:root {
  /* Brand palette — warm premium boutique */
  --sidebar-bg:    #1a1a2e;   /* deep charcoal with hint of warmth */
  --sidebar-text:  #a8a0b4;   /* muted lavender-grey */
  --sidebar-hover: rgba(201,169,110,0.08);
  --sidebar-active-bg: rgba(201,169,110,0.12);
  --sidebar-active-text: #e8d5b5; /* warm light gold */
  --sidebar-active-border: #c9a96e; /* soft gold */

  /* Content area */
  --bg:        #faf8f5;   /* warm cream */
  --white:     #ffffff;
  --border:    #e8e2d9;   /* warm sand */
  --border-md: #d4ccc0;   /* warm stone */

  /* Text */
  --text:       #2d2a26;  /* dark walnut */
  --text-light: #6b6560;  /* warm grey */
  --text-muted: #9c9490;  /* muted warm */

  /* Accent colours */
  --primary:    #c9a96e;  /* soft gold */
  --primary-dk: #b08d4f;  /* deep gold */
  --primary-lt: #fdf8ef;  /* cream gold tint */
  --green:      #5a9e6f;  /* sage green */
  --green-lt:   #edf5ef;  /* soft sage */
  --red:        #c45c5c;  /* muted rose */
  --red-lt:     #fdf0f0;  /* soft rose */
  --amber:      #d4a24c;  /* warm amber */
  --amber-lt:   #fdf6e8;  /* soft amber */

  /* Legacy aliases */
  --navy:       #1a1a2e;
  --blue:       #c9a96e;
  --light-blue: #fdf8ef;
  --gold:       #c9a96e;
  --grey:       #faf8f5;

  /* Component tokens */
  --sidebar-width: 210px;
  --shadow-sm: 0 1px 3px rgba(42,36,30,0.06), 0 1px 2px rgba(42,36,30,0.04);
  --shadow:    0 4px 6px -1px rgba(42,36,30,0.07), 0 2px 4px -1px rgba(42,36,30,0.04);
  --shadow-md: 0 10px 15px -3px rgba(42,36,30,0.08), 0 4px 6px -2px rgba(42,36,30,0.04);
  --radius:    8px;
  --radius-lg: 12px;
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --sidebar-bg:    #12101a;
  --sidebar-text:  #8a8298;
  --sidebar-hover: rgba(201,169,110,0.08);
  --sidebar-active-bg: rgba(201,169,110,0.15);
  --sidebar-active-text: #e8d5b5;
  --sidebar-active-border: #c9a96e;

  --bg:        #1a1820;
  --white:     #242230;
  --border:    #3a3644;
  --border-md: #4a4654;

  --text:       #e8e2d9;
  --text-light: #a8a0b4;
  --text-muted: #6b6578;

  --primary:    #d4b678;
  --primary-dk: #c9a96e;
  --primary-lt: rgba(201,169,110,0.12);
  --green-lt:   rgba(90,158,111,0.15);
  --red-lt:     rgba(196,92,92,0.15);
  --amber-lt:   rgba(212,162,76,0.15);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow:    0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.2);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.3);

  --navy:       #12101a;
  --blue:       #d4b678;
  --light-blue: rgba(201,169,110,0.12);
  --gold:       #d4b678;
  --grey:       #1a1820;
}
[data-theme="dark"] .data-table tbody tr:nth-child(even) td { background: #1e1c28; }
[data-theme="dark"] .data-table tbody tr:hover td { background: rgba(201,169,110,0.1) !important; }
[data-theme="dark"] .data-table tr.total-row td { background: rgba(201,169,110,0.08) !important; }
[data-theme="dark"] .flatpickr-calendar { background: #242230; border-color: #3a3644; }
[data-theme="dark"] .flatpickr-day { color: #e2e8f0; }
[data-theme="dark"] .flatpickr-day:hover { background: #334155; }
[data-theme="dark"] .flatpickr-day.selected { background: #6366f1; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: #1e293b; color: #e2e8f0; border-color: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar-header {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.logo-icon { color: #c9a96e; flex-shrink: 0; } /* soft gold */
.logo-text { display: flex; flex-direction: column; }
.logo-main { color: #f8fafc; font-weight: 700; font-size: .9rem; line-height: 1.2; letter-spacing: -.01em; }
.logo-sub { color: rgba(255,255,255,0.35); font-size: .68rem; letter-spacing: .02em; }

.nav-links { list-style: none; padding: .75rem 0; flex: 1; overflow-y: auto; }
.nav-links li { margin: 1px 0; }
.nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .15s;
  font-size: .845rem;
  font-weight: 400;
}
.nav-link:hover { background: var(--sidebar-hover); color: #e2e8f0; border-left-color: rgba(255,255,255,0.1); }
.nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
}
.nav-icon {
  flex-shrink: 0;
  opacity: .7;
  display: flex;
  align-items: center;
}
.nav-link.active .nav-icon,
.nav-link:hover .nav-icon { opacity: 1; }
.nav-icon svg { display: block; }

.sidebar-footer {
  padding: .875rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.sync-status { display: flex; align-items: center; gap: .45rem; color: rgba(255,255,255,0.4); font-size: .73rem; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.lang-btn {
  width: 100%;
  padding: .35rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: rgba(255,255,255,0.55);
  font-size: .77rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  letter-spacing: .02em;
}
.lang-btn:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }
.shutdown-btn {
  width: 100%;
  padding: .35rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: rgba(255,255,255,0.35);
  font-size: .73rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.shutdown-btn:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: #fca5a5; }

/* ── MAIN ── */
.main-content { margin-left: var(--sidebar-width); flex: 1; padding: 1.75rem 2rem; max-width: calc(100vw - var(--sidebar-width)); overflow-x: hidden; }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-header h1 { font-size: 1.5rem; color: var(--text); font-weight: 700; letter-spacing: -.02em; }
.page-sub { color: var(--text-muted); font-size: .82rem; margin-top: .15rem; }
.page-header-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.date-picker, .period-select, .date-input {
  padding: .4rem .7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .845rem;
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.date-picker:focus, .period-select:focus, .date-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: .5rem;
  background: var(--white);
}
.card-header h3 { font-size: .9rem; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.card-header-controls { display: flex; gap: 1rem; align-items: center; font-size: .845rem; }
.card-header-controls select { padding: .3rem .5rem; border: 1px solid var(--border); border-radius: 5px; background: var(--white); }
.card-body { padding: 1.25rem; }

/* ── SECTION HEADER ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.section-header h2 { font-size: 1rem; font-weight: 600; color: var(--text); letter-spacing: -.01em; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .875rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: .845rem;
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
/* Primary — indigo solid */
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(99,102,241,0.3); }
.btn-primary:hover { background: var(--primary-dk); box-shadow: 0 2px 4px rgba(99,102,241,0.35); }

/* Secondary — light grey */
.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--bg); border-color: var(--border-md); }

/* Outline — indigo border */
.btn-outline { background: var(--white); border: 1px solid var(--border); color: var(--text-light); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }

/* Add / ghost — replaces dashed btn-add */
.btn-add { background: var(--primary-lt); color: var(--primary); border: 1px solid #c7d2fe; }
.btn-add:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-add-sm { background: var(--primary-lt); color: var(--primary); border: 1px solid #c7d2fe; padding: .28rem .6rem; font-size: .78rem; border-radius: 5px; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; font-weight: 500; transition: all .15s; }
.btn-add-sm:hover { background: var(--primary); color: #fff; }

/* Danger */
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-danger-sm { background: var(--red-lt); color: var(--red); border: 1px solid #fecaca; padding: .28rem .6rem; font-size: .78rem; border-radius: 5px; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; font-weight: 500; transition: all .15s; }
.btn-danger-sm:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Delete row — icon button */
.btn-del-row { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .95rem; padding: .2rem .35rem; border-radius: 4px; line-height: 1; transition: all .15s; }
.btn-del-row:hover { color: var(--red); background: var(--red-lt); }

/* Sizes */
.btn-sm { padding: .3rem .6rem; font-size: .78rem; }
.btn-lg { padding: .6rem 1.25rem; font-size: .9rem; }

/* ── TABLES ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .845rem; }
.data-table th {
  background: var(--bg);
  color: var(--text-light);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .6rem .875rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: .6rem .875rem; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: #fafbfc; }
.data-table tbody tr:hover td { background: var(--primary-lt) !important; }
.data-table tr.total-row td { background: #fffbf0 !important; font-weight: 600; border-top: 2px solid var(--amber); border-bottom: none; }
.data-table tr.row-cancelled td { opacity: .5; text-decoration: line-through; }
.data-table tr.row-inactive td { opacity: .55; }
.money { font-variant-numeric: tabular-nums; text-align: right; }
.data-table th.money { text-align: right; }
.loading { text-align: center; color: var(--text-muted); padding: 2.5rem !important; }
.empty { text-align: center; color: var(--text-muted); padding: 2.5rem !important; font-style: italic; font-size: .875rem; }

/* ── YoY STRIP TABLE ── */
.yoy-table { width: 100%; border-collapse: collapse; font-size: .845rem; }
.yoy-table th { color: var(--text-muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; padding: .4rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.yoy-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); color: var(--text); }
.yoy-table tbody tr:last-child td { border-bottom: none; }
.yoy-table tbody tr:hover td { background: var(--bg); }
/* dashboard.js emits: <span class="yoy-delta up"> or <span class="yoy-delta down">
   so selectors must target .yoy-delta.up not standalone .yoy-up */
.yoy-delta.up   { color: #3d8b56; font-weight: 600; }
.yoy-delta.down { color: var(--red); font-weight: 600; }

/* ── CHART CARDS ── */
.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.chart-card.large { }
.chart-card.small { }
.chart-card.full { grid-column: 1 / -1; }
@media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; } }

/* ── KPI CARDS ── */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1rem .875rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  text-align: center;
  min-width: 0;
  transition: box-shadow .15s;
}
.kpi-card:hover { box-shadow: var(--shadow); }
.kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  margin: 0 auto .5rem;
  background: var(--primary-lt);
  color: var(--primary);
}
.kpi-icon svg { display: block; }
.kpi-val { font-size: 1.2rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-label { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; font-weight: 500; letter-spacing: .01em; text-transform: uppercase; }
.kpi-sub { font-size: .69rem; color: var(--text-muted); margin-top: .15rem; }
/* dashboard.js does: el.className = 'kpi-yoy ' + d.cls  (cls = 'up'|'down'|'')
   so selectors must be direct class combos, NOT descendant selectors */
.kpi-yoy      { margin-top: .35rem; min-height: 1.4em; display: block; }
.kpi-yoy.up   { display: inline-flex; align-items: center; gap: .2rem; background: var(--green-lt); color: #3d8b56; font-size: .72rem; font-weight: 600; padding: .15rem .45rem; border-radius: 20px; }
.kpi-yoy.down { display: inline-flex; align-items: center; gap: .2rem; background: var(--red-lt);   color: var(--red);    font-size: .72rem; font-weight: 600; padding: .15rem .45rem; border-radius: 20px; }
.kpi-yoy.flat { display: inline-flex; align-items: center; gap: .2rem; background: var(--bg);       color: var(--text-muted); font-size: .72rem; font-weight: 500; padding: .15rem .45rem; border-radius: 20px; }
.kpi-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.kpi-mini { background: var(--bg); border-radius: 8px; padding: .75rem; text-align: center; }
.kpi-mini-val { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.kpi-mini-label { font-size: .75rem; color: var(--text-muted); }

/* ── Insights: Staffing Forecast ───────────────────────────────────────── */
.forecast-month-label { font-size: .75rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .06em; margin: 1rem 0 .4rem; }
.forecast-month-label:first-child { margin-top: 0; }
.forecast-row { display: grid; grid-template-columns: 8.5rem 1fr 14rem 16rem; align-items: center; gap: .75rem; padding: .7rem 1rem; border-left: 4px solid; border-radius: 0 6px 6px 0; margin-bottom: .4rem; }
.forecast-date { font-weight: 600; font-size: .85rem; color: #374151; white-space: nowrap; }
.forecast-event { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.forecast-event-name { font-weight: 500; font-size: .9rem; color: #111827; }
.forecast-tag { font-size: .68rem; padding: .15rem .45rem; border-radius: 10px; font-weight: 600; letter-spacing: .02em; }
.forecast-tag.holiday  { background: #e0e7ff; color: #3730a3; }
.forecast-tag.boost    { background: #d1fae5; color: #065f46; }
.forecast-tag.festival { background: #fce7f3; color: #9d174d; }
.forecast-peak-col { display: flex; flex-direction: column; gap: .25rem; }
.forecast-bar-wrap { display: flex; align-items: center; gap: .5rem; }
.forecast-bar-track { position: relative; width: 80px; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.forecast-bar-norm  { position: absolute; top: 0; left: 0; height: 100%; background: #d1d5db; border-radius: 4px; }
.forecast-bar-fill  { position: absolute; top: 0; left: 0; height: 100%; border-radius: 4px; transition: width .3s; }
.forecast-bar-label { font-size: .82rem; font-weight: 700; color: #111827; white-space: nowrap; }
.forecast-jobs-note { font-size: .76rem; color: #6b7280; }
.forecast-baseline  { color: #9ca3af; }
.forecast-est { font-size: .68rem; background: #f3f4f6; border-radius: 3px; padding: 0 .3rem; color: #9ca3af; cursor: help; }
.forecast-rec { display: flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600; color: #111827; }
.forecast-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
@media (max-width: 960px) {
  .forecast-row { grid-template-columns: 1fr 1fr; row-gap: .4rem; }
  .forecast-peak-col, .forecast-rec { grid-column: span 1; }
}

/* ── Insights: Staffing Planner ─────────────────────────────────────────── */
.planner-grid { display: flex; flex-direction: column; gap: .35rem; }
.planner-header-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.planner-col-head { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-light); text-align: center; padding: .2rem 0; }
.planner-week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.planner-cell { border-radius: 8px; padding: .55rem .65rem; min-height: 5.5rem; position: relative; border: 1.5px solid; font-size: .8rem; }
.planner-cell-empty { border: 1.5px solid transparent; }
.planner-ok    { background: #f0fdf4; border-color: #86efac; }
.planner-amber { background: #fffbeb; border-color: #fcd34d; }
.planner-red   { background: #fff1f2; border-color: #fca5a5; }
.planner-date  { font-size: .72rem; font-weight: 700; color: var(--text-light); margin-bottom: .2rem; }
.planner-event { font-size: .7rem; color: #7c3aed; font-weight: 600; margin-bottom: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planner-jobs  { font-size: .75rem; color: var(--text-light); margin-bottom: .25rem; }
.planner-staff { font-size: .78rem; }
.planner-norm  { color: var(--text-light); font-size: .72rem; }
.planner-badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: .15rem .4rem; border-radius: 99px; margin-top: .3rem; }
.planner-badge-amber { background: #fef3c7; color: #92400e; }
.planner-badge-red   { background: #fee2e2; color: #991b1b; }
.planner-legend { display: flex; align-items: center; gap: 1.25rem; margin-top: .85rem; font-size: .75rem; color: var(--text-light); flex-wrap: wrap; }
.planner-legend-item { display: flex; align-items: center; gap: .35rem; }
.planner-dot-ok    { width: 10px; height: 10px; border-radius: 50%; background: #86efac; display: inline-block; }
.planner-dot-amber { width: 10px; height: 10px; border-radius: 50%; background: #fcd34d; display: inline-block; }
.planner-dot-red   { width: 10px; height: 10px; border-radius: 50%; background: #fca5a5; display: inline-block; }
.planner-legend-note { margin-left: auto; font-style: italic; }

/* Past/today/closed day styles */
.planner-past { background: #f0f4f8; border-color: #cbd5e1; }
.planner-cell-closed { background: #f1f5f9; border-color: #e2e8f0; opacity: 0.6; }
.planner-today { border-color: var(--primary) !important; border-width: 2.5px; box-shadow: 0 0 0 1px var(--primary); }

[data-theme="dark"] .planner-past { background: #1e293b; border-color: #475569; }
[data-theme="dark"] .planner-cell-closed { background: #1a2332; border-color: #334155; opacity: 0.6; }
[data-theme="dark"] .planner-ok { background: rgba(134,239,172,0.08); border-color: rgba(134,239,172,0.3); }
[data-theme="dark"] .planner-amber { background: rgba(252,211,77,0.08); border-color: rgba(252,211,77,0.3); }
[data-theme="dark"] .planner-red { background: rgba(252,165,165,0.08); border-color: rgba(252,165,165,0.3); }

/* ── Insights: School Holidays ──────────────────────────────────────────── */
.school-hols-block { margin-bottom: 1.5rem; }
.school-hols-header { font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-light); margin-bottom:.5rem; }
.school-hol-row { display:flex; align-items:center; gap:.75rem; padding:.35rem 0; border-bottom:1px solid var(--border); font-size:.82rem; }
.school-hol-name { font-weight:600; min-width:11rem; }
.school-hol-range { color:var(--text-light); min-width:10rem; }
.school-hol-impact { margin-left:auto; font-weight:600; }

/* ── Insights: Heatmap ─────────────────────────────────────────────────── */
.heatmap-table { border-collapse: separate; border-spacing: 3px; width: 100%; }
.heatmap-table th { font-size: .75rem; padding: .3rem .5rem; text-align: center; color: var(--text-light); font-weight: 600; }
.heatmap-table .hour-label { font-size: .73rem; color: var(--text-light); padding: .3rem .75rem .3rem 0; white-space: nowrap; text-align: right; }
.heat-cell { width: 72px; height: 34px; text-align: center; font-size: .72rem; border-radius: 5px; cursor: default; transition: outline .1s; }
.heat-cell:hover { outline: 2px solid var(--blue); }
.heat-cell.empty { background: #f0f4f8; }
.heatmap-legend { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; justify-content: flex-end; font-size: .72rem; color: var(--text-light); }
.legend-gradient { width: 80px; height: 10px; border-radius: 5px; background: linear-gradient(to right, #f0f4f8, #4d9fd0, #1e3a5c); }
.card-sub { font-size: .78rem; font-weight: 400; color: var(--text-light); margin-left: .5rem; }

.charts-row .card { margin-bottom: 0; }
.chart-half { flex: 1; min-width: 0; }

/* ── HOME ── */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.quick-action-card { background: var(--white); border-radius: var(--radius); padding: 1.5rem 1.25rem; box-shadow: var(--shadow); cursor: pointer; transition: all .15s; text-align: center; border: 2px solid transparent; }
.quick-action-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
.qa-icon { font-size: 2rem; margin-bottom: .5rem; }
.qa-title { font-weight: 700; color: var(--navy); font-size: .95rem; }
.qa-sub { font-size: .78rem; color: var(--text-light); margin-top: .25rem; }
.home-bottom { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
@media(max-width:900px) { .home-bottom { grid-template-columns: 1fr; } }

/* ── SECTION HEADERS ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.section-header h2 { font-size: 1.1rem; color: var(--navy); font-weight: 600; }
.section-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; border-radius: 12px; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; margin-left: .5rem; }

/* ── THERAPIST PANELS ── */
.therapist-panels-grid { display: flex; flex-direction: column; gap: 1rem; }
.therapist-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border-left: 4px solid var(--blue); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: var(--light-blue); flex-wrap: wrap; gap: .5rem; }
.panel-header-left { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.panel-header-right { display: flex; gap: .75rem; align-items: center; }
.therapist-select { padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px; font-size: .88rem; font-weight: 600; background: var(--white); min-width: 150px; }
.room-select { padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; background: var(--white); }
.tips-label { font-size: .85rem; color: var(--text); }
.tips-input { width: 60px; padding: .3rem .4rem; border: 1px solid var(--border); border-radius: 5px; font-size: .85rem; }
.jobs-table { width: 100%; }
.jobs-table input[type=time], .jobs-table input[type=number], .jobs-table select { padding: .3rem .4rem; border: 1px solid var(--border); border-radius: 4px; font-size: .82rem; width: 100%; background: var(--white); }
.jobs-table input[type=number] { min-width: 65px; }
.jobs-table .jr-amount, .jobs-table .jr-girl, .jobs-table .jr-shop { min-width: 70px; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem; background: #f8fafc; border-top: 1px solid var(--border); }
.panel-totals { font-size: .83rem; color: var(--text-light); }
.panel-totals strong { color: var(--navy); }

/* ── BOOKINGS TABLE ── */
.bookings-table input[type=text], .bookings-table input[type=time], .bookings-table input[type=number], .bookings-table select { padding: .3rem .4rem; border: 1px solid var(--border); border-radius: 4px; font-size: .82rem; width: 100%; background: var(--white); }

/* ── CASH RECONCILIATION ── */
.cash-recon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; padding: 1.25rem; }
.recon-block h4 { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .75rem; }
.recon-row { display: flex; align-items: center; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid var(--border); gap: .75rem; font-size: .845rem; }
.recon-row:last-child { border-bottom: none; }
.recon-row label { color: var(--text-light); flex: 1; }
.recon-calc { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recon-input { width: 80px; padding: .25rem .45rem; border: 1px solid var(--border); border-radius: 5px; font-size: .845rem; text-align: right; background: var(--white); color: var(--text); outline: none; transition: border-color .15s; }
.recon-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,0.12); }
.total-row label { font-weight: 600; color: var(--text); }
.total-val { font-weight: 700; color: var(--text); font-size: 1rem; }
.notes-row .recon-input { width: 180px; }

/* ── SAVE STATUS ── */
.save-status { padding: .6rem 1rem; border-radius: 6px; font-weight: 500; font-size: .88rem; margin-bottom: 1rem; }
.save-status.success { background: #d4edda; color: #155724; }
.save-status.error { background: #f8d7da; color: #721c24; }
.save-status.info  { background: #cce5ff; color: #004085; }
.recon-readonly { background: #f3f4f6 !important; color: #6b7280 !important; cursor: default; }
.hidden { display: none !important; }

/* ── TABS ── (reports.html uses class="tab-nav" + class="tab-btn" — keep those names) */
.tab-nav { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn {
  padding: .6rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: .845rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── FILTER CARD ── */
.filter-card { padding: 1rem 1.25rem !important; }
.filter-row { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: .3rem; }
.filter-group label { font-size: .78rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .04em; }

/* ── THERAPIST PAGE ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media(max-width:1000px) { .two-col { grid-template-columns: 1fr; } }
.add-form { padding: .75rem 1.25rem; background: var(--light-blue); display: flex; gap: .5rem; align-items: center; border-bottom: 1px solid var(--border); }
.text-input { padding: .45rem .75rem; border: 1px solid var(--border); border-radius: 6px; font-size: .88rem; flex: 1; }
.text-input-sm { padding: .3rem .5rem; border: 1px solid var(--border); border-radius: 5px; font-size: .85rem; width: 100%; }

/* ── STATUS BADGES ── */
.badge { display: inline-flex; align-items: center; padding: .2rem .55rem; border-radius: 20px; font-size: .72rem; font-weight: 600; letter-spacing: .01em; }
.badge-active   { background: var(--green-lt); color: #3d8b56; }
.badge-inactive { background: var(--bg);       color: var(--text-muted); border: 1px solid var(--border); }
.badge-primary  { background: var(--primary-lt); color: var(--primary); }
.badge-green { background: var(--green-lt); color: #3d8b56; }
.badge-grey  { background: var(--bg); color: var(--text-muted); }

/* ── FORM INPUTS (general) ── */
input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  font-family: inherit;
}
/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
input[type="date"] {
  padding: .4rem .7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .845rem;
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  outline: none;
}
input[type="date"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* ── SETTINGS ── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px,1fr)); gap: 1.25rem; }
.info-block { display: flex; flex-direction: column; gap: 1rem; }
.info-row { display: flex; flex-direction: column; gap: .3rem; }
.info-row label { font-size: .78rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; }
.info-row code { background: var(--grey); padding: .4rem .6rem; border-radius: 5px; font-size: .82rem; word-break: break-all; }
.info-note { font-size: .85rem; color: var(--text-light); line-height: 1.5; }
.pricingTable input { width: 80px; padding: .3rem .4rem; border: 1px solid var(--border); border-radius: 4px; font-size: .85rem; text-align: right; }

/* ── Daily Entry Page ─────────────────────────────────────────────────────── */
.ocr-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.ocr-overlay.hidden { display: none; }
.ocr-modal {
  background: #fff; border-radius: 10px; padding: 1.5rem;
  width: min(540px, 94vw); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.ocr-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.75rem;
}
.ocr-modal-header h3 { margin: 0; font-size: 1.15rem; }
.ocr-drop-zone {
  display: block; border: 2px dashed #adb5bd; border-radius: 8px;
  padding: 1.5rem; text-align: center; cursor: pointer; color: #555;
  transition: border-color 0.2s;
}
.ocr-drop-zone:hover { border-color: #1a3a5c; color: #1a3a5c; }
.ocr-preview {
  display: block; max-width: 100%; max-height: 260px; margin-top: 0.75rem;
  border-radius: 6px; border: 1px solid #e5e7eb; object-fit: contain;
}
.ocr-preview.hidden { display: none; }
.save-status.info { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.sara-extra {
  display: flex; align-items: center; gap: 0.5rem;
  background: #fff8e1; border-top: 1px solid #ffe082;
  padding: 0.5rem 0.75rem; font-size: 0.875rem;
}
.sara-extra.hidden { display: none; }
.sara-extra-label { font-weight: 600; color: #b45309; white-space: nowrap; }
.sara-extra input { width: 80px; }
.sara-extra select { font-size: 0.85rem; }
.sara-panel { border-color: #f59e0b; }
.recon-pt-sel { font-size: 0.82rem; padding: 0.2rem 0.3rem; border: 1px solid #d1d5db; border-radius: 4px; background: #fff; }
/* flatpickr overrides to match app style */
.flatpickr-calendar { font-family: inherit; box-shadow: 0 4px 20px rgba(0,0,0,.15); border-radius: 8px; border: 1px solid #d1d5db; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: #1a3a5c; border-color: #1a3a5c; }
.flatpickr-day:hover { background: #e8f4fd; }
.flatpickr-months .flatpickr-month { background: #1a3a5c; border-radius: 7px 7px 0 0; }
.flatpickr-current-month, .flatpickr-current-month .cur-month,
.flatpickr-current-month input.cur-year { color: #fff; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { color: #fff; fill: #fff; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: #e8a838; }
.flatpickr-weekday { color: #6b7280; font-weight: 600; }

.yoy-strip { margin-bottom:1.25rem; }

/* ── INSIGHTS STAT CARDS (4-card strip on Insights page) ── */
.insight-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .875rem; margin-bottom: 1.25rem; }
.insight-kpi { background: var(--white); border-radius: var(--radius-lg); padding: 1rem 1.125rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.insight-kpi .label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: .3rem; }
.insight-kpi .val { font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.insight-kpi .sub { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }

/* ── SCROLLBAR (webkit) ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── SELECTION ── */
::selection { background: rgba(99,102,241,0.15); }
