:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef5f4;
    --text: #111827;
    --muted: #64748b;
    --line: #dbe4ec;
    --primary: #0d9488;
    --primary-strong: #0f766e;
    --blue: #2563eb;
    --amber: #d97706;
    --danger: #dc2626;
    --good: #16a34a;
    --nav: #0f172a;
    --nav-soft: #172033;
    --radius: 8px;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #eef6f5 0, var(--bg) 260px, #f8fafc 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 16px;
    background: var(--nav);
    color: #f8fafc;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 8px;
    border-radius: var(--radius);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--blue));
    color: #fff;
    font-weight: 800;
    flex: 0 0 auto;
}

.brand strong,
.brand small {
    display: block;
    line-height: 1.2;
}

.brand small {
    color: #b8c0cc;
    margin-top: 3px;
}

.nav-list {
    display: grid;
    gap: 6px;
    margin-top: 28px;
}

.nav-list a,
.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #d9e2ef;
    font-weight: 700;
}

.nav-list a:hover,
.nav-list a.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.nav-list a.is-active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-list svg,
.mobile-nav svg,
.btn svg,
.icon-btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.main {
    min-width: 0;
    padding: 28px 32px 44px;
}

.topbar,
.toolbar,
.panel-header,
.toolbar-actions,
.table-actions,
.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar {
    margin-bottom: 20px;
    padding: 4px 0 8px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 1.82rem;
    line-height: 1.2;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 1.05rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    border-radius: 8px;
    padding: 8px 10px 8px 12px;
}

.user-chip span,
.user-chip small {
    display: block;
}

.user-chip small {
    color: var(--muted);
}

.btn,
.icon-btn {
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    font-weight: 700;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.btn {
    padding: 9px 14px;
}

.btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.btn.primary {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 10px 20px rgba(13, 148, 136, 0.18);
}

.btn.primary:hover {
    background: var(--primary-strong);
}

.btn.ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.82);
    border-color: var(--line);
}

.btn.warning {
    color: #4b2e00;
    background: #fde68a;
}

.btn.danger,
.icon-btn.danger {
    color: #fff;
    background: var(--danger);
}

.btn.small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.86rem;
}

.btn.full {
    width: 100%;
}

.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--text);
    background: var(--surface);
    border-color: var(--line);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.metric-card,
.panel,
.event-card,
.resource-card,
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-color: rgba(148, 163, 184, 0.32);
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--blue), var(--amber));
    opacity: .78;
}

.metric-card span,
.metric-card small {
    color: var(--muted);
}

.metric-card strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 1.6rem;
    line-height: 1.15;
}

.metric-card.strong {
    border-left: 0;
}

.dashboard-grid,
.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.dashboard-grid .wide {
    grid-column: 1 / -1;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 300px;
    min-height: 260px;
    overflow: hidden;
}

.chart-box.wide {
    height: 280px;
}

.chart-box.compact {
    height: 220px;
    min-height: 200px;
}

.chart-box canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.panel {
    padding: 18px;
    border-color: rgba(148, 163, 184, 0.32);
}

.panel-header {
    margin-bottom: 14px;
}

.panel-header a {
    color: var(--primary);
    font-weight: 700;
}

.toolbar {
    flex-wrap: wrap;
    margin: 10px 0 16px;
}

.inline-form,
.grid-form,
.stack-form {
    display: grid;
    gap: 12px;
}

.inline-form {
    grid-template-columns: repeat(4, minmax(150px, auto));
    align-items: end;
}

.inline-form.filters {
    grid-template-columns: repeat(5, minmax(150px, auto));
}

.inline-form.tight {
    display: flex;
    gap: 6px;
    align-items: center;
}

.grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-form.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-weight: 700;
    min-width: 0;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--text);
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(15, 118, 110, 0.18);
    border-color: var(--primary);
}

.wide-field {
    grid-column: 1 / -1;
}

.check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.check-card input {
    width: 18px;
    min-height: 18px;
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    font-weight: 700;
    white-space: nowrap;
}

