:root {

    --background: #f5f4ef;

    --surface: #ffffff;

    --surface-soft: #f0efe9;

    --text: #171815;

    --muted: #77786f;

    --muted-light: #999b91;

    --border: #e5e3da;

    --accent: #d7f15b;

    --accent-dark: #afc83a;

    --dark: #181a17;

    --danger: #d95757;

    --shadow:
        0 18px 50px
        rgba(21, 22, 18, 0.08);
}


/* RESET */

* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {

    margin: 0;

    min-height: 100vh;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);

    color: var(--text);
}


button,
input,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


input,
select {
    outline: none;
}


/* APP */

.app {
    min-height: 100vh;
}


/* HEADER */

.site-header {

    position: sticky;

    top: 0;

    z-index: 20;

    background:
        rgba(255,255,255,.94);

    backdrop-filter:
        blur(16px);

    border-bottom:
        1px solid var(--border);
}


.header-inner {

    width:
        min(1280px, calc(100% - 42px));

    min-height: 72px;

    margin: 0 auto;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 28px;
}


/* BRAND */

.brand {

    display: flex;

    align-items: center;

    gap: 10px;

    color: var(--text);

    text-decoration: none;

    flex-shrink: 0;
}


.brand-icon {

    width: 39px;

    height: 39px;

    display: grid;

    place-items: center;

    border-radius: 11px;

    background: var(--accent);

    color: var(--dark);

    font-size: 19px;

    font-weight: 900;
}


.brand-copy h1 {

    margin: 0;

    font-size: 15px;

    line-height: 1;

    letter-spacing: -.03em;
}


.brand-copy span {

    display: block;

    margin-top: 4px;

    color: var(--muted-light);

    font-size: 9px;
}


/* MAIN NAV */

.main-nav {

    display: flex;

    align-items: center;

    gap: 4px;

    margin-left: auto;

    margin-right: auto;
}


.nav-item {

    position: relative;

    border: 0;

    background: transparent;

    color: var(--muted);

    padding:
        9px 12px;

    border-radius: 8px;

    font-size: 10px;

    font-weight: 800;

    transition:
        color .18s ease,
        background .18s ease;
}


.nav-item:hover {

    color: var(--text);

    background:
        var(--surface-soft);
}


.nav-item.active {

    color: var(--text);
}


.nav-item.active::after {

    content: "";

    position: absolute;

    left: 12px;

    right: 12px;

    bottom: -18px;

    height: 2px;

    border-radius: 99px;

    background: var(--dark);
}


/* HEADER ACTIONS */

.header-actions {

    display: flex;

    align-items: center;

    gap: 12px;

    flex-shrink: 0;
}


.header-balance {

    display: grid;

    gap: 2px;

    text-align: right;
}


.header-balance span {

    color: var(--muted-light);

    font-size: 8px;

    font-weight: 900;

    letter-spacing: .1em;
}


.header-balance strong {

    font-size: 11px;

    letter-spacing: -.01em;
}


.add-button {

    border: 0;

    padding:
        10px 14px;

    border-radius: 9px;

    background: var(--dark);

    color: white;

    font-size: 10px;

    font-weight: 800;

    transition:
        transform .18s ease,
        box-shadow .18s ease;
}


.add-button:hover {

    transform:
        translateY(-1px);

    box-shadow:
        0 9px 20px
        rgba(0,0,0,.13);
}


.mobile-menu-button {

    display: none;

    border: 0;

    background: var(--surface-soft);

    color: var(--text);

    width: 34px;

    height: 34px;

    border-radius: 9px;

    font-size: 16px;
}


/* MOBILE NAV */

.mobile-nav {

    display: none;

    border-top:
        1px solid var(--border);

    padding:
        8px 14px;

    gap: 5px;
}


.mobile-nav .nav-item {

    flex: 1;

    text-align: center;
}


.mobile-nav .nav-item.active::after {

    display: none;
}


/* MAIN */

.main {

    width:
        min(1100px, calc(100% - 42px));

    margin: 0 auto;

    padding:
        38px 0 60px;
}


/* VIEWS */

.view {

    display: none;
}


.view.active {

    display: block;
}


/* TOP HEADING */

.top-heading {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}


.date-label {

    margin-bottom: 7px;

    color: var(--muted-light);

    font-size: 8px;

    font-weight: 900;

    letter-spacing: .16em;
}


