:root {
    color-scheme: light;
    --font-sans: Poppins, Inter, "Segoe UI", Roboto, Arial, sans-serif;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-strong: #edf2f7;
    --text: #172033;
    --text-muted: #667085;
    --border: #dfe5ee;
    --primary: #3157d5;
    --primary-hover: #2648b6;
    --primary-soft: #eaf0ff;
    --accent: #16a085;
    --success: #16856d;
    --success-soft: #e9f8f3;
    --warning: #a15c00;
    --warning-soft: #fff4dc;
    --danger: #b42318;
    --danger-soft: #fff0ef;
    --info: #175cd3;
    --info-soft: #eff6ff;
    --sidebar: #111c35;
    --sidebar-text: #e8edf8;
    --sidebar-muted: #91a0bf;
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08);
    --shadow-lg: 0 20px 48px rgba(20, 34, 66, .14);
    --radius-sm: 8px;
    --radius: 13px;
    --radius-lg: 20px;
    --sidebar-width: 264px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1420;
    --surface: #171e2d;
    --surface-soft: #1c2536;
    --surface-strong: #253047;
    --text: #eef2f8;
    --text-muted: #a5afc1;
    --border: #2b374d;
    --primary: #7392ff;
    --primary-hover: #8ea7ff;
    --primary-soft: #23335f;
    --success: #56caae;
    --success-soft: #173f39;
    --warning: #f5b954;
    --warning-soft: #443418;
    --danger: #ff8a80;
    --danger-soft: #4a2426;
    --info: #83adff;
    --info-soft: #1d345a;
    --sidebar: #0b1020;
    --sidebar-text: #edf2ff;
    --sidebar-muted: #8996b2;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .25);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: hidden; overflow-y: auto; }
body {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.025em; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

.app-shell { min-height: 100vh; height: auto; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 26px 18px 18px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #456be7, #2343ad);
    box-shadow: inset 0 1px rgba(255, 255, 255, .25), 0 8px 24px rgba(49, 87, 213, .28);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}
.brand strong { display: block; font-size: 18px; letter-spacing: .03em; }
.brand small { display: block; color: var(--sidebar-muted); font-size: 10px; }
.side-nav { margin-top: 40px; }
.nav-heading {
    margin: 28px 12px 9px;
    color: var(--sidebar-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.nav-item {
    display: flex;
    min-height: 45px;
    align-items: center;
    gap: 11px;
    margin: 4px 0;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
}
.nav-item.active { background: rgba(115, 146, 255, .16); color: #fff; }
.nav-item.disabled { color: var(--sidebar-muted); cursor: default; }
.nav-item small { margin-left: auto; font-size: 9px; text-transform: uppercase; }
.nav-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, .06);
    font-size: 12px;
    font-weight: 800;
}
.sidebar-footer { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--sidebar-muted); font-size: 11px; }

.workspace { min-height: 100vh; height: auto; min-width: 0; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    min-height: 70px;
    align-items: center;
    gap: 16px;
    padding: 10px 30px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(12px);
}
.topbar-context { display: flex; flex-direction: column; min-width: 0; }
.topbar-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.topbar-context span { color: var(--text-muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
}
.icon-button:hover { border-color: var(--primary); color: var(--primary); }
.menu-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 4px; }
.avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
}
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 12px; }
.user-chip small { color: var(--text-muted); font-size: 10px; }
.main-content { width: min(1280px, 100%); min-width: 0; min-height: 0; margin: 0 auto; padding: 36px 32px 60px; }

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border .15s ease;
}
.button:active { transform: translateY(1px); }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(49, 87, 213, .2); }
.button-primary:hover { background: var(--primary-hover); }
.button-quiet { min-height: 36px; border-color: var(--border); background: var(--surface); color: var(--text-muted); font-size: 12px; }
.button-quiet:hover { border-color: var(--primary); color: var(--primary); }
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover { filter: brightness(.92); }
.button-block { width: 100%; }

