/* Tokens: light is the default, dark is selected (not an automatic invert). */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-wash: rgba(42, 120, 214, 0.10);
  --decline: #e34948;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --deemph: #c3c2b7;
  --good: #006300;
  --bad: #d03b3b;
  --focus: #2a78d6;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #262624;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --accent-wash: rgba(57, 135, 229, 0.12);
    --decline: #e66767;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
    --deemph: #4a4a46;
    --good: #0ca30c;
    --bad: #e66767;
    --focus: #3987e5;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #262624;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5;
  --accent-wash: rgba(57, 135, 229, 0.12);
  --decline: #e66767;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --deemph: #4a4a46;
  --good: #0ca30c;
  --bad: #e66767;
  --focus: #3987e5;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text-primary);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */
:root { --sidebar-w: 248px; --sidebar-rail: 68px; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns .2s ease; }
.content { min-width: 0; display: flex; flex-direction: column; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100dvh; z-index: 30;
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 12px; overflow: hidden auto;
  background: var(--surface); border-right: 1px solid var(--border);
}
.sidebar-head { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 4px 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; margin-right: auto; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-group + .nav-group { margin-top: 6px; }
.nav-section { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 10px 6px; border: 0;
  background: none; cursor: pointer; color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; border-radius: 6px; }
.nav-section:hover { color: var(--text-secondary); }
.nav-chev { width: 14px; height: 14px; transition: transform .15s ease; }
.nav-group.closed .nav-chev { transform: rotate(-90deg); }
.nav-items { display: grid; gap: 1px; }
.nav-group.closed .nav-items { display: none; }
/* Detail pages: indented under their list page, shown only in that area. */
.nav-item.nav-child { display: none; min-height: 32px; padding-left: 42px; font-size: 13px; }
.nav-item.nav-child.show { display: flex; }
.nav-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--border); margin-right: -4px; }
.nav-child[aria-current="page"] .nav-dot { background: var(--accent); }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; font-size: 14px;
  background: transparent; color: var(--text-secondary); text-decoration: none; text-align: left;
  font-weight: 500; cursor: pointer; white-space: nowrap;
}
.nav-item svg { flex: none; width: 20px; height: 20px; }
.nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-item[aria-current="page"] { background: var(--accent-wash); color: var(--text-primary); }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.sidebar-foot { border-top: 1px solid var(--grid); padding-top: 10px; display: grid; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 6px 8px; min-width: 0; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.me-text { display: grid; min-width: 0; font-size: 13px; line-height: 1.3; }
.me-text strong, .me-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span { color: var(--text-muted); font-size: 12px; }

/* Collapsed rail (desktop): icons only; the title attribute names each item. */
@media (min-width: 1024px) {
  .shell.collapsed { grid-template-columns: var(--sidebar-rail) minmax(0, 1fr); }
  .shell.collapsed .nav-text { display: none; }
  .shell.collapsed .sidebar-head { flex-direction: column; padding-bottom: 4px; }
  .shell.collapsed .brand { margin: 0; }
  .shell.collapsed .nav-item { justify-content: center; padding: 0; }
  .shell.collapsed .nav-section { padding: 0; height: 0; overflow: hidden; border-top: 1px solid var(--grid); border-radius: 0; margin: 8px 6px; pointer-events: none; }
  .shell.collapsed .nav-group.closed .nav-items { display: grid; }
  .shell.collapsed .nav-child { display: none; }
  .shell.collapsed .me { justify-content: center; padding: 6px 0 8px; }
  .shell.collapsed .collapse-btn svg { transform: scaleX(-1); }
}

.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .4); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.title-block { margin-right: auto; min-width: 0; }
.title-block h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.title-block p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.topbar .menu-btn { display: none; }
.icon-btn, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: pointer; color: inherit; text-decoration: none;
}
.icon-btn { flex: none; width: 36px; padding: 0; }
.icon-btn.ghost { border-color: transparent; background: transparent; color: var(--text-secondary); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover, .btn:hover { background: var(--surface-2); }

/* ---------- Layout ---------- */
main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 20px 24px 48px; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); }
.segmented button {
  min-height: 32px; min-width: 48px; padding: 0 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-secondary); cursor: pointer; font-weight: 500;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.select {
  min-height: 38px; padding: 0 32px 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none; cursor: pointer;
}

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px; margin-bottom: 16px; border-radius: 10px;
  background: var(--accent-wash); color: var(--text-secondary); font-size: 13px;
}
.notice strong { color: var(--text-primary); }
.notice.error { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.notice svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
[hidden] { display: none !important; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }
.span-9 { grid-column: span 9; }
.span-4 { grid-column: span 4; }

/* ---------- FHE productivity ---------- */
.view-tabs { margin-bottom: 14px; }
.view-tabs.inline { margin-bottom: 0; }
.stack-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.qoq-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.qoq-head h2 { margin: 0; font-size: 15px; }
.qoq-head .card-note { margin: 2px 0 0; }
.view-tabs button { white-space: nowrap; }
.card-head { flex-wrap: wrap; }
.tiles-5 + .grid { margin-top: 0; }
.cur-switch button { min-width: 44px; }
.tiles-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
table.board th, table.board td { white-space: nowrap; }
table.board thead tr.groups th { color: var(--text-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  text-align: center; border-bottom: 1px solid var(--grid); padding-bottom: 4px; }
table.board tbody th { text-align: left; font-weight: 500; color: var(--text-primary); font-size: 14px; }
table.board tbody th, table.board thead tr:last-child th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.board td { vertical-align: top; }
.median-row th, .median-row td { color: var(--text-muted); font-style: italic; background: var(--page) !important; }
.person-link { border: 0; background: none; padding: 0; font: inherit; color: var(--text-primary); cursor: pointer; text-align: left; }
.person-link:hover { color: var(--accent); text-decoration: underline; }
.off { color: var(--text-muted); font-size: 10px; }
.mini-bar { display: block; position: relative; width: 72px; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--surface-2); }
.mini-bar i, .mini-bar b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.mini-bar i { background: var(--deemph); }
.mini-bar b { background: var(--accent); }
.person-head { display: flex; align-items: baseline; gap: 12px; margin: 0 2px 12px; }
.person-head h2 { margin: 0; font-size: 20px; }
.section-title { margin: 20px 2px 10px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 18px;
  color: var(--text-primary); text-decoration: none; background: var(--surface); }
.chip:hover { border-color: var(--accent); background: var(--accent-wash); }
.chip em { font-style: normal; color: var(--text-muted); font-size: 12px; }
.empty-pick { max-width: 860px; }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover { color: var(--accent); text-decoration: underline; }
.picker .ms-btn { min-width: 220px; }
.ctabs { margin: 0 0 14px; }
.ctabs a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 7px; color: var(--text-secondary);
  text-decoration: none; font-weight: 500; white-space: nowrap; }
