/* ==========================================================================
   Swahili Dating design system. Colours live ONLY here, as variables.
   ========================================================================== */
:root {
  --primary: #D33652;
  --primary-dark: #A8243D;
  --primary-soft: #FCE8EB;
  --blush: #FFF4F2;
  --surface: #FFFFFF;
  --surface-alt: #F7F3F2;
  --app-bg: #FAF7F6;
  --text: #1E1A1F;
  --text-muted: #6B6268;
  --border: #EDE3E1;
  --divider: #F2E9E7;
  --online: #2F8F5B;
  --verified: #3B82F6;
  --danger: #B42335;

  --role-admin: #1E1A1F;
  --role-manager: #2563EB;
  --role-user: #D33652;

  /* status pills (text / background pairs ≥ 4.5:1) */
  --pill-blue: #1D4ED8;   --pill-blue-bg: #E8EFFE;
  --pill-green: #1F6E43;  --pill-green-bg: #E4F4EA;
  --pill-orange: #9A4A0B; --pill-orange-bg: #FDEEDC;
  --pill-amber: #8A5A00;  --pill-amber-bg: #FDF3D7;
  --pill-red: #A11D2E;    --pill-red-bg: #FCE6E8;
  --pill-violet: #5B33B6; --pill-violet-bg: #EFE9FC;
  --pill-gray: #5D555A;   --pill-gray-bg: #F1ECEB;

  --on-primary: #FFFFFF;
  --overlay: rgba(30, 26, 31, 0.55);
  --photo-shade: linear-gradient(180deg, rgba(30, 26, 31, 0) 45%, rgba(30, 26, 31, 0.78) 100%);
  --shadow-sm: 0 1px 2px rgba(30, 26, 31, 0.06);
  --shadow: 0 10px 30px rgba(30, 26, 31, 0.08);
  --shadow-lg: 0 24px 60px rgba(168, 36, 61, 0.18);
  --focus: 0 0 0 3px var(--surface), 0 0 0 6px var(--primary);

  --radius-pill: 999px;
  --radius-card: 24px;
  --radius-card-lg: 28px;
  --radius-input: 16px;
  --sidebar-w: 264px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; font-weight: 500; line-height: 1.6;
  color: var(--text); background: var(--surface);
}
@media (min-width: 768px) { body { font-size: 16px; } }
img { max-width: 100%; display: block; }
a { color: var(--primary-dark); text-underline-offset: 3px; }
a:hover { color: var(--primary); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
h1, .h1 { font-size: clamp(28px, 2.4vw, 32px); }
h2, .h2 { font-size: 22px; }
h3, .h3 { font-size: 18px; }
p { margin: 0 0 1em; }
.display { font-size: clamp(40px, 6vw, 64px); font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; }
.display-sm { font-size: 40px; }
.label { font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 12px; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: var(--radius-pill); z-index: 100; }
.skip-link:focus { top: 12px; }
.icon { flex: none; vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--divider); margin: 24px 0; }

/* layout utilities */
.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.stack > * + * { margin-top: var(--gap, 16px); }
.stack-lg { --gap: 24px; }
.stack-sm { --gap: 8px; }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, 12px); align-items: center; }
.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap, 20px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.w-full { width: 100%; }
.grow { flex: 1; min-width: 0; }
.narrow { max-width: 820px; }
.align-start { align-items: start; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.photo-strip img { aspect-ratio: 3/4; object-fit: cover; border-radius: 16px; width: 100%; }
.inline { display: inline; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-fg);
  font: 700 15px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { color: var(--btn-fg); border-color: var(--text-muted); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary); --btn-border: var(--primary); }
