/* Pinaka design system. Every colour, size and radius comes from these tokens. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2");
}
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-sunk: #f7f8fa;
  --border: #e4e7ec;
  --border-strong: #cfd4dc;
  --text: #101828;
  --text-2: #475467;
  --text-3: #7a8494;

  --accent: #1f4e8c;
  --accent-hover: #183f72;
  --accent-soft: #eaf1fb;
  --accent-text: #1f4e8c;
  --ring: 0 0 0 3px rgba(31, 78, 140, 0.20);

  --nav-bg: #ffffff;
  --nav-bg-2: var(--accent-soft);
  --nav-text: #344054;
  --nav-muted: #8a94a6;

  --danger: #b42318;
  --danger-soft: #fef0ef;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warn: #93590a;
  --warn-soft: #fffaeb;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 8px -2px rgba(16, 24, 40, 0.05);
  --shadow-hover: 0 10px 28px -8px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow-btn: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-menu: 0 12px 32px rgba(16, 24, 40, 0.12), 0 2px 6px rgba(16, 24, 40, 0.06);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 256px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 var(--font); font-feature-settings: "cv11" 1, "ss01" 1, "tnum" 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { margin: 0; color: var(--text); letter-spacing: -0.018em; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 650; }
h2 { font-size: 15px; line-height: 1.4; font-weight: 620; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
strong, .strong { font-weight: 600; color: var(--text); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--s2); }
.icon { flex: 0 0 auto; vertical-align: -3px; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 38px; padding: 0 var(--s4); border: 1px solid transparent; border-radius: var(--radius);
  font: inherit; font-weight: 560; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { text-decoration: none; }
.btn-sm { height: 32px; padding: 0 var(--s3); font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-btn), inset 0 1px 0 rgba(255,255,255,0.08); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-btn); }
.btn-secondary:hover { background: var(--surface-sunk); border-color: #b9c0cb; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(16, 24, 40, 0.05); color: var(--text); }
.btn-ghost-danger { background: transparent; color: var(--danger); }
.btn-ghost-danger:hover { background: var(--danger-soft); }
.btn-link { background: none; border: 0; padding: 0; height: auto; color: var(--accent-text); font-weight: 560; }
.btn-link:hover { text-decoration: underline; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer; }

/* ---------- forms ---------- */
.stack > * + * { margin-top: var(--s4); }
.stack-sm > * + * { margin-top: var(--s2); }
.row-gap { margin: var(--s5) 0 var(--s2); }
.field label, .field .label { display: block; margin-bottom: 6px; font-weight: 560; font-size: 13.5px; color: var(--text); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row label { margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; height: 40px; padding: 0 var(--s3);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-btn);
  font: inherit; transition: border-color .12s, box-shadow .12s;
}
select { padding-right: var(--s8); appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%237a8494' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:hover, select:hover { border-color: #b9c0cb; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.has-error input, .has-error select, input[aria-invalid=true] { border-color: var(--danger); }
.has-error input:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16); }
.field-help { margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.field-error { margin-top: 6px; font-size: 12.5px; color: var(--danger); font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s6); }
.form-narrow { max-width: 560px; }
.readonly { padding: 8px 0 0; color: var(--text); }
.inline-fields { display: flex; gap: var(--s3); align-items: flex-start; flex-wrap: wrap; }
.inline-fields .field { flex: 1 1 240px; }
.inline-fields .field-narrow { flex: 0 0 160px; }
.inline-fields .field-btn { flex: 0 0 auto; padding-top: 27px; }
.inline-form { display: flex; gap: var(--s2); align-items: center; }
.inline-form select { height: 32px; width: 130px; font-size: 13px; }
.js .js-hide { display: none; }