.ctabs a[aria-current="page"] { background: var(--surface); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.table-search { width: 100%; max-width: 360px; min-height: 36px; margin: 6px 0 4px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--page); }
.route { white-space: normal; color: var(--text-secondary); }
[data-slot="tq"] th:nth-child(2), [data-slot="tq"] td:nth-child(2) { text-align: left; }
[data-slot="queries"] th:nth-child(3), [data-slot="queries"] td:nth-child(3),
[data-slot="queries"] th:nth-child(4), [data-slot="queries"] td:nth-child(4) { text-align: left; }
.picker-panel { width: 320px; }
.picker-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; text-align: left; cursor: pointer; }
.picker-opt:hover, .picker-opt:focus-visible { background: var(--surface-2); }
.picker-opt[aria-selected="true"] { background: var(--accent-wash); font-weight: 600; }
.picker-opt em { font-style: normal; font-size: 12px; color: var(--text-muted); font-weight: 400; }
[data-slot="person-lanes"] { align-items: start; }

/* ---------- Needs attention ---------- */
.queue-total { margin: 0 2px 14px; color: var(--text-secondary); font-size: 15px; }
.queue-total strong { color: var(--text-primary); font-size: 18px; }
.lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.lane { display: flex; flex-direction: column; }
.lane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lane-head h2 { font-size: 15px; }
.lane-count { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.lane-list { list-style: none; margin: 8px 0 0; padding: 0; }
.lane-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--grid); }
.lane-main { min-width: 0; }
.lane-main .cell-main, .lane-main .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-main .cell-main { display: block; }
.lane-metric { flex: none; color: var(--text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.lane-empty { color: var(--text-muted); margin: 12px 0 4px; }
.lane-more { align-self: flex-start; margin-top: 8px; font-size: 13px; }
.backlog .card-note { margin-top: 8px; }
.backlog-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--grid); }
.backlog-count { min-width: 56px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.backlog-text { flex: 1; color: var(--text-secondary); font-size: 13px; }
.backlog-text strong { color: var(--text-primary); font-weight: 500; }
.back { font-size: 13px; margin: 0 0 10px; }
.holders { margin: 4px 0 8px; color: var(--text-secondary); font-size: 13px; }
.holders .link-btn { font-size: 13px; padding: 0; }
table.queue td { vertical-align: top; white-space: normal; }
table.queue th, table.queue td { text-align: left; }
table.queue td:first-child { min-width: 240px; }
table.queue td[data-label="Waiting"], table.queue td[data-label="Travel"], table.queue td[data-label="Last change"] { white-space: nowrap; }
table.queue th { white-space: nowrap; }
.cell-main a { color: inherit; text-decoration: none; font-weight: 500; }
.cell-main a:hover { color: var(--accent); text-decoration: underline; }
.cell-main { font-weight: 500; }
.cell-sub { display: block; color: var(--text-muted); font-size: 12px; margin-top: 1px; }
.cell-link { color: var(--accent); text-decoration: none; margin-left: 4px; }
.sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.sort:hover { color: var(--text-primary); }
.why { text-align: left !important; }
.pill { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--text-secondary); white-space: nowrap; }
.rules-panel { width: 340px; }
.rules-intro { margin: 12px 14px 4px; color: var(--text-secondary); font-size: 13px; }
.rule-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; }
.rule-field > span:first-child { font-size: 13px; }
.rule-input { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.rule-input input { width: 64px; min-height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--page); text-align: right; }
.rule-input em { font-style: normal; color: var(--text-muted); font-size: 12px; width: 36px; }
.dims { display: contents; }
.span-2 .delta { flex-wrap: wrap; }
.span-2 .delta .vs { flex-basis: 100%; }
/* The line explaining a page's numbers: its own row between the tiles and the charts, not squeezed between them. */
.card-note.kpi-note { margin: 12px 2px 18px; max-width: 110ch; line-height: 1.5; }
.card-note { margin: 0 0 4px; color: var(--text-muted); font-size: 12px; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }
.stat .note { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
td .muted { color: var(--text-muted); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.card h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card .sub { color: var(--text-muted); font-size: 12px; }
.chart { width: 100%; min-height: 260px; }
.chart.tall { min-height: 320px; }

/* ---------- Filter controls: date picker + multi-select ---------- */
.dp, .ms { position: relative; }
.dp-btn, .ms-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 260px;
  padding: 0 10px 0 12px; background-image: none; text-align: left; white-space: nowrap;
}
.dp-btn .cal, .ms-btn .cal { flex: none; width: 16px; height: 16px; color: var(--text-muted); }
.dp-label, .ms-label { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chev { flex: none; width: 14px; height: 14px; color: var(--text-muted); transition: transform .15s; }
.open > .select .chev { transform: rotate(180deg); }
.ms-btn.has-value { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background-color: var(--accent-wash); }

.popover {
  position: absolute; top: calc(100% + 6px); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06);
}
.pop-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--grid); }
.pop-foot > span { margin-right: auto; color: var(--text-muted); font-size: 12px; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.primary.sm { width: auto; min-height: 32px; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 4px 2px; color: var(--accent); font-size: 12px; font-weight: 500; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* multi-select */
.ms-panel { width: 280px; display: flex; flex-direction: column; max-height: min(420px, 70vh); }
.ms-search { margin: 10px 10px 0; min-height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--page); }
.ms-actions { display: flex; justify-content: space-between; padding: 6px 12px 2px; }
.ms-list { overflow: auto; padding: 4px 6px 8px; flex: 1; }
.ms-opt { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 8px; border-radius: 6px; cursor: pointer; }
.ms-opt:hover { background: var(--surface-2); }
.ms-opt input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.ms-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-empty { color: var(--text-muted); padding: 8px; margin: 0; }

/* date picker */
.dp-body { display: flex; }
.dp-presets { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; min-width: 160px; border-right: 1px solid var(--grid); }
.dp-preset {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; white-space: nowrap;
}
.dp-preset:hover { background: var(--surface-2); }
.dp-preset[aria-pressed="true"] { font-weight: 600; }
.dp-preset .tick { width: 16px; height: 16px; color: var(--accent); }
.dp-cal { position: relative; padding: 10px 14px 12px; }
.dp-nav { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; justify-content: space-between; pointer-events: none; }
.dp-nav button { pointer-events: auto; width: 32px; min-height: 32px; }
.dp-nav button:disabled { opacity: .3; cursor: default; }
.dp-months { display: flex; gap: 20px; }
.dp-month { width: 252px; }
.dp-title { text-align: center; font-weight: 600; line-height: 32px; margin-bottom: 4px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 36px); }
.dp-wd { text-align: center; color: var(--text-muted); font-size: 11px; line-height: 28px; }
.dp-day {
  height: 36px; border: 0; background: none; border-radius: 0; cursor: pointer;
  font-variant-numeric: tabular-nums; position: relative;
}
.dp-day:hover:not(:disabled) { background: var(--surface-2); border-radius: 8px; }
.dp-day:disabled { color: var(--text-muted); opacity: .4; cursor: default; }
.dp-day.today { font-weight: 700; }
.dp-day.today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.dp-day.in { background: var(--accent-wash); border-radius: 0; }
.dp-day.start, .dp-day.end { background: var(--accent); color: #fff; font-weight: 600; }
.dp-day.start { border-radius: 8px 0 0 8px; }
.dp-day.end { border-radius: 0 8px 8px 0; }
.dp-day.start.end { border-radius: 8px; }
.dp-day.start.today::after, .dp-day.end.today::after { background: #fff; }
.dp-summary.bad { color: var(--bad); }

/* ---------- Stat tiles ---------- */
.stat .label { color: var(--text-secondary); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 2px; }
.stat.hero .value { font-size: 40px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--text-muted); }
.delta .vs { color: var(--text-muted); font-weight: 400; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 8px -4px 0; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 4px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text-muted); font-weight: 500; font-size: 12px; border-bottom: 1px solid var(--grid); }
td { border-bottom: 1px solid var(--grid); }
tr:last-child td { border-bottom: 0; }
.share { display: inline-block; vertical-align: middle; width: 56px; height: 6px; border-radius: 3px; background: var(--surface-2); margin-left: 8px; overflow: hidden; }
.share i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- Loading ---------- */
.loading .value, .loading .delta, .loading .chart, .loading tbody {
  color: transparent !important; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--grid) 50%, var(--surface-2) 75%) 0 0 / 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
