* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f4f6f8;
    color: #172033;

    display: flex;
    min-height: 100vh;
}

a {
    color: #243b69;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    width: 245px;
    min-height: 100vh;

    background: #172033;
    color: white;

    padding: 26px 18px;
}

.brand {
    margin-bottom: 34px;
    padding: 0 10px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.3rem;
}

.brand small {
    margin-top: 5px;
    color: #aab3c2;
}

.sidebar nav {
    display: grid;
    gap: 5px;
}

.sidebar nav a {
    text-decoration: none;
    color: #d9dfeb;

    padding: 11px 12px;
    border-radius: 8px;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, .09);
    color: white;
}

.logout-form {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 24px;
}

.logout-form button {
    width: 100%;
    margin: 0;

    padding: 11px;

    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;

    background: transparent;
    color: white;

    cursor: pointer;
}

.main-content {
    width: calc(100% - 245px);
    margin-left: 245px;

    padding: 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 5px;
}

.page-header p {
    margin: 0;
    color: #667085;
}

.btn {
    display: inline-block;

    padding: 11px 17px;

    border: none;
    border-radius: 8px;

    background: #172033;
    color: white;

    text-decoration: none;
    cursor: pointer;
}

.cards {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(210px, 1fr));

    gap: 18px;

    margin-bottom: 28px;
}

.card,
.panel {
    background: white;

    border-radius: 14px;

    box-shadow:
        0 4px 18px rgba(0,0,0,.055);
}

.card {
    padding: 22px;
}

.card span,
.card small {
    display: block;
    color: #667085;
}

.card strong {
    display: block;

    margin-top: 9px;

    font-size: 1.7rem;
}

.target-date {
    margin-top: 10px;
}

.panel {
    padding: 22px;
}

.panel h2 {
    margin-top: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 22px;
}

.month-selector {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 26px;

    width: fit-content;

    margin-bottom: 22px;
    padding: 10px 17px;

    background: white;

    border-radius: 10px;

    box-shadow:
        0 3px 12px rgba(0,0,0,.04);
}

.month-selector a {
    font-size: 1.3rem;
    text-decoration: none;
}

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

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

th,
td {
    padding: 13px 15px;

    text-align: left;

    border-bottom: 1px solid #eaecf0;
}

th {
    color: #475467;
    font-size: .9rem;
}

tr:last-child td {
    border-bottom: none;
}

.positive {
    color: #087443;
}

.negative {
    color: #b42318;
}

.badge {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 20px;

    font-size: .82rem;
}

.badge.success {
    background: #dcfae6;
    color: #087443;
}

.badge.warning {
    background: #fef0c7;
    color: #93370d;
}

.badge.neutral {
    background: #eaecf0;
    color: #475467;
}

.badge.info {
    background: #e0eaff;
    color: #3538cd;
}

.goal {
    margin-bottom: 22px;
}

.goal:last-child {
    margin-bottom: 0;
}

.goal-line {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.progress {
    height: 9px;

    margin: 10px 0;

    background: #e6e9ef;

    border-radius: 20px;

    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #172033;
}

.alert-box,
.success-box,
.message {
    margin-bottom: 22px;
    padding: 14px 16px;

    border-radius: 10px;
}

.alert-box {
    background: #fff4e5;
}

.alert-box a {
    margin-left: 12px;
}

.success-box,
.message.success {
    background: #dcfae6;
}

.message.error {
    background: #fee4e2;
}

.form-panel {
    max-width: 760px;
}

.form-panel p {
    margin-bottom: 20px;
}

.form-panel label,
.panel form label {
    display: block;

    margin-bottom: 6px;

    font-weight: 600;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.panel form input,
.panel form select,
.panel form textarea {
    width: 100%;

    padding: 10px 11px;

    border: 1px solid #d0d5dd;
    border-radius: 7px;

    background: white;
}

.form-panel textarea,
.panel form textarea {
    min-height: 90px;
}

.form-panel input[type="checkbox"],
.panel form input[type="checkbox"] {
    width: auto;
}

.helptext {
    display: block;

    margin-top: 5px;

    color: #667085;

    font-size: .85rem;
}

.errorlist {
    padding-left: 18px;
    color: #b42318;
}

.transaction-amount {
    font-size: 1.8rem;
}

.allocation-summary {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;

    margin-top: 22px;
}

.allocation-summary div {
    padding: 14px;

    background: #f8f9fb;

    border-radius: 10px;
}

.allocation-summary span,
.allocation-summary strong {
    display: block;
}

.allocation-summary span {
    color: #667085;
    font-size: .88rem;
}

.allocation-summary strong {
    margin-top: 5px;
}

.back-link {
    display: inline-block;
    margin-bottom: 12px;

    text-decoration: none;
}

.empty-state {
    color: #667085;
}

.auth-page {
    min-height: 100vh;

    display: grid;

    place-items: center;

    width: 100%;
}

.login-card {
    width: min(420px, calc(100% - 32px));

    padding: 32px;

    background: white;

    border-radius: 16px;

    box-shadow:
        0 10px 30px rgba(0,0,0,.1);
}

.login-card label {
    display: block;

    margin-top: 18px;
    margin-bottom: 6px;
}

.login-card input {
    width: 100%;

    padding: 12px;

    border: 1px solid #d0d5dd;
    border-radius: 8px;
}

.login-card button {
    width: 100%;

    margin-top: 22px;
    padding: 12px;

    border: none;
    border-radius: 8px;

    background: #172033;
    color: white;

    cursor: pointer;
}

@media (max-width: 900px) {

    body {
        display: block;
    }

    .sidebar {
        position: static;

        width: 100%;
        min-height: auto;
    }

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

    .logout-form {
        position: static;
        margin-top: 20px;
    }

    .main-content {
        width: 100%;
        margin-left: 0;

        padding: 18px;
    }

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

    .allocation-summary {
        grid-template-columns: 1fr;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: white;
    color: #172033;
    border: 1px solid #d0d5dd;
}

.import-result {
    margin-top: 22px;
}

.import-result .cards {
    margin-top: 18px;
}

.error-list {
    color: #b42318;
}

@media (max-width: 700px) {
    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
        text-align: center;
    }
}

.filters {
    display: grid;
    grid-template-columns:
        2fr
        minmax(180px, 1fr)
        minmax(160px, .7fr)
        auto;

    gap: 14px;
    align-items: end;
}

.filters label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.filters input,
.filters select {
    width: 100%;
    padding: 10px;

    border: 1px solid #d0d5dd;
    border-radius: 7px;
}

.filter-panel {
    margin-bottom: 22px;
}

.filter-actions {
    display: flex;
    gap: 7px;
}

.btn-small {
    padding: 7px 11px;
    font-size: .85rem;
}

@media (max-width: 1000px) {

    .filters {
        grid-template-columns: 1fr;
    }

}
