/* ============================================================
   DANGOTE VMS — Host / Staff Portal
   Fresh brand per spec: navy chrome, blue primary, teal accent,
   Inter + tabular numerals, status-color vocabulary.
   ============================================================ */

:root {
  /* Brand */
  --brand-900: #0A2540;
  --brand-800: #0C2E4F;
  --brand-700: #103A66;
  --brand-600: #14528F;
  --brand-500: #1E6FD9;
  --brand-400: #4A8CE3;
  --brand-300: #6FA8E6;
  --brand-100: #DCEAFB;
  --accent:    #00B5AD;
  --accent-dim:#0E9089;

  /* Status vocabulary */
  --invited:  #64748B;  /* grey  */
  --registered:#2563EB; /* blue  */
  --onsite:   #16A34A;  /* green */
  --review:   #F59E0B;  /* amber */
  --expired:  #DC2626;  /* red   */
  --checkedout:#475569; /* slate */
  --success:  #16A34A;
  --warning:  #F59E0B;
  --danger:   #DC2626;
  --info:     #2563EB;

  /* Neutrals (slate) */
  --slate-950:#020617;
  --slate-900:#0F172A;
  --slate-800:#1E293B;
  --slate-700:#334155;
  --slate-600:#475569;
  --slate-500:#64748B;
  --slate-400:#94A3B8;
  --slate-300:#CBD5E1;
  --slate-200:#E2E8F0;
  --slate-100:#F1F5F9;
  --slate-50: #F8FAFC;

  /* ----- semantic (LIGHT content, the default) ----- */
  --page:        #EEF2F7;
  --surface:     #FFFFFF;
  --surface-2:   #F8FAFC;
  --surface-3:   #F1F5F9;
  --border:      #E2E8F0;
  --border-2:    #CBD5E1;
  --fg:          #0F172A;
  --fg-2:        #334155;
  --fg-3:        #64748B;
  --fg-muted:    #94A3B8;
  --ring:        rgba(30,111,217,0.35);
  --shadow-sm:   0 1px 2px rgba(15,23,42,0.06), 0 1px 1px rgba(15,23,42,0.04);
  --shadow:      0 1px 3px rgba(15,23,42,0.08), 0 4px 12px rgba(15,23,42,0.05);
  --shadow-lg:   0 12px 32px rgba(15,23,42,0.14), 0 2px 8px rgba(15,23,42,0.08);
  --shadow-xl:   0 24px 60px rgba(7,18,38,0.30);

  /* chrome is always navy */
  --side-bg:     var(--brand-900);
  --side-fg:     #C7D6E8;
  --side-fg-dim: #6E89A8;
  --side-hover:  rgba(255,255,255,0.06);
  --side-active: var(--brand-700);
  --side-border: rgba(255,255,255,0.07);

  /* type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-xs: 5px;
  --r-sm: 7px;
  --r:    9px;
  --r-lg: 13px;
  --r-xl: 18px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-theme="dark"] {
  --page:        #070D17;
  --surface:     #0F1A2B;
  --surface-2:   #132238;
  --surface-3:   #18293F;
  --border:      #1E2F47;
  --border-2:    #284064;
  --fg:          #E6EDF6;
  --fg-2:        #AFC0D6;
  --fg-3:        #7E93AD;
  --fg-muted:    #5E748F;
  --ring:        rgba(74,140,227,0.45);
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
  --shadow:      0 2px 8px rgba(0,0,0,0.45);
  --shadow-lg:   0 16px 40px rgba(0,0,0,0.55);
  --shadow-xl:   0 28px 70px rgba(0,0,0,0.7);
  --side-bg:     #060B14;
  --side-fg:     #B7C8DE;
  --side-fg-dim: #5E748F;
  --side-active: #11233B;
  --side-border: rgba(255,255,255,0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ----- focus ----- */
:focus-visible { outline: none; }
.focusable:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  box-shadow: 0 0 0 3px var(--ring);
  border-color: var(--brand-500);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--font);
  font-size: 14px; font-weight: 600; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .14s var(--ease), border-color .14s var(--ease), transform .1s var(--ease), box-shadow .14s var(--ease), color .14s var(--ease);
  user-select: none;
}
.btn:active { transform: scale(0.975); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand-500); color: #fff; box-shadow: 0 1px 2px rgba(30,111,217,0.4), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: var(--surface); color: var(--fg-2); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-3); border-color: var(--slate-400); }
.btn-ghost { background: transparent; color: var(--fg-3); }
.btn-ghost:hover { background: var(--surface-3); color: var(--fg); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(220,38,38,0.4); }
.btn-danger:hover { background: rgba(220,38,38,0.08); border-color: var(--danger); }
.btn-accent { background: var(--accent); color: #04201E; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); }
.btn-accent:hover { background: var(--accent-dim); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 13px; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-icon { padding: 8px; border-radius: var(--r-sm); }
.btn-icon svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* ============================================================
   FORM FIELDS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 13px; font-weight: 600; color: var(--fg-2); letter-spacing: 0.005em; }
.label .req { color: var(--danger); margin-left: 2px; }
.help { font-size: 12px; color: var(--fg-muted); }
.input, .textarea, .select-native {
  font-family: var(--font); font-size: 14px; color: var(--fg);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); padding: 11px 13px; width: 100%;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease), background .14s;
}
.input::placeholder, .textarea::placeholder { color: var(--fg-muted); }
.input:hover, .textarea:hover, .select-native:hover { border-color: var(--slate-400); }
.input:focus, .textarea:focus, .select-native:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--ring); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .lead-icon { position: absolute; left: 12px; color: var(--fg-muted); pointer-events: none; display: flex; }
.input-wrap .lead-icon svg { width: 17px; height: 17px; }
.input-wrap .input { padding-left: 40px; }
.field.invalid .input, .field.invalid .select-native, .field.invalid .textarea { border-color: var(--danger); }
.field.invalid .input:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.18); }
.err-text { font-size: 12px; color: var(--danger); display: flex; align-items: center; gap: 5px; }
.err-text svg { width: 14px; height: 14px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 5px 10px 5px 9px; border-radius: var(--r-pill);
  border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; flex: 0 0 auto; }
