/* ══════════════════════════════════════════════════
   TEAM HUB — CORE DESIGN SYSTEM
   Shared across all Team Hub pages
   ══════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  /* Core palette */
  --navy: #112C3B;
  --navy-light: #1a3d50;
  --navy-dark: #0c1f2b;
  --bg: #f4f0e8;
  --surface: #ffffff;
  --surface-hover: #f8f5ef;
  --border: #CEC8B6;
  --gold: #CEC8B6;
  --gold-dark: #b8b09c;
  --text: #112C3B;
  --text-muted: #5a7a8a;
  --text-light: #718096;

  /* Brand accent (from colour palette) */
  --accent-blue: #8AA5B2;
  --accent-blue-light: #dce7ec;
  --accent-blue-pale: #edf2f5;
  --accent-blue-glow: rgba(138, 165, 178, 0.15);

  /* Semantic colours */
  --green: #28a745;
  --green-bg: #d4edda;
  --green-border: #c3e6cb;
  --green-glow: rgba(40, 167, 69, 0.10);
  --orange: #e67e00;
  --orange-bg: #fff3cd;
  --orange-border: #ffeaa7;
  --orange-glow: rgba(230, 126, 0, 0.10);
  --red: #e53935;
  --red-bg: #f8d7da;
  --red-border: #f5c6cb;
  --red-glow: rgba(229, 57, 53, 0.10);
  --purple: #7c4dff;
  --purple-glow: rgba(124, 77, 255, 0.10);
  --cyan: #0097a7;
  --cyan-bg: #dbeafe;
  --cyan-glow: rgba(0, 151, 167, 0.10);
  --yellow: #f9a825;
  --yellow-bg: rgba(249, 168, 37, 0.10);
  --yellow-glow: rgba(249, 168, 37, 0.10);
  --blue: #3b82f6;
  --blue-bg: #dbeafe;
  --accent: #112C3B;
  --accent-glow: rgba(17, 44, 59, 0.10);

  /* Typography */
  --heading-font: 'Playfair Display', Georgia, serif;
  --body-font: 'DM Sans', -apple-system, sans-serif;
  --mono-font: 'JetBrains Mono', monospace;

  /* Spacing & radius */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1), 0 8px 32px rgba(0,0,0,0.06);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--body-font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: var(--safe-bottom);
}

/* ── Container (mobile-first, 600px) ── */
.container { max-width: 600px; margin: 0 auto; padding: 24px 20px; }

/* ── Container wide (desktop dashboards, 1280px) ── */
.container-wide { max-width: 1280px; margin: 0 auto; padding: 28px 32px 48px; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   HEADER — Compact single-row dark navy bar
   Left: logo+TEAM HUB | Centre: greeting+date | Right: session+avatar
   ══════════════════════════════════════════ */
.site-header {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
  padding-top: var(--safe-top);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  max-width: 600px;
  margin: 0 auto;
  gap: 12px;
}
/* For wide pages (dashboards), allow header content to stretch */
.site-header.wide .header-row {
  max-width: 1280px;
  padding: 10px 32px;
}
/* Left: logo + divider + app name */
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.header-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(0.85) sepia(0.15) saturate(0.5);
}
.header-divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.header-hub-link {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.header-hub-link:hover { opacity: 0.8; }
/* Centre: greeting + date text, with clock dot to the right */
.header-centre {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.header-centre-text {
  text-align: center;
  min-width: 0;
}
.header-greeting {
  font-family: var(--heading-font);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-date {
  font-size: 11px;
  color: rgba(206, 200, 182, 0.55);
  margin-top: 1px;
}
.header-clock-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* 2026-05-11 v131: both clocked-in (green) and clocked-out (red) variants
   now pulse so the user always has a visible status cue. Amplitude bumped
   (scale 1 → 1.25 + box-shadow grow) so it's clearly perceptible. */
.header-clock-dot.in {
  background: var(--green);
  box-shadow: 0 0 6px rgba(40,167,69,0.75);
  animation: pulse-dot-in 1.4s ease-in-out infinite;
}
.header-clock-dot.out {
  background: var(--red);
  box-shadow: 0 0 6px rgba(229,57,53,0.65);
  animation: pulse-dot-out 1.4s ease-in-out infinite;
}
@keyframes pulse-dot-in {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(40,167,69,0.55), 0 0 6px rgba(40,167,69,0.75);
  }
  50% {
    transform: scale(1.25);
    box-shadow: 0 0 0 4px rgba(40,167,69,0.15), 0 0 12px rgba(40,167,69,0.95);
  }
}
@keyframes pulse-dot-out {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220,38,38,0.55), 0 0 6px rgba(229,57,53,0.65);
  }
  50% {
    transform: scale(1.25);
    box-shadow: 0 0 0 4px rgba(220,38,38,0.15), 0 0 12px rgba(229,57,53,0.95);
  }
}
@media (prefers-reduced-motion: reduce) {
  .header-clock-dot.in,
  .header-clock-dot.out { animation: none; }
}
/* Legacy alias — the original pulse-dot keyframes were inlined elsewhere;
   keep an empty entry so any rule still referencing it falls through cleanly. */
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 6px rgba(40,167,69,0.75); }
  50% { box-shadow: 0 0 12px rgba(40,167,69,0.95); }
}
/* Right: session badge + avatar */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.session-badge {
  font-size: 11px;
  font-family: var(--mono-font);
  color: var(--gold);
  background: rgba(206,200,182,0.12);
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}
.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy-light);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  cursor: pointer;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.header-avatar:active { transform: scale(0.92); }

