/* ===========================================================
   Uhuru People — design system
   Brand primary is the navy from the corporate logo.
   =========================================================== */

:root {
  /* Surface */
  --surface: #ffffff;
  --surface-alt: #f6f7f9;
  --surface-raised: #ffffff;
  --border: #e3e6eb;
  --border-strong: #c8cdd6;

  /* Type */
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-faint: #98a0ad;

  /* Brand — Uhuru navy from the logo. */
  --brand: #1a2d5c;
  --brand-hover: #233c79;
  --brand-pressed: #131f3f;
  --brand-tint: rgba(26, 45, 92, 0.08);
  --brand-tint-strong: rgba(26, 45, 92, 0.16);
  --brand-on: #ffffff;

  /* Status */
  --success: #1f8a4c;
  --warning: #b8860b;
  --danger: #b3261e;
  --info: var(--brand);
  --success-tint: rgba(31, 138, 76, 0.12);
  --warning-tint: rgba(184, 134, 11, 0.14);
  --danger-tint: rgba(179, 38, 30, 0.12);
  --info-tint: var(--brand-tint);

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

  /* Radius */
  --radius-pill: 999px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.04), 0 1px 1px rgba(15, 20, 25, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 20, 25, 0.08), 0 1px 2px rgba(15, 20, 25, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 20, 25, 0.18);

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --content-max: 1240px;
}

[data-theme="dark"] {
  --surface: #0f1419;
  --surface-alt: #1a1f26;
  --surface-raised: #1a1f26;
  --border: #2a313b;
  --border-strong: #394251;
  --text: #e6e9ef;
  --text-muted: #8b94a3;
  --text-faint: #6b7382;
  --brand: #6c8bd1;
  --brand-hover: #88a3df;
  --brand-pressed: #4f6cb0;
  --brand-tint: rgba(108, 139, 209, 0.14);
  --brand-tint-strong: rgba(108, 139, 209, 0.24);
  --success: #5dc28a;
  --warning: #e2b35b;
  --danger: #e0716c;
  --success-tint: rgba(93, 194, 138, 0.14);
  --warning-tint: rgba(226, 179, 91, 0.14);
  --danger-tint: rgba(224, 113, 108, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.7);
}

/* Reset / base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p { margin: 0 0 var(--space-3); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.num { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

:is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  outline-color: rgba(26, 45, 92, 0.6);
}
[data-theme="dark"] :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline-color: rgba(108, 139, 209, 0.7);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* App shell */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  min-height: 100vh;
}
.sidebar { grid-area: sidebar; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--space-4) var(--space-3) var(--space-3); border-bottom: 1px solid var(--border); }
.sidebar-logo { display: block; width: 100%; max-width: 168px; height: auto; }
[data-theme="dark"] .sidebar-logo { background: #fff; border-radius: 6px; padding: 6px 10px; }
.sidebar-tagline { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.6px; font-weight: 600; text-align: center; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--brand); color: var(--brand-on); display: grid; place-items: center; font-weight: 700; font-size: 14px; letter-spacing: 0.5px; }
.brand-text { font-weight: 600; font-size: 15px; }
.brand-text small { display: block; color: var(--text-muted); font-weight: 400; font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase; }
.nav { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-3); }
.nav-section { margin-top: var(--space-4); padding: 0 var(--space-3) var(--space-2); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.nav-section:first-child { margin-top: 0; }
.nav-link { display: flex; align-items: center; gap: var(--space-3); padding: 9px var(--space-3); border-radius: var(--radius-md); color: var(--text); font-weight: 500; cursor: pointer; transition: background 120ms ease; }
.nav-link:hover { background: var(--surface-alt); text-decoration: none; }
.nav-link.active { background: var(--brand-tint); color: var(--brand); }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link .badge { margin-left: auto; background: var(--brand); color: var(--brand-on); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--radius-pill); }