.badge-invited    { color: var(--invited);    background: rgba(100,116,139,0.12); border-color: rgba(100,116,139,0.22); }
.badge-registered { color: var(--registered); background: rgba(37,99,235,0.10);   border-color: rgba(37,99,235,0.22); }
.badge-onsite     { color: var(--onsite);     background: rgba(22,163,74,0.12);   border-color: rgba(22,163,74,0.24); }
.badge-review     { color: #B45309;           background: rgba(245,158,11,0.14);  border-color: rgba(245,158,11,0.30); }
.badge-expired    { color: var(--expired);    background: rgba(220,38,38,0.10);   border-color: rgba(220,38,38,0.22); }
.badge-checkedout { color: var(--checkedout); background: rgba(71,85,105,0.10);   border-color: rgba(71,85,105,0.20); }
[data-theme="dark"] .badge-review { color: #FBBF24; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500;
  padding: 5px 11px; border-radius: var(--r-pill); background: var(--surface-3);
  color: var(--fg-2); border: 1px solid var(--border);
}

/* ============================================================
   CARD / PANEL
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 15px; font-weight: 700; color: var(--fg); letter-spacing: -0.01em; }
.panel-sub { font-size: 12.5px; color: var(--fg-3); margin-top: 2px; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-muted);
}

/* ============================================================
   STAT TILE
   ============================================================ */
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 18px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; }
.stat-ico svg { width: 18px; height: 18px; }
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--fg-3); }
.stat-value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 600; color: var(--fg); letter-spacing: -0.02em; line-height: 1; margin-top: 14px; }
.stat-meta { font-size: 12px; color: var(--fg-muted); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.stat-meta svg { width: 14px; height: 14px; }

/* ============================================================
   TABLE
   ============================================================ */
.tbl-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted);
  padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--surface-2); position: sticky; top: 0; z-index: 1;
}
.tbl thead th.sortable { cursor: pointer; user-select: none; }
.tbl thead th.sortable:hover { color: var(--fg-3); }
.tbl thead th .th-in { display: inline-flex; align-items: center; gap: 5px; }
.tbl thead th svg { width: 13px; height: 13px; opacity: 0.7; }
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--fg-2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s var(--ease); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--surface-3); }
.tbl tbody tr:last-child td { border-bottom: none; }
.density-compact .tbl tbody td { padding: 8px 16px; }
.density-compact .tbl thead th { padding: 8px 16px; }
.cell-name { font-weight: 600; color: var(--fg); }
.cell-sub { font-size: 12px; color: var(--fg-muted); margin-top: 1px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity .12s; }
.tbl tbody tr:hover .row-actions { opacity: 1; }
.icon-btn { background: transparent; border: none; color: var(--fg-muted); padding: 6px; border-radius: var(--r-xs); cursor: pointer; display: inline-flex; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--surface); color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--danger); background: rgba(220,38,38,0.08); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar { border-radius: 999px; display: grid; place-items: center; font-weight: 600; color: #fff; flex: 0 0 auto; overflow: hidden; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-md { width: 38px; height: 38px; font-size: 14px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 36px); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 15px;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 3px;
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  animation: toast-in .26s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateX(16px) scale(.98); } to { opacity: 1; transform: none; } }
.toast.out { animation: toast-out .22s var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
.toast-ico { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; margin-top: 1px; }
.toast-ico svg { width: 19px; height: 19px; }
.toast-title { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.toast-msg { font-size: 12.5px; color: var(--fg-3); margin-top: 2px; line-height: 1.45; }
.toast-success { border-left-color: var(--success); } .toast-success .toast-ico { color: var(--success); }
.toast-info    { border-left-color: var(--info); }    .toast-info .toast-ico { color: var(--info); }
.toast-error   { border-left-color: var(--danger); }  .toast-error .toast-ico { color: var(--danger); }
.toast-warn    { border-left-color: var(--warning); } .toast-warn .toast-ico { color: var(--warning); }

/* ============================================================
   DRAWER / MODAL
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(7,18,38,0.55); z-index: 150; backdrop-filter: blur(2px); animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 480px; max-width: 94vw;
  background: var(--page); border-left: 1px solid var(--border); z-index: 151;
  box-shadow: var(--shadow-xl); display: flex; flex-direction: column;
  animation: drawer-in .28s var(--ease);
}
@keyframes drawer-in { from { transform: translateX(36px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--border); background: var(--surface); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 4px; }
.tl-item { position: relative; padding: 0 0 22px 30px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -4px; width: 2px; background: var(--border-2); }
.tl-item:last-child::before { display: none; }
.tl-node { position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 999px; background: var(--surface); border: 2px solid var(--border-2); display: grid; place-items: center; }
.tl-node.done { background: var(--onsite); border-color: var(--onsite); }
.tl-node.done svg { width: 9px; height: 9px; color: #fff; }
.tl-node.active { border-color: var(--brand-500); background: var(--brand-500); box-shadow: 0 0 0 4px var(--ring); }
.tl-node.pending { border-style: dashed; }
.tl-title { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.tl-pending .tl-title { color: var(--fg-muted); font-weight: 500; }
.tl-meta { font-family: var(--mono); font-size: 11.5px; color: var(--fg-muted); margin-top: 2px; }

/* ============================================================
   STEPPER (segmented)
   ============================================================ */
.stepper { display: flex; align-items: center; gap: 8px; }
.step-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--border-2); transition: all .2s var(--ease); }
.step-dot.on { background: var(--brand-500); }
.step-dot.done { background: var(--accent); }
.step-line { flex: 1; height: 2px; background: var(--border-2); border-radius: 2px; }
.step-line.done { background: var(--accent); }

/* ============================================================
   QR PANEL
   ============================================================ */
.qr-panel { display: inline-flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.qr-grid { display: grid; background: #fff; }
.qr-grid .qb { background: #0A2540; }
.qr-cap { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: #475569; text-transform: uppercase; }

/* ============================================================
   MISC
   ============================================================ */
.divider { height: 1px; background: var(--border); border: none; margin: 0; }
.muted { color: var(--fg-muted); }
.fg3 { color: var(--fg-3); }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-xs); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px; gap: 6px; }
.empty-ico { width: 52px; height: 52px; border-radius: var(--r-lg); background: var(--surface-3); display: grid; place-items: center; color: var(--fg-muted); margin-bottom: 6px; }
.empty-ico svg { width: 24px; height: 24px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--fg-2); }
.empty-sub { font-size: 13px; color: var(--fg-muted); max-width: 280px; }

.fade-in { animation: fade .3s var(--ease); }
.lock-tip { position: relative; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
