/* Novantis app. Tokens and components follow novantis.pen (App System). */
:root {
  --night: #0B1F3A;
  --night-2: #132B4D;
  --gold: #F2B84B;
  --gold-hover: #E0A63A;
  --gold-grad: linear-gradient(135deg, #F7CB70 0%, #EDAE3F 100%);
  --offwhite: #F6F7F9;
  --white: #FFFFFF;
  --slate: #5B6B7F;
  --slate-2: #8FA0B5;
  --mist: #E3E7ED;
  --light-on-dark: #DCE3EC;
  --white-10: rgba(255, 255, 255, .10);
  --white-12: rgba(255, 255, 255, .12);
  --whatsapp: #25D366;
  --success: #1E7B4F;  --success-tint: #E6F4EC;
  --warning: #8A5A0B;  --gold-tint: #FDF1DA;
  --info: #2D6AA8;     --info-tint: #E8F0F9;
  --flag: #B54708;     --flag-tint: #FEF0E6;
  --error: #B42318;    --error-tint: #FCEBEA;
  --shadow-soft: 0 8px 24px rgba(11, 31, 58, .08);
  --r-card: 16px;
  --r-control: 12px;
  --r-btn: 10px;
  --font-head: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--offwhite); color: var(--night); font: 16px/1.5 var(--font-body); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.icon { flex: none; display: block; }
.muted { color: var(--slate); }
.small { font-size: 13px; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(242, 184, 75, .6); outline-offset: 2px; }
#app:focus { outline: none; }

/* ------------------------------------------------------------ logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--night); }
.logo svg { width: 16px; height: 16px; fill: var(--gold); }
.logo span { font-family: var(--font-head); font-weight: 600; font-size: 20px; letter-spacing: 3.6px; line-height: 1.2; }
.logo.light { color: var(--white); }
.logo.sm span { font-size: 17px; letter-spacing: 3px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-btn); border: 1px solid var(--mist);
  background: var(--white); color: var(--night); font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, filter .15s;
}
.btn .icon { color: var(--slate); }
.btn:hover { border-color: #C9D1DC; }
.btn.primary { background: var(--gold-grad); border-color: transparent; color: var(--night); }
.btn.primary .icon { color: var(--night); }
.btn.primary:hover { filter: brightness(.97); }
.btn.dark { background: var(--night); border-color: var(--night); color: var(--white); }
.btn.dark .icon { color: var(--white); }
.btn.danger { color: var(--error); border-color: rgba(180, 35, 24, .25); }
.btn.danger-solid { background: var(--error); border-color: var(--error); color: var(--white); }
.btn.ghost-dark { background: transparent; color: var(--white); border-color: rgba(242, 184, 75, .6); }
.btn.ghost-dark .icon { color: var(--whatsapp); }
.btn.lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: var(--r-control); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--info); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.linkbtn .icon { color: currentColor; }
.linkbtn.light { color: var(--light-on-dark); }

/* ------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap;
  background: var(--offwhite); color: var(--slate); border: 1px solid var(--mist);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.nodot::before { display: none; }
.badge.gold { background: var(--gold-tint); color: var(--warning); border-color: rgba(242, 184, 75, .55); }
.badge.info { background: var(--info-tint); color: var(--info); border-color: rgba(45, 106, 168, .25); }
.badge.success { background: var(--success-tint); color: var(--success); border-color: rgba(30, 123, 79, .25); }
.badge.flag { background: var(--flag-tint); color: var(--flag); border-color: rgba(181, 71, 8, .25); }
.badge.error { background: var(--error-tint); color: var(--error); border-color: rgba(180, 35, 24, .25); }
.badge.dark { background: var(--night); color: var(--gold); border-color: transparent; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.tag.gold { background: var(--gold-tint); color: var(--warning); }
.tag.info { background: var(--info-tint); color: var(--info); }
.tag.flag { background: var(--flag-tint); color: var(--flag); }
.count { display: inline-flex; min-width: 22px; height: 18px; padding: 0 7px; border-radius: 999px; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: var(--gold); color: var(--night); }
.count.soft { background: var(--mist); color: var(--slate); }

/* ------------------------------------------------------------ avatar */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 13px; font-weight: 600; background: var(--info-tint); color: var(--info); }
.avatar.c1 { background: var(--gold-tint); color: var(--warning); }
.avatar.c2 { background: var(--success-tint); color: var(--success); }
.avatar.gold { background: var(--gold); color: var(--night); }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }

