:root {
    --navy-950: #132334;
    --navy-900: #233b57;
    --navy-800: #2d4b6c;
    --navy-100: #dce8f2;
    --navy-50: #edf4f8;
    --ink: #1b2733;
    --muted: #64717d;
    --line: #dbe2e8;
    --surface: #ffffff;
    --canvas: #f4f7f9;
    --amber: #f4b942;
    --amber-dark: #91600b;
    --green: #237259;
    --green-soft: #e4f3ed;
    --red: #a63e3e;
    --red-soft: #fbe9e7;
    --orange: #a55818;
    --orange-soft: #fff0df;
    --violet: #675281;
    --violet-soft: #f0eaf7;
    --shadow: 0 14px 35px rgba(21, 42, 61, .08);
    --radius: 16px;
    color-scheme: light;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

:focus-visible {
    outline: 3px solid rgba(244, 185, 66, .55);
    outline-offset: 2px;
}

.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: 260px;
    flex-direction: column;
    padding: 28px 18px 20px;
    color: #fff;
    background: var(--navy-950);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand strong { display: block; font-size: 1.08rem; letter-spacing: -.01em; }
.brand small, .sidebar-user small { display: block; margin-top: 1px; color: #b8c7d3; font-size: .78rem; }

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    color: var(--navy-950);
    background: var(--amber);
    font-size: .86rem;
    font-weight: 850;
    letter-spacing: -.03em;
}

.brand-mark.large { width: 52px; height: 52px; flex-basis: 52px; border-radius: 16px; font-size: 1rem; }

.main-nav { display: grid; min-height: 0; gap: 6px; align-content: start; margin-top: 38px; overflow-y: auto; }
.main-nav a {
    padding: 12px 14px;
    border-radius: 11px;
    color: #c7d4de;
    font-size: .94rem;
    font-weight: 650;
    text-decoration: none;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.main-nav a.active { color: var(--navy-950); background: var(--amber); }

.sidebar-sheet-link {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-top: auto;
    margin-bottom: 12px;
    padding: 11px 12px;
    border: 1px solid rgba(244,185,66,.55);
    border-radius: 12px;
    color: #fff;
    background: rgba(244,185,66,.09);
    text-decoration: none;
}
.sidebar-sheet-link:hover, .sidebar-sheet-link.active { color: var(--navy-950); background: var(--amber); }
.sidebar-sheet-link strong, .sidebar-sheet-link small { display: block; }
.sidebar-sheet-link strong { font-size: .86rem; }
.sidebar-sheet-link small { margin-top: 1px; color: #b8c7d3; font-size: .68rem; line-height: 1.25; }
.sidebar-sheet-link:hover small, .sidebar-sheet-link.active small { color: #52606b; }
.sidebar-sheet-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; font-size: 1rem; }
.sidebar-sheet-link:hover .sidebar-sheet-icon, .sidebar-sheet-link.active .sidebar-sheet-icon { border-color: rgba(19,35,52,.18); background: rgba(255,255,255,.32); }
.sidebar-sheet-link + .sidebar-user { margin-top: 0; }

.sidebar-user {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.12);
    font-size: .84rem;
}

.sidebar-user strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-link { color: #b8c7d3; font-size: .8rem; text-decoration: none; }
.logout-link:hover { color: #fff; text-decoration: underline; }

.avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: var(--navy-950);
    background: #d9e8ef;
    font-weight: 800;
}
.avatar.small { width: 34px; height: 34px; font-size: .84rem; }

.app-content { min-height: 100vh; margin-left: 260px; }
.page-wrap { width: min(1220px, 100%); margin: 0 auto; padding: 38px 34px 60px; }
.mobile-header { display: none; }
.mobile-bottom-nav { display: none; }

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}
.page-heading h1 { margin: 2px 0 4px; color: var(--navy-950); font-size: clamp(1.55rem, 2.6vw, 2.15rem); line-height: 1.16; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 5px !important; color: var(--violet) !important; font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.month-control { display: flex; align-items: center; gap: 8px; }
.month-control label { color: var(--muted); font-size: .82rem; font-weight: 700; }

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { color: #fff; background: var(--navy-900); }
.button.primary:hover { background: var(--navy-800); }
.button.accent { color: var(--navy-950); background: var(--amber); }
.button.secondary { color: var(--navy-900); border-color: #cbd8e1; background: #fff; }
.button.danger { color: var(--red); border-color: #efc5c1; background: #fff; }
.button.small { min-height: 36px; padding: 7px 11px; font-size: .82rem; }
.button.full { width: 100%; }
.button[disabled] { cursor: not-allowed; opacity: .55; transform: none; }

.card {
    border: 1px solid rgba(35,59,87,.09);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(17, 34, 51, .035);
}
.card-pad { padding: 22px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 0; }
.card-header h2, .card-header h3 { margin: 0; color: var(--navy-950); font-size: 1.08rem; letter-spacing: -.02em; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.metric { min-height: 130px; padding: 19px; }
.metric span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.metric strong { display: block; margin: 8px 0 4px; color: var(--navy-950); font-size: clamp(1.35rem, 2vw, 1.82rem); letter-spacing: -.04em; }
.metric small { color: var(--muted); font-size: .78rem; }
.metric.emphasis { border-top: 4px solid var(--amber); padding-top: 16px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .85fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.table-wrap { overflow-x: auto; padding: 10px 22px 20px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .035em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 10px; border-bottom: 1px solid #edf0f2; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafb; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.subtle { color: var(--muted); }
.nowrap { white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.row-actions form { margin: 0; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    white-space: nowrap;
}
.badge-success { color: var(--green); background: var(--green-soft); }
.badge-warning { color: var(--orange); background: var(--orange-soft); }
.badge-attention { color: var(--violet); background: var(--violet-soft); }
.badge-danger { color: var(--red); background: var(--red-soft); }
.badge-muted { color: #69747e; background: #edf0f2; }
.badge-neutral { color: var(--navy-800); background: var(--navy-50); }

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: 12px;
    font-weight: 650;
}
.flash button { padding: 4px 0; border: 0; color: inherit; background: transparent; cursor: pointer; font-size: .8rem; text-decoration: underline; }
.flash-success { border-color: #b8ded0; color: var(--green); background: var(--green-soft); }
.flash-warning { border-color: #edd2ac; color: var(--orange); background: var(--orange-soft); }
.flash-error { border-color: #efc5c1; color: var(--red); background: var(--red-soft); }

.form-card { padding: 22px; }
.form-card h2 { margin: 0 0 4px; color: var(--navy-950); font-size: 1.15rem; }
.form-card > p { margin: 0 0 18px; color: var(--muted); font-size: .88rem; }
.roster-disclosure { overflow: hidden; }
.roster-disclosure > summary {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 20px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.roster-disclosure > summary::-webkit-details-marker { display: none; }
.roster-disclosure > summary:hover { background: #f8fafb; }
.roster-disclosure > summary:focus-visible { outline: 3px solid rgba(35,59,87,.24); outline-offset: -3px; }
.roster-disclosure > summary strong, .roster-disclosure > summary small { display: block; }
.roster-disclosure > summary strong { color: var(--navy-950); font-size: 1.05rem; }
.roster-disclosure > summary small { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.roster-disclosure-toggle { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid #cbd8e1; border-radius: 10px; color: var(--navy-900); background: #fff; font-size: .8rem; font-weight: 800; }
.roster-disclosure .when-open { display: none; }
.roster-disclosure[open] .when-open { display: inline; }
.roster-disclosure[open] .when-closed { display: none; }
.roster-chevron { font-size: 1.05rem; transition: transform .18s ease; }
.roster-disclosure[open] .roster-chevron { transform: rotate(180deg); }
.roster-disclosure[open] > summary { border-bottom: 1px solid var(--line); background: #f8fafb; }
.roster-disclosure .roster-card { border: 0; border-radius: 0; box-shadow: none; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 15px; align-items: end; }
.field { grid-column: span 3; }
.field.span-2 { grid-column: span 2; }
.field.span-4 { grid-column: span 4; }
.field.span-6 { grid-column: span 6; }
.field.span-8 { grid-column: span 8; }
.field.span-9 { grid-column: span 9; }
.field.span-12 { grid-column: span 12; }
label { display: grid; gap: 7px; color: #40505e; font-size: .84rem; font-weight: 750; }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5dc;
    border-radius: 10px;
    color: var(--ink);
    background: #fff;
}
input:hover, select:hover, textarea:hover { border-color: #9fafbb; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-800); outline: 3px solid rgba(45,75,108,.12); }
textarea { min-height: 88px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-help { margin: 12px 0 0; color: var(--muted); font-size: .78rem; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 18px; padding: 14px 16px; }
.filter-bar label { min-width: 160px; }

.empty-state { padding: 40px 24px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--navy-950); font-size: 1rem; }

.today-list { display: grid; gap: 10px; padding: 12px 22px 22px; }
.today-item { display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.today-item .time { color: var(--navy-900); font-size: .86rem; font-weight: 800; }
.today-item strong { display: block; }
.today-item small { color: var(--muted); }

.share-list { display: grid; gap: 14px; padding: 16px 22px 22px; }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 7px 18px; align-items: end; }
.share-row strong { color: var(--navy-950); }
.share-row .bar { grid-column: 1 / -1; height: 7px; overflow: hidden; border-radius: 999px; background: #e8edf0; }
.share-row .bar span { display: block; height: 100%; border-radius: inherit; background: var(--amber); }

.auth-page { min-height: 100vh; background: var(--navy-950); }
.auth-shell { display: grid; width: min(980px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; grid-template-columns: .8fr 1fr; align-items: center; gap: 80px; padding: 46px 0; }
.auth-brand { display: flex; align-items: center; gap: 14px; color: #fff; }
.auth-brand strong { display: block; font-size: 1.7rem; letter-spacing: -.035em; }
.auth-brand span:last-child { color: #b8c7d3; }
.auth-card { padding: clamp(26px, 5vw, 46px); border-radius: 24px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.auth-card h1 { margin: 0 0 10px; color: var(--navy-950); font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.12; letter-spacing: -.045em; }
.auth-card > p:not(.eyebrow):not(.privacy-note):not(.form-help) { margin: 0 0 24px; color: var(--muted); }
.form-stack { display: grid; gap: 16px; }
.privacy-note { margin: 20px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 72px; }
.password-wrap button { position: absolute; top: 50%; right: 10px; padding: 5px; border: 0; color: var(--navy-800); background: none; transform: translateY(-50%); cursor: pointer; font-size: .75rem; font-weight: 800; }
.inline-error { display: grid; gap: 4px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid #efc5c1; border-radius: 10px; color: var(--red); background: var(--red-soft); font-size: .86rem; }
.install-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; }
.install-list span { padding: 12px; border-radius: 10px; color: var(--muted); background: var(--canvas); font-size: .74rem; text-align: center; }
.install-list strong { display: block; color: var(--navy-950); font-size: 1rem; }

.clock-hero { position: relative; overflow: hidden; padding: clamp(22px, 4vw, 34px); border-left: 6px solid var(--amber); }
.clock-hero::after { position: absolute; inset: 0 0 auto auto; width: 170px; height: 170px; border: 32px solid var(--navy-50); border-radius: 50%; content: ''; transform: translate(55px, -78px); }
.clock-hero > * { position: relative; z-index: 1; }
.clock-date { color: var(--muted); font-weight: 700; }
.clock-time { margin: 5px 0 2px; color: var(--navy-950); font-size: clamp(2.6rem, 8vw, 5rem); font-weight: 850; line-height: 1; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.clock-zone { color: var(--muted); font-size: .82rem; }
.shift-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0; }
.shift-summary div { padding: 13px; border-radius: 11px; background: var(--canvas); }
.shift-summary span { display: block; color: var(--muted); font-size: .75rem; font-weight: 700; }
.shift-summary strong { display: block; margin-top: 3px; color: var(--navy-950); }
.clock-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.clock-actions .button { min-width: 180px; min-height: 52px; font-size: 1rem; }

.timeline { display: grid; gap: 0; padding: 14px 22px 24px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 8px 0 18px; }
.timeline-item:not(:last-child)::before { position: absolute; top: 23px; bottom: -1px; left: 7px; width: 2px; background: var(--line); content: ''; }
.timeline-dot { width: 16px; height: 16px; margin-top: 3px; border: 4px solid var(--navy-100); border-radius: 50%; background: var(--navy-900); }
.timeline-item.pending .timeline-dot { border-color: #eceff1; background: #a6b0b8; }
.timeline-item strong { display: block; }
.timeline-item small { color: var(--muted); }

dialog { width: min(580px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: #fff; box-shadow: 0 30px 100px rgba(4,17,29,.34); }
.payment-date-dialog { width: min(440px, calc(100% - 28px)); }
dialog::backdrop { background: rgba(9, 22, 34, .68); backdrop-filter: blur(3px); }
.dialog-body { padding: 26px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dialog-head h2 { margin: 0; color: var(--navy-950); font-size: 1.35rem; }
.dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: .88rem; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer; color: var(--muted); background: var(--canvas); }
.signature-pad { width: 100%; height: 190px; border: 2px dashed #afbdc8; border-radius: 12px; background: #fbfcfd; touch-action: none; }
.signature-toolbar { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; }
.signature-toolbar span { color: var(--muted); font-size: .76rem; }
.text-button { padding: 3px 0; border: 0; color: var(--navy-800); background: none; cursor: pointer; font-size: .78rem; font-weight: 800; text-decoration: underline; }
.check-line { display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; margin: 16px 0; font-weight: 600; }
.check-line input { width: 20px; min-height: 20px; flex: 0 0 20px; margin-top: 2px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.signature-preview { width: 150px; max-height: 62px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.note-box { padding: 14px 16px; border-left: 4px solid var(--amber); border-radius: 8px; color: #4e5963; background: #fff8e7; font-size: .86rem; }
.totals-row { font-weight: 800; background: var(--navy-50); }
.totals-row td { border-top: 2px solid #c5d4df; }

.slug-input {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #cbd5dc;
    border-radius: 10px;
    background: #fff;
}
.slug-input > span { padding-left: 12px; color: var(--muted); }
.slug-input input { min-width: 0; border: 0; border-radius: 0; outline: 0; }
.slug-input:focus-within { border-color: var(--navy-800); outline: 3px solid rgba(45,75,108,.12); }
.field small { color: var(--muted); font-weight: 500; }
.direct-link { color: var(--navy-800); font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.public-sign-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(244,185,66,.18), transparent 28rem),
        linear-gradient(155deg, var(--navy-950), #1e3850 58%, #2b5064);
}
.public-sign-shell { width: min(720px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 48px; }
.public-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; color: #fff; }
.public-brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.public-brand strong, .public-brand small { display: block; }
.public-brand strong { font-size: 1rem; }
.public-brand small { margin-top: 1px; color: #bfd0dc; font-size: .75rem; }
.secure-note { color: #d7e3ea; font-size: .76rem; font-weight: 700; }
.secure-note::before { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #72d2aa; content: ''; box-shadow: 0 0 0 4px rgba(114,210,170,.13); }
.public-sign-card { overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 24px; background: #fff; box-shadow: 0 28px 70px rgba(4,17,29,.28); }
.public-welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; padding: 28px 30px 22px; }
.public-welcome h1 { margin: 0; color: var(--navy-950); font-size: clamp(1.8rem, 6vw, 2.5rem); line-height: 1.1; letter-spacing: -.045em; }
.public-clock { text-align: right; font-variant-numeric: tabular-nums; }
.public-clock strong { display: block; color: var(--navy-950); font-size: 1.7rem; line-height: 1.1; letter-spacing: -.045em; }
.public-clock span { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; text-transform: capitalize; }
.public-shift-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-block: 1px solid var(--line); background: var(--line); }
.public-shift-meta > div { min-width: 0; padding: 15px 18px; background: var(--canvas); }
.public-shift-meta > div > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: .71rem; font-weight: 750; text-transform: uppercase; }
.public-shift-meta strong { display: block; overflow: hidden; color: var(--navy-950); font-size: .88rem; text-overflow: ellipsis; }
.public-sign-form { padding: 25px 30px 30px; }
.signature-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.signature-label strong { color: var(--navy-950); font-size: 1rem; }
.signature-label span { color: var(--muted); font-size: .75rem; }
.public-sign-form .signature-pad { height: 215px; border-style: solid; border-color: #b8c6d0; background: linear-gradient(#fff, #fbfcfd); }
.public-confirm { margin: 20px 0; padding: 13px; border-radius: 11px; background: var(--navy-50); }
.public-submit { min-height: 56px; font-size: 1rem; }
.public-complete-state, .public-wait-state { padding: 36px 30px 38px; text-align: center; }
.public-complete-state .state-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 14px; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 1.5rem; font-weight: 800; }
.public-complete-state h2, .public-wait-state h2 { margin: 0 0 7px; color: var(--navy-950); font-size: 1.3rem; }
.public-complete-state p, .public-wait-state p { margin: 0 0 20px; color: var(--muted); }
.public-complete-state form { width: min(340px, 100%); margin: 22px auto 0; }
.automatic-end-note { width: min(360px, 100%); margin: 22px auto 0; padding: 14px 16px; border-radius: 12px; background: var(--navy-50); }
.automatic-end-note span, .automatic-end-note strong { display: block; }
.automatic-end-note span { color: var(--muted); font-size: .75rem; font-weight: 750; text-transform: uppercase; }
.automatic-end-note strong { margin-top: 3px; color: var(--navy-950); }
.public-wait-state > strong { color: var(--navy-900); }
.public-empty { padding-block: 54px; }
.public-card-footer { padding: 14px 24px; border-top: 1px solid var(--line); color: var(--muted); background: #fafbfc; font-size: .74rem; text-align: center; }
.pending-signatures-heading { padding: 5px 30px 16px; text-align: center; }
.pending-signatures-heading h2 { margin: 0; color: var(--navy-950); font-size: 1.25rem; }
.pending-signatures-heading p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
.pending-signatures-list { display: grid; gap: 10px; padding: 0 30px 32px; }
.pending-signature-item { display: grid; min-height: 76px; grid-template-columns: 50px minmax(0, 1fr) 20px; gap: 14px; align-items: center; padding: 12px 15px; border: 1px solid #cbd8e1; border-radius: 14px; color: var(--navy-900); background: #fff; text-decoration: none; }
.pending-signature-item:hover { border-color: var(--navy-800); box-shadow: 0 8px 20px rgba(19,35,52,.07); transform: translateY(-1px); }
.pending-signature-item > span:nth-child(2) strong, .pending-signature-item > span:nth-child(2) small { display: block; }
.pending-signature-item > span:nth-child(2) small { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.pending-signature-date { display: grid; width: 48px; height: 48px; place-items: center; align-content: center; border-radius: 12px; color: var(--navy-950); background: var(--navy-50); line-height: 1.05; }
.pending-signature-date strong { font-size: 1.2rem; }
.pending-signature-date small { margin-top: 2px; color: var(--muted); font-size: .64rem; font-weight: 750; }
.released-signature-note { display: grid; gap: 3px; margin-bottom: 18px; padding: 13px 15px; border-left: 4px solid var(--amber); border-radius: 10px; color: var(--navy-950); background: #fff8e7; }
.released-signature-note span { color: var(--muted); font-size: .79rem; }
.point-times { display: grid; gap: 2px; min-width: 190px; margin-top: 7px; color: var(--muted); font-size: .72rem; line-height: 1.35; }

.report-metrics { grid-template-columns: repeat(3, 1fr); }
.closing-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr); gap: 20px; margin-bottom: 22px; }
.payment-entry-form { display: grid; grid-template-columns: minmax(155px, .75fr) minmax(175px, .8fr) 1fr auto; gap: 14px; align-items: end; padding: 18px 22px 22px; }
.payment-entry-form .button { min-width: 160px; }
.optional-label { color: var(--muted); font-size: .72rem; font-weight: 500; }
.money-input { display: flex; align-items: center; overflow: hidden; border: 1px solid #cbd5dc; border-radius: 10px; background: #fff; }
.money-input > span { padding-left: 12px; color: var(--muted); font-weight: 800; }
.money-input input { border: 0; border-radius: 0; outline: 0; }
.money-input:focus-within { border-color: var(--navy-800); outline: 3px solid rgba(45,75,108,.12); }
.informed-payment-list { display: grid; gap: 0; padding: 12px 22px 20px; }
.informed-payment-list.compact { padding-top: 14px; }
.informed-payment-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.informed-payment-row:last-child { border-bottom: 0; }
.informed-payment-row > span strong, .informed-payment-row > span small { display: block; }
.informed-payment-row > span small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.informed-payment-row > strong { color: var(--navy-950); font-size: 1.05rem; white-space: nowrap; }
.report-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.report-tab { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border: 1px solid #cbd8e1; border-radius: 14px; color: var(--navy-900); background: #fff; text-decoration: none; }
.report-tab span { font-weight: 800; }
.report-tab strong { white-space: nowrap; }
.report-tab.active { border-color: var(--navy-900); color: #fff; background: var(--navy-900); box-shadow: var(--shadow); }
.report-result-card { min-height: 230px; }
.payment-metrics { grid-template-columns: repeat(3, 1fr); }
.payment-date { display: block; margin-top: 5px; color: var(--muted); font-size: .72rem; }
.payment-payers { display: grid; gap: 2px; margin-top: 5px; color: var(--navy-800); font-size: .7rem; font-weight: 700; }
.bulk-payment-card { overflow: hidden; margin-bottom: 20px; border-top: 4px solid var(--amber); }
.bulk-payment-main { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 20px 22px; }
.bulk-payment-main h2 { margin: 0; color: var(--navy-950); font-size: 1.2rem; }
.bulk-payment-main p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.bulk-payment-main > .button { flex: 0 0 auto; }
.payment-attribution-summary { display: grid; grid-template-columns: minmax(180px, .65fr) 1fr; gap: 16px; align-items: start; padding: 15px 22px 18px; border-top: 1px solid var(--line); background: var(--canvas); font-size: .82rem; }
.payment-attribution-summary > strong { color: var(--navy-950); }
.payment-attribution-summary > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.payment-attribution-summary span { display: flex; gap: 10px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.payment-attribution-summary b { color: var(--navy-950); white-space: nowrap; }
.payment-filter-hint { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; padding: 13px 16px; border: 1px solid #cadbe6; border-radius: 13px; color: var(--navy-800); background: var(--navy-50); }
.payment-filter-hint span { color: var(--muted); font-size: .82rem; }
.payment-allocation-dialog { width: min(540px, calc(100% - 28px)); }
.split-payment-fields { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.split-payment-fields[hidden], [data-allocation-single][hidden] { display: none !important; }
.split-payment-fields > p { margin: 0; color: var(--muted); font-size: .82rem; }
.split-money-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; margin-top: 6px; }
.split-money-row .money-input { min-width: 0; }
.split-money-row .button { min-height: 46px; }
.allocation-remaining { padding: 10px 12px; border-radius: 10px; color: var(--violet); background: var(--violet-soft); font-size: .82rem; font-weight: 800; text-align: center; }
.allocation-remaining.complete { color: var(--green); background: var(--green-soft); }
.allocation-remaining.over { color: var(--red); background: var(--red-soft); }
.payment-confirm-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid #c8d8e2; border-radius: 11px; background: var(--navy-50); }
.payment-confirm-total span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.payment-confirm-total strong { color: var(--navy-950); font-size: 1.12rem; white-space: nowrap; }

.caregiver-portal-shell { width: min(620px, calc(100% - 28px)); }
.access-home-shell { width: min(680px, calc(100% - 28px)); padding-top: clamp(24px, 8vh, 76px); }
.access-home-card { border-top: 5px solid var(--amber); }
.access-home-welcome { padding-top: clamp(34px, 8vw, 58px); }
.access-home-actions { padding-bottom: clamp(30px, 7vw, 46px); }
.caregiver-picker-shell { width: min(620px, calc(100% - 28px)); }
.caregiver-picker-heading { padding-bottom: 22px; }
.caregiver-picker-list { display: grid; gap: 10px; padding: 0 30px 34px; }
.caregiver-picker-item { display: grid; min-height: 72px; grid-template-columns: 44px minmax(0, 1fr) 20px; gap: 14px; align-items: center; padding: 12px 15px; border: 1px solid #cbd8e1; border-radius: 14px; color: var(--navy-900); background: #fff; text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.caregiver-picker-item:hover { border-color: var(--navy-800); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(19,35,52,.07); }
.caregiver-picker-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: var(--navy-950); background: var(--navy-50); font-weight: 850; }
.caregiver-picker-item strong, .caregiver-picker-item small { display: block; }
.caregiver-picker-item strong { font-size: 1rem; }
.caregiver-picker-item small { margin-top: 2px; color: var(--muted); font-size: .76rem; }
.portal-welcome { padding: clamp(30px, 7vw, 50px) 30px 24px; text-align: center; }
.portal-welcome h1 { margin: 0; color: var(--navy-950); font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.1; letter-spacing: -.05em; }
.portal-welcome > p:last-child { margin: 9px 0 0; color: var(--muted); }
.portal-actions { display: grid; gap: 12px; padding: 0 30px 34px; }
.portal-copy-link { display: grid; gap: 7px; margin: -17px 30px 26px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.portal-copy-link .button { min-height: 48px; }
.portal-copy-link small { color: var(--muted); font-size: .74rem; }
.portal-action { display: grid; min-height: 84px; grid-template-columns: 44px minmax(0, 1fr) 24px; gap: 14px; align-items: center; padding: 15px 16px; border: 1px solid #cbd8e1; border-radius: 15px; color: var(--navy-900); background: #fff; text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.portal-action:hover { border-color: #aebfca; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(19,35,52,.07); }
.portal-action.primary { border-color: var(--navy-900); color: #fff; background: var(--navy-900); }
.portal-action-number { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--navy-900); background: var(--navy-50); font-weight: 850; }
.portal-action.primary .portal-action-number { color: var(--navy-950); background: var(--amber); }
.portal-action strong, .portal-action small { display: block; }
.portal-action strong { font-size: 1rem; }
.portal-action small { margin-top: 3px; color: var(--muted); font-size: .77rem; }
.portal-action.primary small { color: #c6d4de; }
.portal-arrow { font-size: 1.8rem; line-height: 1; text-align: right; }
.public-back-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 11px; color: #fff; background: rgba(255,255,255,.08); font-size: .82rem; font-weight: 800; text-decoration: none; }
.public-back-button:hover { background: rgba(255,255,255,.15); }
.public-payments-shell { width: min(960px, calc(100% - 28px)); }
.payments-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 28px 30px 22px; }
.payments-heading h1 { margin: 0; color: var(--navy-950); font-size: clamp(1.8rem, 5vw, 2.35rem); letter-spacing: -.045em; }
.payments-heading p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); }
.public-month-control { flex: 0 0 auto; }
.public-payment-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-block: 1px solid var(--line); background: var(--line); }
.public-payment-metrics > div { padding: 17px 22px; background: var(--canvas); }
.public-payment-metrics span, .public-payment-metrics strong { display: block; }
.public-payment-metrics span { color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.public-payment-metrics strong { margin-top: 4px; color: var(--navy-950); font-size: 1.15rem; }
.public-payment-metrics .paid strong { color: var(--green); }
.public-payments-table { padding-top: 16px; }
.public-payments-card .public-card-footer { display: flex; justify-content: center; gap: 14px; }
.public-payments-card .public-card-footer a { color: var(--navy-800); font-weight: 800; }

@media (max-width: 1100px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .closing-grid { grid-template-columns: 1fr; }
    .payment-entry-form { grid-template-columns: 1fr 1fr; }
    .payment-entry-form .button { width: 100%; }
    .payment-metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .sidebar { width: min(82vw, 290px); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 12px 0 50px rgba(0,0,0,.25); }
    body.menu-open .sidebar { transform: translateX(0); }
    body.menu-open::after { position: fixed; inset: 0; z-index: 20; background: rgba(9,22,34,.55); content: ''; }
    .app-content { margin-left: 0; }
    .mobile-header { position: sticky; top: 0; z-index: 15; display: flex; height: 56px; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 2px 12px rgba(19,35,52,.04); backdrop-filter: blur(12px); }
    .mobile-header > strong { font-size: 1.02rem; }
    .mobile-bottom-nav { position: fixed; inset: auto 0 0; z-index: 18; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 60px; padding: 4px max(5px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); box-shadow: 0 -8px 28px rgba(19,35,52,.1); backdrop-filter: blur(14px); }
    .mobile-bottom-nav a { display: flex; min-width: 0; align-items: center; justify-content: center; flex-direction: column; gap: 1px; padding: 4px 1px; border-radius: 9px; color: var(--muted); font-size: .62rem; font-weight: 750; line-height: 1.08; text-align: center; text-decoration: none; }
    .mobile-nav-icon { display: grid; min-width: 27px; height: 24px; place-items: center; color: currentColor; font-size: .76rem; font-weight: 850; line-height: 1; }
    .mobile-bottom-nav a.active { color: var(--navy-950); background: var(--navy-50); }
    .menu-button { padding: 8px 0; border: 0; color: var(--navy-900); background: none; font-weight: 800; }
    .page-wrap { padding: 18px 12px calc(78px + env(safe-area-inset-bottom)); }
    .field, .field.span-2, .field.span-4 { grid-column: span 6; }
    .field.span-6, .field.span-8, .field.span-9, .field.span-12 { grid-column: span 12; }
}

@media (max-width: 760px) {
    .card-header { gap: 10px; padding: 16px 14px 0; }
    .table-wrap { overflow: visible; padding: 9px 8px 12px; }
    .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
    .table-wrap thead { display: none; }
    .table-wrap table { font-size: .86rem; }
    .table-wrap tbody { display: grid; gap: 9px; }
    .table-wrap tr { overflow: hidden; padding: 3px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(19,35,52,.03); }
    .table-wrap tbody tr:hover { background: #fff; }
    .table-wrap td { display: grid; min-height: 0; grid-template-columns: minmax(96px, .42fr) minmax(0, 1fr); gap: 9px; align-items: center; padding: 8px 0; border-bottom: 1px solid #edf0f2; text-align: right; white-space: normal; }
    .table-wrap td:last-child { border-bottom: 0; }
    .table-wrap td::before { grid-column: 1; grid-row: 1; align-self: center; color: var(--muted); content: attr(data-label); font-size: .66rem; font-weight: 800; letter-spacing: .025em; line-height: 1.25; text-align: left; text-transform: uppercase; }
    .table-wrap td > * { grid-column: 2; justify-self: end; }
    .table-wrap td .point-times { justify-items: end; min-width: 0; margin-top: 3px; text-align: right; }
    .table-wrap td .button { width: min(190px, 100%); min-height: 42px; }
    .table-wrap td .row-actions { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .table-wrap td .row-actions > form, .table-wrap td .row-actions > a { width: 100%; min-width: 0; }
    .table-wrap td .row-actions .button { width: 100%; min-width: 0; padding-inline: 7px; }
    .table-wrap tr.totals-row { border-color: #c5d4df; background: var(--navy-50); }
    .table-wrap td[colspan] { grid-template-columns: minmax(96px, .42fr) minmax(0, 1fr); }
}

@media (max-width: 650px) {
    .page-heading { display: grid; gap: 11px; margin-bottom: 16px; }
    .page-heading h1 { font-size: 1.52rem; }
    .page-heading .button { width: 100%; }
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
    .split-grid { grid-template-columns: 1fr; }
    .report-metrics, .payment-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-metrics .metric:last-child, .payment-metrics .metric:last-child { grid-column: 1 / -1; }
    .metric { min-height: 96px; padding: 14px; }
    .metric span { font-size: .73rem; }
    .metric strong { margin-block: 5px 2px; font-size: 1.25rem; }
    .metric small { display: block; line-height: 1.25; }
    .field, .field.span-2, .field.span-4, .field.span-6, .field.span-8, .field.span-9, .field.span-12 { grid-column: span 12; }
    .form-grid { gap: 13px; }
    .form-card { padding: 16px 14px; }
    .roster-disclosure > summary { min-height: 66px; padding: 13px 14px; }
    .roster-disclosure > summary small { max-width: 215px; }
    .roster-disclosure-toggle { padding-inline: 10px; }
    .form-actions .button { width: 100%; }
    .filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
    .filter-bar label { min-width: 0; }
    .filter-bar label:only-of-type, .filter-bar > .button { grid-column: 1 / -1; }
    .filter-bar > .button { width: 100%; }
    .auth-shell { grid-template-columns: 1fr; gap: 26px; padding: 30px 0; }
    .auth-brand { justify-content: center; }
    .auth-card { padding: 26px 22px; }
    .install-list { grid-template-columns: 1fr; }
    .shift-summary { grid-template-columns: 1fr; }
    .clock-actions .button { width: 100%; }
    .today-item { grid-template-columns: 1fr auto; gap: 5px 12px; }
    .today-item .time { grid-column: 1 / -1; }
    .dialog-actions { flex-direction: column-reverse; }
    .dialog-actions .button { width: 100%; }
    .payment-entry-form { grid-template-columns: 1fr; padding-inline: 18px; }
    .payment-entry-form .button { width: 100%; }
    .informed-payment-list { padding: 10px 14px 16px; }
    .informed-payment-row { align-items: stretch; flex-direction: column; gap: 7px; padding: 12px 0; }
    .informed-payment-row > strong { align-self: flex-end; }
    .bulk-payment-main { align-items: stretch; flex-direction: column; gap: 14px; padding: 16px 14px; }
    .bulk-payment-main > .button { width: 100%; }
    .payment-attribution-summary { grid-template-columns: 1fr; gap: 9px; padding: 13px 14px 15px; }
    .payment-attribution-summary > div { display: grid; justify-content: stretch; }
    .payment-attribution-summary span { justify-content: space-between; }
    .payment-filter-hint { align-items: flex-start; flex-direction: column; gap: 3px; margin-bottom: 14px; }
    .payment-allocation-dialog .dialog-body { padding: 18px 15px; }
    .split-money-row { grid-template-columns: 1fr; }
    .split-money-row .button { width: 100%; min-height: 40px; }
    .report-tabs { grid-template-columns: 1fr; gap: 9px; }
    .report-tab { min-height: 68px; }
    .report-result-card .card-header { align-items: stretch; flex-direction: column; }
    .report-result-card .card-header .button { width: 100%; }
    .public-sign-shell { width: min(100% - 12px, 720px); padding: 8px 0 18px; }
    .public-topbar { margin-bottom: 8px; padding-inline: 3px; }
    .public-sign-card { border-radius: 18px; }
    .public-back-button { min-height: 40px; padding-inline: 11px; }
    .secure-note { display: none; }
    .public-welcome { padding: 23px 20px 18px; }
    .public-clock strong { font-size: 1.45rem; }
    .public-clock span { max-width: 125px; }
    .public-shift-meta { grid-template-columns: 1fr 1fr; }
    .public-shift-meta > div:last-child { grid-column: 1 / -1; }
    .public-sign-form { padding: 22px 20px 24px; }
    .public-sign-form .signature-pad { height: 190px; }
    .public-complete-state, .public-wait-state { padding-inline: 20px; }
    .pending-signatures-heading { padding-inline: 20px; }
    .pending-signatures-list { padding-inline: 18px; }
    .pending-signature-item { grid-template-columns: 48px minmax(0, 1fr) 18px; gap: 11px; padding-inline: 12px; }
    .portal-welcome { padding: 24px 18px 18px; }
    .portal-actions { gap: 9px; padding: 0 14px 18px; }
    .portal-copy-link { margin: 0 14px 18px; padding-top: 14px; }
    .portal-action { min-height: 72px; grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 10px; padding: 11px 12px; }
    .caregiver-picker-list { gap: 8px; padding: 0 14px 18px; }
    .caregiver-picker-item { min-height: 68px; grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 10px; padding: 10px 12px; }
    .payments-heading { align-items: stretch; flex-direction: column; gap: 14px; padding: 18px 16px 14px; }
    .payments-heading h1 { font-size: 1.65rem; }
    .public-month-control { display: grid; grid-template-columns: auto 1fr; }
    .public-payment-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .public-payment-metrics > div { padding: 11px 5px; text-align: center; }
    .public-payment-metrics span { font-size: .62rem; line-height: 1.2; }
    .public-payment-metrics strong { margin-top: 4px; font-size: .92rem; }
    .public-payments-table { padding: 8px 7px 10px; }
    .public-payments-table td { grid-template-columns: minmax(105px, .45fr) minmax(0, 1fr); }
    .public-payments-card .public-card-footer { align-items: center; flex-direction: column; gap: 4px; }
}

@media (max-width: 390px) {
    .page-wrap { padding-inline: 9px; }
    .mobile-bottom-nav a { font-size: .58rem; }
    .table-wrap td, .table-wrap td[colspan] { grid-template-columns: minmax(88px, .38fr) minmax(0, 1fr); gap: 7px; }
    .public-payments-table td { grid-template-columns: minmax(100px, .44fr) minmax(0, 1fr); }
    .public-payment-metrics strong { font-size: .84rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Visão Geral: planilha mensal baseada no controle original da família. */
.overview-page .page-wrap { width: min(1540px, 100%); }
.overview-heading { margin-bottom: 18px; }
.workbook {
    overflow: hidden;
    border: 1px solid #bac3ca;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(30, 45, 57, .08);
}
.workbook-titlebar {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 16px;
    color: #fff;
    background: #555057;
}
.workbook-titlebar > div { display: flex; min-width: 0; align-items: center; gap: 11px; }
.workbook-titlebar strong, .workbook-titlebar small { display: block; }
.workbook-titlebar strong { overflow: hidden; font-size: .96rem; text-overflow: ellipsis; white-space: nowrap; }
.workbook-titlebar small { margin-top: 2px; color: #dedadd; font-size: .72rem; }
.workbook-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; font-size: 1.25rem; }
.workbook-tabs { display: flex; flex: 0 0 auto; gap: 6px; }
.workbook-tabs a { padding: 7px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; color: #fff; font-size: .75rem; font-weight: 750; text-decoration: none; }
.workbook-tabs a:hover { background: rgba(255,255,255,.1); }
.workbook-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.workbook-download { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; color: #173e30; background: #d9efe5; font-size: .78rem; font-weight: 850; text-decoration: none; white-space: nowrap; }
.workbook-download:hover { background: #c6e6d8; }
.workbook-download span { font-size: 1rem; line-height: 1; }

.spreadsheet-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid #bfc6cb; background: #f5f5f5; }
.sheet-cell { min-height: 82px; padding: 13px 15px; border-right: 1px solid #c8ced2; border-bottom: 1px solid #c8ced2; background: #f4ebee; }
.sheet-cell:nth-child(4n) { border-right: 0; }
.sheet-cell:nth-last-child(-n+4) { border-bottom: 0; }
.sheet-cell span, .sheet-cell strong { display: block; }
.sheet-cell span { color: #5d6168; font-size: .68rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.sheet-cell strong { margin-top: 6px; color: #24282c; font-size: clamp(1rem, 1.7vw, 1.34rem); letter-spacing: -.025em; }
.sheet-cell.rose { background: #ead6dc; }
.sheet-cell.green { background: #e0efe8; }
.sheet-cell.yellow { background: #fff3cd; }
.sheet-cell.dark { color: #fff; background: #a85d72; }
.sheet-cell.dark span, .sheet-cell.dark strong { color: #fff; }

.sheet-scroll-note { display: none; align-items: center; gap: 7px; padding: 9px 12px; color: #555f68; background: #fff8df; border-bottom: 1px solid #e9deb5; font-size: .74rem; font-weight: 700; }
.sheet-scroll-note span { font-size: 1rem; }
.sheet-section { scroll-margin-top: 18px; border-bottom: 1px solid #bfc6cb; }
.sheet-section-heading { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 13px; border-bottom: 1px solid #c0c7cc; background: #f1f2f3; }
.sheet-section-heading > div { display: flex; align-items: center; gap: 9px; }
.sheet-section-heading strong, .sheet-section-heading small { display: block; }
.sheet-section-heading strong { color: #31363b; font-size: .9rem; }
.sheet-section-heading small { margin-top: 1px; color: #6a7178; font-size: .71rem; }
.sheet-section-heading > a { min-height: 34px; padding: 7px 10px; border: 1px solid #a9b2b9; border-radius: 7px; color: #3e4850; background: #fff; font-size: .74rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.sheet-tab-number { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 6px; color: #fff; background: #a85d72; font-size: .78rem; font-weight: 900; }

.spreadsheet-wrap { max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; background: #fff; scrollbar-color: #9ca6ad #edf0f2; scrollbar-width: thin; }
.spreadsheet-wrap:focus-visible { outline: 3px solid rgba(168,93,114,.34); outline-offset: -3px; }
.spreadsheet-table { width: max-content; min-width: 100%; border-spacing: 0; border-collapse: separate; table-layout: auto; color: #272c30; background: #fff; font-family: Calibri, "Segoe UI", Arial, sans-serif; font-size: .82rem; line-height: 1.28; }
.spreadsheet-table.shift-sheet { min-width: 1940px; }
.spreadsheet-table.expense-sheet { min-width: 1120px; }
.spreadsheet-table th, .spreadsheet-table td { height: 38px; padding: 7px 9px; border-right: 1px solid #d1d5d8; border-bottom: 1px solid #d1d5d8; vertical-align: middle; }
.spreadsheet-table th:last-child, .spreadsheet-table td:last-child { border-right: 0; }
.spreadsheet-table thead th { position: sticky; z-index: 3; top: 0; color: #fff; border-color: #777378; background: #555057; font-size: .68rem; letter-spacing: .035em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.spreadsheet-table thead th.numeric { text-align: right; }
.spreadsheet-table tbody tr:hover { background: #f5f8fa; }
.spreadsheet-table tbody tr:last-child td { border-bottom: 0; }
.spreadsheet-table .row-number { position: sticky; z-index: 2; left: 0; width: 42px; min-width: 42px; max-width: 42px; color: #697178; background: #f1f2f3; font-weight: 700; text-align: center; }
.spreadsheet-table thead .row-number { z-index: 5; color: #fff; background: #555057; }
.spreadsheet-table .professional-cell { min-width: 145px; background: #fff3cd; }
.spreadsheet-table .money-cell { background: #f4ebee; font-variant-numeric: tabular-nums; }
.spreadsheet-table .notes-cell { width: 280px; min-width: 220px; max-width: 340px; color: #4e5358; background: #fff9e8; white-space: normal; }
.spreadsheet-table .numeric { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sheet-status { display: inline-block; padding: 3px 7px; border-radius: 4px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.sheet-status-success { color: #1e674f; background: #ddf0e8; }
.sheet-status-warning { color: #895712; background: #fff0d5; }
.sheet-status-attention { color: #614876; background: #eee6f5; }
.sheet-status-danger { color: #963535; background: #f9e3e1; }
.sheet-status-muted { color: #62696f; background: #eaedef; }
.sheet-status-neutral { color: #2d4b6c; background: #e6eff5; }
.sheet-yes { color: #21664f; font-weight: 800; }
.sheet-no { color: #747b81; }
.sheet-row-cancelled td { color: #81878c; background-color: #f0f1f2 !important; text-decoration: line-through; }
.sheet-total-row td { color: #fff; border-color: #866070; background: #a85d72 !important; text-decoration: none; }
.sheet-total-row .row-number { background: #8d4d60 !important; }
.sheet-empty { display: grid; min-height: 105px; place-content: center; gap: 3px; padding: 22px; color: #697178; text-align: center; }
.sheet-empty strong { color: #384149; }

.sheet-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; background: #e9ecee; }
.mini-sheet { min-width: 0; overflow: hidden; border: 1px solid #b9c0c5; border-radius: 7px; background: #fff; }
.mini-sheet-title { padding: 9px 11px; color: #fff; background: #a85d72; font-size: .78rem; font-weight: 850; letter-spacing: .02em; }
.mini-sheet .spreadsheet-table { min-width: 560px; }
.mini-sheet:nth-child(2) .spreadsheet-table, .mini-sheet:nth-child(4) .spreadsheet-table { min-width: 100%; }
.workbook-footer-summary { display: flex; justify-content: flex-end; gap: 28px; padding: 13px 16px; background: #555057; color: #fff; }
.workbook-footer-summary span { display: grid; gap: 1px; }
.workbook-footer-summary small { color: #dcd9dc; font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.workbook-footer-summary strong { font-size: .94rem; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
    .overview-page .page-wrap { padding-inline: 9px; }
    .overview-heading { gap: 12px; margin-bottom: 14px; }
    .overview-heading .month-control { width: 100%; }
    .overview-heading .month-control input { flex: 1; }
    .workbook { border-radius: 9px; }
    .workbook-titlebar { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px; }
    .workbook-titlebar strong { font-size: .86rem; }
    .workbook-titlebar small { font-size: .67rem; }
    .workbook-actions { align-items: stretch; flex-direction: column; }
    .workbook-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .workbook-tabs a { text-align: center; }
    .workbook-download { justify-content: center; }
    .spreadsheet-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sheet-cell { min-height: 72px; padding: 11px 10px; }
    .sheet-cell:nth-child(4n) { border-right: 1px solid #c8ced2; }
    .sheet-cell:nth-child(2n) { border-right: 0; }
    .sheet-cell:nth-last-child(-n+4) { border-bottom: 1px solid #c8ced2; }
    .sheet-cell:nth-last-child(-n+2) { border-bottom: 0; }
    .sheet-cell span { font-size: .61rem; }
    .sheet-cell strong { font-size: 1rem; }
    .sheet-scroll-note { display: flex; }
    .sheet-section-heading { align-items: stretch; flex-direction: column; gap: 8px; padding: 10px; }
    .sheet-section-heading > a { display: flex; align-items: center; justify-content: center; }
    .spreadsheet-wrap { -webkit-overflow-scrolling: touch; }
    .spreadsheet-table { font-size: .78rem; }
    .spreadsheet-table th, .spreadsheet-table td { height: 36px; padding: 6px 8px; }
    .sheet-summary-grid { grid-template-columns: 1fr; gap: 10px; padding: 9px; }
    .mini-sheet .spreadsheet-table { min-width: 620px; }
    .mini-sheet:nth-child(2) .spreadsheet-table, .mini-sheet:nth-child(4) .spreadsheet-table { min-width: 480px; }
    .workbook-footer-summary { align-items: stretch; flex-direction: column; gap: 7px; padding: 11px 13px; }
    .workbook-footer-summary span { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
}