.header-help-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(206,200,182,0.15);
  border: 1.5px solid rgba(206,200,182,0.3);
  color: var(--gold);
  font-family: var(--body-font);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.header-help-btn:hover {
  background: rgba(206,200,182,0.25);
  border-color: var(--gold);
  color: #fff;
}
.header-help-btn:active { transform: scale(0.92); }

/* 2026-05-11: Header shortcut icons (Launchpad / Ops Portal staging).
   Same visual treatment as .header-help-btn — admin-only, revealed by
   _revealAdminShortcuts(). Sit immediately to the left of the help icon. */
.header-shortcut {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(206,200,182,0.15);
  border: 1.5px solid rgba(206,200,182,0.3);
  color: var(--gold);
  font-family: var(--body-font);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.header-shortcut:hover {
  background: rgba(206,200,182,0.25);
  border-color: var(--gold);
  transform: scale(1.05);
}
.header-shortcut:active { transform: scale(0.92); }

/* Deprecated: kept for backward compat with inline HTML until rebuilt */
.header-greeting-row { display: none; }

/* ── Page Title ── */
.page-title {
  font-family: var(--heading-font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 4px;
}
.page-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Back Button ── */
.back-btn {
  background: none; border: none; color: var(--text-muted); font-family: inherit;
  font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 6px;
  margin-bottom: 20px; padding: 4px 0; transition: color 0.15s;
}
.back-btn:hover { color: var(--text); }
.back-btn:active { color: var(--text); }

/* ══════════════════════════════════════════
   STAT TILES — Enhanced with coloured left border
   Generic .stat-card layout used across many pages (housekeeping, leave-dashboard,
   sales, etc.) — flex row with icon left + info right. Dashboard variant is
   scoped below under #dashboardScreen #statGrid.
   ══════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px;
  margin-bottom: 20px;
}
/* Mobile: stay 3-up, just shrink padding/typography so tiles still fit.
   Note: this affects the GENERIC stat-card layout. Dashboard variant has its
   own mobile rules in the unified-layout block below. */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px; }
  .stat-grid .stat-card { padding: 8px 6px; gap: 6px; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
  .stat-grid .stat-card::before { width: 3px; }
  .stat-grid .stat-icon { width: 30px; height: 30px; font-size: 14px; }
  .stat-grid .stat-info { min-width: 0; }
  .stat-grid .stat-info h3 { font-size: 16px; }
  .stat-grid .stat-info p { font-size: 9px; letter-spacing: 0.4px; }
}
.stat-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeIn 0.3s ease backwards;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
}
.stat-card:active { transform: scale(0.98); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card.sc-green::before { background: var(--green); }
.stat-card.sc-orange::before { background: var(--orange); }
.stat-card.sc-blue::before { background: var(--blue); }
.stat-card.sc-navy::before { background: var(--navy); }
.stat-card.sc-cyan::before { background: var(--cyan); }
.stat-card.sc-purple::before { background: var(--purple); }
.stat-card.sc-amber::before { background: #f59e0b; }
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.stat-card.sc-green .stat-icon { background: var(--green-bg); }
.stat-card.sc-orange .stat-icon { background: var(--orange-bg); }
.stat-card.sc-amber .stat-icon { background: var(--orange-bg); }
.stat-card.sc-blue .stat-icon { background: var(--blue-bg); }
.stat-card.sc-navy .stat-icon { background: var(--accent-glow); }
.stat-card.sc-cyan .stat-icon { background: rgba(0,151,167,0.1); }
.stat-card.sc-purple .stat-icon { background: var(--purple-glow); }
.stat-info h3 {
  font-size: 22px; font-weight: 700; line-height: 1; margin-bottom: 2px; color: var(--text);
}
.stat-info p {
  font-size: 11px; color: var(--text-light); text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 600; line-height: 1.3;
}
/* ══════════════════════════════════════════
   STAT TILES — Dashboard centred layout 2026-05-11 (v102)
   Scoped to #dashboardScreen #statGrid so other pages' stat-cards remain on
   the generic flex layout above.
   Layout:
     • Number ("7")          — TOP-LEFT corner, big bold
     • Date corner badge     — TOP-RIGHT corner, small muted (Arrivals only)
     • Icon                  — CENTRED horizontally below the number row
     • Label                 — CENTRED directly under the icon
   Same shape desktop + mobile. Coloured 4px left edge stripe retained.
   Requires markup: .stat-card > [.stat-date-corner?] + [.stat-info > h3] + [.stat-icon] + [.stat-label].
   ══════════════════════════════════════════ */
#dashboardScreen #statGrid .stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 8px 10px 8px 16px;
  min-height: 70px;
}
#dashboardScreen #statGrid .stat-info {
  /* Number — break out of the centred flow to top-left */
  position: absolute;
  top: 10px;
  left: 14px;
  margin: 0;
  display: block;
  text-align: left;
  min-width: 0;
}
#dashboardScreen #statGrid .stat-info h3 {
  font-weight: 700;
  font-size: 26px;
  color: var(--text);
  line-height: 1;
  margin: 0;
}
#dashboardScreen #statGrid .stat-icon { margin-top: 8px; margin-bottom: 2px; align-self: center; width: 28px; height: 28px; font-size: 14px; }
#dashboardScreen #statGrid .stat-card > .stat-label {
  /* Centred directly under the icon */
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-light);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  text-align: center;
  white-space: nowrap;
}
#dashboardScreen #statGrid .stat-date-corner {
  /* Top-right corner badge (Arrivals only — JS populates #statArrivalsDate) */
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 10px;
  color: var(--text-muted, #64748b);
  line-height: 1.2;
  text-align: right;
}
/* Mobile (≤480px): shrink number/icon/padding, keep the centred shape. */
@media (max-width: 480px) {
  #dashboardScreen #statGrid .stat-card {
    padding: 10px 8px 10px 12px;
    min-height: 70px;
  }
  #dashboardScreen #statGrid .stat-info { top: 6px; left: 10px; }
  #dashboardScreen #statGrid .stat-info h3 { font-size: 20px; }
  #dashboardScreen #statGrid .stat-icon {
    width: 28px; height: 28px; font-size: 13px;
    margin-top: 22px; margin-bottom: 4px;
  }
  #dashboardScreen #statGrid .stat-card > .stat-label { font-size: 9px; letter-spacing: 0.4px; }
  #dashboardScreen #statGrid .stat-date-corner { top: 6px; right: 8px; font-size: 9px; }
}
/* Larger stat card text for desktop dashboards */
.stat-grid-4 .stat-card { padding: 20px 22px; }
.stat-grid-4 .stat-icon { width: 44px; height: 44px; font-size: 20px; }
.stat-grid-4 .stat-info h3 { font-size: 28px; }
.stat-grid-4 .stat-info p { font-size: 12px; letter-spacing: 0.8px; }

