/* ═════════════════════════════════════════════════════════════════════════
   FlexRate — Master Stylesheet (Style Guide v1)
   ═════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ───────────────────────────────────────────────────────── */
:root {
  /* Core */
  --accent:        #E5A100;
  --accent-hover:  #CC8F00;
  --accent-soft:   rgba(229,161,0,0.08);
  --accent-gradient: linear-gradient(135deg, #E5A100, #F5B800);

  /* Surfaces */
  --page-bg:       #F9F7F2;
  --surface:       #FFFFFF;
  --sidebar-bg:    #111827;
  --input-bg:      #F8FAFC;

  /* Text */
  --text-primary:  #111827;
  --text-secondary:#6B7280;
  --text-muted:    #9CA3AF;
  --label:         #374151;

  /* Borders */
  --border:        #E5E7EB;
  --border-light:  #F3F4F6;

  /* Status */
  --success:       #10B981;
  --warning:       #F59E0B;
  --danger:        #EF4444;
  --info:          #3B82F6;
  --indigo:        #6366F1;
  --rose:          #F43F5E;

  /* Layout */
  --sidebar-w:     240px;
  --topbar-h:      64px;

  /* Radius */
  --radius:        12px;
  --radius-sm:     8px;

  /* Shadows */
  --shadow-card:   0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-hover:  0 4px 12px rgba(0,0,0,0.08);

  /* Refined shadow scale (Stripe-inspired — lighter than Bootstrap defaults) */
  --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.06);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,.10), 0 4px 6px -4px rgba(15,23,42,.06);
  --shadow-xl: 0 20px 25px -5px rgba(15,23,42,.12), 0 8px 10px -6px rgba(15,23,42,.06);
}

/* Override Bootstrap modal / offcanvas shadows */
.modal-content   { box-shadow: var(--shadow-xl) !important; border: 1px solid var(--border); border-radius: var(--radius); }
.dropdown-menu   { box-shadow: var(--shadow-lg) !important; border: 1px solid var(--border); }
.card            { box-shadow: var(--shadow-sm); }
.card:hover      { box-shadow: var(--shadow-md); }

html { min-height: 100%; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-hover); }

/* ═══ SIDEBAR ════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--sidebar-bg);
  display: flex; flex-direction: column; z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 32px; display: flex; align-items: center; gap: 12px;
}

.logo-icon {
  width: 36px; height: 36px; background: var(--accent);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { color: #fff; width: 20px; height: 20px; }

.logo-text { display: flex; flex-direction: column; }
.logo-text span:first-child { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.logo-text span:last-child { font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.4); letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.55); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: all 0.15s ease; cursor: pointer; position: relative;
}
.nav-item:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.06); }
.nav-item.active { color: #fff; background: rgba(229,161,0,0.15); }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 1.8; }
.nav-item-sub { padding-left: 32px; font-size: 13px; }

.nav-badge {
  margin-left: auto; background: var(--accent); color: #1a1400;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; line-height: 1.4;
}

.nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 12px 12px; }

.nav-section-label {
  padding: 8px 12px 4px; font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.3);
}

/* ═══ TOP BAR ════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; z-index: 90;
}

.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--page-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 16px; width: 380px;
  transition: border-color 0.15s ease;
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229,161,0,0.1); }
.search-bar svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  border: none; background: none; outline: none;
  font-family: inherit; font-size: 13px; color: var(--text-primary); width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 20px; }

.notification-btn {
  position: relative; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: none; background: var(--page-bg);
  cursor: pointer; transition: background 0.15s ease;
}
.notification-btn:hover { background: var(--border); }
.notification-btn svg { width: 20px; height: 20px; color: var(--text-secondary); }

.notification-badge {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--surface);
}

.user-profile {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; padding: 4px 8px; border-radius: 10px;
  transition: background 0.15s ease; text-decoration: none;
}
.user-profile:hover { background: var(--page-bg); }
.user-info { text-align: right; }
.user-info-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-info-role { font-size: 11px; color: var(--text-secondary); font-weight: 500; }

.user-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #1a1400; font-size: 14px; font-weight: 600;
}

/* ═══ MAIN CONTENT AREA ═════════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
  padding: 28px 32px 48px; min-height: calc(100vh - var(--topbar-h));
}

.header-row {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px;
}
.page-header { margin-bottom: 0; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); font-weight: 400; }
.page-subtitle strong { color: var(--accent); font-weight: 600; }

.header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ═══ BUTTONS ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease; border: none; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent-gradient); color: #1a1400;
  box-shadow: 0 2px 8px rgba(229,161,0,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(229,161,0,0.35); transform: translateY(-1px); color: #1a1400; }

.btn-outline {
  background: var(--surface); color: var(--text-primary); border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--page-bg); border-color: var(--accent); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ═══ METRIC CARDS ═══════════════════════════════════════════════════════ */
.metrics-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 16px;
}

.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; display: flex; justify-content: space-between; align-items: flex-start;
  box-shadow: var(--shadow-card); transition: all 0.2s ease; cursor: pointer;
}
.metric-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }

.metric-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-secondary); margin-bottom: 10px;
}
.metric-value { font-size: 30px; font-weight: 700; color: var(--text-primary); line-height: 1; }

