/* ==========================================================================
   MONPAD — Sistem Desain Aplikasi Monitoring PAD Kabupaten Buton
   Tampilan modern 2026: tema gelap-terang, bento grid, angka tabular,
   gradien lembut, transisi halus, responsif penuh.
   ========================================================================== */

:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --r-pill: 999px;

  --gap: 20px;
  --maxw: 1360px;

  --brand: #6366f1;
  --brand-2: #22d3ee;
  --brand-3: #a78bfa;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --info: #38bdf8;

  --tone-indigo: #818cf8;
  --tone-cyan: #22d3ee;
  --tone-violet: #c084fc;
  --tone-amber: #fbbf24;
  --tone-slate: #94a3b8;

  --shadow-sm: 0 1px 2px rgba(2, 6, 23, .5);
  --shadow-md: 0 12px 32px -12px rgba(2, 6, 23, .55);
  --shadow-lg: 0 32px 64px -28px rgba(2, 6, 23, .7);

  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070A10;
  --bg-soft: #0A0E16;
  --surface: #0E131C;
  --surface-2: #141A25;
  --surface-3: #1A2130;
  --border: rgba(148, 163, 184, .14);
  --border-strong: rgba(148, 163, 184, .26);
  --text: #e9eef7;
  --text-2: #9aa7bd;
  --text-3: #6c7a91;
  --grid: rgba(148, 163, 184, .10);
  --aurora-1: rgba(99, 102, 241, .28);
  --aurora-2: rgba(34, 211, 238, .18);
  --aurora-3: rgba(167, 139, 250, .18);
  --glass: rgba(14, 19, 28, .72);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fb;
  --bg-soft: #eef1f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f8;
  --border: rgba(15, 23, 42, .10);
  --border-strong: rgba(15, 23, 42, .20);
  --text: #0b1220;
  --text-2: #4c5871;
  --text-3: #79859b;
  --grid: rgba(15, 23, 42, .07);
  --aurora-1: rgba(99, 102, 241, .22);
  --aurora-2: rgba(34, 211, 238, .20);
  --aurora-3: rgba(192, 132, 252, .18);
  --glass: rgba(255, 255, 255, .78);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 14px 34px -18px rgba(15, 23, 42, .30);
  --shadow-lg: 0 36px 70px -32px rgba(15, 23, 42, .35);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.02em; font-weight: 650; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.num, .kpi-value, td.n, th.n {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv05" 1;
}

/* ------------------------------------------------------------- aurora bg */
.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  animation: drift 26s var(--ease) infinite alternate;
}
.aurora::before {
  background: radial-gradient(circle at 30% 30%, var(--aurora-1), transparent 65%);
  top: -22vmax; left: -14vmax;
}
.aurora::after {
  background: radial-gradient(circle at 70% 40%, var(--aurora-2), transparent 65%);
  bottom: -26vmax; right: -16vmax;
  animation-delay: -8s;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, 3vmax, 0) scale(1.12); }
}

.shell { position: relative; z-index: 1; }

.container {
  width: min(100% - 40px, var(--maxw));
  margin-inline: auto;
}

/* -------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  background: var(--glass);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: 17px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 22px -10px var(--brand);
  flex: none;
}
.brand small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--text-2);
  transition: .22s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: .2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }

.nav-toggle { display: none; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  transition: .2s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #4f46e5);
  color: #fff;
  box-shadow: 0 12px 26px -14px var(--brand);
}
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.btn-soft { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.btn-danger { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-block { width: 100%; }

/* ----------------------------------------------------------------- hero */
.hero { padding: 46px 0 26px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
  letter-spacing: .03em;
}
.hero-kicker .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok) 0%, transparent); } }

