/* ============================================================
   SYMBINARY v2 – Design System (concept chapter O)
   Navy/blue trust aesthetic · light + dark mode
   ============================================================ */

:root {
  --brand-900: #0B1B3A;
  --brand-700: #12295C;
  --brand-600: #1E5BFF;
  --brand-500: #3D74FF;
  --brand-300: #7FA8FF;
  --success:   #12B76A;
  --warn:      #F79009;
  --danger:    #F04438;
  --danger-dark: #B42318;

  --bg:        #F7F9FC;
  --surface:   #FFFFFF;
  --surface-2: #EEF2F8;
  --text:      #0B1B3A;
  --text-2:    #5A6B8C;
  --border:    #DDE4F0;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 4px 24px rgba(11, 27, 58, .07);
  --font:      'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0A0F1C;
    --surface:   #111A2E;
    --surface-2: #1A2540;
    --text:      #EAF0FA;
    --text-2:    #8FA0C0;
    --border:    #24304D;
    --shadow:    0 4px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */
.topbar {
  background: var(--brand-900);
  color: #fff;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;            /* many admin items: wrap instead of clipping */
  gap: 8px 18px;
  min-height: 60px;           /* grows with a second row – never cuts items off */
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .logo { font-weight: 800; font-size: 19px; letter-spacing: .04em; color: #fff; white-space: nowrap; }
.topbar .logo span { color: var(--brand-300); }
.topbar nav { display: flex; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
.topbar nav a {
  color: #C6D4F2; padding: 7px 11px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.topbar .user { color: #C6D4F2; font-size: 13px; white-space: nowrap; margin-left: auto; }

@media (max-width: 720px) {
  .topbar { padding: 8px 12px; gap: 6px 10px; }
  .topbar nav { order: 3; flex-basis: 100%; }   /* menu gets its own full row on phones */
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
.page-title { font-size: 26px; font-weight: 750; margin-bottom: 4px; }
.page-sub { color: var(--text-2); font-size: 14px; margin-bottom: 26px; }

/* ── Cards / grid ───────────────────────────────────────── */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card h2 { font-size: 16px; font-weight: 650; margin-bottom: 14px; }
.stat .num { font-size: 30px; font-weight: 800; }
.stat .lbl { color: var(--text-2); font-size: 13px; margin-top: 2px; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; color: var(--text-2); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--surface-2); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
}
.badge.green  { background: rgba(18,183,106,.14); color: var(--success); }
.badge.yellow { background: rgba(247,144,9,.14);  color: var(--warn); }
.badge.orange { background: rgba(247,144,9,.22);  color: #D96C00; }
.badge.red    { background: rgba(240,68,56,.14);  color: var(--danger); }
.badge.blue   { background: rgba(30,91,255,.12);  color: var(--brand-600); }
.badge.gray   { background: var(--surface-2);     color: var(--text-2); }

/* ── Forms / buttons ────────────────────────────────────── */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
input[type=text], input[type=password], input[type=number], input[type=email],
select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-500); outline-offset: 0; border-color: var(--brand-500);
}
textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-block; padding: 10px 20px; border: 0; cursor: pointer;
  border-radius: var(--radius-sm); font: inherit; font-size: 14px; font-weight: 650;
  background: var(--brand-600); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--brand-500); text-decoration: none; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 13px; font-size: 13px; }

.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px;
}
.alert.error { background: rgba(240,68,56,.1); color: var(--danger-dark); border: 1px solid rgba(240,68,56,.3); }
.alert.ok    { background: rgba(18,183,106,.1); color: var(--success); border: 1px solid rgba(18,183,106,.3); }

/* ── Login ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--brand-900) 0%, var(--brand-700) 60%, #0E2B6E 100%);
  padding: 20px;
}
.login-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 400px; padding: 38px 34px;
}
.login-card .logo { font-size: 24px; font-weight: 800; letter-spacing: .04em; margin-bottom: 4px; }
.login-card .logo span { color: var(--brand-600); }

/* ── Consumer verify page ───────────────────────────────── */
.verify-page { max-width: 560px; margin: 0 auto; padding: 24px 18px 80px; }
.verify-brand { text-align: center; padding: 18px 0 26px; font-weight: 800; font-size: 20px; letter-spacing: .05em; }
.verify-brand span { color: var(--brand-600); }

.status-hero {
  border-radius: var(--radius); padding: 30px 24px; text-align: center;
  color: #fff; margin-bottom: 22px;
}
.status-hero.green  { background: linear-gradient(150deg, #0E9355, var(--success)); }
.status-hero.yellow { background: linear-gradient(150deg, #C87100, var(--warn)); }
.status-hero.orange { background: linear-gradient(150deg, #B45309, #EA7B10); }
.status-hero.red    { background: linear-gradient(150deg, #98241B, var(--danger)); }
.status-hero.gray   { background: linear-gradient(150deg, #33415E, #5A6B8C); }
.status-hero .icon { font-size: 44px; }
.status-hero h1 { font-size: 21px; margin: 10px 0 6px; }
.status-hero p { font-size: 14px; opacity: .92; }

.product-images { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 16px; }
.product-images img {
  height: 150px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  object-fit: cover;
}

/* ── AI chat ────────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.chat .msg { max-width: 85%; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.chat .msg.user { align-self: flex-end; background: var(--brand-600); color: #fff; border-bottom-right-radius: 4px; }
.chat .msg.ai   { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; white-space: pre-wrap; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input { flex: 1; }
.chat-quota { font-size: 12px; color: var(--text-2); text-align: right; margin-top: 6px; }

/* ── Misc ───────────────────────────────────────────────── */
.pager { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-size: 14px; }
code.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px;
  background: var(--surface-2); padding: 2px 7px; border-radius: 5px; }
.muted { color: var(--text-2); }
.mt { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
details.panel { margin-top: 10px; }
details.panel summary { cursor: pointer; font-weight: 650; font-size: 14px; padding: 6px 0; }