.topbar { grid-area: topbar; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-5); position: sticky; top: 0; z-index: 20; }
.topbar-search { flex: 1; max-width: 460px; position: relative; }
.topbar-search input { width: 100%; padding: 9px var(--space-4) 9px 38px; background: var(--surface-alt); border: 1px solid transparent; border-radius: var(--radius-md); color: var(--text); }
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.topbar-search input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.topbar-search input:focus { background: var(--surface); border-color: var(--border-strong); outline: none; }
.topbar-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; }
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; color: var(--text-muted); display: grid; place-items: center; position: relative; }
.icon-btn:hover { background: var(--surface-alt); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--surface); }

.user-menu { position: relative; }
.user-trigger { display: flex; align-items: center; gap: var(--space-2); padding: 4px 10px 4px 4px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-pill); color: var(--text); }
.user-trigger:hover { background: var(--surface-alt); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-on); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.user-name { font-weight: 500; font-size: 13px; }
.user-role { font-size: 11px; color: var(--text-muted); }

.dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: var(--space-2); z-index: 30; display: none; }
.dropdown.open { display: block; }
.dropdown-header { padding: var(--space-3); border-bottom: 1px solid var(--border); margin-bottom: var(--space-2); }
.dropdown-item { display: flex; align-items: center; gap: var(--space-3); padding: 8px var(--space-3); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.dropdown-item:hover { background: var(--surface-alt); }
.dropdown-item svg { width: 16px; height: 16px; color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border); margin: var(--space-2) 0; }
.role-pill { margin-left: auto; padding: 2px 8px; background: var(--brand-tint); color: var(--brand); border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }
.role-pill.active::before { content: ''; display: inline-block; width: 6px; height: 6px; background: currentColor; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

.main { grid-area: main; overflow-x: hidden; }
.page { max-width: var(--content-max); margin: 0 auto; padding: var(--space-5) var(--space-6); }
.page-header { display: flex; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-5); }
.page-title h1 { margin-bottom: 4px; }
.page-title p { color: var(--text-muted); margin: 0; }
.page-actions { margin-left: auto; display: flex; gap: var(--space-2); flex-shrink: 0; }

/* Page header — photo hero treatment (rotates through the 3 Kilimanjaro shots per route) */
.page-header.page-hero {
  position: relative;
  overflow: hidden;
  align-items: center;
  border-radius: var(--radius-lg);
  padding: 22px var(--space-5);
  background-image:
    linear-gradient(100deg, rgba(13, 23, 48, 0.82) 0%, rgba(13, 23, 48, 0.55) 55%, rgba(13, 23, 48, 0.28) 100%),
    var(--hero-img, url('kilimanjaro-overview.jpg'));
  background-size: cover;
  background-position: center 55%;
}
.page-header.page-hero .page-title h1 { color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
.page-header.page-hero .page-title p { color: rgba(255, 255, 255, 0.92); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.page-header.page-hero .page-title p a { color: #e3c477; }
.page-header.page-hero .page-title p a:hover { color: #f0d999; }
.page-header.page-hero .page-title code { background: rgba(255, 255, 255, 0.15); color: #fff; padding: 1px 5px; border-radius: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: 9px var(--space-4); border-radius: var(--radius-md); font-weight: 500; border: 1px solid transparent; background: var(--surface); color: var(--text); transition: transform 80ms ease, background 120ms ease, border-color 120ms ease; min-height: 36px; white-space: nowrap; }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: var(--brand-on); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-pressed); }
.btn-secondary { border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-alt); }
.btn-danger { color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-tint); }
.btn-sm { padding: 6px 12px; min-height: 30px; font-size: 13px; }
.btn-block { width: 100%; }

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--space-3); }
.card-header h2, .card-header h3 { margin: 0; }
.card-header .meta { color: var(--text-muted); font-size: 13px; margin-left: auto; }
.card-body { padding: var(--space-5); }
.card-footer { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); display: flex; gap: var(--space-2); justify-content: flex-end; background: var(--surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid { display: grid; gap: var(--space-4); }
.grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1080px) {
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.stack-y { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* Stats */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-sm); position: relative; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: var(--space-2); color: var(--text); }
.stat-meta { margin-top: var(--space-2); font-size: 12px; color: var(--text-muted); }
.stat-icon { position: absolute; top: var(--space-4); right: var(--space-4); width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; }
.stat-icon svg { width: 18px; height: 18px; }

/* Pills */
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; background: var(--surface-alt); color: var(--text-muted); transition: background 200ms ease, color 200ms ease; }
.pill-success { background: var(--success-tint); color: var(--success); }
.pill-warning { background: var(--warning-tint); color: var(--warning); }
.pill-danger  { background: var(--danger-tint);  color: var(--danger); }
.pill-info    { background: var(--info-tint);    color: var(--info); }
.pill-neutral { background: var(--surface-alt);  color: var(--text-muted); }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 12px var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data thead th { font-weight: 600; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; background: var(--surface-alt); cursor: pointer; }
table.data thead th:hover { color: var(--text); }
table.data tbody tr:hover { background: var(--surface-alt); cursor: pointer; }
table.data tbody tr:last-child td { border-bottom: none; }

