/* ═══════════════════════════════════════════════════
   HYRULE HR — Refined Dark Industrial
   Typography: Outfit (display) + DM Sans (body)
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-root: #06080f;
  --bg-surface: #0d1117;
  --bg-card: #151b25;
  --bg-card-hover: #1a2130;
  --bg-elevated: #1e2636;
  --bg-input: #111820;
  --border: #1e2a3a;
  --border-focus: #00d4aa;
  --text-primary: #e8ecf1;
  --text-secondary: #8494a7;
  --text-muted: #4a5568;
  --accent: #00d4aa;
  --accent-glow: rgba(0, 212, 170, 0.15);
  --accent-dim: #00a88a;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  --morning: #3b82f6;
  --afternoon: #f59e0b;
  --evening: #8b5cf6;
  --night: #6366f1;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 1px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4), 0 0 1px rgba(0,0,0,0.5);
  --font-display: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --nav-height: 64px;
  --bottom-nav: 72px;
  --sidebar-w: 260px;
}

/* Light theme */
[data-theme="light"] {
  --bg-root: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fb;
  --bg-elevated: #f4f5f7;
  --bg-input: #f0f2f5;
  --border: #dde1e6;
  --border-focus: #009e7e;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --accent: #009e7e;
  --accent-glow: rgba(0, 158, 126, 0.1);
  --accent-dim: #007d64;
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1), 0 0 1px rgba(0,0,0,0.1);
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  /* Fill the status bar area with the root background */
  background: var(--bg-root);
}
body {
  font-family: var(--font-body);
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* iOS PWA status bar safe area — fixed bar behind status bar */
@supports (padding-top: env(safe-area-inset-top)) {
  body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: env(safe-area-inset-top, 0);
    background: var(--bg-surface);
    z-index: 9998;
    pointer-events: none;
  }
  .main-content {
    padding-top: env(safe-area-inset-top, 0);
  }
  .sidebar {
    padding-top: env(safe-area-inset-top, 0);
  }
}

/* Prevent iOS input zoom (inputs < 16px trigger zoom on focus) */
@supports (-webkit-touch-callout: none) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="tel"], input[type="url"],
  input[type="search"], input[type="date"], input[type="time"],
  input[type="datetime-local"], input[type="month"], select, textarea {
    font-size: 16px;
  }
}

