:root {
    color: #172033;
    background: #f5f7fb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

a {
    color: #175cd3;
    font-weight: 600;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.site-header {
    border-bottom: 1px solid #e4e7ec;
    background: #fff;
}

.site-header-inner {
    display: flex;
    width: min(1120px, calc(100% - 32px));
    min-height: 64px;
    margin: 0 auto;
    align-items: center;
    gap: 24px;
}

.site-brand {
    color: #172033;
    font-weight: 800;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.current-user {
    margin: 0 0 0 auto;
    color: #475467;
    font-size: 0.875rem;
}

.dashboard-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 64px;
}

.message-list {
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.message {
    padding: 14px 16px;
    border: 1px solid #a6f4c5;
    border-radius: 10px;
    color: #05603a;
    background: #ecfdf3;
}

.message-error {
    border-color: #fecdca;
    color: #b42318;
    background: #fef3f2;
}

.dashboard-header,
.panel-heading,
.category-item,
.history-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.month-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-picker label {
    color: #475467;
    font-size: 0.875rem;
    font-weight: 700;
}

.month-picker input {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
}

.completeness-banner {
    display: flex;
    margin-top: 28px;
    padding: 18px 20px;
    border: 1px solid;
    border-radius: 12px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.completeness-banner p {
    margin: 6px 0 0;
}

.completeness-banner--complete {
    border-color: #a6f4c5;
    background: #ecfdf3;
}

.completeness-banner--incomplete {
    border-color: #fedf89;
    background: #fffaeb;
}

.status-pill {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.75);
    font-size: 0.8125rem;
    font-weight: 800;
    white-space: nowrap;
}

.summary-card small {
    display: block;
    margin-top: 8px;
    color: #667085;
}

.comparison-note {
    margin: 14px 0 0;
    color: #667085;
    font-size: 0.875rem;
}

.eyebrow,
.panel-heading p,
.snapshot-date,
.summary-card p {
    margin: 0;
    color: #667085;
}

.eyebrow {
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 5vw, 3rem);
}

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

.summary-grid,
.dashboard-grid,
.dashboard-charts {
    display: grid;
    gap: 20px;
    margin-top: 32px;
}

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

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

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

.summary-card,
.panel,
.dashboard-chart-card,
.empty-state,
.form-panel {
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgb(16 24 40 / 0.04);
}

.summary-card {
    padding: 24px;
}

.summary-card strong {
    display: block;
    margin-top: 12px;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.liability-card strong {
    color: #b42318;
}

.net-worth-card {
    border-color: #a9d6c3;
    background: #effaf5;
}

.net-worth-card strong {
    color: #087443;
}

.panel {
    overflow: hidden;
}

.dashboard-chart-card {
    min-width: 0;
    overflow: hidden;
}

.dashboard-chart-card--wide {
    margin-top: 20px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 320px;
    padding: 20px 24px;
}

.chart-container--trend {
    height: 380px;
}

.chart-empty-state {
    margin: 0;
    padding: 48px 24px;
    color: #667085;
    text-align: center;
}

.panel-heading {
    padding: 20px 24px;
    border-bottom: 1px solid #eaecf0;
}

.category-list,
.history-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-item,
.history-list li {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f2f5;
}

.category-item:last-child,
.history-list li:last-child {
    border-bottom: 0;
}

.type-badge {
    display: inline-block;
    margin-right: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.type-asset {
    color: #087443;
    background: #dcfae6;
}

.type-liability {
    color: #b42318;
    background: #fee4e2;
}

.empty-list,
.empty-state {
    color: #667085;
}

.empty-list {
    padding: 24px;
}

.empty-state {
    margin-top: 32px;
    padding: 48px 24px;
    text-align: center;
}

.empty-state h2 {
    color: #172033;
}

.empty-state p {
    max-width: 480px;
    margin: 12px auto 0;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #175cd3;
    border-radius: 8px;
    color: #fff;
    background: #175cd3;
    font-weight: 700;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: #004eeb;
    text-decoration: none;
}

.button-small {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 0.875rem;
}

.button-link {
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #175cd3;
}

.button-link:hover {
    background: transparent;
    text-decoration: underline;
}

.danger-link {
    color: #b42318;
}

.button-danger {
    border-color: #b42318;
    background: #b42318;
}

.button-danger:hover {
    background: #912018;
}

.intervention-notice {
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid #fdb022;
    border-radius: 12px;
    background: #fffaeb;
}

.intervention-notice p {
    margin: 8px 0;
}

.intervention-notice small {
    color: #667085;
}

.form-panel {
    width: min(100%, 640px);
    margin: 24px auto 0;
    padding: 32px;
}

.form-panel form p,
.form-field {
    display: grid;
    gap: 8px;
    margin: 0 0 20px;
}

.form-panel label {
    font-weight: 700;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
}

.form-panel ul.errorlist {
    margin: 0;
    padding-left: 20px;
    color: #b42318;
}

.form-actions,
.entry-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 16px 24px;
    border-bottom: 1px solid #eaecf0;
    white-space: nowrap;
}

th {
    color: #475467;
    background: #f9fafb;
    font-size: 0.875rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.entry-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.entry-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f2f5;
}

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

.entry-list li > div:first-child {
    display: grid;
    gap: 4px;
}

.entry-list span {
    color: #667085;
    font-size: 0.875rem;
}

.entry-actions form {
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 720px) {
    .dashboard-shell {
        width: min(100% - 24px, 1120px);
        padding-top: 28px;
    }

    .site-header-inner {
        width: min(100% - 24px, 1120px);
        flex-wrap: wrap;
        gap: 12px 16px;
        padding: 12px 0;
    }

    .site-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .current-user {
        margin-left: auto;
    }

    .dashboard-header,
    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .month-picker {
        width: 100%;
        flex-wrap: wrap;
    }

    .summary-grid,
    .dashboard-grid,
    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .entry-list li {
        align-items: flex-start;
        flex-direction: column;
    }
}
