/* ==========================================================================
   Design system
   1. Tokens          5. Components        9. Admin / KYC / forms
   2. Base            6. Public site      10. Work workspace
   3. Layout          7. App shell        11. Utilities, motion, responsive
   4. Buttons/forms   8. Worker pages
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* colour */
  --navy-950: #070d24;
  --navy-900: #0c1636;
  --navy-800: #13214b;
  --navy-700: #1d2f66;
  --indigo-800: #3730a3;
  --indigo-700: #4338ca;
  --indigo-600: #4f46e5;
  --indigo-200: #c7d2fe;
  --indigo-100: #e0e7ff;
  --indigo-50: #eef2ff;
  --accent: #14b8a6;
  --accent-ink: #0f766e;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --line: #e1e6f1;
  --line-strong: #c9d1e3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5b6577;

  --ok: #05603a;
  --ok-bg: #e3f6ec;
  --ok-line: #a7e0c1;
  --warn: #8a4b00;
  --warn-bg: #fff3d6;
  --warn-line: #f3d48a;
  --danger: #a4211a;
  --danger-bg: #fde8e7;
  --danger-line: #f4b4b0;
  --info: #3730a3;
  --info-bg: #e8ebff;
  --info-line: #c3cbff;
  --neutral-bg: #eceff5;

  /* spacing (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;

  /* shape + depth */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(12, 22, 54, 0.06);
  --shadow: 0 1px 3px rgba(12, 22, 54, 0.06), 0 8px 24px rgba(12, 22, 54, 0.06);
  --shadow-lg: 0 18px 48px rgba(12, 22, 54, 0.18);
  --ring: 0 0 0 3px rgba(79, 70, 229, 0.35);

  /* type */
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --fs-xs: 0.78rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3.25rem;

  --control-h: 44px;
  --sidebar-w: 272px;
  --topbar-h: 64px;

  /* legacy aliases (kept so older markup keeps working) */
  --indigo: var(--indigo-700);
  --indigo-dark: var(--indigo-800);
  --indigo-soft: var(--indigo-100);
  --slate: var(--text-2);
  --ink: var(--text);
  --card: var(--surface);
  --warn-text: var(--warn);
  --sans: var(--font);
}

/* 2. Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[x-cloak], [hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 var(--s-3); letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: var(--fs-xl); font-weight: 750; }
h2 { font-size: var(--fs-md); font-weight: 700; }
h3 { font-size: var(--fs-base); font-weight: 700; }
p { margin: 0 0 var(--s-3); }
a { color: var(--indigo-700); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--indigo-800); }
img, svg { max-width: 100%; }
img { height: auto; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--neutral-bg); border-radius: 6px; padding: 1px 6px; }
.mono, input.mono { font-family: var(--mono); font-size: inherit; }
kbd {
  font-family: var(--mono); font-size: 0.78rem; padding: 2px 6px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 2px; color: var(--text-2);
}
.icon { flex: none; vertical-align: middle; }

:focus-visible { outline: 3px solid var(--indigo-600); outline-offset: 2px; border-radius: 4px; }
.sidebar :focus-visible, .site-footer :focus-visible, .hero :focus-visible, .cta-band :focus-visible { outline-color: var(--indigo-200); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: var(--s-3); top: -100px; z-index: 1000; background: var(--navy-900); color: #fff;
  padding: var(--s-3) var(--s-4); min-height: var(--control-h); border-radius: var(--r-sm); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: var(--s-3); color: #fff; }
main:focus { outline: none; }

/* 3. Layout ----------------------------------------------------------------- */
.container { width: min(1160px, calc(100% - 2 * var(--s-5))); margin-inline: auto; }
.container-narrow { width: min(820px, calc(100% - 2 * var(--s-5))); }
.grid { display: grid; gap: var(--s-4); margin-bottom: var(--s-4); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: 1.2fr 0.8fr; }
.grid-2-eq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: var(--s-5); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.action-row { margin-bottom: var(--s-4); }
.inline { display: inline; }
.muted { color: var(--muted); }
.pre { white-space: pre-wrap; margin: 0; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 4. Buttons + forms --------------------------------------------------------- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--control-h); padding: 0 var(--s-4);
  border-radius: 10px; border: 1px solid transparent;
  background: var(--indigo-700); color: #fff; font: inherit; font-weight: 650; line-height: 1.2;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:hover { background: var(--indigo-800); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--indigo-700); color: #fff; }