/* animation stagger */
.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }

/* ── Category Cards ── */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.category-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 20px 14px; text-align: center; cursor: pointer; transition: all 0.15s;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; overflow: hidden;
}
.category-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.category-card:active { transform: scale(0.97); border-color: var(--accent-blue); }
.category-card.cc-accom::before { background: var(--green); }
.category-card.cc-bar::before { background: var(--orange); }
.category-card.cc-team::before { background: var(--blue); }
.category-card.cc-general::before { background: var(--purple); }
.category-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.cc-accom .category-icon { background: var(--green-bg); }
.cc-bar .category-icon { background: var(--orange-bg); }
.cc-team .category-icon { background: var(--blue-bg); }
.cc-general .category-icon { background: var(--purple-glow); }
.category-card.cc-events::before { background: #e67e00; }
.cc-events .category-icon { background: rgba(230, 126, 0, 0.10); }
/* #2336 (2026-07-11): Bugle Inn nav card — distinct terracotta stripe, same
   pattern as cc-events (raw hex, no shared CSS var needed for a single hub). */
.category-card.cc-bugle::before { background: #b5502e; }
.cc-bugle .category-icon { background: rgba(181, 80, 46, 0.10); }
.category-title { font-family: var(--heading-font); font-size: 15px; font-weight: 700; }
.category-count { font-size: 11px; color: var(--text-muted); }

/* ── Service Cards ── */
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.service-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px; display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
}
.service-card:active { transform: scale(0.98); background: var(--surface-hover); }
.service-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.service-card .service-title { font-size: 15px; font-weight: 600; }
.service-card .service-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.service-card .arrow { margin-left: auto; color: var(--text-muted); font-size: 18px; }

/* Service icon colours */
.si-clock { background: var(--green-glow); color: var(--green); }
.si-maint { background: var(--orange-glow); color: var(--orange); }
.si-supply { background: var(--accent-blue-glow); color: var(--accent-blue); }
.si-refuse { background: var(--red-glow); color: var(--red); }
.si-cashup { background: var(--yellow-glow); color: var(--yellow); }
.si-leave { background: var(--cyan-glow); color: var(--cyan); }
.si-feedback { background: var(--purple-glow); color: var(--purple); }
.si-concerns { background: var(--red-glow); color: var(--red); }
.si-newsboard { background: var(--accent-blue-glow); color: var(--accent-blue); }
.si-events { background: rgba(230, 126, 0, 0.10); color: #e67e00; }
.si-intel { background: var(--purple-glow); color: var(--purple); }
.si-rates { background: var(--cyan-glow); color: var(--cyan); }
.si-briefing { background: var(--blue-bg); color: var(--blue); }

/* ── Form Elements ── */
.form-title { font-family: var(--heading-font); font-size: 22px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.3px; }
.form-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
label.field-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.6px;
}
.field-group { margin-bottom: 20px; }
textarea, input[type="text"], input[type="number"], input[type="email"],
input[type="date"], input[type="time"], input[type="password"] {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; color: var(--text);
  font-family: inherit; font-size: 15px; appearance: none; -webkit-appearance: none;
  transition: border-color 0.15s;
}
textarea:focus, input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px var(--accent-blue-glow); }
textarea { min-height: 100px; resize: vertical; }