.top-heading h2 {

    margin: 0;

    font-size: 30px;

    line-height: 1;

    letter-spacing: -.055em;
}


.top-heading p {

    margin: 8px 0 0;

    color: var(--muted);

    font-size: 11px;
}


.date-status {

    display: flex;

    align-items: center;

    gap: 7px;

    padding:
        8px 10px;

    border:
        1px solid var(--border);

    border-radius: 99px;

    background: var(--surface);

    color: var(--muted);

    font-size: 9px;

    font-weight: 700;
}


.status-dot {

    width: 6px;

    height: 6px;

    border-radius: 50%;

    background: #8ca329;
}


/* LABEL */

.section-label {

    display: block;

    color: var(--muted-light);

    font-size: 8px;

    font-weight: 900;

    letter-spacing: .15em;
}


/* HERO */

.hero-grid {

    display: grid;

    grid-template-columns:
        1.55fr .75fr;

    gap: 15px;

    margin-bottom: 15px;
}


/* ALLOWANCE */

.allowance-card {

    position: relative;

    overflow: hidden;

    padding: 27px;

    border-radius: 19px;

    background: var(--accent);

    box-shadow:
        0 16px 35px
        rgba(175,200,58,.13);
}


.allowance-card::after {

    content: "";

    position: absolute;

    width: 230px;

    height: 230px;

    right: -95px;

    top: -115px;

    border:
        35px solid
        rgba(255,255,255,.17);

    border-radius: 50%;
}


.allowance-header {

    position: relative;

    z-index: 2;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;
}


.allowance-card .section-label {

    color: #617000;
}


.allowance-card h3 {

    margin: 6px 0 0;

    font-size: 47px;

    line-height: 1;

    font-weight: 900;

    letter-spacing: -.065em;
}


.allowance-badge {

    padding:
        6px 9px;

    border-radius: 99px;

    background:
        rgba(0,0,0,.09);

    color: #536000;

    font-size: 8px;

    font-weight: 850;

    text-transform: uppercase;

    letter-spacing: .06em;
}


.allowance-details {

    position: relative;

    z-index: 2;

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 30px;

    margin-top: 35px;
}


.allowance-details div {

    display: grid;

    gap: 5px;
}


.allowance-details span {

    color: #657300;

    font-size: 9px;

    font-weight: 700;
}


.allowance-details strong {

    color: #15170f;

    font-size: 17px;

    font-weight: 850;
}


.allowance-progress {

    position: relative;

    z-index: 2;

    margin-top: 27px;
}


.progress-track {

    width: 100%;

    height: 8px;

    overflow: hidden;

    border-radius: 99px;

    background:
        rgba(0,0,0,.11);
}


.progress-fill {

    width: 0;

    height: 100%;

    border-radius: inherit;

    background: var(--dark);

    transition:
        width .35s ease;
}


.progress-caption {

    display: flex;

    justify-content: space-between;

    margin-top: 8px;

    color: #647000;

    font-size: 9px;

    font-weight: 700;
}


/* SAFE */

.safe-card {

    position: relative;

    min-height: 260px;

    overflow: hidden;

    padding: 27px;

    border-radius: 19px;

    background: var(--dark);

    color: white;
}


.safe-card .section-label {

    color: #7f8379;
}


.safe-value {

    margin-top: 18px;

    color: var(--accent);

    font-size: 42px;

    line-height: 1;

    font-weight: 900;

    letter-spacing: -.06em;
}


.safe-card p {

    max-width: 180px;

    margin: 13px 0 0;

    color: #949890;

    font-size: 11px;

    line-height: 1.6;
}


.safe-icon {

    position: absolute;

    right: 22px;

    bottom: 20px;

    width: 46px;

    height: 46px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    background:
        rgba(215,241,91,.1);

    color: var(--accent);

    font-size: 20px;

    font-weight: 900;
}


/* TOMORROW */

.tomorrow-card {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding:
        21px 24px;

    margin-bottom: 15px;

    border:
        1px solid var(--border);

    border-radius: 17px;

    background: var(--surface);
}


.tomorrow-card h3 {

    margin: 5px 0 0;

    font-size: 25px;

    line-height: 1;

    letter-spacing: -.04em;
}


.tomorrow-right {

    display: grid;

    gap: 4px;

    text-align: right;
}


.tomorrow-right span {

    color: var(--muted-light);

    font-size: 8px;
}


