/* Noviqra GeoGuard · Command Center
   Brand: black + NQ gold. Chart colours follow the validated data-viz palette (see charts.js). */

@font-face { font-family: 'Jakarta'; src: url('/vendor/fonts/jakarta.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'JBMono'; src: url('/vendor/fonts/mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --font: 'Jakarta', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JBMono', ui-monospace, monospace;
  --bg: #f4f3ef; --surface: #ffffff; --surface-2: #faf9f6; --surface-3: #f2f0ea; --hover: #f6f4ee;
  --line: #e9e6de; --line-2: #ddd9ce;
  --ink: #121212; --ink-2: #52514e; --ink-3: #898781; --ink-inv: #ffffff;
  --gold: #b88943; --gold-2: #d6ad6b; --gold-ink: #8a6424; --gold-soft: #f7eedf; --gold-line: #ecd9b8;
  --s-gold: #a87a35; --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --seq-0: #f0efec; --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95;
  --grid: #eeece6; --axis: #c3c2b7;
  --good: #0ca30c; --good-ink: #006300; --good-bg: #e6f4e6;
  --warn: #fab219; --warn-ink: #8a5a00; --warn-bg: #fdf3dc;
  --serious: #ec835a; --serious-bg: #fcebe3;
  --bad: #d03b3b; --bad-ink: #a32121; --bad-bg: #fbe6e6;
  --info: #2a78d6; --info-bg: #e5effb;
  --shadow-sm: 0 1px 2px rgba(20, 16, 8, .05);
  --shadow: 0 1px 2px rgba(20, 16, 8, .04), 0 10px 30px -14px rgba(20, 16, 8, .16);
  --shadow-lg: 0 24px 60px -20px rgba(20, 16, 8, .35);
  --r: 16px; --r-sm: 10px; --r-xs: 7px;
  --side: 256px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0b0c; --surface: #161616; --surface-2: #1b1b1b; --surface-3: #222222; --hover: #1f1f1f;
  --line: #262626; --line-2: #313131;
  --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8f8d86;
  --gold-soft: #2a2115; --gold-line: #4a3a20; --gold-ink: #e0b874;
  --s-gold: #b8873f; --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --seq-0: #222220; --seq-1: #104281; --seq-2: #184f95; --seq-3: #256abf; --seq-4: #3987e5; --seq-5: #6da7ec; --seq-6: #9ec5f4;
  --grid: #232321; --axis: #383835;
  --good-ink: #3fc03f; --good-bg: #13260f; --warn-ink: #f2bf4e; --warn-bg: #2b220b; --serious-bg: #2d1a12;
  --bad-ink: #f07272; --bad-bg: #2d1414; --info-bg: #11213a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.i { flex: none; display: inline-block; vertical-align: middle; }
.mono { font-family: var(--mono); font-size: .92em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
::selection { background: var(--gold-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }

/* ------------------------------------------------------------------ app shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; transition: grid-template-columns .35s var(--ease); }
.shell.collapsed { --side: 78px; }
.side { position: sticky; top: 0; height: 100vh; background: #0e0e0f; color: #a8a59d; display: flex; flex-direction: column;
  border-right: 1px solid #1d1d1f; overflow: hidden; z-index: 30; }
.side::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(400px 260px at -60px -40px, rgba(184, 137, 67, .22), transparent 70%),
              radial-gradient(300px 300px at 120% 110%, rgba(184, 137, 67, .08), transparent 70%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; position: relative; }
/* The NQ mark is wide (about 3:2): keep its proportions inside a dark app-icon tile, like the phone app icon. */
.brand .logo { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(150deg, #1d1b18, #0b0b0b); border: 1px solid rgba(214, 173, 107, .32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 24px -10px rgba(184, 137, 67, .65); }
.brand .logo img { width: 33px; height: auto; display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.shell.collapsed .brand { padding-left: 16px; }
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .01em; white-space: nowrap; }
.brand span { display: block; color: var(--gold-2); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 12px; position: relative; scrollbar-width: none; }
.nav-group { margin-top: 14px; }
.nav-group > small { display: block; padding: 0 12px 6px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #5e5b55; font-weight: 700; white-space: nowrap; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 11px; color: #a8a59d;
  font-weight: 550; white-space: nowrap; transition: color .2s, background .2s; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(184, 137, 67, .22), rgba(184, 137, 67, .04)); }
.nav a.active .i { color: var(--gold-2); }
.nav a .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: #2a2a2c; color: #ddd; font-size: 11px;
  display: grid; place-items: center; font-weight: 700; }
.nav a .count.hot { background: var(--bad); color: #fff; }
.nav a .live-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, .6); animation: ping 2s infinite; }
.nav-ind { position: absolute; left: 12px; width: 3px; height: 22px; border-radius: 3px; background: var(--gold-2); box-shadow: 0 0 12px var(--gold);
  transition: transform .4s var(--ease), opacity .3s; pointer-events: none; }
.shell.collapsed .nav-group > small, .shell.collapsed .nav a span, .shell.collapsed .nav a .count, .shell.collapsed .brand div, .shell.collapsed .me div { opacity: 0; pointer-events: none; }
.shell.collapsed .nav a { justify-content: center; padding: 0; }
.me { margin: 10px 12px 14px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid #1f1f21; display: flex; align-items: center; gap: 10px; position: relative; }
.me b { color: #eee; font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.me small { color: #77746d; font-size: 11.5px; }
.me button { margin-left: auto; }
.side .icon-btn { color: #8a877f; }
.side .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 26px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 19px; font-weight: 750; }
.top .crumb { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.search-btn { display: flex; align-items: center; gap: 10px; height: 38px; min-width: 260px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-3); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.search-btn:hover { border-color: var(--gold-line); box-shadow: 0 0 0 4px var(--gold-soft); }
.search-btn kbd { margin-left: auto; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.clock b { font-size: 15px; font-variant-numeric: tabular-nums; }
.clock small { font-size: 11px; color: var(--ink-3); }
.duty { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 20px; font-size: 12px; font-weight: 650;
  background: var(--good-bg); color: var(--good-ink); }
.duty.off { background: var(--surface-3); color: var(--ink-2); }
.duty i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: ping 2s infinite; }
.duty.off i { animation: none; }
.demo-flag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 20px; font-size: 11px; font-weight: 750;
  letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); background: var(--gold-soft); border: 1px dashed var(--gold-line); cursor: pointer; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; border: 0; background: transparent;
  color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .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: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.content { padding: 24px 26px 40px; min-width: 0; flex: 1; }
.view { animation: viewIn .5s var(--ease) both; }
.view > * { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }

/* ------------------------------------------------------------------ cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); min-width: 0;
  transition: box-shadow .3s var(--ease), transform .3s var(--ease), border-color .3s; }
.card.lift:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.card-h h3 { font-size: 14.5px; font-weight: 700; }
.card-h .hint { font-size: 12px; color: var(--ink-3); }
.card-b { padding: 10px 18px 18px; }
.card-b.flush { padding: 0; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cols-21 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.cols-12 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.cols-32 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.stack { display: grid; gap: 16px; }
@media (max-width: 1280px) { .cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .cols-2, .cols-21, .cols-12, .cols-32, .cols-3 { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 26px 2px 12px; }
.section-title h2 { font-size: 16px; font-weight: 750; }
.section-title span { color: var(--ink-3); font-size: 12.5px; }

/* greeting / hero */
.hello { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.hello h2 { font-size: 26px; font-weight: 780; letter-spacing: -.02em; }
.hello p { margin: 4px 0 0; color: var(--ink-2); }
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 22px 24px; color: #fff; background: #111;
  border: 1px solid #222; box-shadow: var(--shadow); isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: -40%; z-index: -1;
  background: conic-gradient(from 0deg at 70% 30%, rgba(184, 137, 67, .0), rgba(184, 137, 67, .45), rgba(184, 137, 67, 0) 30%);
  animation: spin 14s linear infinite; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 120% at 100% 0%, rgba(214, 173, 107, .25), transparent 55%),
  linear-gradient(160deg, #161616 20%, #0c0c0c); }
@keyframes spin { to { transform: rotate(360deg); } }
.hero small { color: var(--gold-2); text-transform: uppercase; letter-spacing: .14em; font-weight: 750; font-size: 11px; }
.hero .big { font-size: 56px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: 10px 0 6px; }
.hero .big em { font-style: normal; font-size: 22px; color: #9b968b; font-weight: 650; margin-left: 6px; }
.hero p { color: #b9b5ab; margin: 0; }
.hero .ring { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; }
.kpi { position: relative; padding: 16px 16px 12px; overflow: hidden; }
.kpi .lbl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi .lbl .i { color: var(--gold); }
.kpi .val { font-size: 28px; font-weight: 780; letter-spacing: -.02em; margin: 8px 0 2px; }
.kpi .val small { font-size: 14px; color: var(--ink-3); font-weight: 650; margin-left: 2px; }
.kpi .foot { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: 12px; color: var(--ink-3); }
.kpi .spark { display: block; width: 100%; height: 30px; margin: 2px 0 6px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12px; padding: 1px 7px 1px 5px; border-radius: 10px; }
.delta.up { color: var(--good-ink); background: var(--good-bg); }
.delta.down { color: var(--bad-ink); background: var(--bad-bg); }
.delta.flat { color: var(--ink-2); background: var(--surface-3); }

/* pills, badges */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 20px; font-size: 12px; font-weight: 650; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-bg); color: var(--good-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill.gold { background: var(--gold-soft); color: var(--gold-ink); }
.pill.info { background: var(--info-bg); color: var(--s1); }
.pill.ghost { background: transparent; border: 1px solid var(--line-2); }
.pill.pulse .dot { animation: ping 1.8s infinite; }
.tag { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 750; letter-spacing: .04em;
  text-transform: uppercase; background: var(--surface-3); color: var(--ink-3); }
.tag.demo { background: var(--gold-soft); color: var(--gold-ink); }
.score { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; font-variant-numeric: tabular-nums; }
.score b { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 8px; font-size: 12.5px; }
.score.s-a b { background: var(--good-bg); color: var(--good-ink); }
.score.s-b b { background: color-mix(in srgb, var(--good-bg) 60%, var(--surface-3)); color: var(--good-ink); }
.score.s-c b { background: var(--warn-bg); color: var(--warn-ink); }
.score.s-d b { background: var(--bad-bg); color: var(--bad-ink); }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 12.5px; letter-spacing: .02em;
  color: var(--gold-ink); background: linear-gradient(140deg, var(--gold-soft), color-mix(in srgb, var(--gold-soft) 40%, var(--surface))); border: 1px solid var(--gold-line); }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; }
.btn:hover { border-color: var(--ink-3); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.97); }
.btn.primary { border: 0; color: #1a1205; background: linear-gradient(135deg, #e2bd7e, #b88943 55%, #a27434); box-shadow: 0 6px 18px -8px rgba(184, 137, 67, .9), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.danger { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); box-shadow: none; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface);
  outline: none; transition: border-color .2s, box-shadow .2s; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 11.5px; }
.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); gap: 2px; position: relative; }
.seg button { position: relative; z-index: 1; height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-weight: 650;
  font-size: 12.5px; cursor: pointer; transition: color .2s; }
.seg button.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink-2); font-weight: 600; font-size: 12.5px; cursor: pointer; transition: all .2s; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { font-size: 11px; opacity: .7; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 20px; background: var(--line-2); border: 0; cursor: pointer; transition: background .25s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s var(--ease); }
.toggle.on { background: var(--gold); }
.toggle.on::after { transform: translateX(18px); }
.days-pick { display: flex; gap: 6px; }
.days-pick button { width: 42px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 650; cursor: pointer; }
.days-pick button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* tables */
.table-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.t th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); font-weight: 700;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.t th.sortable { cursor: pointer; user-select: none; }
.t th.sortable:hover { color: var(--ink); }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t tbody tr { transition: background .15s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr:hover { background: var(--hover); }
.t tbody tr:last-child td { border-bottom: 0; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { position: relative; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--s-gold); transform-origin: left; animation: grow .9s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.idx { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 800; font-size: 13px; position: relative; }

/* insights */
.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.insight { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); position: relative; overflow: hidden; }
.insight::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink-3); }
.insight.good::before { background: var(--good); } .insight.warn::before { background: var(--warn); } .insight.bad::before { background: var(--bad); } .insight.info::before { background: var(--s1); }
.insight .ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.insight.good .ic { background: var(--good-bg); color: var(--good-ink); } .insight.warn .ic { background: var(--warn-bg); color: var(--warn-ink); }
.insight.bad .ic { background: var(--bad-bg); color: var(--bad-ink); } .insight.info .ic { background: var(--info-bg); color: var(--s1); }
.insight b { display: block; font-size: 13.5px; }
.insight p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); }