.check-inline input {
    width: 16px;
    min-height: 16px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    background: #f8fafc;
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #344054;
    background: var(--surface-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.status.closed,
.status.deleted,
.status.cancelled,
.event-card.overdue {
    color: #fff;
    background: var(--danger);
}

.status.open,
.status.done,
.status.active,
.status.receipt-ok,
.status.acknowledged,
.status.reimbursed {
    color: #fff;
    background: var(--good);
}

.status.extra-home {
    color: #fff;
    background: var(--blue);
}

.status.planned,
.status.partial,
.status.corrected,
.status.deposit,
.status.adjustment,
.status.missing-receipt,
.status.unsettled {
    color: #3f2f05;
    background: #fde68a;
}

.status.withdrawal,
.status.ignored {
    color: #fff;
    background: var(--danger);
}

.flash {
    padding: 12px 14px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid var(--line);
    background: var(--surface);
}

.flash.success {
    border-color: #86efac;
    background: #f0fdf4;
}

.flash.error {
    border-color: #fecaca;
    background: #fef2f2;
}

.alert-strip {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.alert-strip svg {
    color: var(--amber);
}

.alert-strip.danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.alert-strip.danger svg {
    color: var(--danger);
}

.alert-strip.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.alert-strip.success svg {
    color: var(--good);
}

.toolbar > .inline-form,
.toolbar > .btn,
.toolbar-actions form {
    filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.04));
}

.dashboard-grid .panel,
.split-grid .panel {
    min-width: 0;
}

.panel-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
}

.panel-header small {
    color: var(--muted);
}

.table-wrap {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: var(--radius);
    overflow: auto;
}

.table-wrap table {
    background: #fff;
}

tbody tr {
    transition: background .15s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

.list-row {
    border-radius: var(--radius);
    padding: 10px 8px;
    transition: background .15s ease, transform .15s ease;
}

.list-row:hover {
    background: #f8fafc;
    transform: translateX(2px);
}

.timeline-item {
    padding: 6px 0;
}

.timeline-item > span {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.chart-box {
    padding: 8px 4px 0;
}

.resource-card,
.event-card,
.fund-card,
.quick-card,
.attachment-tile {
    border-color: rgba(148, 163, 184, 0.32);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.resource-card:hover,
.event-card:hover,
.fund-card:hover,
.quick-card:hover,
.attachment-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 148, 136, 0.34);
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.10);
}

.fund-card {
    border-left: 4px solid var(--fund-color, var(--primary));
}

.fund-card-main strong {
    color: #0f172a;
}

.quick-actions {
    align-items: stretch;
}

.quick-card {
    color: #0f172a;
}

.quick-card.is-active {
    background: #ecfdf5;
}

.chip-cloud span {
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
}

.empty-state {
    box-shadow: var(--shadow);
}

.list,
.timeline {
    display: grid;
    gap: 10px;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.list-row:last-child {
    border-bottom: 0;
}

.list-row small,
.muted {
    color: var(--muted);
}

.list-row.danger {
    color: var(--danger);
}

.list-row.warning {
    color: #8a5700;
}

.timeline-item {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 12px;
}

.timeline-item > span {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--blue);
}

.timeline-item small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

