/* PLOD — product styles on top of the Operations design system (styles.css). Every colour, size and
   space is a token from tokens/*.css; the two themes only re-point the semantic aliases. */

:root {
  --text-faint: var(--grey-600);
  --text-accent: var(--df-orange-700);
  --status-success-text: #0F7A37;
  --status-warning-text: #8A5A00;
  --status-danger-text: #B42318;
  --status-info-text: var(--df-azure-700);
  --surface-nav: color-mix(in srgb, var(--white) 88%, transparent);
  --hero-overlay: linear-gradient(100deg, rgba(12, 15, 34, 0.94) 0%, rgba(18, 23, 43, 0.82) 55%, rgba(18, 23, 43, 0.55) 100%);
  --map-land: var(--df-navy-050);
  --map-line: var(--df-navy-100);
  color-scheme: light;
}
[data-theme="dark"] {
  --text-strong: var(--white);
  --text-body: var(--grey-200);
  --text-muted: var(--grey-400);
  --text-faint: var(--grey-400);
  --text-link: var(--df-azure-300);
  --text-accent: var(--df-orange-400);
  --surface-page: var(--df-navy-950);
  --surface-card: var(--df-navy-900);
  --surface-subtle: var(--df-navy-800);
  --surface-sunken: var(--df-navy-950);
  --surface-accent-soft: color-mix(in srgb, var(--df-orange-500) 16%, var(--df-navy-900));
  --surface-nav: color-mix(in srgb, var(--df-navy-950) 88%, transparent);
  --border-subtle: var(--df-navy-700);
  --border-default: var(--df-navy-600);
  --status-success-text: #4ADE80;
  --status-warning-text: #F5B454;
  --status-danger-text: #FF8A80;
  --status-info-text: var(--df-azure-300);
  --map-land: var(--df-navy-800);
  --map-line: var(--df-navy-600);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}
[data-theme="dark"] a:hover { color: var(--df-azure-100); }
/* Surfaces that are always dark (hero, rank card, footer, sidebar) carry the dark palette in both themes. */
.hero, .rank-card, .footer, .sidebar, .toast {
  --text-strong: var(--white); --text-body: var(--grey-200); --text-muted: var(--grey-300); --text-link: var(--df-azure-300); --text-accent: var(--df-orange-400);
  --status-success-text: #4ADE80; --status-warning-text: #F5B454; --status-danger-text: #FF8A80; --status-info-text: var(--df-azure-300);
  --surface-sunken: var(--df-navy-800); --surface-subtle: var(--df-navy-800); --border-subtle: var(--df-navy-700);
}

html { scroll-behavior: smooth; }
body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }
.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; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 28px; height: 28px; }