/* ------------------------------------------------------------ cards */
.card { background: var(--white); border: 1px solid var(--mist); border-radius: var(--r-card); }
.card.pad { padding: 24px; }
.card.dark { background: var(--night); border-color: var(--night); color: var(--white); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; }
.card-head h2, .card h2 { font-size: 18px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--mist); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.eyebrow.slate { color: var(--slate); }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--slate); }

/* ------------------------------------------------------------ metrics */
.metrics { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
.metric { background: var(--white); border: 1px solid var(--mist); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.metric .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric .label { color: var(--slate); font-size: 13px; font-weight: 500; }
.metric .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--offwhite); display: flex; align-items: center; justify-content: center; color: var(--night); }
.metric .value { font-family: var(--font-head); font-size: 28px; font-weight: 600; letter-spacing: -.5px; line-height: 1.2; }
.metric .note { font-size: 13px; color: var(--slate); }
.metric .note.up { color: var(--success); }
.metric.dark { background: var(--night); border-color: var(--night); }
.metric.dark .label, .metric.dark .note { color: var(--light-on-dark); }
.metric.dark .value { color: var(--gold); }
.metric.dark .ic { background: var(--white-10); color: var(--gold); }
a.metric:hover { border-color: #C9D1DC; }
/* metric strip: one card split into cells */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--white); border: 1px solid var(--mist); border-radius: var(--r-card); }
.strip > div { padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.strip > div + div { border-left: 1px solid var(--mist); }
.strip .label { font-size: 13px; color: var(--slate); }
.strip .value { font-family: var(--font-head); font-size: 26px; font-weight: 600; letter-spacing: -.4px; }
.strip .note { font-size: 12px; color: var(--slate); }
.v-gold { color: var(--warning) !important; }
.v-error { color: var(--error) !important; }
.methodbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--mist); margin: 8px 0 10px; }
.methodbar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--slate); }
.legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ------------------------------------------------------------ tables (grid rows; stack on phones) */
.table { display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--mist); text-decoration: none; color: inherit; min-width: 0; }
.trow > * { min-width: 0; }
.trow:last-child { border-bottom: 0; }
.thead { background: var(--offwhite); border-top: 1px solid var(--mist); padding-top: 10px; padding-bottom: 10px; }
.thead > * { font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--slate); }
a.trow:hover, .trow.click:hover { background: #FAFBFC; cursor: pointer; }
.trow.hl { background: #FFFBF2; }
.cell-main { font-size: 14px; font-weight: 600; color: var(--night); overflow-wrap: anywhere; }
.cell-sub { font-size: 13px; color: var(--slate); overflow-wrap: anywhere; }
.cell { font-size: 14px; color: var(--night); overflow-wrap: anywhere; }
.cell.muted { color: var(--slate); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.t-empty { padding: 48px 24px; }
.skel { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--mist) 0%, #EEF1F5 50%, var(--mist) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel.circle { width: 32px; height: 32px; border-radius: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ------------------------------------------------------------ tabs, filters */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; }
.toolbar .right { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--offwhite); border-radius: 10px; }
.seg a, .seg button { display: inline-flex; gap: 6px; align-items: baseline; border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--slate); text-decoration: none; cursor: pointer; }
.seg a span, .seg button span { font-size: 12px; font-weight: 500; color: var(--slate-2); }
.seg .on { background: var(--white); color: var(--night); box-shadow: 0 1px 2px rgba(11, 31, 58, .08); }
.ul-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--mist); overflow-x: auto; }
.ul-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--slate); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ul-tabs a.on { color: var(--night); border-color: var(--night); }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--slate); pointer-events: none; }
.search input { padding-left: 38px; height: 40px; font-size: 15px; }
.filter { height: 40px; width: auto; padding: 0 40px 0 12px; font-weight: 500; font-size: 14px; }

