/* ============================================================
   Oracle Redwood — A-Team Landing
   Corporate / cross-product (GIU) palette.
   Oracle Red is an accent only, never dominant. No gradients.
   ============================================================ */

@font-face {
  font-family: 'Oracle Sans';
  src: url('/static/fonts/OracleSans_Lt.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Oracle Sans';
  src: url('/static/fonts/OracleSans_Rg.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Oracle Sans';
  src: url('/static/fonts/OracleSans_SBd.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Oracle Sans';
  src: url('/static/fonts/OracleSans_Bd.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Oracle Sans';
  src: url('/static/fonts/OracleSans_XBd.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Redwood corporate palette */
  --neutral-30: #f1efed;
  --slate-150: #3c4545;
  --slate-100: #697778;
  --slate-50: #c2d4d4;
  --oracle-red: #c74634;
  --oracle-red-dark: #a63829;
  --brand-yellow: #f1b13f;

  --ink: #1e2426;
  --ink-soft: #52605f;
  --surface: #ffffff;
  --surface-alt: #f8f7f5;
  --border: #dfdcd8;
  --border-strong: #c9c5bf;
  --shadow: 0 1px 2px rgba(30, 36, 38, 0.06), 0 8px 24px rgba(30, 36, 38, 0.08);
  --shadow-lift: 0 4px 8px rgba(30, 36, 38, 0.08), 0 18px 40px rgba(30, 36, 38, 0.16);
  --radius: 12px;
  --radius-lg: 18px;
  --font: 'Oracle Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--neutral-30);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

a {
  color: var(--oracle-red);
  text-decoration: none;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar .brand img {
  height: 26px;
  width: auto;
  display: block;
}

.topbar .brand .divider {
  width: 1px;
  height: 26px;
  background: var(--border-strong);
}

.topbar .brand .app-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--slate-150);
}

.topbar .actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar .who {
  font-size: 13px;
  color: var(--ink-soft);
}

.topbar .who strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  background: transparent;
  color: var(--ink);
  line-height: 1;
}

.btn-primary {
  background: var(--oracle-red);
  color: #fff;
}
.btn-primary:hover {
  background: var(--oracle-red-dark);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--slate-150);
  background: var(--surface);
}
.btn-ghost:hover {
  border-color: var(--slate-100);
}

.btn-danger {
  border-color: #e2c3bd;
  color: var(--oracle-red-dark);
  background: #fff;
}
.btn-danger:hover {
  background: #fbf1ef;
}

.btn-sm {
  font-size: 13px;
  padding: 7px 14px;
}

/* ---------- Layout shell ---------- */

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

.page-head {
  margin-bottom: 36px;
}

.page-head h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--slate-150);
}

.page-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 60ch;
}

.accent-rule {
  width: 56px;
  height: 4px;
  background: var(--oracle-red);
  border-radius: 2px;
  margin-bottom: 22px;
}

/* ---------- Portal tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 168px;
  padding: 26px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--oracle-red);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}

.tile:hover::before {
  opacity: 1;
}

.tile .tile-top {
  display: flex;
  flex-direction: column;
}

.tile .tile-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--slate-150);
  margin-bottom: 18px;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.tile .tile-badge .icon {
  width: 26px;
  height: 26px;
}

.tile:hover .tile-badge {
  background: var(--oracle-red);
  border-color: var(--oracle-red);
  color: #fff;
}

.tile .tile-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--slate-150);
  letter-spacing: -0.01em;
}

.tile .tile-desc {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.tile .tile-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--oracle-red);
  margin-top: 18px;
}

.tile .tile-go .arrow {
  transition: transform 0.16s ease;
}

.tile:hover .tile-go .arrow {
  transform: translateX(4px);
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(105, 119, 120, 0.35), transparent 60%),
    var(--slate-150);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 40px 36px 34px;
}

.login-card .logo {
  height: 30px;
  width: auto;
  display: block;
  margin-bottom: 28px;
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--slate-150);
}

.login-card .sub {
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------- Forms ---------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-150);
  margin-bottom: 7px;
}

.field input[type='text'],
.field input[type='password'],
.field input[type='url'] {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--slate-100);
  box-shadow: 0 0 0 3px rgba(105, 119, 120, 0.18);
}

.select {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  min-width: 190px;
  cursor: pointer;
}

.select:focus {
  outline: none;
  border-color: var(--slate-100);
  box-shadow: 0 0 0 3px rgba(105, 119, 120, 0.18);
}

.icon-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--slate-150);
  align-self: center;
}

.icon-preview .icon {
  width: 22px;
  height: 22px;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 6px 0 2px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--slate-150);
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--oracle-red);
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-error {
  background: #fbeeeb;
  border: 1px solid #e7c3bb;
  color: var(--oracle-red-dark);
}

.notice {
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-yellow);
  color: var(--slate-150);
}

/* ---------- Admin ---------- */

.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.admin-nav a {
  padding: 10px 4px;
  margin-right: 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}

.admin-nav a:hover {
  color: var(--slate-150);
}

.section {
  margin-bottom: 48px;
  scroll-margin-top: 20px;
}

.section h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--slate-150);
  margin: 0 0 4px;
}

.section .section-sub {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.list {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.row:last-child {
  border-bottom: none;
}

.row form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}

.row .grow {
  flex: 1 1 200px;
}

.row .field-full {
  flex: 1 1 100%;
}

.row .field {
  margin-bottom: 0;
}

.row-add {
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius) var(--radius);
}

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

.mini-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-100);
  margin-bottom: 6px;
}

/* ---------- Footer ---------- */

.foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px 40px;
  color: var(--slate-100);
  font-size: 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .topbar { padding: 16px 20px; }
  .page { padding: 32px 20px 60px; }
  .page-head h1 { font-size: 27px; }
  .foot { padding: 0 20px 32px; }
}
