:root {
    font: 16px/1.5 "DM Sans", system-ui, sans-serif;
    color: #192d2b;
    background: #f0f5f3;
    --accent: #09694f;
    --muted: #516964;
    --border: #d8e4df;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, .button {
    display: inline-block;
    background: var(--accent);
    color: white;
    border: 1px solid transparent;
    padding: .65rem 1rem;
    border-radius: .6rem;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
}
button:hover, .button:hover { background: #074e3b; }
:focus-visible { outline: 3px solid #408e72; outline-offset: 3px; }
.shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 100vh; }
aside { background: #102d29; color: #e3f3ed; padding: 1.6rem 1rem; display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.35rem; font-weight: 750; color: inherit; text-decoration: none; }
nav { margin-top: 2.6rem; display: grid; gap: .35rem; }
nav a, .quiet { color: #c7ded6; display: block; text-decoration: none; padding: .65rem .7rem; border-radius: .5rem; }
nav a.selected, nav a:hover, .quiet:hover { background: #235047; color: white; }
.logout { margin-top: auto; padding-top: 1rem; }
.quiet { background: transparent; }
main { padding: clamp(1rem, 4vw, 3.5rem); width: 100%; max-width: 96rem; }
h1, h2, p { margin: 0 0 .65rem; }
h1 { font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.14; letter-spacing: -.04em; }
h2 { font-size: 1.2rem; }
p, small, .metric span { color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1.35rem; }
.panel { background: white; border: 1px solid var(--border); border-radius: .9rem; padding: clamp(1rem, 2vw, 1.5rem); margin-bottom: 1rem; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric strong { display: block; font-size: clamp(1.4rem, 3vw, 2rem); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .75rem .65rem; text-align: left; border-bottom: 1px solid var(--border); }
thead { background: #eaf4ee; }
tbody tr:last-child > * { border-bottom: 0; }
.fields { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: block; font-weight: 600; margin-bottom: .35rem; }
input:not([type=hidden]), select { width: 100%; padding: .6rem; border: 1px solid #9bb5aa; border-radius: .45rem; color: inherit; background: white; }
td input:not([type=hidden]) { min-width: 7rem; }
.editor { max-width: 47rem; }
.actions { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.error, .notice { padding: .7rem 1rem; border-radius: .5rem; }
.error { color: #831b1b; background: #fbeaea; }
.notice { color: #075742; background: #dcf4e6; }
.guest { display: grid; grid-template-columns: 1fr; place-items: center; background: radial-gradient(at 15% 0%, #c8ebdc, #f0f5f3 65%); }
.guest main { max-width: 29rem; }
.signin .brand, .signin .field { margin-bottom: 1rem; }
.signin button { width: 100%; }
@media (max-width: 720px) {
    .shell { grid-template-columns: 1fr; }
    aside { gap: .8rem; padding: .9rem 1rem; }
    nav { display: flex; flex-wrap: wrap; margin: 0; }
    .logout { padding: 0; }
    .dates { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
    .cards, .fields { grid-template-columns: 1fr; gap: 0; }
    .field { margin-bottom: .75rem; }
}
@media print {
    aside, .print, .actions { display: none; }
    :root { background: white; }
    .shell { display: block; }
    main { padding: 0; }
    .panel { border: 0; padding: 0; }
}
.company-switch { margin-top: 1.5rem; }
.company-switch select { margin-bottom: .5rem; }
.company-switch button { width: 100%; }
.company-heading { font-weight: 650; }
.inline-form { display: inline-block; margin-left: .8rem; }
textarea { width: 100%; font: inherit; padding: .6rem; border: 1px solid #9bb5aa; border-radius: .45rem; }
.editor .field { margin-bottom: 1rem; }
.account-name { color: #c7ded6; padding: .7rem; margin-top: 1rem; overflow-wrap: anywhere; }
details { min-width: 12rem; } details .field { margin-bottom: .75rem; } .tax-sources { margin-top: 1.5rem; }
.company-logo { display: block; max-width: 180px; max-height: 100px; object-fit: contain; margin: .75rem 0; }
input[type=checkbox] { width: auto; }
.payslip-footer { margin-top: 1.25rem; white-space: normal; }
.pay-detail { display: block; min-width: 12rem; } pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 40rem; }

.site-logo { display: block; width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.signin .site-logo { width: 56px; height: 56px; }
@media print {
    .report-filter { display: none; }
    .contribution-report { font-size: 9pt; }
    .contribution-report .page-head { margin-bottom: 10px; }
    .contribution-report th, .contribution-report td { padding: 5px; }
    .contribution-report .pay-detail { min-width: 0; }
    .contribution-report table { table-layout: auto; }
    .contribution-report .table-wrap { overflow: visible; }
    .contribution-report { page: statutory; }
    .statutory-section + .statutory-section { break-before: page; }
}

@page statutory { size: landscape; margin: 12mm; }

.report-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
@media print { .report-actions { display: none; } }
.statutory-heading { display: flex; justify-content: space-between; gap: 1.5rem; border-top: 2px solid #192d2b; padding-top: 1rem; margin-bottom: 1rem; }
.statutory-heading h2 { font-size: 1.8rem; }
.statutory-company { text-align: right; font-size: .85rem; }
.statutory-dates { display: flex; gap: 3rem; flex-wrap: wrap; margin-top: 1rem; }
.statutory-table { font-size: .85rem; }
.statutory-table thead { background: transparent; border-top: 2px solid #192d2b; border-bottom: 2px solid #192d2b; }
.statutory-table th, .statutory-table td { padding: .4rem; vertical-align: top; }
.statutory-table th:nth-child(n+5):nth-child(-n+9), .statutory-table td:nth-child(n+5):nth-child(-n+9) { text-align: right; }
.employee-group-name th { padding-top: .8rem; border-bottom: 0; text-align: left; }
.employee-subtotal { font-weight: 700; }
.statutory-table tfoot { font-weight: 750; border-top: 2px solid #192d2b; }
@media print {
    .statutory-heading { border-color: black; }
    .statutory-heading h2 { font-size: 22pt; }
    .statutory-company { font-size: 9pt; }
    .statutory-table { font-size: 8pt; color: black; }
    .statutory-table thead { display: table-header-group; }
    .statutory-table tfoot { display: table-row-group; }
    .employee-report-group { break-inside: avoid; }
}