/* ------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--night); line-height: 1.43; }
.hint { font-size: 13px; color: var(--slate); }
.field-error { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--error); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--night); background: var(--white);
  height: 48px; padding: 0 16px; border: 1px solid #C5CDD8; border-radius: var(--r-control);
}
textarea { height: auto; min-height: 76px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235B6B7F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
input::placeholder, textarea::placeholder { color: #8A97A8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--night); box-shadow: 0 0 0 3px rgba(242, 184, 75, .35); }
input.invalid { border-color: var(--error); }
input.valid { border-color: var(--success); }
.input-wrap { position: relative; }
.input-wrap > .icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.input-wrap > .icon.ok { color: var(--success); }
.form { display: flex; flex-direction: column; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.choice { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 8px; }
.choice > div { position: relative; }
.choice label { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border: 1px solid #C5CDD8; border-radius: var(--r-control); font-weight: 500; color: var(--slate); cursor: pointer; background: var(--white); font-size: 15px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice label .icon { display: none; }
.choice input:checked + label { background: var(--gold-tint); border-color: var(--gold); color: var(--night); font-weight: 600; }
.choice input:checked + label .icon { display: block; }
.choice input:focus-visible + label { outline: 3px solid rgba(242, 184, 75, .6); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--night); }
.divider { height: 1px; background: var(--mist); border: 0; margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.switch { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #C5CDD8; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); transition: transform .15s var(--ease); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .45; }
.switch input:focus-visible + span { outline: 3px solid rgba(242, 184, 75, .6); }

/* ------------------------------------------------------------ alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-control); font-size: 14px; }
.alert .icon { margin-top: 1px; }
.alert strong { display: block; font-weight: 600; color: var(--night); margin-bottom: 2px; }
.alert.error { background: var(--error-tint); color: var(--error); }
.alert.ok { background: var(--success-tint); color: var(--success); }
.alert.gold { background: var(--gold-tint); color: var(--warning); border: 1px solid rgba(242, 184, 75, .55); }
.alert.flag { background: var(--flag-tint); color: var(--flag); }
.alert.info { background: var(--offwhite); color: var(--slate); }
.notebar { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--slate); }

/* ------------------------------------------------------------ toast */
.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 60; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; background: var(--night); color: var(--white); padding: 16px; border-radius: 12px; box-shadow: 0 12px 32px rgba(11, 31, 58, .25); animation: toast-in .25s var(--ease); }
.toast .tic { width: 28px; height: 28px; border-radius: 50%; background: var(--success); display: flex; align-items: center; justify-content: center; flex: none; color: var(--white); }
.toast.error .tic { background: var(--error); }
.toast .tbody { flex: 1; min-width: 0; }
.toast strong { display: block; font-size: 14px; font-weight: 600; }
.toast p { font-size: 13px; color: var(--light-on-dark); margin-top: 2px; }
.toast .tact { color: var(--gold); font-weight: 600; font-size: 13px; background: none; border: 0; cursor: pointer; text-decoration: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ------------------------------------------------------------ modal */
.scrim { position: fixed; inset: 0; background: rgba(11, 31, 58, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--white); border-radius: 20px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 24px 64px rgba(11, 31, 58, .3); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 24px 28px 20px; border-bottom: 1px solid var(--mist); }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 28px; background: var(--offwhite); border-top: 1px solid var(--mist); }
.iconbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--slate); flex: none; }
.iconbtn:hover { background: var(--offwhite); }