.toggle-group { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle-btn {
  flex: 1; min-width: 0; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; text-align: center;
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all 0.15s;
}
.toggle-btn.selected { border-color: var(--accent-blue); background: var(--accent-blue-pale); color: var(--navy); }
.toggle-btn:active { transform: scale(0.96); }

.submit-btn {
  width: 100%; padding: 16px; border: none; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy), var(--accent-blue)); color: #f4f0e8;
  font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: all 0.15s; box-shadow: 0 4px 20px rgba(17, 44, 59, 0.25); margin-top: 12px;
}
.submit-btn:active { transform: scale(0.97); }

/* ── Info Card ── */
.info-card {
  background: var(--accent-blue-pale); border: 1.5px solid rgba(138,165,178,0.3); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 20px;
}
.info-card-title { font-size: 12px; font-weight: 600; color: var(--navy); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 10px; }
.info-card-row { display: flex; justify-content: space-between; padding: 4px 0; }
.info-card-label { font-size: 14px; color: var(--text-muted); }
.info-card-value { font-size: 14px; font-weight: 600; }

/* ── Toast Notifications ── */
/* z-index 10000: must sit above every modal/drawer/overlay including the
   reassign drawer (z-index 9999 in rota.html). Pre-fix this was 200 and
   toast feedback was invisible behind the rota drawer overlay. */
