/*
|--------------------------------------------------------------------------
| ROOT
|--------------------------------------------------------------------------
*/

:root {

    --bg: #f4f6f9;

    --surface: #ffffff;
    --surface-secondary: #f3f5f8;
    --surface-hover: #eef1f5;

    --text: #16181d;
    --text-muted: #69707d;

    --primary: #5d4df7;
    --primary-hover: #4c3ce0;
    --primary-soft: rgba(93, 77, 247, .10);

    --success: #178847;
    --success-soft: rgba(23, 136, 71, .10);

    --danger: #d83b3b;
    --danger-soft: rgba(216, 59, 59, .10);

    --warning: #d78b09;

    --border: #e1e5eb;

    --shadow:
        0 4px 18px
        rgba(20, 26, 38, .07);

    --shadow-hover:
        0 10px 28px
        rgba(20, 26, 38, .11);

    --radius: 16px;

    --navbar-bg:
        rgba(255, 255, 255, .92);

    --overlay:
        rgba(0, 0, 0, .55);

    --input-bg: #ffffff;

    --scrollbar: #c7ccd5;
}


/*
|--------------------------------------------------------------------------
| DARK
|--------------------------------------------------------------------------
*/

html[data-theme="dark"] {

    --bg: #111318;

    --surface: #191c23;
    --surface-secondary: #22262f;
    --surface-hover: #292e38;

    --text: #f0f2f5;
    --text-muted: #a3aab7;

    --primary: #8d81ff;
    --primary-hover: #a095ff;
    --primary-soft: rgba(141, 129, 255, .14);

    --success: #55d889;
    --success-soft: rgba(85, 216, 137, .12);

    --danger: #ff7070;
    --danger-soft: rgba(255, 112, 112, .12);

    --warning: #f7b84b;

    --border: #303540;

    --shadow:
        0 6px 22px
        rgba(0, 0, 0, .28);

    --shadow-hover:
        0 12px 36px
        rgba(0, 0, 0, .38);

    --navbar-bg:
        rgba(25, 28, 35, .93);

    --overlay:
        rgba(0, 0, 0, .72);

    --input-bg: #20242c;

    --scrollbar: #454b57;
}


/*
|--------------------------------------------------------------------------
| BASE
|--------------------------------------------------------------------------
*/

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

body {

    margin: 0;

    background:
        var(--bg);

    color:
        var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    transition:
        background-color .2s ease,
        color .2s ease;
}

a {
    color:
        var(--primary);

    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
}

::selection {
    background:
        var(--primary-soft);
}


/*
|--------------------------------------------------------------------------
| SCROLLBAR
|--------------------------------------------------------------------------
*/

* {
    scrollbar-width: thin;

    scrollbar-color:
        var(--scrollbar)
        var(--surface-secondary);
}


/*
|--------------------------------------------------------------------------
| CONTAINER
|--------------------------------------------------------------------------
*/

.container {

    width:
        min(
            1180px,
            calc(100% - 40px)
        );

    margin-left: auto;
    margin-right: auto;
}

.page {
    padding:
        34px 0 70px;
}


/*
|--------------------------------------------------------------------------
| NAVBAR
|--------------------------------------------------------------------------
*/

.navbar {

    position: sticky;

    top: 0;

    z-index: 100;

    background:
        var(--navbar-bg);

    backdrop-filter:
        blur(14px);

    border-bottom:
        1px solid
        var(--border);
}

.navbar-inner {

    min-height: 68px;

    display: flex;

    align-items: center;

    justify-content:
        space-between;

    gap: 20px;
}

.logo {

    display: inline-flex;

    align-items: center;

    font-size: 20px;

    font-weight: 850;

    color:
        var(--text);
}

.nav-user {

    display: flex;

    align-items: center;

    gap: 12px;
}

.nav-user-name {

    color:
        var(--text-muted);

    font-size: 14px;
}

.avatar {

    width: 36px;
    height: 36px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        var(--primary-soft);

    color:
        var(--primary);

    font-weight: 800;
}

.logout {

    color:
        var(--text-muted);

    font-size: 13px;
}


/*
|--------------------------------------------------------------------------
| THEME BUTTON
|--------------------------------------------------------------------------
*/

.theme-toggle {

    height: 38px;

    padding:
        0 11px;

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    background:
        var(--surface-secondary);

    color:
        var(--text);

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    gap: 6px;

    font-size: 12px;

    font-weight: 650;
}

.theme-toggle:hover {
    background:
        var(--surface-hover);
}

.theme-toggle-icon {
    font-size: 16px;
}


/*
|--------------------------------------------------------------------------
| HEADERS
|--------------------------------------------------------------------------
*/