/* ------------------------------------------------------------ empty / restricted states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 24px; }
.empty .eic { width: 56px; height: 56px; border-radius: 14px; background: var(--offwhite); color: var(--slate); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.empty .eic.gold { background: var(--gold-tint); color: var(--warning); }
.empty .eic.green { background: var(--success-tint); color: var(--success); }
.empty h3 { font-size: 18px; }
.empty p { color: var(--slate); font-size: 14px; max-width: 420px; }
.empty .row { margin-top: 8px; justify-content: center; }

/* ------------------------------------------------------------ layout helpers */
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.stack.sm { gap: 12px; }
.cols { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.cols.wide-side { grid-template-columns: minmax(0, 1fr) 360px; }
.cols.left-list { grid-template-columns: 340px minmax(0, 1fr); }
.kv-list { display: flex; flex-direction: column; gap: 16px; }
.kv-item { display: flex; gap: 12px; align-items: flex-start; }
.kv-item .icon { color: var(--slate); margin-top: 2px; }
.kv-item .k { font-size: 12px; color: var(--slate); }
.kv-item .v { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.pairs { display: flex; flex-direction: column; gap: 8px; font-size: 14px; margin: 0; }
.pairs > div { display: flex; justify-content: space-between; gap: 12px; }
.pairs dt { color: var(--light-on-dark); }
.pairs dd { margin: 0; font-weight: 600; text-align: right; }
.progress { height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }

/* ================================================================ ADMIN SHELL */
.admin { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--night); color: var(--light-on-dark); display: flex; flex-direction: column; gap: 28px; padding: 24px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.admin-tag { background: var(--white-10); color: var(--gold); border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600; letter-spacing: 1px; }
.sidebar nav { display: flex; flex-direction: column; gap: 24px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group h4 { font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--slate-2); padding: 0 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--light-on-dark); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-item .icon { color: var(--slate-2); }
.nav-item span.lbl { flex: 1; }
.nav-item:hover { background: rgba(255, 255, 255, .05); }
.nav-item.on { background: var(--white-10); color: var(--white); }
.nav-item.on .icon { color: var(--gold); }
.account { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--white-10); border-radius: 12px; }
.account .who-txt { flex: 1; min-width: 0; }
.account .nm { color: var(--white); font-size: 13px; font-weight: 600; }
.account .em { color: var(--slate-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account button { background: none; border: 0; color: var(--slate-2); cursor: pointer; padding: 4px; border-radius: 6px; }
.account button:hover { color: var(--white); }
.admin-main { padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; }
.page-head h1 { font-size: 30px; letter-spacing: -.4px; }
.page-head .sub { color: var(--slate); font-size: 15px; margin-top: 4px; }
.page-head .date { color: var(--slate); font-size: 14px; margin-bottom: 2px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--slate); margin-bottom: -12px; }
.crumbs a { color: var(--slate); text-decoration: none; }
.crumbs a:hover { color: var(--night); }
.crumbs b { color: var(--night); font-weight: 600; }
.mobile-bar { display: none; }
.admin-drawer-scrim { display: none; }

/* attention list (overview) */
.attn { display: flex; flex-direction: column; }
.attn > div { display: flex; gap: 14px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--mist); }
.attn .aic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.attn .txt { flex: 1; min-width: 0; }
.attn .t { font-size: 14px; font-weight: 600; }
.attn .s { font-size: 13px; color: var(--slate); }
.top-ref { display: flex; flex-direction: column; gap: 6px; }
.top-ref + .top-ref { margin-top: 16px; }

/* activity timeline */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--mist); }
.tl-item:last-child::before { display: none; }
.tl-ic { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--offwhite); color: var(--slate); }
.tl-ic.gold { background: var(--gold-tint); color: var(--warning); }
.tl-ic.green { background: var(--success-tint); color: var(--success); }
.tl-ic.blue { background: var(--info-tint); color: var(--info); }
.tl-ic.flag { background: var(--flag-tint); color: var(--flag); }
.tl-t { font-size: 14px; font-weight: 600; }
.tl-s { font-size: 13px; color: var(--slate); }
.tl-when { font-size: 12px; color: var(--slate); white-space: nowrap; }