.tomorrow-right strong {

    font-size: 9px;

    letter-spacing: .1em;
}


/* ACTIVITY */

.activity-panel {

    margin-bottom: 15px;

    padding: 23px;

    border:
        1px solid var(--border);

    border-radius: 17px;

    background: var(--surface);
}


.panel-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 17px;
}


.panel-header h3 {

    margin: 5px 0 0;

    font-size: 16px;

    letter-spacing: -.025em;
}


.link-button {

    border: 0;

    background: transparent;

    color: #788536;

    font-size: 10px;

    font-weight: 800;
}


/* TODAY ITEMS */

.today-list {

    display: grid;
}


.today-item {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding:
        13px 0;

    border-top:
        1px solid var(--border);
}


.today-item:first-child {

    padding-top: 0;

    border-top: 0;
}


.item-left {

    display: flex;

    align-items: center;

    gap: 11px;

    min-width: 0;
}


.item-icon {

    width: 34px;

    height: 34px;

    display: grid;

    place-items: center;

    flex-shrink: 0;

    border-radius: 10px;

    background: var(--surface-soft);

    font-size: 12px;

    font-weight: 850;
}


.item-info {

    min-width: 0;
}


.item-info strong {

    display: block;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 11px;
}


.item-info span {

    display: block;

    margin-top: 3px;

    color: var(--muted-light);

    font-size: 9px;
}


.item-amount {

    flex-shrink: 0;

    font-size: 12px;

    font-weight: 850;
}


/* QUICK ACTIONS */

.quick-actions {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 15px;
}


.quick-card {

    display: flex;

    align-items: center;

    gap: 13px;

    padding: 15px;

    border:
        1px solid var(--border);

    border-radius: 15px;

    background: var(--surface);

    color: var(--text);

    text-align: left;

    transition:
        transform .18s ease,
        box-shadow .18s ease;
}


.quick-card:hover {

    transform:
        translateY(-2px);

    box-shadow:
        var(--shadow);
}


.quick-icon {

    width: 38px;

    height: 38px;

    display: grid;

    place-items: center;

    border-radius: 11px;

    font-size: 17px;

    font-weight: 900;
}


.expense-icon {

    background: var(--dark);

    color: white;
}


.allowance-icon {

    background: var(--accent);

    color: var(--dark);
}


.quick-card strong {

    display: block;

    font-size: 11px;
}


.quick-card span:not(.quick-icon) {

    display: block;

    margin-top: 3px;

    color: var(--muted-light);

    font-size: 9px;
}


/* FILTER */

.filter-bar {

    display: grid;

    grid-template-columns:
        minmax(180px,1fr)
        180px
        160px;

    gap: 9px;

    margin-bottom: 12px;
}


.search {

    display: flex;

    align-items: center;

    gap: 7px;

    padding:
        0 12px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: var(--surface);
}


.search span {

    color: var(--muted-light);

    font-size: 17px;
}


.search input {

    width: 100%;

    border: 0;

    outline: 0;

    background: transparent;

    color: var(--text);

    font-size: 11px;
}


.filter-bar select,
.filter-bar input {

    border:
        1px solid var(--border);

    border-radius: 10px;

    padding:
        10px 11px;

    background: var(--surface);

    color: var(--text);

    font-size: 11px;
}


/* EXPENSE CARD */

.expenses-card {

    overflow: hidden;

    border:
        1px solid var(--border);

    border-radius: 17px;

    background: var(--surface);
}


.table-container {

    overflow-x: auto;
}


table {

    width: 100%;

    min-width: 760px;

    border-collapse: collapse;
}


th,
td {

    padding:
        14px 17px;

    border-bottom:
        1px solid var(--border);

    text-align: left;

    font-size: 10px;
}


th {

    color: var(--muted-light);

    font-size: 8px;

    font-weight: 900;

    letter-spacing: .12em;

    text-transform: uppercase;
}


td strong {

    font-size: 10px;
}


.amount {

    font-weight: 850;

    color: #22251e;
}


.category-pill {

    display: inline-block;

    padding:
        5px 8px;

    border-radius: 99px;

    background: var(--surface-soft);

    color: var(--muted);

    font-size: 8px;

    font-weight: 800;
}


.actions {

    display: flex;

    justify-content: flex-end;

    gap: 3px;
}


.action-button {

    border: 0;

    border-radius: 7px;

    padding: 6px;

    background: transparent;

    color: var(--muted-light);

    font-size: 9px;
}


