* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: #f6f7f9;
    color: #202c33;
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

button,
input,
select {
    font: inherit
}

button {
    cursor: pointer;
    transition: background .15s
}

button:disabled {
    opacity: .5;
    cursor: wait
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #42bfa2;
    outline-offset: 3px
}

[hidden] {
    display: none !important
}

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

aside {
    background: #fff;
    border-right: 1px solid #e8ebee;
    padding: 36px 24px;
    display: flex;
    flex-direction: column
}

.brand {
    text-decoration: none;
    color: #157c66;
    font-size: 34px;
    display: flex;
    align-items: center;
    gap: 12px
}

.brand span {
    color: #202c33;
    font-size: 23px;
    font-weight: 750;
    letter-spacing: -.7px
}

.brand small {
    display: block;
    font-size: 11px;
    letter-spacing: .2px;
    color: #84918f;
    font-weight: 500
}

.nav {
    margin-top: 48px;
    padding: 14px;
    border-radius: 10px;
    color: #167961;
    background: #eaf5f0;
    font-weight: 600
}

.aside-note {
    margin-top: auto;
    padding-top: 80px;
    font-size: 25px;
    line-height: 1.3;
    color: #627871;
    letter-spacing: -.6px
}

.aside-note p {
    font-size: 13px;
    line-height: 1.7;
    letter-spacing: 0;
    color: #8c9894
}

.local {
    margin-top: 30px;
    font-size: 10px;
    color: #7c8e86
}

main {
    max-width: 1500px;
    width: 100%;
    padding: 44px 48px
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 30px
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    color: #7b8c85;
    font-weight: 700
}

h1 {
    font-size: 32px;
    letter-spacing: -1.1px;
    margin: 8px 0
}

header p {
    margin: 0;
    color: #7e888e
}

h2 {
    font-size: 18px;
    letter-spacing: -.3px;
    margin: 0
}

.month-label {
    min-width: 175px
}

.metrics {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 18px
}

.metric {
    border: 1px solid #e5e9eb;
    border-radius: 16px;
    background: white;
    padding: 25px
}

.metric span {
    color: #7a8785;
    font-size: 13px
}

.metric strong {
    display: block;
    font-size: 31px;
    letter-spacing: -1px;
    margin: 16px 0 12px;
    font-weight: 650;
    overflow-wrap: anywhere
}

.metric small {
    color: #8c9694;
    font-size: 11px
}

.metric.total {
    background: #163d36;
    border-color: #163d36;
    color: #fff
}

.total span,
.total small {
    color: #b9d0c6
}

.section {
    margin: 32px 0
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px
}

.secondary {
    background: #fff;
    border: 1px solid #dce3df;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: #3f6558
}

.secondary:hover {
    background: #edf6f0
}

.count {
    border-radius: 6px;
    background: #edf1ef;
    padding: 3px 8px;
    color: #7b8c83;
    font-size: 12px;
    font-weight: 500;
    vertical-align: middle
}

.accounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px
}

.account {
    padding: 19px 21px;
    background: #fff;
    border: 1px solid #e5e9eb;
    border-radius: 12px;
    min-width: 0
}

.account .kind {
    font-size: 11px;
    color: #82938b
}

.account h3 {
    font-size: 14px;
    margin: 8px 0;
    font-weight: 500;
    overflow-wrap: anywhere
}

.account strong {
    font-size: 22px;
    letter-spacing: -.4px
}

.workspace {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px
}

.panel {
    background: #fff;
    border: 1px solid #e5e9eb;
    border-radius: 16px;
    padding: 25px;
    min-width: 0
}

label {
    display: block;
    font-size: 12px;
    font-weight: 550;
    color: #62736d;
    margin-bottom: 14px
}

input,
select {
    width: 100%;
    margin-top: 6px;
    border: 1px solid #dfe6e2;
    border-radius: 8px;
    background: #fcfdfc;
    padding: 11px 12px;
    color: #283d34;
    min-height: 44px;
    font-size: 14px
}

input:focus,
select:focus {
    outline: 2px solid #60b99d;
    outline-offset: 1px
}

input::placeholder {
    color: #a0aaa5;
    font-size: 12px
}

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

.primary {
    background: #207b60;
    border: 0;
    color: #fff;
    padding: 13px 18px;
    border-radius: 9px;
    width: 100%;
    font-weight: 600;
    font-size: 14px
}

.primary:hover {
    background: #17634d
}

.hint {
    font-size: 11px;
    line-height: 1.7;
    color: #8a9690;
    margin: 14px 0 0
}

.muted {
    color: #98a29d;
    font-weight: 400
}