/* application cards */
.app-card { padding: 20px 24px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; }
.app-card .detail { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; margin-top: 16px; }
.app-card .quote { font-size: 15px; color: var(--night); }
.contact-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--night); }
.contact-list div { display: flex; gap: 10px; align-items: center; overflow-wrap: anywhere; }
.contact-list .icon { color: var(--slate); }
.app-flag { display: flex; gap: 10px; padding: 12px 24px 12px 84px; background: var(--flag-tint); color: var(--flag); font-size: 14px; border-top: 1px solid rgba(181, 71, 8, .15); border-radius: 0 0 var(--r-card) var(--r-card); }
.codebox-dark { background: var(--white-10); border: 1px solid var(--white-12); border-radius: 12px; padding: 16px; }
.codebox-dark .code { font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--gold); letter-spacing: .5px; }
.codebox-dark .lnk { font-size: 13px; color: var(--light-on-dark); margin-top: 4px; overflow-wrap: anywhere; }
.ticks { display: flex; flex-direction: column; gap: 12px; }
.ticks div { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.ticks .icon { color: var(--gold); margin-top: 3px; }

/* pay row (commissions) */
.payrow { display: grid; grid-template-columns: 220px minmax(0, 1fr) 150px auto auto; gap: 16px; align-items: end; padding: 0 24px 18px 72px; background: #FFFBF2; border-bottom: 1px solid var(--mist); }
.payrow input { height: 40px; font-size: 15px; }

/* flagged */
.flag-item { display: block; width: 100%; text-align: left; padding: 16px; border: 1px solid var(--mist); border-radius: 14px; background: var(--white); cursor: pointer; }
.flag-item.on { border: 2px solid var(--night); padding: 15px; }
.flag-item + .flag-item { margin-top: 12px; }
.capt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.capt > div { background: var(--offwhite); border-radius: 12px; padding: 12px 14px; }
.capt .k { font-size: 13px; color: var(--slate); }
.capt .v { font-size: 15px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.match { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--mist); border-radius: 12px; cursor: pointer; }
.match + .match { margin-top: 10px; }
.match:has(input:checked) { border-color: var(--gold); background: #FFFBF2; box-shadow: 0 0 0 1px var(--gold); }
.match input { width: 22px; height: 22px; margin: 0; accent-color: var(--night); flex: none; }
.match .txt { flex: 1; min-width: 0; }

/* settings */
.pk-input { height: 40px; max-width: 140px; font-weight: 600; font-size: 15px; padding: 0 12px; border-radius: 10px; border-color: var(--mist); }

/* ================================================================ REFERRER SHELL */
.ref-top { background: var(--white); border-bottom: 1px solid var(--mist); }
.ref-top .inner { max-width: 1200px; margin: 0 auto; height: 72px; padding: 0 24px; display: flex; align-items: center; gap: 40px; }
.ref-tabs { display: flex; gap: 4px; flex: 1; }
.ref-tabs a { padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--slate); text-decoration: none; }
.ref-tabs a.on { background: var(--offwhite); color: var(--night); font-weight: 600; }
.ref-user { position: relative; }
.ref-user > button { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px; border-radius: 10px; }
.ref-user > button .icon { color: var(--slate); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: 1px solid var(--mist); border-radius: 12px; box-shadow: var(--shadow-soft); padding: 6px; min-width: 200px; z-index: 20; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font-size: 14px; text-decoration: none; color: var(--night); cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--offwhite); }
.menu .icon { color: var(--slate); }
.ref-main { max-width: 1200px; margin: 0 auto; padding: 48px 24px 64px; display: flex; flex-direction: column; gap: 28px; }
.ref-main h1 { font-size: 30px; letter-spacing: -.4px; }
.ref-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.code-hero { border-radius: 20px; padding: 36px 32px; color: var(--white); background: radial-gradient(120% 140% at 0% 0%, #1E4F86 0%, #0D2443 55%, #0B1F3A 100%); }
.code-hero .big { font-family: var(--font-head); font-size: 44px; font-weight: 600; letter-spacing: 1px; margin: 12px 0 24px; overflow-wrap: anywhere; line-height: 1.1; }
.linkbar { display: flex; align-items: center; gap: 12px; background: var(--white-10); border: 1px solid var(--white-12); border-radius: 12px; padding: 6px 6px 6px 16px; }
.linkbar .url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.linkbar > .icon { color: var(--light-on-dark); }
.earn-list > div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--mist); font-size: 15px; }
.earn-list > div b { font-weight: 600; }
.legend-dots { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--slate); }
.legend-dots span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--c); }
.ref-mobile-stats { display: none; }