/* Forms */
.form-section { padding: var(--space-5); border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: none; }
.form-section-title { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.form-section-title h3 { flex: 1; }
.form-row { margin-bottom: var(--space-4); }
.form-row:last-child { margin-bottom: 0; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 720px) { .form-row-2 { grid-template-columns: 1fr; } }
label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; }
.label-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 6px; }
.label-row label { margin: 0; }
.req-tag { font-size: 10px; font-weight: 600; color: var(--text-muted); padding: 1px 6px; border: 1px solid var(--border); border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.4px; }
.helper { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.field-error { display: none; color: var(--danger); font-size: 12px; margin-top: 4px; }
.form-row.has-error .field-error { display: block; }
.form-row.has-error input,
.form-row.has-error select,
.form-row.has-error textarea { border-color: var(--danger); }

input[type="text"], input[type="email"], input[type="date"], input[type="number"],
input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text); min-height: 44px; transition: border-color 120ms ease;
}
textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-tint-strong); outline-offset: 0; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.checkbox, .radio { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.checkbox input, .radio input { width: 16px; height: 16px; min-height: auto; }

.sticky-footer { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: var(--space-4) var(--space-5); display: flex; gap: var(--space-2); justify-content: flex-end; align-items: center; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.save-state { margin-right: auto; color: var(--text-muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.save-state svg { width: 14px; height: 14px; }
.save-state.saving { color: var(--warning); }
.save-state.saved { color: var(--success); }

/* Sectioned/collapsible */
details.section { border-bottom: 1px solid var(--border); }
details.section:last-child { border-bottom: none; }
details.section[open] { background: var(--surface); }
details.section > summary { list-style: none; cursor: pointer; padding: var(--space-4) var(--space-5); display: flex; align-items: center; gap: var(--space-3); font-weight: 600; font-size: 15px; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: ''; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform 160ms ease; }
details.section[open] > summary::after { transform: rotate(-135deg); }
details.section > summary .pill { font-size: 11px; }
details.section .section-body { padding: 0 var(--space-5) var(--space-5); }

.section-locked summary { color: var(--text-muted); }
.section-locked .lock-note { margin-left: auto; margin-right: var(--space-4); color: var(--text-muted); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.section-locked .lock-note svg { width: 14px; height: 14px; }

/* Approval queue */
.queue { display: flex; flex-direction: column; gap: var(--space-3); }
.queue-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-4); align-items: center; }
.queue-meta { display: flex; flex-direction: column; gap: 2px; }
.queue-meta .name { font-weight: 600; }
.queue-meta .detail { color: var(--text-muted); font-size: 13px; }
.queue-meta .reason { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.queue-actions { display: flex; gap: var(--space-2); }

/* Calendar */
.cal-toolbar { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.cal-month { font-weight: 600; font-size: 16px; min-width: 160px; }
.cal-grid { display: grid; grid-template-columns: 240px repeat(31, 32px); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.cal-grid .cal-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px 10px; font-size: 12px; color: var(--text-muted); background: var(--surface); }
.cal-grid .cal-cell.weekend, .cal-grid .cal-cell.holiday { background: var(--surface-alt); }
.cal-grid .cal-cell.holiday { background: repeating-linear-gradient(45deg, var(--surface-alt), var(--surface-alt) 4px, var(--brand-tint) 4px, var(--brand-tint) 8px); }
.cal-grid .cal-cell.cal-name { grid-column: 1; font-size: 13px; font-weight: 500; color: var(--text); background: var(--surface); padding: 8px 16px; display: flex; align-items: center; gap: 8px; }
.cal-grid .cal-cell.cal-name .avatar { width: 22px; height: 22px; font-size: 10px; }
.cal-grid .cal-cell.header { font-weight: 600; color: var(--text-muted); }
.cal-grid .cal-cell.cal-name.header { padding: 8px 16px; }
.cal-bar { background: var(--brand); color: var(--brand-on); border-radius: var(--radius-sm); height: 22px; font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0 8px; overflow: hidden; white-space: nowrap; cursor: pointer; }
.cal-bar.sick { background: var(--warning); }
.cal-bar.parental { background: #6b21a8; }
.cal-bar.scheduled { opacity: 0.7; border: 2px dashed rgba(255,255,255,0.6); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 20, 25, 0.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: var(--space-4); }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal.lg { max-width: 760px; }
.modal-header { padding: var(--space-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-header h2 { margin: 0; flex: 1; }
.modal-close { border: 0; background: transparent; color: var(--text-muted); width: 32px; height: 32px; border-radius: var(--radius-md); display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-alt); color: var(--text); }
.modal-body { padding: var(--space-5); }
.modal-footer { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); display: flex; gap: var(--space-2); justify-content: flex-end; background: var(--surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Toasts */
.toast-stack { position: fixed; top: var(--space-5); right: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); z-index: 200; max-width: 360px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 12px var(--space-4); display: flex; align-items: flex-start; gap: var(--space-3); animation: slideIn 220ms ease; }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger  { border-left-color: var(--danger); }
.toast.error   { border-left-color: var(--danger); }
.toast-body { flex: 1; font-size: 13px; }
.toast-body strong { display: block; margin-bottom: 2px; font-size: 13px; }
.toast-body p { margin: 0; color: var(--text-muted); }
.toast-dismiss { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Empty states */
.empty-state { text-align: center; padding: var(--space-7) var(--space-5); color: var(--text-muted); }
.empty-state svg { width: 36px; height: 36px; margin-bottom: var(--space-3); color: var(--text-faint); }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }
.empty-state p { margin-bottom: var(--space-4); }

/* Skeletons */
.skeleton { background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 50%, var(--surface-alt) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  background: var(--surface, #ffffff); /* white during the logo intro, before the mountain fades in */
  display: grid;
  place-items: center;
  overflow: hidden;
  z-index: 1000;
  opacity: 1;
  visibility: visible;
  transition: opacity 700ms ease, visibility 700ms ease;
  padding: var(--space-5);
}
/* Sequence: logo appears → holds → fades out; mountain then fades in and
   cinematic-zooms; whole splash fades away to reveal the sign-in screen. */
.splash-bg {
  position: absolute;
  inset: -4%; /* slight oversize so the zoom never reveals an edge */
  background-image: url('kilimanjaro-splash.jpg');
  background-size: cover;
  background-position: center 62%;
  filter: saturate(0.85) brightness(0.8);
  opacity: 0;
  transform: scale(1);
  animation: splashBgIn 0.55s ease-out 0.85s forwards, splashZoom 1.9s ease-out 0.85s forwards;
}
.splash-scrim {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse at center, rgba(13, 23, 48, 0.25) 0%, rgba(13, 23, 48, 0.82) 100%),
    linear-gradient(180deg, rgba(13, 23, 48, 0.6) 0%, rgba(13, 23, 48, 0.25) 42%, rgba(13, 23, 48, 0.7) 100%);
  animation: splashBgIn 0.55s ease-out 0.85s forwards;
}
.splash-logo {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 600px;
  height: auto;
  opacity: 0;
  transform: scale(0.92);
  animation: splashLogoInOut 1.1s ease-in-out forwards;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.35));
}
.splash-logo {
  background: #fff;
  border-radius: 10px;
  padding: 10px 16px;
}
.splash-section-label {
  display: none;
  position: relative;
  z-index: 2;
  text-align: center;
  opacity: 0;
  transform: scale(0.94);
}
.splash-section-label .ssl-text {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 600;
  letter-spacing: 7px;
  text-transform: uppercase;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(0, 0, 0, 0.3);
}
.splash-section-label .ssl-rule {
  display: block;
  width: 72px;
  height: 3px;
  margin: 20px auto 0;
  background: #c9a84c;
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
@keyframes splashBgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes splashLogo {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes splashLogoInOut {
  0%   { opacity: 0; transform: scale(0.92); }
  20%  { opacity: 1; transform: scale(1); }
  68%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}
@keyframes splashZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}
.splash.splash-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* Quick in-app "new section" flash — same layers, much shorter timing */
.splash.splash-transition .splash-bg {
  animation: splashBgIn 0.2s ease-out forwards, splashZoomFast 0.65s ease-out forwards;
}
.splash.splash-transition .splash-scrim {
  animation: splashBgIn 0.2s ease-out forwards;
}
.splash.splash-transition .splash-logo {
  display: none;
}
.splash.splash-transition .splash-section-label {
  display: block;
  animation: splashLogo 0.3s ease-out 0.08s forwards;
}
@keyframes splashZoomFast {
  from { transform: scale(1.02); }
  to   { transform: scale(1.09); }
}
@media (prefers-reduced-motion: reduce) {
  .splash, .splash-logo { transition-duration: 200ms; animation-duration: 200ms; }
  .splash-bg, .splash-scrim { animation: none; opacity: 1; }
  .splash-bg { transform: scale(1.04); }
  .splash-logo { animation-delay: 100ms; }
}

/* Sign-in screen */
.signin-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
  background: #0d1730;
}
.signin-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('kilimanjaro-landing.jpg');
  background-size: cover;
  background-position: center 68%;
  filter: saturate(0.9) brightness(0.72);
}
.signin-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 65%, rgba(13, 23, 48, 0.3) 0%, rgba(13, 23, 48, 0.86) 78%),
    linear-gradient(180deg, rgba(13, 23, 48, 0.55) 0%, rgba(13, 23, 48, 0.18) 45%, rgba(13, 23, 48, 0.6) 100%);
}
.signin-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  padding: var(--space-4) var(--space-4) var(--space-5);
  width: 100%;
  max-width: 300px;
  margin: var(--space-4);
}
.ms-btn { width: 100%; background: #2f2f2f; color: white; padding: 12px var(--space-4); border: 0; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; gap: var(--space-3); font-weight: 500; cursor: pointer; }
.ms-btn:hover { background: #1a1a1a; }
.ms-logo { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; width: 18px; height: 18px; }
.ms-logo span:nth-child(1) { background: #f25022; }
.ms-logo span:nth-child(2) { background: #7fba00; }
.ms-logo span:nth-child(3) { background: #00a4ef; }
.ms-logo span:nth-child(4) { background: #ffb900; }

/* Audit log / comments / progress bar */
.audit-log { list-style: none; margin: 0; padding: 0; }
.audit-log li { padding: var(--space-3) 0; border-bottom: 1px dashed var(--border); display: flex; gap: var(--space-3); font-size: 13px; }
.audit-log li:last-child { border-bottom: none; }
.audit-log .when { color: var(--text-muted); white-space: nowrap; min-width: 130px; }
.audit-log .what strong { color: var(--text); }

.comment { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.comment.manager { border-left: 3px solid var(--brand); background: var(--brand-tint); }
.comment.hr { border-left: 3px solid var(--warning); background: var(--warning-tint); }
.comment-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 6px; font-size: 13px; }
.comment-head strong { font-size: 13px; }
.comment-head .role { color: var(--text-muted); font-size: 12px; }
.comment-head .when { color: var(--text-muted); font-size: 12px; margin-left: auto; }
.comment p { margin: 0; font-size: 13px; line-height: 1.5; }

.progress { height: 6px; width: 100%; background: var(--surface-alt); border-radius: var(--radius-pill); overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand); border-radius: var(--radius-pill); transition: width 600ms ease; }

.kpi-row { display: grid; grid-template-columns: 2fr 2fr 2fr 110px; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px dashed var(--border); align-items: start; }
.kpi-row:last-child { border-bottom: none; }
.kpi-row .kpi-num { font-weight: 600; }
@media (max-width: 880px) { .kpi-row { grid-template-columns: 1fr; } }

.skill-row { display: grid; grid-template-columns: 1.2fr 110px 2fr 2fr; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px dashed var(--border); align-items: start; }
.skill-row:last-child { border-bottom: none; }
@media (max-width: 880px) { .skill-row { grid-template-columns: 1fr; } }

/* Investment Pipeline ---------------------------------------- */

.pipeline-toolbar { flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.pipeline-filters { display: flex; gap: var(--space-2); margin-left: auto; flex-wrap: wrap; align-items: center; }
.pipeline-filters input[type="search"] { min-width: 200px; }
.pipeline-filters select { max-width: 160px; }

.pipeline-board { display: flex; gap: var(--space-4); overflow-x: auto; padding-bottom: var(--space-2); }
.pipeline-col { flex: 0 0 250px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-md); display: flex; flex-direction: column; max-height: 640px; }
.pipeline-col-header { padding: var(--space-3) var(--space-3) var(--space-2); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.pipeline-col-body { padding: var(--space-2); overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-2); }
.pipeline-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--radius-sm); padding: var(--space-3); cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease; }
.pipeline-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); transform: translateY(-1px); }
.pipeline-card-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pipeline-codename { font-size: 10px; font-weight: 500; padding: 1px 6px; }
.pipeline-ic-chip { font-size: 10px; font-weight: 600; padding: 1px 6px; }

.pipeline-doc-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px dashed var(--border); align-items: center; }
.pipeline-doc-row:last-child { border-bottom: none; }
@media (max-width: 720px) { .pipeline-doc-row { grid-template-columns: 1fr; } }

.pipeline-import-summary { margin-top: var(--space-3); background: var(--surface-alt); }
.pipeline-import-summary .card-body p { margin: 0 0 6px; }
.pipeline-import-summary .card-body p:last-child { margin-bottom: 0; }

@media (max-width: 960px) {
  .pipeline-filters { margin-left: 0; width: 100%; }
  .pipeline-filters input[type="search"] { flex: 1 1 100%; }
}

.footer { border-top: 1px solid var(--border); padding: var(--space-4) var(--space-6); color: var(--text-muted); font-size: 12px; display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.footer a { color: var(--text-muted); }
.footer .sep { color: var(--text-faint); }
.footer-logo { height: 22px; width: auto; opacity: 0.7; margin-right: var(--space-2); }
[data-theme="dark"] .footer-logo { background: #fff; border-radius: 4px; padding: 2px 5px; opacity: 1; }

/* Loading splash */
.loading-splash { min-height: 100vh; display: grid; place-items: center; background: var(--surface-alt); }
.loading-splash .brand-mark { width: 56px; height: 56px; font-size: 22px; margin-bottom: var(--space-4); animation: pulse 1.4s ease-in-out infinite; }
.loading-splash p { color: var(--text-muted); }
.loading-splash .err { color: var(--danger); margin-top: var(--space-3); max-width: 460px; text-align: left; padding: var(--space-3); border-radius: var(--radius-md); background: var(--danger-tint); }
.loading-splash code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface); padding: 1px 6px; border-radius: var(--radius-sm); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Mobile */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "topbar" "main" "sidebar"; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; border-right: none; border-top: 1px solid var(--border); flex-direction: row; overflow-x: auto; padding: 0; z-index: 30; }
  .sidebar-brand { display: none; }
  .nav { display: flex; padding: 4px; gap: 0; flex: 1; overflow-x: auto; }
  .nav-section { display: none; }
  .nav-link { flex-direction: column; gap: 2px; font-size: 11px; padding: 8px 12px; min-width: 64px; }
  .nav-link .badge { position: absolute; top: 4px; right: 8px; padding: 0 5px; font-size: 10px; }
  .main { padding-bottom: 80px; }
  .page { padding: var(--space-4); }
  .topbar-search { display: none; }
  table.data { display: block; }
  table.data thead { display: none; }
  table.data tbody, table.data tr, table.data td { display: block; }
  table.data tr { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: var(--space-3); padding: var(--space-3); }
  table.data td { border-bottom: none; padding: 4px 0; }
  table.data td::before { content: attr(data-label); display: inline-block; width: 110px; color: var(--text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
}

/* =============================================================
   PAYSLIP STYLES — Premium edition
   ============================================================= */

/* —— Design tokens —— */
:root {
  --ps-navy:   #0f2344;
  --ps-gold:   #b8972a;
  --ps-gold-l: #f0e0a0;
  --ps-red:    #8b1a1a;
  --ps-bg:     #fafaf8;
  --ps-border: #c8c8c4;
  --ps-muted:  #666;
}

/* —— Outer shell —— */
.payslip {
  background: #fff;
  color: #1a1a1a;
  font-family: 'Segoe UI', Calibri, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: 0 6px 32px rgba(0,0,0,.14), 0 1px 4px rgba(0,0,0,.08);
  border: 1px solid var(--ps-border);
  overflow: hidden; /* keeps header band flush */
}

/* —— Header band —— */
.ps-header {
  background: var(--ps-navy);
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
/* Logo sits on a white pill so the artwork shows correctly on the dark header */
.ps-header-logo {
  background: rgba(255,255,255,0.97);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ps-header-logo img {
  height: 38px;
  width: auto;
  object-fit: contain;
}
.ps-header-info { flex: 1; }
.ps-header-co {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .6px;
  line-height: 1.2;
  text-transform: uppercase;
}
.ps-header-title {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-top: 3px;
}
.ps-header-period {
  text-align: right;
  font-size: 12px;
  color: rgba(255,255,255,.75);
  line-height: 1.6;
}
.ps-header-period strong {
  display: block;
  font-size: 14px;
  color: #fff;
  letter-spacing: .5px;
}

/* —— Gold accent bar —— */
.ps-gold-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--ps-gold) 0%, var(--ps-gold-l) 50%, var(--ps-gold) 100%);
}

/* —— Body content —— */
.ps-content { padding: 24px 32px 28px; }

/* —— Employee meta strip —— */
.ps-emp-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--ps-border);
  border: 1px solid var(--ps-border);
  margin-bottom: 20px;
}
.ps-emp-strip > div {
  background: var(--ps-bg);
  padding: 9px 14px;
}
.ps-emp-strip.four { grid-template-columns: repeat(4, 1fr); }
.ps-label {
  font-size: 9.5px;
  color: var(--ps-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 3px;
}
.ps-val { font-size: 13px; font-weight: 600; color: #111; }

/* —— Earnings / deductions table —— */
.ps-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 12.5px;
}
.ps-table th {
  background: var(--ps-navy);
  color: #fff;
  padding: 7px 11px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  text-align: left;
  border: 1px solid var(--ps-navy);
}
.ps-table th.num { text-align: right; }
.ps-table td { border: 1px solid #ddd; padding: 5px 11px; }
.ps-table tbody tr:nth-child(even) td { background: #f7f7f5; }
.ps-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ps-table .section-head td {
  background: #e8ecf4;
  color: var(--ps-navy);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 4px 11px;
  border-color: #c0c8d8;
}
.ps-subtotal td {
  background: #edf0f7 !important;
  font-weight: 700;
  border-top: 2px solid #b0bbd0;
  border-bottom: 2px solid #b0bbd0;
  color: var(--ps-navy);
}
.ps-deduction { color: var(--ps-red); }
.ps-deduction td { color: var(--ps-red); }

/* —— Net pay highlight box —— */
.ps-net-box {
  background: var(--ps-navy);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  border-left: 5px solid var(--ps-gold);
}
.ps-net-box .ps-net-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.75);
}
.ps-net-box .ps-net-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
}
.ps-net-box .ps-net-usd {
  font-size: 12px;
  color: rgba(255,255,255,.65);
  margin-top: 2px;
  text-align: right;
}