.toast {
  position: fixed; bottom: calc(30px + var(--safe-bottom)); left: 20px; right: 20px;
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px 16px 24px; display: flex; align-items: center; gap: 12px;
  z-index: 10000; animation: slideUp 0.3s ease;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  overflow: hidden;
}
.toast::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 5px;
}
.toast.success {
  background: linear-gradient(135deg, #d4edda 0%, #e8f5e9 100%);
  border-color: #2e7d32;
}
.toast.success::before { background: #2e7d32; }
.toast.error {
  background: linear-gradient(135deg, #f8d7da 0%, #fce4ec 100%);
  border-color: #c62828;
}
.toast.error::before { background: #c62828; }
.toast-icon { font-size: 22px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15)); }
.toast-text { font-size: 14px; font-weight: 500; }
.toast-text strong { display: block; font-size: 15px; margin-bottom: 2px; }

/* ── Status Pills (used across leave, approvals, etc.) ── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase;
}
.status-pill.requested, .status-pill.pending { background: var(--orange-bg); color: #856404; }
.status-pill.approved, .status-pill.booked { background: var(--green-bg); color: #155724; }
.status-pill.active { background: var(--cyan-bg); color: #006064; }
.status-pill.taken { background: #e0e7ec; color: #3a5a6c; }
.status-pill.declined { background: var(--red-bg); color: #721c24; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-dot.requested, .status-dot.pending { background: #f59e0b; }
.status-dot.approved, .status-dot.booked { background: var(--green); }
.status-dot.active { background: var(--cyan); }
.status-dot.taken { background: #7a9aab; }
.status-dot.declined { background: var(--red); }

/* ── Loading / Spinner ── */
.loading-overlay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; color: var(--text-muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}

/* ── Error Banner ── */
.error-banner {
  background: var(--red-bg); border: 1px solid var(--red-border); color: #721c24;
  padding: 12px 18px; border-radius: 8px; margin-bottom: 18px; font-size: 13px;
  display: none;
}
.error-banner.show { display: block; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .container-wide { padding: 20px 16px; }
}
@media (max-width: 768px) {
  .stat-grid-4 { grid-template-columns: 1fr; }
  .site-header.wide .header-row { padding: 12px 16px; }
}

/* ── Print ── */
@media print {
  .site-header { position: static; }
  .stat-card { break-inside: avoid; }
}

/* ══════════════════════════════════════════
   DASHBOARD TILE ANIMATIONS — 2026-05-11 (v104)
   Two subtle animations on a 12s cycle:
     1. Stripe sweep — a soft highlight travels top→bottom along the 4px
        coloured left edge of each tile (~1.5s of the 12s cycle, the rest
        the stripe is calm).
     2. Icon shimmer — icons get a brief scale + brightness pulse on the
        OFFSET half of the cycle (delay 6s) so the two never overlap.
   Stagger via nth-child gives a left-to-right wave across the dashboard.
   Honours prefers-reduced-motion: reduce AND .no-animations kill switch.
   Apply to: .stat-card::before, .dash-cat::before, .mgmt-cat::before,
             .mgmt-grid .mgmt-card::before (stripes),
             .stat-icon, .cat-icon, .mgmt-icon (shimmer).
   ══════════════════════════════════════════ */

/* Per-variant --stripe-bg so the gradient interpolation respects the
   tile's existing colour. Mirrors the static .sc-* / .cc-* rules above. */
.stat-card { --stripe-bg: var(--blue); }
.stat-card.sc-green  { --stripe-bg: var(--green); }
.stat-card.sc-orange { --stripe-bg: var(--orange); }
.stat-card.sc-blue   { --stripe-bg: var(--blue); }
.stat-card.sc-navy   { --stripe-bg: var(--navy); }
.stat-card.sc-cyan   { --stripe-bg: var(--cyan); }
.stat-card.sc-purple { --stripe-bg: var(--purple); }
.stat-card.sc-amber  { --stripe-bg: #f59e0b; }

/* Override the static ::before background so the animated gradient shows. */
.stat-card::before,
.dash-cat::before,
.mgmt-cat::before,
.mgmt-grid .mgmt-card::before {
  background: var(--stripe-bg, currentColor) !important;
  color: var(--stripe-bg, currentColor);
}


  92%           { outline: 3px solid var(--stripe-bg, currentColor); outline-offset: 2px; }
  96%           { outline: 0 solid transparent; outline-offset: 0; }
}

@keyframes stripe-chase {
  /* 2026-05-11 fix: animate `top` (parent-relative) so the blob actually travels
     full tile height, not just self-height. Visible top-to-bottom sweep. */
  0%, 70%, 100% { top: -30%; opacity: 0; }
  78%           { top: -30%; opacity: 1; }
  90%           { top: 100%; opacity: 1; }
  92%, 100%     { top: 100%; opacity: 0; }
}

@keyframes icon-shimmer {
  /* 2026-05-11: gentle scale only, no rotation. */
  0%, 92%, 100% { transform: scale(1); }
  96%           { transform: scale(1.12); }
}

.stat-icon,
.cat-icon,
.mgmt-icon {
  animation: icon-shimmer 5s ease-in-out infinite;
  animation-delay: 6s;
}

/* Stripe chase — a 30% tall white blob travels down inside each 4px stripe.
   Fires with icon-shimmer (same 12s cycle, similar timing) so user sees both at once. */
.stat-card,
.dash-cat,
.mgmt-cat,
.mgmt-grid .mgmt-card {
  position: relative;
}
.stat-card::after,
.dash-cat::after,
.mgmt-cat::after,
.mgmt-grid .mgmt-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 30%;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 100%);
  animation: stripe-chase 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}


