/* fieldpost. shared stylesheet. Dark-first control-room dispatch tool.
   Light mode via prefers-color-scheme. Responsive to ~380px. */

:root {
  /* Dark, default */
  --base: #14161A;
  --surface: #1B1E24;
  --surface-2: #22262E;
  --ink: #ECEFF2;
  --muted: #9AA1AB;
  --hairline: rgba(255, 255, 255, .10);
  --hairline-2: rgba(255, 255, 255, .06);

  --primary: #A3E635;          /* high-vis lime, used sparingly */
  --primary-ink: #14161A;      /* text sitting on the lime */
  --green: #35C07A;
  --amber: #F0A93B;
  --red: #F0574A;
  --blue: #4A8CFF;

  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 16px;
  --sidebar-w: 236px;
  --topbar-h: 60px;

  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);

  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --base: #F5F6F8;
    --surface: #FFFFFF;
    --surface-2: #EEF0F3;
    --ink: #14161A;
    --muted: #5A616B;
    --hairline: rgba(20, 22, 26, .10);
    --hairline-2: rgba(20, 22, 26, .06);

    --primary: #5FA30E;        /* darker lime, legible on white */
    --primary-ink: #FFFFFF;
    --green: #1E9E5E;
    --amber: #C9820F;
    --red: #D23A2C;
    --blue: #2F6FE0;

    --shadow: 0 1px 2px rgba(20,22,26,.06), 0 8px 24px rgba(20,22,26,.08);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- App shell ---------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brandmark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--hairline-2);
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.wordmark .dot { color: var(--primary); }

.company {
  padding: 2px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.company .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}
.company .sub { font-size: 12px; color: var(--muted); }
.chip-plan {
  align-self: flex-start;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 3px 8px;
  border-radius: 999px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 10px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--ink);
  font-weight: 600;
}
.nav a[aria-current="page"] svg { color: var(--primary); }
.nav a.muted { opacity: .72; }

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--hairline-2);
  padding-top: 14px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* Main + topbar */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--base) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 var(--gutter);
}
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .spacer { flex: 1; }

.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 13px;
  min-width: 200px;
  color: var(--muted);
}
.searchbox svg { width: 15px; height: 15px; flex: none; }
.searchbox input {
  background: none;
  border: none;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  width: 100%;
  outline: none;
}
.searchbox input::placeholder { color: var(--muted); }

.shift-ctl {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--ink);
  background: var(--surface);
  white-space: nowrap;
}
.shift-ctl svg { width: 14px; height: 14px; color: var(--muted); }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .badge {
  position: absolute; top: -3px; right: -3px;
  width: 15px; height: 15px; border-radius: 999px;
  background: var(--red); color: #fff;
  font-family: var(--font-mono); font-size: 9px;
  display: grid; place-items: center;
  border: 2px solid var(--base);
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 22%, var(--surface-2));
  color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--hairline);
}

.hamburger {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  place-items: center;
}
.hamburger svg { width: 19px; height: 19px; }

/* Content column */
.content {
  padding: 22px var(--gutter) 60px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.page-head { margin-bottom: 20px; }
.page-head .eyebrow { display: block; margin-bottom: 7px; }
.page-head h2 { font-size: 26px; }
.page-head p { color: var(--muted); margin: 6px 0 0; font-size: 14px; max-width: 60ch; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
}
.section-head h3 { font-size: 16px; }
.section-head .link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ---------- Cards / surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 16px; }

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 15px 16px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 2px;
  background: var(--accent, var(--muted));
}
.kpi.tone-ink { --accent: var(--primary); }
.kpi.tone-blue { --accent: var(--blue); }
.kpi.tone-green { --accent: var(--green); }
.kpi.tone-amber { --accent: var(--amber); }
.kpi .k-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi .k-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1.05;
  margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}
.kpi .k-note { font-size: 12px; color: var(--muted); }

/* ---------- Status pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.pill.st-unassigned { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); border-color: color-mix(in srgb, var(--amber) 34%, transparent); }
.pill.st-scheduled  { color: var(--muted); background: var(--surface-2); border-color: var(--hairline); }
.pill.st-enroute    { color: var(--blue); background: color-mix(in srgb, var(--blue) 15%, transparent); border-color: color-mix(in srgb, var(--blue) 36%, transparent); }
.pill.st-onsite     { color: var(--primary); background: color-mix(in srgb, var(--primary) 15%, transparent); border-color: color-mix(in srgb, var(--primary) 38%, transparent); }
.pill.st-completed  { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); border-color: color-mix(in srgb, var(--green) 34%, transparent); }
.pill.st-invoiced   { color: var(--muted); background: transparent; border-color: var(--hairline); }
.pill.st-urgent     { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); border-color: color-mix(in srgb, var(--red) 34%, transparent); }

/* ---------- Filter chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
  display: inline-flex; align-items: center; gap: 7px;
}
.chip:hover { color: var(--ink); }
.chip .count { color: var(--muted); }
.chip[aria-pressed="true"] {
  color: var(--primary-ink);
  background: var(--primary);
  border-color: var(--primary);
}
.chip[aria-pressed="true"] .count { color: var(--primary-ink); opacity: .8; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
table.data thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
}
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-2);
  font-size: 13.5px;
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .jobid { font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.cust-name { font-weight: 600; }
.muted-cell { color: var(--muted); }
.addr { color: var(--muted); font-size: 12.5px; }

.crew-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px;
  white-space: nowrap;
}
.crew-tag .swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.crew-tag.none { color: var(--muted); font-style: normal; }

.btn-mini {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--primary-ink);
  background: var(--primary);
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}
.btn-ghost {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- Dispatch overview ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Active job list rows */
.joblist { display: flex; flex-direction: column; }
.joblist .row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--hairline-2);
}
.joblist .row:last-child { border-bottom: none; }
.joblist .wo { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.joblist .who { font-weight: 600; font-size: 14px; }
.joblist .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.joblist .right { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.joblist .win { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* Crew status panel */
.crewpanel { display: flex; flex-direction: column; }
.crewpanel .c-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--hairline-2);
}
.crewpanel .c-row:last-child { border-bottom: none; }
.crew-avatar {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  color: var(--primary-ink);
  flex: none;
}
.crewpanel .c-name { font-weight: 600; font-size: 13.5px; }
.crewpanel .c-trade { font-size: 12px; color: var(--muted); }
.crewpanel .c-mid { flex: 1; min-width: 0; }
.crewpanel .c-next { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avail-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; }
.status-avail { color: var(--green); }
.status-onsite { color: var(--primary); }
.status-enroute { color: var(--blue); }
.status-off { color: var(--muted); }

/* Board / dispatch timeline (overview mini) */
.timeline {
  overflow-x: auto;
  padding-bottom: 6px;
}
.timeline-inner { min-width: 640px; }
.tl-hours {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 8px;
}
.tl-hours span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  padding: 0 0 8px 4px;
  border-left: 1px solid var(--hairline-2);
}
.tl-lane {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.tl-lane .lane-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 26px; }
.tl-track .slot {
  position: absolute; top: 0; bottom: 0;
  border-radius: 6px;
  display: flex; align-items: center;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .02em;
  color: var(--primary-ink);
  overflow: hidden;
  white-space: nowrap;
  border: 1px solid rgba(0,0,0,.18);
}

