/* ============================================================
   LOTRI ADMIN — Design System
   Brand DNA from Lotri Ayiti (cobalt ink, electric gold, hot
   magenta) re-tuned for a dense, professional operations tool.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Brand constants */
  --ink:        #0B1437;
  --ink-2:      #131F4F;
  --ink-3:      #1E2C66;
  --gold:       #FFC93C;
  --gold-2:     #FFB000;
  --magenta:    #E5167B;
  --magenta-2:  #B70D5F;
  --teal:       #00A88C;
  --sky:        #2D6BFF;
  --violet:     #7C5CFF;

  /* Accent (tweakable) */
  --accent:     #FFC93C;
  --accent-ink: #0B1437;

  /* Semantic */
  --good:    #0E9F6E;
  --good-bg: rgba(14,159,110,0.12);
  --bad:     #E0264C;
  --bad-bg:  rgba(224,38,76,0.10);
  --warn:    #E8920C;
  --warn-bg: rgba(232,146,12,0.12);
  --info:    #2D6BFF;
  --info-bg: rgba(45,107,255,0.10);

  /* Type */
  --display: 'Archivo Black', system-ui, sans-serif;
  --sans:    'Space Grotesk', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 9px;
  --r:    13px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Density (tweakable) — comfortable default */
  --pad: 20px;
  --row-pad: 13px;
  --gap: 18px;

  /* ——— LIGHT THEME (default) ——— */
  --bg:        #F4F5F9;
  --bg-2:      #ECEEF4;
  --surface:   #FFFFFF;
  --surface-2: #FAFBFD;
  --sidebar:   #0B1437;
  --sidebar-fg: #FFF8EC;
  --line:      #E4E7EF;
  --line-2:    #D3D8E4;
  --text:      #0E1734;
  --text-2:    #5A6786;
  --text-3:    #8A95B0;
  --shadow-1:  0 1px 2px rgba(11,20,55,0.05), 0 1px 3px rgba(11,20,55,0.06);
  --shadow-2:  0 4px 12px rgba(11,20,55,0.08), 0 2px 4px rgba(11,20,55,0.04);
  --shadow-3:  0 20px 48px rgba(11,20,55,0.18);
}

[data-theme="dark"] {
  --bg:        #070C20;
  --bg-2:      #0B1330;
  --surface:   #0F1838;
  --surface-2: #131F47;
  --sidebar:   #060A1C;
  --sidebar-fg: #EAEEFB;
  --line:      rgba(255,255,255,0.08);
  --line-2:    rgba(255,255,255,0.14);
  --text:      #EAEEFB;
  --text-2:    #9AA6C8;
  --text-3:    #6B779C;
  --shadow-1:  0 1px 2px rgba(0,0,0,0.4);
  --shadow-2:  0 6px 18px rgba(0,0,0,0.45);
  --shadow-3:  0 24px 56px rgba(0,0,0,0.6);
  --good-bg: rgba(14,159,110,0.18);
  --bad-bg:  rgba(224,38,76,0.18);
  --warn-bg: rgba(232,146,12,0.18);
  --info-bg: rgba(45,107,255,0.18);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "tnum", "cv01";
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============ APP SHELL ============ */
.app {
  display: grid;
  grid-template-columns: var(--sb-w, 256px) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.22s cubic-bezier(.4,0,.2,1);
}
.app.collapsed { --sb-w: 76px; }

/* ——— Sidebar ——— */
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.sb-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  height: 65px;
  flex-shrink: 0;
}
.sb-mark {
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--gold);
  color: var(--ink);
  border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-size: 21px;
  transform: rotate(-6deg);
  box-shadow: 2px 2px 0 var(--magenta);
}
.sb-brand-txt { line-height: 1; overflow: hidden; white-space: nowrap; }
.sb-brand-txt .nm {
  font-family: var(--display); font-size: 19px; letter-spacing: 0.5px;
  display: flex; align-items: baseline; gap: 7px;
}
.sb-brand-txt .nm b { color: var(--gold); }
.sb-brand-txt small {
  display: block; font-size: 9px; font-weight: 600; letter-spacing: 2.5px;
  color: rgba(255,248,236,0.45); margin-top: 5px; text-transform: uppercase;
}
.collapsed .sb-brand-txt { opacity: 0; pointer-events: none; }