.btn-primary:hover { --btn-bg: var(--primary-dark); border-color: var(--primary-dark); }
.btn-soft { --btn-bg: var(--primary-soft); --btn-fg: var(--primary-dark); --btn-border: var(--primary-soft); }
.btn-soft:hover { border-color: var(--primary); }
.btn-dark { --btn-bg: var(--text); --btn-fg: var(--surface); --btn-border: var(--text); }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-border: var(--border); }
.btn-danger:hover { --btn-bg: var(--pill-red-bg); border-color: var(--danger); }
.btn-danger-solid { --btn-bg: var(--danger); --btn-fg: var(--on-primary); --btn-border: var(--danger); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn-ghost:hover { --btn-bg: var(--surface-alt); border-color: transparent; }
.btn-lg { min-height: 58px; padding: 0 32px; font-size: 16px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 52px; min-height: 52px; padding: 0; }
.btn-round { border-radius: 50%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary-dark); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: 13px; font-weight: 600; }
.input, .select, .textarea,
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: var(--radius-input);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font: 500 16px/1.4 var(--font); transition: border-color .15s, box-shadow .15s;
}
.field textarea, .textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft);
}
.field .help { font-size: 13px; color: var(--text-muted); }
.field-error, .errorlist { color: var(--danger); font-size: 13px; font-weight: 600; margin: 0; padding: 0; list-style: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.select-sm { min-height: 36px; padding: 4px 12px; width: auto; font-size: 14px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: grid; place-items: center; padding: 0 14px; border: 1.5px solid var(--border); border-right: 0; border-radius: var(--radius-input) 0 0 var(--radius-input); background: var(--surface-alt); font-weight: 700; }
.input-prefix input { border-radius: 0 var(--radius-input) var(--radius-input) 0 !important; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span, .chip-static {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border-radius: var(--radius-pill); border: 1.5px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--text); transition: all .15s;
}
.chip input:checked + span, .chip-static.is-selected { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.chip input:focus-visible + span { box-shadow: var(--focus); }
.chip input:disabled + span { opacity: .45; }
.chip-static.is-shared { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

/* toggle switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--divider); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch-label { font-size: 15px; font-weight: 700; }
.select-filter { width: auto; min-height: 46px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 52px; height: 30px; border-radius: var(--radius-pill); background: var(--border); transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus); }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; }
.card-lg { border-radius: var(--radius-card-lg); padding: 32px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; }
.blush { background: var(--blush); border-color: var(--blush); }

/* avatar */
.avatar { position: relative; flex: none; width: var(--size, 44px); height: var(--size, 44px); border-radius: 50%; overflow: visible; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-weight: 800; font-size: calc(var(--size, 44px) * .38); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .dot { position: absolute; right: 1px; bottom: 1px; width: 28%; height: 28%; min-width: 10px; min-height: 10px; border-radius: 50%; background: var(--online); border: 2px solid var(--surface); }
.verified { color: var(--verified); display: inline-flex; }

/* role badge */
.role-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; color: var(--on-primary); background: var(--role-user); }
.role-badge--ADMIN { background: var(--role-admin); }
.role-badge--MANAGER { background: var(--role-manager); }
.role-badge--USER { background: var(--role-user); }

/* status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--pill-gray); background: var(--pill-gray-bg); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--blue { color: var(--pill-blue); background: var(--pill-blue-bg); }
.pill--green { color: var(--pill-green); background: var(--pill-green-bg); }
.pill--orange { color: var(--pill-orange); background: var(--pill-orange-bg); }
.pill--amber { color: var(--pill-amber); background: var(--pill-amber-bg); }
.pill--red { color: var(--pill-red); background: var(--pill-red-bg); }
.pill--violet { color: var(--pill-violet); background: var(--pill-violet-bg); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 800; }

/* flash messages */
.flashes { display: grid; gap: 10px; margin-bottom: 20px; }
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; }
.flash--success { background: var(--pill-green-bg); border-color: var(--pill-green-bg); color: var(--pill-green); }
.flash--error { background: var(--pill-red-bg); border-color: var(--pill-red-bg); color: var(--pill-red); }
.flash--warning { background: var(--pill-amber-bg); border-color: var(--pill-amber-bg); color: var(--pill-amber); }
.flash--info { background: var(--pill-blue-bg); border-color: var(--pill-blue-bg); color: var(--pill-blue); }
.flash button { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; }
.dev-note { border: 1.5px dashed var(--primary); background: var(--primary-soft); color: var(--primary-dark); padding: 10px 14px; border-radius: 14px; font-size: 14px; }

/* empty state */
.empty-state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 24px; }
.empty-state .empty-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty-state p { max-width: 40ch; color: var(--text-muted); }

/* stat card */
.stat-card { display: grid; gap: 6px; text-decoration: none; color: inherit; }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-alt); color: var(--text); }
.stat-card .stat-value { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
a.stat-card:hover { border-color: var(--text-muted); color: inherit; }

/* modal */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-card-lg); width: min(480px, 100% - 32px); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: var(--overlay); }
.modal-body { padding: 28px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.match-modal { text-align: center; background: var(--blush); }
.match-modal .pair { display: flex; justify-content: center; margin: 12px 0 20px; }
.match-modal .pair .avatar { --size: 104px; border: 4px solid var(--surface); }
.match-modal .pair .avatar + .avatar { margin-left: -18px; }

/* tabs */
.tabs { display: inline-flex; gap: 6px; padding: 6px; border-radius: var(--radius-pill); background: var(--surface-alt); }
.tab { min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius-pill); background: transparent; font: 700 14px var(--font); color: var(--text-muted); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.tab[aria-selected="true"], .tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- public site */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--divider); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: var(--text); text-decoration: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--text-muted); font-weight: 600; text-decoration: none; }
.site-nav a:hover { color: var(--text); }
@media (max-width: 760px) { .site-nav { display: none; } }

