@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ─── Design tokens ──────────────────────────────────────── */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f2f0ec;
  --surface-3: #e8e5df;
  --border: #d6d2ca;
  --border-strong: #b8b3aa;

  --text: #1a1815;
  --text-2: #4a4640;
  --text-3: #7a756e;

  --accent: #c84b2f;
  --accent-hover: #a83a20;
  --accent-light: #fdf1ee;
  --accent-border: #f0c4b8;

  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-light: #eff6ff;
  --blue-border: #bfdbfe;

  --green: #15803d;
  --green-light: #f0fdf4;
  --green-border: #bbf7d0;

  --amber: #b45309;
  --amber-light: #fffbeb;
  --amber-border: #fde68a;

  --red: #dc2626;
  --red-light: #fef2f2;
  --red-border: #fecaca;

  --cyan: #0e7490;
  --cyan-light: #ecfeff;
  --cyan-border: #a5f3fc;

  --shadow-sm: 0 1px 3px rgba(26,24,21,0.08);
  --shadow: 0 4px 16px rgba(26,24,21,0.08);
  --shadow-lg: 0 8px 32px rgba(26,24,21,0.12);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
}

/* ─── Reset ──────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  padding: 0 0 64px;
}

/* ─── Topbar ─────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247,246,243,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Single-row main bar — brand + nav */
.topbar-main {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Optional second row for page controls (dashboard, planner, pds diary) */
.topbar-controls-row {
  padding: 10px 0 12px;
  border-top: 1px solid var(--border);
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── Brand ──────────────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: white;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.brand-sep {
  width: 1px;
  height: 16px;
  background: var(--border-strong);
  margin: 0 4px;
}

.page-title {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

/* ─── Nav ────────────────────────────────────────────────── */

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link.active { background: var(--accent-light); color: var(--accent); }

/* ─── Topbar pill controls ───────────────────────────────── */

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}

.ctrl-label {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.ctrl-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  width: 5em;
  padding: 0;
}

.ctrl-select {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  min-width: 110px;
  appearance: none;
}

.ctrl-select option { background: var(--surface); }

.status-text {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  padding: 0 4px;
}

/* ─── Layout ─────────────────────────────────────────────── */

/* Full-width container used by dashboard/planner pages */
.container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-body { padding-top: 20px; }

/* Narrower container used by base/staff profile pages */
.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ─── Page Header ────────────────────────────────────────── */

.page-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}

h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.subtitle {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
}

/* ─── Cards ──────────────────────────────────────────────── */

/* Card style used by base/staff profile */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

/* Card style used by dashboard/planner (no padding — content manages its own) */
.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  gap: 12px;
  flex-wrap: wrap;
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.section-heading {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.section-meta {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ─── Controls Row (base/staff profile) ─────────────────── */

.controls-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.controls-card { background: var(--surface); }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 200px;
}

.field-action {
  min-width: 140px;
}

.field-action .btn {
  width: 100%;
  justify-content: center;
  height: 38px;
}

.field-grow { flex: 1; }

label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

select,
input[type="text"],
input[type="number"] {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  outline: none;
}

/* select:focus,
input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,75,47,0.1);
} */

select:focus,
input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: none;
  background: var(--surface);
}

select:disabled,
input[type="text"]:disabled {
  background: var(--surface-2);
  color: var(--text-3);
  cursor: not-allowed;
}

.location-meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ─── Toolbar ────────────────────────────────────────────── */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Buttons ────────────────────────────────────────────── */

/* Pill-style buttons (dashboard/planner) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn:disabled, .btn.nav-disabled { opacity: 0.4; pointer-events: none; }

.btn.primary,
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn.primary:hover,
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Rectangular buttons (base/staff profile) */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  height: 36px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  background: var(--surface);
  color: var(--text-2);
  text-decoration: none;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-primary {
  border-radius: var(--radius-sm);
  height: 36px;
  padding: 0 14px;
}

.btn-primary:disabled,
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── Badge ──────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  height: 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* ─── Table ──────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  margin: 0 -20px -20px;
  border-top: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  white-space: nowrap;
}

tbody td {
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  vertical-align: middle;
  font-size: 13px;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

tbody tr.unsaved-row { background: var(--amber-light); }
tbody tr.unsaved-row td { border-bottom-color: var(--amber-border); }

.empty-cell {
  text-align: center;
  color: var(--text-3);
  padding: 40px !important;
  font-size: 13px;
}

/* ─── Row Controls ───────────────────────────────────────── */

.row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-status { font-size: 12px; font-family: var(--font-mono); }
.row-status.success { color: var(--green); }
.row-status.error   { color: var(--red); }
.row-status.pending { color: var(--amber); }

.current-week {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

/* ─── Inputs within table ────────────────────────────────── */

.edit-input { min-width: 130px; height: 32px !important; font-size: 13px !important; }
.employee-number-input { min-width: 110px; }
table select { height: 32px; font-size: 13px; min-width: 120px; }

/* ─── Sort Header ────────────────────────────────────────── */

.sort-header {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sort-header:hover { color: var(--text); }
.sort-indicator { font-size: 10px; line-height: 1; min-width: 10px; }

/* ─── Muted ──────────────────────────────────────────────── */

.muted { color: var(--text-3); font-size: 13px; }

/* ─── Roster Template ────────────────────────────────────── */

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.week-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.week-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.day-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.day-row:last-of-type { border-bottom: none; }
.day-name { font-weight: 500; font-size: 13px; color: var(--text-2); }
.day-notes { margin-top: 2px; font-size: 12px; color: var(--text-3); }

/* ─── Legend / Dots ──────────────────────────────────────── */

.legend { display: flex; gap: 12px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot.info  { background: var(--cyan); }
.dot.good  { background: var(--green); }
.dot.warn  { background: var(--amber); }

/* ─── Stats grid (dashboard) ─────────────────────────────── */

.stats-wrap { padding: 16px 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(160px,1fr)); gap: 10px; }

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card.accent { border-color: var(--accent-border); background: var(--accent-light); }
.stat-card.cyan   { border-color: var(--cyan-border);   background: var(--cyan-light); }
.stat-card.green  { border-color: var(--green-border);  background: var(--green-light); }
.stat-card.amber  { border-color: var(--amber-border);  background: var(--amber-light); }
.stat-card.subtle { border-style: dashed; }

.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); font-family: var(--font-mono); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-meta  { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }

/* ─── Planner calendar (planner2 / pds_planner) ─────────── */

.planner-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.grid {
  display: grid;
  /* 5 weekday cols flex equally; 2 weekend cols are narrower.
     No fixed min-width so Mon–Fri are always fully visible on laptop screens. */
  grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, 0.55fr));
}