.metric-change { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; margin-top: 6px; }
.metric-change.up { color: var(--success); }
.metric-change.down { color: var(--danger); }
.metric-change svg { width: 12px; height: 12px; }

.metric-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.metric-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.metric-icon.yellow  { background: rgba(229,161,0,0.08); color: #E5A100; }
.metric-icon.indigo  { background: rgba(99,102,241,0.08); color: #6366F1; }
.metric-icon.emerald { background: rgba(16,185,129,0.08); color: #10B981; }
.metric-icon.blue    { background: rgba(59,130,246,0.08); color: #3B82F6; }
.metric-icon.rose    { background: rgba(244,63,94,0.08); color: #F43F5E; }

/* ═══ ALERT CARDS ════════════════════════════════════════════════════════ */
.alerts-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 28px;
}

.alert-card {
  background: var(--surface); border-radius: var(--radius); padding: 18px 20px;
  display: flex; justify-content: space-between; align-items: flex-start;
  cursor: pointer; transition: all 0.2s ease; border: 1px solid transparent; position: relative;
}
.alert-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.alert-card.amber    { border-color: rgba(245,158,11,0.25); background: linear-gradient(135deg, rgba(245,158,11,0.04), rgba(245,158,11,0.01)); }
.alert-card.critical { border-color: rgba(239,68,68,0.25); background: linear-gradient(135deg, rgba(239,68,68,0.04), rgba(239,68,68,0.01)); }
.alert-card.info     { border-color: rgba(59,130,246,0.25); background: linear-gradient(135deg, rgba(59,130,246,0.04), rgba(59,130,246,0.01)); }
.alert-card.ok       { border-color: rgba(16,185,129,0.25); background: linear-gradient(135deg, rgba(16,185,129,0.04), rgba(16,185,129,0.01)); }
.alert-card.inactive { border-color: var(--border); background: var(--surface); }

.alert-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 5px; margin-bottom: 10px;
}
.alert-badge.amber-badge    { background: rgba(245,158,11,0.12); color: #D97706; }
.alert-badge.critical-badge { background: rgba(239,68,68,0.12); color: #DC2626; }
.alert-badge.info-badge     { background: rgba(59,130,246,0.12); color: #2563EB; }
.alert-badge.ok-badge       { background: rgba(16,185,129,0.12); color: #059669; }

.alert-value { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1; margin-bottom: 4px; }
.alert-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

.alert-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.alert-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }
.alert-icon.amber-icon    { color: #F59E0B; background: rgba(245,158,11,0.1); }
.alert-icon.critical-icon { color: #EF4444; background: rgba(239,68,68,0.1); }
.alert-icon.info-icon     { color: #3B82F6; background: rgba(59,130,246,0.1); }
.alert-icon.ok-icon       { color: #10B981; background: rgba(16,185,129,0.1); }

.pulse-dot {
  position: absolute; top: 14px; right: 14px;
  width: 7px; height: 7px; background: #EF4444; border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ═══ PANELS ═════════════════════════════════════════════════════════════ */
.bottom-row { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}

.panel-header {
  display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 16px;
}
.panel-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.panel-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.panel-action {
  font-size: 13px; font-weight: 600; color: var(--accent);
  text-decoration: none; cursor: pointer; transition: color 0.15s ease;
}
.panel-action:hover { color: var(--accent-hover); }

/* ═══ EVENT LIST ═════════════════════════════════════════════════════════ */
.event-list { padding: 0 24px 20px; }

.event-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border-light);
}
.event-item:last-child { border-bottom: none; }

.event-date-col {
  width: 48px; text-align: center; flex-shrink: 0;
  background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 4px;
}
.event-date-col .month { font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }
.event-date-col .day { font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1.1; }

.event-content { flex: 1; min-width: 0; }
.event-name {
  font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event-name a { color: var(--accent); text-decoration: none; font-weight: 700; }
.event-name a:hover { text-decoration: underline; }
.event-venue { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.event-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.event-time-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; margin-top: 2px; }

/* Tags */
.etag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 5px; }
.etag.staff     { background: rgba(59,130,246,0.08); color: #3B82F6; }
.etag.time      { background: rgba(99,102,241,0.08); color: #6366F1; }
.etag.confirmed { background: rgba(16,185,129,0.08); color: #059669; }
.etag.pending   { background: rgba(245,158,11,0.08); color: #D97706; }

/* ═══ CHARTS: DONUT ══════════════════════════════════════════════════════ */
.right-panels { display: flex; flex-direction: column; gap: 20px; }

.donut-section { padding: 0 24px 24px; display: flex; align-items: center; gap: 28px; }
.donut-wrap { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.donut-center-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.donut-center-label .num { font-size: 22px; font-weight: 700; color: var(--text-primary); display: block; line-height: 1; }
.donut-center-label .lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-top: 2px; }

.legend { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.legend-item { display: flex; align-items: center; justify-content: space-between; }
.legend-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-value { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* ═══ CHARTS: BAR ════════════════════════════════════════════════════════ */
.bar-section { padding: 0 24px 24px; }
.bar-item { margin-bottom: 16px; }
.bar-item:last-child { margin-bottom: 0; }
.bar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bar-label { font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-secondary); }
.bar-value { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.bar-track { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }
.bar-fill.fill-1 { background: #E5A100; }
.bar-fill.fill-2 { background: #6366F1; }
.bar-fill.fill-3 { background: #10B981; }
.bar-fill.fill-4 { background: #3B82F6; }
.bar-fill.fill-5 { background: #F43F5E; }

/* ═══ FORMS (App Context) ═══════════════════════════════════════════════ */
.fr-form-group { margin-bottom: 18px; }
.fr-form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--label); margin-bottom: 7px; letter-spacing: 0.01em;
}
.fr-input {
  width: 100%; padding: 10px 14px;
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  color: var(--text-primary); background: var(--input-bg);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.fr-input::placeholder { color: var(--text-muted); }
.fr-input:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(229,161,0,0.1);
}
select.fr-input { cursor: pointer; }

/* ═══ TABLES ═════════════════════════════════════════════════════════════ */
.fr-table { width: 100%; border-collapse: collapse; }
.fr-table thead th {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-secondary); padding: 12px 16px; border-bottom: 1px solid var(--border);
  text-align: left;
}
.fr-table tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  font-size: 14px; color: var(--text-primary);
}
.fr-table tbody tr:last-child td { border-bottom: none; }
.fr-table tbody tr:hover { background: rgba(229,161,0,0.03); }

/* Tabular lining numerals — makes decimal points and digits column-align */
.fr-table .fr-num,
.fr-table tfoot td,
.fr-table .row-total td {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Right-align all numeric columns by default */
.fr-table th.text-right,
.fr-table td.text-right { text-align: right; }

/* Totals row styling — double border above, bold, subtle bg */
.fr-table tfoot tr td,
.fr-table .row-total td {
  font-weight: 600;
  border-top: 2px solid var(--text-primary);
  background: var(--border-light);
  padding-top: 10px;
}

/* Dimmed zero — shows "—" visually lighter than actual numbers */
.fr-table .fr-zero { color: var(--text-muted); }

/* Row expand indicator */
.fr-table tbody tr.fr-expandable { cursor: pointer; }
.fr-table tbody tr.fr-expandable:hover td:first-child::after {
  content: ' ↓';
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}
.fr-table tbody tr.fr-expandable.fr-expanded:hover td:first-child::after { content: ' ↑'; }
.fr-table .fr-detail-row { background: var(--border-light); }
.fr-table .fr-detail-row td { padding: 12px 16px 12px 32px; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }

/* ═══ STATUS BADGES (pills) ═════════════════════════════════════════════ */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;   /* full pill */
  letter-spacing: 0.01em;
  white-space: nowrap;
  vertical-align: middle;
}

/* Dot prefix — rendered via ::before on the inner span */
.status-pill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Payroll-specific states ───────────────────────────────────────────── */
.status-pill.pill-draft {
  background: #F1F5F9; color: #475569;
}
.status-pill.pill-draft .status-pill-dot { background: #94A3B8; }

.status-pill.pill-review {
  background: #EFF6FF; color: #1D4ED8;
}
.status-pill.pill-review .status-pill-dot { background: #3B82F6; }

.status-pill.pill-approved {
  background: #F0FDF4; color: #15803D;
}
.status-pill.pill-approved .status-pill-dot { background: #22C55E; }

.status-pill.pill-paid {
  background: #ECFDF5; color: #065F46;
}
.status-pill.pill-paid .status-pill-dot { background: #10B981; }

.status-pill.pill-locked {
  background: #EDE9FE; color: #5B21B6;
}
.status-pill.pill-locked .status-pill-dot { background: #7C3AED; }

.status-pill.pill-rejected {
  background: #FEF2F2; color: #991B1B;
}
.status-pill.pill-rejected .status-pill-dot { background: #EF4444; }

/* ── Keep old .status-tag for non-payroll pages (events, assignments) ─── */
/* Do NOT delete .status-tag — it is used on Events, Staff, Expenses pages */
.status-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 5px;
}
.status-tag.active, .status-tag.confirmed, .status-tag.completed, .status-tag.approved, .status-tag.paid {
  background: rgba(16,185,129,0.08); color: #059669;
}
.status-tag.planned, .status-tag.draft, .status-tag.pending, .status-tag.under-review {
  background: rgba(245,158,11,0.08); color: #D97706;
}
.status-tag.cancelled, .status-tag.rejected, .status-tag.overdue {
  background: rgba(239,68,68,0.08); color: #DC2626;
}
.status-tag.inactive, .status-tag.locked {
  background: var(--border-light); color: var(--text-muted);
}

/* ═══ ALERT BANNERS ══════════════════════════════════════════════════════ */
.fr-alert {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: 13px; font-weight: 500;
}
.fr-alert svg { width: 20px; height: 20px; flex-shrink: 0; }
.fr-alert a { font-weight: 600; }
.fr-alert.warning {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25); color: #92400E;
}
.fr-alert.warning svg { color: #F59E0B; }
.fr-alert.info {
  background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25); color: #1E40AF;
}
.fr-alert.info svg { color: #3B82F6; }
.fr-alert.success {
  background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); color: #065F46;
}
.fr-alert.success svg { color: #10B981; }
.fr-alert.danger {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #991B1B;
}
.fr-alert.danger svg { color: #EF4444; }

/* ═══ 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.4; }
.empty-state p { font-size: 14px; font-weight: 500; }

/* ═══ MOBILE MENU BUTTON ═════════════════════════════════════════════════ */
.mobile-menu-btn {
  display: none; width: 40px; height: 40px; border: none;
  background: var(--page-bg); border-radius: var(--radius-sm);
  cursor: pointer; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.mobile-menu-btn:hover { background: var(--border); }
.mobile-menu-btn svg { width: 20px; height: 20px; color: var(--text-secondary); }

/* ═══ LOGOUT BUTTON (topbar) ═════════════════════════════════════════════ */
.logout-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px; display: flex; align-items: center; color: var(--text-muted);
  transition: color 0.15s ease;
}
.logout-btn:hover { color: var(--danger); }
.logout-btn svg { width: 18px; height: 18px; }

/* ═══ LIFECYCLE STEPPER ══════════════════════════════════════════════════ */
.fr-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.fr-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 100px;
  position: relative;
}

/* Connector line between steps */
.fr-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.fr-step.fr-step-done:not(:last-child)::after {
  background: var(--success);
}

/* Step circle */
.fr-step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  position: relative; z-index: 1;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.fr-step.fr-step-done .fr-step-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.fr-step.fr-step-active .fr-step-circle {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(229,161,0,0.12);
}
.fr-step.fr-step-locked .fr-step-circle {
  background: #EDE9FE;
  border-color: #7C3AED;
  color: #5B21B6;
}

.fr-step-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}
.fr-step.fr-step-done .fr-step-label,
.fr-step.fr-step-active .fr-step-label { color: var(--text-primary); }
.fr-step.fr-step-locked .fr-step-label { color: #5B21B6; }

.fr-step-meta {
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

/* Checkmark SVG inside done circles */
.fr-step-check { display: none; }
.fr-step.fr-step-done .fr-step-check { display: block; }
.fr-step.fr-step-done .fr-step-num   { display: none; }

/* ═══ KPI CARDS ══════════════════════════════════════════════════════════ */
.fr-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.fr-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
}

/* Coloured top bar — 3px accent strip */
.fr-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--border));
  border-radius: var(--radius) var(--radius) 0 0;
}

.fr-kpi-card.kpi-gross   { --kpi-color: var(--accent); }
.fr-kpi-card.kpi-net     { --kpi-color: var(--success); }
.fr-kpi-card.kpi-paye    { --kpi-color: var(--info); }
.fr-kpi-card.kpi-uif     { --kpi-color: #8B5CF6; }
.fr-kpi-card.kpi-count   { --kpi-color: var(--text-muted); }
.fr-kpi-card.kpi-warning { --kpi-color: var(--warning); }

.fr-kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.fr-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}

.fr-kpi-value.kpi-large { font-size: 1.75rem; }

.fr-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══ PAY RUN DETAIL LAYOUT ═════════════════════════════════════════════ */
.fr-payrun-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.fr-payrun-main { min-width: 0; }

.fr-payrun-sidebar {
  position: sticky;
  top: calc(var(--topbar-h, 64px) + 16px);
}

.fr-action-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.fr-action-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--border-light, #f9fafb);
}

.fr-action-panel-header h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  margin: 0;
}

.fr-action-panel-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fr-action-panel .btn { width: 100%; justify-content: center; }

.fr-action-panel-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.fr-action-panel-note {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 2px;
}

/* Expandable row toggle */
.fr-expandable { cursor: pointer; }
.fr-expandable:hover { background: var(--bg-secondary, #f9fafb); }
.fr-detail-row td { background: var(--bg-secondary, #f9fafb); }

/* Zero-value dash */
.fr-zero { color: var(--text-muted); font-weight: 400; }

@media (max-width: 900px) {
  .fr-payrun-layout {
    grid-template-columns: 1fr;
  }
  .fr-payrun-sidebar {
    position: static;
    order: -1;
  }
}

/* ═══ CREATE PAY RUN LAYOUT ══════════════════════════════════════════════ */
.fr-create-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

.fr-create-main { min-width: 0; }

.fr-create-aside {
  position: sticky;
  top: calc(var(--topbar-h, 64px) + 16px);
}

.fr-live-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.fr-live-summary-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft, rgba(229,161,0,0.06));
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent-hover, #b88600);
}

.fr-live-summary-body { padding: 14px 16px; }

.fr-live-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  font-size: 13px;
}
.fr-live-summary-row:last-of-type { border-bottom: none; }

.fr-live-summary-row .label { color: var(--text-secondary); }
.fr-live-summary-row .value {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.fr-live-summary-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fr-live-summary-total .label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.fr-live-summary-total .value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .fr-create-layout { grid-template-columns: 1fr; }
  .fr-create-aside { position: static; order: -1; }
}

/* ═══ RESPONSIVE ═════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .metrics-row, .alerts-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .bottom-row { grid-template-columns: 1fr; }
  .metrics-row, .alerts-row { grid-template-columns: repeat(2, 1fr); }
  .search-bar { width: 260px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: flex; }
  .main { margin-left: 0; padding: 20px 16px 40px; }
  .topbar { left: 0; padding: 0 16px; }
  .metrics-row, .alerts-row { grid-template-columns: 1fr; }
  .search-bar { width: 200px; }
}

/* ═══ LOGIN PAGE ═════════════════════════════════════════════════════════ */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #0A0E1A; overflow: hidden; position: relative;
}
.login-body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(229,161,0,0.10), transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(245,184,0,0.07), transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 80%, rgba(16,185,129,0.04), transparent 50%);
}
.login-body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

.login-wrapper {
  position: relative; z-index: 10; width: 100%; max-width: 440px; padding: 24px;
  animation: fadeUp 0.6s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card {
  background: #FFFFFF; border-radius: 20px; padding: 44px 40px 36px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04),
    0 24px 64px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.08) inset;
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(229,161,0,0.7) 40%, rgba(245,184,0,0.7) 60%, transparent 100%);
}

.login-logo-area { display: flex; flex-direction: column; align-items: center; margin-bottom: 36px; gap: 14px; }

.login-logo-mark {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #E5A100, #F5B800);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(229,161,0,0.35), 0 0 0 1px rgba(229,161,0,0.2);
}
.login-logo-mark svg { width: 28px; height: 28px; stroke: white; stroke-width: 1.5; fill: none; }

.login-brand-name { font-size: 18px; font-weight: 600; color: #0F172A; letter-spacing: -0.3px; }
.login-brand-name span { color: #E5A100; }

.login-headline { text-align: center; margin-bottom: 32px; }
.login-headline h1 { font-size: 22px; font-weight: 600; color: #0F172A; letter-spacing: -0.4px; line-height: 1.3; }
.login-headline p { font-size: 14px; color: #64748B; margin-top: 6px; font-weight: 400; }

.login-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2);
  border-radius: 100px; padding: 3px 10px 3px 7px;
  font-size: 11.5px; color: #059669; font-weight: 500; margin-bottom: 10px;
}
.login-status-dot {
  width: 6px; height: 6px; background: #10b981; border-radius: 50%;
  animation: login-pulse 2s infinite;
}
@keyframes login-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* Login form fields */
.login-field { margin-bottom: 18px; }
.login-field label {
  display: block; font-size: 13px; font-weight: 500;
  color: #374151; margin-bottom: 7px; letter-spacing: 0.01em;
}
.login-input-wrap { position: relative; }
.login-input-wrap .field-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: #94a3b8; stroke-width: 1.75; fill: none;
  pointer-events: none; transition: stroke 0.2s;
}
.login-input-wrap input {
  width: 100%; padding: 11px 14px 11px 38px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: #0F172A;
  background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 10px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
}
.login-input-wrap input::placeholder { color: #b0bcc9; }
.login-input-wrap input:focus {
  border-color: #E5A100; background: #fff;
  box-shadow: 0 0 0 3px rgba(229,161,0,0.1);
}
.login-input-wrap:focus-within .field-icon { stroke: #E5A100; }

.login-toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  display: flex; align-items: center; color: #94a3b8; transition: color 0.2s;
}
.login-toggle-pw:hover { color: #E5A100; }
.login-toggle-pw svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.75; fill: none; }

.login-field-meta {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px;
}
.login-field-meta label { margin-bottom: 0; }
.login-forgot {
  font-size: 12.5px; color: #E5A100; text-decoration: none; font-weight: 500; transition: opacity 0.2s;
}
.login-forgot:hover { opacity: 0.75; }

.login-remember {
  display: flex; align-items: center; gap: 8px; margin-bottom: 18px;
  font-size: 13px; color: #64748B; cursor: pointer;
}
.login-remember input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: #E5A100; cursor: pointer;
}

.btn-signin {
  width: 100%; padding: 12px; margin-top: 8px;
  background: linear-gradient(135deg, #E5A100, #F5B800); color: #1a1400;
  font-family: 'DM Sans', sans-serif; font-size: 14.5px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer; letter-spacing: 0.01em;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 4px 14px rgba(229,161,0,0.3), 0 1px 3px rgba(229,161,0,0.2);
  position: relative; overflow: hidden;
}
.btn-signin::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 60%);
  border-radius: 10px;
}
.btn-signin:hover {
  filter: brightness(1.08); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229,161,0,0.38), 0 1px 3px rgba(229,161,0,0.2);
}
.btn-signin:active { transform: translateY(0); }

.login-card-footer {
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid #E2E8F0; text-align: center;
}
.login-card-footer p { font-size: 13px; color: #64748B; }
.login-card-footer a { color: #E5A100; text-decoration: none; font-weight: 500; transition: opacity 0.2s; }
.login-card-footer a:hover { opacity: 0.75; }

.login-copyright {
  text-align: center; margin-top: 20px; font-size: 12px;
  color: rgba(255,255,255,0.25); font-family: 'DM Mono', monospace; letter-spacing: 0.03em;
}

/* Login error message */
.login-error {
  display: flex; align-items: center; gap: 8px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 18px;
  font-size: 13px; color: #DC2626; font-weight: 500;
}
.login-error svg { width: 16px; height: 16px; flex-shrink: 0; stroke: #EF4444; }

/* ═══ VALIDATION ERRORS ══════════════════════════════════════════════════ */
.field-validation-error,
.fr-validation-msg { font-size: 12px; color: #DC2626; margin-top: 4px; display: block; }
.validation-summary-errors { color: #DC2626; font-size: 13px; margin-bottom: 12px; }
.validation-summary-errors ul { padding-left: 16px; }

/* ═══ TEMPDATA ALERTS ════════════════════════════════════════════════════ */
.fr-toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: var(--radius); margin-bottom: 20px;
  font-size: 13px; font-weight: 500; animation: fadeUp 0.3s ease both;
}
.fr-toast.success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); color: #065F46; }
.fr-toast.error,
.fr-toast.danger  { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #991B1B; }
.fr-toast.warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.30); color: #92400E; }
.fr-toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.fr-toast-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: inherit; opacity: 0.5; padding: 4px; display: flex;
}
.fr-toast-close:hover { opacity: 1; }

/* ═══ PAGINATION ═════════════════════════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; gap: 3px;
  padding: 14px 16px; border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  font-size: 13px; font-weight: 500; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none;
  transition: all 0.15s ease; border: 1px solid transparent;
}
.pagination a:hover { background: var(--page-bg); border-color: var(--border); color: var(--text-primary); }
.pagination span.active {
  background: var(--accent-soft); border-color: rgba(229,161,0,0.3);
  color: var(--accent); font-weight: 600;
}
.pagination span.disabled { color: var(--text-muted); pointer-events: none; }

/* ═══ STATUS TAG — SUSPENDED ═════════════════════════════════════════════ */
.status-tag.suspended { background: rgba(245,158,11,0.08); color: #D97706; }

/* ═══ STAFF LIST ═════════════════════════════════════════════════════════ */
.staff-filter-bar {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px; flex-wrap: wrap;
}
.staff-search-wrap {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: 8px;
  background: var(--input-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px; height: 38px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.staff-search-wrap:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229,161,0,0.1);
}
.staff-search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.staff-search-input {
  border: none; background: transparent; outline: none; width: 100%;
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text-primary);
}
.staff-search-input::placeholder { color: var(--text-muted); }
.staff-filter-select { width: 160px; height: 38px; padding: 0 10px; }
.staff-name-cell {
  display: flex; align-items: center; gap: 10px; font-weight: 500;
}
.staff-avatar-sm {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-gradient); color: #1a1400;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.rating-display {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}

@media (max-width: 768px) {
  .staff-filter-bar { flex-direction: column; align-items: stretch; }
  .staff-search-wrap { min-width: unset; }
  .staff-filter-select { width: 100%; }
  .fr-table thead { display: none; }
  .fr-table tbody td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 16px; border-bottom: none;
  }
  .fr-table tbody td::before {
    content: attr(data-label);
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--text-muted); flex-shrink: 0;
  }
  .fr-table tbody tr { border-bottom: 1px solid var(--border-light); }
  .fr-table tbody tr:last-child { border-bottom: none; }
}

/* ═══ FORM HELPERS ═══════════════════════════════════════════════════════ */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-half { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.required-star { color: var(--danger); margin-left: 2px; }
.field-hint {
  display: inline; font-size: 11px; font-weight: 400;
  color: var(--text-muted); margin-left: 6px;
}
@media (max-width: 640px) {
  .form-row-2, .form-row-half { grid-template-columns: 1fr; }
}

/* ═══ WIZARD / MULTI-STEP FORM ═══════════════════════════════════════════ */
.wizard-steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 24px; flex-wrap: nowrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.wizard-step {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.wizard-step-circle {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--border); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  transition: all 0.2s ease;
}
.wizard-step.active .wizard-step-circle {
  background: var(--accent-gradient); color: #1a1400;
  box-shadow: 0 0 0 3px rgba(229,161,0,0.15);
}
.wizard-step.completed .wizard-step-circle {
  background: rgba(16,185,129,0.12); color: #059669;
}
.wizard-step.completed .wizard-step-circle::before {
  content: '✓'; font-size: 12px;
}
.wizard-step.completed .wizard-step-circle { font-size: 0; }
.wizard-step-label {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: color 0.2s ease; white-space: nowrap;
}
.wizard-step.active .wizard-step-label   { color: var(--text-primary); font-weight: 600; }
.wizard-step.completed .wizard-step-label { color: #059669; }
.wizard-step-line {
  flex: 1; height: 1px; background: var(--border); min-width: 20px;
}

.wizard-panel-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--border-light);
}
.wizard-panel-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent-soft); border: 1px solid rgba(229,161,0,0.2);
  display: flex; align-items: center; justify-content: center;
}
.wizard-panel-icon svg { width: 22px; height: 22px; color: var(--accent); }
.wizard-panel-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.wizard-panel-sub   { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.wizard-panel-body  { padding: 24px; }
.wizard-panel-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-top: 1px solid var(--border-light);
  background: var(--page-bg); border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Role Cards ────────────────────────────────────────────────────── */
.wizard-roles-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.role-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; overflow: hidden;
  transition: border-color 0.15s ease;
}
.role-card:has(.role-checkbox:checked) { border-color: rgba(229,161,0,0.4); }
.role-card-header {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface); flex-wrap: wrap;
}
.role-checkbox-label {
  display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1;
  font-size: 14px; font-weight: 500; color: var(--text-primary);
}
.role-checkbox { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.role-card-name { font-size: 14px; font-weight: 500; }
.primary-radio-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-secondary); cursor: pointer;
  background: var(--accent-soft); border: 1px solid rgba(229,161,0,0.3);
  border-radius: 100px; padding: 3px 10px;
}
.primary-radio { width: 13px; height: 13px; accent-color: var(--accent); cursor: pointer; }
.role-card-meta {
  display: flex; align-items: center; gap: 8px; margin-left: auto;
}
.role-default-rate { font-size: 12px; color: var(--text-muted); }
.role-card-overrides { padding: 14px 16px; background: var(--page-bg); border-top: 1px solid var(--border-light); }

/* ── ID Number Preview ─────────────────────────────────────────────── */
.id-preview { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.id-tag {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 100px;
  background: rgba(16,185,129,0.08); color: #059669;
}

/* ── Confirm Summary ───────────────────────────────────────────────── */
.confirm-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.confirm-section { background: var(--page-bg); border-radius: var(--radius-sm); padding: 16px; }
.confirm-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
}
.confirm-row {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--border-light);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row span:first-child { color: var(--text-secondary); flex-shrink: 0; }
.confirm-row span:last-child  { color: var(--text-primary); font-weight: 500; text-align: right; }

@media (max-width: 768px) {
  .wizard-steps { overflow-x: auto; }
  .wizard-step-label { display: none; }
  .wizard-step.active .wizard-step-label { display: block; }
  .confirm-grid { grid-template-columns: 1fr; }
  .wizard-panel-header { padding: 16px; }
  .wizard-panel-body   { padding: 16px; }
  .wizard-panel-footer { padding: 12px 16px; }
}

/* ═══ STAFF DETAIL PAGE ══════════════════════════════════════════════════ */

/* Header with avatar */
.detail-header-row { display: flex; align-items: center; gap: 16px; }
.detail-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-gradient); color: #1a1400;
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Summary metric cards */
.detail-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.detail-metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow-card);
}
.detail-metric-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-secondary); display: block; margin-bottom: 6px;
}
.detail-metric-value { display: flex; align-items: center; gap: 4px; }
.detail-metric-num { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }

/* Stars */
.star-icon { width: 18px; height: 18px; }
.star-icon.star-sm { width: 14px; height: 14px; }
.star-icon.star-filled { fill: #F59E0B; stroke: #D97706; stroke-width: 1.5; }
.star-icon.star-empty { fill: none; stroke: #9CA3AF; stroke-width: 2; }
.star-icon.star-clickable { cursor: pointer; width: 28px; height: 28px; transition: transform 0.1s; }
.star-icon.star-clickable:hover { transform: scale(1.2); }
.star-rating-input { display: inline-flex; gap: 2px; align-items: center; }

/* Tab bar */
.detail-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 0; overflow-x: auto;
}
.detail-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 20px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.15s ease; white-space: nowrap;
}
.detail-tab svg { width: 16px; height: 16px; stroke-width: 1.8; }
.detail-tab:hover { color: var(--text-primary); background: var(--page-bg); }
.detail-tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
}

/* Panel body for tab content */
.detail-panel { border-top: none; border-radius: 0 0 var(--radius) var(--radius); }
.detail-tab-content { padding: 24px; }

/* Info sections */
.detail-section { margin-bottom: 28px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-title {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
}
.detail-section-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}

/* Info grid (key-value pairs) */
.detail-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px;
}
.detail-info-item { display: flex; flex-direction: column; gap: 2px; }
.detail-info-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-muted);
}
.detail-info-value { font-size: 14px; color: var(--text-primary); font-weight: 500; }