/* Wave stagger — left→right, top→bottom across the dashboard. Wave wraps
   inside ~3.5s so the last tile's sweep finishes well before the next cycle. */
.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.4s; }
.stat-card:nth-child(3) { animation-delay: 0.8s; }
.stat-card:nth-child(4) { animation-delay: 1.2s; }

.dash-cat:nth-child(1) { animation-delay: 1.0s; }
.dash-cat:nth-child(2) { animation-delay: 1.4s; }
.dash-cat:nth-child(3) { animation-delay: 1.8s; }
.dash-cat:nth-child(4) { animation-delay: 2.2s; }
.dash-cat:nth-child(5) { animation-delay: 2.6s; }
.dash-cat:nth-child(6) { animation-delay: 3.0s; }

.mgmt-cat:nth-child(1) { animation-delay: 2.0s; }
.mgmt-cat:nth-child(2) { animation-delay: 2.4s; }
.mgmt-cat:nth-child(3) { animation-delay: 2.8s; }
.mgmt-cat:nth-child(4) { animation-delay: 3.2s; }

.mgmt-grid .mgmt-card:nth-child(1) { animation-delay: 2.5s; }
.mgmt-grid .mgmt-card:nth-child(2) { animation-delay: 2.9s; }
.mgmt-grid .mgmt-card:nth-child(3) { animation-delay: 3.3s; }
.mgmt-grid .mgmt-card:nth-child(4) { animation-delay: 3.7s; }
.mgmt-grid .mgmt-card:nth-child(5) { animation-delay: 4.1s; }
.mgmt-grid .mgmt-card:nth-child(6) { animation-delay: 4.5s; }

/* DIAGNOSTIC 2026-05-11: prefers-reduced-motion block temporarily disabled to verify animation visibility.
/* Respect user's OS-level reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  .stat-card::before,
  .dash-cat::before,
  .mgmt-cat::before,
  .mgmt-grid .mgmt-card::before {
    animation: none !important;
    background: var(--stripe-bg, currentColor) !important;
    background-size: auto !important;
    background-position: 0 0 !important;
  }
*/
  .stat-icon, .cat-icon, .mgmt-icon {
    animation: none !important;
  }
}

/* Global kill switch — add class="no-animations" to <body> or <html> to
   disable all dashboard tile animations without touching the OS setting. */