/* Fix date/time inputs overflowing on mobile */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
@media (max-width: 768px) {
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  input[type="month"] {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

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

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 600; }
.label { font-family: var(--font-display); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

/* ── App Shell ── */
#app { display: flex; min-height: 100vh; max-width: 100vw; overflow-x: hidden; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Collapse / expand toggle (desktop) */
.sidebar-collapse-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease,
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-collapse-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.sidebar-collapse-btn svg { width: 18px; height: 18px; }
@media (max-width: 768px) { .sidebar-collapse-btn { display: none; } }

.sidebar-brand .logo-img {
  width: 36px; height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar-brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s ease;
  position: relative;
  margin-bottom: 2px;
}
.sidebar-nav a:hover { background: var(--bg-card); color: var(--text-primary); }
.sidebar-nav a.active {
  background: var(--accent-glow);
  color: var(--accent);
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.sidebar-nav a svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.7; }
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.sidebar-logo { opacity: 0.5 !important; }
/* dark (default) = reversed brandmark; [data-theme="light"] keeps the kit default colour */
html:not([data-theme="light"]) .sidebar-logo.tns-brandmark { --tns-ink:#fff;--tns-halo:var(--halo-dark,rgba(255,255,255,.14))!important;--tns-track:rgba(0,156,255,.28); }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Collapsed (slim, icons-only) sidebar — desktop only ── */
@media (min-width: 769px) {
  :is(#app, #admin-app).sidebar-collapsed { --sidebar-w: 76px; }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-brand .logo-img,
  :is(#app, #admin-app).sidebar-collapsed .sidebar-brand > div,
  :is(#app, #admin-app).sidebar-collapsed .sidebar-brand span { display: none; }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-collapse-btn { margin-left: 0; transform: rotate(180deg); }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-nav { padding-left: 6px; padding-right: 6px; overflow: visible; }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-nav a { justify-content: center; gap: 0; font-size: 0; padding: 12px 0; }

  /* Hover tooltip — uses app surface/border/radius tokens */
  :is(#app, #admin-app).sidebar-collapsed .sidebar-nav a::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    z-index: 200;
    transition: opacity 0.14s ease, transform 0.14s cubic-bezier(0.4, 0, 0.2, 1);
  }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-nav a:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-nav a .nav-badge {
    position: absolute; top: 6px; right: 14px;
    min-width: 9px; width: 9px; height: 9px;
    padding: 0; font-size: 0; line-height: 0; border-radius: 50%;
  }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-footer .flex-between { justify-content: center; }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-footer .sidebar-logo { display: none; }
  :is(#app, #admin-app).sidebar-collapsed .sidebar-footer .btn { font-size: 0; padding-left: 10px; padding-right: 10px; }
}

.page-header {
  padding: 24px 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-body { padding: 20px 32px 100px; flex: 1; }

/* ── Bottom Nav (mobile) ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 8px 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
}
.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  position: relative;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a .nav-badge {
  position: absolute;
  top: 0; right: 4px;
  margin: 0;
  font-size: 0.6rem;
  padding: 1px 5px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s ease;
}
.card:hover { border-color: rgba(0,212,170,0.2); }
.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--accent);
  color: #06080f;
}
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }
.pat-day-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.15); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ── Form Controls ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234a5568' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ── Custom Select Dropdown ── */
.cs-wrap { position: relative; width: 100%; user-select: none; }
.cs-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font-body);
  font-size: 0.9rem; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.cs-trigger:hover { border-color: var(--accent); }
.cs-wrap.open .cs-trigger { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.cs-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cs-arrow { width: 12px; height: 12px; color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
.cs-wrap.open .cs-arrow { transform: rotate(180deg); }
.cs-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 100;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.cs-wrap.open .cs-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.cs-search {
  width: 100%; padding: 10px 14px; border: none; border-bottom: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-primary); font-family: var(--font-body);
  font-size: 0.85rem; outline: none;
}
.cs-search::placeholder { color: var(--text-muted); }
.cs-options { overflow-y: auto; max-height: 220px; padding-bottom: 4px; }
.cs-option {
  padding: 10px 14px; font-size: 0.85rem; cursor: pointer; color: var(--text-primary);
  transition: background 0.1s;
}
.cs-option:hover { background: var(--accent-glow); }
.cs-option.active { color: var(--accent); font-weight: 600; }
.cs-option[style*="display: none"] + .cs-option { border-top: none; }
/* Flip dropdown upward when near bottom */
.cs-wrap.cs-flip .cs-dropdown { top: auto; bottom: calc(100% + 4px); transform-origin: bottom; }
.cs-wrap.cs-flip.open .cs-dropdown { transform: translateY(0); }
/* In modals, hide the inline dropdown entirely — a floater on body is used instead */
.modal .cs-dropdown { display: none !important; }
/* Floater: dropdown rendered on body to escape modal overflow */
.cs-floater {
  position: fixed; z-index: 9999;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.cs-floater .cs-search {
  width: 100%; padding: 10px 14px; border: none; border-bottom: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-primary); font-family: var(--font-body);
  font-size: 0.85rem; outline: none; box-sizing: border-box;
}
.cs-floater .cs-search::placeholder { color: var(--text-muted); }
.cs-floater .cs-options { overflow-y: auto; }
.cs-floater .cs-option {
  padding: 10px 14px; font-size: 0.85rem; cursor: pointer; color: var(--text-primary);
  transition: background 0.1s;
}
.cs-floater .cs-option:hover { background: var(--accent-glow); }
.cs-floater .cs-option.active { color: var(--accent); font-weight: 600; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* Date/time/datetime/month inputs — fix dark mode. color-scheme: dark makes Chrome/Safari
   draw the picker glyph light; an invert() on top of that only dims it again (verified by
   screenshot 2026-09-15), so the filter below is for bare inputs without .form-input only. */
input[type="date"].form-input,
input[type="time"].form-input,
input[type="datetime-local"].form-input,
input[type="month"].form-input {
  color-scheme: dark;
  color: var(--text-primary);
}
[data-theme="light"] input[type="date"].form-input,
[data-theme="light"] input[type="time"].form-input,
[data-theme="light"] input[type="datetime-local"].form-input,
[data-theme="light"] input[type="month"].form-input {
  color-scheme: light;
}
/* Webkit calendar/clock picker icon colour (bare inputs only — see above) */
input[type="date"]:not(.form-input)::-webkit-calendar-picker-indicator,
input[type="time"]:not(.form-input)::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:not(.form-input)::-webkit-calendar-picker-indicator,
input[type="month"]:not(.form-input)::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
}
[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: none;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-accent { background: var(--accent-glow); color: var(--accent); }

/* ── Avatar ── */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--bg-root);
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }

/* ── Stat Cards ── */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-label { font-size: 0.8rem; color: var(--text-secondary); }

/* ── Clock Widget ── */
.clock-widget {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.clock-widget::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
}
.clock-widget.clocked-in::before { opacity: 1; }
.clock-widget.clocked-in { border-color: rgba(0,212,170,0.3); }

.clock-timer {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
}
.clock-timer span { opacity: 0.4; }

.clock-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 8px;
}
.clock-btn:hover {
  background: var(--accent);
  color: var(--bg-root);
  transform: scale(1.05);
  box-shadow: 0 0 24px var(--accent-glow);
}
.clock-btn.active {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.clock-btn.active:hover {
  box-shadow: 0 0 24px rgba(239,68,68,0.3);
}
.clock-btn svg { width: 28px; height: 28px; }

.clock-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 12px;
}
.clock-status strong { color: var(--accent); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--accent); color: var(--bg-root); }
/* Unread count inside an inbox tab (Staff / System split, 2026-10-21) */
.tab-count { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 10px; font-size: 0.65rem; font-weight: 700; line-height: 1.4; background: var(--danger); color: #fff; vertical-align: 1px; }
.tab.active .tab-count { background: var(--bg-root); color: var(--accent); }

/* ── Toggle switch ── */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toggle {
  width: 44px; height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: var(--text-secondary);
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle.active { background: var(--accent); }
.toggle.active::after { transform: translateX(20px); background: #fff; }

/* ── Progress ring ── */
.progress-ring-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.progress-ring { transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--border); }
.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-ring-text {
  position: absolute;
  text-align: center;
}
.progress-ring-text .val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  line-height: 1;
}
.progress-ring-text .sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* ── Shift card ── */
.shift-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
}
.shift-card:hover { border-color: rgba(0,212,170,0.2); }
.shift-time-bar {
  width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}
.shift-time-bar.morning { background: var(--morning); }
.shift-time-bar.afternoon { background: var(--afternoon); }
.shift-time-bar.evening { background: var(--evening); }
.shift-time-bar.night { background: var(--night); }
.shift-info { flex: 1; min-width: 0; }
.shift-time {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.shift-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.shift-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Merged shift card — each name is its own click target */
.rota-merge-name { cursor: pointer; }
.rota-merge-name:hover { text-decoration: underline; color: var(--text-primary); }
/* Merged month pill: allow names to wrap so every name stays visible + clickable.
   Enhanced-rate cells wrap too, so the ×1.25 pill is never ellipsis-clipped
   out of a narrow month column. */
.month-shift.merged, .month-shift.has-factor { white-space: normal; }

/* ── Holiday Calendar Heatmap ── */
/* ── Holiday Calendar ── */
.hol-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.hol-calendar .day-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hol-day {
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: default;
  transition: background 0.15s;
  gap: 2px;
  position: relative;
  padding: 4px 2px;
}
.hol-day.booked { background: var(--accent-glow); color: var(--accent); font-weight: 600; }
.hol-day.pending { background: var(--warning-bg); color: var(--warning); font-weight: 600; }
.hol-day.booked.pending { background: linear-gradient(135deg, var(--accent-glow) 50%, var(--warning-bg) 50%); }
.hol-day.today { border: 2px solid var(--accent); color: var(--text-primary); font-weight: 700; }
.hol-day.empty { background: transparent; min-height: 0; }
/* .hol-day.weekend — no fade, 24/7 operation */
.hol-day-num { font-family: var(--font-display); font-size: 0.85rem; }
.hol-day-dot { width: 6px; height: 6px; border-radius: 50%; }
.hol-day-dot.approved { background: var(--accent); }
.hol-day-dot.pending { background: var(--warning); }
.hol-day-names { display: flex; flex-direction: column; gap: 1px; width: 100%; }
.hol-day-name {
  font-size: 0.55rem;
  font-family: var(--font-display);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
  border-radius: 2px;
  line-height: 1.4;
}
.hol-day-name.approved { color: var(--accent); }
.hol-day-name.pending { color: var(--warning); }

/* ── Bank Holidays ── */
.month-cell.bank-holiday { background: rgba(245, 158, 11, 0.08); }
.month-cell.bank-holiday .month-cell-date { color: var(--warning); }
.hol-day.bank-holiday { background: rgba(245, 158, 11, 0.08); }
.hol-day.bank-holiday .hol-day-num { color: var(--warning); }
.bank-holiday-label {
  font-size: 0.5rem;
  line-height: 1.1;
  color: var(--warning);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 1px 0;
  text-align: center;
}
.hol-day .bank-holiday-label { font-size: 0.55rem; }
.week-day-header.bank-holiday { color: var(--warning); }
.week-day-header .bank-holiday-label { font-size: 0.6rem; font-weight: 500; display: block; }

/* ── Message list ── */
.msg-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  min-width: 0;
  overflow: hidden;
}
.msg-item:hover { background: var(--bg-card-hover); }
.msg-item.unread { background: var(--bg-card); }
.msg-item.unread .msg-subject { color: var(--text-primary); font-weight: 600; }
.msg-body-wrap { flex: 1; min-width: 0; }
.msg-subject {
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.msg-unread-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── Chat Thread View ── */
.chat-thread { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.chat-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
}
.chat-bubble.sent {
  align-self: flex-end;
  background: var(--accent);
  color: var(--bg-root);
  border-bottom-right-radius: 4px;
}
.chat-bubble.received {
  align-self: flex-start;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.chat-bubble .chat-time { font-size: 0.65rem; opacity: 0.6; margin-top: 4px; }

.chat-compose {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}
.chat-compose input { flex: 1; }

/* ── Account Sections ── */
.account-section {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.account-section:last-child { border: none; }
.account-section h3 { margin-bottom: 16px; }
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}
.account-row .account-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.account-row .account-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}
.account-row .form-input-sm {
  max-width: 260px;
  padding: 7px 10px;
  font-size: 0.85rem;
  text-align: right;
  margin-left: auto;
}
.account-row .cs-wrap {
  max-width: 260px;
  margin-left: auto;
}
.account-row .cs-trigger {
  padding: 7px 10px;
  font-size: 0.85rem;
}

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-root);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  position: relative;
  z-index: 1;
}
.login-logo-img {
  width: 72px; height: 72px;
  border-radius: 18px;
  display: block;
  margin: 0 auto 24px;
  object-fit: contain;
}
.mobile-logo-img {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: contain;
}
.login-title {
  text-align: center;
  margin-bottom: 8px;
}
.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}
.login-error {
  background: var(--danger-bg);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--danger);
  margin-bottom: 16px;
  display: none;
}

/* ── 2FA OTP Input ── */
.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}
.otp-inputs input {
  width: 48px; height: 56px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.otp-inputs input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Holiday Request Form ── */
.holiday-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.holiday-form .form-group.full { grid-column: 1 / -1; }

/* ── Rich Text Editor ── */
.rte-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-input); }
.rte-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.rte-toolbar {
  display: flex; align-items: center; gap: 2px; padding: 6px 8px;
  border-bottom: 1px solid var(--border); background: var(--bg-elevated);
}
.rte-btn {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--radius-sm); color: var(--text-secondary);
  cursor: pointer; font-size: 0.8rem; transition: all 0.1s;
}
.rte-btn:hover { background: var(--accent-glow); color: var(--text-primary); }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rte-body {
  padding: 12px 14px; font-family: var(--font-body); font-size: 0.9rem;
  color: var(--text-primary); line-height: 1.6; outline: none;
  overflow-y: auto; max-height: 300px;
}
.rte-body.empty:not(.focused)::before {
  content: attr(data-placeholder); color: var(--text-muted); pointer-events: none;
}
.rte-body p { margin: 0 0 8px; }
.rte-body ul, .rte-body ol { margin: 0 0 8px; padding-left: 20px; }
.rte-body a { color: var(--accent); text-decoration: underline; }