.page-header {

    display: flex;

    align-items:
        flex-start;

    justify-content:
        space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.page-header h1 {

    margin:
        0 0 5px;

    font-size: 30px;
}

.page-header p {

    margin: 0;

    color:
        var(--text-muted);
}

.section-title {

    margin-top: 34px;

    margin-bottom: 15px;
}

.section-title h2 {
    margin: 0;
}


/*
|--------------------------------------------------------------------------
| BUTTONS
|--------------------------------------------------------------------------
*/

.btn {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    min-height: 40px;

    padding:
        9px 15px;

    border:
        1px solid transparent;

    border-radius: 10px;

    cursor: pointer;

    font-size: 14px;

    font-weight: 700;

    text-decoration: none;

    transition:
        background .15s ease,
        transform .15s ease,
        border-color .15s ease;
}

.btn:hover {

    text-decoration: none;

    transform:
        translateY(-1px);
}

.btn-primary {

    background:
        var(--primary);

    color: white;
}

.btn-primary:hover {

    background:
        var(--primary-hover);

    color: white;
}

.btn-secondary {

    background:
        var(--surface-secondary);

    color:
        var(--text);

    border-color:
        var(--border);
}

.btn-secondary:hover {

    background:
        var(--surface-hover);

    color:
        var(--text);
}

.btn-small {

    min-height: 32px;

    padding:
        6px 10px;

    font-size: 12px;
}


/*
|--------------------------------------------------------------------------
| FORMS
|--------------------------------------------------------------------------
*/

.transaction-form {

    background:
        var(--surface);

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    padding: 24px;

    box-shadow:
        var(--shadow);

    margin-top: 22px;
}

.transaction-form h2 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {

    display: block;

    margin-bottom: 7px;

    font-size: 13px;

    font-weight: 700;
}

.form-control {

    display: block;

    width: 100%;

    min-height: 44px;

    padding:
        10px 12px;

    color:
        var(--text);

    background:
        var(--input-bg);

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    outline: none;

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

textarea.form-control {

    min-height: 110px;

    resize: vertical;
}

.form-control:focus {

    border-color:
        var(--primary);

    box-shadow:
        0 0 0 3px
        var(--primary-soft);
}


/*
|--------------------------------------------------------------------------
| ALERTS
|--------------------------------------------------------------------------
*/

.alert {

    padding:
        13px 15px;

    border-radius: 10px;

    margin-bottom: 18px;

    border:
        1px solid
        var(--border);
}

.alert-success {

    background:
        var(--success-soft);

    color:
        var(--success);
}

.alert-danger {

    background:
        var(--danger-soft);

    color:
        var(--danger);
}


/*
|--------------------------------------------------------------------------
| SUMMARY
|--------------------------------------------------------------------------
*/

.summary-card {

    background:
        var(--surface);

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    padding: 28px;

    box-shadow:
        var(--shadow);

    display: flex;

    justify-content:
        space-between;

    align-items: center;

    gap: 20px;
}

.summary-label {

    color:
        var(--text-muted);

    font-size: 13px;
}

.summary-value {

    font-size: 38px;

    font-weight: 850;

    margin:
        3px 0 7px;
}

.summary-subtitle {

    color:
        var(--text-muted);

    font-size: 13px;
}


/*
|--------------------------------------------------------------------------
| GOALS
|--------------------------------------------------------------------------
*/

.goals-grid {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(260px, 1fr)
        );

    gap: 18px;
}

.goal-card {

    display: block;

    background:
        var(--surface);

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    padding: 20px;

    box-shadow:
        var(--shadow);

    color:
        var(--text);

    transition:
        transform .15s ease,
        box-shadow .15s ease;
}

.goal-card:hover {

    transform:
        translateY(-3px);

    box-shadow:
        var(--shadow-hover);

    color:
        var(--text);
}

.goal-card-header {

    display: flex;

    justify-content:
        space-between;

    align-items: center;

    margin-bottom: 15px;
}

.goal-icon {
    font-size: 26px;
}

.goal-role {

    font-size: 11px;

    color:
        var(--text-muted);
}

.goal-name {

    font-size: 18px;

    font-weight: 800;

    margin-bottom: 12px;
}

.goal-balance {

    font-size: 27px;

    font-weight: 850;
}

.goal-target,
.goal-deadline {

    color:
        var(--text-muted);

    font-size: 12px;

    margin-top: 5px;
}

.goal-progress-info {

    margin-top: 7px;

    display: flex;

    justify-content:
        space-between;

    gap: 10px;

    color:
        var(--text-muted);

    font-size: 11px;
}


/*
|--------------------------------------------------------------------------
| PROGRESS
|--------------------------------------------------------------------------
*/

.progress {

    height: 9px;

    margin-top: 14px;

    background:
        var(--surface-secondary);

    border-radius: 999px;

    overflow: hidden;
}

.progress-bar {

    height: 100%;

    background:
        var(--primary);

    border-radius: inherit;
}


/*
|--------------------------------------------------------------------------
| GOAL VIEW
|--------------------------------------------------------------------------
*/

.goal-view-header {

    background:
        var(--surface);

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    padding: 27px;

    box-shadow:
        var(--shadow);
}

.goal-view-balance {

    margin-top: 18px;

    font-size: 38px;

    font-weight: 850;
}

.goal-view-actions {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 20px;
}


/*
|--------------------------------------------------------------------------
| TRANSACTIONS
|--------------------------------------------------------------------------
*/

.transactions {

    background:
        var(--surface);

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    overflow: hidden;

    box-shadow:
        var(--shadow);
}

.transaction-row {

    display: flex;

    align-items: center;

    justify-content:
        space-between;

    gap: 18px;

    padding: 16px 18px;

    border-bottom:
        1px solid
        var(--border);
}

.transaction-row:last-child {
    border-bottom: 0;
}

.transaction-info {
    min-width: 0;
}

.transaction-description {

    margin-top: 4px;

    font-size: 13px;
}

.transaction-date {

    margin-top: 5px;

    color:
        var(--text-muted);

    font-size: 11px;
}

.transaction-amount {

    white-space: nowrap;

    font-weight: 800;
}

.transaction-amount.positive {
    color:
        var(--success);
}

.transaction-amount.negative {
    color:
        var(--danger);
}


/*
|--------------------------------------------------------------------------
| EMPTY
|--------------------------------------------------------------------------
*/

.empty {

    padding: 30px;

    background:
        var(--surface);

    border:
        1px dashed
        var(--border);

    border-radius:
        var(--radius);

    text-align: center;

    color:
        var(--text-muted);
}

.empty h3 {

    margin-top: 0;

    color:
        var(--text);
}


/*
|--------------------------------------------------------------------------
| MODAL
|--------------------------------------------------------------------------
*/

.modal-overlay {

    position: fixed;

    inset: 0;

    z-index: 9999;

    display: none;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        var(--overlay);
}

.modal-overlay.active {
    display: flex;
}

.modal {

    width:
        min(
            720px,
            100%
        );

    max-height: 85vh;

    overflow-y: auto;

    background:
        var(--surface);

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        0 30px 90px
        rgba(0, 0, 0, .35);
}


/*
|--------------------------------------------------------------------------
| ACHIEVEMENTS
|--------------------------------------------------------------------------
*/

.achievements-section {

    margin-top: 42px;
}


.achievements-header {

    margin-bottom: 18px;
}


.achievements-header h2 {

    margin:
        0 0 5px;

    font-size: 24px;
}


.achievements-header p {

    margin: 0;

    color:
        var(--text-muted);

    font-size: 13px;
}


.badge-list {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(170px, 1fr)
        );

    gap: 16px;

    align-items: stretch;
}