/* Reveal button for masked fields */
.btn-reveal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: none; background: var(--page-bg);
  border-radius: 6px; cursor: pointer; margin-left: 6px; vertical-align: middle;
  transition: background 0.15s ease;
}
.btn-reveal:hover { background: var(--border); }
.btn-reveal svg { width: 14px; height: 14px; stroke-width: 1.8; color: var(--text-secondary); }

/* Performance summary */
.detail-perf-summary {
  background: var(--page-bg); border-radius: var(--radius-sm);
  padding: 20px; margin-bottom: 20px;
}
.perf-avg { text-align: center; }
.perf-avg-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 8px;
}
.perf-avg-stars { display: flex; align-items: center; justify-content: center; gap: 4px; }
.perf-avg-num { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-left: 8px; }
.perf-avg-count { font-size: 12px; color: var(--text-muted); display: block; margin-top: 4px; }

/* Responsive */
@media (max-width: 1024px) {
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .detail-metrics { grid-template-columns: 1fr; }
  .detail-info-grid { grid-template-columns: 1fr; }
  .detail-tabs { gap: 0; }
  .detail-tab { padding: 10px 14px; font-size: 12px; }
  .detail-tab svg { display: none; }
  .detail-tab-content { padding: 16px; }
  .detail-header-row { flex-wrap: wrap; }
}