.btn-secondary, .btn.secondary { background: var(--surface); color: var(--text-2); border-color: var(--line-strong); }
.btn-secondary:hover, .btn.secondary:hover { background: var(--surface-2); color: var(--text); border-color: #aeb9d3; }
.btn-ghost { background: transparent; color: var(--indigo-700); }
.btn-ghost:hover { background: var(--indigo-50); color: var(--indigo-800); }
.btn-danger, .btn.danger { background: var(--danger); color: #fff; }
.btn-danger:hover, .btn.danger:hover { background: #861a14; color: #fff; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-sm, .btn.small { min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: 8px; }
.btn-lg { min-height: 52px; padding: 0 var(--s-5); font-size: var(--fs-base); border-radius: 12px; }
.btn-block, .btn.wide { width: 100%; }

label { display: block; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); margin: 0 0 6px; }
.field { margin-bottom: var(--s-4); min-width: 0; }
.field > label .optional, .optional { font-weight: 500; color: var(--muted); }
.hint { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: var(--control-h);
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #7b8599; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: #9aa7c4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo-600); box-shadow: var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--neutral-bg); color: var(--muted); cursor: not-allowed; }
input[type="file"] { padding: 9px 10px; background: var(--surface-2); }
input[type="file"]::file-selector-button {
  margin-right: 12px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px;
  padding: 6px 12px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--indigo-700); flex: none; padding: 0; }
.check { display: flex; align-items: center; gap: var(--s-2); font-weight: 600; font-size: var(--fs-sm); min-height: 32px; margin: var(--s-2) 0; cursor: pointer; }
.check input { width: 18px; min-height: 0; }
.input-group { display: flex; align-items: stretch; position: relative; }
.input-group input { flex: 1; min-width: 0; }
.input-addon {
  position: absolute; right: 0; top: 0; bottom: 0; width: var(--control-h); min-height: var(--control-h); border: 0; border-radius: 0 var(--r-sm, 8px) var(--r-sm, 8px) 0;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.input-addon:hover { background: var(--neutral-bg); color: var(--text); }
.input-group:has(.input-addon) input { padding-right: 48px; }
.input-prefix {
  display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-right: 0;
  border-radius: 10px 0 0 10px; background: var(--neutral-bg); color: var(--muted); font-weight: 600;
}
.input-prefix + input { border-radius: 0 10px 10px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-4); }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.form-narrow { max-width: 760px; }
.form-card .subhead { margin-top: var(--s-5); }
.subhead { font-size: var(--fs-base); margin: var(--s-5) 0 var(--s-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr 130px auto; gap: var(--s-2); margin-bottom: var(--s-2); align-items: center; }
.inline-form { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.inline-form input[type="file"] { flex: 1; min-width: 200px; }
.row-form { display: flex; gap: var(--s-2); margin-bottom: var(--s-2); }
.row-form input { min-height: 36px; padding: 6px 10px; min-width: 140px; }

/* 5. Components ------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); padding: var(--s-5); margin-bottom: var(--s-4);
}
.stack > .card, .side-stack > .card, .dash-grid > .card, .dash-insights > .card, .wallet-grid > .card, .kyc-layout .card { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.card-head h2 { margin: 0; }
.card-foot { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }

.alert {
  display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md); border: 1px solid transparent; margin-bottom: var(--s-4); font-size: var(--fs-sm);
}
.alert-body { min-width: 0; flex: 1; line-height: 1.5; }
.alert-icon { margin-top: 1px; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.alert a { color: inherit; font-weight: 700; }
/* legacy banner markup */
.banner { border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); border: 1px solid transparent; }
.banner.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.banner.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.banner.error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }

.badge, .pill {
  display: inline-flex; align-items: center; gap: 4px; border-radius: var(--r-pill);
  padding: 2px 10px; font-size: var(--fs-xs); font-weight: 650; line-height: 1.6;
  background: var(--neutral-bg); color: #475569; white-space: nowrap;
}
.badge-ok, .pill.open, .pill.active, .pill.approved, .pill.paid { background: var(--ok-bg); color: var(--ok); }
.badge-warn, .pill.review, .pill.pending, .pill.requested { background: var(--warn-bg); color: var(--warn); }
.badge-danger, .pill.rejected, .pill.banned { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--neutral-bg); color: #475569; }
.badge-lg { font-size: var(--fs-sm); padding: 4px 14px; }

.table-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--s-2)); padding: 0 var(--s-2); }
table, .table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td, table th, table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th, table thead th {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700;
  background: var(--surface-2); border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.table tbody tr:hover { background: #fafbff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-dense th, .table-dense td { padding: 9px 10px; }
.table .num, table .num { text-align: right; font-variant-numeric: tabular-nums; }
tr.hidden-row { display: none; }
.amt-pos { color: var(--ok); font-weight: 650; }
.amt-neg { color: var(--danger); font-weight: 650; }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.search-box { position: relative; flex: 1; max-width: 340px; }
.search-box .icon { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.search-box .filter { padding-left: 38px; }
.filter { max-width: 340px; }

.empty-state { text-align: center; max-width: 560px; margin: var(--s-6) auto; padding: var(--s-6) var(--s-5); }
.empty-state.card { margin-top: var(--s-5); }
.empty-icon {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--indigo-50); color: var(--indigo-700); margin-bottom: var(--s-3);
}
.empty-state h1, .empty-state h2 { margin-bottom: var(--s-2); }
.empty-state p { color: var(--muted); }
.empty-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: center; margin-top: var(--s-4); }
.empty-inline { text-align: center; padding: var(--s-6) var(--s-4); color: var(--muted); }
.empty-inline p { margin: var(--s-2) 0 var(--s-3); }
.empty-inline .empty-icon { width: 52px; height: 52px; }

.progress { height: 8px; border-radius: var(--r-pill); background: var(--neutral-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--indigo-600), var(--accent)); transition: width .4s ease; }