.hero { background: var(--blush); overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 72px 0 88px; }
.hero .lead { font-size: 18px; color: var(--text-muted); max-width: 46ch; margin: 20px 0 32px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--surface); color: var(--primary-dark); font-size: 13px; font-weight: 700; margin-bottom: 20px; }
.trust { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 28px; color: var(--text-muted); font-size: 14px; font-weight: 600; }
.trust span { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; padding: 48px 0 64px; } }

.phone { position: relative; width: min(320px, 100%); margin-inline: auto; aspect-ratio: 9 / 18.5; border-radius: 44px; background: var(--text); padding: 12px; box-shadow: var(--shadow-lg); transform: rotate(3deg); }
.phone-screen { height: 100%; border-radius: 34px; background: var(--app-bg); overflow: hidden; display: flex; flex-direction: column; padding: 14px; gap: 12px; }
.phone-card { position: relative; flex: 1; border-radius: 24px; overflow: hidden; background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%); }
.phone-card .shade { position: absolute; inset: 0; background: var(--photo-shade); }
.phone-card .who { position: absolute; left: 16px; right: 16px; bottom: 16px; color: var(--on-primary); }
.phone-card .who strong { font-size: 22px; display: block; }
.phone-actions { display: flex; justify-content: center; gap: 14px; }
.phone-actions span { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); color: var(--text-muted); }
.phone-actions span.like { background: var(--primary); color: var(--on-primary); }
.floating-chip { position: absolute; background: var(--surface); border-radius: var(--radius-pill); padding: 10px 16px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); display: inline-flex; gap: 8px; align-items: center; transform: rotate(-3deg); }

.phone-wrap { position: relative; padding: 24px 0; }
.floating-chip.chip-a { top: 12%; left: 0; color: var(--primary-dark); }
.floating-chip.chip-b { bottom: 14%; right: 0; transform: rotate(4deg); }
@media (max-width: 480px) { .floating-chip { display: none; } }
.section { padding: 88px 0; }
.section.pt-0 { padding-top: 0; }
.section-sm { padding: 40px 0 64px; }
.app-bg { background: var(--app-bg); }
.center-icon { margin-inline: auto; }
.center-cluster { justify-content: center; }
.error-page .empty-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--text-muted); font-size: 17px; }
.steps { counter-reset: step; }
.step { position: relative; }
.step .num { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font-weight: 800; font-size: 20px; margin-bottom: 16px; }
.safety { background: var(--text); color: var(--surface); border-radius: var(--radius-card-lg); padding: 48px; }
.safety .muted-inv { color: color-mix(in srgb, var(--surface) 72%, transparent); }
.safety .feature { display: flex; gap: 14px; }
.safety .feature .icon-wrap { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 12%, transparent); flex: none; }
.app-banner { background: var(--primary); color: var(--on-primary); border-radius: var(--radius-card-lg); padding: 48px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.app-banner .btn { --btn-bg: var(--surface); --btn-fg: var(--primary-dark); --btn-border: var(--surface); }
.site-footer { border-top: 1px solid var(--divider); padding: 40px 0; color: var(--text-muted); font-size: 14px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--text-muted); }

