/* ═══════════════════════════════════════════════════════════════════
   QLS Suite — Modern design system
   ═══════════════════════════════════════════════════════════════════
   Currently used by the HR module. When you want to retrofit other
   apps to this look, just swap their stylesheet import from
   /shared/suite.css to /shared/suite-modern.css.

   Design language:
   - QLS palette (burgundy + gold + almond) on near-white surfaces
   - Full-height almond sidebar with white-rail active state
   - Modern Sense-inspired layout: airy spacing, soft shadows, sentence
     case, rounded corners, generous padding
   - Poppins throughout (no serif headings here)
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   1. Tokens
   ═══════════════════════════════════════════════════════════════════ */
:root {
  /* Brand palette */
  --burgundy:      #7A2535;
  --burgundy-dark: #5E1A27;
  --gold:          #C5B58E;
  --gold-light:    #E8DCC4;
  --gold-dark:     #9E8E68;
  --almond:        #EAE0CD;
  --almond-light:  #F5EFE2;
  --almond-pale:   #F9F4E8;
  --onyx:          #1D1D1B;
  --charcoal:      #383838;
  --mocha:         #A47864;
  --brass:         #A68A64;
  --white:         #FFFFFF;

  /* Surfaces */
  --bg-page:       var(--mist);
  --bg-sidebar:    var(--white);
  --bg-card:       var(--white);
  --bg-band:       var(--almond-light);
  --border:        #EFE7D5;
  --border-strong: #DCD0B8;

  /* Text */
  --ink-900: var(--onyx);
  --ink-700: var(--charcoal);
  --ink-500: var(--mocha);
  --ink-400: #B5A28E;

  /* Role / staff-group palette (avatars + group badges) */
  --role-director:  #7A2535;
  --role-office:    #383838;
  --role-factory:   #9E8E68;
  --role-logistics: #2D6A4F;
  --role-default:   #A47864;

  /* Semantic */
  --success-bg: #DDF1E0;  --success: #2D6A4F;
  --warning-bg: #FBEBC8;  --warning: #8A5A1A;
  --danger-bg:  #FBE0E0;  --danger:  #B81E1E;
  --info-bg:    #E5DFD0;  --info:    var(--burgundy);

  /* Spacing scale */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;

  /* Radius */
  --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(29,29,27,0.05);
  --shadow:    0 1px 3px rgba(29,29,27,0.08), 0 1px 2px rgba(29,29,27,0.04);
  --shadow-lg: 0 8px 24px rgba(29,29,27,0.10), 0 2px 6px rgba(29,29,27,0.05);
}

