﻿/* Parts ASAP Now dashboard framework.
   Design system adapted from the Parts ASAP Ecommerce 5-Year Lookback dashboard:
   warm-neutral surfaces, brand-red ALL-CAPS headings, red-accent KPI cards, soft borders. */
:root {
  --brand-red: #CC2027;
  --brand-blue: #3B4B9F;
  --surface: #fcfcfb;
  --card: #ffffff;
  --border: #e6e4df;
  --text-1: #0b0b0b;
  --text-2: #52514e;
  --text-3: #8a8880;
  --chip-bg: #f2f1ee;
  --grid-line: #eceae5;
  --accent-success: #1baf7a;
  --accent-amber: #eda100;
}

body { background: var(--surface); }

.dash-page { --dash-gap: 16px; }

.dash-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  border-bottom: 4px solid var(--brand-red); padding-bottom: 10px; margin-bottom: 14px; }
.dash-title { font-weight: 700; color: var(--brand-red); margin: 0; text-transform: uppercase; letter-spacing: .05em; font-size: 1.35rem; }
.dash-subtitle { color: var(--text-2); font-size: .85rem; }
.dash-meta { font-size: .78rem; color: var(--text-3); margin-top: 10px; }
.dash-meta-top { margin-top: 0; margin-bottom: 8px; text-align: right; }

/* A payload's plain-words reading of its own numbers, and its "How to read this page" box. */
.dash-takeaway { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--brand-blue);
  border-radius: 10px; padding: 12px 16px; margin: 0 0 12px; font-size: .95rem; line-height: 1.5; }
.dash-about { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; margin: 0 0 14px; font-size: .85rem; }
.dash-about summary { cursor: pointer; font-weight: 700; color: var(--brand-blue); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.dash-about ul { margin: 8px 0 2px; padding-left: 1.2rem; line-height: 1.5; }
.dash-about li { margin-bottom: 4px; }

.wn-whpick { position: relative; }
.wn-whpick__btn { min-width: 170px; max-width: 240px; text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wn-whpick__panel { position: absolute; top: calc(100% + 4px); right: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .14); padding: 8px 12px; min-width: 210px;
  max-height: 320px; overflow-y: auto; }
.wn-whpick__opt { display: flex; align-items: center; gap: 8px; padding: 4px 2px;
  font-size: .85rem; color: var(--text-1); cursor: pointer; white-space: nowrap; }
.wn-whpick__opt .form-check-input { margin: 0; flex: none; }
.wn-whpick__sep { border-top: 1px solid var(--border); margin: 4px 0; }

/* Date range picker (_DateRangePicker.cshtml) */
.wn-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wn-range__custom { display: flex; align-items: center; gap: 6px; }
.wn-range__custom[hidden] { display: none; }
.wn-range__custom input[type="date"] { width: auto; }
.dash-stale { color: var(--accent-amber); font-weight: 700; }
/* Shown when a newer build is deployed under an open page (dashboard-core.js). */
.wn-update-banner { position: sticky; top: 0; z-index: 1050; background: var(--brand-blue, #3B4B9F); color: #fff;
                    padding: .5rem 1rem; text-align: center; font-weight: 600; }
.wn-update-banner__btn { margin-left: .5rem; background: #fff; color: var(--brand-blue, #3B4B9F); border: 0;
                         border-radius: 4px; padding: .15rem .75rem; font-weight: 700; text-transform: uppercase; }

.dash-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: var(--dash-gap); }
/* Heading over a row of cards that share KpiCard.Group. */
.dash-kpi-group { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 0 0 6px; }
.dash-kpi { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--brand-red);
  border-radius: 8px; padding: 12px 14px; }
.dash-kpi__label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.dash-kpi__value { font-size: 1.6rem; font-weight: 700; line-height: 1.15; color: var(--text-1); margin: 2px 0; }
.dash-kpi__hint { font-size: .78rem; color: var(--text-2); }
/* Marks a card whose value is "right now" and so ignores the selected date range. */
.dash-kpi__live { display: inline-block; margin-top: 4px; padding: 1px 6px; border-radius: 3px;
    font-size: .62rem; font-weight: 700; letter-spacing: .06em;
    color: var(--accent-success); border: 1px solid var(--accent-success); }
.dash-kpi--navy { border-left-color: var(--brand-blue); }
.dash-kpi--red { border-left-color: var(--brand-red); }
.dash-kpi--success { border-left-color: var(--accent-success); }
.dash-kpi--amber { border-left-color: var(--accent-amber); }
.dash-kpi--slate { border-left-color: var(--text-3); }