/* auth split */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand { background: var(--blush); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand .quote { font-size: 28px; font-weight: 800; line-height: 1.25; max-width: 18ch; letter-spacing: -0.02em; }
.auth-panel { display: grid; place-items: center; padding: 48px 24px; }
.auth-box { width: min(420px, 100%); }
.auth-box h1 { margin-bottom: 8px; }
.staff .auth-brand { background: var(--text); color: var(--surface); }
.staff .auth-brand .logo { color: var(--surface); }
@media (max-width: 860px) { .auth-split { grid-template-columns: 1fr; } .auth-brand { padding: 24px; gap: 24px; } .auth-brand .quote { font-size: 22px; } }

/* ---------------------------------------------------------------- app shells */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) 1fr; background: var(--app-bg); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 24px 16px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.sidebar .logo { padding: 0 12px 16px; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; border-radius: 20px; background: var(--surface-alt); }
.sidebar-user .who { min-width: 0; }
.sidebar-user .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-button { width: 100%; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: var(--radius-pill); color: var(--text-muted); font-weight: 600; text-decoration: none; }
.nav-link:hover { background: var(--surface-alt); color: var(--text); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.nav-link .count { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--divider); }
.main { min-width: 0; padding: 32px clamp(16px, 3vw, 40px) 56px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text-muted); text-decoration: none; margin-bottom: 8px; }

/* staff shell: calmer + role strip */
.staff-shell { --nav-active-bg: var(--surface-alt); }
.role-strip { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 30; background: var(--role-color, var(--role-manager)); }
.staff-shell .sidebar { padding-top: 28px; }
.staff-shell .nav-link.is-active { background: var(--surface-alt); color: var(--text); box-shadow: inset 3px 0 0 var(--role-color); border-radius: 14px; }
.staff-shell .nav-link { border-radius: 14px; }
.staff-shell .main { padding-top: 36px; }
.role-ADMIN { --role-color: var(--role-admin); }
.role-MANAGER { --role-color: var(--role-manager); }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; padding: 12px 12px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .logo { padding: 4px 4px 8px; }
  .sidebar-user { margin: 0; }
  .nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 12px; scrollbar-width: none; }
  .nav-link { flex: none; min-height: 44px; }
  .sidebar-foot { display: none; }
  .main { padding-top: 20px; }
}

/* ---------------------------------------------------------------- tables */
.table-card { padding: 0; overflow: hidden; }
.table-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--divider); }
.table-toolbar .search { position: relative; flex: 1 1 240px; }
.table-toolbar .search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.table-toolbar .search input { padding-left: 46px; min-height: 46px; }
.table-toolbar select { min-height: 46px; width: auto; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 20px; background: var(--surface-alt); white-space: nowrap; }
.data-table th a { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.data-table th[aria-sort="ascending"] a::after { content: "↑"; }
.data-table th[aria-sort="descending"] a::after { content: "↓"; }
.data-table td { height: 56px; padding: 8px 20px; border-top: 1px solid var(--divider); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--app-bg); }
.data-table .person { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.data-table .person .avatar { --size: 36px; }
.data-table a.row-link { color: var(--text); font-weight: 700; text-decoration: none; }
.data-table a.row-link:hover { color: var(--primary-dark); text-decoration: underline; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--divider); font-size: 14px; color: var(--text-muted); }
.htmx-request .table-scroll, .htmx-request.table-scroll { opacity: .55; transition: opacity .2s; }

/* list rows (inside cards) */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.list > li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.kv dt { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }

/* bar charts: single series, one hue, thin bars, 2px gap, 4px rounded data-end on the baseline */
.chart { margin: 0; display: grid; gap: 6px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 8px; border-bottom: 1px solid var(--divider); }
.bar-hit { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; border-radius: 4px 4px 0 0; }
.bar-hit:focus-visible { box-shadow: var(--focus); }
.bars .bar { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--primary); }
.bar-hit:hover .bar, .bar-hit:focus .bar { background: var(--primary-dark); }
.bar-hit::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5; }
.bar-hit:hover::after, .bar-hit:focus::after { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.table-view summary { cursor: pointer; color: var(--text-muted); font-weight: 600; }
.data-table.compact td { height: 36px; padding: 4px 12px; }
.meter { height: 8px; border-radius: var(--radius-pill); background: var(--surface-alt); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--role-manager); border-radius: inherit; }