.loading .chart > * { visibility: hidden; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .loading * { animation: none !important; } }

.kpis { gap: 16px; }
.link { color: var(--text-secondary); text-decoration: none; }
.link:hover { color: var(--accent); }
tr.selected td { background: var(--accent-wash); }
.empty-note { color: var(--text-muted); margin: 12px 0 4px; }
.empty { max-width: 420px; }
.empty p { color: var(--text-secondary); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 14px 0 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.theme-pick { margin-top: 14px; }
.stack { margin-top: 14px; max-width: 420px; }
.hint { color: var(--text-muted); font-size: 12px; }
.form-msg { min-height: 20px; font-size: 13px; margin-bottom: 8px; }
.form-msg.ok { color: var(--good); }
.form-msg.bad { color: var(--bad); }
.btn.primary.fit { width: auto; padding: 0 18px; }

footer { color: var(--text-muted); font-size: 12px; margin-top: 20px; text-align: center; }

/* ---------- Login ---------- */
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; padding: 28px 24px; }
.auth-card h1 { font-size: 20px; margin: 16px 0 4px; }
.auth-card p { margin: 0 0 20px; color: var(--text-secondary); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; }
.field input {
  min-height: 42px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--page);
}
.btn.primary { width: 100%; min-height: 44px; background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.primary:disabled { opacity: .6; cursor: progress; }
.form-error { color: var(--bad); font-size: 13px; min-height: 20px; margin: 4px 0 8px; }

/* ---------- Hotels ---------- */
.page-question { margin: 0 2px 14px; color: var(--text-secondary); font-size: 15px; }
.callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 0 0 16px; }
.callouts:empty { display: none; }
.callout { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.callout:hover { border-color: var(--accent); }
.callout .kind { color: var(--text-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.callout .head { font-size: 15px; font-weight: 600; margin: 4px 0; }
.callout .body { color: var(--text-secondary); font-size: 13px; }
.table-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 4px; }
.table-tools .table-search { margin: 0; }
.hotel-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); padding: 0; overflow: hidden; margin-bottom: 16px; }
.hotel-id { padding: 20px 22px; background: linear-gradient(135deg, var(--accent-wash), transparent 70%); }
.hotel-id h2 { margin: 10px 0 2px; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
.hotel-id .meta { color: var(--text-secondary); font-size: 13px; }
.hotel-id .pill { margin: 0 4px 0 0; }
.verdict { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.verdict li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-secondary); font-size: 13px; }
.verdict b { color: var(--text-primary); font-weight: 600; }
.verdict .mark { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--text-muted); }
.verdict .mark.good { background: var(--good); }
.verdict .mark.bad { background: var(--bad); }
.hero-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 1px solid var(--grid); }
.hero-tiles .stat { border: 0; border-radius: 0; box-shadow: none; background: none; border-bottom: 1px solid var(--grid); }
.hero-tiles .stat:nth-child(odd) { border-right: 1px solid var(--grid); }
.hero-tiles .stat:nth-last-child(-n+2) { border-bottom: 0; }
.hero-tiles .stat .value { font-size: 24px; }
.stay-cal { display: grid; grid-template-columns: 44px repeat(12, minmax(0, 1fr)); gap: 3px; margin-top: 10px; font-size: 11px; color: var(--text-muted); }
.stay-cal .yr { display: flex; align-items: center; }
.stay-cal .mo { text-align: center; }
.stay-cal .cell { aspect-ratio: 1.15; border-radius: 4px; background: var(--surface-2); }
.stay-cal .cell.future { outline: 1px dashed var(--axis); outline-offset: -1px; }
.stay-cal .cell.none { background: transparent; }
.cal-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--text-muted); font-size: 11px; }
.cal-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.pill.st-confirmed { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.pill.st-open { background: color-mix(in srgb, var(--series-4) 18%, transparent); color: var(--text-primary); }
.pill.st-closed { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
tr.self td, tr.self th { font-weight: 600; background: var(--accent-wash); }
.more-detail { margin-top: 16px; }
.more-detail summary { cursor: pointer; color: var(--text-secondary); font-weight: 500; }
.more-detail[open] summary { margin-bottom: 14px; }
.detail-block h3 { margin: 0 0 6px; font-size: 13px; }
.detail-block ul { list-style: none; margin: 0; padding: 0; }
.detail-block li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--grid); font-size: 13px; }
.detail-block li:first-child { border-top: 0; }
.detail-block li b { font-weight: 500; font-variant-numeric: tabular-nums; }
.detail-block .muted { font-style: normal; color: var(--text-muted); font-size: 12px; }
.span-8 { grid-column: span 8; }
.text-table th, .text-table td { text-align: left; }
.text-table th:last-child, .text-table td:last-child { text-align: right; }
@media (max-width: 1180px) {
  .hotel-hero { grid-template-columns: minmax(0, 1fr); }
  .hero-tiles { border-left: 0; border-top: 1px solid var(--grid); }
  .span-8 { grid-column: span 12; }
}