.flash-stack { position: fixed; top: 82px; right: 22px; z-index: 100; display: grid; width: min(390px, calc(100vw - 32px)); gap: 8px; }
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13px; }
.alert button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 20px; line-height: 1; }
.alert-success { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.alert-warning { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.alert-danger { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.alert-info { border-color: var(--info); background: var(--info-soft); color: var(--info); }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.page-heading h1 { margin-bottom: 8px; font-size: clamp(27px, 3vw, 36px); }
.page-heading p { max-width: 680px; margin-bottom: 0; color: var(--text-muted); }
.status-badge { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border)); border-radius: 99px; background: var(--success-soft); color: var(--success); font-size: 11px; font-weight: 700; }
.status-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent); }
.empty-state-card { display: flex; min-height: 280px; align-items: center; justify-content: center; gap: 20px; padding: 32px; border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--border)); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--surface), var(--surface-soft)); box-shadow: var(--shadow-sm); text-align: left; }
.empty-state-icon { display: grid; width: 54px; height: 54px; flex: 0 0 auto; place-items: center; border-radius: 16px; background: var(--primary-soft); color: var(--primary); font-size: 27px; font-weight: 800; }
.empty-state-card h2 { margin-bottom: 7px; font-size: 20px; }
.empty-state-card p { margin-bottom: 0; color: var(--text-muted); font-size: 13px; }
.readiness-version { margin-left: auto; padding: 5px 9px; border-radius: 7px; background: var(--surface); color: var(--text-muted); font: 11px ui-monospace, monospace; }