.dash-charts { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--dash-gap); }
.dash-chart-card, .dash-table-card { grid-column: span 12; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; }
.dash-card-title { font-size: .8rem; font-weight: 700; color: var(--brand-blue); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }

.dash-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.dash-table th { background: var(--brand-red); color: #fff; padding: 6px 8px; text-align: left;
  font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; }
.dash-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); color: var(--text-1); }
.dash-table tbody tr:nth-child(even) td { background: var(--chip-bg); }
.dash-table tbody tr:first-child td { font-weight: 700; }
/* Filterable tables (TableSpec.Filterable / Csv): toolbar beside the title, a filter box per column. */
.dash-table-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 6px; }
.dash-table-head .dash-card-title { margin-bottom: 0; }
.dash-table-tools { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dash-table-count { font-size: .78rem; color: var(--text-2); }
.dash-table .dash-filterrow th { background: var(--chip-bg); padding: 3px 4px; }
.dash-table .dash-filterrow input { width: 100%; min-width: 56px; border: 1px solid var(--border); border-radius: 6px;
  font-size: .72rem; padding: 2px 5px; background: var(--card); color: var(--text-1); }
.dash-table--filterable tbody tr:first-child td { font-weight: inherit; } /* grid rows are data, not a totals row */
/* A cell that opens the detail pop-up (TableCell.Detail): reads as a link. */
.dash-detail-link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-blue); text-decoration: underline; cursor: pointer; text-align: left; }

@media (min-width: 992px) {
  .span-3 { grid-column: span 3; }
  .span-4 { grid-column: span 4; }
  .span-6 { grid-column: span 6; }
  .span-8 { grid-column: span 8; }
  .span-12 { grid-column: span 12; }
}

/* ---- KPI drill-down modal ---- */
.dash-kpi--clickable { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.dash-kpi--clickable:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-1px); }
.dash-modal-overlay { position: fixed; inset: 0; background: rgba(11,11,11,.45); z-index: 1050;
  display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; }