.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--navy-700); }
.avatar-initials { display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; background: linear-gradient(135deg, var(--indigo-600), var(--navy-700)); }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }

.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s-3); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--indigo-700); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 600; }

.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line-strong); margin-bottom: var(--s-4); overflow-x: auto; }
.tab { padding: 10px var(--s-4); text-decoration: none; color: var(--muted); font-weight: 650; font-size: var(--fs-sm); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: var(--control-h); display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--indigo-700); border-bottom-color: var(--indigo-700); }
.tab-count { background: var(--neutral-bg); color: #475569; border-radius: var(--r-pill); font-size: var(--fs-xs); padding: 0 8px; }
.tab.is-active .tab-count { background: var(--indigo-100); color: var(--indigo-800); }

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000; max-width: min(380px, calc(100vw - 40px));
  background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); font-size: var(--fs-sm); font-weight: 550; border-left: 4px solid var(--accent);
  animation: toast-in .2s ease;
}
.toast.ok { background: var(--ok); border-left-color: #6ee7b7; }
.toast.warn { background: #7a4100; border-left-color: #fcd34d; }
.toast.error { background: var(--danger); border-left-color: #fca5a5; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

dialog.modal, .modal {
  border: 0; border-radius: var(--r-lg); padding: var(--s-5); width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg); background: var(--surface); color: var(--text);
}
dialog.modal::backdrop { background: rgba(7, 13, 36, 0.6); }

.skeleton { display: block; border-radius: 8px; background: linear-gradient(90deg, #e8ecf5 25%, #f4f6fb 50%, #e8ecf5 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton-stack { display: grid; gap: 10px; max-width: 360px; margin: 0 auto var(--s-5); }
.skeleton-title { height: 20px; width: 55%; }
.skeleton-line { height: 14px; }
.skeleton-line.short { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.accordion { display: grid; gap: var(--s-2); }
.accordion details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 var(--s-4); }
.accordion summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); min-height: 56px; font-weight: 650; cursor: pointer; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .icon { transition: transform .2s ease; color: var(--muted); }
.accordion details[open] summary .icon { transform: rotate(180deg); }
.accordion details[open] { border-color: var(--indigo-200); box-shadow: var(--shadow-sm); }
.accordion p { color: var(--text-2); padding-bottom: var(--s-3); margin: 0; }

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); list-style: none; padding: 0; margin: 0 0 var(--s-5); counter-reset: s; }
.step-item { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); position: relative; }
.step-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); flex: none; background: var(--neutral-bg); color: #475569; }
.step-label { display: grid; line-height: 1.3; min-width: 0; }
.step-label strong { font-size: var(--fs-sm); }
.step-label small { color: var(--muted); font-size: var(--fs-xs); }
.step-item.is-current { border-color: var(--indigo-600); box-shadow: var(--ring); }
.step-item.is-current .step-dot { background: var(--indigo-700); color: #fff; }
.step-item.is-done .step-dot { background: var(--ok); color: #fff; }
.step-item.is-done { border-color: var(--ok-line); }
.step-item.is-error { border-color: var(--danger); }
.step-item.is-error .step-dot { background: var(--danger); color: #fff; }

.checklist { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.check-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.check-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; flex: none; background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); }
.check-item.is-done .check-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.check-item.is-wait .check-dot { border-color: var(--warn); color: var(--warn); }
.check-item.is-warn .check-dot { border-color: var(--danger); color: var(--danger); }
.check-item.is-done { background: var(--ok-bg); border-color: var(--ok-line); }
.check-text { flex: 1; display: grid; min-width: 0; line-height: 1.35; }
.check-text span { color: var(--muted); font-size: var(--fs-sm); }

/* 6. Public site ------------------------------------------------------------ */
.site-header { background: var(--navy-900); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.site-header-inner { display: flex; align-items: center; gap: var(--s-5); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--control-h); text-decoration: none; color: #fff; font-weight: 800; letter-spacing: -0.01em; font-size: 1.15rem; }
.brand:hover { color: #fff; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--indigo-600), var(--accent)); color: #fff; }
.brand-mark .icon { stroke-width: 2; }
.brand-name { line-height: 1; }
.site-nav { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; }
.site-nav > a { color: #c9d3f0; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 600; min-height: var(--control-h); display: inline-flex; align-items: center; }
.site-nav > a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.site-nav-actions { display: flex; gap: var(--s-2); margin-left: var(--s-3); }
.site-nav-actions .btn-ghost { color: #fff; }
.site-nav-actions .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.site-toggle { margin-left: auto; }
.nav-toggle, .nav-close {
  display: inline-grid; place-items: center; width: var(--control-h); height: var(--control-h); border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer;
}
.site-toggle { background: transparent; border-color: rgba(255, 255, 255, .3); color: #fff; }
.nav-toggle.site-toggle { display: none; }

.hero { background: radial-gradient(900px 420px at 85% -10%, rgba(79, 70, 229, .55), transparent 70%), radial-gradient(600px 400px at 0% 100%, rgba(20, 184, 166, .22), transparent 70%), var(--navy-900); color: #fff; padding: var(--s-8) 0 var(--s-8); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--s-7); align-items: center; }
.hero h1 { color: #fff; font-size: var(--fs-3xl); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; margin-bottom: var(--s-4); }
.hero-lede { color: #cfd8f3; font-size: var(--fs-md); max-width: 58ch; line-height: 1.6; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 700; color: #a5f3e6; background: rgba(20, 184, 166, .14); padding: 5px 12px; border-radius: var(--r-pill); margin-bottom: var(--s-4); }
.eyebrow-dark { color: var(--accent-ink); background: #dcf7f2; }
.hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin: var(--s-5) 0; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); color: #cfd8f3; font-size: var(--fs-sm); }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points .icon { color: #5eead4; }
.mock-window { background: #fff; border-radius: var(--r-lg); box-shadow: 0 30px 60px rgba(0, 0, 0, .4); color: var(--text); overflow: hidden; transform: rotate(1.2deg); }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #d4dbea; }
.mock-bar em { margin-left: auto; font-style: normal; font-size: var(--fs-xs); color: var(--muted); font-weight: 650; }
.mock-body { padding: var(--s-5); }
.mock-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.mock-pay { font-size: var(--fs-xs); color: var(--muted); }
.mock-pay strong { color: var(--ok); font-size: var(--fs-sm); }
.mock-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 0 0 4px; }
.mock-text { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: var(--s-3); }
.mock-text del { background: #fecaca; text-decoration: none; border-radius: 3px; }
.mock-text ins { background: #bbf7d0; text-decoration: none; border-radius: 3px; }
.mock-actions { display: flex; justify-content: flex-end; gap: var(--s-2); }
.mock-caption { text-align: center; font-size: var(--fs-xs); color: #93a1cc; margin: var(--s-4) 0 0; }

.section { padding: var(--s-8) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: var(--s-6); }
.section-head h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; }
.section-head p { color: var(--muted); font-size: var(--fs-md); }
.section-lede { color: var(--muted); font-size: var(--fs-md); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--shadow-sm); }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.step-num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--indigo-700); color: #fff; font-weight: 800; margin-bottom: var(--s-3); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-4); }
.cat-card { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
a.cat-card:hover { border-color: var(--indigo-600); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.cat-card h3 { margin: var(--s-2) 0 0; }
.cat-card p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.section-alt .cat-card { background: var(--bg); }
.cat-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--indigo-50); color: var(--indigo-700); flex: none; }
.cat-icon-lg { width: 56px; height: 56px; border-radius: 16px; }
.cat-grid-compact { grid-template-columns: 1fr; gap: var(--s-2); }
.cat-grid-compact .cat-card { flex-direction: row; align-items: center; padding: var(--s-3) var(--s-4); gap: var(--s-3); }
.cat-body { display: grid; flex: 1; line-height: 1.3; }
.cat-body small { color: var(--muted); }
.split-section { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--s-7); align-items: start; }
.split-section h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; }
.feature-list { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-4); }
.feature-list li { display: flex; gap: var(--s-4); }
.feature-list p { color: var(--muted); margin: 4px 0 0; font-size: var(--fs-sm); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #dcf7f2; color: var(--accent-ink); flex: none; }
.trust-card { background: var(--navy-900); color: #dbe3fb; border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-lg); }
.trust-card h3 { color: #fff; display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); margin-bottom: var(--s-4); }
.trust-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.trust-card li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.trust-card .icon { color: #5eead4; margin-top: 2px; }
.cta-band { background: linear-gradient(120deg, var(--indigo-800), var(--navy-900)); color: #fff; padding: var(--s-7) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; }
.cta-band h2 { color: #fff; font-size: var(--fs-xl); margin-bottom: 4px; }
.cta-band p { color: #cbd5f5; margin: 0; }
.cta-band .btn-primary { background: #fff; color: var(--indigo-800); }
.cta-band .btn-primary:hover { background: var(--indigo-50); }

.site-footer { background: var(--navy-950); color: #a9b5d9; padding-top: var(--s-7); font-size: var(--fs-sm); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: var(--s-6); padding-bottom: var(--s-6); }
.footer-grid h2 { color: #fff; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--s-3); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.site-footer a { color: #c9d3f0; }
.site-footer a:hover { color: #fff; }
.footer-brand p { margin: var(--s-3) 0 0; max-width: 36ch; }
.footer-mail { display: flex; align-items: center; gap: 8px; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .08); padding: var(--s-4) 0 var(--s-5); color: #8e9bc4; }

.flash-wrap { padding-top: var(--s-4); }
.auth-wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--s-6); align-items: center; padding: var(--s-7) 0; min-height: calc(100vh - 340px); }
.auth-aside { padding: var(--s-4); }
.auth-aside h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--s-5); }
.auth-aside ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.auth-aside li { display: flex; gap: var(--s-3); align-items: flex-start; color: var(--text-2); }
.auth-aside .icon { color: var(--accent-ink); margin-top: 2px; }
.auth-card { max-width: 480px; width: 100%; margin: 0 auto; padding: var(--s-6); box-shadow: var(--shadow); }
.auth-card h1 { font-size: var(--fs-xl); }
.lede { color: var(--muted); margin: 0 0 var(--s-5); font-size: var(--fs-base); }
.switch-line { margin: var(--s-4) 0 0; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.fine-print { font-size: var(--fs-xs); color: var(--muted); margin: var(--s-3) 0 0; }
.demo { margin-top: var(--s-4); border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); background: var(--surface-2); }
.demo summary { cursor: pointer; font-weight: 700; min-height: var(--control-h); display: flex; align-items: center; }
.demo ul { list-style: none; margin: var(--s-2) 0; padding: 0; display: grid; gap: 6px; }
.demo li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.demo li span { font-weight: 600; min-width: 130px; }

.page-static { padding: var(--s-7) 0; }
.page-static h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; }
.prose { margin-top: var(--s-5); }
.prose h2 { font-size: var(--fs-md); margin-bottom: var(--s-2); }
.prose p { color: var(--text-2); max-width: 70ch; }

/* 7. App shell -------------------------------------------------------------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #c3cdea; padding: var(--s-4) var(--s-3);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: var(--s-2) var(--s-2) var(--s-5); }
.nav-close { display: none; background: transparent; border-color: rgba(255, 255, 255, .25); color: #fff; }
.sidebar-nav { flex: 1; }
.nav-list, .nav-sub { list-style: none; margin: 0; padding: 0; }
.nav-list > li { margin-bottom: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--control-h); padding: 0 12px;
  border-radius: 10px; border: 0; background: transparent; color: #c3cdea; font: inherit; font-weight: 600; font-size: var(--fs-sm);
  text-decoration: none; cursor: pointer; text-align: left; position: relative;
}
.nav-link > span:not(.nav-badge):not(.nav-status) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.is-active { background: rgba(99, 102, 241, .28); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-link.is-active .icon { color: #5eead4; }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-chevron { transition: transform .2s ease; opacity: .7; }
.nav-group[open] > summary .nav-chevron { transform: rotate(180deg); }
.nav-sub { margin: 2px 0 6px 20px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .14); }
.nav-link-sub { min-height: var(--control-h); font-weight: 550; gap: 10px; padding: 0 10px; }
.nav-badge {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.nav-badge.is-zero { background: rgba(255, 255, 255, .06); color: #9ba8cf; }
.nav-badge.is-alert { background: #f59e0b; color: #2b1700; }
.nav-status { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .1); color: #b4c0e4; white-space: nowrap; }
.nav-status-approved { background: rgba(52, 211, 153, .16); color: #6ee7b7; }
.nav-status-pending { background: rgba(251, 191, 36, .16); color: #fcd34d; }
.nav-status-rejected { background: rgba(248, 113, 113, .18); color: #fca5a5; }
.nav-signout { margin-top: var(--s-4) !important; padding-top: var(--s-3); border-top: 1px solid rgba(255, 255, 255, .1); }
.nav-signout form { margin: 0; }
.sidebar-foot { padding-top: var(--s-4); }
.user-card { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.user-card:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.user-card-text { display: grid; min-width: 0; line-height: 1.3; }
.user-card-text strong { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-text small { color: #9ba8cf; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrim { position: fixed; inset: 0; background: rgba(7, 13, 36, .55); z-index: 90; }

.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-5); background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.app-topbar .nav-toggle, .topbar-brand { display: none; }
.topbar-brand { color: var(--navy-900); }
.topbar-spacer { flex: 1; }
.balance-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); text-decoration: none; color: var(--text); min-height: var(--control-h); }
.balance-chip:hover { border-color: var(--indigo-600); color: var(--text); }
.balance-chip .icon { color: var(--ok); }
.balance-chip small { color: var(--muted); margin-right: 4px; }
.balance-chip strong { font-variant-numeric: tabular-nums; }
.app-content { flex: 1; width: min(1120px, 100%); margin-inline: auto; padding: var(--s-6) var(--s-5) var(--s-7); }
.is-admin .app-content { width: min(1240px, 100%); }
.app-footer { display: flex; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.app-footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: var(--control-h); }
.app-footer span { margin-right: auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.page-head .lede { margin: 0; max-width: 62ch; }
.page-head-icon { margin-right: calc(-1 * var(--s-2)); }
.page-head:has(.page-head-icon) { justify-content: flex-start; align-items: center; }

/* 8. Worker pages ------------------------------------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-5); }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: var(--s-3) var(--s-3); align-items: center; padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.stat-card > :nth-child(n+3) { grid-column: 1 / -1; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-danger { background: var(--danger-bg); color: var(--danger); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-muted { background: var(--neutral-bg); color: #475569; }
.stat-label { margin: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.stat-value { margin: 0; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-value-sm { font-size: var(--fs-md); }
.stat-note, .stat-link { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.stat-link { font-weight: 650; }
a.stat-link { display: inline-flex; align-items: center; min-height: var(--control-h); }
.stat .label, .stat-card .label { color: var(--muted); font-size: var(--fs-sm); }

.dash-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--s-5); align-items: start; }
.dash-insights { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: var(--s-5); align-items: start; margin-bottom: var(--s-5); }
.earn-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-3); }
.earn-figure { padding: var(--s-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 0; }
.earn-figure .stat-value { font-size: var(--fs-md); }
.earn-empty { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.earn-empty p { margin: 0 0 var(--s-3); }
.earn-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; }
.earn-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-3); align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.earn-list .badge { justify-self: start; }
.earn-list .earn-note { grid-column: 1; color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.earn-list .earn-amt { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-variant-numeric: tabular-nums; }
.heat-summary { margin: 0 0 var(--s-3); color: var(--muted); font-size: var(--fs-sm); }
.heat-scroll { overflow-x: auto; }
.heat-months { display: grid; grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; margin: 0 0 4px 32px; min-height: 14px; font-size: 10px; line-height: 14px; color: var(--muted); font-weight: 650; }
.heat-months span { overflow: visible; white-space: nowrap; }
.heat-main { display: flex; gap: 6px; align-items: flex-start; width: max-content; }
.heat-dow { display: grid; grid-template-rows: repeat(7, 12px); gap: 3px; width: 26px; flex: none; font-size: 10px; line-height: 12px; color: var(--muted); font-weight: 650; }
.heat-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); grid-auto-columns: 12px; gap: 3px; }
.heat-cell { display: block; width: 12px; height: 12px; border-radius: 3px; background: var(--neutral-bg); }
.heat-cell.is-future { background: transparent; }
.heat-cell.lv-0 { background: var(--neutral-bg); }
.heat-cell.lv-1 { background: var(--indigo-200); }
.heat-cell.lv-2 { background: #818cf8; }
.heat-cell.lv-3 { background: var(--indigo-600); }
.heat-cell.lv-4 { background: var(--navy-800); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--muted); }
.section-line { margin-bottom: var(--s-3); }
.section-line h2 { margin: 0; }
.result-line { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 var(--s-3); font-weight: 600; }
.batch-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.batch-toolbar .result-line { margin: 0; }
.view-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.view-switch-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: 650; cursor: pointer;
}
.view-switch-btn:hover { background: var(--surface-2); color: var(--text); }
.view-switch-btn.is-active, .view-switch-btn.is-active:hover { background: var(--indigo-700); color: #fff; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-4); }
.batch-card { display: flex; flex-direction: column; gap: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, border-color .15s ease; }
.batch-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.batch-card header { display: grid; gap: var(--s-2); justify-items: start; }
.batch-card h2 { margin: 0; font-size: var(--fs-md); }
.batch-instructions { color: var(--text-2); font-size: var(--fs-sm); margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.batch-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin: 0; padding: var(--s-3) 0; border-block: 1px solid var(--line); }
.batch-meta dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.batch-meta dd { margin: 2px 0 0; font-weight: 750; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.batch-meta .pay { color: var(--ok); }
.lock-reason { margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.batch-table .batch-instr { max-width: 360px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-table th[scope="row"] { white-space: nowrap; }
.batch-table .pay { color: var(--ok); font-weight: 750; }

.wallet-grid { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: var(--s-5); align-items: start; }
.requirements { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: grid; gap: var(--s-2); font-size: var(--fs-sm); }
.requirements li { display: flex; gap: 10px; align-items: flex-start; }
.requirements .is-done .icon { color: var(--ok); }
.requirements .is-todo .icon { color: var(--danger); }

.avatar-row { display: flex; gap: var(--s-5); align-items: center; margin-bottom: var(--s-5); flex-wrap: wrap; }
.avatar-controls { flex: 1; min-width: 240px; }

.kyc-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr); gap: var(--s-5); align-items: start; }
.side-stack { display: grid; gap: var(--s-4); }
.trust-panel { background: var(--navy-900); color: #dbe3fb; border-color: transparent; }
.trust-panel h2 { color: #fff; display: flex; gap: 10px; align-items: center; }
.trust-panel a { color: #a5f3e6; }
.tick-list, .plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); font-size: var(--fs-sm); }
.tick-list li { display: flex; gap: 10px; align-items: flex-start; }
.tick-list .icon { color: #5eead4; margin-top: 3px; }
.plain-list { list-style: disc; padding-left: 18px; gap: var(--s-2); color: var(--text-2); }
.file-preview { margin-top: var(--s-2); display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--muted); }
.file-preview img { max-height: 160px; width: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); object-fit: contain; }
.detail-list { margin: 0; display: grid; gap: 0; }
.detail-list > div { display: grid; grid-template-columns: 150px 1fr; gap: var(--s-3); padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-weight: 600; }
.detail-list dd { margin: 0; word-break: break-word; }
.id-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4); }
.id-pair figure { margin: 0; }
.id-pair img { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: repeating-conic-gradient(#f1f4fa 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.id-pair figcaption { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }
.id-missing > div { min-height: 160px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--muted); background: var(--surface-2); }

/* 9. Admin ------------------------------------------------------------------- */
.todo-strip { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-5); }
.todo-strip a { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r-pill); background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); text-decoration: none; font-size: var(--fs-sm); min-height: 44px; }
.todo-strip a:hover { background: #ffecb8; color: var(--warn); }
.chart-box { height: 300px; position: relative; }
.kyc-review { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr); gap: var(--s-5); align-items: start; }
.kyc-review .card { margin-bottom: 0; }
.id-pair-lg { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.decision-form { margin: 0 0 var(--s-4); }
.reject-form { padding-top: var(--s-4); border-top: 1px solid var(--line); }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 10px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); }
ul.segments { margin: 0; padding-left: 18px; }

/* 10. Work workspace ---------------------------------------------------------- */
.layout-work { background: var(--surface-2); }
.work-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--surface-2); }
.work-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 0 var(--s-5); min-height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.work-left { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.work-exit { display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-h); padding: 0 var(--s-3); border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 650; font-size: var(--fs-sm); border: 1px solid var(--line-strong); }
.work-exit:hover { background: var(--surface-2); color: var(--text); }
.work-divider { width: 1px; height: 28px; background: var(--line); }
.work-title { display: grid; line-height: 1.25; min-width: 0; }
.work-title small { color: var(--muted); font-weight: 650; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; }
.work-title strong { font-size: var(--fs-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.work-right { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.pill-stat { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--neutral-bg); color: var(--text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pill-stat strong { color: var(--text); }
.pill-label { color: var(--muted); }
.pill-pay { background: var(--ok-bg); color: var(--ok); }
.pill-pay strong { color: var(--ok); }
.pill-timer { background: var(--info-bg); color: var(--info); }
.timer { font-family: var(--mono); font-weight: 700; color: var(--info); font-size: var(--fs-base); }
.timer.late { color: var(--danger); }
.pill-timer.is-late { background: var(--danger-bg); color: var(--danger); }
.timer-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.timer-bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--indigo-600), var(--accent)); transition: width 1s linear; }
.pill-timer.is-late ~ .timer-bar span, .work-top:has(.is-late) .timer-bar span { background: var(--danger); }
.work-instructions { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-5); background: var(--info-bg); color: var(--info); border-bottom: 1px solid var(--info-line); font-size: var(--fs-sm); }
.work-instructions .icon { margin-top: 2px; }
.work-instructions span { color: var(--text-2); }
.work-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.15fr 0.85fr; }
.panel { min-height: 0; overflow: auto; padding: var(--s-5); }
.panel + .panel { border-left: 1px solid var(--line); background: var(--surface); }
.panel h2 { font-size: var(--fs-base); color: var(--text-2); }
.work-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-5); min-height: 64px; background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); flex-wrap: wrap; }
.hotkeys { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hotkeys kbd { margin-left: 8px; }
.work-foot .btn { min-width: 112px; }
.empty-state.is-loading h1 { font-size: var(--fs-md); }
#work-empty:not(.is-loading) .skeleton-stack { display: none; }
#work-empty { margin: auto; }
.work-shell .empty-state { margin: auto; }
.empty-exit { margin-top: var(--s-4); }

.media-stage { height: 100%; min-height: 280px; max-height: 70vh; background: var(--navy-900); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.media-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transform-origin: center center; cursor: grab; user-select: none; }
#wave { width: 100%; }
.seg-row { display: grid; grid-template-columns: 90px 1fr; gap: var(--s-2); margin-bottom: var(--s-2); }
.box-tools { display: flex; gap: var(--s-2); align-items: center; margin-bottom: var(--s-2); flex-wrap: wrap; }
.box-tools select, .box-tools input { width: auto; min-height: 36px; }
#board { width: 100%; height: 520px; background: #111827; border-radius: var(--r-md); }
.diff { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: var(--s-3); line-height: 1.7; }
.diff del { background: #fecaca; text-decoration: none; border-radius: 3px; }
.diff ins { background: #bbf7d0; text-decoration: none; border-radius: 3px; }
.response { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4); margin-bottom: var(--s-3); background: var(--surface); }
.response:hover { border-color: var(--line-strong); }
.response header { display: flex; justify-content: space-between; gap: var(--s-2); align-items: center; margin-bottom: var(--s-2); }
.choice-option { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: var(--s-2); cursor: pointer; background: var(--surface); font-weight: 600; }
.choice-option:hover { border-color: var(--line-strong); }
.choice-option.is-selected { border-color: var(--navy-700, #1e3a5f); background: var(--surface-2); }
.choice-option input { width: 18px; min-height: 0; }
.stars { display: flex; gap: 4px; align-items: center; margin: 0; font-weight: 600; }
.stars input { width: auto; min-height: 0; }
.stars select { width: 90px; min-height: 36px; }

/* 11. Utilities, motion, responsive ------------------------------------------ */
@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2.6rem; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 100; left: 0; top: 0; bottom: 0; width: min(310px, 88vw); height: 100%;
    transform: translateX(-100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }
  .nav-close, .app-topbar .nav-toggle, .topbar-brand { display: inline-grid; }
  .topbar-brand { display: inline-flex; }
  .app-topbar { padding: 0 var(--s-4); }
  .app-content { padding: var(--s-5) var(--s-4) var(--s-6); }
  body.nav-open { overflow: hidden; }

  .nav-toggle.site-toggle { display: inline-grid; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--navy-900); padding: var(--s-3) var(--s-4) var(--s-5); border-bottom: 1px solid rgba(255, 255, 255, .1); gap: 2px; margin: 0; }
  .site-nav.is-open { display: flex; }
  .site-nav > a { min-height: var(--control-h); }
  .site-nav-actions { margin: var(--s-3) 0 0; }
  .site-nav-actions .btn { flex: 1; }

  .hero { padding: var(--s-7) 0; }
  .hero-grid, .split-section, .auth-wrap { grid-template-columns: 1fr; }
  .hero-visual { max-width: 520px; }
  .auth-wrap { padding: var(--s-5) 0 var(--s-7); min-height: 0; }
  .auth-aside { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid, .dash-insights, .wallet-grid, .kyc-layout, .kyc-review { grid-template-columns: minmax(0, 1fr); }
  .earn-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3, .grid-2, .grid-2-eq, .stat-grid-3 { grid-template-columns: 1fr 1fr; }
  .work-body { grid-template-columns: 1fr; }
  .work-shell { height: auto; min-height: 100vh; }
  .panel + .panel { border-left: 0; border-top: 1px solid var(--line); }
  .work-title strong { max-width: 36vw; }

  .batch-toolbar { flex-direction: column; align-items: stretch; }
  .view-switch { width: 100%; }
  .view-switch-btn { flex: 1; justify-content: center; min-height: 44px; }
  .batch-table-wrap { overflow: visible; margin: 0; padding: 0; }
  .batch-table, .batch-table tbody { display: block; }
  .batch-table thead { display: none; }
  .batch-table tbody { display: grid; gap: var(--s-3); }
  .batch-table tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px var(--s-4);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    padding: var(--s-4); box-shadow: var(--shadow-sm);
  }
  .batch-table tr:hover { background: var(--surface); }
  .batch-table th, .batch-table td { display: block; width: auto; padding: 0; border: 0; text-align: left; }
  .batch-table th[scope="row"], .batch-table .batch-instr, .batch-table .batch-action { grid-column: 1 / -1; }
  .batch-table th[scope="row"] { white-space: normal; font-size: var(--fs-md); }
  .batch-table .batch-instr {
    max-width: none; white-space: normal; text-overflow: unset;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  }
  .batch-table .batch-pay::before, .batch-table .batch-tasks::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: var(--fs-xs); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted);
  }
  .batch-table .batch-tasks { text-align: left; font-weight: 750; font-variant-numeric: tabular-nums; }
  .batch-table .batch-action .btn { width: 100%; }
}

@media (max-width: 640px) {
  :root { --fs-xl: 1.5rem; --fs-2xl: 1.75rem; --fs-3xl: 2.2rem; }
  .container { width: calc(100% - 2 * var(--s-4)); }
  .section { padding: var(--s-7) 0; }
  .steps, .form-grid, .split, .grid-3, .grid-2, .grid-2-eq, .stat-grid-3, .stepper, .footer-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.1rem; }
  .field-row { grid-template-columns: 1fr; }
  .detail-list > div { grid-template-columns: 1fr; gap: 2px; }
  .balance-chip small { display: none; }
  .work-top { padding: var(--s-3) var(--s-4); }
  .work-title strong { max-width: 56vw; }
  .work-foot { padding: var(--s-3) var(--s-4); }
  .hotkeys { display: none; }
  .work-foot .actions { width: 100%; }
  .work-foot .actions .btn { flex: 1; }
  .panel { padding: var(--s-4); }
  .batch-grid { grid-template-columns: 1fr; }
  .card { padding: var(--s-4); }
  .row-form { flex-wrap: wrap; }
}

@media (pointer: coarse) {
  .btn-sm, .btn.small { min-height: 44px; }
  .work-exit, .pill-stat { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skeleton { animation: none; }
}

@media (forced-colors: active) {
  .btn, .nav-link, .badge { border: 1px solid ButtonText; }
  .nav-link.is-active { outline: 2px solid Highlight; }
}

.swal2-styled.swal2-confirm, .swal2-styled.swal2-cancel { min-height: var(--control-h); }

/* Badges used on light surfaces (dashboard category cards) */
.cat-card .nav-badge { background: var(--indigo-50, #eef2ff); color: #3730a3; border: 1px solid #c7d2fe; }
.cat-card .nav-badge.is-zero { background: var(--surface-2, #f1f5f9); color: #475569; border-color: var(--line); }

.dash-grid > *, .dash-insights > *, .wallet-grid > *, .kyc-layout > *, .kyc-review > * { min-width: 0; }