/* ─── TIME DROPDOWN ─────────────────────────────────────────────────────── */
.fr-time-dropdown-wrapper {
  position: relative;
}

.fr-time-dropdown-list {
  position: absolute;
  z-index: 1050;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  padding: 0;
  margin: 0;
  list-style: none;
}

.fr-time-option {
  padding: 8px 12px;
  font-size: .875rem;
  cursor: pointer;
  color: var(--text-primary);
}

.fr-time-option:hover {
  background: var(--surface-hover);
}

/* ─── DATE PICKER ───────────────────────────────────────────────────────── */
.fr-date-wrapper {
  position: relative;
}

.fr-date-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.fr-date-panel {
  position: absolute;
  z-index: 1060;
  top: calc(100% + 4px);
  left: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  padding: 16px;
}

.fr-dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fr-dp-title {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-primary);
}

.fr-dp-nav {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.fr-dp-nav:hover {
  background: var(--surface-hover);
}

.fr-dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.fr-dp-dayheaders {
  margin-bottom: 4px;
}

.fr-dp-dayheader {
  text-align: center;
  font-size: .7rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 0;
}

.fr-dp-days {
  margin-bottom: 8px;
}

.fr-dp-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: .8rem;
  cursor: pointer;
  color: var(--text-primary);
  position: relative;
}