/* staff page helpers */
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.staff-grid { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 1100px) { .staff-grid { grid-template-columns: 1fr; } }
.filter-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.filter-row .field { min-width: 180px; }
.nowrap { white-space: nowrap; }
.code { font: 600 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; padding: 4px 8px; border-radius: 8px; background: var(--surface-alt); color: var(--text); }
.input.input-days { width: 96px; min-height: 44px; }
.input.input-emoji { width: 64px; min-height: 40px; text-align: center; padding: 6px; }
.input.input-name { width: 180px; min-height: 40px; padding: 6px 12px; }
.flash-link { text-decoration: none; }
.chat-review { max-height: 420px; border-radius: 18px; border: 1px solid var(--border); }

/* ---------------------------------------------------------------- member features */
/* onboarding */
.onboarding { max-width: 760px; margin: 0 auto; }
.photo-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.photo-slot { position: relative; aspect-ratio: 3/4; border-radius: 20px; border: 2px dashed var(--border); background: var(--surface-alt); display: grid; place-items: center; overflow: hidden; color: var(--text-muted); }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot:focus-within { box-shadow: var(--focus); }
.photo-slot .remove { position: absolute; top: 8px; right: 8px; z-index: 2; }
.photo-slot.filled { border-style: solid; }

/* discover */
.discover { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1100px) { .discover { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; } }
.photo-card { position: relative; aspect-ratio: 3/4; border-radius: var(--radius-card-lg); overflow: hidden; background: var(--surface-alt); box-shadow: var(--shadow); }
.photo-card > img { width: 100%; height: 100%; object-fit: cover; }
.photo-card .shade { position: absolute; inset: 0; background: var(--photo-shade); pointer-events: none; }
.photo-card .info { position: absolute; left: 20px; right: 20px; bottom: 20px; color: var(--on-primary); }
.photo-card .info .name { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.photo-card .info .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; font-weight: 600; opacity: .95; }
.photo-card .badge-top { position: absolute; top: 16px; left: 16px; }
.photo-card .badge-top .pill { background: var(--surface); }
.photo-card .dots { position: absolute; top: 10px; left: 16px; right: 16px; display: flex; gap: 4px; }
.photo-card .dots span { flex: 1; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--surface) 45%, transparent); }
.photo-card .dots span.on { background: var(--surface); }
.photo-card .no-photo { width: 100%; height: 100%; display: grid; place-items: center; font-size: 96px; font-weight: 800; color: var(--primary); background: var(--primary-soft); }
.photo-card.small { aspect-ratio: 4/5; border-radius: var(--radius-card); box-shadow: none; }
.photo-card.small .info .name { font-size: 20px; }
.action-bar { display: flex; justify-content: center; gap: 20px; margin-top: -32px; position: relative; z-index: 2; }
.action { width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface); color: var(--text-muted); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s; }
.action:hover { transform: translateY(-2px) scale(1.04); }
.action.pass:hover { color: var(--danger); }
.action.super { width: 56px; height: 56px; margin-top: 4px; color: var(--verified); }
.action.like { width: 72px; height: 72px; margin-top: -4px; background: var(--primary); color: var(--on-primary); }
.action.like:hover { background: var(--primary-dark); }
.likes-left { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 14px; }
.side-panel .section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 10px; }

/* matches */
.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.match-card { text-decoration: none; color: inherit; display: block; }
.match-card .photo-card { transition: transform .15s; }
.match-card:hover .photo-card { transform: translateY(-3px); }
.blurred img { filter: blur(14px) saturate(.9); transform: scale(1.1); }