.sb-scroll { flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
.sb-scroll::-webkit-scrollbar { width: 5px; }
.sb-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 3px; }

.sb-sec-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 2px;
  color: rgba(255,248,236,0.36); font-weight: 700;
  padding: 16px 12px 7px; white-space: nowrap;
}
.collapsed .sb-sec-label { opacity: 0; height: 14px; padding: 8px 0; text-align: center; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin-bottom: 1px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  color: rgba(255,248,236,0.74);
  width: 100%; text-align: left;
  position: relative;
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--sidebar-fg); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav-item.active .nav-ic { color: var(--accent-ink); }
.nav-ic { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.92; }
.nav-item .lbl { flex: 1; overflow: hidden; }
.collapsed .nav-item { justify-content: center; padding: 11px; }
.collapsed .nav-item .lbl, .collapsed .nav-item .nav-badge { display: none; }
.nav-badge {
  margin-left: auto; background: var(--magenta); color: #fff;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: grid; place-items: center;
}
.nav-item.active .nav-badge { background: var(--ink); color: var(--gold); }

.sb-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,0.07); flex-shrink: 0; }
.sb-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-ava {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--magenta); color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 14px;
}
.sb-user .meta { min-width: 0; flex: 1; overflow: hidden; }
.sb-user .meta .n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .meta .r { font-size: 10.5px; color: rgba(255,248,236,0.5); font-family: var(--mono); white-space: nowrap; }
.collapsed .sb-user .meta, .collapsed .sb-foot .ic { display: none; }
.collapsed .sb-foot { display: flex; justify-content: center; }

/* ——— Main / Topbar ——— */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 65px; flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.tb-toggle { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); transition: background 0.14s; }
.tb-toggle:hover { background: var(--bg-2); color: var(--text); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.crumb b { color: var(--text); font-weight: 600; }
.tb-spacer { flex: 1; }

.tb-search {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-2); border: 1px solid transparent;
  border-radius: 10px; padding: 0 13px; height: 40px; width: 280px;
  color: var(--text-3); transition: border-color 0.14s, background 0.14s;
}
.tb-search:focus-within { border-color: var(--accent); background: var(--surface); }
.tb-search input { border: none; background: none; outline: none; flex: 1; font-size: 13.5px; color: var(--text); }
.tb-search kbd {
  font-family: var(--mono); font-size: 10px; padding: 2px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 5px; color: var(--text-3);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; position: relative;
  color: var(--text-2); transition: background 0.14s, color 0.14s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 9px; right: 10px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--magenta); border: 2px solid var(--surface);
}
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bad-bg); color: var(--bad);
  padding: 7px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }

/* ——— Page content ——— */
.page { padding: 26px; max-width: 1480px; width: 100%; margin: 0 auto; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { font-family: var(--display); font-size: 30px; letter-spacing: -0.5px; line-height: 1; margin: 0; }
.page-sub { font-size: 13.5px; color: var(--text-2); margin: 9px 0 0; }
.page-actions { display: flex; align-items: center; gap: 9px; }

/* ============ COMPONENTS ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: var(--pad); }
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: var(--pad) var(--pad) 0;
}
.card-h h3 { font-size: 14px; font-weight: 700; margin: 0; letter-spacing: -0.1px; }
.card-h .sub { font-size: 12px; color: var(--text-3); }
.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 1.6px; font-weight: 700; color: var(--text-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; height: 40px; border-radius: 10px;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.07s, background 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.btn-primary { background: var(--ink); color: #FFF8EC; }
.btn-primary:hover { background: var(--ink-2); }
[data-theme="dark"] .btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(0.96); }
.btn-magenta { background: var(--magenta); color: #fff; }
.btn-magenta:hover { background: var(--magenta-2); }
.btn-ghost { background: var(--bg-2); color: var(--text); }
.btn-ghost:hover { background: var(--line); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--text-3); background: var(--bg-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--bg-2); color: var(--text-2);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2px;
}
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.bad  { background: var(--bad-bg);  color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted{ background: var(--bg-2);    color: var(--text-3); }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Tabs */
.tabs { display: inline-flex; gap: 3px; background: var(--bg-2); padding: 4px; border-radius: 11px; }
.tabs button {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); transition: all 0.14s; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* Field */
.field {
  width: 100%; height: 40px; padding: 0 13px;
  background: var(--surface); border: 1.5px solid var(--line-2);
  border-radius: 10px; font-size: 13.5px; font-weight: 500; outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea.field { height: auto; padding: 10px 13px; resize: vertical; line-height: 1.5; }
select.field { cursor: pointer; }
.field-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-bottom: 7px; color: var(--text-2); }

/* Table */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left; padding: 12px 16px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
  color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
.tbl thead th.num, .tbl tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody td { padding: var(--row-pad) 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background 0.1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .u-strong { font-weight: 600; }
.tbl .u-mono { font-family: var(--mono); font-size: 12.5px; }
.tbl .u-link { color: var(--sky); font-weight: 600; cursor: pointer; }
.tbl .u-link:hover { text-decoration: underline; }

.avatar-sm {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--display); font-size: 12px; color: #fff;
}

/* Progress / meter */
.meter { height: 7px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; transition: width 0.5s cubic-bezier(.2,1,.4,1); }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(11,20,55,0.5);
  backdrop-filter: blur(4px); z-index: 100;
  display: grid; place-items: center; padding: 24px;
  animation: fadeIn 0.18s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-3);
  animation: modalIn 0.24s cubic-bezier(.2,1,.4,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-h { padding: 22px 24px 0; }
.modal-h h2 { font-family: var(--display); font-size: 21px; margin: 0; letter-spacing: -0.3px; }
.modal-h p { font-size: 13px; color: var(--text-2); margin: 8px 0 0; line-height: 1.5; }
.modal-b { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-f { padding: 0 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }

/* Toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #FFF8EC; padding: 13px 18px; border-radius: 12px;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-3);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s cubic-bezier(.2,1,.4,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Number tile (brand element) */
.num-tile {
  width: 42px; height: 48px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 24px;
  background: var(--ink); color: var(--gold);
  border: 2px solid var(--ink);
}
.num-tile.alt { background: var(--gold); color: var(--ink); }
.num-tile.mag { background: var(--magenta); color: #fff; border-color: var(--magenta); }
.num-tile.sm { width: 32px; height: 38px; font-size: 18px; }

/* Source flag */
.src-flag {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px; font-family: var(--display); color: #fff;
}
.src-flag.ny { background: #FF6F1F; }
.src-flag.fl { background: #00A88C; }

/* Mono number pill (fits multi-digit numbers cleanly) */
.numpill {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 8px;
  padding: 4px 11px; letter-spacing: 1px; font-variant-numeric: tabular-nums;
}

/* Digit-tile row — one tile per digit so numbers never overflow */
.dtiles { display: flex; gap: 4px; flex-wrap: wrap; }

/* Verification screenshot capture (faux scraped evidence) */
.vstep { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; color: var(--text-3); display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.vstep b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 10px; }
.shot { border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--ink); box-shadow: var(--shadow-1); }
.shot-bar { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #060A1C; border-bottom: 1px solid rgba(255,255,255,0.08); }
.shot-bar .dots { display: flex; gap: 4px; }
.shot-bar .dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.shot-url { font-family: var(--mono); font-size: 10px; color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.07); padding: 3px 9px; border-radius: 5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-body { padding: 14px 14px 18px; color: #FFF8EC; text-align: center; position: relative; }
.shot-game { font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.balls { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.ball { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #0B1437; display: grid; place-items: center; font-family: var(--display); font-size: 21px; box-shadow: inset 0 -3px 7px rgba(0,0,0,0.18); }
.shot-cap { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 11px; }
.shot-stamp { position: absolute; bottom: 6px; right: 9px; font-family: var(--mono); font-size: 8.5px; color: rgba(255,255,255,0.35); }
/* Admin verification input */
.ventry { display: flex; align-items: center; gap: 12px; }
.ventry .vlabel { width: 58px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-2); flex-shrink: 0; }
.vinput { flex: 1; max-width: 160px; height: 42px; font-family: var(--mono); font-size: 18px; font-weight: 700; letter-spacing: 6px; text-align: center; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 10px; outline: none; transition: border-color 0.14s, box-shadow 0.14s; }
.vinput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.vinput.match { border-color: var(--good); }
.vinput.diff { border-color: var(--bad); }

/* Grids */
.grid { display: grid; gap: var(--gap); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .g-4, .g-3, .g-2 { grid-template-columns: 1fr; } }

/* KPI card */
.kpi { position: relative; overflow: hidden; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 600; margin-top: 14px; }
.kpi-val { font-family: var(--display); font-size: 32px; letter-spacing: -1px; line-height: 1.05; margin-top: 5px; }
.kpi-val small { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; margin-top: 9px; }
.kpi-delta.up { color: var(--good); }
.kpi-delta.down { color: var(--bad); }
.kpi-spark { position: absolute; bottom: 0; left: 0; right: 0; height: 38px; opacity: 0.5; }

/* List rows (status etc.) */
.row-list { display: flex; flex-direction: column; }
.row-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-list > div:last-child { border-bottom: none; }
.row-list .k { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 9px; }
.row-list .v { font-weight: 600; font-family: var(--mono); font-size: 13px; }

/* Utility */
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.stack { display: flex; flex-direction: column; }
.flex { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.pos { color: var(--good); } .neg { color: var(--bad); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ===== Lotri.Admin app-specific additions (NOT from the design handoff) =====
   Keep handoff-ported rules above this line so a future re-sync stays clean. */
.sb-signin {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 9px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--sidebar-fg);
  background: rgba(255,255,255,0.06);
}
.sb-signin:hover { background: rgba(255,255,255,0.12); }

/* Page background must fill the full content height + the browser canvas, not
   just one viewport. The handoff's `html, body { height: 100% }` (sized for its
   React #root) CLAMPS the painted area to 100vh in Blazor, so on tall pages the
   white <html> canvas shows through below and to the right of the content.
   Paint the canvas in the theme bg and let body grow with content. */
html { background: var(--bg); }
html, body { height: auto; min-height: 100vh; }

/* Flexbox overflow fix: without min-height:0 the nav list grows past the
   viewport and pushes the sidebar footer (the user / sign-in / sign-out
   widget) off-screen on short windows. min-height:0 lets .sb-scroll actually
   scroll internally so the footer stays pinned and visible. */
.sb-scroll { min-height: 0; }

/* Grid-item overflow fix: grid children default to min-width:auto and won't
   shrink below their content's intrinsic width, so a wide card (e.g. the big
   "Next drawing" display text) forces its track past the container and the row
   overflows / is cut off on the right. min-width:0 lets the items shrink and
   their content wrap. (Wide tables already scroll inside .tbl-wrap.) */
.grid > * { min-width: 0; }

/* Page width matches the standalone handoff exactly (1480px, centred). The base
   rule already sets this; the earlier "white gutter" complaint was a stale
   bootstrap body{background:#fff} render, not a width problem, so we do NOT
   widen past the design here. */

/* Horizontal-overflow guard: clip (not scroll) any accidental spill so a wide
   child can never push the page sideways and cut off the right edge / the
   topbar's right-hand controls. `clip` (vs hidden/auto) does NOT create a
   scroll container, so the sticky topbar + sticky sidebar keep working. */
.app { overflow-x: clip; }
.main { overflow-x: clip; }

/* Topbar must shrink gracefully: the search is the only elastic element, so
   give it a flex-basis it can shrink BELOW (min-width:0) instead of a hard
   280px that shoves the theme/bell/sign-out buttons off the right edge on
   tighter viewports or at browser zoom. The right-side controls stay visible. */
.tb-search-wrap { flex: 0 1 280px; min-width: 0; }
.tb-search { width: 100%; min-width: 120px; }
.tb-search input { min-width: 0; }
/* On tight widths drop the non-essential chrome before anything clips. */
@media (max-width: 1180px) {
  .live-pill { display: none; }
  .tb-search kbd { display: none; }
}
@media (max-width: 920px) {
  .crumb { display: none; }
  .tb-search-wrap { flex: 0 1 200px; }
}

/* Detail / stat tile grid (auto-fit) — used by Player/Banker detail pages. */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gap); }

/* Filter bar — the standard list-page controls row, design-token styled. */
.filter-bar {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: var(--shadow-1); margin-bottom: 18px;
}
.filter-bar .fgroup { display: flex; flex-direction: column; }
.filter-bar .field-label { margin-bottom: 6px; }
.filter-bar .field { min-width: 168px; }
.filter-bar .grow { flex: 1; }

/* Toggle pill switch (booleans on Settings, etc.). */
.toggle { position: relative; width: 44px; height: 25px; border-radius: 999px; background: var(--line-2); transition: background 0.16s; flex-shrink: 0; }
.toggle.on { background: var(--good); }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: left 0.16s; }
.toggle.on .knob { left: 22px; }
.toggle[disabled] { opacity: 0.5; cursor: not-allowed; }

/* MutationDialog → design modal. The form-control styling here lets every
   existing dialog page adopt the look before its individual reskin. */
.modal.modal-wide { max-width: 640px; }
.modal-h.modal-h-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-x { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); background: none; }
.modal-x:hover { background: var(--bg-2); color: var(--text); }
.modal-b label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; }
.modal-b label > span { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-2); }
.modal-b input[type="text"], .modal-b input[type="number"], .modal-b input[type="email"],
.modal-b input[type="url"], .modal-b input[type="time"], .modal-b input[type="password"],
.modal-b select, .modal-b textarea {
  width: 100%; height: 40px; padding: 0 13px; background: var(--surface);
  border: 1.5px solid var(--line-2); border-radius: 10px; font-size: 13.5px; font-weight: 500;
  outline: none; color: var(--text); font-family: inherit;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.modal-b textarea { height: auto; min-height: 84px; padding: 10px 13px; resize: vertical; line-height: 1.5; }
.modal-b input:focus, .modal-b select:focus, .modal-b textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.modal-b .field-error { color: var(--bad); font-size: 12px; margin-top: -2px; }

/* Auth pages (Login / 2FA) — branded form inside the AuthLayout card. */
.auth-form { display: flex; flex-direction: column; }
.auth-title { font-family: var(--display); font-size: 23px; letter-spacing: -0.3px; margin: 0 0 5px; }
.auth-sub { font-size: 13px; color: var(--text-2); margin: 0 0 18px; line-height: 1.5; }
.auth-fields { display: flex; flex-direction: column; gap: 14px; }
.auth-fields .fgroup { display: flex; flex-direction: column; }
.auth-fields .field-label { margin-bottom: 6px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-msg { margin: 14px 0 0; padding: 10px 13px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.auth-msg.is-error { background: var(--bad-bg); color: var(--bad); }
.auth-msg.is-success { background: var(--good-bg); color: var(--good); }
.auth-link { margin: 16px 0 0; font-size: 13px; }
.auth-link a { color: var(--sky); font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }

/* Bootstrap utility shims still referenced by framework/error pages
   (Error.razor) now that bootstrap.min.css is no longer loaded. */
.text-danger { color: var(--bad); }
.btn-link { background: none; color: var(--sky); font-weight: 600; padding: 0; height: auto; }
.btn-link:hover { text-decoration: underline; }

/* Topbar global search + notifications dropdowns. Anchored to the search /
   bell wrappers so the absolutely-positioned panels sit under their trigger.
   Token-themed (surface / line / shadow-2) so light + dark both read well. */
.tb-search-wrap { position: relative; }
.tb-bell-wrap { position: relative; display: inline-flex; }

.tb-spin {
  width: 14px; height: 14px; flex-shrink: 0;
  border: 2px solid var(--line-2); border-top-color: var(--accent);
  border-radius: 50%; animation: tb-spin 0.7s linear infinite;
}
@keyframes tb-spin { to { transform: rotate(360deg); } }

.tb-dropdown {
  position: absolute; top: calc(100% + 8px); z-index: 60;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-2);
  padding: 6px; overflow: hidden auto;
  max-height: min(70vh, 460px);
}
.tb-search-dropdown { left: 0; right: 0; min-width: 280px; }
.tb-bell-dropdown { right: 0; width: 340px; }

.tb-dd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 9px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-2);
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.tb-dd-link { font-size: 11px; font-weight: 600; color: var(--sky); text-transform: none; letter-spacing: 0; }
.tb-dd-link:hover { text-decoration: underline; }

.tb-dd-section {
  padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-3);
}

.tb-dd-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border-radius: 9px; text-align: left;
  background: none; border: none; cursor: pointer; color: var(--text);
  transition: background 0.12s;
}
.tb-dd-item:hover { background: var(--bg-2); }
.tb-dd-notif { cursor: default; }
.tb-dd-notif:hover { background: var(--surface-2); }

.tb-dd-ic {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg-2); color: var(--text-2);
}

.tb-dd-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.tb-dd-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-dd-sub {
  font-size: 11.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tb-dd-empty { padding: 18px 12px; text-align: center; font-size: 13px; color: var(--text-2); }
