/* ============ Miloha Wi-Fi System — design tokens ============ */
:root {
  --navy-900: #070d18;
  --navy-800: #0b1424;
  --navy-700: #122036;
  --accent: #0e9f6e;
  --accent-strong: #0b8a5f;
  --accent-soft: #e3f7ef;
  --cyan: #22b8cf;
  --violet: #6d5efc;
  --warn: #d97706;
  --warn-soft: #fef3e2;
  --bad: #e0485a;
  --bad-soft: #fdeaec;
  --ok: #0e9f6e;
  --ok-soft: #e3f7ef;

  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --line: #e3e9f2;
  --text: #0f1b2d;
  --text-2: #42526b;
  --muted: #7386a1;
  --shadow-sm: 0 1px 2px rgba(10, 25, 47, .05), 0 4px 14px rgba(10, 25, 47, .05);
  --shadow-lg: 0 18px 48px rgba(10, 25, 47, .16);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 264px;
  color-scheme: light;
}

html[data-theme='dark'] {
  --bg: #070d19;
  --surface: #101a2c;
  --surface-2: #16223a;
  --surface-3: #1c2a45;
  --line: #24334f;
  --text: #eef4ff;
  --text-2: #b9c8e0;
  --muted: #7f93b4;
  --accent-soft: #0d2f26;
  --warn-soft: #33240e;
  --bad-soft: #3a1720;
  --ok-soft: #0d2f26;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .28);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.2px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.center { text-align: center; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ============ boot / auth ============ */
/* Mirrors the agent app's splash: flat navy, wordmark + tagline, LeNTL at the foot. */
.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-content: center;
  justify-items: center;
  background: #0b1b33;
  color: #dbe7ff;
  transition: opacity .32s ease;
}
.boot.out { opacity: 0; }
.boot-center { display: grid; justify-items: center; gap: 34px; }
.boot-mark {
  width: 200px;
  height: auto;
  opacity: 0;
  transform: scale(.94);
  animation: boot-in .34s ease-out forwards;
}
.boot-tag {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  color: #94a3b8;
  opacity: 0;
  animation: boot-in .34s .16s ease-out forwards;
}
.boot-foot { position: absolute; bottom: 38px; left: 50%; transform: translateX(-50%); width: 96px; height: auto; opacity: .92; }
@keyframes boot-in { to { opacity: 1; transform: none; } }
html:has(#boot:not(.hidden)), html:has(#boot:not(.hidden)) body { overflow: hidden; }

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(1000px 600px at 10% -10%, rgba(34, 184, 207, .2), transparent 55%),
    radial-gradient(800px 600px at 110% 110%, rgba(14, 159, 110, .22), transparent 55%),
    var(--navy-900);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 30px 26px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  backdrop-filter: blur(14px);
  color: #eaf2ff;
}
.brand-logo-chip { display: inline-flex; align-items: center; background: #fff; border-radius: 11px; padding: 6px 9px; box-shadow: 0 8px 20px rgba(3, 8, 18, .28); }
.brand-logo-chip img { display: block; width: 124px; height: auto; }
.powered { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin: 2px 0; color: #8ea3bd; font-size: 10px; line-height: 1.4; }
.powered img { width: 96px; height: auto; opacity: .92; }
.auth .brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth .brand-logo-chip img { width: 128px; }
.auth .powered { margin-top: 20px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); color: #8ea3bd; align-items: flex-start; }
.auth .brand-icon {
  width: 46px; height: 46px;
  padding: 10px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--accent), var(--cyan));
  stroke: #fff;
  box-shadow: 0 10px 26px rgba(14, 159, 110, .4);
}
.auth .brand h1 { font-size: 20px; letter-spacing: -.3px; }
.auth .brand p { margin: 2px 0 0; font-size: 12.5px; color: #9db1d3; }
.auth .field span { color: #9db1d3; }
.auth .field input { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); color: #fff; }
.auth .field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34, 184, 207, .16); }
.auth .hint { color: #9db1d3; }

/* ============ layout shell ============ */
.app { min-height: 100dvh; display: block; }
.sidebar { display: none; }
.shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand.small { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand.small > div { min-width: 0; }
.topbar .brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44vw; }
.topbar .brand .sync-line { display: none; }
.page-head { display: none; }
@media (min-width: 1024px) { .page-head { display: block; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.auth .btn, .stack .btn { width: 100%; }
.topbar .brand-icon {
  width: 38px; height: 38px; padding: 8px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), var(--cyan));
  stroke: #fff;
}
.topbar .brand strong { display: block; font-size: 15px; letter-spacing: -.2px; }
.topbar .brand-wordmark { display: block; width: 86px; height: auto; flex: none; }
.sync-line { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); flex: none; }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.dot.warn { background: #cbd5e1; box-shadow: none; }

.top-actions { 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(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: .16s ease;
}
.icon-btn:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.sm svg { width: 16px; height: 16px; }

.view {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============ bottom tabs ============ */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 2px;
  padding: 6px;
  width: calc(100% - 24px);
  max-width: 460px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(1.4);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 4px 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s ease;
}
.tab svg { width: 20px; height: 20px; }
.tab.active { color: var(--accent-strong); background: var(--accent-soft); }
.tab.active svg { stroke-width: 2.1; }

/* ============ hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 20px;
  color: #eaf3ff;
  background:
    radial-gradient(600px 240px at 88% -20%, rgba(34, 184, 207, .38), transparent 60%),
    radial-gradient(520px 320px at -10% 120%, rgba(14, 159, 110, .45), transparent 60%),
    linear-gradient(135deg, #0b1424 0%, #10233d 60%, #0d2f33 100%);
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(120deg, rgba(0, 0, 0, .55), transparent 60%);
  mask-image: linear-gradient(120deg, rgba(0, 0, 0, .55), transparent 60%);
  pointer-events: none;
}
.hero-top { position: relative; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.hero-eyebrow { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #8fb4d6; margin: 0 0 6px; }
.hero h1 { font-size: 24px; line-height: 1.15; letter-spacing: -.6px; }
.hero-sub { margin: 8px 0 0; font-size: 12.5px; color: #b6cae4; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hero-sub span { display: inline-flex; align-items: center; gap: 5px; }
.hero-actions { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.hero-btn { justify-content: center; }
.hero-actions .hero-btn.solid { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .hero-actions { display: flex; flex-wrap: wrap; }
  .hero-actions .hero-btn.solid { grid-column: auto; }
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: .16s ease;
  backdrop-filter: blur(6px);
}
.hero-btn:hover { background: rgba(255, 255, 255, .18); transform: translateY(-1px); }
.hero-btn.solid { background: linear-gradient(135deg, #12c48b, #0e9f6e); border-color: transparent; box-shadow: 0 10px 24px rgba(14, 159, 110, .35); }
.hero-btn svg { width: 16px; height: 16px; }
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: 11.5px;
  color: #d8e6fa;
  white-space: nowrap;
}
.hero-status .dot { background: #37e0a4; box-shadow: 0 0 0 3px rgba(55, 224, 164, .2); }
.hero-status.bad .dot { background: #ff8090; box-shadow: 0 0 0 3px rgba(255, 128, 144, .2); }

/* ============ cards ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card.pad-sm { padding: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 11.5px; color: var(--muted); }
.card-head .icon-wrap {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong);
}
.card-head .icon-wrap svg { width: 15px; height: 15px; }

/* ============ KPI ============ */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpis.money { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (max-width: 699px) { .kpis .kpi.span { grid-column: 1 / -1; } }
.money-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.money-actions .primary { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .money-actions { display: flex; flex-wrap: wrap; }
  .money-actions .primary { grid-column: auto; flex: 1; }
  .money-actions .ghost { flex: 1; }
}
.kpi {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.kpi::after {
  content: '';
  position: absolute; right: -22px; top: -22px;
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--accent-soft);
  opacity: .55;
}
.kpi .kpi-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi .kpi-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.kpi .kpi-icon svg { width: 16px; height: 16px; }
.kpi .value { position: relative; margin-top: auto; padding-top: 8px; font-size: 25px; font-weight: 750; letter-spacing: -.8px; line-height: 1; }
.kpi .value small { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi .foot { position: relative; margin-top: 7px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi.ok { background: linear-gradient(160deg, var(--surface) 55%, var(--accent-soft)); }
.kpi.ok .value { color: var(--accent-strong); }
.kpi.warn { background: linear-gradient(160deg, var(--surface) 55%, var(--warn-soft)); }
.kpi.warn .value { color: var(--warn); }
.kpi.bad { background: linear-gradient(160deg, var(--surface) 55%, var(--bad-soft)); }
.kpi.bad .value { color: var(--bad); }
.kpi.violet .kpi-icon { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.kpi.violet::after { background: color-mix(in srgb, var(--violet) 16%, transparent); }

/* ============ dashboard grids ============ */
.dash-grid { display: grid; gap: 14px; }
.dash-col { display: flex; flex-direction: column; gap: 14px; }
.branch-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.branch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    radial-gradient(300px 120px at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: .18s ease;
  text-align: left;
}
.branch-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow-lg); }
.branch-card .bc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.branch-card .bc-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.branch-card .bc-loc { font-size: 11.5px; color: var(--muted); }
.branch-card .bc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.branch-card .bc-stat { display: flex; flex-direction: column; justify-content: space-between; min-height: 36px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.branch-card .bc-stat b { display: block; font-size: 16px; color: var(--text); letter-spacing: -.3px; margin-top: 2px; text-transform: none; }

.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; color: var(--text-2); }
.stat-row:last-child { border-bottom: 0; }
.stat-row .v { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-row .v.pos { color: var(--accent-strong); }
.stat-row .v.neg { color: var(--bad); }
.stat-row .lbl { display: flex; align-items: center; gap: 8px; }
.stat-row .lbl i { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
.stat-row .lbl i.warn { background: var(--warn); }
.stat-row .lbl i.bad { background: var(--bad); }
.stat-row .lbl i.muted { background: var(--muted); }

/* progress */
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width .5s ease; }
.progress.warn > i { background: linear-gradient(90deg, #f0a23a, var(--warn)); }
.progress.bad > i { background: linear-gradient(90deg, #f06b7c, var(--bad)); }
.progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

/* banner */
.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  border: 1px solid transparent;
}
.banner svg { width: 18px; height: 18px; margin-top: 1px; }
.banner.bad { background: var(--bad-soft); color: color-mix(in srgb, var(--bad) 80%, var(--text)); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.banner.warn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--text)); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.banner.info { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }
.banner.ok { background: var(--ok-soft); color: var(--accent-strong); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }

/* strip of meta */
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.strip strong { color: var(--text); }

/* ============ pills / chips ============ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-2);
}
.pill.ok { background: var(--ok-soft); color: var(--accent-strong); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.muted { background: var(--surface-3); color: var(--muted); }
.pill.info { background: color-mix(in srgb, var(--violet) 12%, transparent); color: var(--violet); }
.pill .dot { width: 5px; height: 5px; box-shadow: none; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 1px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s ease;
  white-space: nowrap;
}
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .n { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }
.page-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.page-bar .bar-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }

/* ============ lists ============ */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.item:last-child { border-bottom: 0; }
.item-main { flex: 1; min-width: 0; }
.item-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; }
.item-title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.item-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 559px) {
  .item-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.item-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.item .amount { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.mini-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: .15s ease;
}
.mini-btn svg { width: 15px; height: 15px; }
.mini-btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--text); }
.mini-btn.ok { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.mini-btn.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }

.empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 13px; }
/* Holds the Money/Reports layout while the first answer is on the wire. */
.sk { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; border-radius: 8px; animation: sk-sweep 1.2s ease-in-out infinite; }
@keyframes sk-sweep { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line { height: 10px; margin: 0 0 8px; }
.sk-value { height: 22px; width: 58%; margin: 4px 0 10px; }
.sk-chart { height: 140px; margin: 4px 0; }
.sk-row { height: 44px; margin: 6px 0; }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* ============ forms ============ */
.form-grid { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.field input, .field select, .field textarea, .search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.field textarea { resize: vertical; min-height: 64px; }
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.upload-btn svg { width: 14px; height: 14px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.search svg { width: 17px; height: 17px; color: var(--muted); }
.search input { border: 0; background: transparent; padding: 10px 0; }
.search input:focus { box-shadow: none; }
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--surface-3);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: .16s ease;
  text-align: center;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #12c48b, var(--accent)); color: #fff; box-shadow: 0 8px 20px rgba(14, 159, 110, .28); }
.btn.primary:hover { box-shadow: 0 12px 26px rgba(14, 159, 110, .34); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--text); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.small { padding: 8px 12px; font-size: 12px; border-radius: 10px; }
.btn:disabled { opacity: .55; pointer-events: none; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.form-actions .btn { flex: 1; min-width: 120px; }

/* segmented control */
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  width: fit-content;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: .16s ease;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* kv */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

/* hint */
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.hint.ok { color: var(--accent-strong); }
.hint.error { color: var(--bad); }

/* ============ sheet ============ */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 10, 22, .55); backdrop-filter: blur(3px); animation: fade .18s ease; }
.sheet {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .35);
  animation: slideUp .24s cubic-bezier(.2, .8, .3, 1);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-size: 16.5px; }
.sheet-body { padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0)); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
@keyframes slideUp { from { transform: translateY(40px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(92vw, 420px);
  padding: 11px 16px;
  border-radius: 13px;
  background: rgba(12, 22, 38, .94);
  color: #eef4ff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
}
.toast.ok { background: linear-gradient(135deg, #0f9d6e, #0b7f5a); }
.toast.err { background: linear-gradient(135deg, #d2485c, #b3344a); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ============ responsive ============ */
@media (min-width: 700px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .branch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view { padding: 20px 24px 40px; }
  .topbar { padding: 14px 24px; }
  .grid2 { gap: 12px; }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 24px; max-height: 86dvh; animation: pop .2s ease; }
  @keyframes pop { from { transform: scale(.97); opacity: .6; } }
  .toast { bottom: 26px; }
}

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
  .tabbar { display: none; }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px 18px;
    background:
      radial-gradient(420px 260px at 50% -10%, rgba(34, 184, 207, .16), transparent 60%),
      linear-gradient(180deg, #0a1322 0%, #0b1728 55%, #08131f 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
  }
  .side-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 2px 8px 10px; color: #eaf2ff; }
  .side-brand .brand-icon { width: 40px; height: 40px; padding: 9px; border-radius: 13px; background: linear-gradient(145deg, var(--accent), var(--cyan)); stroke: #fff; box-shadow: 0 10px 24px rgba(14, 159, 110, .35); }
  .side-brand strong { display: block; font-size: 15px; letter-spacing: -.2px; }
  .side-brand span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #7f9ab8; }
  .side-brand .side-brand-sub { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #7f9ab8; }
  .side-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #5f7897; padding: 0 10px; margin-bottom: 6px; }
  .branch-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .05);
    color: #dbe7f8;
    cursor: pointer;
    text-align: left;
    transition: .15s ease;
  }
  .branch-btn:hover { background: rgba(255, 255, 255, .09); }
  .branch-btn .bb-name { font-size: 12.5px; font-weight: 650; display: block; }
  .branch-btn .bb-sub { font-size: 10.5px; color: #7f9ab8; }
  .branch-btn svg { width: 15px; height: 15px; color: #7f9ab8; }

  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav .tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 13px;
    color: #9fb4cf;
  }
  .side-nav .tab svg { width: 18px; height: 18px; }
  .side-nav .tab:hover { background: rgba(255, 255, 255, .06); color: #eaf2ff; }
  .side-nav .tab.active { background: linear-gradient(100deg, rgba(14, 159, 110, .26), rgba(34, 184, 207, .12)); color: #fff; box-shadow: inset 0 0 0 1px rgba(55, 224, 164, .22); }
  .side-nav .tab.active svg { stroke: #55e6b3; }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
  .side-foot .row { gap: 8px; }
  .side-foot .icon-btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #b9cbe2; }
  .side-foot .icon-btn:hover { background: rgba(255, 255, 255, .11); color: #fff; }
  .side-foot .btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #c6d6ea; }
  .side-foot .btn:hover { background: rgba(255, 255, 255, .11); }
  .side-foot .pill { background: rgba(255, 255, 255, .07); color: #9fb4cf; }

  .topbar { padding: 16px 28px; }
  .topbar .brand.mobile-brand { display: none; }
  .view { padding: 22px 28px 44px; max-width: 1240px; }
  .hero { padding: 26px 28px; }
  .hero h1 { font-size: 27px; }
  .dash-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
  .kpis { gap: 12px; }
  .kpi { padding: 16px; }
  .kpi .value { font-size: 27px; }
  .branch-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 360px) {
  .view { padding-left: 12px; padding-right: 12px; }
  .kpi .value { font-size: 21px; }
}

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

/* ============ alerts, reports, packages ============ */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--bad); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  border: 2px solid var(--surface);
}
.notif { align-items: flex-start; gap: 10px; }
.notif-ico {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
}
.notif-ico svg { width: 16px; height: 16px; }
.notif-ico.bad { background: var(--bad-soft); color: var(--bad); }
.notif-ico.warn { background: var(--warn-soft); color: var(--warn); }
.notif-ico.ok { background: var(--ok-soft); color: var(--ok); }
.notif-ico.info { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.notif.unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.notif.unread .name::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle;
}
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 6px 2px 0; overflow-x: auto; }
.bars .bar { flex: 1 0 8px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bars .bar i {
  display: block; width: 100%; max-width: 22px; min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--cyan)));
}
.bars .bar span { font-size: 9px; color: var(--muted); }
.rank {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  background: var(--surface-3); color: var(--text-2);
}
.report-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.report-form .field { margin: 0; min-width: 150px; flex: 1; }
.item.dim { opacity: .55; }

/* ============ guided tour ============ */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-backdrop { position: absolute; inset: 0; background: rgba(4, 10, 22, .66); backdrop-filter: blur(2px); }
.tour-ring {
  position: fixed;
  z-index: 91;
  pointer-events: none;
  border: 2px solid #37e0a4;
  box-shadow: 0 0 0 3px rgba(55, 224, 164, .22), 0 0 34px rgba(55, 224, 164, .28);
  transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}
.tour-card {
  position: fixed;
  z-index: 92;
  width: min(92vw, 380px);
  max-height: min(72dvh, 470px);
  overflow-y: auto;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: tourIn .18s ease;
}
.tour-card.center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tour-step { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-strong); }
.tour-x {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: var(--surface-3); color: var(--muted);
  cursor: pointer;
}
.tour-x svg { width: 14px; height: 14px; }
.tour-card h3 { font-size: 16px; margin-bottom: 6px; }
.tour-body { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.tour-body b { color: var(--text); }
.tour-actions { display: flex; gap: 8px; margin-top: 14px; }
.tour-actions .btn { flex: 1; }
.tour-skip {
  display: block;
  margin: 10px auto 0;
  border: 0; background: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
}
@keyframes tourIn { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 559px) {
  .tour-card { padding: 14px; }
  .tour-body { font-size: 12.5px; }
}

/* voucher / package codes */
.qr-box { display: inline-flex; padding: 10px; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.qr-box svg { width: 190px; height: 190px; display: block; }
.qr-url { font-size: 11.5px; word-break: break-all; color: var(--muted); margin-top: 8px; }
.vcode { font: 700 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.voucher-sheet-code { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px dashed var(--line); border-radius: 14px; }

/* ============ language flags ============ */
.lang-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.flag-btn {
  display: grid; place-items: center;
  width: 30px; height: 22px;
  padding: 2px;
  border: 0; border-radius: 7px;
  background: transparent;
  opacity: .5;
  cursor: pointer;
  transition: .15s ease;
}
.flag-btn svg { width: 24px; height: 16px; border-radius: 2.5px; display: block; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.flag-btn:hover { opacity: .9; }
.flag-btn.active { opacity: 1; background: var(--accent-soft); }
.side-foot .lang-switch { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }
.side-foot .flag-btn.active { background: rgba(255, 255, 255, .18); }
.top-lang { display: none; }
@media (max-width: 1023px) { .top-lang { display: inline-flex; } }
@media (max-width: 559px) {
  .top-actions #tourBtn,
  .top-actions [data-theme-toggle] { display: none; }
  .top-lang { padding: 2px; }
  .top-lang .flag-btn { width: 26px; height: 20px; }
  .top-lang .flag-btn svg { width: 21px; height: 14px; }
}
@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar .brand.small { flex: 1 1 auto; }
  .topbar .brand strong { max-width: none; }
  .topbar .top-actions { flex: 1 1 100%; justify-content: flex-start; gap: 6px; }
  .topbar .top-actions .chip { flex: 1 1 auto; justify-content: center; min-width: 0; }
  .topbar .top-actions .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.account-lang { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.account-lang:last-child { border-bottom: 0; }
.account-lang .label { font-size: 13px; font-weight: 600; }
.account-lang .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ============ bottom tabs: 4 primary + More ============ */
.tabbar { max-width: 430px; }
.tabbar .tab { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.tabbar .tab span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabbar .tab svg { flex: none; }
@media (max-width: 559px) {
  .tabbar { padding: 5px; bottom: calc(8px + env(safe-area-inset-bottom, 0)); }
  .tabbar .tab { font-size: 10px; padding: 6px 2px 5px; }
}

/* ============ reports ============ */
.rchart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding: 6px 2px 0; overflow-x: auto; }
.rcol { flex: 1 0 10px; min-width: 10px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.rbars { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.rbars i { display: block; width: 42%; max-width: 10px; border-radius: 4px 4px 2px 2px; min-height: 2px; }
.rbars i.inc { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--cyan))); }
.rbars i.exp { background: color-mix(in srgb, var(--bad) 70%, transparent); min-height: 0; }
.rcol span { font-size: 9px; color: var(--muted); height: 12px; }
.chart-legend { display: flex; gap: 14px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.chart-legend b { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.forecast { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .forecast { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.forecast .f { padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.forecast .f .k { font-size: 11px; color: var(--muted); }
.forecast .f .v { font-size: 17px; font-weight: 750; margin-top: 3px; font-variant-numeric: tabular-nums; }
.forecast .f .s { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.rec { display: flex; gap: 11px; padding: 12px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent); align-items: flex-start; }
.rec:last-child { border-bottom: 0; }
.rec .ri { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.rec .ri svg { width: 17px; height: 17px; }
.rec.ok .ri { background: var(--ok-soft); color: var(--accent-strong); }
.rec.warn .ri { background: var(--warn-soft); color: var(--warn); }
.rec.bad .ri { background: var(--bad-soft); color: var(--bad); }
.rec.info .ri { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.rec .rt { font-size: 13px; font-weight: 650; }
.rec .rb { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.rec .item-actions { align-self: center; }
.donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 118px; height: 118px; border-radius: 50%; position: relative; flex: none; display: grid; place-items: center; }
.donut::after { content: ''; position: absolute; inset: 19px; border-radius: 50%; background: var(--surface); }
.donut span { position: relative; z-index: 1; font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.3; }
.legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 7px; }
.legend .lg { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.legend .lg b { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend .lg .v { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.share { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 5px; }
.share i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: 4px; }
.guest-kpis { margin-bottom: 2px; }

/* ============ top menu button + nav drawer ============ */
.menu-btn { display: none; flex: none; }
@media (max-width: 1023px) { .menu-btn { display: grid; } }

.drawer-wrap { position: fixed; inset: 0; z-index: 70; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(4, 10, 22, .55); backdrop-filter: blur(3px); animation: fade .18s ease; }
.drawer {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: min(316px, 86vw);
  display: flex;
  flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top, 0)) 14px calc(14px + env(safe-area-inset-bottom, 0));
  color: #eaf2ff;
  background:
    radial-gradient(420px 260px at 50% -10%, rgba(34, 184, 207, .16), transparent 60%),
    linear-gradient(180deg, #0a1322 0%, #0b1728 55%, #08131f 100%);
  border-right: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 24px 0 70px rgba(0, 0, 0, .45);
  animation: drawerIn .22s cubic-bezier(.2, .8, .3, 1);
  overflow-y: auto;
}
@keyframes drawerIn { from { transform: translateX(-28px); opacity: .4; } }
@media (min-width: 1024px) { .drawer-wrap { display: none !important; } }

.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.drawer-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.drawer-brand .brand-logo-chip img { width: 112px; }
.drawer-brand .brand-icon { width: 40px; height: 40px; padding: 9px; border-radius: 13px; background: linear-gradient(145deg, var(--accent), var(--cyan)); stroke: #fff; flex: none; }
.drawer-brand strong { display: block; font-size: 15px; letter-spacing: -.2px; color: #eaf2ff; }
.drawer-brand span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #7f9ab8; }
.drawer-head .icon-btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #b9cbe2; }
.drawer-head .icon-btn:hover { background: rgba(255, 255, 255, .11); color: #fff; }

.drawer-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 12px 0; }
.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #9fb4cf;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: .15s ease;
}
.drawer-item svg { width: 19px; height: 19px; flex: none; }
.drawer-item:hover { background: rgba(255, 255, 255, .06); color: #eaf2ff; }
.drawer-item.active { background: linear-gradient(100deg, rgba(14, 159, 110, .26), rgba(34, 184, 207, .12)); color: #fff; box-shadow: inset 0 0 0 1px rgba(55, 224, 164, .22); }
.drawer-item.active svg { stroke: #55e6b3; }

.drawer-foot { display: flex; flex-direction: column; gap: 9px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.drawer-foot .lang-switch { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); padding: 2px; }
.drawer-foot .flag-btn.active { background: rgba(255, 255, 255, .18); }
.drawer-foot .icon-btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #b9cbe2; }
.drawer-foot .icon-btn:hover { background: rgba(255, 255, 255, .11); color: #fff; }
.drawer-foot .btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #c6d6ea; }
.drawer-foot .btn:hover { background: rgba(255, 255, 255, .11); }
.drawer-foot .pill { background: rgba(255, 255, 255, .07); color: #9fb4cf; align-self: flex-start; }

/* ============ More menu sheet ============ */
.more-sheet { max-width: 520px; }
.more-head { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 18px 2px; }
.more-grab { width: 38px; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.more-head h2 { font-size: 15px; letter-spacing: .01em; color: var(--text-2); }
.more-body { padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0)); display: flex; flex-direction: column; gap: 14px; }
.more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.more-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 13px 4px 11px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: .15s ease;
}
.more-tile:hover, .more-tile:focus-visible { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--text); transform: translateY(-1px); }
.more-tile .mt-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.more-tile .mt-ico svg { width: 20px; height: 20px; }
.more-tile:nth-child(2) .mt-ico { background: var(--warn-soft); color: var(--warn); }
.more-tile:nth-child(3) .mt-ico { background: color-mix(in srgb, var(--violet) 16%, transparent); color: var(--violet); }
.more-tile:nth-child(4) .mt-ico { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: color-mix(in srgb, var(--cyan) 80%, var(--text)); }
.more-tile .mt-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-rows { display: flex; flex-direction: column; }
.more-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 4px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.more-row:hover { color: var(--text); }
.more-row svg { width: 18px; height: 18px; flex: none; }
.more-row .chev { margin-left: auto; width: 16px; height: 16px; color: var(--muted); transform: rotate(-90deg); }
.more-lang .lang-switch { margin-left: auto; padding: 2px; }

/* ============ settings hub ============ */
.group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 4px -4px;
}
.group-label:first-child { margin-top: 2px; }
.hub-hero { display: flex; flex-direction: column; gap: 13px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface)) 0%, var(--surface) 58%); }
.hub-head { display: flex; align-items: center; gap: 12px; }
.hub-badge {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.hub-badge svg { width: 22px; height: 22px; }
.hub-titles { flex: 1; min-width: 0; }
.hub-kicker { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hub-title { font-size: 16px; font-weight: 700; letter-spacing: -.2px; line-height: 1.3; }
.hub-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hub-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-width: 0;
}
.hub-stat .k { font-size: 9.5px; line-height: 1.25; color: var(--muted); display: flex; align-items: flex-start; gap: 3px; white-space: normal; }
.hub-stat .k svg { width: 11px; height: 11px; margin-top: 1px; flex: none; }
.hub-stat .v { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-stat .v .pill { font-size: 10.5px; }
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.seg button .n { font-size: 10.5px; font-weight: 600; opacity: .65; font-variant-numeric: tabular-nums; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ============ branch wizard ============ */
.wiz-steps { display: flex; align-items: center; gap: 6px; }
.wiz-step { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.wiz-step .dot {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
}
.wiz-step .dot svg { width: 13px; height: 13px; }
.wiz-step.active { color: var(--text); }
.wiz-step.active .dot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.wiz-step.done .dot { border-color: transparent; background: var(--accent); color: #fff; }
.wiz-line { flex: 1; height: 2px; border-radius: 2px; background: var(--line); min-width: 12px; }
.wiz-done { display: flex; align-items: center; gap: 12px; }
.wiz-check {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.wiz-check svg { width: 20px; height: 20px; }
.wiz-code {
  margin: 8px 0;
  padding: 16px 10px;
  text-align: center;
  font: 700 26px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 4px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  user-select: all;
}
@media (max-width: 420px) {
  .wiz-step span:last-child { display: none; }
}
@media (min-width: 900px) {
  .hub-hero > .btn { align-self: flex-start; padding-inline: 26px; }
}
.card-head .head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
@media (max-width: 560px) {
  .card-head:has(.head-actions) { flex-wrap: wrap; }
  .card-head .head-actions { width: 100%; }
  .card-head .head-actions > * { flex: 1 1 0; justify-content: center; }
}