/* ---------- alerts, badges ---------- */
.alert { padding: 11px var(--s4); border-radius: var(--radius); border: 1px solid; margin: var(--s4) 0; font-size: 13.5px; }
.alert-error { background: var(--danger-soft); border-color: #fecdca; color: #912018; }
.alert-success { background: var(--success-soft); border-color: #abefc6; color: #05603a; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 560; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge-neutral { background: #f2f4f7; color: #475467; border-color: #e4e7ec; }
.badge-neutral::before { opacity: 0.5; }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: #c9daf3; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: #abefc6; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: #fedf89; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecdca; }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 42%) 1fr; background: var(--surface); }
.auth-plain { grid-template-columns: 1fr; background: var(--bg); }
.auth-plain .auth-brand { display: inline-block; }
.auth-plain .auth-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s8); box-shadow: var(--shadow-card); }
.auth-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: var(--s10) 56px;
  color: #dbe4f3; overflow: hidden;
  background: radial-gradient(900px 500px at -10% 110%, rgba(56, 116, 203, 0.35), transparent 60%), linear-gradient(160deg, #12274a 0%, #0c1830 100%); }
.auth-side::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px; }
.auth-side > * { position: relative; z-index: 1; }
.auth-side .brand { color: #fff; }
.auth-side-brand { display: flex; align-items: center; gap: var(--s2); }
.brand-tag { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(143, 178, 230, 0.18); color: #b8d0f2; }
.auth-dashboard .auth-side { background: radial-gradient(900px 500px at 110% -10%, rgba(16, 163, 127, 0.28), transparent 60%), linear-gradient(160deg, #0f2a3d 0%, #0b1a2a 100%); }
.auth-side-copy { max-width: 440px; }
.auth-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #8fb2e6; margin-bottom: var(--s4); }
.auth-side h2 { color: #fff; font-size: 30px; line-height: 1.2; font-weight: 650; letter-spacing: -0.025em; }
.auth-points { list-style: none; margin: var(--s8) 0 0; padding: 0; display: grid; gap: var(--s4); }
.auth-points li { display: flex; gap: var(--s3); align-items: flex-start; color: #c6d2e6; }
.auth-points .icon { color: #8fb2e6; margin-top: 1px; }
.auth-side-foot { font-size: 12.5px; color: #7f91b0; }
.auth-main { width: 100%; max-width: 440px; margin: 0 auto; padding: 72px var(--s6) var(--s10); align-self: center; }
.auth-brand { display: none; margin-bottom: var(--s6); color: var(--text); }
.auth-brand:hover { text-decoration: none; }
.auth-panel { background: transparent; border: 0; padding: 0; }
.auth-panel h1 { margin-bottom: var(--s2); font-size: 26px; }
.auth-panel > .muted { margin-bottom: var(--s6); }
.auth-panel form.stack { margin-top: var(--s6); }
.auth-panel .muted + form.stack { margin-top: 0; }
.auth-switch { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--border); color: var(--text-2); text-align: center; }
.auth-foot { margin-top: var(--s6); font-size: 12.5px; color: var(--text-3); text-align: center; }
.auth-wide { max-width: 640px; }
.auth-wide .card { box-shadow: var(--shadow-card); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 680; letter-spacing: -0.02em; color: var(--text); }
.outbox { list-style: none; margin: var(--s5) 0 0; padding: 0; }
.outbox li { padding: var(--s4) 0; border-top: 1px solid var(--border); }
.outbox-head { display: flex; justify-content: space-between; gap: var(--s3); }
.outbox .btn { margin-top: var(--s3); }

/* ---------- signed-in shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--nav-bg); color: var(--nav-text); padding: var(--s4) var(--s3); border-right: 1px solid var(--border);
}
.sidebar .brand { color: var(--text); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: var(--s1) var(--s2) var(--s5); }
.nav-toggle { display: none; background: transparent; border: 0; color: var(--text); cursor: pointer; padding: 6px; border-radius: var(--radius); }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: var(--s3) calc(-1 * var(--s1)) 0; padding: 0 var(--s1);
  scrollbar-width: thin; scrollbar-color: #d0d5dd transparent; }
.nav-label { margin: var(--s5) var(--s3) var(--s2); font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nav-muted); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px var(--s3); border-radius: var(--radius); color: var(--nav-text); font-weight: 520; font-size: 13.5px; }
.nav-item .icon { color: #98a2b3; }
.nav-item:hover { background: var(--surface-sunk); color: var(--text); text-decoration: none; }
.nav-item:hover .icon { color: var(--text-2); }
.nav-item.is-active { background: var(--nav-bg-2); color: var(--accent-text); font-weight: 600; }
.nav-item.is-active .icon { color: var(--accent); }
.nav-empty { padding: 6px var(--s3); color: var(--nav-muted); font-size: 13px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin: var(--s3) calc(-1 * var(--s1)) 0; padding: var(--s3) var(--s2) 0; border-top: 1px solid var(--border); }
.sidebar-user .icon-btn { color: var(--nav-muted); }
.sidebar-user .icon-btn:hover { background: var(--surface-sunk); color: var(--text); }
.avatar { flex: 0 0 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #3d6fb6, #23497f); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 650; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.who-name, .who-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name { font-weight: 560; color: var(--text); font-size: 13.5px; }
.who-mail { font-size: 12px; color: var(--nav-muted); }

/* city switcher */
.switcher { position: relative; }
.switcher summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunk); color: var(--text);
}
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary:hover { border-color: var(--border-strong); background: var(--surface); }
.switcher summary .icon { color: var(--nav-muted); }
.switcher-mark { flex: 0 0 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; }
.switcher-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.switcher-name { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-sub { font-size: 12px; color: var(--nav-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; padding: var(--s1); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-menu); }
.menu-label { padding: 6px var(--s2) 4px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.menu-item { display: flex; flex-direction: column; padding: 7px var(--s2); border-radius: var(--radius-sm); color: var(--text); line-height: 1.35; }
.menu-item .muted { font-size: 12px; color: var(--text-3); }
.menu-item:hover { background: var(--surface-sunk); text-decoration: none; }
.menu-item.is-current { background: var(--accent-soft); }
.menu-action { flex-direction: row; align-items: center; gap: var(--s2); font-weight: 520; }
.menu-action .icon { color: var(--text-3); }
.menu-sep { height: 1px; margin: var(--s1) 0; background: var(--border); }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  height: 52px; padding: 0 var(--s10); background: rgba(243, 245, 248, 0.88); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.crumbs { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.crumbs a { color: var(--text-2); font-weight: 560; }
.crumbs > span:last-child { color: var(--text); font-weight: 560; }
.crumb-sep { color: #c3c9d3; }
.topbar-right { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); white-space: nowrap; }
.main { width: 100%; min-width: 0; padding: var(--s8) var(--s10) 56px; max-width: 1240px; }
.narrow { max-width: 780px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); margin-bottom: var(--s6); }
.lede { margin-top: 6px; color: var(--text-2); max-width: 760px; }
.page-actions { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.section { margin-top: var(--s8); }
.section-head { display: flex; align-items: center; gap: var(--s3); justify-content: space-between; margin-bottom: var(--s3); }
.section-head h2 { font-size: 16px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card-pad { padding: var(--s6); }
.card-title { margin-bottom: var(--s4); font-size: 15px; }
.table-wrap { overflow-x: auto; position: relative; } /* keeps hidden labels inside the scroll box, so wide tables never widen the page */
.callout { display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s5) var(--s6); background: linear-gradient(135deg, #f5f8fd, #ffffff); border: 1px solid #d6e2f3; border-radius: var(--radius-lg); }
.callout p { margin-top: 2px; }
.empty { padding: 48px var(--s6); text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty p + p { margin-top: var(--s1); }
.empty .btn { margin-top: var(--s4); }
.card .empty { border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: var(--s8) var(--s6); color: var(--text-3); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.stat { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: 4px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); min-width: 0; }
.stat-label { font-size: 12.5px; font-weight: 560; color: var(--text-3); }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.2; color: var(--text); }
.stat-text { font-size: 18px; line-height: 1.75; }
.stat-of { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 450; color: var(--text-3); letter-spacing: 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) var(--s5); }
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-main { display: flex; flex-direction: column; min-width: 0; }
.list-title { font-weight: 600; color: var(--text); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 620; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3);
  background: var(--surface-sunk); padding: 10px var(--s4); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th:first-child { border-top-left-radius: var(--radius-lg); }
.table th:last-child { border-top-right-radius: var(--radius-lg); }
.table td { padding: 12px var(--s4); border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfd; }
.table .actions { text-align: right; width: 1%; white-space: nowrap; }

.search-bar { display: flex; gap: var(--s2); margin-top: var(--s6); max-width: 560px; }

/* app picker */
.choice-grid { border: 0; margin: 0 0 var(--s4); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); }
.choice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); transition: border-color .12s, background-color .12s; }
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--accent); background: #f6f9fe; box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.choice input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }
.choice-body { display: flex; flex-direction: column; gap: 2px; }
.choice-title { font-weight: 600; }
.choice-text { font-size: 13px; color: var(--text-2); }

/* setup steps */
.steps { list-style: none; display: flex; gap: var(--s6); margin: 0 0 var(--s6); padding: 0; font-size: 13px; color: var(--text-3); }
.steps li { display: flex; align-items: center; gap: var(--s2); }
.step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650;
  border: 1px solid var(--border-strong); background: var(--surface); }
.steps .is-current { color: var(--text); font-weight: 560; }
.steps .is-current .step-num { border-color: var(--accent); background: var(--accent); color: #fff; }
.steps .is-done .step-num { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

/* city search */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: 68px; margin: 0; padding: var(--s1); list-style: none;
  max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-menu); }
.combo-list li { display: flex; justify-content: space-between; gap: var(--s3); padding: 8px var(--s2); border-radius: var(--radius-sm); cursor: pointer; }
.combo-list li[aria-selected=true] { background: var(--accent-soft); }
.combo-list .combo-state { color: var(--text-3); font-size: 13px; }
.combo-list .combo-none { color: var(--text-3); cursor: default; }


/* ---------- app pages ---------- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: 0; white-space: nowrap; }
.optional { font-weight: 400; color: var(--text-3); font-size: 12px; margin-left: 2px; }
.tabs { display: flex; gap: var(--s5); margin: calc(-1 * var(--s2)) 0 var(--s6); border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { padding: 10px 2px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-3); font-weight: 560; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--accent-text); border-bottom-color: var(--accent); }

.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stats-5 { grid-template-columns: repeat(5, 1fr); }
.stats + .filters, .stats + .section, .stats + .card, .stats + .chips { margin-top: var(--s6); }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); margin: 0 0 var(--s4); }
.filter { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.filter label { font-size: 12px; font-weight: 600; color: var(--text-3); }
.filter input, .filter select { height: 38px; }
.filter input[type=search] { min-width: 220px; }
.filter-actions { flex-direction: row; min-width: 0; }
input[type=date], input[type=time], input[type=month], input[type=number], input[type=tel], textarea {
  width: 100%; height: 40px; box-shadow: var(--shadow-btn); padding: 0 var(--s3); background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius); font: inherit; }
textarea { height: auto; padding: var(--s2) var(--s3); resize: vertical; line-height: 1.5; }
input[type=date]:focus, input[type=time]:focus, input[type=month]:focus, input[type=number]:focus, input[type=tel]:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=number] { font-variant-numeric: tabular-nums; }

.form-card { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s5); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .field-check { align-self: end; padding-bottom: 8px; }
.check { display: flex; align-items: center; gap: var(--s2); font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.net-preview { margin-top: var(--s4); padding: var(--s3) var(--s4); background: var(--surface-sunk); border: 1px solid var(--border); border-radius: var(--radius); }
.geo { margin-top: var(--s4); padding: var(--s3) var(--s4); background: var(--surface-sunk); border: 1px solid var(--border); border-radius: var(--radius); }
.geo.is-ok .geo-status { color: var(--success); }
.geo.is-bad .geo-status { color: var(--danger); }

.photo-field input[type=file] { display: block; width: 100%; padding: 7px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-sunk); font: inherit; font-size: 13px; }
.photo-preview { display: block; margin-top: var(--s2); max-width: 220px; max-height: 160px; border-radius: var(--radius); border: 1px solid var(--border); object-fit: cover; }
.thumb img { display: block; width: 56px; height: 42px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.photo-pair figure { margin: 0; }
.photo-pair img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-sunk); }
.photo-pair figcaption { margin-top: var(--s1); font-size: 12.5px; color: var(--text-2); }

.table tfoot td { font-weight: 600; background: var(--surface-sunk); border-top: 1px solid var(--border); border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-note { margin-top: var(--s2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: start; }

.kv { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s6); }
.kv-row { display: flex; justify-content: space-between; gap: var(--s4); padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 500; text-align: right; }
.detail { padding: var(--s6); }
.detail + .detail, .card + .card { margin-top: var(--s4); }

.slip { max-width: 640px; padding: var(--s8); }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: var(--s5); margin-bottom: var(--s2); border-bottom: 2px solid var(--text); }
.slip-head h2 { font-size: 18px; }
.slip-no { display: flex; flex-direction: column; align-items: flex-end; }
.slip-no strong { font-size: 24px; }
.slip .kv { grid-template-columns: 1fr; }
.slip-weights { display: grid; grid-template-columns: repeat(3, 1fr); margin: var(--s6) 0 var(--s4); border: 1px solid var(--border); border-radius: var(--radius); }
.slip-weights > div { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s4); }
.slip-weights > div + div { border-left: 1px solid var(--border); }
.slip-weights strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.slip-net { background: var(--accent-soft); color: var(--accent-text); }
.slip-foot { margin-top: var(--s6); }

.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); max-width: 760px;
  margin-top: var(--s8); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.section-head .btn { margin-left: auto; }
.table-note { color: var(--text-3); }

@media print {
  .topbar, .sidebar, .page-header .page-actions, .tabs, .danger-zone, .alert { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .main { padding: 0; }
  .slip { border: 0; }
}


.section-gap { margin-bottom: var(--s6); }
.kv-1 { grid-template-columns: 1fr; }
.description { margin-top: var(--s4); white-space: pre-wrap; }
.thumbs { display: inline-flex; gap: var(--s1); }
.list-tight .list-row { padding: var(--s2) 0; }
.list-tight { margin-top: var(--s4); border-top: 1px solid var(--border); }
code, .copy { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-sunk);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 6px; word-break: break-all; user-select: all; }
.review-form { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--border); }
.review-form label { display: block; font-weight: 500; margin-bottom: 6px; }
.review-form input { width: 100%; height: 38px; padding: 0 var(--s3); border: 1px solid var(--border-strong); border-radius: var(--radius); font: inherit; }
.danger-zone .grow { flex: 1; }
.danger-zone input { margin-top: var(--s2); width: 100%; max-width: 360px; height: 34px; padding: 0 var(--s3); border: 1px solid var(--border-strong); border-radius: var(--radius); font: inherit; }
.slip-weights-1 { grid-template-columns: 1fr; }
.slip.is-cancelled { position: relative; }
.slip.is-cancelled::after { content: "CANCELLED"; position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg);
  font-size: 44px; font-weight: 700; letter-spacing: 0.1em; color: rgba(179, 38, 30, 0.18); pointer-events: none; }

.map { height: 420px; overflow: hidden; z-index: 0; }

.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); }
.report-card { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4) var(--s5); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); color: var(--text); transition: border-color .12s, box-shadow .12s, transform .12s; }
.report-card:hover { border-color: #c9d6ea; text-decoration: none; box-shadow: 0 6px 18px rgba(16, 24, 40, 0.07); }
.report-name { display: flex; align-items: center; gap: var(--s2); font-weight: 620; padding-bottom: var(--s3); border-bottom: 1px solid var(--border); }
.report-name .ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.report-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-size: 13.5px; }
.report-row strong { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.muster { font-size: 12.5px; }
.muster th.day, .muster td.day { padding: 8px 4px; text-align: center; min-width: 28px; }
.muster .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; text-align: left; font-weight: 400; border-right: 1px solid var(--border); }
.muster thead .sticky { background: var(--surface-sunk); }
.muster td.code-A { color: var(--danger); font-weight: 600; }
.muster td.code-HD { color: var(--warn); font-weight: 600; }
.muster td.code-P { color: var(--success); }
.muster td.code-L, .muster td.code-UL { color: var(--accent-text); font-weight: 600; }
.muster td.code-WO, .muster td.code-H { color: var(--text-3); background: var(--surface-sunk); }


.segmented { display: inline-flex; margin-bottom: var(--s4); border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.segmented a { padding: 6px var(--s4); color: var(--text-2); font-weight: 500; background: var(--surface); }
.segmented a + a { border-left: 1px solid var(--border-strong); }
.segmented a.is-active { background: var(--accent-soft); color: var(--accent-text); }
.segmented a:hover { text-decoration: none; }
.input-sm { height: 30px; width: 140px; padding: 0 var(--s2); border: 1px solid var(--border-strong); border-radius: var(--radius); font: inherit; font-size: 13px; }
.inline { display: inline; }
a.plain { color: inherit; }
.check-grid { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s2); }
.check-grid legend { margin-bottom: 6px; font-weight: 500; }
.share-link { margin-top: var(--s2); }
.playback { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s3); padding: var(--s2) var(--s3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.playback input[type=range] { flex: 1; accent-color: var(--accent); }
.playback [data-at] { min-width: 150px; text-align: right; color: var(--text-2); }
.share-main { max-width: 1040px; margin: 0 auto; padding: var(--s8) var(--s4); }
@media print { .playback, .filters, .table-note { display: none !important; } .map { height: 360px; page-break-inside: avoid; } }

.spark { display: block; fill: var(--accent); opacity: 0.85; }
.spark-base { stroke: var(--border); }
.util { display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; }
.util-track { fill: #e8ebef; }
.util-good { fill: var(--success); }
.util-mid { fill: #c58a00; }
.util-low { fill: var(--danger); }
.chips { display: inline-flex; flex-wrap: wrap; gap: var(--s1); margin-bottom: var(--s4); }
.chip { padding: 5px var(--s3); border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); font-weight: 500; font-size: 13px; }
.chip:hover { text-decoration: none; border-color: var(--text-3); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.group-head { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.group-head .grow { flex: 1; }
.card + .card.group { margin-top: var(--s4); }
.spark-cell { display: inline-block; vertical-align: middle; }

.mark-choices { border: 0; margin: 0; padding: 0; display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.mark { position: relative; cursor: pointer; }
.mark input { position: absolute; opacity: 0; }
.mark span { display: block; padding: 6px var(--s3); font-size: 13px; font-weight: 500; color: var(--text-2); background: var(--surface); }
.mark + .mark span { border-left: 1px solid var(--border-strong); }
.mark input:focus-visible + span { box-shadow: inset var(--ring); }
.mark-P input:checked + span { background: var(--success-soft); color: var(--success); }
.mark-HD input:checked + span { background: var(--warn-soft); color: var(--warn); }
.mark-A input:checked + span { background: var(--danger-soft); color: var(--danger); }

.trend-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.trend { padding: var(--s4) var(--s5) var(--s3); }
.trend-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s2); }
.trend-title { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 620; }
.trend-title .ic { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.trend-figure { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.25; }
.trend-figure strong { font-size: 20px; letter-spacing: -0.02em; }
.trend-foot { margin-top: var(--s2); }
.chart-box { position: relative; margin: 0; padding-top: 18px; }
.chart-max { position: absolute; top: 0; right: 0; font-size: 11.5px; color: var(--text-3); }
.chart { display: block; width: 100%; height: 110px; }
.chart .hit { fill: transparent; }
.chart .bar { fill: #a9c1e4; transition: fill .1s; }
.chart .bar-now { fill: var(--accent); }
.chart g:hover .bar { fill: #4f7fc4; }
.chart .gridline { stroke: #eef0f3; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart .baseline { stroke: #d0d5dd; vector-effect: non-scaling-stroke; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed-row { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s5); }
.feed-row + .feed-row { border-top: 1px solid #eef0f3; }
.feed-icon { flex: 0 0 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.feed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.feed-details { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.app-tag { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--text-2); }
.app-tag .icon { color: var(--text-3); }
.app-tags { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.table .details { max-width: 520px; }
.topbar-right .badge { margin-right: var(--s2); }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .stats-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-brand { display: inline-block; }
  .auth-main { padding-top: 48px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 40; height: auto; padding: var(--s2) var(--s3); }
  .sidebar-top { padding: 4px var(--s1); }
  .nav-toggle { display: inline-grid; place-items: center; }
  .sidebar .switcher, .sidebar .nav, .sidebar .sidebar-user { display: none; }
  .nav-open .sidebar { height: 100vh; overflow-y: auto; }
  .nav-open .sidebar .switcher { display: block; margin-top: var(--s2); }
  .nav-open .sidebar .nav { display: flex; }
  .nav-open .sidebar .sidebar-user { display: flex; }
  .topbar { position: static; padding: 0 var(--s4); height: 44px; }
  .topbar-right { display: none; }
  .main { padding: var(--s5) var(--s4) var(--s10); }
  .stats, .stats-3, .stats-5 { grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
  .stat-value { font-size: 22px; }
  .form-grid, .grid-2, .kv, .photo-pair, .trend-grid { grid-template-columns: minmax(0, 1fr); }
  .stats, .stats-3, .stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 > *, .home-main { min-width: 0; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter, .filter input[type=search] { min-width: 0; flex: 1 1 140px; }
  .page-header, .callout { flex-direction: column; align-items: stretch; }
  h1 { font-size: 21px; }
}

/* ---------- dashboard site ---------- */
.dash { background: #f1f4f8; min-height: 100vh; }
.dash-bar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); }
.dash-bar-inner { max-width: 1320px; margin: 0 auto; padding: 0 var(--s8); display: flex; align-items: center; gap: var(--s3); }
.dash-bar > .dash-bar-inner { height: 60px; }
.dash-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 680; letter-spacing: -0.02em; color: var(--text); margin-right: var(--s4); }
.dash-brand:hover { text-decoration: none; }
.dash-brand .brand-tag { background: #e6f6f1; color: #0b7a5c; }
.dash-picker { position: relative; }
.dash-picker summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s2); height: 36px; padding: 0 var(--s3);
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-weight: 600; box-shadow: var(--shadow-btn); }
.dash-picker summary::-webkit-details-marker { display: none; }
.dash-picker summary .icon { color: var(--text-3); }
.dash-picker .menu { left: 0; right: auto; min-width: 260px; }
.dash-user { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 560; font-size: 13.5px; }
.dash-tabs { border-top: 1px solid #eef0f3; }
.dash-tabs .dash-bar-inner { gap: var(--s1); overflow-x: auto; scrollbar-width: none; }
.dash-tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px var(--s3); color: var(--text-3); font-weight: 560; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dash-tab:hover { color: var(--text); text-decoration: none; }
.dash-tab.is-active { color: #0b7a5c; border-bottom-color: #10a37f; }
.dash-tab .icon { color: currentColor; opacity: 0.8; }
.dash-main { max-width: 1320px; margin: 0 auto; padding: var(--s8) var(--s8) 64px; }
.dash .page-header { margin-bottom: var(--s5); }
.dash .stat { border-top: 3px solid #10a37f; }
.dash .chart .bar-now, .dash .chart g:hover .bar { fill: #0b7a5c; }
.dash .chart .bar { fill: #9fd9c6; }
.dash .report-name .ic, .dash .trend-title .ic { background: #e6f6f1; color: #0b7a5c; }
.dash .chip.is-active { background: #0b7a5c; border-color: #0b7a5c; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.readonly-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 860px) {
  .dash-bar-inner { padding: 0 var(--s4); }
  .dash-user-name, .dash-app-link { display: none; }
  .dash-main { padding: var(--s5) var(--s4) var(--s10); }
  .dash-grid-3 { grid-template-columns: 1fr; }
}


/* =====================================================================
   Visual polish layer: applies on top of the base styles above.
   ===================================================================== */

/* page titles with the app's icon */
.page-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.title-ic { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #eef4fd, #dfeafa); color: var(--accent); box-shadow: inset 0 0 0 1px #d4e2f6; }
h1 { font-size: 25px; letter-spacing: -0.022em; }
.lede { font-size: 14px; }
.page-header { align-items: center; margin-bottom: var(--s6); }

/* figure tiles */
.stats { gap: 14px; }
.stat { position: relative; padding: 16px 18px; gap: 6px; border-color: #e7eaf0; transition: box-shadow .15s, transform .15s; }
.stat:hover { box-shadow: var(--shadow-hover); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.stat-label { font-size: 12.5px; color: var(--text-2); font-weight: 560; }
.stat-ic { flex: 0 0 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #f1f5fb; color: #5a7fb5; }
.stat-value { font-size: 27px; font-weight: 680; }

/* filters become a tidy toolbar */
.filters { align-items: flex-end; gap: 10px 12px; padding: 12px 14px; background: var(--surface); border: 1px solid #e7eaf0;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); margin-bottom: var(--s5); }
.filter { min-width: 140px; gap: 5px; }
.filter label { font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.filter input, .filter select { height: 36px; box-shadow: none; background-color: var(--surface-sunk); }
.filter input:focus, .filter select:focus { background-color: var(--surface); }
.filter-actions { margin-left: auto; gap: var(--s2); }
.stats + .filters { margin-top: var(--s5); }

/* cards and sections */
.card { border-color: #e7eaf0; }
.section { margin-top: 28px; }
.section-head h2 { font-size: 16px; letter-spacing: -0.01em; }
.card-title { font-size: 15.5px; }
.detail { padding: 22px 24px; }
.grid-2 { gap: 18px; }

/* tables */
.table th { background: #f8fafc; color: #6b7686; padding: 11px 16px; }
.table td { padding: 13px 16px; }
.table tbody tr { transition: background-color .1s; }
.table tbody tr:hover td { background: #f8fbff; }
.table td .strong, .table td.strong { color: var(--text); }
.table tfoot td { background: #f8fafc; }

/* buttons */
.btn { border-radius: 9px; transition: background-color .12s, border-color .12s, box-shadow .12s, transform .06s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #2a5ea4, #1f4e8c); border-color: #1c4680; }
.btn-primary:hover { background: linear-gradient(180deg, #24548f, #183f72); }
.btn .icon { margin-left: -2px; }

/* forms */
.form-card { padding: 26px 28px; }
.form-grid { gap: 18px 20px; }
input[type=text], input[type=email], input[type=password], input[type=search], select,
input[type=date], input[type=time], input[type=month], input[type=number], input[type=tel], textarea { border-radius: 9px; border-color: #d5dae2; }
.field-check { display: flex; align-items: center; }
.check { padding: 9px 12px; border: 1px solid #d5dae2; border-radius: 9px; background: var(--surface-sunk); width: 100%; }
.check:has(input:checked) { border-color: #9dbbe6; background: var(--accent-soft); }

/* photo picker */
.field label.drop, .drop { display: flex; align-items: center; gap: 12px; margin: 0; font-weight: 400; padding: 12px 14px; border: 1.5px dashed #c5cfdd; border-radius: 12px;
  background: #fafcff; cursor: pointer; transition: border-color .12s, background-color .12s; }
.drop:hover { border-color: var(--accent); background: #f3f8ff; }
.drop:focus-within { box-shadow: var(--ring); border-color: var(--accent); }
.drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-ic { flex: 0 0 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.drop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.drop-text strong { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-preview[hidden] { display: none !important; }
.drop .photo-preview { margin: 0; width: 56px; height: 44px; max-width: none; border-radius: 8px; object-fit: cover; }
.has-photo .drop { border-style: solid; border-color: #9dd5bd; background: #f3fbf7; }
.has-photo .drop-ic { background: var(--success-soft); color: var(--success); }

/* empty states */
.empty { padding: 44px 24px; border-style: dashed; border-color: #d3dae4; background: linear-gradient(180deg, #fbfcfe, #f7f9fc); }
.empty::before { content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 12px; background: #eef3fa
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235a7fb5' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") no-repeat center; }
.card .empty { background: transparent; }
.card .empty::before { width: 36px; height: 36px; margin-bottom: 10px; }

/* today cards */
.report-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.report-card { gap: 12px; padding: 16px 18px 18px; }
.report-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.report-name { border-bottom: 0; padding-bottom: 0; font-size: 14px; }
.report-name .ic { width: 32px; height: 32px; border-radius: 9px; }
.report-go { margin-left: auto; color: #b0b9c6; font-weight: 500; transition: transform .15s, color .15s; }
.report-card:hover .report-go { color: var(--accent); transform: translateX(2px); }
.report-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; padding-top: 12px; border-top: 1px solid #eef0f4; }
.metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.metric-value { font-size: 21px; font-weight: 680; letter-spacing: -0.02em; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-sub { font-size: 12.5px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.metric-label { font-size: 12.5px; color: var(--text-2); }

/* activity feed */
.feed-row { padding: 14px 20px; transition: background-color .1s; }
.feed-row:hover { background: #f8fbff; }

/* sidebar */
.nav-item { padding: 8px 12px; border-radius: 9px; }
.nav-item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.sidebar { box-shadow: 1px 0 0 #eef0f4; }

/* tabs inside an app */
.tabs { gap: 22px; }
.tab { padding: 11px 2px; }

/* dashboard site */
.dash .page-header { padding: 22px 24px; border-radius: 16px; color: #fff; margin-bottom: 18px;
  background: radial-gradient(600px 220px at 100% 0%, rgba(52, 211, 153, 0.28), transparent 60%), linear-gradient(135deg, #0f3b39 0%, #0b2a3d 100%);
  box-shadow: 0 12px 30px -14px rgba(11, 42, 61, 0.55); }
.dash .page-header h1 { color: #fff; }
.dash .page-header .lede { color: #b9d6cf; }
.dash .page-header .title-ic { background: rgba(255, 255, 255, 0.12); color: #a7f3d0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
.dash .page-header .btn-secondary { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.25); box-shadow: none; }
.dash .readonly-note { color: #b9d6cf; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px; }
.dash .stat { border-top: 0; }
.dash .stat-ic { background: #e9f7f2; color: #0b7a5c; }
.dash .filters { margin-bottom: 18px; }
.dash-tab.is-active { background: linear-gradient(180deg, transparent 60%, rgba(16, 163, 127, 0.06)); }
.dash-bar { backdrop-filter: saturate(180%) blur(8px); background: rgba(255, 255, 255, 0.92); }

/* charts */
.trend { transition: box-shadow .15s; }
.trend:hover { box-shadow: var(--shadow-hover); }

@media (max-width: 860px) {
  .title-ic { flex-basis: 38px; height: 38px; border-radius: 10px; }
  .filters { padding: 10px; }
  .filter-actions { margin-left: 0; }
  .dash .page-header { padding: 18px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-actions { justify-content: flex-start; }
}

/* dashboard: download menu */
.dash-tabs .dash-bar-inner { justify-content: space-between; overflow: visible; }
.dash-tab-list { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; min-width: 0; }
.dash-downloads { flex: 0 0 auto; padding: 6px 0; }
.dl { position: relative; }
.dl > summary { list-style: none; }
.dl > summary::-webkit-details-marker { display: none; }
.dash .dl-btn { background: linear-gradient(180deg, #13a07d, #0b7a5c); border-color: #0a7054; }
.dash .dl-btn:hover { background: linear-gradient(180deg, #11916f, #096a50); }
.dl-menu { left: auto; right: 0; width: 380px; padding: 8px; }
.dl-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label label" "input btn"; gap: 8px; padding: 10px; border-radius: 10px; }
.dl-row:hover { background: var(--surface-sunk); }
.dl-label { grid-area: label; display: flex; flex-direction: column; line-height: 1.35; }
.dl-row input { grid-area: input; height: 34px; }
.dl-row .btn { grid-area: btn; }
.dl-print { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; padding: 10px; }
@media print { .dash-bar { position: static; box-shadow: none; } .dash-downloads, .dash-picker, .dash-app-link, .dash-bar form { display: none !important; } }
@media (max-width: 860px) {
  .dash-tabs .dash-bar-inner { flex-direction: column; align-items: stretch; }
  .dash-downloads { padding: 0 0 8px; }
  .dl-menu { width: min(380px, calc(100vw - 32px)); left: 0; right: auto; }
}

/* =====================================================================
   Soft theme: a floating frame on a warm gradient, pill buttons and tabs,
   a light grey sidebar and white rounded cards. Overrides the layers above.
   ===================================================================== */
:root {
  --surface-sunk: #f6f6f7;
  --border: #ececef;
  --border-strong: #dedee3;
  --text: #121214;
  --text-2: #5d5d68;
  --text-3: #90909b;
  --accent: #121214;
  --accent-hover: #2a2a2e;
  --accent-soft: #f1f1f3;
  --accent-text: #121214;
  --ring: 0 0 0 3px rgba(18, 18, 20, 0.12);
  --warm: #f0895a;
  --warm-soft: #fdeee5;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(18, 18, 20, 0.03), 0 10px 30px -18px rgba(18, 18, 20, 0.14);
  --shadow-hover: 0 1px 2px rgba(18, 18, 20, 0.04), 0 18px 40px -18px rgba(18, 18, 20, 0.22);
  --backdrop: linear-gradient(180deg, #c9ced3 0%, #dad4cf 45%, #eebfa6 78%, #f59b76 100%);
}
html { background: var(--backdrop) fixed; min-height: 100%; }
body.dash, body.auth, body.auth.auth-plain { background: transparent; }

/* the floating frame */
body.app { margin: 18px; min-height: calc(100vh - 36px); border-radius: 28px; overflow: clip; background: rgba(250, 250, 251, 0.95);
  box-shadow: 0 30px 80px -30px rgba(60, 40, 30, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.6) inset; }
.sidebar { top: 18px; height: calc(100vh - 36px); background: #f1f1f3; border-right: 1px solid #e8e8eb; box-shadow: none; padding: 22px 14px 14px; }
.sidebar-top { padding: 2px 10px 18px; }
.nav-label { color: #a0a0aa; letter-spacing: 0.06em; margin: 18px 12px 6px; }
.nav-item { color: #4a4a52; font-weight: 520; padding: 8px 12px; border-radius: 12px; }
.nav-item .icon { color: #77777f; }
.nav-item:hover { background: rgba(255, 255, 255, 0.65); color: var(--text); }
.nav-item.is-active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(18, 18, 20, 0.06), 0 4px 14px -8px rgba(18, 18, 20, 0.18); }
.nav-item.is-active .icon { color: var(--text); }
.switcher summary { background: #fff; border-color: #e6e6ea; border-radius: 14px; }
.switcher-mark { background: linear-gradient(135deg, #2b2b30, #121214); border-radius: 9px; }
.sidebar-user { margin: 12px 0 0; padding: 12px; border: 0; border-radius: 16px; background: linear-gradient(160deg, #d9dbe0, #c9ccd2); }
.sidebar-user .who-mail { color: #6c6c76; }
.avatar { background: linear-gradient(135deg, #f4b08a, #e9806a); }
.topbar { background: transparent; backdrop-filter: none; border-bottom: 0; padding-top: 6px; }
.main { padding-top: 18px; }

/* buttons: pills */
.btn { border-radius: 999px; padding: 0 18px; font-weight: 560; }
.btn-sm { padding: 0 14px; }
.btn-primary { background: #121214; border-color: #121214; color: #fff; box-shadow: 0 6px 16px -8px rgba(18, 18, 20, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn-primary:hover { background: #2a2a2e; }
.btn-secondary { background: #fff; border-color: #e4e4e8; box-shadow: 0 1px 2px rgba(18, 18, 20, 0.04); }
.btn-secondary:hover { background: #f8f8f9; border-color: #d8d8de; }
.btn-ghost:hover { background: rgba(18, 18, 20, 0.05); }
.icon-btn { border-radius: 999px; }

/* inputs */
input[type=text], input[type=email], input[type=password], input[type=search], select,
input[type=date], input[type=time], input[type=month], input[type=number], input[type=tel], textarea {
  border-radius: 12px; border-color: #e2e2e7; box-shadow: none; background-color: #fff; }
input:focus, select:focus, textarea:focus { border-color: #9a9aa3 !important; box-shadow: var(--ring) !important; }

/* cards, tiles, tables */
.card, .stat, .report-card, .filters, .choice, .callout, .danger-zone { border-radius: var(--radius-lg); border-color: #ededf0; box-shadow: var(--shadow-card); }
.stat-ic, .report-name .ic, .trend-title .ic, .feed-icon { background: #f3f3f5; color: #3b3b42; }
.title-ic { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(18, 18, 20, 0.05), inset 0 0 0 1px #ececef; border-radius: 14px; }
.table th { background: transparent; color: #9a9aa4; border-bottom-color: #f0f0f2; letter-spacing: 0.04em; }
.table td { border-bottom-color: #f3f3f5; }
.table tbody tr:hover td { background: #fafafb; }
.table tfoot td { background: #fafafb; }
.filters { padding: 12px 16px; }
.filter input, .filter select { background-color: #f7f7f8; border-color: #ececf0; }
.empty { background: rgba(255, 255, 255, 0.6); border-color: #e2e2e7; border-radius: var(--radius-lg); }
.empty::before { background-color: #f3f3f5; }
.callout { background: linear-gradient(120deg, #fff 0%, #fff6f0 100%); border-color: #f6e2d6; }
a { color: var(--text); }
a:hover { color: #000; }
.lede a, .field-help a, .table-note a, .empty a, .alert a { text-decoration: underline; text-underline-offset: 2px; }

/* tabs and chips become pill switches */
.tabs { display: inline-flex; gap: 2px; padding: 4px; background: #ececef; border: 0; border-radius: 999px; max-width: 100%; }
.tab { padding: 7px 16px; margin: 0; border: 0; border-radius: 999px; color: #6b6b75; }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.5); }
.tab.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(18, 18, 20, 0.08); }
.chip { border-color: #e4e4e8; }
.chip.is-active, .dash .chip.is-active { background: #121214; border-color: #121214; color: #fff; }
.segmented { border-radius: 999px; }

/* badges */
.badge { border-radius: 999px; }
.badge-accent { background: #f1f1f3; color: #2a2a30; border-color: #e3e3e8; }

/* charts: warm bars */
.chart .bar, .dash .chart .bar { fill: #f6cdb7; }
.chart .bar-now, .dash .chart .bar-now, .chart g:hover .bar, .dash .chart g:hover .bar { fill: var(--warm); }
.spark { fill: #e9926a; }
.util-good { fill: #2f9e6f; }

/* ---------- overview: welcome hero, quick actions, side panel ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.home-main { min-width: 0; }
.hero { position: relative; text-align: center; padding: 22px 12px 8px; }
.hero-star { display: block; margin: 0 auto 4px; filter: drop-shadow(0 8px 22px rgba(240, 137, 90, 0.35)); }
.hero h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.hero .lede { margin: 8px auto 0; color: #8a8a94; }
.hero-actions { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 26px; }
.quick-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: #fff; border: 1px solid #ededf0; border-radius: 18px;
  box-shadow: var(--shadow-card); color: var(--text); transition: transform .15s, box-shadow .15s; }
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; color: var(--text); }
.quick-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 8px;
  background: linear-gradient(140deg, #ffe3d2, #f7c0d6); color: #a5452a; }
.quick-card:nth-child(3n+2) .quick-ic { background: linear-gradient(140deg, #fde9c6, #f9c99b); color: #9a5a12; }
.quick-card:nth-child(3n+3) .quick-ic { background: linear-gradient(140deg, #e6ddfb, #f2cfe4); color: #6a42a8; }
.quick-title { font-weight: 640; }
.quick-text { font-size: 12.5px; color: #8a8a94; line-height: 1.45; }
.side { position: sticky; top: 76px; display: flex; flex-direction: column; background: #fff; border: 1px solid #ededf0; border-radius: 22px;
  box-shadow: var(--shadow-card); padding: 18px; max-height: calc(100vh - 120px); }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.side-head h2 { font-size: 17px; }
.side .feed { overflow-y: auto; margin: 0 -18px; padding: 0 4px; flex: 1; scrollbar-width: thin; }
.side .feed-row { padding: 12px 14px; border-radius: 14px; }
.side .feed-row + .feed-row { border-top: 0; }
.side .feed-row:hover { background: #f7f7f8; }
.side .feed-meta { display: none; }
.side .feed-when { font-size: 11.5px; color: #a0a0aa; }
.side-foot { padding-top: 12px; }
.side-foot .btn { width: 100%; }
.side .empty { padding: 26px 10px; }

/* ---------- dashboard site ---------- */
.dash-bar { margin: 18px 18px 0; border-radius: 22px; border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(250, 250, 251, 0.9); top: 18px; }
.dash-brand .brand-tag { background: #121214; color: #fff; }
.dash-tabs { border-top: 1px solid #efeff2; }
.dash-tab { border: 0; margin: 6px 0; padding: 7px 14px; border-radius: 999px; }
.dash-tab.is-active { background: #121214; color: #fff; }
.dash-tab.is-active .icon { opacity: 1; }
.dash-main { margin-top: 18px; background: rgba(250, 250, 251, 0.94); border-radius: 28px; padding: 28px; margin-bottom: 18px;
  box-shadow: 0 30px 80px -30px rgba(60, 40, 30, 0.35); }
.dash-picker summary { border-radius: 999px; }
.dash .page-header { color: var(--text); background: radial-gradient(420px 180px at 100% 0%, rgba(245, 155, 118, 0.28), transparent 70%), radial-gradient(360px 160px at 85% 100%, rgba(214, 180, 240, 0.25), transparent 70%), #fff;
  border: 1px solid #ededf0; box-shadow: var(--shadow-card); }
.dash .page-header h1 { color: var(--text); }
.dash .page-header .lede { color: var(--text-2); }
.dash .page-header .title-ic { background: linear-gradient(140deg, #ffe3d2, #f7c0d6); color: #a5452a; box-shadow: none; }
.dash .page-header .btn-secondary { background: #fff; color: var(--text); border-color: #e4e4e8; }
.dash .readonly-note { color: var(--text-3); border-color: #e4e4e8; }
.dash .stat-ic, .dash .report-name .ic, .dash .trend-title .ic { background: #f3f3f5; color: #3b3b42; }
.dash .dl-btn, .dl-btn { background: #121214; border-color: #121214; }
.dash .dl-btn:hover { background: #2a2a2e; }

/* ---------- sign-in pages ---------- */
.auth { grid-template-columns: minmax(380px, 44%) 1fr; }
.auth-side, .auth-dashboard .auth-side { background: transparent; color: var(--text); }
.auth-side::after { display: none; }
.auth-side .brand { color: var(--text); }
.auth-kicker { color: #9a6a52; }
.auth-side h2 { color: var(--text); }
.auth-points li { color: #4a4a52; }
.auth-points .icon { color: #a5452a; }
.auth-side-foot { color: #6c6c76; }
.brand-tag { background: #121214; color: #fff; }
.auth-main { margin: 24px; background: rgba(255, 255, 255, 0.92); border-radius: 28px; box-shadow: 0 30px 80px -30px rgba(60, 40, 30, 0.35); max-width: 520px; padding: 56px 48px; }
.auth-main.auth-wide { max-width: 680px; }
.auth-plain .auth-main { margin: 48px auto; }
.auth-plain .auth-panel { box-shadow: none; border: 0; padding: 0; }

@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; }
}
@media (max-width: 960px) {
  .auth-main { margin: 16px auto; padding: 36px 24px; width: calc(100% - 32px); }
}
@media (max-width: 860px) {
  body.app { margin: 0; border-radius: 0; min-height: 100vh; }
  .sidebar { top: 0; height: auto; }
  .dash-bar { margin: 8px 8px 0; top: 8px; }
  .dash-main { margin: 10px 8px; padding: 18px 14px; border-radius: 20px; }
  .hero h1 { font-size: 26px; }
  .tabs { display: flex; overflow-x: auto; }
}
.home-solo { grid-template-columns: minmax(0, 1fr); }
/* closed dropdowns take no space (some browsers still measure their hidden content) */
details:not([open]) > .menu { display: none; }
@media (max-width: 860px) {
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick-card { padding: 14px; }
  .dash-picker .menu { position: fixed; left: 12px; right: 12px; top: 74px; min-width: 0; }
}
@media (max-width: 860px) {
  .dash-bar > .dash-bar-inner { gap: 8px; }
  .dash-brand { margin-right: 0; gap: 6px; }
  .dash-brand > span:not(.brand-tag), .dash-user { display: none; }
  .dash-picker summary { max-width: 150px; padding: 0 10px; }
  .dash-picker summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* unread entries: menu count and bell */
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #121214; color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.bell { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 6px; border-radius: 999px;
  background: #fff; border: 1px solid #e6e6ea; color: var(--text-2); }
.bell:hover { color: var(--text); text-decoration: none; }
.bell-dot { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--warm);
  color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #fafafb; }
.feed-row.is-new { background: #fff7f1; }
.badge-new { background: var(--warm); color: #fff; border-color: var(--warm); }
.badge-new::before { display: none; }

/* needs your attention */
.attention { list-style: none; margin: 0; padding: 6px; display: grid; gap: 4px; background: #fff; border: 1px solid #ededf0; border-radius: 20px; box-shadow: var(--shadow-card); }
.attention-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--text); }
.attention-row:hover { background: #fff7f1; text-decoration: none; color: var(--text); }
.attention-ic { flex: 0 0 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg, #ffe3d2, #f7c0d6); color: #a5452a; }
.attention-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.attention-text strong { font-weight: 600; }
.attention-text span { font-size: 12.5px; color: var(--text-3); }
.attention-go { color: #b8b8c0; transition: transform .15s, color .15s; }
.attention-row:hover .attention-go { color: var(--warm); transform: translateX(2px); }
.attention-ok { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #f2fbf6; border: 1px solid #cdeedd; border-radius: 18px; color: #1d6a48; }
.history .grid-2 { margin-top: 4px; }
.history-block { padding: 16px 18px; }
.history-block .section-head { margin-bottom: 8px; }
.history-block h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.history-ic { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; background: #f3f3f5; }
.history-block .card { box-shadow: none; border: 0; }
.history-block .table td, .history-block .table th { padding: 9px 10px; }
.history .empty { margin-top: 4px; }
.narrow + .history, .history { max-width: 1100px; }