pre {
    max-width: 100%;
    overflow: auto;
    padding: 12px;
    border-radius: 8px;
    background: #111827;
    color: #f8fafc;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.fund-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.resource-card,
.event-card,
.fund-card {
    padding: 16px;
}

.fund-card {
    display: grid;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.fund-card.is-deleted,
.is-muted {
    opacity: .58;
}

.fund-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.fund-card-main strong,
.fund-card-main small {
    display: block;
}

.fund-card-main small {
    color: var(--muted);
    margin-top: 3px;
}

.fund-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--fund-color, var(--primary));
    background: color-mix(in srgb, var(--fund-color, var(--primary)), #ffffff 86%);
    border: 1px solid color-mix(in srgb, var(--fund-color, var(--primary)), #ffffff 65%);
    flex: 0 0 auto;
}

.fund-icon svg {
    width: 23px;
    height: 23px;
}

.fund-progress {
    display: grid;
    gap: 7px;
}

.fund-progress > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-weight: 800;
}

.fund-progress progress {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: var(--surface-soft);
}

.fund-progress progress::-webkit-progress-bar {
    background: var(--surface-soft);
}

.fund-progress progress::-webkit-progress-value {
    border-radius: 999px;
    background: var(--fund-color, var(--primary));
}

.fund-progress progress::-moz-progress-bar {
    border-radius: 999px;
    background: var(--fund-color, var(--primary));
}

.fund-progress.large progress {
    height: 16px;
}

.fund-hero {
    display: grid;
    gap: 14px;
    border-left: 5px solid var(--fund-color, var(--primary));
}

.resource-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.resource-card svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.resource-card small,
.event-card small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.event-card {
    display: grid;
    gap: 12px;
}

.event-card dl,
.details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

dt {
    color: var(--muted);
    font-size: 0.84rem;
}

dd {
    margin: 2px 0 0;
    font-weight: 700;
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.attachment-tile {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.attachment-tile a {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.attachment-tile span {
    overflow-wrap: anywhere;
}

.attachment-tile.is-deleted {
    opacity: .6;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 16px;
}

.quick-card {
    min-height: 92px;
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font-weight: 800;
    color: var(--text);
}

.quick-card svg {
    width: 26px;
    height: 26px;
    color: var(--primary);
}

.quick-card.is-active {
    border-color: var(--primary);
    outline: 3px solid rgba(15, 118, 110, 0.16);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.quick-amounts {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-amounts button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    min-height: 36px;
    padding: 6px 10px;
}

.inline-delete {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-delete input {
    min-height: 34px;
    width: 120px;
}

.row-details summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 800;
}

.settlement-details {
    min-width: 260px;
}

.settlement-form {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.settlement-form input,
.settlement-form select {
    min-height: 36px;
}

.chip-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-cloud span {
    border: 1px solid color-mix(in srgb, var(--chip), #ffffff 65%);
    background: color-mix(in srgb, var(--chip), #ffffff 88%);
    color: #1f2937;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 700;
}

.empty-state {
    min-height: 320px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 30px;
}

.empty-state svg {
    width: 42px;
    height: 42px;
    color: var(--primary);
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #eef3f7;
}

.auth-card {
    width: min(460px, 100%);
    padding: 28px;
}

.auth-brand {
    margin-bottom: 22px;
}

.auth-switch {
    margin: 14px 0 0;
    text-align: center;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 800;
}

.mobile-nav {
    display: none;
}

.text-danger {
    color: var(--danger);
    font-weight: 800;
}

.text-good {
    color: var(--good);
    font-weight: 800;
}

.danger-zone {
    border-color: #fecaca;
}

.list-row {
    border-radius: var(--radius);
    padding: 10px 8px;
    transition: background .15s ease, transform .15s ease;
}

.list-row:hover {
    background: #f8fafc;
    transform: translateX(2px);
}

.resource-card,
.event-card,
.fund-card,
.quick-card,
.attachment-tile {
    border-color: rgba(148, 163, 184, 0.32);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.resource-card:hover,
.event-card:hover,
.fund-card:hover,
.quick-card:hover,
.attachment-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 148, 136, 0.34);
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.10);
}

.fund-card {
    border-left: 4px solid var(--fund-color, var(--primary));
}

.quick-card {
    color: #0f172a;
}

.quick-card.is-active {
    background: #ecfdf5;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .main {
        padding: 18px 16px 92px;
    }

    .metric-grid,
    .dashboard-grid,
    .split-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        display: flex;
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        background: rgba(15, 23, 42, 0.94);
        border-top: 1px solid rgba(255, 255, 255, 0.10);
        box-shadow: 0 -18px 36px rgba(15, 23, 42, 0.22);
        backdrop-filter: blur(14px);
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    }

    .mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .mobile-nav a {
        flex: 0 0 76px;
        min-height: 58px;
        padding: 6px 4px;
        display: grid;
        place-items: center;
        gap: 2px;
        color: #cbd5e1;
        font-size: 0.72rem;
        text-align: center;
    }

    .mobile-nav a.is-active {
        color: #fff;
        background: rgba(13, 148, 136, 0.25);
        box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.22);
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
    }

    .user-chip {
        padding: 7px;
    }

    .user-chip > span,
    .user-chip > small {
        display: none;
    }

    h1 {
        font-size: 1.35rem;
    }

    .metric-grid,
    .dashboard-grid,
    .split-grid,
    .grid-form,
    .grid-form.compact,
    .quick-actions,
    .event-card dl,
    .details-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-card {
        min-height: 74px;
    }

    .inline-form,
    .inline-form.filters {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .toolbar,
    .toolbar-actions {
        align-items: stretch;
    }

    .toolbar > .btn,
    .toolbar-actions,
    .toolbar-actions .btn,
    .toolbar-actions form {
        width: 100%;
    }

    .panel {
        padding: 14px;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        padding: 12px 0;
        border-bottom: 1px solid var(--line);
    }

    td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        border-bottom: 0;
        padding: 7px 0;
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 800;
        flex: 0 0 110px;
    }

    .table-actions,
    .inline-delete {
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

/* Shared refinement of existing screens; no alternate layout framework. */
body { background: #f6f7f8; }
.app-shell { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { overflow-y: auto; background: #202825; }
.brand-mark { background: #0f766e; }
.main { min-width: 0; }
.panel { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.metric-card, .event-card, .resource-card, .fund-card { box-shadow: none; }
.metric-card::before { display: none; }
.metric-card.strong:first-child { border-left: 4px solid var(--primary-strong); }
.metric-card strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { padding: 16px; }
.list-row > span { min-width: 0; }
.list-row > span > strong, .list-row > span > small { display: block; }
.list-row > b { flex-shrink: 0; white-space: nowrap; }
.list-row > span > strong { overflow-wrap: anywhere; }
.receipt-suggestion > svg { color: #285c55; }
.balance-strip { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 0 2px 16px; font-size: .88rem; color: var(--muted); }
.balance-strip strong { color: var(--text); margin-left: 6px; white-space: nowrap; }
.receipt-suggestion { background: #edf5f4; color: #285c55; border-color: #c7dfda; }
.receipt-suggestion a { text-decoration: underline; }
.status.missing-receipt { background: #edf2f5; color: #465b68; }
.chart-box { position: relative; }
.chart-state { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; background: #f6f7f8; color: var(--muted); text-align: center; padding: 24px; }
.chart-state[hidden] { display: none; }
.table-wrap { border-radius: 0; }
th { letter-spacing: 0; }
.pagination, .form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagination { justify-content: flex-end; padding: 18px 0; }
.filters { flex-wrap: wrap; }
.search-field { min-width: 180px; }
.empty-table { padding: 32px; text-align: center; color: var(--muted); }
.field-error { color: #b42318; font-size: .85rem; }
[aria-invalid="true"] { border-color: #b42318; }
.form-details { padding: 12px 0; border-top: 1px solid var(--line); }
.form-details > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.form-details[open] > summary { margin-bottom: 12px; }
.amount-field input { font-size: 2rem; font-weight: 700; min-height: 64px; }
.quick-expense { max-width: 820px; }
.quick-actions { gap: 8px; }
.quick-card { min-height: 58px; box-shadow: none; }
.icon-btn { min-width: 44px; min-height: 44px; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 100; background: white; padding: 12px; }
.skip-link:focus { top: 12px; }
.mobile-more summary { list-style: none; }
.mobile-more summary::-webkit-details-marker { display: none; }
.mobile-more-panel { display: none; }
.mobile-more[open] .mobile-more-panel { display: grid; }
@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 1fr; }
    .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mobile-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; background: #202825; box-shadow: 0 -2px 10px #00000012; backdrop-filter: none; }
    .mobile-nav > a, .mobile-more > summary { min-width: 0; min-height: 56px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 6px 0; font-size: .75rem; color: #e2e8e5; cursor: pointer; }
    .mobile-more > summary svg { width: 22px; height: 22px; }
    .mobile-nav > a:nth-child(3) { background: #0f766e; color: white; }
    .mobile-more-panel { position: absolute; bottom: calc(100% + 8px); left: 8px; right: 8px; max-height: min(65vh, 520px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -5px 25px #00000018; padding: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mobile-more-panel a { display: flex; justify-content: flex-start; gap: 10px; padding: 12px; color: #25312e; font-size: .88rem; text-align: left; min-width: 0; }
    .mobile-more-panel a.is-active { background: #e6f1ef; color: #0f766e; box-shadow: none; }
    .mobile-more-panel svg { flex: 0 0 20px; }
}
@media (max-width: 760px) {
    .metric-card strong { font-size: 1.28rem; }
    .metric-card span, .metric-card small { font-size: .8rem; }
    .metric-card { padding: 12px; }
    .balance-strip { display: grid; gap: 8px; }
    .quick-actions { display: flex; overflow-x: auto; padding-bottom: 8px; }
    .quick-card { flex: 0 0 88px; min-height: 62px; }
    .form-actions .btn { flex: 1 1 160px; }
    .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .filters .search-field { grid-column: 1 / -1; min-width: 0; }
    .filters input, .filters select { min-width: 0; width: 100%; }
    .table-wrap td { overflow-wrap: anywhere; }
    .table-wrap td::before { flex-basis: 76px; }
    .empty-table::before { display: none; }
    .table-actions { gap: 6px; }
    .inline-delete input { max-width: 110px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