.container { width: 100%; max-width: var(--container-lg); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 720px) { .container { padding: 0 var(--space-6); } }
.stack { display: grid; gap: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-body-sm); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.money { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: var(--fw-semibold); color: var(--text-strong); }
.num { font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* ---- Top navigation ---- */
.topnav { position: sticky; top: 0; z-index: 40; background: var(--surface-nav); backdrop-filter: blur(12px); border-bottom: var(--border-hairline) solid var(--border-subtle); }
.topnav__inner { height: var(--topbar-height); display: flex; align-items: center; gap: var(--space-4); }
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--text-strong); font-weight: var(--fw-bold); letter-spacing: var(--ls-heading); text-decoration: none; }
.brand:hover { text-decoration: none; color: var(--text-strong); }
.brand img { height: 32px; width: auto; }
.brand__tag { font-size: var(--fs-overline); letter-spacing: var(--ls-overline); text-transform: uppercase; color: var(--text-muted); font-weight: var(--fw-semibold); display: none; }
@media (min-width: 900px) { .brand__tag { display: inline; } }
.nav-links { display: none; gap: var(--space-1); margin-left: auto; align-items: center; }
.nav-links a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--text-body); font-weight: var(--fw-medium); text-decoration: none; }
.nav-links a:hover { background: var(--surface-subtle); text-decoration: none; color: var(--text-strong); }
.nav-links a.is-active { color: var(--text-accent); background: var(--surface-accent-soft); }
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }
@media (min-width: 900px) { .nav-actions { margin-left: 0; } }
.nav-toggle { display: inline-flex; }
@media (min-width: 900px) { .nav-toggle { display: none; } }
.nav-drawer { display: none; border-top: var(--border-hairline) solid var(--border-subtle); background: var(--surface-card); padding: var(--space-2) 0; }
.nav-drawer.is-open { display: block; }
.nav-drawer a { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: 0 var(--space-4); color: var(--text-body); font-weight: var(--fw-medium); text-decoration: none; }
.nav-drawer a.is-active { color: var(--text-accent); }
@media (min-width: 900px) { .nav-drawer { display: none !important; } }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-md); border: var(--border-hairline) solid var(--border-default); background: var(--surface-card); color: var(--text-strong); font-weight: var(--fw-semibold); cursor: pointer; text-decoration: none; transition: background var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard); white-space: nowrap; }
.btn:hover { background: var(--surface-subtle); text-decoration: none; color: var(--text-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.6; cursor: not-allowed; }
.btn--primary { background: var(--df-orange-500); border-color: var(--df-orange-500); color: var(--df-navy-950); box-shadow: var(--shadow-accent); }
.btn--primary:hover { background: var(--df-orange-400); border-color: var(--df-orange-400); color: var(--df-navy-950); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-subtle); }
.btn--dark { background: var(--df-navy-800); border-color: var(--df-navy-800); color: var(--white); }
.btn--dark:hover { background: var(--df-navy-700); color: var(--white); }
.btn--danger { color: var(--status-danger-text); border-color: currentColor; }
.btn--sm { min-height: 36px; padding: 0 var(--space-3); font-size: var(--fs-body-sm); }
.btn--icon { width: 44px; padding: 0; }
.btn--block { width: 100%; }

/* ---- Hero ---- */
.hero { position: relative; color: var(--white); background: var(--df-navy-950); overflow: hidden; }
.hero__photo { position: absolute; inset: 0; background-image: url('/assets/hero-generated.webp'); background-size: cover; background-position: center; }
.hero__overlay { position: absolute; inset: 0; background: var(--hero-overlay); }
.hero__inner { position: relative; padding: var(--space-16) 0 var(--space-12); display: grid; gap: var(--space-8); }
@media (min-width: 900px) { .hero__inner { grid-template-columns: 1.1fr 0.9fr; align-items: center; padding: var(--space-20) 0 var(--space-16); } }
.hero h1 { font-size: clamp(3rem, 6vw, var(--fs-display-xl)); line-height: var(--lh-tight); letter-spacing: var(--ls-display); color: var(--white); margin: 0 0 var(--space-4); max-width: 14ch; }
.hero .lead { font-size: var(--fs-lead); color: var(--grey-200); max-width: 46ch; }
.hero .ag-overline { color: var(--df-orange-400); }
.hero__cta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }
.hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-top: var(--space-8); }
.stat { background: rgba(12, 15, 34, 0.6); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); }
.stat__value { font-family: var(--font-mono); font-size: var(--fs-h2); font-weight: var(--fw-semibold); color: var(--white); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat__label { font-size: var(--fs-caption); color: var(--grey-300); text-transform: uppercase; letter-spacing: var(--ls-label); }
.hero__panel { background: rgba(18, 23, 43, 0.72); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius-xl); padding: var(--space-4); backdrop-filter: blur(8px); }
.hero__panel .btn--primary { margin-top: var(--space-3); }

/* ---- Sections ---- */
.section { padding: var(--space-12) 0; }
.section--alt { background: var(--surface-subtle); }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.section__head h2 { margin: 0; }
.section__head p { margin: 0; }
.page { padding: var(--space-8) 0 var(--space-16); flex: 1; }
.page__head { margin-bottom: var(--space-6); }
.page__head h1 { margin: 0 0 var(--space-2); font-size: clamp(1.75rem, 4vw, var(--fs-h1)); }