.fr-dp-day:hover:not(.fr-dp-disabled):not(.fr-dp-selected) {
  background: var(--surface-hover);
}

.fr-dp-day.fr-dp-disabled {
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
}

.fr-dp-day.fr-dp-today {
  color: var(--primary);
  font-weight: 700;
}

.fr-dp-today-dot {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.fr-dp-day.fr-dp-selected {
  background: #F59E0B;
  color: #fff;
  font-weight: 500;
  border-radius: 50%;
}

.fr-dp-day.fr-dp-selected:hover {
  background: #D97706;
}

.fr-dp-day.fr-dp-selected .fr-dp-today-dot {
  background: #fff;
}

.fr-dp-day.fr-dp-empty {
  cursor: default;
}

.fr-dp-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.fr-dp-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fr-dp-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  font-size: .825rem;
  color: var(--text-primary);
}

.fr-dp-shortcut:hover {
  background: var(--surface-hover);
}

.fr-dp-shortcut-date {
  font-size: .75rem;
  color: var(--text-muted);
}

.fr-dp-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.fr-dp-time-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .825rem;
  color: var(--text-secondary);
}

.fr-dp-time-input-wrap {
  width: 100px;
}

.fr-dp-time-input {
  font-size: .825rem;
  padding: 6px 10px;
}