/* —— Exchange note —— */
.ps-exchange {
  font-size: 11px;
  color: var(--ps-muted);
  text-align: right;
  margin: -8px 0 12px;
  font-style: italic;
}

/* —— GH-specific two-column earnings/deductions —— */
.ps-gh-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}
.ps-gh-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--ps-navy);
  padding: 5px 10px;
  background: #e8ecf4;
  border: 1px solid #c0c8d8;
  border-bottom: none;
}
.ps-gh-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ps-gh-table td { border: 1px solid #ddd; padding: 4px 9px; }
.ps-gh-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ps-gh-table tr:nth-child(even) td { background: #f7f7f5; }
.ps-gh-table .total-row td { background: #edf0f7 !important; font-weight: 700; border-top: 2px solid #b0bbd0; color: var(--ps-navy); }
.ps-gh-additional {
  border: 1px solid var(--ps-border);
  border-top: 3px solid var(--ps-navy);
  padding: 10px 14px;
  font-size: 12px;
  margin-top: 10px;
}
.ps-gh-add-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid #eee;
}
.ps-gh-add-row:last-child { border-bottom: none; }

/* —— CI-specific —— */
.ps-ci-address {
  font-size: 10.5px;
  color: var(--ps-muted);
  text-align: center;
  padding: 6px 0 10px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 14px;
}
.ps-ci-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}
.ps-ci-meta > div { padding: 3px 0; font-size: 12px; }
.ps-ci-meta .ps-label { display: inline-block; min-width: 110px; }
.ps-ci-nom { font-size: 15px; font-weight: 700; color: var(--ps-navy); margin-bottom: 10px; }
.ps-ci-table { font-size: 12px; }
.ps-ci-footer { display: flex; justify-content: flex-end; margin-top: 14px; }
.ps-ci-totals {
  border: 2px solid var(--ps-navy);
  min-width: 280px;
  overflow: hidden;
}
.ps-ci-totals-head {
  background: var(--ps-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 6px 14px;
}
.ps-ci-total-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 14px;
  border-bottom: 1px solid #ddd;
  font-size: 13px;
}
.ps-ci-total-row:last-child { border-bottom: none; }
.ps-ci-total-row.ps-net-ci {
  background: var(--ps-bg);
  font-weight: 700;
  font-size: 14px;
  border-top: 2px solid var(--ps-navy);
  color: var(--ps-navy);
}

/* —— Signature block —— */
.ps-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--ps-border);
}
.ps-sig-col { text-align: center; }
.ps-sig-img {
  height: 54px;
  max-width: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}
