:root {
    --ink: #172022;
    --muted: #687376;
    --paper: #f3f1eb;
    --card: #fffefa;
    --line: #dcd9d0;
    --accent: #e8562a;
    --accent-dark: #ba3818;
    --teal: #183e3d;
    --mint: #cae3d8;
    --danger: #a53d31;
    --shadow: 0 18px 50px rgba(28, 42, 42, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.brand-mark { display: inline-grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font: 800 14px/1 Georgia, serif; letter-spacing: -.04em; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 78px; padding: 14px max(24px, calc((100vw - 1220px) / 2)); background: var(--teal); color: #fff; }
.wordmark { display: flex; gap: 12px; align-items: center; text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.account { display: flex; align-items: center; gap: 18px; text-align: right; }
.account strong, .account small { display: block; }
.account small { color: #b7ceca; font-size: 12px; }
.quiet-button { padding: 8px 13px; border: 1px solid rgba(255,255,255,.25); border-radius: 7px; color: #fff; background: transparent; cursor: pointer; }
.quiet-button:hover { background: rgba(255,255,255,.1); }
.dashboard-shell { max-width: 1220px; margin: 0 auto; padding: 48px 24px 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
h1, h2, p { margin-top: 0; }
.page-heading h1 { margin-bottom: 5px; font: 600 clamp(32px, 5vw, 52px)/1.05 Georgia, serif; letter-spacing: -.035em; }
.page-heading p:last-child { margin-bottom: 0; }
.employee-picker { display: grid; gap: 6px; min-width: 230px; }
.employee-picker label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.employee-picker select, .week-nav input { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 8px 12px; color: var(--ink); }
.summary-grid { display: grid; grid-template-columns: 1.15fr repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.summary-card { min-height: 150px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.summary-card p { margin-bottom: 14px; color: var(--muted); font-weight: 700; }
.summary-card strong { display: block; margin-bottom: 8px; font: 600 35px/1 Georgia, serif; letter-spacing: -.03em; }
.summary-card span { color: var(--muted); font-size: 13px; }
.summary-primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.summary-primary p, .summary-primary span { color: var(--mint); }
.summary-primary strong { color: #fff; font-size: 43px; }
.summary-primary strong.negative { color: #ffd2c7; }
.ledger-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.ledger-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.ledger-toolbar h2 { margin-bottom: 4px; font: 600 24px/1.2 Georgia, serif; }
.ledger-toolbar p { margin-bottom: 0; font-size: 13px; }
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav > a { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: #fff; }
.week-nav > a:hover { border-color: var(--accent); color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 14px 16px; color: var(--muted); background: #f8f7f2; font-size: 11px; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 17px 16px; border-top: 1px solid #ebe8e0; vertical-align: middle; white-space: nowrap; }
td:first-child strong, td:first-child span { display: block; }
td:first-child span { color: var(--muted); font-size: 12px; }
.weekend-row { background: #fbf6ee; }
.time-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 5px 8px; border-radius: 5px; background: #edf1ee; font-variant-numeric: tabular-nums; }
.empty { color: #9ba1a0; font-style: italic; }
.rate-badge { display: inline-block; padding: 4px 8px; border-radius: 999px; color: var(--accent-dark); background: #fee4d7; font-weight: 800; }
.positive { color: #176a52; }
.negative { color: var(--danger); }
.formula-note { display: flex; gap: 12px; align-items: start; padding: 18px 26px; border-top: 1px solid var(--line); background: #f8f7f2; }
.formula-note > span { display: grid; flex: 0 0 23px; height: 23px; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; font: 700 13px Georgia, serif; }
.formula-note p { margin: 0; color: var(--muted); font-size: 13px; }
.login-body { min-height: 100vh; background: var(--teal); }
.login-shell { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(34px, 7vw, 92px); color: #fff; background: var(--teal); }
.login-brand h1 { margin-bottom: 24px; font: 500 clamp(48px, 7vw, 82px)/.96 Georgia, serif; letter-spacing: -.05em; }
.login-intro { max-width: 520px; color: #bad0cb; font-size: 18px; }
.login-rule { margin-bottom: 0; color: #bad0cb; }
.login-rule strong { color: #fff; }
.login-panel { display: grid; place-items: center; padding: 30px; background: var(--paper); }
.login-form { width: min(100%, 430px); padding: clamp(28px, 5vw, 50px); border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.login-form h2 { margin-bottom: 6px; font: 600 35px/1.1 Georgia, serif; }
.login-form > label { display: block; margin: 21px 0 7px; font-weight: 700; }
.login-form input[type=text], .login-form input[type=password] { width: 100%; height: 48px; border: 1px solid #c9c7bf; border-radius: 7px; padding: 10px 12px; background: #fff; }
.login-form input:focus, select:focus, button:focus, a:focus { outline: 3px solid rgba(232,86,42,.28); outline-offset: 2px; }
.login-form button[type=submit] { display: flex; justify-content: space-between; width: 100%; margin-top: 26px; padding: 14px 17px; border: 0; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 800; cursor: pointer; }
.login-form button[type=submit]:hover { background: var(--accent-dark); }
.alert { margin: 18px 0 0; padding: 11px 13px; border-left: 3px solid var(--danger); color: #7b2c24; background: #fbe8e4; }
@media (max-width: 1050px) {
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 850px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { min-height: 42vh; padding: 34px; }
    .login-brand h1 { margin-top: 45px; font-size: 52px; }
    .login-rule { display: none; }
    .summary-grid { grid-template-columns: 1fr; }
    .summary-card { min-height: 125px; }
    .page-heading, .ledger-toolbar { align-items: stretch; flex-direction: column; }
    .employee-picker { width: 100%; }
}
@media (max-width: 680px) {
    .topbar { padding: 12px 16px; }
    .wordmark > span:last-child, .account > div { display: none; }
    .dashboard-shell { padding: 32px 14px 50px; }
    .ledger-toolbar { padding: 20px 16px; }
    .week-nav { justify-content: space-between; }
    .week-nav form { flex: 1; }
    .week-nav input { width: 100%; }
    table, tbody, tr, td { display: block; }
    thead { display: none; }
    tr { padding: 16px; border-top: 1px solid var(--line); }
    tr:first-child { border-top: 0; }
    td { display: grid; grid-template-columns: 115px 1fr; gap: 12px; padding: 6px 0; border: 0; white-space: normal; }
    td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
    .formula-note { padding: 16px; }
}
@media print {
    .topbar, .employee-picker, .week-nav { display: none; }
    body { background: #fff; }
    .dashboard-shell { max-width: none; padding: 0; }
    .summary-card, .ledger-card { box-shadow: none; }
}