.fr-dp-footer {
  padding-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.fr-dp-confirm {
  width: 100%;
}

/* ── Year selector ─────────────────────────────────────────────────────── */
.fr-dp-year-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-primary);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.fr-dp-year-toggle:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

.fr-year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 0;
}

.fr-year-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  border: none;
  border-radius: var(--radius-md);
  background: none;
  font-size: .85rem;
  cursor: pointer;
  color: var(--text-primary);
  position: relative;
}

.fr-year-cell:hover:not(.fr-year-disabled):not(.fr-year-selected) {
  background: var(--surface-hover);
}

.fr-year-cell.fr-year-disabled {
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
}

.fr-year-cell.fr-year-current {
  color: var(--primary);
  font-weight: 700;
}

.fr-year-cell.fr-year-selected {
  background: #F59E0B;
  color: #fff;
  font-weight: 600;
}

.fr-year-cell.fr-year-selected:hover {
  background: #D97706;
}

.fr-year-today-dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.fr-year-cell.fr-year-selected .fr-year-today-dot {
  background: #fff;
}

/* ─── ASSIGN STAFF — employee card list ─────────────────────────────────── */
.assign-employee-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.assign-employee-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: default;
  transition: background 0.15s;
}

.assign-employee-card:last-child {
  border-bottom: none;
}

.assign-employee-card:hover {
  background: var(--surface-hover);
}

.assign-employee-card.selected {
  background: rgba(29, 158, 117, 0.08);
  border-left: 3px solid var(--primary);
}

.assign-employee-card.assigned {
  opacity: 0.6;
}

.assign-card-paid {
  opacity: 0.6;
  pointer-events: none;
  background: var(--surface);
}

.assign-card-paid td {
  color: var(--text-muted) !important;
}

.assign-employee-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assign-employee-name {
  font-weight: 600;
  font-size: 13px;
  display: block;
}

.assign-employee-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.assign-employee-actions {
  flex-shrink: 0;
}

/* ─── PRIMARY NAV ITEM WITH CHEVRON ─────────────────────────────────────── */
.nav-item-primary-row {
  display: flex;
  align-items: center;
}

.nav-chevron-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
}

.nav-chevron-btn[aria-expanded="true"] .nav-chevron-icon {
  transform: rotate(180deg);
}

.nav-sub-group {
  padding-left: 0;
}
}