.dow {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.dow.weekend { color: var(--border-strong); }

.cell {
  min-height: 145px;
  padding: 8px 8px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
}

.grid > :nth-child(7n) { border-right: none; }
.blank { background: var(--surface-2); opacity: 0.7; }
.cell.weekend { background: var(--surface-2); }
.cell.today { background: var(--accent-light); box-shadow: inset 0 2px 0 var(--accent); }
.cell.today .dayNum { background: var(--accent); border-color: var(--accent); color: white; }

.cellTop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

.dayNum {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

.iso {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Dashboard week grid ────────────────────────────────── */

.week-grid {
  display: grid;
  /* 5 weekday cols flex equally; 2 weekend cols are narrower.
     No fixed min-width so Mon–Fri are always fully visible on laptop screens. */
  grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, 0.55fr));
}

.week-grid .dow {
  border-right: 1px solid var(--border);
}

.week-grid .dow:last-child { border-right: none; }

.dow-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.dow-date { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.dow-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); font-size: 11px; color: var(--text-2); }

.week-grid .cell {
  min-height: 240px;
  padding: 8px 8px 10px;
  border-right: 1px solid var(--border);
  border-bottom: none;
}

.week-grid .cell:last-child { border-right: none; }

/* ─── Planner items ──────────────────────────────────────── */

.items { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.item {
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  min-width: 0;
}

.item.event-cap    { border-color: var(--accent-border); background: var(--accent-light); }
.item.event-safety { border-color: var(--cyan-border);   background: var(--cyan-light); }

.item .who   { font-weight: 600; font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .event { margin-top: 2px; font-size: 11px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta  { margin-top: 4px; font-size: 10px; color: var(--text-3); font-family: var(--font-mono); }

.unassigned-day,
.empty-day {
  margin-top: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--text-3);
  font-size: 11px;
  text-align: center;
}

.week-grid .empty-day { padding: 16px 12px; }

/* ─── Pill selects (planner2) ────────────────────────────── */

.pillRow { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; min-width: 0; }

.pillSelect {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  min-width: 0;
  flex: 1 1 160px;
  max-width: 100%;
}

.pillSelect .k { font-size: 10px; color: var(--text-3); white-space: nowrap; flex: 0 0 auto; font-family: var(--font-mono); }
.pillSelect select { flex: 1 1 auto; min-width: 0; color: var(--text); background: transparent; border: none; border-radius: 999px; padding: 3px 20px 3px 4px; font-family: var(--font-sans); font-size: 11px; font-weight: 500; outline: none; appearance: none; cursor: pointer; height: auto; width: auto; }
.pillSelect select:disabled { opacity: 0.5; cursor: not-allowed; }
.pillSelect select option { background: var(--surface); }
.pillSelect .chev { position: absolute; right: 8px; width: 10px; height: 10px; opacity: 0.5; pointer-events: none; }

.pillSelect.good { border-color: var(--green-border); background: var(--green-light); }
.pillSelect.warn { border-color: var(--amber-border); background: var(--amber-light); }
.pillSelect.info { border-color: var(--cyan-border);  background: var(--cyan-light); }

/* ─── Staff Profile search ───────────────────────────────── */

.search-area { position: relative; }

.search-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.search-row .field { flex: 1; }

.results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.result-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}

.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--surface-2); }
.result-item strong { font-weight: 600; }

.search-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.detail-field {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.detail-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.detail-field div {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ─── Utility ────────────────────────────────────────────── */

.hidden { display: none !important; }
.loading { opacity: 0.6; pointer-events: none; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.pill.yes { background: var(--green-light); color: var(--green); border-color: var(--green-border); }
.pill.no  { background: var(--red-light);   color: var(--red);   border-color: var(--red-border); }

.meta{
  font-size:12px;
  opacity:.8;
  margin-top:2px;
}


/* ─── Toast ──────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-family: var(--font-mono);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  max-width: calc(100% - 32px);
  white-space: nowrap;
}

.toast.show { opacity: 1; }
.toast.error { background: #7f1d1d; border-color: #991b1b; color: white; }

/* ─── Scrollbar ──────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px)  { .stats-grid { grid-template-columns: 1fr; } .pillSelect { flex: 1 1 100%; } }
@media (max-width: 600px)  { .day-row { grid-template-columns: 1fr; } }