/* =====================================================================
   TeamTrail – UI styles
   Themes: data-theme = trail | monsoon | saffron | lotus | meadow | slate
   Modes:  data-mode  = light | dark
   ===================================================================== */

:root {
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar-w: 248px;
  --ok: #1F9D6B; --warn: #D98E04; --bad: #D64545; --info: #2F7DD3;
}

/* ---------- theme palettes ---------- */
[data-theme="trail"]   { --brand: #0F3D3E; --brand-ink: #F4FBF8; --signal: #F2A541; --tint: #2BA59B; }
[data-theme="monsoon"] { --brand: #26338C; --brand-ink: #F3F5FF; --signal: #22B8CF; --tint: #5B6BE0; }
[data-theme="saffron"] { --brand: #8C2F0E; --brand-ink: #FFF7F0; --signal: #F59E0B; --tint: #E0663A; }
[data-theme="lotus"]   { --brand: #7A1846; --brand-ink: #FFF3F8; --signal: #F472B6; --tint: #C2407E; }
[data-theme="meadow"]  { --brand: #36541A; --brand-ink: #F7FBEF; --signal: #E3B505; --tint: #6E9E32; }
[data-theme="slate"]   { --brand: #273444; --brand-ink: #F2F6FA; --signal: #38BDF8; --tint: #64748B; }

[data-mode="light"] {
  --bg: color-mix(in oklab, var(--brand) 5%, #F7F8F5);
  --surface: #FFFFFF;
  --surface-2: color-mix(in oklab, var(--brand) 4%, #FBFBF9);
  --line: color-mix(in oklab, var(--brand) 14%, #E3E6E1);
  --ink: #17221F;
  --ink-2: #4A5753;
  --ink-3: #7B8783;
  --contour: color-mix(in oklab, var(--brand) 12%, transparent);
  --shadow: 0 1px 2px rgba(15, 30, 25, .06), 0 8px 24px -12px rgba(15, 30, 25, .18);
  --brand-soft: color-mix(in oklab, var(--brand) 10%, #fff);
  --signal-soft: color-mix(in oklab, var(--signal) 18%, #fff);
  color-scheme: light;
}
[data-mode="dark"] {
  --bg: color-mix(in oklab, var(--brand) 22%, #0B1110);
  --surface: color-mix(in oklab, var(--brand) 16%, #121A19);
  --surface-2: color-mix(in oklab, var(--brand) 20%, #172120);
  --line: color-mix(in oklab, var(--brand) 30%, #26302E);
  --ink: #EEF3F1;
  --ink-2: #B5C1BD;
  --ink-3: #82908B;
  --contour: color-mix(in oklab, var(--signal) 10%, transparent);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  --brand-soft: color-mix(in oklab, var(--tint) 22%, var(--surface));
  --signal-soft: color-mix(in oklab, var(--signal) 22%, var(--surface));
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--tint); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* contour (topographic) texture – the TeamTrail signature */
.contour {
  background-image:
    repeating-radial-gradient(circle at 18% 22%, transparent 0 22px, var(--contour) 22px 23.5px),
    repeating-radial-gradient(ellipse at 82% 78%, transparent 0 28px, var(--contour) 28px 29.5px);
}

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 14px; text-align: center; color: var(--ink-2); }
.boot-mark { width: 56px; height: 56px; margin: auto; border-radius: 18px; background: var(--brand);
  -webkit-mask: url(../img/icon.svg) center/contain no-repeat; mask: url(../img/icon.svg) center/contain no-repeat;
  animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .6; } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: var(--brand-ink); padding: 48px clamp(28px, 5vw, 72px);
  background: var(--brand); display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero::before { content: ""; position: absolute; inset: 0; opacity: .9;
  background-image:
    repeating-radial-gradient(circle at 70% 35%, transparent 0 26px, color-mix(in oklab, var(--brand-ink) 9%, transparent) 26px 27.5px),
    repeating-radial-gradient(ellipse at 15% 90%, transparent 0 34px, color-mix(in oklab, var(--signal) 18%, transparent) 34px 35.5px); }
.auth-hero > * { position: relative; }
.auth-hero .trail-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.trail-svg path { fill: none; stroke: var(--signal); stroke-width: 3; stroke-dasharray: 2 12; stroke-linecap: round;
  animation: march 18s linear infinite; }
@keyframes march { to { stroke-dashoffset: -280; } }
.auth-hero h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem); max-width: 12ch; line-height: 1.02; }
.auth-hero p.lead { margin-top: 18px; max-width: 36ch; font-size: 1.08rem; opacity: .88; }
.auth-points { display: grid; gap: 10px; margin-top: 28px; max-width: 40ch; }
.auth-points div { display: flex; gap: 10px; align-items: flex-start; opacity: .92; }
.auth-points svg { flex: none; margin-top: 3px; color: var(--signal); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(420px, 100%); }
.auth-card h2 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-tabs { display: flex; gap: 6px; padding: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; margin: 22px 0; }
.auth-tabs button { flex: 1; border: 0; background: none; padding: 9px 10px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--signal); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; color: var(--brand); }
.brand small { display: block; font: 500 .72rem var(--font-ui); opacity: .7; letter-spacing: 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--brand); color: var(--brand-ink);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 18px;
}
.sidebar .brand { padding: 4px 8px 10px; }
.nav { display: grid; gap: 2px; }
.nav-group { margin-top: 10px; padding: 0 10px 4px; font-size: .78rem; opacity: .6; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; text-decoration: none;
  color: inherit; opacity: .82; font-weight: 500; transition: background .15s, opacity .15s;
}
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { opacity: 1; background: color-mix(in oklab, var(--brand-ink) 9%, transparent); }
.nav a[aria-current="page"] { opacity: 1; background: color-mix(in oklab, var(--brand-ink) 14%, transparent); box-shadow: inset 3px 0 0 var(--signal); }
.nav .badge { margin-left: auto; background: var(--signal); color: var(--brand); font-weight: 700; font-size: .72rem; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; font-size: .8rem; padding: 0 10px; }
.sidebar-foot p { opacity: .7; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 32px);
  background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.topbar .spacer { flex: 1; }
.topbar .menu-btn { display: none; }
.content { padding: clamp(16px, 3vw, 32px); display: grid; gap: 22px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; color: var(--ink-2); max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform .12s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in oklab, var(--tint) 50%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
[data-mode="dark"] .btn.primary { background: var(--signal); border-color: var(--signal); color: #15120a; }
.btn.signal { background: var(--signal); border-color: var(--signal); color: #1d1404; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 6px 11px; font-size: .86rem; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 10px; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .88rem; }
.field .hint { font-size: .8rem; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--tint); box-shadow: 0 0 0 3px color-mix(in oklab, var(--tint) 22%, transparent); }
textarea.input { min-height: 90px; resize: vertical; }
.form { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--tint); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 190px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.toolbar .field { min-width: 150px; }
.error-text { color: var(--bad); font-size: .88rem; }

/* ---------- panels & tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-body { padding: 18px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .82rem; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in oklab, var(--tint) 5%, transparent); }
.table .actions { text-align: right; white-space: nowrap; }
.person { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none;
  background: var(--brand-soft); color: var(--brand); }
[data-mode="dark"] .avatar { color: var(--ink); }
.person b { display: block; font-weight: 600; }
.person span { font-size: .8rem; color: var(--ink-3); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: color-mix(in oklab, var(--ok) 12%, var(--surface)); border-color: transparent; }
.pill.warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 14%, var(--surface)); border-color: transparent; }
.pill.bad { color: var(--bad); background: color-mix(in oklab, var(--bad) 12%, var(--surface)); border-color: transparent; }
.pill.info { color: var(--info); background: color-mix(in oklab, var(--info) 12%, var(--surface)); border-color: transparent; }

.empty { padding: 48px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--ink-2); }
.empty svg { width: 46px; height: 46px; color: var(--tint); opacity: .8; }
.empty h3 { color: var(--ink); }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--signal-soft); border: 1px solid color-mix(in oklab, var(--signal) 40%, transparent); }
.notice svg { flex: none; width: 20px; height: 20px; color: color-mix(in oklab, var(--signal) 70%, var(--ink)); margin-top: 2px; }

/* ---------- dashboard ---------- */
.today {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: clamp(20px, 3vw, 32px);
  background: var(--brand); color: var(--brand-ink); display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 48px); align-items: center;
}
.today::before { content: ""; position: absolute; inset: 0;
  background-image: repeating-radial-gradient(circle at 92% 10%, transparent 0 24px, color-mix(in oklab, var(--brand-ink) 8%, transparent) 24px 25.5px); }
.today > * { position: relative; }
.ring { width: 168px; height: 168px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: color-mix(in oklab, var(--brand-ink) 16%, transparent); }
.ring .value { stroke: var(--signal); stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.ring .label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .label b { font: 800 2.6rem/1 var(--font-display); }
.ring .label span { font-size: .82rem; opacity: .8; }
.today h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem); }
.today-stats { display: flex; gap: clamp(16px, 3vw, 40px); flex-wrap: wrap; margin-top: 18px; }
.today-stats div b { display: block; font: 700 1.6rem/1.1 var(--font-display); }
.today-stats div span { font-size: .84rem; opacity: .78; }
.spark { margin-top: 18px; height: 54px; width: 100%; max-width: 420px; }
.spark path.area { fill: color-mix(in oklab, var(--signal) 22%, transparent); }
.spark path.line { fill: none; stroke: var(--signal); stroke-width: 2.5; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; text-decoration: none; color: inherit; }
a.tile:hover { border-color: color-mix(in oklab, var(--tint) 45%, var(--line)); }
.tile span { color: var(--ink-2); font-size: .86rem; }
.tile b { font: 700 1.7rem/1.15 var(--font-display); }
.tile.alert b { color: var(--bad); }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }

/* ---------- map ---------- */
.map { height: 460px; border-radius: var(--r-md); overflow: hidden; z-index: 0; border: 1px solid var(--line); }
.map.sm { height: 280px; }
.leaflet-container { font: inherit; background: var(--surface-2); }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--brand); border: 3px solid var(--signal); display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.pin span { transform: rotate(45deg); color: var(--brand-ink); font: 700 .66rem var(--font-ui); }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
dialog.modal.wide { width: min(960px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: color-mix(in oklab, var(--brand) 45%, rgba(0,0,0,.4)); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: rise .22s var(--ease); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 1000; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); animation: rise .2s var(--ease); display: flex; gap: 10px; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* ---------- popover (theme picker, notifications) ---------- */
.pop { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 24px 60px -20px rgba(0,0,0,.35); padding: 14px; z-index: 50; }
.pop-anchor { position: relative; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.swatch { border: 2px solid transparent; border-radius: 12px; padding: 8px; cursor: pointer; background: var(--surface-2); text-align: left; font-size: .8rem; font-weight: 600; }
.swatch i { display: flex; height: 26px; border-radius: 7px; overflow: hidden; margin-bottom: 6px; }
.swatch i b { flex: 2; } .swatch i em { flex: 1; }
.swatch[aria-pressed="true"] { border-color: var(--tint); }
.seg { display: flex; padding: 4px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; background: none; padding: 7px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.notif { display: grid; gap: 2px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.notif:last-child { border-bottom: 0; }
.dot-count { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid var(--bg); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--signal); }

/* ---------- employee portal ---------- */
.portal { min-height: 100vh; max-width: 560px; margin: 0 auto; padding: 0 0 92px; }
.portal-top { background: var(--brand); color: var(--brand-ink); padding: 18px 20px 76px; border-radius: 0 0 32px 32px; position: relative; overflow: hidden; }
.portal-top::before { content: ""; position: absolute; inset: 0;
  background-image: repeating-radial-gradient(circle at 85% 0%, transparent 0 20px, color-mix(in oklab, var(--brand-ink) 9%, transparent) 20px 21.5px); }
.portal-top > * { position: relative; }
.portal-top .row { display: flex; align-items: center; justify-content: space-between; }
.portal-top h1 { margin-top: 22px; font-size: 1.7rem; }
.portal-top p { opacity: .82; margin-top: 4px; }
.portal-body { padding: 0 16px; margin-top: -56px; display: grid; gap: 16px; position: relative; }
.punch { background: var(--surface); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); display: grid; gap: 18px; justify-items: center; text-align: center; }
.radar { width: 220px; height: 220px; position: relative; display: grid; place-items: center; }
.radar svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.radar .zone { fill: color-mix(in oklab, var(--ok) 12%, transparent); stroke: var(--ok); stroke-dasharray: 4 6; }
.radar.out .zone { fill: color-mix(in oklab, var(--bad) 10%, transparent); stroke: var(--bad); }
.radar .grid { fill: none; stroke: var(--line); }
.radar .me { fill: var(--signal); stroke: var(--surface); stroke-width: 3; transition: cx .6s var(--ease), cy .6s var(--ease); }
.radar .site { fill: var(--brand); }
[data-mode="dark"] .radar .site { fill: var(--tint); }
.radar-label { text-align: center; margin-top: -6px; }
.radar-label b { font: 800 1.5rem var(--font-display); }
.punch-btn { width: 100%; padding: 18px; font-size: 1.1rem; border-radius: 16px; }
.portal-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); z-index: 30; }
.portal-nav a { flex: 1; max-width: 140px; display: grid; justify-items: center; gap: 2px; padding: 6px; border-radius: 12px; text-decoration: none; color: var(--ink-3); font-size: .76rem; font-weight: 600; }
.portal-nav a svg { width: 22px; height: 22px; }
.portal-nav a[aria-current="page"] { color: var(--ink); background: var(--brand-soft); }
.history-item { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { min-height: 300px; padding: 28px 24px; }
  .auth-hero .auth-points { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(290px, 85vw); transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: 0 0 60px rgba(0,0,0,.35); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .topbar .menu-btn { display: inline-flex; }
  .today { grid-template-columns: 1fr; justify-items: start; }
  .ring { width: 140px; height: 140px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .map { height: 360px; }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile b { font-size: 1.4rem; }
  .table.cards thead { display: none; }
  .table.cards tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table.cards td { border: 0; padding: 0; }
  .table.cards td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: .8rem; }
  .table.cards td.actions { grid-column: 1 / -1; text-align: left; }
  .pop { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  #toasts { left: 12px; right: 12px; }
  .toast { max-width: none; }
}
@media print {
  .sidebar, .topbar, .page-actions, .toolbar .btn { display: none !important; }
  .shell { display: block; }
  .panel { box-shadow: none; }
}
.content:focus { outline: none; }

/* ---------- Powered by RivoraCloud ---------- */
.powered { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 10px; background: #fff;
  color: #4A5753; font-size: .74rem; font-weight: 600; text-decoration: none; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: transform .15s; }
.powered:hover { transform: translateY(-1px); }
.powered img { height: 22px; width: auto; display: block; }
.powered.on-dark { border-color: transparent; margin-bottom: 10px; }
.powered-row { display: flex; justify-content: center; margin-top: 22px; }
.sidebar-foot .powered { padding: 5px 9px; }
.sidebar-foot .powered img { height: 19px; }