.empty {
    padding: 35px 20px;
    text-align: center;
    color: #87948d;
    font-size: 13px;
    border: 1px dashed #d9e3dc;
    border-radius: 12px;
    grid-column: 1/-1
}

.empty strong {
    display: block;
    color: #50665a;
    font-size: 16px;
    margin: 8px
}

.operation {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #eff2f0
}

.operation:last-child {
    border-bottom: 0
}

.operation .icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f0f3f1;
    color: #708578
}

.operation .title {
    font-size: 14px;
    font-weight: 550;
    overflow-wrap: anywhere
}

.operation .details {
    font-size: 11px;
    color: #94a099;
    margin-top: 3px;
    overflow-wrap: anywhere
}

.operation .amount {
    text-align: right;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 650
}

.operation.income .amount {
    color: #208465
}

.operation .date {
    color: #a0a9a3;
    font-size: 10px;
    text-align: right;
    font-weight: 400;
    margin-top: 4px
}

footer {
    margin-top: 32px;
    color: #9aa59f;
    font-size: 11px
}

dialog {
    border: 0;
    border-radius: 18px;
    padding: 30px;
    width: min(440px, calc(100% - 32px));
    box-shadow: 0 25px 100px #1c302533
}

dialog::backdrop {
    background: #183b3466;
    backdrop-filter: blur(3px)
}

.close {
    background: none;
    border: 0;
    color: #7a8e82;
    font-size: 26px
}

#status,
#account-error {
    background: #fff0e9;
    border-radius: 9px;
    color: #9c4930;
    font-size: 13px;
    padding: 12px
}

#status.success {
    background: #e5f2eb;
    color: #25684c
}

@media(min-width:1600px) {
    main {
        margin: auto
    }
}

@media(max-width:1150px) {
    .shell {
        grid-template-columns: 190px 1fr
    }

    aside {
        padding: 30px 18px
    }

    main {
        padding: 32px 25px
    }

    .workspace {
        grid-template-columns: 310px 1fr
    }

    .metric {
        padding: 20px
    }

    .metric strong {
        font-size: 25px
    }
}

@media(max-width:900px) {
    .shell {
        display: block
    }

    aside {
        padding: 16px 24px;
        border-right: 0;
        border-bottom: 1px solid #e5e9eb
    }

    .nav,
    .aside-note,
    .local {
        display: none
    }

    .brand {
        font-size: 26px
    }

    .brand span {
        font-size: 21px
    }

    .brand small {
        display: none
    }

    .workspace {
        grid-template-columns: 1fr 1.2fr
    }

    .metrics {
        gap: 10px
    }

    .metric {
        padding: 16px
    }

    .metric strong {
        font-size: 23px
    }
}

@media(max-width:680px) {
    main {
        padding: 24px 16px
    }

    header {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px
    }

    h1 {
        font-size: 28px
    }

    header p {
        font-size: 13px
    }

    .month-label {
        width: 100%;
        margin: 0
    }

    .metrics {
        grid-template-columns: 1fr 1fr
    }

    .total {
        grid-column: 1/-1
    }

    .metric strong {
        margin: 8px 0;
        font-size: 25px
    }

    .accounts {
        grid-template-columns: 1fr 1fr
    }

    .workspace {
        display: flex;
        flex-direction: column
    }

    .panel {
        padding: 20px
    }

    .account {
        padding: 16px
    }

    .account strong {
        font-size: 19px
    }

    .section-title h2 {
        font-size: 17px
    }

    .secondary {
        padding: 8px 10px
    }

    .operation {
        gap: 8px;
        grid-template-columns: 30px 1fr auto
    }

    .operation .icon {
        width: 30px;
        height: 30px
    }
}

.user-menu { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 20px; color: #62736d; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 32px; margin: 0; }
.login-card h1 { font-size: 25px; margin-top: 28px; }
.login-card form { margin-top: 24px; }
#login-error { background: #fff0e9; border-radius: 9px; color: #9c4930; font-size: 13px; padding: 12px; }

.family-panel { margin: 0 0 24px; }
.family-members { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.family-member { border-radius: 8px; background: #edf5f0; padding: 6px 10px; color: #315c4b; font-size: 12px; overflow-wrap: anywhere; }
#family-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
#family-form label { flex: 1; min-width: 200px; margin: 0; }
#family-form button { min-height: 44px; }
.family-invitation { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eff2f0; overflow-wrap: anywhere; }
.account-visibility-label { margin: 14px 0 0; }

.budget-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 24px; }
.budget-tabs button { border: 1px solid #dce3df; background: #fff; border-radius: 9px; padding: 10px 16px; color: #3f6558; white-space: nowrap; }
.budget-tabs button[aria-pressed="true"] { background: #163d36; border-color: #163d36; color: #fff; }
.family-invitation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