.hero h1 {
  margin-top: 18px;
  font-size: clamp(30px, 4.6vw, 50px);
  font-weight: 700;
  letter-spacing: -.035em;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  margin-top: 14px;
  max-width: 68ch;
  color: var(--text-2);
  font-size: 16px;
}
.hero-tools {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ---------------------------------------------------------------- grids */
.grid { display: grid; gap: var(--gap); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.bento {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.b-3 { grid-column: span 3; }
.b-4 { grid-column: span 4; }
.b-5 { grid-column: span 5; }
.b-6 { grid-column: span 6; }
.b-7 { grid-column: span 7; }
.b-8 { grid-column: span 8; }
.b-12 { grid-column: span 12; }

/* ---------------------------------------------------------------- cards */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card.pad-0 { padding: 0; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.card-head h3 { font-size: 15.5px; font-weight: 620; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 450; }
.card-title-group { display: flex; flex-direction: column; gap: 2px; }

.section { padding: 14px 0 40px; }
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.section-title h2 { font-size: 21px; }
.section-title span { color: var(--text-3); font-size: 13.5px; }

/* ----------------------------------------------------------------- kpi */
.kpi {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: .3s var(--ease);
}
.kpi::after {
  content: "";
  position: absolute;
  right: -30%; top: -55%;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: var(--kpi-glow, var(--brand));
  opacity: .10;
  filter: blur(38px);
  transition: .35s var(--ease);
}
.kpi:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.kpi:hover::after { opacity: .2; }

.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kpi-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 600;
}
.kpi-ico {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--kpi-glow, var(--brand)) 15%, transparent);
  color: var(--kpi-glow, var(--brand));
  flex: none;
}
.kpi-value {
  margin-top: 14px;
  font-size: clamp(23px, 2.5vw, 30px);
  font-weight: 700;
  letter-spacing: -.035em;
}
.kpi-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 620;
  letter-spacing: .01em;
  border: 1px solid transparent;
}
.badge.ok   { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.bad  { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.badge.info { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.badge.mute { background: var(--surface-3); color: var(--text-2); }

.tone-indigo { --tone: var(--tone-indigo); }
.tone-cyan   { --tone: var(--tone-cyan); }
.tone-violet { --tone: var(--tone-violet); }
.tone-amber  { --tone: var(--tone-amber); }
.tone-slate  { --tone: var(--tone-slate); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 4px 7px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 560;
  background: color-mix(in srgb, var(--tone, var(--brand)) 13%, transparent);
  color: var(--tone, var(--brand));
  border: 1px solid color-mix(in srgb, var(--tone, var(--brand)) 24%, transparent);
}
.chip .ico { width: 14px; height: 14px; }

/* ------------------------------------------------------------- progress */
.bar {
  position: relative;
  height: 9px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .9s var(--ease);
}
.bar.thin { height: 6px; }
.bar.ok   > span { background: linear-gradient(90deg, #10b981, #34d399); }
.bar.warn > span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar.bad  > span { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.meter { display: flex; flex-direction: column; gap: 7px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; }
.meter-head b { font-weight: 640; font-variant-numeric: tabular-nums; }
.meter-head span { color: var(--text-3); font-size: 12.5px; }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
.table-wrap::-webkit-scrollbar { height: 9px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 9px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.6px;
  min-width: 640px;
}
table.data thead th {
  position: sticky; top: 0;
  text-align: left;
  padding: 12px 14px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 640;
  white-space: nowrap;
}
table.data tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr { transition: background .16s ease; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.n, table.data th.n { text-align: right; }
table.data .with-bar { min-width: 150px; }
table.data .sub { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

tr.total-row td {
  background: var(--surface-2);
  font-weight: 660;
  border-top: 2px solid var(--border-strong);
}

/* --------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-size: 12.5px;
  font-weight: 580;
  color: var(--text-2);
  letter-spacing: .01em;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  transition: .18s var(--ease);
  outline: none;
}
.input::placeholder { color: var(--text-3); }
.input:focus {
  border-color: color-mix(in srgb, var(--brand) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
  background: var(--surface);
}
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238894ab' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 34px;
}
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.help { font-size: 12px; color: var(--text-3); }
.has-error .input { border-color: var(--bad); }
.error-text { font-size: 12px; color: var(--bad); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.filters .field { min-width: 150px; }

/* --------------------------------------------------------------- alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  font-size: 13.6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 16px;
}
.alert .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.is-good { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); }
.alert.is-warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--warn); }
.alert.is-poor { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.alert.tone-cyan { border-color: color-mix(in srgb, var(--info) 40%, transparent); background: color-mix(in srgb, var(--info) 10%, transparent); color: var(--info); }

/* --------------------------------------------------------------- charts */
.chart-box { position: relative; width: 100%; height: 300px; }
.chart-box.sm { height: 236px; }
.chart-box.lg { height: 350px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12.5px; color: var(--text-2); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* ---------------------------------------------------------------- list */
.rank { display: flex; flex-direction: column; gap: 14px; }
.rank-item { display: flex; gap: 13px; align-items: center; }
.rank-no {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  flex: none;
}
.rank-item:first-child .rank-no { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--brand); }
.rank-body { flex: 1; min-width: 0; }
.rank-title { display: flex; justify-content: space-between; gap: 10px; font-size: 13.6px; }
.rank-title b { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-title span { color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }
.rank-sub { font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; }

.stat-list { display: grid; gap: 12px; }
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: .2s var(--ease);
}
.stat-row:hover { border-color: var(--border-strong); transform: translateX(3px); }

/* ------------------------------------------------------------- tabs/nav */
.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.tabs a, .tabs button {
  padding: 7px 15px;
  border-radius: var(--r-pill);
  font-size: 13.4px;
  color: var(--text-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: .2s var(--ease);
}
.tabs a.active, .tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 7px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
}
.pager a:hover { color: var(--text); border-color: var(--border-strong); }
.pager .current { background: var(--brand); color: #fff; border-color: transparent; }

/* --------------------------------------------------------------- auth */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.auth-card {
  width: min(100%, 430px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 34px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 23px; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-3); font-size: 13.6px; margin-bottom: 24px; }
.auth-fields { display: grid; gap: 15px; }
.auth-hint {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 12.4px;
  color: var(--text-3);
  line-height: 1.7;
}
.auth-hint code { font-family: var(--font-mono); color: var(--text-2); }

/* -------------------------------------------------------------- admin */
.admin { display: grid; grid-template-columns: 262px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 8px;
  overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.side-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.side-brand b { font-size: 15.5px; letter-spacing: -.02em; }
.side-brand small { display: block; font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

.side-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
  padding: 16px 10px 7px;
  font-weight: 660;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px;
  transition: .18s var(--ease);
}
.side-link .ico { width: 18px; height: 18px; flex: none; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 18%, transparent), transparent);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--brand);
}
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar-admin {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  height: 66px;
  padding: 0 26px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-admin h1 { font-size: 17px; font-weight: 640; }
.crumb { font-size: 12.5px; color: var(--text-3); }
.topbar-admin .spacer { margin-left: auto; }

.user-menu {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.user-menu .meta { line-height: 1.2; }
.user-menu .meta b { display: block; font-size: 13px; font-weight: 600; }
.user-menu .meta small { font-size: 10.5px; color: var(--text-3); }

.page { padding: 26px; display: grid; gap: 20px; align-content: start; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h2 { font-size: 21px; }
.page-head .sub { color: var(--text-3); font-size: 13.4px; margin-top: 4px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.mini-stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.mini-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.mini-stat .kpi-label { font-size: 10.5px; }
.mini-stat .v { font-size: 22px; font-weight: 680; letter-spacing: -.03em; margin-top: 8px; }
.mini-stat .d { font-size: 12px; color: var(--text-3); margin-top: 3px; }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--text-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 5px; }

/* -------------------------------------------------------------- footer */
.footer {
  margin-top: 30px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 40px 0 30px;
}
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1.6fr 1fr 1fr; }
.footer h4 { font-size: 13.5px; margin-bottom: 12px; }
.footer p, .footer li { color: var(--text-3); font-size: 13.2px; line-height: 1.85; }
.footer a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.4px;
  color: var(--text-3);
}

/* ------------------------------------------------------------- content */
.prose { display: grid; gap: 16px; }
.prose h3 { font-size: 17px; margin-top: 8px; }
.prose p { color: var(--text-2); font-size: 14.4px; }
.prose ul { display: grid; gap: 9px; }
.prose ul li {
  position: relative;
  padding-left: 22px;
  color: var(--text-2);
  font-size: 14.2px;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.legal {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-size: 13.4px;
  color: var(--text-2);
}

.def-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.def {
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.def b { display: block; font-size: 13.6px; margin-bottom: 5px; }
.def span { font-size: 13px; color: var(--text-3); }

/* --------------------------------------------------------- animation */
.reveal { animation: rise .55s var(--ease) both; }
.reveal-2 { animation: rise .55s var(--ease) .07s both; }
.reveal-3 { animation: rise .55s var(--ease) .14s both; }
.reveal-4 { animation: rise .55s var(--ease) .21s both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .b-3 { grid-column: span 6; }
  .b-4, .b-5, .b-7, .b-8 { grid-column: span 12; }
  .b-6 { grid-column: span 12; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 268px;
    z-index: 90;
    transform: translateX(-102%);
    transition: transform .3s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .nav.show {
    display: flex;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    gap: 4px;
  }
  .nav.show a { padding: 11px 14px; }
  .nav-toggle { display: grid; }
  .topbar-inner { height: 62px; }
  .hero { padding: 32px 0 20px; }
  .b-3, .b-4 { grid-column: span 12; }
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .page { padding: 18px; }
  .card { padding: 18px; border-radius: var(--r-md); }
  .topbar-admin { padding: 0 16px; }
  .user-menu .meta { display: none; }
}

@media (max-width: 520px) {
  .container { width: min(100% - 28px, var(--maxw)); }
  .kpi-value { font-size: 24px; }
  .btn { padding: 9px 15px; }
}

/* unghide */
.d-none { display: none !important; }

/* ------------------------------------------------------- forms / misc */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.4px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
}

tr.is-off td { opacity: .55; }

.kpi-ico svg, .ico { width: 18px; height: 18px; }

.pager span.current { cursor: default; }

textarea.input { resize: vertical; min-height: 74px; line-height: 1.55; }

input.input[type="number"] { font-variant-numeric: tabular-nums; }

.admin .form-grid .field { min-width: 0; }

.dash-note {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.6;
}