/* ---- Cards ---- */
.card { background: var(--surface-card); border: var(--border-hairline) solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: var(--space-3); }
.card--flat { box-shadow: none; }
.card__title { margin: 0; font-size: var(--fs-h4); }
.card--accent { border-top: 3px solid var(--df-orange-500); }
.feature { display: flex; flex-direction: column; gap: var(--space-3); }
.feature .icon { width: 28px; height: 28px; color: var(--text-accent); }
.feature h3 { margin: 0; font-size: var(--fs-h4); }
.feature p { margin: 0; color: var(--text-muted); }
.price-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--space-3); height: 100%; }
.price-card .money { font-size: var(--fs-h2); }

/* ---- Flight board ---- */
.board { display: grid; gap: var(--space-3); }
.leg { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3) var(--space-4); align-items: center; background: var(--surface-card); border: var(--border-hairline) solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-4); transition: border-color var(--dur-fast); }
.leg:hover { border-color: var(--border-default); }
.leg__time { font-family: var(--font-mono); font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1; font-variant-numeric: tabular-nums; }
.leg__time small { display: block; font-size: var(--fs-caption); color: var(--text-muted); margin-top: var(--space-1); font-family: var(--font-body); }
.leg__route { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.leg__towns { font-weight: var(--fw-semibold); color: var(--text-strong); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.leg__meta { color: var(--text-muted); font-size: var(--fs-body-sm); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.leg__space { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.leg__kg { font-family: var(--font-mono); font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--text-accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.leg__kg small { font-size: var(--fs-caption); color: var(--text-muted); font-family: var(--font-body); }
.leg__actions { grid-column: 1 / -1; display: flex; gap: var(--space-2); flex-wrap: wrap; }
@media (min-width: 720px) { .leg { grid-template-columns: 96px 1fr auto auto; } .leg__actions { grid-column: auto; } }
.leg--live { border-color: var(--df-orange-500); }
.progress { height: 4px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; width: 100%; }
.progress > span { display: block; height: 100%; background: var(--df-orange-500); border-radius: var(--radius-pill); transition: width var(--dur-slow) var(--ease-standard); }

/* ---- Map ---- */
.map { width: 100%; aspect-ratio: 4 / 3; background: var(--surface-card); border: var(--border-hairline) solid var(--border-subtle); border-radius: var(--radius-xl); overflow: hidden; }
.map svg { width: 100%; height: 100%; display: block; }
.map .land { fill: var(--map-land); stroke: var(--map-line); stroke-width: 1.5; }
.map .route { stroke: var(--map-line); stroke-width: 1; stroke-dasharray: 3 4; fill: none; }
.map .town { fill: var(--surface-card); stroke: var(--df-azure-500); stroke-width: 2; }
.map .town-label { font-family: var(--font-mono); font-size: 11px; fill: var(--text-body); font-weight: 600; }
.map .plane { fill: var(--df-orange-500); }
.map .plane-halo { fill: var(--df-orange-500); opacity: 0.25; }
.map .plane-label { font-family: var(--font-mono); font-size: 10px; fill: var(--text-strong); }
.map__legend { display: flex; gap: var(--space-4); flex-wrap: wrap; color: var(--text-muted); font-size: var(--fs-body-sm); margin-top: var(--space-3); }
.pulse { animation: pulse 2s var(--ease-standard) infinite; transform-origin: center; }
@keyframes pulse { 0% { opacity: 0.35; } 50% { opacity: 0.1; } 100% { opacity: 0.35; } }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--status-success-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-success-text) 25%, transparent); }
.live-dot--off { background: var(--text-muted); box-shadow: none; }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); border-radius: var(--radius-pill); font-size: var(--fs-caption); font-weight: var(--fw-semibold); letter-spacing: var(--ls-label); text-transform: uppercase; border: 1px solid currentColor; white-space: nowrap; line-height: 1.5; }
.badge--success { color: var(--status-success-text); }
.badge--warning { color: var(--status-warning-text); }
.badge--danger { color: var(--status-danger-text); }
.badge--info { color: var(--status-info-text); }
.badge--neutral { color: var(--text-muted); }
.badge--accent { color: var(--text-accent); }