/* ---------- Schedule board (full) ---------- */
.date-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.date-strip button {
  min-width: 58px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 0;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink);
}
.date-strip .dd { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.date-strip .dn { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.date-strip button.active { background: var(--primary); border-color: var(--primary); }
.date-strip button.active .dd,
.date-strip button.active .dn { color: var(--primary-ink); }
.date-strip button.muted { opacity: .5; }

.board-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
}
.board {
  min-width: 900px;
  display: grid;
}
.board-head {
  display: grid;
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.board-head .corner {
  padding: 12px 14px;
  border-right: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.board-head .crew-col {
  padding: 11px 14px;
  border-right: 1px solid var(--hairline-2);
  display: flex; align-items: center; gap: 9px;
}
.board-head .crew-col:last-child { border-right: none; }
.board-head .cc-name { font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.board-head .cc-sub { font-size: 11px; color: var(--muted); }
.crew-swatch { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.board-body { display: grid; }
.board-row {
  display: grid;
  border-bottom: 1px solid var(--hairline-2);
  min-height: 52px;
}
.board-row:last-child { border-bottom: none; }
.board-row .time-cell {
  padding: 8px 14px;
  border-right: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: flex; align-items: flex-start;
}
.board-row .cell {
  border-right: 1px solid var(--hairline-2);
  padding: 6px;
}
.board-row .cell:last-child { border-right: none; }

.job-block {
  border-radius: 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--bl, var(--muted));
  background: color-mix(in srgb, var(--bl, var(--muted)) 12%, var(--surface-2));
  height: 100%;
}
.job-block .jb-top {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.job-block .jb-id { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.job-block .jb-title { font-size: 12px; font-weight: 600; margin: 3px 0 4px; line-height: 1.25; }
.job-block .jb-addr { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Crew cards ---------- */
.crew-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.crew-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px;
  border-top: 3px solid var(--cc, var(--muted));
}
.crew-card .cc-head { display: flex; align-items: center; gap: 12px; }
.crew-card .cc-avatar {
  width: 44px; height: 44px; border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--primary-ink); flex: none;
}
.crew-card .cc-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.crew-card .cc-trade { font-size: 12.5px; color: var(--muted); }
.crew-card .cc-body {
  margin-top: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  border-top: 1px solid var(--hairline-2);
  padding-top: 14px;
}
.crew-card .stat .s-label {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.crew-card .stat .s-val { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.crew-card .cc-next {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline-2);
  font-size: 12.5px; color: var(--muted);
}
.crew-card .cc-next strong { color: var(--ink); font-weight: 600; display: block; margin-top: 2px; }
.crew-card .cc-foot {
  margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.crew-card .cc-phone { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

.legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-bottom: 16px;
  font-size: 12px; color: var(--muted);
}
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 8px; height: 8px; border-radius: 999px; }

/* ---------- Mini charts row ---------- */
.mini-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.chart-card .ch-title { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chart-card svg { width: 100%; height: auto; display: block; margin-top: 12px; }

.stack {
  display: flex; flex-direction: column; gap: 6px; margin-top: 12px;
}
.stack .s-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.stack .s-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.stack .s-bar > span { display: block; height: 100%; border-radius: 4px; }
.stack .s-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); width: 20px; text-align: right; }

/* ---------- Footer note ---------- */
.demo-note {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline-2);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.demo-note svg { width: 14px; height: 14px; flex: none; color: var(--muted); }

/* ---------- Toast (demo feedback) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--ink);
  padding: 11px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 13px;
  display: flex; align-items: center; gap: 9px;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 15px; height: 15px; color: var(--primary); }

/* Scrim for mobile nav */
.scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 40;
}
.scrim.show { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: grid; }
  .searchbox { display: none; }
  .shift-ctl { display: none; }
}

@media (max-width: 440px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 50px; }
  .page-head h2 { font-size: 22px; }
  .kpi .k-value { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Subtle resting motion, opt-in */
@media (prefers-reduced-motion: no-preference) {
  .kpi, .crew-card, .card { animation: rise .32s ease both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .live-dot { animation: pulse 2.2s ease-in-out infinite; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
}