/* ── Toast Notifications ── */
.toast-notification {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: var(--radius); max-width: 420px;
  font-size: 0.85rem; font-weight: 500; font-family: var(--font-body);
  border: 1px solid; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease forwards;
  backdrop-filter: blur(12px);
}
@media (max-width: 480px) { .toast-notification { left: 16px; right: 16px; bottom: 80px; max-width: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(20px); } }

/* ── Skeleton loader ── */
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.skel { background: var(--bg-elevated); border-radius: var(--radius-sm); animation: skeletonPulse 1.2s ease-in-out infinite; }
.skel-text { height: 14px; margin-bottom: 8px; }
.skel-text.w-50 { width: 50%; }
.skel-text.w-75 { width: 75%; }
.skel-text.w-30 { width: 30%; }
.skel-card { height: 72px; border-radius: var(--radius); margin-bottom: 8px; }
.skel-stat { height: 64px; border-radius: var(--radius); }

/* ── Theme toggle ── */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.theme-toggle:hover { border-color: var(--text-muted); color: var(--text-primary); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ── Page transitions ── */
.view { display: none; animation: fadeSlideIn 0.3s ease forwards; }
.view.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Empty states ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
body.modal-open { overflow: hidden; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 768px) {
  .modal { max-width: 100% !important; max-height: 95vh; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  #wage-email-editor { min-height: 200px !important; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  flex-shrink: 0;
}
.modal-body { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-footer { flex-shrink: 0; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-elevated); }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Week Calendar ── */
.week-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.week-day-col { display: flex; flex-direction: column; gap: 6px; }
.week-day-header {
  text-align: center;
  padding: 8px 4px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.week-day-header .day-num {
  display: block;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-top: 2px;
  letter-spacing: 0;
  text-transform: none;
}
.week-day-header.today .day-num {
  background: var(--accent);
  color: var(--bg-root);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.week-shift-card {
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  background: var(--bg-card);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.1s;
}
.week-shift-card:hover { background: var(--bg-card-hover); }
.week-shift-card .wsc-time { font-weight: 600; font-family: var(--font-display); }
.week-shift-card .wsc-dur { color: var(--text-muted); margin-top: 2px; }

/* ── Month Calendar ── */
.month-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.month-header {
  text-align: center;
  padding: 8px 4px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.month-cell {
  min-height: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  font-size: 0.75rem;
  overflow: hidden;
}
.month-cell.empty { background: transparent; border-color: transparent; min-height: 0; }
.month-cell.today { border-color: var(--accent); }
/* .month-cell.weekend — no fade, 24/7 operation */
.month-cell-date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.month-cell.today .month-cell-date { color: var(--accent); }
.month-cell-shifts { display: flex; flex-direction: column; gap: 2px; }
.month-shift {
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
/* Dark-mode rota pills: lighter text + slightly stronger background for contrast */
.month-shift.morning { background: rgba(59,130,246,0.22); color: #93c5fd; }
.month-shift.afternoon { background: rgba(245,158,11,0.22); color: #fcd34d; }
.month-shift.evening { background: rgba(139,92,246,0.25); color: #c4b5fd; }
.month-shift.night { background: rgba(99,102,241,0.25); color: #a5b4fc; }
.month-shift.available-shift { background: var(--success-bg); color: var(--success); font-weight: 600; }
.month-shift.offered-shift { background: var(--warning-bg); color: var(--warning); font-weight: 600; }

/* Light mode keeps the deeper hues for readability on white */
[data-theme="light"] .month-shift.morning { background: rgba(59,130,246,0.14); color: #1d4ed8; }
[data-theme="light"] .month-shift.afternoon { background: rgba(245,158,11,0.18); color: #b45309; }
[data-theme="light"] .month-shift.evening { background: rgba(139,92,246,0.16); color: #6d28d9; }
[data-theme="light"] .month-shift.night { background: rgba(99,102,241,0.16); color: #4338ca; }

/* Shift on a holiday day — strikethrough + dimmed */
.month-shift.on-holiday,
.week-shift-card.on-holiday .wsc-time,
.shift-card.on-holiday .shift-time {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.month-shift.on-holiday { opacity: 0.65; font-style: italic; }
.week-shift-card.on-holiday { opacity: 0.7; }
.shift-card.on-holiday { opacity: 0.78; }

/* Phantom holiday entry (no shift behind it) */
.month-shift.holiday-phantom,
.week-shift-card.holiday-phantom,
.shift-card.holiday-phantom {
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
  border-left: 3px solid var(--danger);
  font-style: italic;
}
.month-shift.holiday-phantom { border-left: 2px solid var(--danger); }
[data-theme="light"] .month-shift.holiday-phantom,
[data-theme="light"] .week-shift-card.holiday-phantom,
[data-theme="light"] .shift-card.holiday-phantom { color: #b91c1c; background: rgba(239,68,68,0.08); }

/* ── Shift offers banner ── */
.shift-offers-banner { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.shift-offer-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius);
  background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245,158,11,0.35);
  cursor: pointer; transition: all 0.15s;
}
.shift-offer-card:hover { border-color: var(--warning); background: rgba(245,158,11,0.18); }
.shift-offer-card .offer-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(245,158,11,0.25); color: #fbbf24;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.shift-offer-card .offer-details { flex: 1; min-width: 0; }
.shift-offer-card .offer-title { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.shift-offer-card .offer-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
[data-theme="light"] .shift-offer-card { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.3); }
[data-theme="light"] .shift-offer-card:hover { background: rgba(245,158,11,0.14); }
.month-cell.drag-over { background: var(--success-bg) !important; border: 2px dashed var(--success) !important; }
.month-cell-date { display: flex; justify-content: space-between; align-items: center; }
.add-shift-btn {
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  color: var(--text-muted); cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.month-cell:hover .add-shift-btn { opacity: 1; }
.add-shift-btn:hover { color: var(--accent); }

/* Mobile: hide tiny +, make whole cell tappable for adding */
@media (max-width: 768px) {
  .add-shift-btn { display: none; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,0.5); }
  .bottom-nav { display: block; }
  .main-content { margin-left: 0; }
  #mobile-header { display: none !important; }
  .quick-actions { overflow-x: auto; flex-wrap: nowrap; }
  .quick-action { flex-shrink: 0; font-size: 0.75rem; padding: 8px 12px; }
  .msg-time { display: none; }
  .msg-unread-dot { margin-top: 4px; }
  .msg-preview { font-size: 0.7rem; }
  .page-header { padding: 16px 16px 0; }
  .page-body { padding: 12px 16px calc(80px + env(safe-area-inset-bottom, 0)); }
  .card-grid.cols-2, .card-grid.cols-3, .card-grid.cols-4 { grid-template-columns: 1fr; }
  .holiday-form { grid-template-columns: 1fr; }
  .week-calendar { grid-template-columns: 1fr; gap: 0; }
  .week-day-col { flex-direction: row; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .week-day-header { text-align: left; min-width: 60px; }
  .week-day-header .day-num { display: inline; margin: 0 0 0 4px; }
  .week-shifts { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
  .chat-bubble { max-width: 85%; }
  .hol-day { min-height: 36px; font-size: 0.7rem; }
  .hol-day-num { font-size: 0.75rem; }
  .month-calendar { grid-template-columns: repeat(7, 1fr); gap: 2px; }
  .month-cell { min-height: 50px; padding: 2px; }
  .month-shift { font-size: 0.5rem; }
  .rota-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .rota-toolbar > div { justify-content: center; }
  /* Hide week/month views on mobile — list only */
  [data-rota-view="week"], [data-rota-view="month"] { display: none !important; }
  #rota-week-view, #rota-month-view { display: none !important; }
  #rota-list-view { display: block !important; }
}

@media (min-width: 769px) {
  .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .mobile-menu-btn { display: none; }
}

/* Dashboard stacked on mobile with gap */
.dashboard-layout { display: flex; flex-direction: column; gap: 20px; }

@media (min-width: 1200px) {
  .dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
  }
}

/* ── Quick actions ── */
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.quick-action:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.quick-action svg { width: 18px; height: 18px; }

/* ── Detail panel (used in modals and admin) ── */
.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  gap: 16px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 100px;
}
.detail-row span:last-child {
  text-align: right;
  word-break: break-word;
}

/* ── Misc ── */
/* iOS install guide */
.ios-step { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ios-step:last-child { border-bottom: none; }
.ios-step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.rota-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }
.fw-600 { font-weight: 600; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }

/* ── Calendar subscription walkthrough (theme-aware: app is dark by default) ── */
.cal-sub { max-width: 420px; }
.cal-sub-dots { display:flex; gap:6px; justify-content:center; padding:4px 0 12px; }
.cal-dot { width:8px; height:8px; border-radius:50%; background:var(--border); transition:background .2s; }
.cal-dot.active { background:var(--accent); }
.cal-sub-footer { padding:0 20px 20px; display:flex; gap:8px; justify-content:space-between; }
.cal-lead { font-size:.9rem; margin-bottom:14px; color:var(--text-secondary); }
.cal-example-card { display:flex; align-items:stretch; border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; margin-bottom:8px; background:var(--bg-elevated); }
.cal-example-bar { width:5px; background:var(--accent); }
.cal-example-text { padding:10px 14px; }
.cal-example-title { font-weight:600; color:var(--text-primary); }
.cal-example-meta { font-size:.8rem; color:var(--text-muted); margin-top:2px; }
.cal-select { width:100%; padding:10px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:.9rem; background:var(--bg-input); color:var(--text-primary); }
.cal-notif-preview { margin-top:14px; min-height:40px; }
.cal-notif { background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 14px; font-size:.85rem; color:var(--text-primary); }
.cal-action-btn { display:block; width:100%; text-align:center; margin-bottom:10px; }
.cal-platform-hint { margin:2px 0 14px; }
.cal-goodtoknow { background:var(--warning-bg); border:1px solid rgba(245,158,11,0.35); border-radius:var(--radius-sm); padding:12px 14px; font-size:.8rem; }
.cal-goodtoknow strong { display:block; margin-bottom:4px; color:var(--warning); }
.cal-goodtoknow p { margin:0; color:var(--text-secondary); }
.cal-reset-link { display:block; margin-top:14px; background:none; border:none; color:var(--text-muted); font-size:.75rem; text-decoration:underline; cursor:pointer; padding:0; }

/* Per-shift pay factor pill (time and a half etc.) */
.shift-factor-pill {
  display: inline-block;
  padding: 0 5px;
  margin-left: 3px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: middle;
  background: var(--warning, #d98324);
  color: #fff;
  white-space: nowrap;
}

/* ── Rota toolbar structure (2026-08-10 mobile header fix) ──
   .rota-controls wraps .rota-nav (prev/label/next) + .rota-actions
   (Today/Subscribe/settings); .rota-filters is the My Shifts/All Staff group.
   Desktop: one inline row each side, same look as the old flex groups.
   Mobile: stacked rows — arrows at the edges with a centered label, actions
   centered beneath, filter tabs stretched full-width. The lone "List" tab
   (Week/Month are hidden on mobile) disappears with .rota-view-tabs. */
.rota-controls, .rota-nav, .rota-actions, .rota-filters { display: flex; gap: 8px; align-items: center; }
.rota-filters { flex-wrap: wrap; }
@media (max-width: 768px) {
  .rota-view-tabs { display: none; }
  .rota-controls { width: 100%; flex-direction: column; align-items: stretch; gap: 10px; }
  .rota-nav { justify-content: space-between; }
  .rota-nav #rota-week-label { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rota-nav .btn { min-width: 44px; }
  .rota-actions { justify-content: center; }
  .rota-filters { width: 100%; }
  .rota-filters .tabs { flex: 1; }
  .rota-filters .tabs .tab { flex: 1; }
}

/* ── Holidays + Messages toolbars: stop the mobile squeeze (2026-08-10) ──
   Same treatment as the rota toolbar: rows that fight for one line on
   desktop stack cleanly on phones, segmented tabs stretch full-width. */
@media (max-width: 768px) {
  .hol-cal-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .hol-cal-head .tabs .tab { flex: 1; }
  .hol-cal-nav { justify-content: space-between; }
  .hol-cal-nav #hol-cal-month { flex: 1; text-align: center; white-space: nowrap; }
  .hol-cal-nav .btn { min-width: 44px; }
  .hol-manage-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .hol-manage-head .tabs { display: flex; }
  .hol-manage-head .tabs .tab { flex: 1; }
  .inbox-toolbar { flex-wrap: wrap; gap: 8px; }
  .inbox-toolbar .tabs { flex: 1 1 100%; }
  .inbox-toolbar .tabs .tab { flex: 1; }
  .inbox-toolbar #mark-all-read-btn { margin-left: auto; }
}

/* ── Expenses ── */
.exp-actions { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 640px) { .exp-actions { flex-direction: row; } .exp-actions .btn-block { width: auto; flex: 1; } }
.exp-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-elevated); }
.exp-thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.1rem; border: 1px dashed var(--border); }
.exp-receipt-preview img, .exp-receipt-full { width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--radius-sm); background: #fff; }
.exp-check { border-color: var(--warning) !important; }

/* ── Expenses: wide two-column modal + guidance card ── */
.modal.modal-wide { max-width: 880px; }
.exp-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 769px) {
  .exp-layout { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .exp-side { position: sticky; top: 0; }
}
.exp-guide { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.78rem; line-height: 1.45; margin-top: 12px; }
.exp-guide h4 { margin: 0 0 6px; font-size: 0.85rem; }
.exp-guide ul { margin: 2px 0 8px 16px; padding: 0; }
.exp-guide li { margin: 2px 0; }
.exp-guide li.ok::marker { color: var(--accent); }
.exp-guide li.no::marker { color: var(--danger); }
.exp-guide li.eg { color: var(--text-muted); }
.exp-guide-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-top: 6px; }
.exp-guide-rate { margin: 0 0 6px; }
.exp-guide-foot { margin: 8px 0 0; font-size: 0.7rem; color: var(--text-muted); }

/* ── Page header on mobile: wrap title row + action buttons (2026-08-28, Adam: Edit cut off on staff view) ── */
@media (max-width: 768px) {
  .page-header { flex-wrap: wrap; row-gap: 10px; }
  .page-header > .flex { flex-wrap: wrap; min-width: 0; }
  .page-header > .flex:first-child { flex: 1 1 100%; }
  .page-header > .flex:last-child { flex: 1 1 100%; justify-content: flex-start; }
  .page-header h1 { min-width: 0; overflow-wrap: anywhere; font-size: 1.25rem; }
}

/* ── Mobile "More" bottom-sheet (bottom-nav overflow) ── */
.more-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 150; display: none; }
.more-sheet-overlay.open { display: block; }
.more-sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
  z-index: 160;
  transform: translateY(110%);
  transition: transform .2s ease;
}
.more-sheet.open { transform: none; }
.more-sheet a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
}
.more-sheet a:active { background: var(--bg-elevated); }
.more-sheet a.active { color: var(--accent); }
.more-sheet a svg { width: 22px; height: 22px; flex-shrink: 0; }
.more-sheet .handle { width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 6px auto 10px; }
@media (min-width: 769px) {
  .more-sheet, .more-sheet-overlay { display: none !important; }
}

/* ── Important updates, reach report, inbox nudge, roomier compose (2026-10-16) ── */
.toggle-locked { opacity: .6; cursor: not-allowed; }
.imp-pill { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--danger-bg); color: var(--danger); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
.reach-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--border); color: var(--text-secondary); }
.reach-chip[data-status="read"] { background: rgba(16, 185, 129, .12); color: #059669; }
.reach-chip[data-status="email_phone"], .reach-chip[data-status="forced"] { background: var(--info-bg); color: var(--info); }
.reach-chip[data-status="none"] { background: var(--danger-bg); color: var(--danger); }
.reach-chip[data-status="unknown"] { opacity: .7; }
.inbox-nudge { display: flex; align-items: center; gap: 12px; padding: 12px 36px 12px 16px; margin-bottom: 16px; border: 1px solid var(--warning); background: var(--warning-bg); border-radius: var(--radius); position: relative; font-size: .85rem; }
.inbox-nudge .inbox-nudge-x { position: absolute; top: 6px; right: 10px; background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; padding: 4px; }
.modal.compose-modal { max-width: 760px; }
#compose-editor .rte-body { min-height: 190px !important; }

/* ── Rota shift filter (Days / Nights), 2026-11-11 ── */
.rota-band { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); overflow: hidden; }
.rota-band.hidden { display: none; }
.rota-band-btn, .rota-band-x { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text-secondary); font: inherit; font-size: 0.75rem; font-weight: 600; padding: 5px 10px; cursor: pointer; transition: all 0.15s; }
.rota-band-btn:hover, .rota-band-x:hover { color: var(--text-primary); }
.rota-band.active { border-color: var(--accent); background: var(--accent-glow); }
.rota-band.active .rota-band-btn { color: var(--accent); }
.rota-band-chip { padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--bg-root); font-size: 0.68rem; font-weight: 700; line-height: 1.5; }
.rota-band-chip.hidden, .rota-band-x.hidden { display: none; }
.rota-band-x { padding: 5px 9px 5px 4px; font-size: 1rem; line-height: 1; color: var(--accent); }
.rota-band-seg .tab { flex: 1; padding: 8px 12px; font-size: 0.82rem; }
.rota-band-rule { margin-bottom: 4px; color: var(--text-secondary); min-height: 1.4em; }
.rota-band-count { min-height: 1.2em; }
@media (max-width: 768px) { .rota-filters .rota-band { flex: 0 0 auto; } .rota-filters:has(.rota-band:not(.hidden)) .tabs { flex: 1 0 100%; } }

/* Rota staff filter: flyout sized to the longest name (one line), anchored right so it opens leftwards; trigger unchanged */
#rota-staff-filter .cs-dropdown {
  left: auto; right: 0;
  width: max-content; min-width: 100%; max-width: min(320px, calc(100vw - 32px));
}
#rota-staff-filter .cs-option { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