.action-button:hover {

    background: var(--surface-soft);

    color: var(--text);
}


.action-button.delete:hover {

    color: var(--danger);
}


/* EMPTY */

.empty-state {

    padding:
        55px 20px;

    text-align: center;
}


.empty-state.hidden {

    display: none;
}


.empty-icon {

    width: 44px;

    height: 44px;

    display: grid;

    place-items: center;

    margin:
        0 auto 12px;

    border-radius: 13px;

    background: var(--accent);

    color: var(--dark);

    font-weight: 900;
}


.empty-state h3 {

    margin: 0 0 4px;

    font-size: 14px;
}


.empty-state p {

    margin: 0;

    color: var(--muted);

    font-size: 10px;
}


/* SETTINGS */

.settings-grid {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 15px;
}


.settings-card {

    padding: 24px;

    border:
        1px solid var(--border);

    border-radius: 17px;

    background: var(--surface);
}


.settings-header {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    margin-bottom: 23px;
}


.settings-header h3 {

    margin: 5px 0 0;

    font-size: 16px;
}


.settings-symbol {

    width: 39px;

    height: 39px;

    display: grid;

    place-items: center;

    border-radius: 11px;

    background: var(--accent);

    font-weight: 900;
}


.settings-card label {

    display: block;

    margin-bottom: 7px;

    color: var(--muted);

    font-size: 10px;

    font-weight: 700;
}


.money-field {

    display: flex;

    align-items: center;

    gap: 7px;

    padding:
        0 12px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: var(--surface-soft);
}


.money-field span {

    color: #7e8e2b;

    font-weight: 850;
}


.money-field input {

    width: 100%;

    border: 0;

    padding: 12px 0;

    background: transparent;

    color: var(--text);

    font-size: 12px;
}


.save-button {

    margin-top: 12px;

    border: 0;

    padding:
        11px 14px;

    border-radius: 9px;

    background: var(--dark);

    color: white;

    font-size: 10px;

    font-weight: 800;
}


.preview-amount {

    margin-bottom: 24px;

    font-size: 38px;

    font-weight: 900;

    letter-spacing: -.06em;
}


.preview-row {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        13px 0;

    border-top:
        1px solid var(--border);

    color: var(--muted);

    font-size: 10px;
}


.preview-row strong {

    color: var(--text);

    font-size: 11px;
}


/* INSIGHTS */

.insight-grid {

    display: grid;

    grid-template-columns:
        repeat(4,1fr);

    gap: 12px;

    margin-bottom: 15px;
}


.insight-card {

    min-height: 145px;

    padding: 18px;

    border:
        1px solid var(--border);

    border-radius: 15px;

    background: var(--surface);
}


.insight-card.highlight {

    background: var(--accent);

    border-color: var(--accent);
}


.insight-card.highlight .section-label {

    color: #667500;
}


.insight-card h3 {

    margin: 12px 0 5px;

    font-size: 24px;

    letter-spacing: -.04em;
}


.insight-card p {

    max-width: 170px;

    margin: 0;

    color: var(--muted);

    font-size: 9px;

    line-height: 1.6;
}


.insight-card.highlight p {

    color: #657200;
}


/* CATEGORY */

.category-panel {

    padding: 23px;

    border:
        1px solid var(--border);

    border-radius: 17px;

    background: var(--surface);
}


.category-list {

    display: grid;

    gap: 15px;
}


.category-row {

    display: grid;

    gap: 8px;
}


.category-top {

    display: flex;

    justify-content: space-between;

    font-size: 10px;
}


.category-top strong {

    font-weight: 800;
}


.category-bar {

    height: 7px;

    overflow: hidden;

    border-radius: 99px;

    background: var(--surface-soft);
}


.category-bar-fill {

    width: 0;

    height: 100%;

    border-radius: inherit;

    background: var(--dark);

    transition:
        width .35s ease;
}


/* MODAL */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 18px;

    background: rgba(18, 19, 16, 0.58);
}

.modal-overlay.open {
    display: flex;
}


.modal {

    width:
        min(590px,100%);

    padding: 23px;

    border-radius: 17px;

    background: var(--surface);

    border:
        1px solid var(--border);

    box-shadow:
        0 30px 70px
        rgba(0,0,0,.2);
}


.modal-top {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    margin-bottom: 23px;
}


