/* D2D Payroll — matches the live client portal (d2d-website /portal/login) exactly:
   light surface, white cards, navy text, magenta CTAs. Tokens pulled directly from
   that project's globals.css (Tailwind v4 @theme block), not guessed from a mockup.
   Mobile-first approach: default rules style for mobile screens, and desktop layouts
   are added under media queries. */
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
    /* Brand Design System Variables */
    --color-magenta: #ce65b0;
    --color-magenta-dark: #b55a9d;
    --color-magenta-text: #a94f92;
    --color-navy: #2d2a45;
    --color-navy-light: #3d3959;
    --color-lavender: #d4cfe0;
    --color-surface: #f4f5f7;
    --color-muted: #6b6b7b;
    --color-success: #25d366;
    --color-whatsapp: #25d366;
    --font-sans: "Raleway", Helvetica, Arial, sans-serif;
    --shadow-card: 0 1px 3px rgba(45, 42, 69, 0.08), 0 8px 24px rgba(45, 42, 69, 0.08);
    --shadow-card-hover: 0 2px 6px rgba(45, 42, 69, 0.1), 0 16px 40px rgba(45, 42, 69, 0.14);

    /* Backwards compatibility aliases */
    --navy: var(--color-navy);
    --navy-light: var(--color-navy-light);
    --magenta: var(--color-magenta);
    --magenta-dark: var(--color-magenta-dark);
    --magenta-text: var(--color-magenta-text);
    --lavender: var(--color-lavender);
    --surface: var(--color-surface);
    --muted: var(--color-muted);
    --success: var(--color-success);
    --danger: #DC2626;
    --navy-10: rgba(45, 42, 69, 0.1);
    --navy-15: rgba(45, 42, 69, 0.15);
    --navy-20: rgba(45, 42, 69, 0.2);
}
* { box-sizing: border-box; }
body {
    margin: 0; min-height: 100vh;
    background: var(--surface); color: var(--navy);
    font-family: var(--font-sans); font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
h1 {
    font-size: 1.4rem; margin: 1rem 0 .5rem; font-weight: 800; line-height: 1.25;
    color: var(--navy); /* fallback color, used whenever the gradient-clip trick below can't apply */
    background: linear-gradient(120deg, var(--color-magenta) 20%, var(--color-navy) 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
/* Forced-colors mode, some a11y tools, and print-preview paths can render the
   background as nothing while still honoring -webkit-text-fill-color:transparent —
   that combination makes headings disappear entirely, not just lose color. Same
   failure mode that already bit badges nested in h1 (see .badge below); this closes
   it at the source for the text itself. */
@supports not (background-clip: text) {
    h1 { -webkit-text-fill-color: initial; background: none; }
}
@media (forced-colors: active) {
    h1 { -webkit-text-fill-color: initial; background: none; forced-color-adjust: none; color: CanvasText; }
}
h2 { font-size: 1.05rem; margin: 1.3rem 0 .5rem; font-weight: 700; color: var(--navy); }
a { color: var(--magenta-text); font-weight: 700; text-decoration: none; }
a:hover { color: var(--magenta-dark); text-decoration: underline; }
a.brand-link, .btn a { text-decoration: none; }
main { max-width: 1200px; margin: 0 auto; padding: 0 0.75rem 2.5rem; }

:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; border-radius: 4px; }

.gradient-brand { background: linear-gradient(135deg, var(--magenta) 0%, var(--navy) 100%); }

/* ---- Responsive visibility utilities ---- */
@media (max-width: 767px) {
    .mobile-hide { display: none !important; }
}
@media (min-width: 768px) {
    .desktop-hide { display: none !important; }
}

/* ---- Top bar (navy chrome, matches the portal's theme-color) ---- */
.topbar {
    display: flex; flex-direction: column; gap: 0.75rem;
    padding: .75rem 1rem; background: var(--navy);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.1rem; letter-spacing: .3px; color: #fff; }
.brand-logo { height: 24px; width: auto; display: block; }

.topbar nav {
    display: flex; gap: .25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: 2px;
}
.topbar nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar for native look */
}
.topbar nav a {
    color: var(--lavender); padding: .45rem .75rem; border-radius: 8px;
    font-weight: 600; transition: background-color .15s ease, color .15s ease;
    white-space: nowrap;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.topbar nav a.on { color: #fff; background: var(--magenta); }

.userbox {
    display: flex; align-items: center; justify-content: space-between;
    color: var(--lavender); font-size: .9rem;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.75rem;
}
.userbox em { color: rgba(212,207,224,.75); font-style: normal; }
.userbox .btn-ghost { color: var(--lavender); border-color: rgba(212,207,224,.35); }
.userbox .btn-ghost:hover { color: #fff; border-color: #fff; }

/* ---- Buttons ---- */
.btn {
    display: inline-block; border: 1px solid var(--navy-20);
    background: #fff; color: var(--navy);
    padding: .5rem 1.1rem; border-radius: 8px; font-weight: 700; font-size: .88rem;
    cursor: pointer; font-family: inherit; transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    text-align: center;
}
.btn:hover { border-color: var(--magenta); }
.btn-primary { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.btn-primary:hover { background: var(--magenta-dark); border-color: var(--magenta-dark); color: #fff; }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
/* One-way-door actions (Finalize) — permanent the moment they're clicked, but not
   "destructive" in the delete/reopen sense, so they get their own tier rather than
   sharing btn-primary's routine weight or btn-danger's delete connotation. Same
   amber used by .warn-panel, so "irreversible" reads consistently across the app. */
.btn-commit { background: #fff; border-color: #92400e; color: #92400e; }
.btn-commit:hover { background: #92400e; border-color: #92400e; color: #fff; }
.btn-ghost { background: transparent; }
.btn-small { padding: .3rem .7rem; font-size: .8rem; }
.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Cards & stats ---- */
.card {
    background: #fff; border-radius: 16px; box-shadow: var(--shadow-card);
    padding: 1rem; margin: .75rem 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
    .card, .card:hover, .tbl-responsive tr, .tbl-responsive tr:hover { transition: none; transform: none; }
}
.card.stat {
    border-top: 4px solid var(--color-magenta);
}
.cards { display: flex; flex-direction: column; gap: .75rem; }
.stat { text-align: center; color: var(--muted); }
.stat-n { font-size: 1.8rem; font-weight: 800; color: var(--navy); }
.narrow { width: 100%; }

/* ---- Forms ---- */
.form-grid { display: flex; flex-direction: column; gap: 1rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; font-size: .85rem; color: var(--navy); }
label.check { flex-direction: row; align-items: center; gap: .5rem; }
input, select {
    min-height: 2.6rem; padding: 0 .85rem; border: 1px solid var(--navy-20); border-radius: 8px;
    font-family: inherit; font-size: .95rem; background: #fff; color: var(--navy);
    transition: border-color .15s ease;
}
input::placeholder { color: rgba(107,107,123,.7); }
input:focus, select:focus { outline: none; border-color: var(--magenta); }
input[type="checkbox"] { accent-color: var(--magenta); min-height: auto; }
.uppercase { text-transform: uppercase; }
small.muted { font-weight: 400; }

/* ---- Tables ---- */
.tbl {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: #fff; border-radius: 16px; box-shadow: var(--shadow-card);
    overflow: hidden; margin: .5rem 0 1rem;
}
.tbl th {
    background: var(--navy); color: #fff;
    text-align: left; padding: .6rem .8rem; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
.tbl td { padding: .55rem .8rem; border-top: 1px solid var(--navy-10); color: var(--navy); }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.totals td { background: var(--surface); font-weight: 700; border-top: 2px solid var(--navy-20); }
.tbl-wide { font-size: .86rem; }

/* ---- Responsive Table (Card Transformation) ----
   Gated to mobile widths only — this previously had no @media wrapper at all, so
   it collapsed to stacked cards on every screen size, desktop included. Used by
   views/client_dashboard.php's lightweight period list, where card-stacking below
   768px is genuinely nicer than a cramped 3-column table. NOT used by the
   payroll-run items table any more (views/run.php) — that one stays a real,
   horizontally-scrollable table at every width; see .table-scroll below. */
@media (max-width: 767px) {
.tbl-responsive {
    display: block; box-shadow: none; background: transparent; border: none; border-radius: 0;
}
.tbl-responsive thead, .tbl-responsive tr:first-child:not(:has(td)) {
    display: none; /* Hide table header rows on mobile */
}
.tbl-responsive tr {
    display: block; background: #fff; border-radius: 16px;
    box-shadow: var(--shadow-card); padding: 1rem; margin-bottom: 1rem;
    border: 1px solid var(--navy-10);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tbl-responsive tr:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}
.tbl-responsive td {
    display: flex; justify-content: space-between; align-items: center;
    border: none; padding: .5rem 0; font-size: .9rem; text-align: right !important;
}
.tbl-responsive td:first-child {
    font-weight: 800; font-size: 1.05rem; border-bottom: 1px solid var(--navy-10);
    padding-bottom: .65rem; margin-bottom: .4rem; display: block; text-align: left !important;
}
.tbl-responsive td::before {
    content: attr(data-label); font-weight: 700; color: var(--muted);
    text-transform: uppercase; font-size: .75rem; text-align: left; margin-right: .5rem;
}
.tbl-responsive td:first-child::before {
    display: none;
}
.tbl-responsive tr.totals {
    display: none !important; /* Hide totals row in card mode */
}
.tbl-responsive td .btn {
    margin: .1rem 0; width: auto;
}
}

/* ---- Real, always-a-table layout (payroll-run items table) ----
   Horizontally scrollable instead of collapsing to cards, so every column stays
   visible/scannable and comparable across rows at any screen width. */
.table-scroll {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-radius: 16px; box-shadow: var(--shadow-card); margin: .5rem 0 1rem;
}
.table-scroll .tbl { box-shadow: none; margin: 0; border-radius: 0; }
.table-scroll .tbl th, .table-scroll .tbl td { white-space: nowrap; }
/* Keep the employee name in view while scrolling right through a wide payroll-lines
   table on mobile — without this, scrolling to Net pay loses track of whose row it is. */
.table-scroll .tbl th:first-child, .table-scroll .tbl td:first-child {
    position: sticky; left: 0; z-index: 1;
    background: #fff; box-shadow: 1px 0 0 var(--navy-10);
}
.table-scroll .tbl th:first-child { background: var(--navy); z-index: 2; }
.table-scroll .tbl tr.subtotal td:first-child,
.table-scroll .tbl tr.totals td:first-child { background: var(--surface); }
.tbl tr.subtotal td { background: var(--surface); font-weight: 700; border-top: 1px solid var(--navy-15); }

/* ---- Flash messages ---- */
.flash { padding: .7rem 1rem; margin: .75rem 0; font-weight: 600; border-radius: 8px; }
.flash-success { background: #ecfdf3; color: #14532d; border: 1px solid rgba(37,211,102,.4); }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid rgba(220,38,38,.3); }
.muted { color: var(--muted); font-weight: 400; }
.center { text-align: center; }

/* ---- Status badges ----
   Bug fix: badges rendered inside a gradient-text heading (e.g. run.php's <h1>)
   inherited -webkit-text-fill-color: transparent from the ancestor h1 (that
   property is inherited like `color`, even though background-clip is not) — the
   pill shape showed but its label text was invisible. Resetting both here makes
   every badge legible regardless of what it's nested inside. */
.badge {
    padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 700; vertical-align: middle;
    -webkit-text-fill-color: currentColor; background-clip: initial; -webkit-background-clip: initial;
}
.badge-draft { background: var(--lavender); color: var(--navy); }
.badge-pending_approval { background: #fdf1da; color: #7a4a05; } /* amber — universally-understood "awaiting action", AA contrast ~7.7:1 */
.badge-approved { background: #dcf7e7; color: #0f6e3d; } /* tinted toward the brand success-green hue, darkened for AA contrast */
.badge-rejected { background: rgba(220,38,38,.12); color: var(--danger); } /* reuses the same --danger token as .btn-danger */
.badge-finalized { background: var(--magenta); color: #fff; }
.badge-none { background: transparent; color: var(--muted); border: 1px dashed var(--navy-20); }

/* ---- Sub-page tabs (e.g. Configuration -> Tax rules / Report templates) ----
   A plain "text · text" line reads as a caption, not something to click — this
   gives each option a visible pill/border so it's unambiguously a tab, with a
   filled active state matching .topbar nav a.on. */
.subtabs { display: flex; gap: .4rem; margin: .5rem 0 1.1rem; flex-wrap: wrap; }
.subtab {
    display: inline-block; padding: .4rem .9rem; border-radius: 999px;
    border: 1px solid var(--navy-20); background: #fff; color: var(--navy);
    font-weight: 700; font-size: .85rem; text-decoration: none;
}
.subtab:hover { border-color: var(--magenta); color: var(--magenta-dark); text-decoration: none; }
.subtab.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.subtab.on:hover { color: #fff; }

/* ---- Rendered markdown (views/guide.php, resources.body via help_render_body()) ---- */
.doc-content h1 { font-size: 1.3rem; }
.doc-content h2 { border-top: 1px solid var(--navy-10); padding-top: 1.1rem; }
.doc-content h3 { font-size: .95rem; margin: 1rem 0 .4rem; font-weight: 700; color: var(--navy); }
.doc-content p { margin: .5rem 0; line-height: 1.55; }
.doc-content ul, .doc-content ol { margin: .4rem 0; padding-left: 1.4rem; line-height: 1.55; }
.doc-content li { margin: .2rem 0; }
.doc-content code { background: var(--surface); border-radius: 4px; padding: .1rem .35rem; font-size: .85em; }
.doc-content pre { background: var(--navy); color: #fff; padding: .8rem 1rem; border-radius: 8px; overflow-x: auto; font-size: .82rem; }
.doc-content pre code { background: transparent; color: inherit; padding: 0; }
.doc-content blockquote { margin: .6rem 0; padding: .5rem 1rem; border-left: 3px solid var(--magenta); background: var(--surface); border-radius: 0 8px 8px 0; color: var(--muted); }
.doc-content hr { border: none; border-top: 1px solid var(--navy-10); margin: 1.2rem 0; }
.doc-content table { font-size: .88rem; }

/* ---- Warnings ---- */
.warn-panel {
    background: #fffbeb; border: 1px solid #fde68a;
    padding: .7rem 1rem; margin: .75rem 0; font-size: .88rem; color: #92400e; border-radius: 8px;
}
.warn-panel ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.warn-panel li { margin: .15rem 0; }

/* ---- Desktop Journey dots legend ---- */
.journey-legend {
    display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .78rem; margin: .5rem 0 .75rem;
}
.journey { display: flex; align-items: center; gap: .35rem; margin-bottom: .3rem; }
.journey-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: var(--lavender); flex: 0 0 auto;
}
.journey-dot.done { background: var(--magenta); }
.journey-dot.current {
    width: 12px; height: 12px; background: var(--magenta); box-shadow: 0 0 0 3px rgba(206,101,176,.25);
}
.journey-dot.current.attention { background: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.2); }
.journey-label { font-weight: 700; font-size: .85rem; color: var(--navy); }
.journey-label.attention { color: var(--danger); }
.journey-note { font-size: .76rem; margin-top: .1rem; }

/* ---- Mobile Vertical Step List ---- */
.journey-vertical {
    display: flex; flex-direction: column; position: relative;
    padding-left: 2rem; margin: 1.5rem 0;
}
.journey-vertical::before {
    content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
    width: 2px; background: var(--lavender);
}
.journey-vertical-step {
    position: relative; margin-bottom: 1.5rem;
}
.journey-vertical-step:last-child {
    margin-bottom: 0;
}
.journey-vertical-dot {
    position: absolute; left: -2rem; top: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--lavender); border: 2.5px solid #fff; z-index: 1;
}
.journey-vertical-dot.done {
    background: var(--magenta);
}
.journey-vertical-dot.current {
    background: var(--magenta);
    box-shadow: 0 0 0 4px rgba(206,101,176,.25);
}
.journey-vertical-dot.current.attention {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(220,38,38,.2);
}
.journey-vertical-content {
    display: flex; flex-direction: column;
}
.journey-vertical-title {
    font-weight: 700; font-size: .92rem; color: var(--navy);
}
.journey-vertical-title.done {
    color: var(--navy-light);
}
.journey-vertical-title.current {
    color: var(--magenta-text);
}
.journey-vertical-title.current.attention {
    color: var(--danger);
}
.journey-vertical-note {
    font-size: .78rem; color: var(--muted); margin-top: .15rem;
}

/* ---- Approvals queue ---- */
.approval-card { padding: 1.1rem 1.3rem; }
.approval-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; flex-wrap: wrap; }
.approval-figures {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .5rem; margin: .75rem 0; padding: .65rem .8rem;
    background: var(--surface); border-radius: 10px; font-variant-numeric: tabular-nums;
}
/* The figure a checker actually decides on — surfaced first and visually heavier so
   it reads before Gross/PAYE/Statutory, which are supporting context. */
.approval-figures .figure-primary { order: -1; }
.approval-figures .figure-primary strong { font-size: 1.15rem; color: var(--magenta-text); }
.actionbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .75rem 0 1rem; }
.inline { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.review-form input { min-width: 0; width: 220px; max-width: 100%; }
.summary-card { max-width: 560px; }
.summary-card-wide { max-width: 720px; }
.delta-list { margin: 0 0 .5rem; padding-left: 1.2rem; font-size: .9rem; }
.delta-list li { margin: .2rem 0; }

/* ---- Login: split-screen, matching the portal's login page exactly ---- */
.login-body { background: var(--surface); }
.login-shell { display: flex; flex-direction: column; min-height: 100vh; }
.login-brand-panel {
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 2rem 1.5rem; color: #fff;
}
.login-logo { height: 34px; width: auto; align-self: flex-start; }
.login-brand-panel h1 {
    color: #fff;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background: none;
    font-size: 1.9rem; font-weight: 800; line-height: 1.15; margin: 0;
}
.login-brand-panel ul { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.login-brand-panel li { font-size: .94rem; font-weight: 600; color: rgba(255,255,255,.92); }
.login-brand-panel .compliance { font-size: .75rem; color: rgba(255,255,255,.7); margin: 0; }
.login-brand-mid { padding: 2rem 0; }
.login-form-panel { display: flex; flex: 1; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-card); padding: 1.75rem; }
.login-card h2 { margin: 0; font-size: 1.4rem; font-weight: 800; }
.login-card .sub { margin: .25rem 0 0; font-size: .9rem; color: var(--muted); }
.login-card form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.login-card .foot-link { margin: 1.5rem 0 0; text-align: center; font-size: .8rem; color: var(--muted); }

.foot { text-align: center; color: var(--muted); padding: 1.5rem; font-size: .8rem; }

/* =====================================================================
   PRINT DOCUMENTS — payslips & funding requests: already light, tightened
   to the exact same shadow/radius tokens as the rest of the app.
   ===================================================================== */
.payslip-body { background: #fff; color: var(--navy); }
/* Simplified two-column text-document look — a plain border reads cleanly as a
   printable/PDF-able document and matches what gets embedded in an email body,
   instead of the app's usual card shadow/radius which doesn't belong on a payslip. */
.payslip {
    max-width: 800px; margin: 1rem auto; border: 1px solid var(--navy-20);
    padding: 1.25rem 1.5rem; page-break-after: always; background: #fff;
}
.payslip-body .muted { color: var(--muted); }
.payslip-body .tbl { background: #fff; border: 1px solid var(--navy-10); box-shadow: none; }
.payslip-body .tbl th { background: var(--navy); color: #fff; text-transform: none; letter-spacing: 0; font-size: .82rem; }
.payslip-body .tbl td { color: var(--navy); border-top: 1px solid var(--navy-10); }
.payslip-body .tbl tr.totals td { background: var(--surface); border-top: 2px solid var(--navy); }
/* --ps-accent: set inline per-company (payslip_theme()'s 'accent') on the .payslip
   wrapper — always used on a border/line/text, never as a background under white
   text, so no custom color choice can ever break legibility. */
.ps-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 3px solid var(--ps-accent, var(--magenta)); padding-bottom: .6rem; }
.ps-company { font-size: 1.2rem; font-weight: 800; }
.ps-title { text-align: right; font-weight: 800; letter-spacing: 2px; color: var(--ps-accent, var(--magenta)); }
.ps-draft { color: var(--danger); border: 2px solid var(--danger); display: inline-block; padding: 0 .5rem; letter-spacing: 1px; border-radius: 4px; }
.ps-emp { margin: .75rem 0; }
.ps-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.ps-net {
    margin-top: .5rem; background: var(--navy); color: #fff; font-weight: 800;
    padding: .55rem .9rem; border-radius: 8px; text-align: right; font-size: 1.05rem;
}
/* Compact layout only — net pay band moved near the top, single flowing table below. */
.ps-net-top { margin: .75rem 0; border-left: 6px solid var(--ps-accent, var(--magenta)); }
.ps-flow .tbl { max-width: none; }
.ps-foot { margin-top: .6rem; font-size: .75rem; line-height: 1.5; }
.ps-foot-note { margin-top: .3rem; font-style: italic; }
.toolbar { max-width: 800px; margin: 1rem auto 0; text-align: right; }

@media print {
    .no-print { display: none !important; }
    .payslip { box-shadow: none; border: 1px solid #333; margin: 0 0 1rem; }
    body { font-size: 12px; background: #fff !important; }
}

/* =====================================================================
   MEDIA QUERIES (Desktop Overrides)
   ===================================================================== */
@media (min-width: 768px) {
    h1 { font-size: 1.6rem; margin: 1.1rem 0 .75rem; }
    h2 { font-size: 1.05rem; margin: 1.6rem 0 .5rem; }
    main { padding: 0 1rem 3rem; }
    
    .topbar {
        flex-direction: row; align-items: center; gap: 1.5rem;
        padding: .75rem 1.25rem;
    }
    .topbar nav {
        overflow-x: visible;
        width: auto;
        flex: 1;
        flex-wrap: wrap;
        padding-bottom: 0;
    }
    .topbar nav a {
        padding: .45rem .8rem;
    }
    .userbox {
        width: auto;
        border-top: none;
        padding-top: 0;
        gap: .75rem;
        justify-content: flex-end;
    }
    
    .card { padding: 1.1rem 1.3rem; }
    .card.stat {
        border-top: 4px solid var(--color-magenta);
    }
    .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
    .narrow { max-width: 420px; }
    
    .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem 1.1rem; }
    
    /* Form action buttons align cleanly spanning all grid columns */
    .form-grid > div:last-child {
        grid-column: 1 / -1;
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .ps-cols { grid-template-columns: 1fr 1fr; }
    
    .review-form input { min-width: 220px; }
}

@media (min-width: 992px) {
    .login-shell { flex-direction: row; }
    .login-brand-panel { width: 44%; padding: 3rem; }
    .login-brand-panel h1 { font-size: 2.4rem; }
    .login-brand-mid { padding: 0; }
    .login-form-panel { padding: 3rem; }
}