/* feed */
.feed { display: grid; }
.feed-item { display: flex; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.feed-item:hover { background: var(--hover); }
.feed-item.new { animation: flash 1.6s var(--ease); }
@keyframes flash { from { background: var(--gold-soft); transform: translateX(-6px); } }
.feed-item .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); }
.feed-item .ic.good { background: var(--good-bg); color: var(--good-ink); } .feed-item .ic.bad { background: var(--bad-bg); color: var(--bad-ink); }
.feed-item .ic.gold { background: var(--gold-soft); color: var(--gold-ink); } .feed-item .ic.info { background: var(--info-bg); color: var(--s1); }
.feed-item p { margin: 0; font-size: 13px; }
.feed-item small { color: var(--ink-3); font-size: 11.5px; }

/* ------------------------------------------------------------------ map */
.map { width: 100%; height: 100%; min-height: 300px; border-radius: inherit; background: var(--surface-3); z-index: 0; }
.leaflet-container { font-family: var(--font); background: var(--surface-3); }
.leaflet-tile-pane { filter: saturate(.45) contrast(.96) brightness(1.04); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) saturate(.35) brightness(.82) contrast(.92); }
:root[data-theme="dark"] .leaflet-container { background: #1c1c1c; }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--ink-3) !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); border-radius: 14px; }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; }
.rm-pin { position: relative; width: 38px; height: 38px; }
.rm-pin .face { position: absolute; inset: 3px; border-radius: 50%; display: grid; place-items: center; font: 800 11px var(--font); color: #fff; background: #1b1b1b;
  border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); transition: transform .3s var(--ease); }
