/* ==========================================================================
   WAPM — design system
   Dipakai bersama oleh /vira (konsol) dan /admin (pengaturan & laporan).
   ========================================================================== */

:root {
  --bg: #0a1118;
  --bg-soft: #0d1620;
  --surface: #111c27;
  --surface-2: #15222e;
  --surface-3: #1a2a38;
  --line: #20303f;
  --line-strong: #2b4155;

  --text: #e8f0f7;
  --text-dim: #c2d1de;
  --muted: #8ba0b4;
  --muted-2: #6d8298;

  --brand: #34d399;
  --brand-strong: #17a673;
  --brand-soft: rgba(52, 211, 153, 0.12);
  --brand-line: rgba(52, 211, 153, 0.32);

  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  --ring: 0 0 0 3px rgba(52, 211, 153, 0.22);

  --sidebar: 256px;
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Consolas", "SF Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(52, 211, 153, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(96, 165, 250, 0.06), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(52, 211, 153, 0.28); }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 20px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
p { margin: 0; }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text-dim);
}

/* --------------------------------------------------------------- app shell */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: linear-gradient(180deg, #101b26 0%, #0c141d 100%);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 0; }
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  color: #05271a;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 6px 18px rgba(23, 166, 115, 0.35);
}
.brand-text { min-width: 0; overflow: hidden; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand);
}
.nav-item .icon { flex: 0 0 18px; opacity: 0.9; }
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--muted);
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 12px;
}
.user-meta { min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 22, 32, 0.82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.topbar-title .eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-2);
}
.topbar-title h1 { font-size: 16px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { padding: 26px 28px 48px; width: 100%; max-width: 1180px; }

.section { display: none; }
.section.active { display: block; animation: fade-in 0.18s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- typography */

.eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-2);
}
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: #21384a; border-color: #365069; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
  border-color: var(--brand-strong);
  color: #04241a;
}
.btn-primary:hover { background: linear-gradient(180deg, #4ade9f 0%, #1bbd83 100%); border-color: #1bbd83; }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); font-weight: 500; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: transparent; border-color: rgba(248, 113, 113, 0.4); color: var(--danger); font-weight: 500; }
.btn-danger:hover { background: var(--danger-soft); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 8px; }

/* --------------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 6px; }
.label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:hover, .select:hover, .textarea:hover { border-color: #3a546c; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-strong);
  background: #0a141d;
  box-shadow: var(--ring);
}
.textarea { resize: vertical; min-height: 84px; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.help { font-size: 11.5px; color: var(--muted-2); line-height: 1.55; }
.error-text { font-size: 12px; color: var(--danger); min-height: 16px; }
.ok-text { font-size: 12px; color: var(--brand); }

.input-group { display: flex; gap: 8px; align-items: center; }
.input-group .input { flex: 1; }

.input[type="file"] { padding: 6px 8px; font-size: 12px; color: var(--muted); }
.input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.input[type="file"]::file-selector-button:hover { background: #21384a; }

/* --------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.card-head .grow { flex: 1; min-width: 0; }
.card-head h2 { font-size: 14px; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* -------------------------------------------------------------------- tables */

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.018); }

.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 11px; }
.cell-title { font-weight: 600; font-size: 13px; }
.cell-sub { font-size: 11.5px; color: var(--muted-2); }

/* ---------------------------------------------------------- badges & chips */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}
.badge.plain::before { display: none; }
.badge-green { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.badge-blue { background: var(--info-soft); border-color: rgba(96, 165, 250, 0.35); color: var(--info); }
.badge-amber { background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.35); color: var(--warn); }
.badge-red { background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.35); color: var(--danger); }
.badge-violet { background: var(--violet-soft); border-color: rgba(167, 139, 250, 0.35); color: var(--violet); }
.badge-muted { color: var(--muted); }