/* chat */
.chat-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr) 280px; height: calc(100vh - 88px); min-height: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-list h2 { padding: 20px 20px 8px; margin: 0; }
.convo { display: flex; gap: 12px; align-items: center; padding: 12px 20px; text-decoration: none; color: inherit; border-left: 3px solid transparent; }
.convo:hover { background: var(--app-bg); }
.convo.is-active { background: var(--blush); border-left-color: var(--primary); }
.convo .preview { font-size: 14px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo .body { min-width: 0; flex: 1; }
.convo .name { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.chat-thread { display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; background: var(--app-bg); }
.bubble { max-width: min(75%, 520px); padding: 10px 16px; border-radius: 22px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.theirs { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.bubble.mine { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 6px; }
.bubble time { display: block; font-size: 11px; opacity: .75; margin-top: 2px; }
.chat-compose { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.chat-compose textarea { flex: 1; min-height: 52px; max-height: 140px; resize: none; border-radius: 26px; padding: 14px 20px; border: 1.5px solid var(--border); font: 500 15px var(--font); }
.chat-compose textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.compose-error { padding: 0 20px; }
.compose-error:empty { display: none; }
.grow-center { flex: 1; align-content: center; }
.chat-head .row-link { color: var(--text); text-decoration: none; }
.mobile-only { display: none; }
@media (max-width: 760px) { .mobile-only { display: inline-flex; } }
.chat-closed { padding: 18px 20px; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); }
.chat-profile { border-left: 1px solid var(--border); padding: 24px 20px; overflow-y: auto; }
.chat-profile .photo-card { box-shadow: none; }
.day-sep { align-self: center; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 4px 12px; border-radius: var(--radius-pill); background: var(--surface-alt); }
@media (max-width: 1200px) { .chat-layout { grid-template-columns: 300px minmax(0, 1fr); } .chat-profile { display: none; } }
@media (max-width: 760px) {
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 160px); }
  .chat-layout.has-thread .chat-list { display: none; }
  .chat-layout:not(.has-thread) .chat-thread { display: none; }
}

/* support */
.ticket-thread { display: grid; gap: 12px; }
.reply { padding: 16px 18px; border-radius: 20px; background: var(--surface-alt); }
.reply.staff { background: var(--pill-blue-bg); }
.reply.note { background: var(--pill-amber-bg); border: 1.5px dashed var(--pill-amber); }
.reply .who { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; margin-bottom: 6px; flex-wrap: wrap; }

/* staff review helpers */
.compare { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.compare figure { margin: 0; }
.compare figcaption { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.compare .selfie, .compare .thumbs img { border-radius: 18px; aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.compare .thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 700px) { .compare { grid-template-columns: 1fr; } }
.audit-banner { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 16px; background: var(--pill-amber-bg); color: var(--pill-amber); font-weight: 600; font-size: 14px; }

/* error pages */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 48px 20px; }
.error-page .code { font-size: 96px; font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -0.04em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Google Sign-In on /auth/ */
.or-divider { display: flex; align-items: center; gap: .75rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border, #e5e0e3); }
.google-btn-wrap { display: flex; justify-content: center; min-height: 44px; }

/* ---- Google-only sign-in, phone input, onboarding photos ---- */
.btn-google { background: #fff; color: var(--text); border: 1.5px solid #DADCE0; box-shadow: 0 1px 3px rgba(30, 26, 31, .08); gap: .75rem; }
.btn-google:hover:not(:disabled) { background: var(--surface-alt); }
.reassure { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.reassure li { display: flex; gap: .85rem; align-items: flex-start; }
.reassure li > svg { flex: none; color: var(--primary); margin-top: 2px; }
.reassure strong { display: block; font-size: 15px; }
.phone-input { display: flex; align-items: stretch; }
.phone-input select { flex: none; width: auto; min-width: 7.5rem; border-radius: var(--radius-input) 0 0 var(--radius-input); border-right: 0; background: var(--surface-alt); font-weight: 700; }
.phone-input input { flex: 1; min-width: 0; border-radius: 0 var(--radius-input) var(--radius-input) 0; }
.photo-slot--filled { border-style: solid; margin: 0; }
.photo-badge { position: absolute; left: 8px; top: 8px; z-index: 2; background: var(--surface); color: var(--text); padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.photo-remove { position: absolute; left: 8px; bottom: 8px; z-index: 2; background: var(--surface); padding: 4px 10px; border-radius: 999px; display: flex; gap: .35rem; align-items: center; font-weight: 600; cursor: pointer; }

/* ---- Settings (/profile/settings/) ---- */
.settings-page { max-width: 1040px; margin: 0 auto; }
.settings-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.back-circle { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--border); color: var(--text); background: var(--surface); }
.back-circle:focus-visible { box-shadow: var(--focus); outline: 0; }
.settings-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 18px; border-radius: 18px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 24px; }
.settings-nav ul { list-style: none; margin: 0; padding: 8px; border-radius: 18px; border: 1.5px solid var(--divider); background: var(--surface); }
.settings-nav a { display: block; padding: 10px 14px; border-radius: 12px; color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; }
.settings-nav a:hover, .settings-nav a:focus-visible { background: var(--primary-soft); color: var(--primary-dark); }
.settings-main { display: grid; gap: 22px; min-width: 0; }
.settings-profile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; border: 1.5px solid var(--divider); background: var(--surface); color: var(--text); text-decoration: none; }
.settings-profile > svg:last-child { transform: rotate(180deg); color: var(--text-muted); }
.settings-profile .ring { display: inline-flex; padding: 2px; border-radius: 50%; box-shadow: 0 0 0 2.5px var(--primary); }
.settings-profile .grow { display: flex; flex-direction: column; }
.pill { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--primary-soft); color: var(--primary-dark); white-space: nowrap; }
.pill--ok { background: #E3F4EA; color: #1F6B42; }
.settings-section { scroll-margin-top: 24px; }
.settings-label { margin: 0 0 8px 4px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.settings-card { border-radius: 18px; border: 1.5px solid var(--divider); background: var(--surface); overflow: hidden; }
.srow { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 12px 16px; margin: 0; color: var(--text); text-decoration: none; border-top: 1px solid var(--divider); flex-wrap: wrap; }
.settings-card > .srow:first-child, .settings-card > details:first-child > summary { border-top: 0; }
a.srow:hover, summary.srow:hover { background: var(--surface-alt); }
.srow-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.srow-text { flex: 1; min-width: 140px; display: flex; flex-direction: column; cursor: pointer; }
.srow-title { font-size: 15px; font-weight: 600; }
.srow-sub { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.srow-value { font-size: 14px; color: var(--text-muted); }
.srow .chev { color: var(--text-muted); font-size: 22px; line-height: 1; }
.srow-select, .srow-number { width: auto; min-height: 40px; padding: 6px 12px; border-radius: 12px; }
.srow-number { width: 90px; }
.srow-phone { flex: 1 1 240px; max-width: 320px; }
.srow-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.srow-inline input[type=time] { min-height: 40px; padding: 4px 8px; width: auto; }
.srow-details > summary { list-style: none; cursor: pointer; }
.srow-details > summary::-webkit-details-marker { display: none; }
.srow-details[open] .chev { transform: rotate(90deg); }
.srow-empty { margin: 0; padding: 12px 16px 16px 66px; color: var(--text-muted); }
.switch--mini { display: inline-flex; padding: 0; border: 0; position: relative; cursor: pointer; }
.switch--mini .switch-track { width: 48px; height: 30px; }
.saved-note { font-size: 13px; font-weight: 700; color: var(--online); }
.saved-note--error { color: var(--danger); }
.safety-tips { margin: 0; padding: 4px 24px 16px 66px; display: grid; gap: 8px; }
.danger-zone { margin-top: 18px; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); min-height: 52px; }
.text-danger { color: var(--danger) !important; }
.legal { max-width: 760px; }
.legal h2 { margin-top: 1.6em; font-size: 20px; }
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; }
  .settings-nav ul { display: flex; overflow-x: auto; gap: 4px; }
  .settings-nav a { white-space: nowrap; }
}

/* =================================================================== Admin panel */
.admin-body { --warning: #D97706; --info: #2563EB; --success: #2F8F5B; background: var(--app-bg); }
.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.role-pill { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; color: #fff; background: #1E1A1F; }
.role-pill--manager { background: #2563EB; }
.nav-group { margin-bottom: 14px; }
.nav-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-group-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); padding: 6px 10px; }
.admin-nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.admin-nav-link:hover { background: var(--surface-alt); }
.admin-nav-link.is-active { background: var(--primary-soft); color: var(--primary-dark); }
.admin-nav-link:focus-visible { outline: 0; box-shadow: var(--focus); }
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; text-align: center; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: rgba(250, 247, 246, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--divider); }
.admin-menu-toggle { display: none; }
.admin-search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; }
.admin-search input { border: 0 !important; box-shadow: none !important; background: transparent; min-height: 40px; padding: 0; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; }
.search-results:empty { display: none; }
.search-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-md, 0 12px 32px rgba(30,26,31,.12)); padding: 8px; max-height: 420px; overflow-y: auto; }
.search-panel a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.search-panel a:hover, .search-panel a:focus-visible { background: var(--surface-alt); }
.search-panel .group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 8px 10px 4px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bell { position: relative; }
.bell .nav-count { position: absolute; top: -4px; right: -4px; margin: 0; }
.avatar-menu { position: relative; }
.avatar-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.avatar-menu summary::-webkit-details-marker { display: none; }
.avatar-menu-body { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; min-width: 200px; box-shadow: 0 12px 32px rgba(30,26,31,.12); z-index: 40; }
.avatar-menu-body a, .avatar-menu-body button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.avatar-menu-body a:hover, .avatar-menu-body button:hover { background: var(--surface-alt); }
.admin-content { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px; display: grid; gap: 24px; align-content: start; }
.admin-content .page-head h1 { font-size: 28px; font-weight: 800; margin: 0; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; min-width: 0; }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.admin-grid { display: grid; gap: 24px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.kpi-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; color: var(--text); text-decoration: none; }
a.kpi-card:hover { border-color: var(--primary); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; }
.kpi-label { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); }
.kpi-icon { color: var(--primary); }
.kpi-value { font-size: 28px; font-weight: 800; margin: 6px 0 4px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.kpi-change { font-size: 12px; font-weight: 700; }
.kpi-change.up { color: var(--success); } .kpi-change.down { color: var(--danger); }
.spark { flex: 1; height: 24px; } .spark polyline { fill: none; stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pill-status { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-status--active, .pill-status--resolved, .pill-status--approved, .pill-status--sent, .pill-status--ready, .pill-status--granted, .pill-status--ok { background: #E3F4EA; color: #1F6B42; }
.pill-status--pending, .pill-status--in_review, .pill-status--scheduled, .pill-status--draft, .pill-status--warn { background: #FEF3C7; color: #8A4B00; }
.pill-status--suspended, .pill-status--capped { background: #FFEDD5; color: #9A3412; }
.pill-status--banned, .pill-status--rejected, .pill-status--failed, .pill-status--error, .pill-status--invalid { background: #FDE2E4; color: #9F1D2C; }
.pill-status--deleted, .pill-status--closed, .pill-status--dismissed, .pill-status--pending_deletion, .pill-status--cancelled { background: #EEE9E8; color: #4A4348; }
.pill-status--open, .pill-status--info, .pill-status--duplicate { background: #DBEAFE; color: #1E40AF; }
.sla { font-weight: 700; font-size: 12px; } .sla--green { color: var(--success); } .sla--amber { color: var(--warning); } .sla--red { color: var(--danger); }
.chart-box { position: relative; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--divider); overflow-x: auto; }
.admin-tabs a { padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.admin-tabs a.is-active { color: var(--primary-dark); border-color: var(--primary); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: flex; gap: 12px; }
.tl-dot { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(30, 26, 31, .35); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); z-index: 61; box-shadow: -12px 0 40px rgba(30,26,31,.15); display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--divider); }
.drawer-body { padding: 20px; overflow-y: auto; display: grid; gap: 14px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-bar input[type=search] { max-width: 260px; min-height: 40px; }
.filter-select select, .filter-select input { min-height: 40px; padding: 6px 12px; border-radius: 12px; width: auto; }
.admin-table-wrap { overflow-x: auto; border-radius: 14px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 500; }
.admin-table thead th { position: sticky; top: 0; background: var(--surface); text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.admin-table tbody tr:hover { background: var(--surface-alt); }
.bulk-bar { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--primary-soft); border-radius: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--text-muted); font-size: 13px; font-weight: 700; } .kv dd { margin: 0; }
.attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attention-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-alt); }
.side-by-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.backup-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding-left: 1.2em; font-size: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.health-ok { color: var(--success); font-weight: 800; } .health-bad { color: var(--danger); font-weight: 800; } .health-warn { color: var(--warning); font-weight: 800; }
@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: 12px 0 40px rgba(30,26,31,.15); }
  body.sidebar-open .admin-sidebar { transform: none; }
  .admin-menu-toggle { display: inline-flex; }
  .admin-grid > * { grid-column: span 12 !important; }
  .side-by-side { grid-template-columns: 1fr; }
}

[data-shortcut-item].is-current { outline: 2px solid var(--primary, #e11d48); outline-offset: 2px; }