.rm-pin:hover .face, .rm-pin.sel .face { transform: scale(1.18); }
.rm-pin.sel { z-index: 1000 !important; }
.rm-pin::before { content: ''; position: absolute; inset: 0; border-radius: 50%; }
.rm-pin.moving .face { background: var(--s1); }
.rm-pin.moving::before { border: 2px solid var(--s1); animation: halo 2s infinite; }
.rm-pin.meeting .face { background: linear-gradient(135deg, #d6ad6b, #a27434); color: #1a1205; }
.rm-pin.meeting::before { border: 2px solid var(--gold); animation: halo 1.6s infinite; }
.rm-pin.arrived .face { background: var(--good); }
.rm-pin.idle .face { background: #5b5a56; }
.rm-pin.lost .face { background: var(--bad); }
.rm-pin.lost::before { border: 2px dashed var(--bad); animation: none; }
.rm-pin.off .face { background: #9b998f; opacity: .8; }
@keyframes halo { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
.cust-pin { width: 14px; height: 14px; border-radius: 4px; transform: rotate(45deg); background: var(--surface); border: 3px solid var(--ink-2); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.cust-pin.completed { border-color: var(--good); } .cust-pin.missed { border-color: var(--bad); } .cust-pin.in_meeting, .cust-pin.arrived { border-color: var(--gold); }
.cust-pin.planned { border-color: var(--s1); }
.map-label { background: var(--ink); color: var(--bg); padding: 3px 8px; border-radius: 6px; font: 700 11.5px var(--font); white-space: nowrap; box-shadow: var(--shadow); }

.live { display: grid; grid-template-columns: 360px 1fr; gap: 0; height: calc(100vh - 68px - 48px); min-height: 560px; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.live-side { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: var(--surface); }
.live-side .head { padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.live-list { overflow-y: auto; flex: 1; }
.live-rm { display: flex; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .2s; align-items: center; }
.live-rm:hover { background: var(--hover); }
.live-rm.sel { background: var(--gold-soft); }
.live-rm .meta { min-width: 0; flex: 1; }
.live-rm b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-rm small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-rm .prog { width: 54px; text-align: right; font-size: 12px; color: var(--ink-2); font-weight: 650; }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; }
.st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st.moving { color: var(--s1); } .st.meeting { color: var(--gold-ink); } .st.arrived { color: var(--good-ink); }
.st.idle { color: var(--ink-2); } .st.lost { color: var(--bad-ink); } .st.off { color: var(--ink-3); }
.map-wrap { position: relative; min-width: 0; }
.map-over { position: absolute; z-index: 500; }
.glass { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(14px) saturate(1.3); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.map-stats { top: 14px; left: 14px; display: flex; gap: 2px; padding: 6px; }
.map-stats div { padding: 4px 12px; text-align: center; }
.map-stats b { display: block; font-size: 18px; font-weight: 800; }
.map-stats small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.map-tools { top: 14px; right: 14px; display: flex; gap: 4px; padding: 5px; }
.rm-card { left: 14px; bottom: 14px; width: 360px; padding: 16px; animation: rise .4s var(--ease) both; }
.replay { left: 14px; right: 14px; bottom: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; animation: rise .4s var(--ease) both; }
.replay input[type=range] { flex: 1; accent-color: var(--gold); }

/* ------------------------------------------------------------------ drawer, modal, toast, tooltip */
.scrim { position: fixed; inset: 0; z-index: 900; background: rgba(8, 8, 8, .35); backdrop-filter: blur(3px); animation: viewIn .25s both; }
.drawer { position: fixed; z-index: 901; top: 10px; right: 10px; bottom: 10px; width: min(600px, calc(100vw - 20px)); background: var(--bg); border-radius: 20px;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: slideIn .45s var(--ease) both; }
.drawer.closing { animation: slideOut .3s var(--ease) both; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes slideOut { to { transform: translateX(40px); opacity: 0; } }
.drawer-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-h h2 { font-size: 18px; font-weight: 780; }
.drawer-b { overflow-y: auto; padding: 18px 20px 30px; display: grid; gap: 16px; align-content: start; }
.drawer-b > * { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.modal { position: fixed; z-index: 902; left: 50%; top: 50%; width: min(560px, calc(100vw - 30px)); max-height: calc(100vh - 40px); transform: translate(-50%, -50%);
  background: var(--surface); border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .35s var(--ease) both; }
.modal.wide { width: min(860px, calc(100vw - 30px)); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -47%) scale(.97); } }
.modal-h { padding: 18px 20px 6px; display: flex; align-items: center; gap: 10px; }
.modal-h h3 { font-size: 17px; font-weight: 780; }
.modal-b { padding: 10px 20px; overflow-y: auto; }
.modal-f { padding: 14px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; }
.secret { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; background: var(--gold-soft); border: 1px dashed var(--gold-line); }
.secret b { font: 800 28px var(--mono); letter-spacing: .18em; color: var(--gold-ink); }
.toasts { position: fixed; z-index: 950; right: 18px; bottom: 18px; display: grid; gap: 10px; width: 360px; }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; background: #141414; color: #eee; box-shadow: var(--shadow-lg);
  border: 1px solid #2a2a2a; animation: toastIn .5s var(--ease) both; cursor: pointer; }
.toast.out { animation: toastOut .35s var(--ease) both; }
.toast .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #262626; color: var(--gold-2); }
.toast.good .ic { color: #5fd35f; } .toast.bad .ic { color: #ff7b7b; }
.toast b { display: block; font-size: 13px; color: #fff; } .toast p { margin: 2px 0 0; font-size: 12.5px; color: #aaa; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.tooltip { position: fixed; z-index: 990; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; min-width: 120px;
  padding: 9px 11px; border-radius: 11px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 12.5px; }
.tooltip.on { opacity: 1; transform: none; }
.tooltip .tt-h { color: var(--ink-3); font-size: 11.5px; margin-bottom: 5px; font-weight: 600; }
.tooltip .tt-r { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-r i { width: 12px; height: 3px; border-radius: 2px; }
.tooltip .tt-r b { font-variant-numeric: tabular-nums; min-width: 34px; }
.tooltip .tt-r span { color: var(--ink-2); }

/* command palette */
.palette { top: 14vh; transform: translateX(-50%); width: min(640px, calc(100vw - 30px)); animation: popTop .3s var(--ease) both; }
@keyframes popTop { from { opacity: 0; transform: translate(-50%, -10px) scale(.98); } }
.palette input { border: 0; outline: 0; background: transparent; width: 100%; height: 56px; font-size: 16px; padding: 0 18px 0 48px; }
.palette .in { position: relative; border-bottom: 1px solid var(--line); }
.palette .in .i { position: absolute; left: 18px; top: 19px; color: var(--ink-3); }
.palette .res { max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette .res a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; }
.palette .res a.on, .palette .res a:hover { background: var(--hover); }
.palette .res small { color: var(--ink-3); }
.palette .grp { padding: 10px 10px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }

/* ------------------------------------------------------------------ charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-3); font-size: 11px; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .area { opacity: .1; animation: viewIn 1.2s .3s both; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: barUp .8s var(--ease) both; transition: opacity .15s; }
.chart .hbar { transform-box: fill-box; transform-origin: left; animation: grow .8s var(--ease) both; }
@keyframes barUp { from { transform: scaleY(0); } }
.chart .bar:hover, .chart .hbar:hover, .chart .cell:hover { opacity: .78; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; opacity: 0; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .lbl-strong { fill: var(--ink); font-weight: 700; font-size: 12px; }
.chart .lbl-mid { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.cell { transition: opacity .15s; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend i.ln { height: 3px; width: 14px; border-radius: 2px; }
.segbar { display: flex; gap: 2px; height: 28px; border-radius: 6px; overflow: hidden; }
.segbar div { display: flex; align-items: center; padding: 0 8px; color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden;
  border-radius: 4px; transform-origin: left; animation: grow .9s var(--ease) both; min-width: 0; }
.segbar div.dk { color: #0b0b0b; }
.hlist { display: grid; gap: 12px; }
.hrow { display: grid; grid-template-columns: 130px 1fr 74px; align-items: center; gap: 12px; font-size: 13px; }
.hrow .track { height: 12px; position: relative; }
.hrow .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; transform-origin: left; animation: grow .9s var(--ease) both; }
.hrow b { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.hrow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }

/* ------------------------------------------------------------------ planner (gantt) */
.gantt { position: relative; overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: 220px 1fr; border-bottom: 1px solid var(--line); min-height: 52px; }
.gantt-row:hover { background: var(--hover); }
.gantt-row .who { padding: 9px 14px; border-right: 1px solid var(--line); background: var(--surface); position: sticky; left: 0; z-index: 2; }
.gantt-track { position: relative; min-width: 1500px; }
.gantt-head { position: sticky; top: 0; z-index: 3; background: var(--surface-2); height: 34px; }
.gantt-head span { position: absolute; top: 9px; font-size: 11px; color: var(--ink-3); transform: translateX(-50%); font-weight: 650; }
.gantt-hr { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.gblock { position: absolute; top: 9px; height: 34px; border-radius: 9px; padding: 3px 8px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer;
  border: 1px solid; transition: transform .2s, box-shadow .2s; animation: grow .7s var(--ease) both; white-space: nowrap; }
.gblock:hover { transform: translateY(-2px); box-shadow: var(--shadow); z-index: 4; }
.gblock b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.gblock small { opacity: .8; }
.gblock.completed { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 45%, transparent); color: var(--good-ink); }
.gblock.planned { background: var(--info-bg); border-color: color-mix(in srgb, var(--s1) 40%, transparent); color: var(--s1); }
.gblock.in_meeting, .gblock.arrived { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.gblock.missed { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad-ink); }
.gblock.cancelled { background: var(--surface-3); border-color: var(--line-2); color: var(--ink-3); text-decoration: line-through; }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 3; box-shadow: 0 0 10px var(--bad); }
.now-line::before { content: 'NOW'; position: absolute; top: 4px; left: 4px; font: 800 9.5px var(--font); color: var(--bad); letter-spacing: .1em; }

/* pipeline board */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; }
.lane { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 420px; max-height: 72vh; }
.lane-h { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.lane-h b { font-size: 13.5px; }
.lane-h .v { font-size: 20px; font-weight: 800; margin-top: 4px; }
.lane-b { padding: 10px; display: grid; gap: 8px; overflow-y: auto; align-content: start; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; transition: transform .2s, box-shadow .2s;
  animation: rise .5s var(--ease) both; }
.deal:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.deal b { font-size: 13px; } .deal .amt { font-weight: 800; font-size: 14px; }
.deal small { color: var(--ink-3); font-size: 11.5px; }

/* podium */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; }
.pod { text-align: center; padding: 18px 14px; position: relative; overflow: hidden; }
.pod .medal { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; font-weight: 800; color: #1a1205;
  background: linear-gradient(135deg, #f0d39c, #b88943); box-shadow: 0 6px 16px -6px rgba(184, 137, 67, .9); }
.pod.p2 .medal { background: linear-gradient(135deg, #f1f1f1, #a9a9a9); box-shadow: none; }
.pod.p3 .medal { background: linear-gradient(135deg, #f0c2a0, #b07246); box-shadow: none; }
.pod.p1 { padding-top: 26px; padding-bottom: 26px; border-color: var(--gold-line); background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%); }
.pod .avatar { margin: 0 auto 10px; }
.pod h4 { font-size: 15px; }
.pod .score-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }

/* timeline (visit trail) */
.tl { position: relative; display: grid; gap: 0; padding-left: 8px; }
.tl-i { position: relative; padding: 0 0 14px 22px; }
.tl-i::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: -6px; width: 2px; background: var(--line); }
.tl-i:last-child::before { display: none; }
.tl-i::after { content: ''; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); }
.tl-i b { font-size: 13px; } .tl-i small { color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.tl-i p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kv > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.kv small { display: block; color: var(--ink-3); font-size: 11.5px; } .kv b { font-size: 14px; }
.breakdown { display: grid; gap: 8px; }
.breakdown .r { display: grid; grid-template-columns: 22px 1fr 54px; gap: 10px; align-items: center; font-size: 13px; }
.breakdown .r .ok { color: var(--good-ink); } .breakdown .r .no { color: var(--bad-ink); }
.breakdown .r b { text-align: right; font-variant-numeric: tabular-nums; }
audio { width: 100%; height: 40px; }
.empty { display: grid; place-items: center; text-align: center; padding: 40px 20px; color: var(--ink-3); gap: 8px; }
.empty .i { color: var(--gold); }
.skel { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 10px; }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.refetch { opacity: .55; transition: opacity .2s; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.callout.gold { background: var(--gold-soft); border-color: var(--gold-line); color: var(--ink); }
.callout.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--ink); }
.callout .i { color: var(--gold); margin-top: 1px; }
.setting { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .t { flex: 1; } .setting .t b { display: block; } .setting .t small { color: var(--ink-3); }
.stat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.stat-row div small { display: block; font-size: 11.5px; color: var(--ink-3); } .stat-row div b { font-size: 18px; font-weight: 780; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: #0b0b0b; color: #fff; }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px; isolation: isolate; }
.login-art canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.login-art::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(80% 70% at 30% 40%, transparent, #0b0b0b 85%); }
.login-art .brand { padding: 0; }
.login-art h1 { font-size: 46px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; max-width: 560px; }
.login-art h1 span { background: linear-gradient(120deg, #f2d59e, #b88943 60%, #8f6327); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art p { color: #a8a59d; font-size: 15.5px; max-width: 480px; margin: 18px 0 0; }
.login-points { display: flex; gap: 26px; color: #8d8a82; font-size: 13px; }
.login-points b { display: block; color: #fff; font-size: 22px; font-weight: 800; }
.login-form { display: grid; place-items: center; padding: 40px; background: #f6f5f1; color: #121212; }
:root[data-theme="dark"] .login-form { background: #121212; color: #f0efec; }
.login-card { width: min(400px, 100%); animation: rise .7s var(--ease) both; }
.login-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.login-card p { color: var(--ink-2); margin: 6px 0 26px; }
.login-card .btn { width: 100%; height: 46px; font-size: 15px; }
.login-card .err { color: var(--bad-ink); font-size: 13px; min-height: 18px; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { min-height: 300px; } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; transform: translateX(-100%); width: 256px; transition: transform .3s var(--ease); }
  .shell.mobile-open .side { transform: none; }
  .search-btn { min-width: 0; } .search-btn span, .search-btn kbd, .clock { display: none; }
  .live { grid-template-columns: 1fr; height: auto; } .live-side { max-height: 300px; } .map-wrap { height: 60vh; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media print { .side, .top, .toasts { display: none !important; } .shell { display: block; } .card { break-inside: avoid; box-shadow: none; } }

/* top bar: never wrap; shrink the search box first */
.top h1, .top .crumb, .demo-flag, .duty { white-space: nowrap; }
.top > div:nth-child(2) { overflow: hidden; }
.top .crumb { overflow: hidden; text-overflow: ellipsis; }
.search-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1560px) { .search-btn { min-width: 0; } .search-btn span { display: none; } }
@media (max-width: 1280px) { .top .crumb { display: none; } .duty { display: none; } }
.map-wrap .leaflet-top.leaflet-left { top: 84px; }

/* address suggestions */
.sugg-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; padding: 4px; animation: rise .2s var(--ease) both; }
.sugg { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.sugg:hover, .sugg.on { background: var(--hover); }
.sugg > .i { color: var(--gold); }
.sugg b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg small { display: block; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- v0.4: hierarchy scope, organisation, productivity */
.scope-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 280px; padding: 0 12px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: 13px; transition: border-color .2s, box-shadow .2s; }
.scope-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-btn .i:first-child { color: var(--gold); }
.scope-btn:hover { border-color: var(--gold-line); box-shadow: 0 0 0 4px var(--gold-soft); }
.scope-pop { position: fixed; z-index: 70; width: 310px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); display: grid; gap: 10px; animation: rise .22s var(--ease) both; }

.tsplit { display: flex; gap: 2px; height: 8px; border-radius: 5px; overflow: hidden; background: var(--surface-3); min-width: 90px; }
.tsplit i { display: block; height: 100%; transform-origin: left; animation: grow .8s var(--ease) both; }
.tsplit .c, .lg .c { background: var(--s-gold); } .tsplit .f, .lg .f { background: var(--s1); } .tsplit .o, .lg .o { background: var(--axis); }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.lg i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; }

.org { display: grid; gap: 10px; }
.org-node { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); animation: rise .45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms); }
.org-kids { display: grid; gap: 8px; padding: 0 12px 12px 30px; position: relative; }
.org-kids::before { content: ''; position: absolute; left: 20px; top: 0; bottom: 18px; width: 2px; border-radius: 2px; background: var(--line); }
.org-node.collapsed > .org-kids { display: none; }
.org-row { display: grid; grid-template-columns: minmax(230px, 1.6fr) 70px 100px 80px 80px minmax(120px, 1.1fr) minmax(150px, 1fr) 92px; align-items: center;
  gap: 12px; padding: 11px 14px; border-radius: 14px; cursor: pointer; transition: background .15s; }
.org-row:hover { background: var(--hover); }
.org-row .nm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.org-row .nm b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-row .nm small { display: block; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-row .caret { transition: transform .25s var(--ease); color: var(--ink-3); flex: none; }
.org-node.collapsed > .org-row .caret { transform: rotate(-90deg); }
.org-row .lvl { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--gold-soft); color: var(--gold-ink); }
.org-row .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.org-row .num small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11px; }
.org-row .acts { display: flex; justify-content: flex-end; gap: 4px; }
.org-head-row { display: grid; grid-template-columns: minmax(230px, 1.6fr) 70px 100px 80px 80px minmax(120px, 1.1fr) minmax(150px, 1fr) 92px; gap: 12px;
  padding: 0 14px 0 14px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.org-head-row .num { text-align: right; }
.now-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.now-chips span { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 7px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-3); color: var(--ink-2); }
.now-chips .c { background: var(--gold-soft); color: var(--gold-ink); } .now-chips .f { background: var(--info-bg); color: var(--s1); }
.now-chips .d { background: var(--warn-bg); color: var(--warn-ink); } .now-chips .x { background: var(--bad-bg); color: var(--bad-ink); }
.heads { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px 54px; margin-top: -4px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; padding: 2px 0 4px; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
  transition: border-color .2s, transform .2s var(--ease); }
.person:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.person .meta { flex: 1; min-width: 0; } .person .meta b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .meta small { color: var(--ink-3); font-size: 11.5px; }
.zone-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--line-2); }
.zone-dot.customer { background: var(--s-gold); } .zone-dot.field { background: var(--s1); } .zone-dot.office { background: var(--axis); }
.zone-dot.desk { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.idx { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 8px; font-weight: 800; font-size: 12.5px;
  background: var(--surface-3); }
.idx.hi { background: var(--good-bg); color: var(--good-ink); } .idx.mid { background: var(--gold-soft); color: var(--gold-ink); } .idx.lo { background: var(--warn-bg); color: var(--warn-ink); }
@media (max-width: 1280px) {
  .org-row, .org-head-row { grid-template-columns: minmax(200px, 1.6fr) 60px 90px 70px minmax(110px, 1fr) 92px; }
  .org-row > :nth-child(5), .org-head-row > :nth-child(5), .org-row > :nth-child(7), .org-head-row > :nth-child(7) { display: none; }
}
.phone-state { display: flex; flex-direction: column; gap: 3px; }
.issue { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 7px; }
.issue.critical, .issue.serious { background: var(--bad-bg); color: var(--bad-ink); } .issue.warning { background: var(--warn-bg); color: var(--warn-ink); }
.issue.info { background: var(--surface-3); color: var(--ink-2); }
.req-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.req-card:last-child { border-bottom: 0; }
.form .three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-section { font-size: 11.5px; font-weight: 750; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.check-list { display: grid; gap: 4px; max-height: 220px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; }
.check-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.check-list label:hover { background: var(--hover); }
.dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 14px; font-size: 13px; }
.dl > span { color: var(--ink-3); font-weight: 600; font-size: 12px; padding-top: 1px; }
.dl > b { font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