.chip {
  display: inline-block;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.chip.super { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }

/* --------------------------------------------------------------------- stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) {
  .stat-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.stat {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--line-strong);
}
.stat.accent-green::after { background: var(--brand); }
.stat.accent-blue::after { background: var(--info); }
.stat.accent-amber::after { background: var(--warn); }
.stat.accent-violet::after { background: var(--violet); }
.stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted-2); }
.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat-value.text { font-size: 15px; font-weight: 650; padding-top: 6px; }
.stat-hint { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

/* ------------------------------------------------------------ segmented tabs */

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.seg {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg:hover { color: var(--text); }
.seg.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------- report card */

.report {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
}
.report + .report { margin-top: 10px; }
.report-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-title { font-size: 13px; font-weight: 650; }
.report-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted-2); }
.report-pre {
  margin: 10px 0 0;
  padding: 0;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
  max-height: 320px;
  overflow: auto;
}
.report-pre.clamped { max-height: 74px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
.report-text {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-dim);
  max-height: 320px;
  overflow: auto;
  overflow-wrap: anywhere;
}
.report-text.clamped {
  max-height: 74px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
  mask-image: linear-gradient(180deg, #000 60%, transparent);
}
.report-text strong { color: var(--text); font-weight: 650; }
.report-foot { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ projects */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.06s ease;
}
.project-card:hover { border-color: var(--brand-line); text-decoration: none; }
.project-card:active { transform: translateY(1px); }
.project-card .top { display: flex; align-items: center; gap: 8px; }
.project-card h3 { font-size: 14px; font-weight: 650; line-height: 1.35; }
.project-card .client { font-size: 11.5px; color: var(--muted-2); }
.project-card .foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted-2);
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-strong), var(--brand));
}
.bar.lg { height: 9px; }

.detail-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.detail-head .grow { flex: 1; min-width: 260px; }
.detail-title { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; margin-top: 6px; }
.detail-progress { min-width: 220px; }
.detail-progress .value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.wbs-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wbs-row:last-child { border-bottom: none; }
.wbs-row .name { flex: 1; min-width: 0; font-size: 12.5px; }
.wbs-row .bar { width: 140px; flex: 0 0 140px; }
.wbs-row .pct { width: 52px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px 12px;
}
.timeline-item .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline-item .note { margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.timeline-item .when { margin-left: auto; font-size: 11px; color: var(--muted-2); }

/* -------------------------------------------------------------- empty/toast */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(4, 8, 12, 0.88);
  backdrop-filter: blur(4px);
}
.lightbox figure {
  margin: 0;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #000;
  object-fit: contain;
}
.lightbox figcaption { color: var(--muted); font-size: 12px; text-align: center; }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted-2);
}
.empty svg { opacity: 0.5; }
.empty strong { color: var(--text-dim); font-size: 13px; font-weight: 600; }
.empty span { font-size: 12px; max-width: 380px; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease;
}
.toast.ok { border-color: var(--brand-line); }
.toast.err { border-color: rgba(248, 113, 113, 0.45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------- modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 12, 0.82);
  backdrop-filter: blur(4px);
}
.modal.hidden { display: none !important; }
.modal-card {
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 15px; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.qr-box {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
}
.qr-box img { width: 280px; height: 280px; image-rendering: pixelated; }
.qr-box.connected,
.qr-box.waiting {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 20px;
}

/* --------------------------------------------------------------------- login */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 48px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(700px 380px at 15% 10%, rgba(52, 211, 153, 0.16), transparent 65%),
    radial-gradient(600px 320px at 90% 100%, rgba(96, 165, 250, 0.1), transparent 60%),
    linear-gradient(180deg, #0d1a24, #0a1118);
}
.auth-brand .brand { padding: 0; }
.auth-copy { max-width: 460px; }
.auth-copy h2 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 12px; }
.auth-copy p { color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.auth-points { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.auth-point { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--text-dim); }
.auth-point svg { color: var(--brand); flex: 0 0 16px; margin-top: 1px; }
.auth-note { font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.auth-panel { display: grid; place-items: center; padding: 32px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .card-body { padding: 26px; }
.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card .field + .field { margin-top: 14px; }
.auth-card .btn { width: 100%; margin-top: 18px; padding: 10px 14px; }

/* ------------------------------------------------------------------ layout utils */

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 10px; }
.row > .grow { flex: 1; min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.icon-sm { width: 15px; height: 15px; flex: 0 0 auto; }

/* ----------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    padding: 14px 16px;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 6px; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { width: auto; white-space: nowrap; padding: 7px 12px; }
  .sidebar-foot { display: none; }
  .nav-label { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 40px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { padding: 24px 16px; min-height: 100vh; }
}

@media (max-width: 560px) {
  .card-head { padding: 14px 14px 10px; flex-wrap: wrap; }
  .card-body { padding: 14px; }
  .table th, .table td { padding: 11px 14px; }
  .report-meta { margin-left: 0; width: 100%; }
  .stat { padding: 11px 12px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 9.5px; }
  .stat-hint { font-size: 10.5px; }
  .content { padding: 16px 12px 32px; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .topbar-actions .btn { padding: 7px 10px; }
}