.dash-modal { background: var(--card); border-radius: 12px; border-top: 4px solid var(--brand-red);
  max-width: 900px; width: 100%; max-height: 88vh; display: flex; flex-direction: column;
  padding: 16px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dash-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dash-modal-title { color: var(--brand-red); text-transform: uppercase; font-size: 1rem; letter-spacing: .05em; font-weight: 700; margin: 0; }
.dash-modal-close { border: none; background: none; font-size: 1.6rem; line-height: 1; color: var(--text-3); cursor: pointer; }
.dash-modal-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.dash-modal-tabs button { border: 1.5px solid var(--border); background: var(--chip-bg); color: var(--text-2);
  border-radius: 16px; padding: 4px 14px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.dash-modal-tabs button.on { background: var(--card); color: var(--text-1); border-color: var(--brand-blue); }
.dash-modal-tabs .dash-modal-csv { margin-left: auto; border-color: var(--brand-red); color: var(--brand-red); background: var(--card); border-radius: 8px; }
/* The open tab's own link (DetailTab.Action, e.g. "Open on ups.com ↗"): a blue button left of Download CSV. */
.dash-modal-tabs a.dash-modal-action { display: inline-flex; align-items: center; border: 1.5px solid var(--brand-blue); color: var(--brand-blue);
  background: var(--card); border-radius: 8px; padding: 4px 14px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.dash-modal-tabs a.dash-modal-action:hover { background: var(--chip-bg); }
.dash-modal-tabs a.dash-modal-action[hidden] { display: none; }
.dash-modal-tabs a.dash-modal-action:not([hidden]) + .dash-modal-csv { margin-left: 0; }
.dash-modal-note { font-size: .78rem; color: var(--text-2); margin: 0 0 6px; }
.dash-modal-body { overflow: auto; }

/* ---- TV / kiosk mode: dark tokens from the reference design, scaled for 32" floor screens ---- */
body.tv-mode { background: #1a1a19; }
.tv-mode .dash-page { --border: #3a3936; }
.tv-mode .dash-header { border-bottom-color: #e66767; }
.tv-mode .dash-title { font-size: 2.3rem; color: #e66767; }
.tv-mode .dash-meta { font-size: 1rem; color: #8a8880; }
.tv-mode .dash-kpi, .tv-mode .dash-chart-card, .tv-mode .dash-table-card { background: #232322; border-color: #3a3936; }
.tv-mode .dash-kpi__label { font-size: 1.05rem; color: #8a8880; }
.tv-mode .dash-kpi__value { font-size: 4.2rem; color: #ffffff; }
.tv-mode .dash-kpi__hint { font-size: 1.1rem; color: #c3c2b7; }
.tv-mode .dash-kpi__live { font-size: .85rem; color: #199e70; border-color: #199e70; }
.tv-mode .dash-kpi--navy { border-left-color: #7f8fd9; }
.tv-mode .dash-kpi--success { border-left-color: #199e70; }
.tv-mode .dash-kpi--amber { border-left-color: #c98500; }
.tv-mode .dash-kpi--red { border-left-color: #e66767; }
.tv-mode .dash-card-title { font-size: 1.2rem; color: #7f8fd9; }
.tv-mode .dash-table { font-size: 1.35rem; }
.tv-mode .dash-table th { background: #8a1c21; }
.tv-mode .dash-table td { color: #ffffff; border-bottom-color: #3a3936; }
.tv-mode .dash-table tbody tr:nth-child(even) td { background: #2e2e2c; }
/* One screen, no scrolling (John, 2026-10-29): the page is exactly the viewport; the chart grid
   takes what the header and cards leave, and fitTv (dashboard-core.js) sizes the rest. */
body.tv-mode { box-sizing: border-box; height: 100vh; overflow: hidden; }
.tv-mode .dash-page { height: 100%; display: flex; flex-direction: column; }
.tv-mode [data-dashboard-root] { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tv-mode .dash-charts { flex: 1; min-height: 0; }
.tv-mode .dash-chart-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tv-mode .dash-chart-host { flex: 1; min-height: 0; }
.tv-mode .dash-table-card { overflow: hidden; }
/* A TV has no mouse: table links (e.g. warehouse → Ship Details) read as plain text. One line per
   row — fitTv shrinks the text when a table is wider than its card. */
.tv-mode .dash-table a { color: inherit; text-decoration: none; }
.tv-mode .dash-table td { white-space: nowrap; }

/* ---- Ship Details grid ---- */
.sd-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sd-count { font-weight: 700; color: var(--text-1); font-size: .9rem; }
.sd-chip { display: inline-block; border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px;
  font-size: .72rem; font-weight: 700; background: var(--chip-bg); color: var(--text-2); cursor: default; }
button.sd-chip { cursor: pointer; }
/* Links out of a Ship Details row: the order's systems as small tags set apart from the number
   (360 / ByD / NS), and UPS numbers in Tracking # as plain links. */
.sd-ext-tags { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: 1px; white-space: nowrap; }
.sd-ext-tag { display: inline-block; padding: 0 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--chip-bg);
  color: var(--brand-blue); font-size: .66rem; font-weight: 700; letter-spacing: .03em; line-height: 1.6; text-decoration: none; }
.sd-ext-tag:hover, .sd-ext-tag:focus-visible { border-color: var(--brand-blue); background: var(--card); }
/* Quick filters (TableSpec.Choices): a bar of checkbox groups between a table's title and its grid. */
.dash-choices { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; margin: 0 0 8px; padding: 6px 10px;
  background: var(--chip-bg); border-radius: 8px; }
.dash-choice { display: inline-flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--text-2); }
.dash-choice-label { font-weight: 700; color: var(--text-1); }
.dash-choice-opt { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
/* Follow-up cell and pop-up (Late Deliveries): status chip + Notes; status buttons, a note box, the history. */
.dash-table td.dash-followup { white-space: nowrap; }
.dash-followup .sd-chip { cursor: pointer; font-size: .72rem; }
.dash-followup-notes { margin-left: 8px; font-size: .78rem; }
.dash-followup-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-followup-status .sd-chip { cursor: pointer; padding: 3px 12px; font-size: .78rem; }
.dash-followup-status .sd-chip.on { outline: 2px solid var(--brand-blue); outline-offset: 1px; cursor: default; }
.dash-followup-msg { font-size: .78rem; color: var(--text-2); }
.dash-followup-add { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.dash-followup-add textarea { flex: 1; }
.dash-followup-text { white-space: pre-wrap; }
.dash-followup-change td { color: var(--text-2); font-style: italic; }
/* Pop-up tables are lists (history, tracking events), not summaries: no bold "totals" first row. */
.dash-modal .dash-table tbody tr:first-child td { font-weight: inherit; }
/* Dashboard tables (Late Deliveries): the order number on its own line, its 360 / ByD / NS tags under it. */
.dash-table .order-id-stack { display: block; margin-bottom: 3px; }
.dash-table td:has(> .order-id-stack) { white-space: nowrap; } /* each line whole: "SO id 777001", then "360 ByD" */
.dash-table td > a.sd-ext-tag { margin-right: 2px; }
/* Combined cells (TableCell.Sub, TableSpec.CsvOnly — Late Deliveries' 6-column grid): a muted second line,
   rows aligned to the top so the stacked lines read across. */
.dash-table--stacked td { vertical-align: top; }
.dash-cell-sub { margin-top: 2px; font-size: .74rem; color: var(--text-3); }
.dash-cell-sub .dash-detail-link { font-size: .78rem; }
.dash-cell-sub > .ld-date, .ld-date { font-size: .82rem; color: var(--text-1); white-space: nowrap; }
.ld-age { display: inline-block; margin-top: 2px; padding: 0 7px; border-radius: 10px; font-size: .72rem; font-weight: 700;
  white-space: nowrap; background: #fdf4e0; color: #a06e00; }
.ld-age--red { background: #fdeaea; color: var(--brand-red); }
.ld-customer { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dash-table--stacked .sd-chip { font-size: .74rem; }
.dash-table--stacked .dash-followup-notes { display: block; margin: 3px 0 0; }
.sd-track { color: var(--brand-blue); }
.sd-hit { background: #e6f6ef; color: #0d7a54; border-color: #b8e6d2; }
.sd-miss { background: #fdeaea; color: var(--brand-red); border-color: #f3c2c4; }
.sd-pending { background: #fdf4e0; color: #a06e00; border-color: #f0dca8; }
.sd-na { background: var(--chip-bg); color: var(--text-3); }
.sd-cancelled { background: var(--chip-bg); color: var(--text-2); border-color: var(--border); text-decoration: line-through; }
.sd-rush { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }
button.sd-chip.on { outline: 2px solid var(--brand-blue); }
.sd-wrap { overflow: auto; max-height: 74vh; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.sd-table { font-size: .78rem; }
.sd-table thead th { position: sticky; z-index: 2; }
.sd-table .sd-headrow th { top: 0; cursor: pointer; white-space: nowrap; user-select: none; }
.sd-table .sd-filterrow th { top: 29px; background: var(--chip-bg); padding: 3px 4px; }
.sd-table .sd-filterrow input { width: 100%; min-width: 64px; border: 1px solid var(--border); border-radius: 6px;
  font-size: .72rem; padding: 2px 5px; background: var(--card); color: var(--text-1); }
.sd-table td { white-space: nowrap; }
.sd-table tbody tr:first-child td { font-weight: inherit; } /* grid rows are data, not a totals row */
.sd-row { cursor: pointer; }
.sd-row:hover td { background: #eef2fb; }
.sd-row-miss td:first-child { box-shadow: inset 3px 0 0 var(--brand-red); }
.sd-arrow { font-size: .65rem; }
.sd-lines td { background: #f8f7f4; padding: 8px 12px; }
.sd-linetable { font-size: .75rem; width: auto; min-width: 60%; }
.sd-linetable th { background: var(--brand-blue); }

/* Ship Details column chooser */
.sd-colpick { position: relative; display: inline-block; }
.sd-colpick__panel { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 8px 10px; min-width: 200px; max-height: 60vh; overflow-y: auto; }
.sd-colpick__opt { display: block; font-size: .8rem; color: var(--text-1); padding: 2px 0; cursor: pointer; white-space: nowrap; }
.sd-colpick__opt input { margin-right: 4px; }
.sd-colpick__reset { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--brand-blue);
  font-size: .78rem; font-weight: 700; padding: 2px 0 6px; cursor: pointer; }
.sd-pct { padding-left: 6px; }
.sd-pct-good { color: var(--accent-success); }
.sd-pct-bad { color: var(--brand-red); }

/* Service Level Trend matrix cells */
.slv-good { color: var(--accent-success); font-weight: 700; }
.slv-warn { color: var(--accent-amber); font-weight: 700; }
.slv-bad { color: var(--brand-red); font-weight: 700; }
.slv-na { color: var(--text-3); }
.slv-n { color: var(--text-3); font-size: .9em; }
.tv-mode .slv-good { color: #34d399; }
.tv-mode .slv-warn { color: #fbbf24; }
.tv-mode .slv-bad { color: #f87171; }
.tv-mode .slv-na, .tv-mode .slv-n { color: #94a3b8; }
.tv-mode .slv-n { font-size: .75em; } /* the % carries across the floor; its counts are for whoever walks up */

/* Rich chart tooltip (series meta lines) */
.dash-tip { padding: 8px 10px; font-size: .78rem; color: var(--text-1); }
.dash-tip__title { font-weight: 700; margin-bottom: 4px; color: var(--text-2); }
.dash-tip__row { display: flex; align-items: center; gap: 6px; padding: 1px 0; white-space: nowrap; }
.dash-tip__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* Sortable tables (TableSpec.Sortable) */
.dash-table th.dash-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.dash-table th.dash-sortable::after { content: ' \21C5'; opacity: .45; font-size: .8em; }
.dash-table th.dash-sort-asc::after { content: ' \25B2'; opacity: 1; }
.dash-table th.dash-sort-desc::after { content: ' \25BC'; opacity: 1; }

/* Employee Performance */
.ep-emp { color: var(--brand-blue); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.ep-up { color: var(--accent-success); font-weight: 700; }
.ep-down { color: var(--brand-red); font-weight: 700; }
.ep-na { color: var(--text-3); }
.ep-tag { font-size: .7rem; padding: 1px 6px; border-radius: 8px; background: var(--chip-bg); color: var(--text-2); white-space: nowrap; }
.tv-mode .ep-emp { color: inherit; text-decoration: none; cursor: default; }
.tv-mode .ep-up { color: #34d399; }
.tv-mode .ep-down { color: #f87171; }
.tv-mode .ep-na { color: #94a3b8; }
/* TV leaderboards (tables with TvMaxRows): readable from the floor */
.tv-mode .dash-tvboard .dash-card-title { font-size: 1.25rem; }
.tv-mode .dash-tvboard .dash-table { font-size: 1.9rem; }
.tv-mode .dash-tvboard .dash-table th { font-size: .95rem; }
.tv-mode .dash-tvboard .dash-table td { padding: .4em .33em; } /* em, so it shrinks with the text when fitTv steps down */
.tv-mode .dash-tvboard.span-3 .dash-table { font-size: 1.6rem; } /* four boards across */
/* One line per person: the name column (#, Employee, ...) takes the spare width and ends in "…" rather than wrapping. */
.tv-mode .dash-tvboard .dash-table td:nth-child(2) { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---- Loading state (John, 2026-10-20): big enough that nobody clicks again ---- */
.wn-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  min-height: 320px; margin: 4px 0 16px; padding: 40px 24px; text-align: center;
  background: var(--card); border: 2px dashed var(--border); border-radius: 12px; }
.wn-loading__spinner { width: 72px; height: 72px; border-radius: 50%;
  border: 7px solid #f3d6d7; border-top-color: var(--brand-red); animation: wn-spin .9s linear infinite; }
.wn-loading__title { font-size: 1.5rem; font-weight: 700; color: var(--brand-red); text-transform: uppercase; letter-spacing: .05em; }
.wn-loading__detail { color: var(--text-2); max-width: 560px; font-size: 1rem; }
.wn-loading__elapsed { color: var(--text-3); font-size: .95rem; font-variant-numeric: tabular-nums; }
.wn-loading--error { border-color: var(--accent-amber); border-style: solid; }
.wn-loading--error .wn-loading__title { color: #9a6700; }
.wn-page-loading { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(252, 252, 251, .82); cursor: progress; }
.wn-page-loading .wn-loading { min-height: 0; max-width: 520px; border-style: solid; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); }
@keyframes wn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wn-loading__spinner { animation-duration: 2.5s; } }
.tv-mode .wn-loading { min-height: 60vh; background: #232321; border-color: #3a3936; }
.tv-mode .wn-loading__title { font-size: 2.6rem; color: #e66767; }
.tv-mode .wn-loading__detail { font-size: 1.4rem; color: #b8b6ae; max-width: 900px; }
.tv-mode .wn-loading__elapsed { font-size: 1.2rem; }

/* Last build shown while a fresh one runs in the background (PanelCache stale-while-revalidate). */
.dash-refreshing { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--brand-blue); color: #fff;
  font-weight: 700; font-size: .72rem; letter-spacing: .05em; animation: wn-pulse 1.4s ease-in-out infinite; }
@keyframes wn-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .dash-refreshing { animation: none; } }

/* Charts whose bars open a list (ChartSpec.Drill) */
.dash-chart-drill .apexcharts-bar-area { cursor: pointer; }
.dash-drill-hint { margin-left: .6rem; font-size: .72rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted, #6b7280); }

/* ---- Executive KPIs tiles (dashboard-core.js renderTile; mockup approved 2026-11-06) ----
   A thick status bar on top (12px, 16px on TV) so a miss reads at a glance; the pill says it in words. */
.wn-tile-row { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.wn-tile { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; color: var(--text-1); text-decoration: none; }
a.wn-tile:hover { color: var(--text-1); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.wn-tile__bar { height: 12px; background: #c9c7c0; flex: none; }
.wn-tile--met .wn-tile__bar { background: var(--accent-success); }
.wn-tile--below .wn-tile__bar { background: var(--accent-amber); }
.wn-tile--tripped .wn-tile__bar { background: var(--brand-red); }
.wn-tile__body { padding: 14px 18px 12px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.wn-tile__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.wn-tile__name { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wn-tile__pill { flex: none; font-size: .66rem; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px;
  white-space: nowrap; color: #52514e; background: #efeee9; }
.wn-tile--met .wn-tile__pill { color: #0d6644; background: #e2f3ea; }
.wn-tile--below .wn-tile__pill { color: #7a4f00; background: #fcefd2; }
.wn-tile--tripped .wn-tile__pill { color: #fff; background: var(--brand-red); }
.wn-tile__owner { font-size: .75rem; color: var(--text-2); margin-top: -4px; }
.wn-tile__main { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.wn-tile__value { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.wn-tile__unit { font-size: .9rem; font-weight: 400; color: var(--text-2); }
.wn-tile__nums { display: grid; grid-template-columns: auto auto; column-gap: 10px; row-gap: 2px; margin: 0; font-size: .75rem; text-align: right; }
.wn-tile__nums dt { font-weight: 400; color: var(--text-2); }
.wn-tile__nums dd { margin: 0; font-weight: 700; }
.wn-tile__extra { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; padding-top: 4px; border-top: 1px dotted var(--border); color: var(--text-2); }
.wn-tile__extra b { color: var(--text-1); }
.wn-tile__spark { display: block; width: 100%; height: auto; overflow: visible; }
.wn-tile__band { fill: var(--brand-red); fill-opacity: .07; }
.wn-tile__goal { stroke: #8a8880; stroke-width: 1.2; stroke-dasharray: 4 3; }
.wn-tile__line { fill: none; stroke: var(--brand-blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wn-tile__miss { fill: var(--brand-red); }
.wn-tile__last { fill: var(--brand-blue); stroke: #fff; stroke-width: 2; }
.wn-tile__trigger { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-2); }
.wn-tile__dots { display: inline-flex; gap: 3px; flex: none; }
.wn-tile__dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #cfccc4; box-sizing: border-box; }
.wn-tile__dot.on { border: 0; background: var(--accent-amber); }
.wn-tile--tripped .wn-tile__dot.on { background: var(--brand-red); }
.wn-tile__empty { border: 1.5px dashed var(--border); border-radius: 8px; padding: 12px; font-size: .82rem; color: var(--text-2); flex: 1; }
.wn-tile__empty-title { font-weight: 700; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.wn-tile__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; margin-top: auto; border-top: 1px solid var(--grid-line); }
.wn-tile__source { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); background: var(--chip-bg); border-radius: 4px; padding: 2px 6px; }
.wn-tile__more { font-size: .8rem; font-weight: 700; color: var(--brand-blue); }
/* Simple view: colour, name, a bigger value, goal and trend only. */
body.wn-view-simple .wn-x { display: none; }
body.wn-view-simple .wn-tile-row { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
body.wn-view-simple .wn-tile__value { font-size: 3.6rem; }
body.wn-view-simple .wn-tile__main { flex-direction: column; align-items: flex-start; }
body.wn-view-simple .wn-tile__nums { text-align: left; }
.tv-mode .wn-tile { background: #232322; border-color: #3a3936; color: #fff; }
.tv-mode .wn-tile__bar { height: 16px; }
.tv-mode .wn-tile__name, .tv-mode .wn-tile__nums dd, .tv-mode .wn-tile__extra b { color: #fff; }
.tv-mode .wn-tile__owner, .tv-mode .wn-tile__nums dt, .tv-mode .wn-tile__trigger, .tv-mode .wn-tile__extra { color: #c3c2b7; }
.tv-mode .wn-tile__value { font-size: 3.4rem; }
.tv-mode .wn-tile__foot { display: none; }
.tv-mode .wn-tile-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