/* ---- Forms ---- */
.form { display: grid; gap: var(--space-4); }
.form__row { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.field { display: grid; gap: var(--space-1); }
.field label, .field legend { font-weight: var(--fw-medium); color: var(--text-strong); font-size: var(--fs-body-sm); }
.field .hint { color: var(--text-muted); font-size: var(--fs-caption); }
.field .error { color: var(--status-danger-text); font-size: var(--fs-caption); min-height: 1.2em; }
.input, .select, .textarea { min-height: var(--control-lg); padding: 0 var(--space-3); border: var(--border-hairline) solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-card); color: var(--text-strong); width: 100%; }
.textarea { padding: var(--space-3); min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--df-orange-500); box-shadow: var(--shadow-focus); outline: none; }
.field.has-error .input, .field.has-error .select { border-color: var(--status-danger-text); }
.check { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3); border: var(--border-hairline) solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--df-orange-500); flex: none; }
.check.is-checked { border-color: var(--df-orange-500); background: var(--surface-accent-soft); }
.form__summary { border: 1px solid var(--status-danger-text); color: var(--status-danger-text); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.segmented { display: inline-flex; border: var(--border-hairline) solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; flex-wrap: wrap; }
.segmented button { min-height: 44px; padding: 0 var(--space-4); border: 0; background: transparent; cursor: pointer; font-weight: var(--fw-medium); color: var(--text-body); }
.segmented button[aria-pressed="true"] { background: var(--df-navy-800); color: var(--white); }
.suggest { position: relative; }
.suggest__list { position: absolute; z-index: 20; inset-inline: 0; top: 100%; background: var(--surface-card); border: var(--border-hairline) solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-md); max-height: 260px; overflow: auto; margin: var(--space-1) 0 0; padding: 0; list-style: none; }
.suggest__list li button { display: block; width: 100%; text-align: left; padding: var(--space-3); border: 0; background: transparent; cursor: pointer; min-height: 44px; color: var(--text-body); }
.suggest__list li button:hover { background: var(--surface-subtle); }
.attribution { font-size: var(--fs-caption); color: var(--text-muted); }

/* ---- Steps / capture ---- */
.steps { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.step { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--border-subtle); color: var(--text-muted); font-size: var(--fs-body-sm); font-weight: var(--fw-medium); }
.step.is-current { border-color: var(--df-orange-500); color: var(--text-accent); }
.step.is-done { color: var(--status-success-text); border-color: currentColor; }
.capture { display: grid; gap: var(--space-3); }
.capture__frame { aspect-ratio: 4 / 3; background: var(--surface-sunken); border-radius: var(--radius-lg); overflow: hidden; display: grid; place-items: center; position: relative; border: var(--border-hairline) solid var(--border-subtle); }
.capture__frame video, .capture__frame img, .capture__frame canvas { width: 100%; height: 100%; object-fit: cover; }
.capture__frame .placeholder { color: var(--text-muted); text-align: center; padding: var(--space-4); }
.waveform { height: 64px; background: var(--surface-sunken); border-radius: var(--radius-md); display: flex; align-items: center; gap: 2px; padding: 0 var(--space-3); overflow: hidden; }
.waveform span { flex: 1; background: var(--df-orange-500); border-radius: 1px; min-height: 2px; }
.declaration { display: grid; gap: var(--space-2); }
.declaration .check p { margin: 0; font-size: var(--fs-body-sm); }
.declaration .check code { color: var(--text-muted); font-size: var(--fs-caption); }

/* ---- QR ---- */
.qr { display: grid; place-items: center; gap: var(--space-3); padding: var(--space-5); background: var(--white); border-radius: var(--radius-xl); color: var(--df-navy-950); }
.qr svg { width: min(100%, 260px); height: auto; display: block; }
.qr .code { font-family: var(--font-mono); font-size: var(--fs-caption); word-break: break-all; text-align: center; color: var(--grey-700); }