/* ---------- Placement › Bookings ---------- */
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 0; color: var(--text-secondary); font-size: 12px; }
.legend-row span::before, .dot-label::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.status-bar { display: flex; gap: 2px; width: 160px; height: 10px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.status-bar i { display: block; height: 100%; }
.bk-table .bar-col { text-align: left; }
.row-btn { border: 0; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; font: inherit; color: inherit; cursor: pointer; }
.row-btn:hover { color: var(--accent); background: var(--accent-wash); }
.row-btn { font-weight: 500; }
.chips:empty { display: none; }

.tours-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.tour-donuts { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); justify-content: center; gap: 48px; }
.tour-donuts figure { margin: 0; text-align: center; }
.tour-donuts figcaption { color: var(--text-muted); font-size: 12px; margin-top: -4px; }
.donut { height: 210px; }
@media (max-width: 640px) { .tour-donuts { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* ---------- Placement › Follow-up ---------- */
.fu-tools { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.fu-tools .carousel { flex: 1 1 420px; }
.fu-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.fu-toggles .chip { padding: 6px 12px; font-size: 13px; cursor: pointer; background: var(--surface); color: var(--text-secondary); }
.fu-toggles .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); color: var(--text-primary); }
.fu-toggles .chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
/* Day strip: one button per day (or week), the count large. */
.fu-days { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; scrollbar-width: thin; }
.fu-days button { flex: 1 0 84px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 12px; border: 1px solid var(--grid);
  border-radius: 10px; background: var(--surface); color: var(--text-secondary); font: inherit; cursor: pointer; text-align: left; }
.fu-days button:hover { border-color: var(--accent); }
.fu-days button span { font-size: 12px; }
.fu-days button b { font-size: 20px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1.2; }
.fu-days button small { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.fu-days button.soon b { color: var(--bad); }
.fu-days button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.fu-head { flex-wrap: wrap; gap: 8px 12px; }
.fu-bad { color: var(--bad); }
/* Suppliers: rows that open the side panel. */
.fu-list { border-top: 1px solid var(--grid); }
.fu-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 90px 90px; gap: 12px; align-items: center; padding: 10px 8px;
  border-bottom: 1px solid var(--grid); cursor: pointer; }
.fu-row:hover, .fu-row[aria-pressed="true"] { background: var(--surface-2); }
.fu-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fu-name { min-width: 0; }
.fu-name b { font-weight: 600; }
.fu-num { font-variant-numeric: tabular-nums; }
.fu-num b { font-weight: 600; }
.fu-when { font-size: 13px; text-align: right; color: var(--text-secondary); }
.fu-when.fu-bad { color: var(--bad); font-weight: 500; }
/* Branches: city × product grid. */
.fu-grid-wrap { overflow-x: auto; }
.fu-grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.fu-grid th, .fu-grid td { padding: 4px 6px; vertical-align: middle; border-bottom: 1px solid var(--grid); text-align: center; white-space: nowrap; }
.fu-grid thead th { font-weight: 500; color: var(--text-muted); font-size: 12px; }
.fu-grid tbody th { text-align: left; font-weight: 500; position: sticky; left: 0; background: var(--surface); }
.fu-grid thead th:first-child { text-align: left; }
.fu-cell { min-width: 44px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit;
  font-variant-numeric: tabular-nums; color: var(--text-primary); cursor: pointer; }
.fu-cell:hover, .fu-cell[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
.fu-cell.soon { color: var(--bad); font-weight: 600; }
.fu-total .fu-cell { font-weight: 600; }
/* Ops performance. */
.ops-bad { color: var(--bad); font-weight: 600; }
.ops-name { font-weight: 600; font-size: 14px; text-align: left; padding: 0; white-space: normal; }
.ops-head { flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.ops-head .table-search { margin-left: auto; max-width: 240px; }
.ops-sub { margin: 4px 0 0; }
.ops-charts { margin: 16px 0; }
.ops-charts .chart { min-height: 0; }
.ops-charts .card-head .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-head .table-search { max-width: 220px; }
.ops-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ops-pill-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.ops-h { margin: 16px 0 0; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
/* Side panel. */
.fu-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .25); }
.fu-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(560px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(0, 0, 0, .14); }
.fu-panel[hidden], .fu-scrim[hidden] { display: none; }
.fu-panel-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--grid); }
.fu-panel-head > div { flex: 1; min-width: 0; }
.fu-panel-head h2 { margin: 0 0 2px; font-size: 16px; }
.fu-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 4px 6px; }
.fu-panel-body { overflow-y: auto; padding: 4px 16px 24px; }
.fu-file { padding: 12px 0; border-bottom: 1px solid var(--grid); }
.fu-file-head { display: flex; flex-direction: column; margin-bottom: 6px; }
.fu-item { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 3px 0; font-size: 13px; }
.fu-date { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.fu-date.fu-bad { font-weight: 500; }
@media (max-width: 640px) {
  .fu-row { grid-template-columns: minmax(0, 1fr) 60px 70px; }
  .fu-row .fu-num:nth-child(3) { display: none; }
  .fu-item { grid-template-columns: 62px minmax(0, 1fr); }
  .fu-item .dot-label { grid-column: 2; }
}

/* ---------- Placement › File readiness ---------- */
.rd-file { border-top: 1px solid var(--grid); }
.rd-file:first-child { border-top: 0; }
.rd-file summary { display: grid; grid-template-columns: 110px minmax(0, 1.2fr) minmax(0, 2fr) 170px; gap: 14px; align-items: center;
  padding: 10px 4px; cursor: pointer; list-style: none; }
.rd-file summary::-webkit-details-marker { display: none; }
.rd-file summary:hover { background: var(--surface-2); }
.rd-when, .rd-who, .rd-state { min-width: 0; }
.rd-state { text-align: right; }
.rd-state .pill { margin: 0; }
.rd-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rd-chip { font-size: 11.5px; padding: 2px 7px; border-radius: 10px; color: var(--text-primary);
  background: color-mix(in srgb, var(--series-2) 16%, transparent); white-space: nowrap; }
.rd-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.rd-chip.done { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
/* Product buttons: one row that scrolls sideways, with arrows at the ends (disabled at either end). */
/* KPI tiles that filter the list below: click to show only those files, click again to clear. */
.stat-filter { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.stat-filter:hover { border-color: var(--accent); }
.stat-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stat-filter[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-wash); }
.carousel { display: flex; align-items: center; gap: 4px; flex: 1 1 100%; min-width: 0; }
.carousel-btn { flex: none; width: 30px; height: 32px; border: 1px solid var(--grid); border-radius: 8px; background: var(--surface);
  color: var(--text-primary); font-size: 18px; line-height: 1; cursor: pointer; }
.carousel-btn:disabled { opacity: .35; cursor: default; }
.rd-prods { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.rd-prods::-webkit-scrollbar { display: none; }
.rd-prods button { flex: none; white-space: nowrap; }
.rd-prods b { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 2px; }
.file-tabs { margin: 0 0 14px; flex-wrap: wrap; }
.tab-count { font-size: 11px; color: var(--text-muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.file-incident { padding: 12px 0; border-top: 1px solid var(--grid); }
.file-incident:first-child { border-top: 0; }
.fi-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.fi-head .pill { margin: 0; }
.fi-line { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.fi-line span { display: block; font-size: 11.5px; color: var(--text-muted); }
.back-link { display: inline-block; margin: 0 0 8px; }
.rd-prods-row { margin: 0 0 10px; }
.rd-prods-row .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
.rd-prods-row .chip b { font-weight: 600; margin-left: 2px; }
.rd-next { flex-basis: 100%; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rd-next b { color: var(--text-primary); font-weight: 600; }
.rd-next.bad b { color: var(--decline); }
.rd-open { padding: 0 4px 12px 124px; }
@media (max-width: 900px) {
  .rd-file summary { grid-template-columns: minmax(0, 1fr) auto; }
  .rd-chips { grid-column: 1 / -1; }
  .rd-open { padding-left: 4px; }
}

/* ---------- Products ---------- */
.product-tabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 0 0 14px; }
.product-tabs a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 7px; color: var(--text-secondary);
  text-decoration: none; font-weight: 500; white-space: nowrap; }
.product-tabs a[aria-current="page"] { background: var(--surface); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.row-link.muted { color: var(--text-muted); font-style: italic; }

/* ---------- Placement › Guest map ---------- */
.guest-map { width: 100%; height: 640px; margin-top: 6px; border-radius: 10px; overflow: hidden; }
.map-card .card-head { align-items: center; }
.legs { list-style: none; margin: 8px 0 0; padding: 0; }
.legs li { border-top: 1px solid var(--grid); }
.legs li:first-child { border-top: 0; }
.leg-btn { display: grid; grid-template-columns: minmax(0, 1fr) 90px 44px; gap: 10px; align-items: center; width: 100%; padding: 8px 2px;
  border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.leg-btn:hover { background: var(--surface-2); }
.leg-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.leg-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.leg-n { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.span-8 { grid-column: span 8; }
@media (max-width: 1180px) { .span-8 { grid-column: span 12; } }
@media (max-width: 640px) { .guest-map { height: 420px; } }

/* ---------- Placement › File details ---------- */
.file-search { position: relative; max-width: 460px; margin: 0 0 14px; }
.header-search { flex: 1 1 260px; max-width: 420px; min-width: 0; }
.header-search:empty { display: none; }
.file-list td, .file-list th { text-align: left; }
.file-list td { white-space: normal; vertical-align: top; }
.file-list tbody tr { cursor: pointer; }
.file-list td:nth-child(3), .file-list td:nth-child(5), .file-list td:nth-child(6) { white-space: nowrap; }
.file-list td:nth-child(2) { min-width: 200px; }
.file-list tbody tr:hover td { background: var(--surface-2); }
.header-search .file-search { margin: 0; max-width: none; }
.file-search .table-search { max-width: none; margin: 0; }
.file-results { position: absolute; z-index: 20; left: 0; right: 0; top: 42px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); max-height: 360px; overflow: auto; padding: 4px; }
.file-results a { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 7px; color: inherit; text-decoration: none; }
.file-results a:hover { background: var(--surface-2); }
.file-results a span { color: var(--text-muted); font-size: 12px; }
.file-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 2px 14px; }
.file-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.file-head .sub { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.file-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.file-badges .pill { margin: 0; }
.journey { padding-bottom: 8px; }
.journey .legend-row { margin: 4px 0 10px; }
.file-map { width: 100%; height: 520px; border-radius: 10px; overflow: hidden; border: 1px solid var(--grid); }
.mode-key { display: inline-flex; align-items: center; gap: 8px; }
.mode-key::before { content: ""; display: inline-block; width: 28px; height: 0; border-top: 3px solid var(--accent); }
.mode-flight::before { border-top-style: dashed; }
.mode-train::before { border-top-style: dotted; }
.mode-hint { color: var(--text-muted); }
.mode-hint::before, .legend-row .mode-hint::before { display: none; }
.legend-row .mode-key::before { background: none; width: 28px; height: 0; border-radius: 0; margin-right: 0; }
/* Day tabs: one row, scrolls sideways */
.day-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 14px 2px 10px; margin: 0 -2px;
  scrollbar-width: thin; }
.day-tab { flex: 0 0 168px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.day-tab:hover { border-color: var(--accent); }
.day-tab.on { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.dt-top { display: flex; align-items: center; justify-content: space-between; }
.dt-top b { font-size: 14px; }
.dt-date { color: var(--text-muted); font-size: 12px; }
.dt-place { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--text-secondary); min-height: 18px; }
.dt-foot .mode-key::before { width: 16px; border-top-width: 2px; }
.dt-count { color: var(--text-muted); }
.dt-count.open { color: var(--series-2); font-weight: 600; }
.stop-pin { font-style: normal; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700; }
.day-panel { border-top: 1px solid var(--grid); padding-top: 12px; }
.dp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.dp-head h3 { margin: 0; font-size: 15px; }
.dp-head .sub { color: var(--text-secondary); font-size: 13px; }
.day-nav { margin-left: auto; display: flex; gap: 12px; }
.day-nav .link-btn:disabled { color: var(--text-muted); cursor: default; }
@media (max-width: 640px) {
  .file-map { height: 360px; }
  .day-tab { flex-basis: 140px; }
  .day-nav { margin-left: 0; }
}

/* ---------- Placement › Booking calendar ---------- */
.cal-day { margin-bottom: 16px; }
.cal-tiles { margin-top: 4px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { min-width: 150px; text-align: center; }
.cal-nav .icon-btn { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.cal-nav .icon-btn:disabled { opacity: .35; cursor: default; }
.cal-weekdays, .cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-weekdays { margin: 8px 0 6px; font-size: 12px; color: var(--text-muted); text-align: center; }
.cal-daycell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 92px; padding: 8px 10px; text-align: left;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; font: inherit; cursor: pointer;
  font-variant-numeric: tabular-nums; }
.cal-daycell:hover { border-color: var(--accent); }
.cal-daycell.on { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-daycell.today .cd-num { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; }
.cal-daycell.past { opacity: .75; }
.cal-daycell.empty { background: transparent; }
.cd-num { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.cd-b { font-size: 13px; }
.cd-b b { font-size: 16px; }
.cd-t, .cd-h { font-size: 12px; color: var(--text-secondary); }
@media (max-width: 640px) {
  .cal-weekdays, .cal-days { gap: 3px; }
  .cal-daycell { min-height: 64px; padding: 5px; }
  .cd-b { font-size: 0; } .cd-b b { font-size: 14px; }
  .cd-t, .cd-h { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .span-7, .span-5, .span-6, .span-4 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
  .span-2 { grid-column: span 4; }
  .span-9, .span-3.side { grid-column: span 12; }
  .tiles-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Tablet & phone: the sidebar becomes an off-canvas drawer. */
@media (max-width: 1023px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 84vw);
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: none;
  }
  .shell.drawer-open .sidebar { transform: none; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
  .topbar .menu-btn { display: inline-flex; margin-left: -6px; }
  .collapse-btn { display: none; }
}
@media (prefers-reduced-motion: reduce) { .shell, .sidebar { transition: none; } }
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; position: static; }  /* filters would eat half the screen if sticky */
  main { padding: 16px 16px 40px; }
  .grid { gap: 12px; }
  .card { padding: 14px; }
  .filters { order: 3; width: 100%; }
  .filters .segmented { flex: 1 1 100%; }
  .topbar { backdrop-filter: none; }
  #dp, .dp { flex: 1 1 100%; }
  .dp-btn, .ms-btn { max-width: none; width: 100%; }
  .ms { flex: 1 1 140px; min-width: 0; }
  .popover { position: fixed; left: 12px; right: 12px; top: 12px; width: auto; max-height: calc(100dvh - 24px); overflow: auto; }
  .ms-panel { max-height: calc(100dvh - 24px); }
  .dp-body { flex-direction: column; }
  .dp-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--grid); min-width: 0; gap: 6px; }
  .dp-preset { min-height: 32px; border: 1px solid var(--border); border-radius: 16px; padding: 0 12px; }
  .dp-preset[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
  .dp-preset .tick { display: none; }
  .dp-cal { display: flex; justify-content: center; }
  .dp-grid { grid-template-columns: repeat(7, minmax(36px, 1fr)); }
  .dp-month { width: 100%; max-width: 340px; }
  .dp-nav { left: 12px; right: 12px; }
  .segmented button { flex: 1; min-width: 0; padding: 0 6px; }
  .fu-tools .segmented { display: flex; flex: 1 1 100%; }
  .fu-days button { flex-basis: 72px; padding: 6px 8px; }
  .segmented.rd-prods button { flex: none; padding: 0 10px; }
  .select { flex: 1 1 140px; min-width: 0; }
  .span-2 { grid-column: span 6; }
  .lanes { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .lane-list li { align-items: flex-start; flex-direction: column; gap: 2px; }
  .lane-main { width: 100%; }
  .lane-main .cell-main, .lane-main .cell-sub { white-space: normal; }
  .backlog-row { flex-wrap: wrap; }
  .rules-panel { width: auto; }
  /* The queue becomes a list of cards on phones. */
  table.queue thead { display: none; }
  table.queue, table.queue tbody, table.queue tr, table.queue td { display: block; width: 100%; }
  table.queue tr { padding: 12px 0; border-bottom: 1px solid var(--grid); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  table.queue td { border: 0; padding: 0; text-align: left; min-width: 0 !important; }
  table.queue td:first-child, table.queue td.why { grid-column: 1 / -1; }
  table.queue td:not(:first-child):not(.why)::before { content: attr(data-label); display: block; color: var(--text-muted); font-size: 11px; }
  .stat .value { font-size: 22px; }
  .stat.hero .value { font-size: 28px; }
  .delta { flex-wrap: wrap; }
  .delta .vs { flex-basis: 100%; }
  .share { display: none; }
  .chart { min-height: 220px; }
  .chart.tall { min-height: 260px; }
}

.refreshing .chart, .refreshing .stat, .refreshing table { opacity: .55; transition: opacity .15s; }

/* Thin bar under the top bar while any data request is in flight. */
.topbar { position: relative; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
.progress i { position: absolute; top: 0; bottom: 0; width: 35%; background: var(--accent); border-radius: 2px; animation: progress 1.1s infinite ease-in-out; }
.busy .progress { opacity: 1; }
@keyframes progress { from { left: -35%; } to { left: 100%; } }

/* Card shown at the top of a page until its first data arrives. */
.loader { display: none; gap: 12px; align-items: center; padding: 12px 16px; margin-bottom: 16px; border-radius: 10px;
  background: var(--accent-wash); color: var(--text-secondary); font-size: 13px; }
.loader strong { color: var(--text-primary); font-weight: 600; }
.loading .loader { display: flex; }
.spinner { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-wash); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .progress i, .spinner { animation-duration: 3s; } }

/* (i) on each card: how the metric is calculated and where the data comes from */
.card.has-info { position: relative; }
.card.has-info > .card-head { padding-right: 28px; }
.info-btn {
  position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; padding: 3px;
  border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer;
}
.info-btn svg { width: 100%; height: 100%; display: block; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--accent); background: var(--accent-wash); }
.info-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.info-pop {
  position: fixed; z-index: 50; width: min(360px, calc(100vw - 16px)); max-height: 70vh; overflow: auto;
  background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); padding: 12px 14px; font-size: 12.5px; line-height: 1.45;
}
.info-pop h3 { margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.info-pop h3 + ul { margin: 0 0 10px; padding-left: 16px; }
.info-pop ul:last-child { margin-bottom: 0; }
.info-pop li + li { margin-top: 3px; }

/* Business pages */
.neg { color: var(--bad); }
.key-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.mix-bar { display: inline-flex; width: 120px; max-width: 100%; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; vertical-align: middle; }
.mix-bar i { display: block; height: 100%; }
.heat-table td.heat { text-align: right; font-variant-numeric: tabular-nums; border-radius: 4px; }
.heat-table td.heat .cell-sub { color: var(--text-muted); }
.heat-table th:not(:first-child) { text-align: right; }

/* Hotel relationships: change against the previous period under a number */
.cell-sub.up { color: var(--good); }
.cell-sub.down { color: var(--bad); }
.view-tabs[data-slot="dims"] { display: flex; width: fit-content; max-width: 100%; overflow-x: auto; }
.view-tabs[data-slot="dims"] button { flex: 0 0 auto; padding: 0 12px; }

/* Branches: a dashed reference line in legends; on phones the branch picker takes the full row like the other filters. */
.legend-row .legend-ref::before { width: 14px; height: 0; border-radius: 0; border-top: 1px dashed var(--text-muted); background: none; vertical-align: 3px; }
/* Branch lists: text columns read left to right, and long names wrap instead of pushing the table wide. */
[data-slot="list"] th, [data-slot="list"] td, [data-slot="xo"] th, [data-slot="xo"] td { text-align: left; white-space: normal; vertical-align: top; }
[data-slot="list"] td:first-child, [data-slot="xo"] td:first-child { white-space: nowrap; }
@media (max-width: 640px) { .picker { width: 100%; } .picker .ms-btn { min-width: 0; } }

/* How branch money works: readable prose, and the one-service split. */
.guide .card p, .guide .card li { font-size: 14px; line-height: 1.6; color: var(--text-secondary); max-width: 80ch; }
.guide .card p { margin: 10px 0 0; }
.guide .card ul { margin: 10px 0 0; padding-left: 20px; }
.guide .card li + li { margin-top: 6px; }
.guide strong { color: var(--text-primary); font-weight: 600; }
.guide-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0 4px; }
.guide-flow > div { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; min-width: 140px; }
.guide-flow > div.accent { border-color: var(--accent); background: var(--accent-wash); }
.guide-flow b { font-size: 22px; font-weight: 600; color: var(--text-primary); }
.guide-flow .muted { font-size: 12px; }
.guide-flow > span { font-size: 20px; color: var(--text-muted); }
.bp-sub-head { margin-top: 20px; }
.bp-donuts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.bp-donuts .donut { height: 190px; }
.bp-table { margin-top: 6px; }
.bp-table summary { cursor: pointer; color: var(--text-muted); font-size: 12px; padding: 4px 0; }
.bp-table summary:hover { color: var(--text-secondary); }

/* Sidebar never scrolls sideways: the nav scrolls vertically only, and a long page name is cut with "…"
   (its full name is in the link's title). */
.sidebar, .nav { overflow-x: hidden; }
.nav-item, .nav-section { min-width: 0; max-width: 100%; box-sizing: border-box; }
.nav-item .nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Tab bars wrap on a narrow screen instead of pushing the page sideways. */
.segmented.view-tabs { flex-wrap: wrap; max-width: 100%; }

/* Incidents list: the reporter's text, readable in a table cell */
.inc-text { min-width: 260px; max-width: 520px; white-space: normal; }
.inc-p { margin: 0 0 6px; line-height: 1.45; }
.inc-report + .inc-report { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--grid); }
.pill.inc-check { background: color-mix(in srgb, var(--series-4) 18%, transparent); color: var(--text-primary); }


/* A page question with an action on the right (Profitability: Download CSV report). */
.page-question-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; margin: 0 2px 14px; }
.page-question-row .page-question { margin-bottom: 0; }
.page-question-row .btn { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }

/* Reset filters, at the end of the filter bar. */
.reset-filters { white-space: nowrap; }
.reset-filters:disabled { opacity: .45; }