.public-page { background: var(--surface); }
.setup-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, .9fr) minmax(500px, 1.1fr); }
.setup-intro { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: clamp(35px, 5vw, 72px); background: var(--sidebar); color: #eef3ff; }
.setup-intro::before, .setup-intro::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.setup-intro::before { width: 420px; height: 420px; left: -220px; bottom: -170px; background: rgba(68, 101, 215, .17); }
.setup-intro::after { width: 300px; height: 300px; top: -170px; right: -120px; border: 50px solid rgba(255, 255, 255, .035); }
.brand-public { position: relative; z-index: 1; }
.brand-public small { color: #9eacc8; }
.intro-copy { position: relative; z-index: 1; max-width: 540px; margin: auto 0; padding: 64px 0; }
.intro-copy .eyebrow { color: #89a3ff; }
.intro-copy h1 { margin-bottom: 20px; font-size: clamp(36px, 4.4vw, 62px); letter-spacing: -.045em; }
.intro-copy p { color: #aeb9ce; font-size: 16px; }
.trust-list { position: relative; z-index: 1; display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; color: #c7d0e1; font-size: 13px; }
.trust-list span { display: inline-grid; width: 22px; height: 22px; margin-right: 7px; place-items: center; border-radius: 50%; background: rgba(86, 202, 174, .15); color: #69dbc0; font-size: 11px; font-weight: 800; }
.form-panel-wrap { display: grid; place-items: center; padding: clamp(28px, 6vw, 90px); background: var(--bg); }
.form-panel { width: min(480px, 100%); padding: clamp(25px, 4vw, 44px); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.form-heading { margin-bottom: 28px; }
.form-heading h1, .form-heading h2 { margin: 10px 0 8px; font-size: 27px; }
.form-heading p { margin-bottom: 0; color: var(--text-muted); font-size: 13px; }
.form-heading.centered { text-align: center; }
.step-badge { display: inline-block; padding: 4px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 800; }
.field-group { margin-bottom: 18px; }
.field-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 750; }
.field-input { width: 100%; height: 45px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; outline: none; background: var(--surface); color: var(--text); transition: border .15s, box-shadow .15s; }
textarea.field-input { min-height: 96px; height: auto; resize: vertical; }
.multi-select { min-height: 150px; height: auto; }
.field-input:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.field-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent); }
.has-error .field-input { border-color: var(--danger); }
.field-hint, .field-error { display: block; margin-top: 5px; font-size: 10px; }
.field-hint { color: var(--text-muted); }
.field-error { color: var(--danger); font-weight: 650; }
.privacy-note { margin: 14px 0 0; color: var(--text-muted); font-size: 10px; text-align: center; }
.check-row { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.check-row input { accent-color: var(--primary); }

.login-layout { display: grid; min-height: 100vh; place-items: center; padding: 32px 18px; background: radial-gradient(circle at 50% 0%, var(--primary-soft), transparent 42%), var(--bg); }
.login-card { width: min(430px, 100%); padding: 38px 42px 32px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.brand-centered { justify-content: center; margin-bottom: 32px; }
.brand-centered small { color: var(--text-muted); }
.local-note { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 10px; text-align: center; }
.local-note span { margin-right: 5px; color: var(--success); }
.theme-text-button { display: block; margin: 14px auto 0; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 11px; }

.content-form { width: min(720px, 100%); padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.content-form-wide { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.form-actions form { margin: 0; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 220px auto; gap: 10px; margin-bottom: 18px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.filter-bar-wide { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.filter-bar .field-input { height: 40px; }
.table-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; overflow-y: visible; overscroll-behavior-inline: contain; touch-action: pan-x pan-y; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface-soft); color: var(--text-muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
td { font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
.table-note { display: block; margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 10px; white-space: nowrap; }
.table-actions a, .link-button { border: 0; background: transparent; color: var(--primary); font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer; }
.table-actions form { display: inline; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 14px; color: var(--text-muted); }
.pagination a { color: var(--primary); font-weight: 700; text-decoration: none; }
.section-heading { margin-top: 28px; margin-bottom: 12px; }
.section-heading h2 { margin: 0; }
.compact-form { margin-top: 18px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.field-help { color: var(--text-muted); font-size: 12px; }
.guardian-entry { margin: 16px 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); }
.guardian-entry legend { padding: 0 8px; font-weight: 800; }
.record-number { display: grid; gap: 4px; margin-bottom: 16px; }
.record-number span { color: var(--text-muted); font-size: 11px; }
.empty-cell { padding: 38px; color: var(--text-muted); text-align: center; }
.pill { display: inline-flex; padding: 4px 8px; border-radius: 99px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-muted { background: var(--surface-strong); color: var(--text-muted); }
.panel { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel h2 { margin-bottom: 20px; font-size: 17px; }
.panel-spaced { margin-top: 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-grid > div { display: grid; gap: 4px; }
.detail-grid > div > span { color: var(--text-muted); font-size: 11px; }
.detail-list { display: grid; grid-template-columns: minmax(120px, .45fr) 1fr; gap: 0; margin: 0; }
.detail-list dt, .detail-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--border); }
.detail-list dt { color: var(--text-muted); font-size: 11px; }
.detail-list dd { overflow-wrap: anywhere; font-size: 12px; font-weight: 650; }
.detail-list-columns { grid-template-columns: 150px 1fr 150px 1fr; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.permission-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); cursor: pointer; font-size: 12px; }
.permission-item input { margin-top: 3px; accent-color: var(--primary); }
.json-view { min-height: 120px; margin: 0; padding: 14px; overflow: auto; border-radius: 9px; background: var(--surface-soft); color: var(--text); font: 11px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.code-text { font-family: ui-monospace, Consolas, monospace; }
.inline-alert { position: static; width: 100%; margin-bottom: 18px; box-shadow: none; }

.error-page { display: grid; min-height: 65vh; place-items: center; align-content: center; padding: 40px 20px; text-align: center; }
.error-page > span { color: var(--primary); font-size: clamp(72px, 14vw, 130px); font-weight: 850; letter-spacing: -.08em; opacity: .16; }
.error-page h1 { margin: -36px 0 12px; font-size: 28px; }
.error-page p { max-width: 500px; margin-bottom: 25px; color: var(--text-muted); }
.sidebar-backdrop { display: none; }

@media (max-width: 1060px) {
    .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar-wide { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
    .setup-layout { grid-template-columns: minmax(330px, .8fr) minmax(430px, 1.2fr); }
    .setup-intro { padding: 38px; }
    .intro-copy h1 { font-size: 40px; }
}

@media (max-width: 820px) {
    body.sidebar-open { overflow: hidden; }
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .workspace { margin-left: 0; }
    .menu-toggle { display: grid; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; border: 0; background: rgba(3, 8, 20, .55); }
    .sidebar-open .sidebar-backdrop { display: block; }
    .setup-layout { grid-template-columns: 1fr; }
    .setup-intro { min-height: auto; padding: 30px; }
    .intro-copy { padding: 62px 0 32px; }
    .trust-list { display: none; }
    .form-panel-wrap { padding: 34px 18px 50px; }
    .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-list-columns { grid-template-columns: 130px 1fr; }
}

@media (max-width: 600px) {
    .topbar { padding: 9px 14px; }
    .topbar-context span, .user-chip > span:not(.avatar), .topbar .button-quiet { display: none; }
    .topbar-actions { gap: 7px; }
    .main-content { padding: 27px 16px 45px; }
    .page-heading { display: block; }
    .status-badge { margin-top: 17px; }
    .empty-state-card { min-height: 240px; align-items: flex-start; padding: 24px 18px; }
    .readiness-version { display: none; }
    .login-card { padding: 30px 22px 25px; }
    .setup-intro { padding: 25px 22px; }
    .intro-copy { padding: 48px 0 18px; }
    .intro-copy h1 { font-size: 34px; }
    .form-panel { padding: 28px 21px; }
    .content-form, .panel { padding: 20px; }
    .form-grid, .detail-grid, .permission-grid, .filter-bar, .filter-bar-wide, .check-grid { grid-template-columns: 1fr; }
    .page-heading .button { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.form-step {
    border-block-end: 1px solid var(--border);
    padding-block: .5rem 1.25rem;
}

.form-step:last-of-type { border-block-end: 0; }

.repeat-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.repeat-heading h2 { margin-block-start: 0; }
.repeat-row { position: relative; }
.repeat-remove { margin-block-start: 10px; }

@media (max-width: 600px) {
    .repeat-heading { display: block; }
    .repeat-heading .button { width: 100%; margin-block: 8px 14px; }
}

.receipt-card { width: min(920px, 100%); margin-inline: auto; padding: 34px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.budget-overrun { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
@media print {
    .budget-overrun { background: #fee2e2; color: #991b1b; }
    .print-view .sidebar, .print-view .topbar, .print-view .sidebar-backdrop, .print-actions { display: none !important; }
    .print-view .workspace { margin: 0; }
    .print-view .main-content { padding: 0; }
    .print-view .receipt-card { width: 100%; border: 0; box-shadow: none; }
}

/* Stage 10 financial reporting */
.report-tabs { display: flex; gap: 8px; margin: 0 0 16px; overflow-x: auto; padding: 4px 0; scrollbar-width: thin; }
.report-tabs a { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: 11px; font-weight: 700; text-decoration: none; }
.report-tabs a:hover, .report-tabs a.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.report-filter { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)) auto; align-items: end; gap: 10px; margin-bottom: 18px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.report-filter label { display: grid; gap: 5px; min-width: 0; color: var(--text-muted); font-size: 10px; font-weight: 700; }
.report-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.report-summary article { display: grid; gap: 7px; min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.report-summary span { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.report-summary strong { overflow-wrap: anywhere; font-size: clamp(18px, 2vw, 25px); }
.report-summary small { color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.content-card { padding: 19px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.content-card h3 { margin: 18px 0 8px; font-size: 12px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-heading h2 { margin: 2px 0 0; font-size: 16px; }
.section-heading a { color: var(--primary); font-size: 11px; font-weight: 700; }
.analysis-row, .due-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--border); }
.analysis-row:last-child, .due-row:last-child { border-bottom: 0; }
.analysis-row > div:first-child, .due-row > span { display: grid; min-width: 0; gap: 3px; }
.analysis-row strong, .due-row strong { overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.analysis-row small, .due-row small { color: var(--text-muted); font-size: 9px; }
.analysis-value { display: grid; min-width: 140px; gap: 5px; color: var(--text); font-size: 11px; font-weight: 700; text-align: right; }
.bar { display: block; width: 100%; height: 5px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.bar i { display: block; width: var(--bar-size, 0%); height: 100%; border-radius: inherit; background: var(--primary); }
.bar-income i { background: var(--success); }
.bar-expense i { background: var(--danger); }
.money-cell { font-weight: 700; white-space: nowrap; }
.negative { color: var(--danger); }
.empty-panel { margin-bottom: 18px; text-align: center; }
.empty-copy { color: var(--text-muted); font-size: 11px; }
.pagination { display: flex; justify-content: space-between; gap: 12px; }
.pagination > span:last-child { display: flex; gap: 12px; }

@media (max-width: 1060px) {
    .report-filter { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
    .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .report-filter, .report-summary, .report-grid { grid-template-columns: 1fr; }
    .report-filter .button { width: 100%; }
    .report-summary article { padding: 15px; }
    .content-card { padding: 15px; }
    .analysis-row, .due-row { align-items: flex-start; }
    .analysis-value { min-width: 112px; }
}

.notification-row-unread { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.notification-severity { display: inline-block; margin-top: .25rem; font-size: .78rem; font-weight: 700; }
.notification-severity-info { color: var(--primary); }
.notification-severity-warning { color: #a16207; }
.notification-severity-critical { color: var(--danger); }
.notification-count { margin-left: auto; min-width: 1.4rem; padding: .1rem .35rem; border-radius: 999px; background: var(--danger); color: #fff; text-align: center; font-size: .72rem; }
.notification-bell { position: relative; text-decoration: none; }
.notification-bell span { position: absolute; top: -.35rem; right: -.35rem; min-width: 1.15rem; padding: .05rem .25rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .66rem; line-height: 1.1rem; text-align: center; }
.notification-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .4rem; min-width: 12rem; }
.notification-actions form { margin: 0; }
.notification-resolve-form { display: grid; gap: .3rem; width: min(18rem, 100%); }
.notification-resolve-form label { font-size: .75rem; color: var(--text-muted); }
.notification-resolve-form textarea { width: 100%; min-height: 3.5rem; padding: .45rem; border: 1px solid var(--border); border-radius: .45rem; background: var(--surface); color: var(--text); resize: vertical; }