.ps-sig-line {
  border-top: 1.5px solid #333;
  margin: 8px 20px 7px;
}
.ps-sig-name { font-weight: 700; font-size: 13px; }
.ps-sig-title { font-size: 11px; color: var(--ps-muted); margin-top: 2px; }
.ps-confidential {
  text-align: center;
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--ps-muted);
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--ps-border);
  text-transform: uppercase;
}
.payslip-page { margin-bottom: 56px; }

/* ── PRINT ─────────────────────────────────────────────────────── */
@media print {
  /* Hide absolutely everything except the payslip output */
  .sidebar,
  .topbar,
  .nav,
  .footer,
  .page-header,
  #psActions,
  #psGenerate,
  .card:not(.payslip):not(.payslip-ng):not(.payslip-gh):not(.payslip-ci),
  [data-go],
  .alert,
  .tabs,
  .tab-btn {
    display: none !important;
  }

  /* The main grid becomes a simple block */
  .app {
    display: block !important;
  }
  .main {
    margin: 0 !important;
    padding: 0 !important;
  }
  .page {
    padding: 0 !important;
  }

  /* Each payslip fills a page */
  .payslip-page {
    page-break-after: always;
    break-after: page;
    margin: 0;
  }
  .payslip-page:last-child {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Payslip itself — no shadows, full width */
  .payslip {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Preserve background colours (navy header, gold bar, net box) */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