/* ---- Timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: var(--space-3); }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--df-orange-500); margin-top: 6px; }
.timeline .dot--muted { background: var(--border-default); }
.timeline time { display: block; font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--text-muted); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border: var(--border-hairline) solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-card); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-body-sm); min-width: 640px; }
.table th, .table td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: var(--border-hairline) solid var(--border-subtle); vertical-align: middle; }
.table th { position: sticky; top: 0; background: var(--surface-subtle); font-size: var(--fs-overline); letter-spacing: var(--ls-overline); text-transform: uppercase; color: var(--text-muted); font-weight: var(--fw-semibold); white-space: nowrap; z-index: 1; }
.table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-1); min-height: 32px; }
.table tbody tr:hover { background: var(--surface-subtle); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table__tools { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; padding: var(--space-3) var(--space-4); border-bottom: var(--border-hairline) solid var(--border-subtle); }
.table__tools .input { max-width: 280px; min-height: 40px; }
.table__pager { display: flex; gap: var(--space-2); align-items: center; justify-content: flex-end; padding: var(--space-3) var(--space-4); color: var(--text-muted); font-size: var(--fs-body-sm); }

/* ---- States ---- */
.skeleton { display: grid; gap: var(--space-2); }
.skeleton span { display: block; height: 14px; border-radius: var(--radius-xs); background: linear-gradient(90deg, var(--surface-sunken), var(--surface-subtle), var(--surface-sunken)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty, .errorbox { text-align: center; padding: var(--space-8) var(--space-4); border: 1px dashed var(--border-default); border-radius: var(--radius-lg); color: var(--text-muted); display: grid; gap: var(--space-3); justify-items: center; }
.errorbox { border-color: var(--status-danger-text); color: var(--status-danger-text); }

/* ---- Toast & dialog ---- */
.toasts { position: fixed; bottom: var(--space-4); left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: var(--space-2); width: min(92vw, 420px); }
.toast { background: var(--df-navy-900); color: var(--white); border-left: 4px solid var(--df-orange-500); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-lg); display: flex; gap: var(--space-3); align-items: center; }
.toast--success { border-left-color: #4ADE80; }
.toast--error { border-left-color: #FF8A80; }
.toast button { margin-left: auto; }
dialog.dialog { border: 0; border-radius: var(--radius-xl); padding: 0; width: min(94vw, 560px); background: var(--surface-card); color: var(--text-body); box-shadow: var(--shadow-xl); }
dialog.dialog::backdrop { background: rgba(12, 15, 34, 0.7); }
.dialog__body { padding: var(--space-6); display: grid; gap: var(--space-4); }
.dialog__body h2 { margin: 0; font-size: var(--fs-h3); }
.dialog__actions { display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }

/* ---- Footer ---- */
.footer { background: var(--df-navy-950); color: var(--grey-300); padding: var(--space-12) 0 var(--space-8); margin-top: auto; }
.footer h4 { color: var(--white); font-size: var(--fs-body-sm); text-transform: uppercase; letter-spacing: var(--ls-overline); }
.footer a { color: var(--grey-200); }
.footer a:hover { color: var(--white); }
.footer__grid { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.footer__trust { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.footer__trust span { display: inline-flex; align-items: center; gap: var(--space-2); border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius-pill); padding: var(--space-1) var(--space-3); font-size: var(--fs-caption); color: var(--grey-200); }
.footer__bottom { margin-top: var(--space-8); padding-top: var(--space-4); border-top: 1px solid rgba(255,255,255,0.12); font-size: var(--fs-caption); color: var(--grey-400); display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }

/* ---- Rank / gamification ---- */
.rank-card { background: var(--gradient-brand); color: var(--white); border-radius: var(--radius-xl); padding: var(--space-6); display: grid; gap: var(--space-3); position: relative; overflow: hidden; }
.rank-card .ag-overline { color: var(--df-orange-400); }
.rank-card h2 { color: var(--white); margin: 0; font-size: var(--fs-display-l); line-height: 1; }
.rank-card .muted { color: var(--grey-300); }
.rank-card .progress { background: rgba(255,255,255,0.15); }
.kpi-row { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.kpi { background: var(--surface-card); border: var(--border-hairline) solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: var(--space-1); }
.kpi__label { font-size: var(--fs-overline); letter-spacing: var(--ls-overline); text-transform: uppercase; color: var(--text-muted); font-weight: var(--fw-semibold); }
.kpi__value { font-family: var(--font-mono); font-size: var(--fs-h2); font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi--accent .kpi__value { color: var(--text-accent); }

/* ---- Admin shell ---- */
.admin { display: grid; min-height: 100vh; grid-template-columns: 1fr; }
@media (min-width: 960px) { .admin { grid-template-columns: var(--sidebar-width) 1fr; } }
.sidebar { background: var(--df-navy-950); color: var(--grey-200); display: flex; flex-direction: column; border-right: 1px solid var(--df-navy-800); }
.sidebar__brand { height: var(--topbar-height); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); border-bottom: 1px solid var(--df-navy-800); color: var(--white); font-weight: var(--fw-bold); }
.sidebar__brand img { height: 30px; }
.sidebar__brand small { display: block; font-size: var(--fs-overline); letter-spacing: var(--ls-overline); text-transform: uppercase; color: var(--df-orange-400); font-weight: var(--fw-semibold); }
.sidebar nav { display: none; flex-direction: column; padding: var(--space-3); gap: var(--space-1); }
.sidebar nav.is-open { display: flex; }
@media (min-width: 960px) { .sidebar nav { display: flex; } }
.sidebar nav a { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--grey-200); text-decoration: none; font-weight: var(--fw-medium); }
.sidebar nav a:hover { background: var(--df-navy-800); color: var(--white); text-decoration: none; }
.sidebar nav a.is-active { background: var(--df-navy-800); color: var(--df-orange-400); }
.sidebar__foot { margin-top: auto; padding: var(--space-4); font-size: var(--fs-caption); color: var(--grey-400); border-top: 1px solid var(--df-navy-800); display: grid; gap: var(--space-2); }
.sidebar__toggle { margin-left: auto; color: var(--white); border-color: var(--df-navy-700); background: transparent; }
@media (min-width: 960px) { .sidebar__toggle { display: none; } }
.admin__main { display: flex; flex-direction: column; min-width: 0; }
.admin__top { height: var(--topbar-height); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); border-bottom: var(--border-hairline) solid var(--border-subtle); background: var(--surface-card); position: sticky; top: 0; z-index: 30; }
.admin__top h1 { margin: 0; font-size: var(--fs-h4); }
.admin__content { padding: var(--space-5) var(--space-4) var(--space-12); display: grid; gap: var(--space-5); align-content: start; }
@media (min-width: 720px) { .admin__content { padding: var(--space-6); } }
.chart { width: 100%; height: 200px; }
.chart .bar { fill: var(--df-orange-500); }
.chart .axis { stroke: var(--border-default); }
.chart text { font-family: var(--font-mono); font-size: 10px; fill: var(--text-muted); }
.filters { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.filters button { min-height: 40px; }
.filters button[aria-pressed="true"] { background: var(--df-navy-800); color: var(--white); border-color: var(--df-navy-800); }
.detail { display: grid; gap: var(--space-4); }
@media (min-width: 1100px) { .split { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-5); align-items: start; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); font-size: var(--fs-body-sm); }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; color: var(--text-strong); word-break: break-word; }
.signin { max-width: 440px; margin: var(--space-16) auto; }
.callout { border-left: 3px solid var(--df-orange-500); background: var(--surface-accent-soft); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); color: var(--text-body); }
.callout--info { border-left-color: var(--status-info-text); background: var(--surface-subtle); }