.modal-top h3 {

    margin: 6px 0 0;

    font-size: 21px;

    letter-spacing: -.03em;
}


.close-modal {

    width: 34px;

    height: 34px;

    border: 0;

    border-radius: 9px;

    background: var(--surface-soft);

    color: var(--text);

    font-size: 20px;
}


.form-group {

    display: grid;

    gap: 7px;

    margin-bottom: 15px;
}


.form-group label {

    color: var(--muted);

    font-size: 10px;

    font-weight: 800;
}


.form-group > input,
.form-group > select {

    width: 100%;

    border:
        1px solid var(--border);

    border-radius: 10px;

    padding: 12px;

    background: var(--surface-soft);

    color: var(--text);

    font-size: 11px;
}


.form-grid {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 13px;
}


.form-group > input:focus,
.form-group > select:focus,
.money-field:focus-within {

    border-color:
        var(--accent-dark);

    box-shadow:
        0 0 0 3px
        rgba(175,200,58,.09);
}


.money-field input:focus {

    box-shadow: none;

    border: 0;
}


.modal-actions {

    display: flex;

    justify-content: flex-end;

    gap: 8px;

    margin-top: 5px;
}


.cancel-button {

    border: 0;

    padding:
        11px 14px;

    border-radius: 9px;

    background: var(--surface-soft);

    color: var(--text);

    font-size: 10px;

    font-weight: 700;
}


/* TOAST */

.toast {

    position: fixed;

    right: 23px;

    bottom: 23px;

    z-index: 50;

    padding:
        11px 14px;

    border-radius: 9px;

    background: var(--dark);

    color: white;

    font-size: 10px;

    box-shadow: var(--shadow);

    opacity: 0;

    transform:
        translateY(12px);

    pointer-events: none;

    transition:
        opacity .2s ease,
        transform .2s ease;
}


.toast.show {

    opacity: 1;

    transform:
        translateY(0);
}


/* TABLET */

@media (max-width: 1000px) {

    .header-inner {
        width:
            min(100% - 28px, 1000px);

        gap: 14px;
    }


    .main {
        width:
            min(100% - 28px, 1000px);
    }


    .header-balance {
        display: none;
    }


    .insight-grid {
        grid-template-columns:
            repeat(2,1fr);
    }

}


/* MOBILE */

@media (max-width: 800px) {

    .header-inner {

        min-height: 64px;

    }


    .brand-copy span {

        display: none;

    }


    .main-nav {

        display: none;

    }


    .mobile-menu-button {

        display: block;

    }


    .mobile-nav.open {

        display: flex;

    }


    .mobile-nav .nav-item {

        padding:
            10px 5px;

    }


    .mobile-nav .nav-item.active {

        background:
            var(--surface-soft);

    }


    .hero-grid {

        grid-template-columns:
            1fr;

    }


    .settings-grid {

        grid-template-columns:
            1fr;

    }


    .content-grid {

        grid-template-columns:
            1fr;

    }

}


/* SMALL MOBILE */

@media (max-width: 620px) {

    .header-inner {

        width:
            calc(100% - 24px);

    }


    .main {

        width:
            calc(100% - 24px);

        padding:
            28px 0 40px;

    }


    .top-heading {

        align-items:
            flex-start;

        flex-direction:
            column;

    }


    .top-heading h2 {

        font-size: 27px;

    }


    .date-status {

        align-self:
            flex-start;

    }


    .allowance-card {

        padding: 22px;

    }


    .allowance-card h3 {

        font-size: 39px;

    }


    .safe-card {

        min-height: 210px;

    }


    .tomorrow-card {

        align-items:
            flex-start;

        flex-direction:
            column;

    }


    .tomorrow-right {

        text-align: left;

    }


    .quick-actions {

        grid-template-columns:
            1fr;

    }


    .filter-bar {

        grid-template-columns:
            1fr;

    }


    .form-grid {

        grid-template-columns:
            1fr;

        gap: 0;

    }


    .insight-grid {

        grid-template-columns:
            1fr 1fr;

    }


    .modal {

        padding: 18px;

    }

}


/* EXTRA SMALL */

@media (max-width: 410px) {

    .insight-grid {

        grid-template-columns:
            1fr;

    }


    .allowance-details {

        grid-template-columns:
            1fr;

        gap: 14px;

    }


    .brand-copy h1 {

        font-size: 14px;

    }

}