/* ═══════════════════════════════════════════════════════════════════
   2. Reset + base
   ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; margin: 0; padding: 0; overflow-x: hidden; }
body {
  font-family: 'Poppins', -apple-system, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-700);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink-900); font-weight: 500; line-height: 1.3; }
h1 { font-size: 24px; font-weight: 600; }
h2 { font-size: 20px; }
h3 { font-size: 16px; font-weight: 600; }
a { color: var(--burgundy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   3. App shell — fixed sidebar, topbar, scrolling main
   ═══════════════════════════════════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 1fr;
  grid-template-areas:
    "sidebar main";
  height: calc(100vh - 58px);
  margin-top: 58px;
  width: 100%;
}

/* Topbar */
.topbar {
  grid-area: topbar;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--s-5);
  gap: var(--s-4);
}
.topbar-spacer { flex: 1; }
.topbar-search {
  flex: 0 0 360px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-700);
  outline: none;
  font-family: inherit;
}
.topbar-search:focus { border-color: var(--gold-dark); }
.topbar-icon-btn {
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--ink-500);
  display: grid;
  place-items: center;
  font-size: 16px;
  position: relative;
}
.topbar-icon-btn:hover { background: var(--almond-light); color: var(--ink-900); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--burgundy);
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--s-4) 0;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 0 var(--s-5) var(--s-5);
  display: flex; align-items: center; gap: var(--s-3);
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand-mark {
  width: 36px; height: 36px;
  background: var(--burgundy);
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar-brand-text-title {
  font-size: 12px; font-weight: 600;
  color: var(--burgundy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar-brand-text-sub {
  font-size: 10px; color: var(--ink-500);
  letter-spacing: 0.04em;
}
.sidebar-section-label {
  padding: var(--s-4) var(--s-5) var(--s-2);
  font-size: 9px;
  color: var(--brass);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sidebar-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px var(--s-5);
  font-size: 13px;
  color: var(--ink-700);
  cursor: pointer;
  border-left: 3px solid transparent;
  background: none; border-top: none; border-right: none; border-bottom: none;
  width: 100%; text-align: left;
  font-family: inherit;
  text-decoration: none;
}
.sidebar-item:hover { background: #f9f5ef; color: var(--ink-900); text-decoration: none; }
.sidebar-item.active {
  background: #f5ede6;
  color: var(--burgundy);
  border-left-color: var(--burgundy);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.sidebar-icon { font-size: 15px; opacity: 0.85; }
.sidebar-spacer { flex: 1; }
.sidebar-footer {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-500);
  display: flex; align-items: center; gap: var(--s-3);
}

/* Main scrolling area */
.main {
  grid-area: main;
  overflow-y: auto;
  padding: var(--s-5) var(--s-6) var(--s-7);
}

/* ═══════════════════════════════════════════════════════════════════
   4. Avatars + role colours
   ═══════════════════════════════════════════════════════════════════ */
.avatar {
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  background: var(--role-default);
  width: 36px; height: 36px; font-size: 13px;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 88px; height: 88px; font-size: 28px; box-shadow: 0 0 0 4px white, 0 0 0 5px var(--border); }
.avatar.role-director  { background: var(--role-director); }
.avatar.role-office    { background: var(--role-office); }
.avatar.role-factory   { background: var(--role-factory); }
.avatar.role-logistics { background: var(--role-logistics); }

/* Group badges (used in directory) */
.group-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
}
.group-badge.role-director  { background: #FBE0E0; color: var(--burgundy); }
.group-badge.role-office    { background: #E5E5E5; color: var(--charcoal); }
.group-badge.role-factory   { background: #F0E8D8; color: var(--gold-dark); }
.group-badge.role-logistics { background: var(--success-bg); color: var(--success); }
.group-badge.role-default   { background: #F0EBE0; color: var(--ink-500); }

/* ═══════════════════════════════════════════════════════════════════
   5. Common page elements
   ═══════════════════════════════════════════════════════════════════ */
.breadcrumb {
  font-size: 13px;
  color: var(--ink-500);
  display: flex;
  gap: var(--s-2);
  align-items: center;
  margin-bottom: var(--s-4);
}
.breadcrumb a { color: var(--ink-500); }
.breadcrumb .sep { color: var(--border-strong); }
.breadcrumb .current { color: var(--ink-900); font-weight: 500; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
  gap: var(--s-3);
}
.page-header h1 + .page-header-sub { margin-top: 4px; }
.page-header-sub { font-size: 13px; color: var(--ink-500); }

/* Notice / banner */
.notice {
  background: var(--bg-band);
  border-left: 3px solid var(--gold-dark);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  margin-bottom: var(--s-4);
  font-size: 13px;
  color: var(--ink-700);
}
.notice.info    { border-left-color: var(--burgundy); }
.notice.warning { border-left-color: #E5A53B; background: var(--warning-bg); }
.notice.danger  { border-left-color: var(--danger); background: var(--danger-bg); }

/* ═══════════════════════════════════════════════════════════════════
   6. Cards
   ═══════════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  background: var(--burgundy);
  padding: var(--s-3) var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  border-bottom: none;
}
.card-header h3 { color: var(--white); font-size: 14px; font-weight: 600; flex: 1; }
.card-header-icon { color: var(--gold-light); font-size: 16px; }
.card-header-actions { display: flex; gap: var(--s-2); }
.card-header .btn { color: var(--white); border-color: rgba(255,255,255,0.3); }
.card-header .btn:hover { background: rgba(255,255,255,0.15); }
.card-body { padding: var(--s-5); }
.card-body.tight { padding: var(--s-4); }
.card-body.flush { padding: 0; }
.card-footer {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════
   7. Summary cards row (top of profile/dashboard)
   ═══════════════════════════════════════════════════════════════════ */
.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.summary-card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: var(--s-4);
}
.summary-card-title { font-size: 12px; color: var(--ink-500); margin-bottom: var(--s-3); }
.summary-card-figures { display: flex; gap: var(--s-4); }
.summary-card-figure { display: flex; flex-direction: column; gap: 2px; }
.summary-card-label { font-size: 11px; color: var(--ink-500); }
.summary-card-value { font-size: 22px; font-weight: 600; color: var(--ink-900); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.success { background: var(--success); }
.dot.warning { background: #E5A53B; }
.dot.danger  { background: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════
   8. Detail list (icon + label + value rows)
   ═══════════════════════════════════════════════════════════════════ */
.detail-list { display: flex; flex-direction: column; gap: var(--s-3); }
.detail-row { display: flex; gap: var(--s-3); align-items: flex-start; }
.detail-row-icon {
  width: 32px; height: 32px;
  background: var(--almond-light);
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--burgundy); font-size: 14px;
  flex-shrink: 0;
}
.detail-row-info { flex: 1; min-width: 0; }
.detail-row-label { font-size: 11px; color: var(--ink-500); }
.detail-row-value { font-size: 13px; color: var(--ink-900); font-weight: 500; word-break: break-word; }

/* List rows (events, documents, etc.) */
.list-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px var(--s-4);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.list-row:last-child { border-bottom: none; }
.list-row-icon { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0; font-size: 13px; }
.list-row-text { flex: 1; min-width: 0; color: var(--ink-700); }
.list-row-meta { font-size: 12px; color: var(--ink-500); }

/* ═══════════════════════════════════════════════════════════════════
   9. Badges
   ═══════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-muted   { background: #F0EBE0;           color: var(--ink-500); }
.badge-info    { background: var(--info-bg);    color: var(--info); }

/* ═══════════════════════════════════════════════════════════════════
   10. Buttons
   ═══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px var(--s-4);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-900);
  cursor: pointer;
  transition: all 0.15s ease;
  height: 36px;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { height: 30px; padding: 4px 12px; font-size: 12px; }
.btn-lg { height: 44px; padding: 10px 22px; font-size: 14px; }
.btn-primary { background: var(--burgundy); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--burgundy-dark); }
.btn-secondary { background: var(--almond-light); color: var(--burgundy); }
.btn-secondary:hover:not(:disabled) { background: var(--almond); }
.btn-ghost { background: transparent; color: var(--ink-700); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--almond-light); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: var(--white); }

/* ═══════════════════════════════════════════════════════════════════
   11. Inputs + forms
   ═══════════════════════════════════════════════════════════════════ */
.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--white);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-900);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; min-height: 80px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(197,181,142,0.25);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--bg-page);
  color: var(--ink-500);
  cursor: not-allowed;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; color: var(--ink-500); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.form-grid .full { grid-column: 1 / -1; }

/* ═══════════════════════════════════════════════════════════════════
   12. Tables
   ═══════════════════════════════════════════════════════════════════ */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  background: var(--bg-band);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 12px var(--s-4);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.table td {
  padding: 12px var(--s-4);
  border-bottom: 1px solid var(--border);
  color: var(--ink-700);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--almond-light); cursor: pointer; }
.table tbody tr:last-child td { border-bottom: none; }
.table-cell-name { display: flex; align-items: center; gap: var(--s-3); color: var(--ink-900); font-weight: 500; }
.table-cell-name-sub { font-size: 11px; color: var(--ink-500); font-weight: 400; }
.table-empty { padding: var(--s-7) var(--s-4); text-align: center; color: var(--ink-500); }

/* Filter bar (above tables) */
.filter-bar {
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  display: flex; align-items: center; gap: var(--s-3);
  flex-wrap: wrap;
}
.filter-bar .input,
.filter-bar .select { height: 32px; font-size: 12px; }
.filter-bar .input { flex: 1; min-width: 200px; max-width: 320px; }
.filter-bar .select { width: auto; min-width: 130px; }
.filter-bar-spacer { flex: 1; }
.filter-bar-meta { font-size: 12px; color: var(--ink-500); }

/* ═══════════════════════════════════════════════════════════════════
   13. Modals
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(29,29,27,0.55);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  width: 720px;
  max-width: 95vw;
  max-height: 88vh;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-band);
}
.modal-title { font-size: 16px; color: var(--ink-900); font-weight: 600; }
.modal-close { background: transparent; border: none; font-size: 22px; color: var(--ink-500); cursor: pointer; line-height: 1; padding: 0; }
.modal-close:hover { color: var(--ink-900); }
.modal-body { padding: var(--s-5); overflow-y: auto; }
.modal-footer {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
}

/* ═══════════════════════════════════════════════════════════════════
   14. Toasts
   ═══════════════════════════════════════════════════════════════════ */
.toast-area {
  position: fixed; top: 80px; right: 20px;
  z-index: 300;
  display: flex; flex-direction: column;
  gap: var(--s-2);
}
.toast {
  padding: 10px 14px;
  font-size: 13px;
  background: var(--white);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--burgundy);
  min-width: 240px;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: #E5A53B; }

/* ═══════════════════════════════════════════════════════════════════
   15. Diff view (for change-request review)
   ═══════════════════════════════════════════════════════════════════ */
.diff-grid {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  gap: var(--s-2) var(--s-4);
  font-size: 13px;
  align-items: start;
}
.diff-label { color: var(--ink-500); font-size: 11px; padding-top: 6px; }
.diff-from { padding: 6px 10px; background: var(--danger-bg); border-radius: var(--r-sm); color: var(--ink-900); }
.diff-to   { padding: 6px 10px; background: var(--success-bg); border-radius: var(--r-sm); color: var(--ink-900); }

/* ═══════════════════════════════════════════════════════════════════
   16. Profile content grid
   ═══════════════════════════════════════════════════════════════════ */
.profile-content { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: var(--s-4); }
.profile-content > * { min-width: 0; }

/* ═══════════════════════════════════════════════════════════════════
   17. Spinner
   ═══════════════════════════════════════════════════════════════════ */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--burgundy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════
   17b. Leave-balance cards (3-up Total / Statutory / Allowance, etc.)
   ═══════════════════════════════════════════════════════════════════ */
.leave-balance-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.leave-balance-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.balance-card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: var(--s-4);
  text-align: center;
}
.balance-card .balance-label { font-size: 12px; color: var(--ink-500); margin-bottom: var(--s-2); }
.balance-card .balance-value { font-size: 36px; font-weight: 600; color: var(--ink-900); line-height: 1; }
.balance-card .balance-sub { font-size: 11px; color: var(--ink-500); margin-top: var(--s-2); }
.balance-card.accent .balance-value { color: var(--success); }
.balance-card.warn .balance-value { color: var(--warning); }
.balance-bar {
  height: 6px; background: var(--almond-light); border-radius: var(--r-pill); overflow: hidden;
  margin-top: var(--s-3);
}
.balance-bar-fill {
  height: 100%; background: var(--success); border-radius: var(--r-pill);
  transition: width 0.3s;
}

/* ═══════════════════════════════════════════════════════════════════
   17b1. Toggle switch (replacement for checkboxes where it looks nicer)
   ═══════════════════════════════════════════════════════════════════
   Markup:
     <label class="toggle">
       <input type="checkbox" id="my-toggle">
       <span class="toggle-slider"></span>
       <span class="toggle-label">Label text</span>
     </label>
*/
.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-700);
  user-select: none;
}
.toggle input {
  /* Hide the actual checkbox but keep it accessible */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.toggle-slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: var(--border-strong);
  border-radius: var(--r-pill);
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider {
  background: var(--burgundy);
}
.toggle input:checked + .toggle-slider::after {
  transform: translateX(16px);
}
.toggle input:focus-visible + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(197,181,142,0.4);
}
.toggle:hover .toggle-slider {
  background: var(--gold-dark);
}
.toggle:hover input:checked + .toggle-slider {
  background: var(--burgundy-dark);
}
.toggle-label { display: inline-block; }

/* ═══════════════════════════════════════════════════════════════════
   17c. Mode tabs (inside a card-header, e.g. Daily / Hourly)
   ═══════════════════════════════════════════════════════════════════ */
.calc-mode-tab {
  background: transparent;
  border: none;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.calc-mode-tab:hover { color: var(--ink-900); }
.calc-mode-tab.active {
  color: var(--burgundy);
  border-bottom-color: var(--burgundy);
  background: var(--white);
}

/* ═══════════════════════════════════════════════════════════════════
   18. Empty state
   ═══════════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: var(--s-7) var(--s-5);
  color: var(--ink-500);
  font-size: 13px;
}
.empty-state h3 {
  color: var(--ink-900);
  margin-bottom: var(--s-2);
}

/* ═══════════════════════════════════════════════════════════════════
   19. Responsive
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto 1fr;
    grid-template-areas:
      "topbar"
      "sidebar"
      "main";
    height: auto; min-height: 100vh;
  }
  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding: var(--s-2);
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-brand { display: none; }
  .sidebar-section-label { display: none; }
  .sidebar-item { flex-shrink: 0; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar-item.active { border-left: none; border-bottom-color: var(--burgundy); }
  .sidebar-spacer, .sidebar-footer { display: none; }
  .summary-row { grid-template-columns: 1fr 1fr; }
  .profile-content { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .main { padding: var(--s-4); }
}