body.no-animations .stat-card::before,
body.no-animations .dash-cat::before,
body.no-animations .mgmt-cat::before,
body.no-animations .mgmt-grid .mgmt-card::before,
html.no-animations .stat-card::before,
html.no-animations .dash-cat::before,
html.no-animations .mgmt-cat::before,
html.no-animations .mgmt-grid .mgmt-card::before {
  animation: none !important;
  background: var(--stripe-bg, currentColor) !important;
  background-size: auto !important;
  background-position: 0 0 !important;
}
body.no-animations .stat-icon,
body.no-animations .cat-icon,
body.no-animations .mgmt-icon,
html.no-animations .stat-icon,
html.no-animations .cat-icon,
html.no-animations .mgmt-icon {
  animation: none !important;
}


/* 2026-05-11: per-stripe stat number colours (was uniform var(--text) dark). */
.stat-card.sc-green  .stat-info h3 { color: var(--green) !important; }
.stat-card.sc-orange .stat-info h3 { color: var(--orange) !important; }
.stat-card.sc-navy   .stat-info h3 { color: var(--navy) !important; }
.stat-card.sc-blue   .stat-info h3 { color: var(--blue) !important; }
.stat-card.sc-cyan   .stat-info h3 { color: var(--cyan) !important; }
.stat-card.sc-purple .stat-info h3 { color: var(--purple) !important; }
.stat-card.sc-amber  .stat-info h3 { color: #f59e0b !important; }


/* 2026-05-11: diagonal cascade load — each tile fades+slides in based on (row+col).
   Top-left fires instant, bottom-right at the end. ~600ms full cascade. */
@keyframes tile-cascade {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tile-cascade { opacity: 0; animation: tile-cascade 0.32s ease-out forwards; }


/* 2026-05-11 v117: CSS-ONLY diagonal cascade load — tiles start at opacity:0 from first paint, fade in with staggered delays. No JS required, no flash. */
@keyframes tile-cascade {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
#dashboardScreen .stat-card,
#dashboardScreen .dash-cat,
#dashboardScreen .mgmt-cat,
#dashboardScreen .mgmt-grid .mgmt-card {
  opacity: 0;
  animation: tile-cascade 0.32s ease-out forwards;
}

/* Per-tile diagonal delays (row + col, 80ms step). DOM-order assumed.
   stat-grid: 3 tiles (1 row). mgmt-grid: 6 tiles (2 rows).
   dash-categories: 6 tiles (2 rows). mgmt-categories: 6 tiles (2 rows). */

/* Stat row — single row at row=0 */
#dashboardScreen .stat-card:nth-of-type(1) { animation-delay: 0ms; }
#dashboardScreen .stat-card:nth-of-type(2) { animation-delay: 80ms; }
#dashboardScreen .stat-card:nth-of-type(3) { animation-delay: 160ms; }

/* Mgmt Quick Access — 2 rows, starting at row=1 */
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(1) { animation-delay: 80ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(2) { animation-delay: 160ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(3) { animation-delay: 240ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(4) { animation-delay: 160ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(5) { animation-delay: 240ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(6) { animation-delay: 320ms; }

/* Services row — 2 rows, starting at row=3 */
#dashboardScreen .dash-cat:nth-of-type(1) { animation-delay: 240ms; }
#dashboardScreen .dash-cat:nth-of-type(2) { animation-delay: 320ms; }
#dashboardScreen .dash-cat:nth-of-type(3) { animation-delay: 400ms; }
#dashboardScreen .dash-cat:nth-of-type(4) { animation-delay: 320ms; }
#dashboardScreen .dash-cat:nth-of-type(5) { animation-delay: 400ms; }
#dashboardScreen .dash-cat:nth-of-type(6) { animation-delay: 480ms; }

/* Mgmt folders — 2 rows, starting at row=5 */
#dashboardScreen .mgmt-cat:nth-of-type(1) { animation-delay: 400ms; }
#dashboardScreen .mgmt-cat:nth-of-type(2) { animation-delay: 480ms; }
#dashboardScreen .mgmt-cat:nth-of-type(3) { animation-delay: 560ms; }
#dashboardScreen .mgmt-cat:nth-of-type(4) { animation-delay: 480ms; }
#dashboardScreen .mgmt-cat:nth-of-type(5) { animation-delay: 560ms; }
#dashboardScreen .mgmt-cat:nth-of-type(6) { animation-delay: 640ms; }





/* 2026-05-11 v121: revert stat-card to vertical layout — number top-left absolute, icon centred middle, label centred below. */
#dashboardScreen #statGrid .stat-info { position: absolute; top: 10px; left: 14px; }
#dashboardScreen #statGrid .stat-info h3 { font-size: 26px; font-weight: 700; line-height: 1; }
#dashboardScreen #statGrid .stat-icon { margin-top: 28px; margin-bottom: 6px; align-self: center; }
#dashboardScreen #statGrid .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: #64748B; font-weight: 600; align-self: center; }
@media (max-width: 480px) {
  #dashboardScreen #statGrid .stat-card { min-height: 90px; padding: 10px 8px 10px 14px; }
  #dashboardScreen #statGrid .stat-info h3 { font-size: 20px; }
  #dashboardScreen #statGrid .stat-icon { width: 28px; height: 28px; font-size: 14px; margin-top: 20px; }
}


/* 2026-05-11 v125 — FINAL icon unification (override base .stat-icon 40x40 rule).
   All four tile types now 32x32 with font-size 16px, uniform across desktop AND mobile. */
#dashboardScreen #statGrid .stat-icon {
  width: 32px !important; height: 32px !important; font-size: 16px !important;
  margin-top: 6px !important; margin-bottom: 2px !important;
  border-radius: 8px !important;
}
@media (max-width: 480px) {
  #dashboardScreen #statGrid .stat-icon {
    width: 32px !important; height: 32px !important; font-size: 16px !important;
  }
  #dashboardScreen #statGrid .stat-card {
    min-height: 70px !important;
  }
}


/* 2026-05-11 v128: icon-shimmer follows the same diagonal cascade as the load animation.
   Cycle = 5s. Wave fires top-left to bottom-right over ~640ms, then 4.36s calm. */
#dashboardScreen .stat-card:nth-of-type(1) .stat-icon { animation-delay: 0ms; }
#dashboardScreen .stat-card:nth-of-type(2) .stat-icon { animation-delay: 80ms; }
#dashboardScreen .stat-card:nth-of-type(3) .stat-icon { animation-delay: 160ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(1) .mgmt-icon { animation-delay: 80ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(2) .mgmt-icon { animation-delay: 160ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(3) .mgmt-icon { animation-delay: 240ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(4) .mgmt-icon { animation-delay: 160ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(5) .mgmt-icon { animation-delay: 240ms; }
#dashboardScreen .mgmt-grid .mgmt-card:nth-of-type(6) .mgmt-icon { animation-delay: 320ms; }
#dashboardScreen .dash-cat:nth-of-type(1) .cat-icon { animation-delay: 240ms; }
#dashboardScreen .dash-cat:nth-of-type(2) .cat-icon { animation-delay: 320ms; }
#dashboardScreen .dash-cat:nth-of-type(3) .cat-icon { animation-delay: 400ms; }
#dashboardScreen .dash-cat:nth-of-type(4) .cat-icon { animation-delay: 320ms; }
#dashboardScreen .dash-cat:nth-of-type(5) .cat-icon { animation-delay: 400ms; }
#dashboardScreen .dash-cat:nth-of-type(6) .cat-icon { animation-delay: 480ms; }
#dashboardScreen .mgmt-cat:nth-of-type(1) .cat-icon { animation-delay: 400ms; }
#dashboardScreen .mgmt-cat:nth-of-type(2) .cat-icon { animation-delay: 480ms; }
#dashboardScreen .mgmt-cat:nth-of-type(3) .cat-icon { animation-delay: 560ms; }
#dashboardScreen .mgmt-cat:nth-of-type(4) .cat-icon { animation-delay: 480ms; }
#dashboardScreen .mgmt-cat:nth-of-type(5) .cat-icon { animation-delay: 560ms; }
#dashboardScreen .mgmt-cat:nth-of-type(6) .cat-icon { animation-delay: 640ms; }