.badge-preview {

    position: relative;

    min-height: 205px;

    padding:
        20px 16px;

    background:
        var(--surface);

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content:
        flex-start;

    text-align: center;

    overflow: hidden;

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        opacity .15s ease;
}


.badge-preview:not(.locked):hover {

    transform:
        translateY(-3px);

    box-shadow:
        var(--shadow-hover);
}


.badge-preview.locked {

    opacity: .58;

    box-shadow: none;
}


.badge-preview.locked::after {

    content: '';

    position: absolute;

    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(120, 120, 120, .03)
        );
}


.badge-icon {

    width: 64px;
    height: 64px;

    flex: 0 0 64px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    margin-bottom: 13px;

    background:
        var(--surface-secondary);

    font-size: 32px;
}


.badge-preview.locked .badge-icon {

    filter:
        grayscale(1);
}


.badge-title {

    margin: 0 0 7px;

    font-size: 15px;

    font-weight: 800;

    line-height: 1.25;
}


.badge-description {

    margin: 0;

    color:
        var(--text-muted);

    font-size: 12px;

    line-height: 1.45;

    min-height: 36px;
}


.badge-status {

    margin-top: auto;

    padding:
        15px 0 0;

    color:
        var(--text-muted);

    font-size: 10px;

    font-weight: 800;

    letter-spacing: .25px;

    text-transform: uppercase;
}


.badge-preview:not(.locked)
.badge-status {

    color:
        var(--success);
}


.badge-lock {

    position: absolute;

    top: 11px;
    right: 11px;

    width: 27px;
    height: 27px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        var(--surface-secondary);

    border:
        1px solid
        var(--border);

    font-size: 12px;
}


/*
|--------------------------------------------------------------------------
| RESPONSIVE
|--------------------------------------------------------------------------
*/

@media (
    max-width: 700px
) {

    .container {

        width:
            min(
                100% - 24px,
                1180px
            );
    }


    .page {
        padding-top: 22px;
    }


    .navbar-inner {
        min-height: 62px;
    }


    .nav-user-name {
        display: none;
    }


    .theme-toggle {

        width: 38px;

        padding: 0;

        justify-content: center;
    }


    .theme-toggle-label {
        display: none;
    }


    .page-header {
        flex-direction: column;
    }


    .summary-value {
        font-size: 31px;
    }


    .goal-view-balance {
        font-size: 31px;
    }


    .transaction-row {
        align-items:
            flex-start;
    }


    .goals-grid {
        grid-template-columns:
            1fr;
    }


    .badge-list {

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 11px;
    }


    .badge-preview {

        min-height: 185px;

        padding:
            16px 10px;
    }


    .badge-icon {

        width: 56px;
        height: 56px;

        flex-basis: 56px;

        font-size: 28px;
    }
}


@media (
    max-width: 390px
) {

    .badge-list {
        grid-template-columns:
            1fr;
    }
}