/* ================================================================ PUBLIC SHELL */
.public {
  min-height: 100vh; color: var(--white); display: flex; flex-direction: column;
  background:
    radial-gradient(50% 60% at 78% 55%, rgba(242, 184, 75, .18) 0%, rgba(242, 184, 75, 0) 100%),
    radial-gradient(55% 70% at 5% 0%, rgba(59, 123, 192, .35) 0%, rgba(59, 123, 192, 0) 100%),
    radial-gradient(80% 60% at 70% 40%, #1E4F86 0%, rgba(30, 79, 134, 0) 70%),
    linear-gradient(180deg, #10284A 0%, #0B1F3A 100%);
}
.announce { height: 36px; display: flex; align-items: center; justify-content: center; gap: 16px; background: rgba(11, 31, 58, .4); border-bottom: 1px solid var(--white-10); font-size: 14px; padding: 0 12px; }
.announce i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); flex: none; }
.pub-nav { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 120px; background: rgba(255, 255, 255, .06); border-bottom: 1px solid; border-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(242, 184, 75, .67), rgba(255, 255, 255, 0)) 1; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.pub-links { display: flex; gap: 32px; }
.pub-links a { color: var(--white); text-decoration: none; font-size: 16px; font-weight: 500; opacity: .9; }
.pub-links a:hover { opacity: 1; color: var(--gold); }
.pub-actions { display: flex; gap: 12px; align-items: center; }
.pub-actions .btn { height: 48px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.pub-ref { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin-right: 8px; }
.pub-ref a { color: var(--white); text-decoration: none; font-size: 13px; font-weight: 500; opacity: .85; white-space: nowrap; }
.pub-ref a:hover { opacity: 1; color: var(--gold); }
.pub-right { display: none; }
.pub-menu { display: none; }
.pub-main { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 64px 120px 96px; }
.pub-split { display: grid; grid-template-columns: minmax(0, 1fr) 560px; gap: 64px; align-items: start; }
.pub-copy { padding-top: 32px; display: flex; flex-direction: column; gap: 28px; }
.pub-copy h1 { font-size: 48px; line-height: 1.1667; letter-spacing: -.96px; font-weight: 700; }
.pub-copy .lead { font-size: 18px; line-height: 1.5556; color: var(--light-on-dark); max-width: 580px; }
.rates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 580px; }
.rates div { background: var(--white-10); border: 1px solid var(--white-12); border-radius: 12px; padding: 14px 16px; }
.rates b { display: block; font-family: var(--font-head); font-size: 24px; color: var(--gold); font-weight: 600; }
.rates span { font-size: 13px; color: var(--light-on-dark); }
.steps { display: flex; flex-direction: column; gap: 20px; max-width: 580px; }
.steps > div { display: grid; grid-template-columns: 32px 1fr; gap: 16px; }
.steps .n { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--night); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; }
.steps b { display: block; font-size: 16px; font-weight: 600; }
.steps span { font-size: 14px; color: var(--light-on-dark); }
.steps.mob { display: none; }
.pub-card { background: var(--white); color: var(--night); border-radius: 20px; padding: 32px; box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
.pub-card h2 { font-size: 24px; }
.pub-card .sub { font-size: 14px; color: var(--slate); margin-top: 4px; }
.terms-box { background: var(--offwhite); border: 1px solid var(--mist); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.terms-box .ticks div { font-size: 13px; color: var(--night); gap: 10px; }
.center-card { max-width: 440px; width: 100%; margin: 64px auto 0; }
.key-ic { width: 48px; height: 48px; border-radius: 12px; background: var(--gold-tint); color: var(--warning); display: flex; align-items: center; justify-content: center; }
.done-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--success-tint); color: var(--success); display: flex; align-items: center; justify-content: center; }
.next-box { background: var(--offwhite); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.next-box div { display: flex; gap: 12px; font-size: 15px; align-items: flex-start; }
.next-box .icon { color: var(--warning); margin-top: 2px; }

/* terms page */
.terms-hero { padding: 48px 120px 56px; max-width: 1440px; margin: 0 auto; width: 100%; }
.terms-hero h1 { font-size: 48px; line-height: 1.1667; letter-spacing: -.96px; margin: 16px 0; }
.terms-hero p { color: var(--light-on-dark); font-size: 18px; max-width: 720px; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--white-10); border: 1px solid var(--white-12); font-size: 13px; font-weight: 500; }
.terms-page { background: var(--white); color: var(--night); }
.terms-layout { max-width: 1440px; margin: 0 auto; padding: 64px 120px 96px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 80px; }
.toc { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: flex; gap: 10px; padding: 7px 12px; font-size: 14px; color: var(--slate); text-decoration: none; border-left: 2px solid transparent; border-radius: 0 8px 8px 0; }
.toc a span { color: var(--slate-2); }
.toc a:hover, .toc a.on { color: var(--night); background: var(--offwhite); border-left-color: var(--gold); }
.terms-article { max-width: 860px; display: flex; flex-direction: column; gap: 48px; }
.terms-article section { scroll-margin-top: 24px; }
.terms-article h2 { display: flex; align-items: center; gap: 16px; font-size: 24px; margin-bottom: 16px; }
.terms-article h2 .n { width: 32px; height: 32px; border-radius: 50%; background: var(--night); color: var(--gold); font-size: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.terms-article p, .terms-article li { font-size: 16px; line-height: 1.625; color: #24364F; }
.terms-article p { padding-left: 48px; }
.terms-article p + p, .terms-article .rate-table + p { margin-top: 12px; }
.terms-article ul { list-style: none; padding: 0 0 0 48px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.terms-article li { position: relative; padding-left: 18px; }
.terms-article li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.rate-table { margin: 16px 0 0 48px; border: 1px solid var(--mist); border-radius: 12px; overflow: hidden; max-width: 560px; }
.rate-table div { display: flex; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--mist); font-size: 15px; }
.rate-table div:first-child { border-top: 0; background: var(--offwhite); font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--slate); }
.rate-table b { font-weight: 600; }
.cta-strip { margin-left: 48px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; padding: 24px 28px; background: var(--offwhite); border: 1px solid var(--mist); border-radius: 16px; }
.foot { background: linear-gradient(180deg, #0B1F3A, #091A31); color: var(--white); }
.foot .inner { max-width: 1440px; margin: 0 auto; padding: 72px 120px 32px; }
.foot .cols4 { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot h4 { font-family: var(--font-body); font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.foot a, .foot li { color: var(--light-on-dark); text-decoration: none; font-size: 15px; }
.foot a:hover { color: var(--gold); }
.foot .tag-line { font-family: var(--font-head); font-size: 20px; margin: 16px 0 12px; }
.foot .bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--white-10); font-size: 13px; color: var(--light-on-dark); }

/* ================================================================ RESPONSIVE */
@media (max-width: 1279px) {
  .pub-nav { padding: 0 40px; }
  .pub-main, .terms-hero, .terms-layout, .foot .inner { padding-left: 40px; padding-right: 40px; }
  .pub-split { grid-template-columns: minmax(0, 1fr) 500px; gap: 40px; }
  .pub-links { gap: 16px; }
  .pub-actions { gap: 8px; }
  .pub-actions .btn { padding: 0 16px; }
  .pub-ref { margin-right: 4px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .cols, .cols.wide-side { grid-template-columns: minmax(0, 1fr) 300px; }
  .payrow { grid-template-columns: 1fr 1fr; padding-left: 24px; }
}

@media (max-width: 1023px) {
  /* admin: sidebar becomes a drawer */
  .admin { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .admin.open .sidebar { transform: none; }
  .admin.open .admin-drawer-scrim { display: block; position: fixed; inset: 0; background: rgba(11, 31, 58, .5); z-index: 39; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 12px 0 16px; background: var(--night); position: sticky; top: 0; z-index: 30; }
  .mobile-bar .iconbtn { color: var(--white); }
  .admin-main { padding: 24px 16px 48px; gap: 20px; }
  .cols, .cols.wide-side, .cols.left-list { grid-template-columns: minmax(0, 1fr); }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip > div:nth-child(3) { border-left: 0; }
  .strip > div:nth-child(n+3) { border-top: 1px solid var(--mist); }

  /* public */
  .pub-links, .pub-actions { display: none; }
  .pub-nav { height: 68px; padding: 0 20px; }
  .pub-right { display: flex; gap: 8px; }
  .pub-wa, .pub-burger { display: inline-flex; width: 44px; height: 44px; border-radius: 10px; border: 1px solid rgba(242, 184, 75, .6); background: var(--white-10); align-items: center; justify-content: center; color: var(--white); cursor: pointer; }
  .pub-wa { color: var(--whatsapp); }
  .pub-menu.open { display: flex; flex-direction: column; gap: 4px; padding: 12px 20px 20px; background: rgba(11, 31, 58, .95); border-bottom: 1px solid var(--white-10); }
  .pub-menu a:not(.btn) { color: var(--white); text-decoration: none; padding: 12px 0; font-size: 17px; border-bottom: 1px solid var(--white-10); }
  .pub-menu .btn { margin-top: 12px; height: 48px; }
  .pub-main { padding: 32px 20px 64px; }
  .pub-split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .pub-copy { padding-top: 0; gap: 20px; }
  .pub-copy h1 { font-size: 32px; line-height: 1.25; letter-spacing: -.64px; }
  .pub-copy .lead { font-size: 17px; }
  .steps.desk { display: none; }
  .steps.mob { display: flex; }
  .terms-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .toc { position: static; }
  .foot .cols4 { grid-template-columns: 1fr 1fr; }

  /* referrer */
  .ref-top .inner { height: 64px; padding: 0 20px; gap: 16px; justify-content: space-between; }
  .ref-tabs { display: none; }
  .ref-user .nm, .ref-user > button > .icon { display: none; }
  .ref-main { padding: 24px 20px 48px; gap: 20px; }
  .ref-main h1 { font-size: 26px; }
  .ref-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 719px) {
  .metrics { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric { padding: 16px; }
  .metric .value { font-size: 22px; }
  .page-head h1 { font-size: 26px; }
  .page-head > .row { width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  /* Standalone text buttons (Forgot password?, Edit…) get a full-size tap target. */
  button.linkbtn { min-height: 44px; }
  .btn.mark-paid { height: 44px; padding: 0 16px; }
  .account button { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .menu a, .menu button { min-height: 44px; }
  .card-head, .toolbar { padding: 16px; }
  .card.pad { padding: 20px; }
  /* tables stack into cards */
  .thead { display: none; }
  .trow { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 14px 16px; align-items: center; }
  .trow > * { flex: 0 1 auto; }
  .trow > :first-child { flex: 1 1 100%; }
  .trow > [data-label]::before { content: attr(data-label) " "; color: var(--slate); font-size: 12px; font-weight: 500; }
  .trow > .num { text-align: left; }
  .trow > .m-hide { display: none; }
  .app-card { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .app-card > .avatar { display: none; }
  .app-card .detail { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .app-flag { padding: 12px 16px; }
  .payrow { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .capt { grid-template-columns: minmax(0, 1fr); }
  .modal-head, .modal-body { padding-left: 20px; padding-right: 20px; }
  .modal-foot { padding: 16px 20px; }
  .choice { grid-template-columns: repeat(2, 1fr); }
  .toasts { right: 16px; bottom: 16px; }
  .pub-card { padding: 24px 20px; border-radius: 16px; }
  .pub-main { padding-left: 12px; padding-right: 12px; }
  .pub-copy { padding: 0 8px; }
  .announce .wide { display: none; }
  .rates { grid-template-columns: 1fr 1fr; }
  .terms-hero { padding: 32px 20px 40px; }
  .terms-hero h1 { font-size: 32px; line-height: 1.25; }
  .terms-layout { padding: 32px 20px 64px; }
  .terms-article p, .terms-article ul { padding-left: 0; }
  .rate-table, .cta-strip { margin-left: 0; }
  .foot .inner { padding: 48px 20px 24px; }
  .foot .cols4 { grid-template-columns: 1fr; }
  .foot .bottom { flex-direction: column; }
  .code-hero { padding: 24px 20px; border-radius: 16px; }
  .code-hero .big { font-size: 30px; margin: 8px 0 16px; }
  .linkbar { flex-wrap: wrap; padding: 12px; }
  .linkbar .url { flex: 1 1 calc(100% - 40px); }
  .ref-desk-stats { display: none; }
  .ref-mobile-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border: 1px solid var(--mist); border-radius: 14px; }
  .ref-mobile-stats > div { padding: 12px 14px; min-width: 0; }
  .ref-mobile-stats > div + div { border-left: 1px solid var(--mist); }
  .ref-mobile-stats .k { font-size: 12px; color: var(--slate); }
  .ref-mobile-stats .v { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
}
.icon.wa, .btn .icon.wa { color: var(--whatsapp); }
.cta-strip p { padding-left: 0 !important; }
