:root {
    color-scheme: light;
    --brand: #3867f4;
    --brand-deep: #2854e8;
    --brand-soft: #eef3ff;
    --ink: #14213d;
    --ink-soft: #34415f;
    --muted: #8490aa;
    --line: #e7eaf1;
    --surface: #ffffff;
    --canvas: #f4f6fa;
    --green: #25a244;
    --green-soft: #edf9ef;
    --red: #f04444;
    --red-soft: #fff1f1;
    --orange: #ff8a24;
    --orange-soft: #fff5e8;
    --violet: #7959f6;
    --violet-soft: #f3efff;
    --shadow: 0 20px 60px rgba(24, 38, 74, .08);
    --card-radius: 17px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 0%, rgba(56, 103, 244, .05), transparent 26rem),
        var(--canvas);
    color: var(--ink);
    font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.app-shell {
    width: min(1480px, calc(100% - 28px));
    min-height: calc(100vh - 28px);
    margin: 14px auto;
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid #e1e5ed;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.sidebar {
    position: relative;
    min-height: calc(100vh - 30px);
    display: flex;
    flex-direction: column;
    padding: 27px 18px 20px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, .95);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-height: 40px;
    padding: 0 10px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.brand-mark {
    position: relative;
    width: 28px;
    height: 27px;
    flex: 0 0 auto;
}

.brand-mark i {
    position: absolute;
    bottom: 1px;
    width: 9px;
    border-radius: 3px 3px 2px 2px;
    background: linear-gradient(160deg, #5b8cff, #2857ea);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
    transform: skewY(-10deg);
}

.brand-mark i:nth-child(1) { left: 0; height: 13px; }
.brand-mark i:nth-child(2) { left: 8px; height: 21px; }
.brand-mark i:nth-child(3) { left: 16px; height: 27px; }

.sidebar-nav {
    display: grid;
    gap: 5px;
    margin-top: 34px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 45px;
    padding: 0 13px;
    color: #53617d;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.nav-link:hover { background: #f6f8fc; color: var(--brand); transform: translateX(2px); }
.nav-link.active { color: var(--brand); background: linear-gradient(90deg, #eef3ff, #f5f7ff); }
.nav-link svg { width: 19px; height: 19px; stroke-width: 1.8; }

.premium-card {
    position: relative;
    overflow: hidden;
    margin-top: auto;
    padding: 18px 15px 15px;
    border: 1px solid #e8ecff;
    border-radius: 16px;
    background: linear-gradient(145deg, #f7f9ff, #edf2ff);
}

.premium-card::after {
    content: "";
    position: absolute;
    right: -26px;
    bottom: -22px;
    width: 94px;
    height: 94px;
    border-radius: 48% 52% 42% 58%;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.95), rgba(93,111,255,.38) 42%, rgba(121,89,246,.06) 68%);
    transform: rotate(-18deg);
}

.premium-card strong, .premium-card span, .premium-card a { position: relative; z-index: 1; }
.premium-card strong { display: block; margin-bottom: 7px; color: var(--brand); font-size: 12px; }
.premium-card span { display: block; max-width: 125px; color: #697694; font-size: 10px; line-height: 1.55; }
.premium-card a {
    display: inline-flex;
    margin-top: 14px;
    padding: 8px 12px;
    color: var(--brand);
    border: 1px solid #e0e6fb;
    border-radius: 9px;
    background: #fff;
    font-size: 10px;
    font-weight: 700;
}

.main-panel { min-width: 0; padding: 27px 29px 32px; }

.topbar {
    min-height: 61px;
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(260px, 390px) auto;
    align-items: start;
    gap: 28px;
    margin-bottom: 22px;
}

.greeting h1 { margin: 0 0 4px; font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
.greeting p { margin: 0; color: var(--muted); font-size: 11px; }

.search {
    height: 43px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(32,48,85,.025);
}
.search svg { width: 16px; color: #a3adc0; }
.search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.search input::placeholder { color: #b1b9ca; }

.profile-area { display: flex; align-items: center; gap: 11px; }
.icon-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 11px;
    background: transparent;
    cursor: pointer;
}
.icon-button:hover { background: #f5f7fb; }
.icon-button svg { width: 19px; }

.profile {
    display: grid;
    grid-template-columns: 38px auto;
    align-items: center;
    gap: 10px;
    min-width: 143px;
}
.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, #18304c, #5682b1);
    color: #fff;
    box-shadow: 0 0 0 1px #dfe4ed;
    font-size: 12px;
    font-weight: 800;
}
.profile-copy strong { display: block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.profile-copy span { color: var(--brand); font-size: 9px; }
.profile:hover .avatar { box-shadow: 0 0 0 3px rgba(56,103,244,.12); }
.logout-button { width: 34px; height: 34px; color: #74809a; }
.logout-button svg { width: 17px; }

.demo-notice {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: -9px 0 15px;
    color: #7f8aa1;
    font-size: 10px;
}
.demo-notice::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f2b441; box-shadow: 0 0 0 4px #fff5dc; }

.metric-grid {
    display: grid;
    grid-template-columns: 1.55fr repeat(3, .8fr);
    gap: 15px;
    margin-bottom: 18px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    background: var(--surface);
    box-shadow: 0 5px 25px rgba(26,42,78,.025);
}

.free-card {
    position: relative;
    min-height: 168px;
    overflow: hidden;
    padding: 22px 23px;
    color: #fff;
    border: 0;
    background: linear-gradient(137deg, #3268fb 0%, #4779ff 54%, #517cf3 100%);
    box-shadow: 0 16px 34px rgba(50,104,251,.2);
}
.free-card::before, .free-card::after {
    content: "";
    position: absolute;
    border-radius: 45% 55% 60% 40%;
    background: rgba(255,255,255,.105);
    transform: rotate(-18deg);
}
.free-card::before { width: 230px; height: 170px; right: -56px; top: -98px; }
.free-card::after { width: 175px; height: 120px; right: -24px; bottom: -53px; }
.free-card > * { position: relative; z-index: 1; }
.free-card--empty { display: flex; flex-direction: column; justify-content: center; }
.free-card--empty::before { right: -36px; top: -118px; }
.free-card--empty::after { right: -12px; bottom: -70px; }
.metric-label { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; }
.metric-value { margin-top: 8px; font-size: clamp(31px, 3vw, 43px); line-height: 1; letter-spacing: .01em; font-weight: 500; }
.metric-empty-copy { max-width: 260px; margin: 15px 0 0; color: rgba(255,255,255,.76); font-size: 10px; line-height: 1.55; }
.sparkline { width: 100%; height: 42px; margin: 1px 0 -4px; overflow: visible; }
.metric-trend { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.78); font-size: 9px; }
.metric-trend svg { width: 13px; }

.small-metric {
    min-width: 0;
    min-height: 168px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 19px;
}
.small-metric.income { background: linear-gradient(145deg, #fff, #f9fdf9); }
.small-metric.expense { background: linear-gradient(145deg, #fff, #fff8f8); }
.small-metric.required { background: linear-gradient(145deg, #fff, #faf8ff); }
.metric-icon {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
}
.metric-icon svg { width: 18px; }
.income .metric-icon { color: var(--green); background: var(--green-soft); }
.expense .metric-icon { color: var(--red); background: var(--red-soft); }
.required .metric-icon { color: var(--violet); background: var(--violet-soft); }
.small-metric strong { margin-bottom: 6px; font-size: 11px; }
.small-metric .amount { white-space: nowrap; font-size: clamp(20px, 2vw, 25px); line-height: 1.1; font-weight: 600; letter-spacing: -.025em; }
.income .amount { color: #178334; }
.expense .amount { color: var(--red); }
.small-metric small { margin-top: 10px; color: var(--muted); font-size: 9px; }

.middle-grid, .bottom-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.middle-grid { grid-template-columns: 1.08fr 1fr; }
.bottom-grid { grid-template-columns: .82fr .95fr 1.23fr; margin-bottom: 0; }
.panel-card { min-width: 0; padding: 18px 19px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-header h2 { margin: 0; font-size: 13px; letter-spacing: -.015em; }
.section-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: 9px; font-weight: 600; }
.section-link svg { width: 13px; }

.budget-table, .saving-list, .operation-list { display: grid; }
.budget-head, .budget-row {
    display: grid;
    grid-template-columns: 1.25fr .75fr .75fr 1.55fr .72fr;
    align-items: center;
    gap: 10px;
}
.budget-head { padding: 0 2px 8px; color: #9aa4b8; font-size: 8px; }
.budget-row { min-height: 41px; border-top: 1px solid #f0f2f6; font-size: 9px; }
.category-cell { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.category-icon, .merchant-icon, .saving-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}
.category-icon svg, .saving-icon svg { width: 13px; }
.icon-green { color: var(--green); background: var(--green-soft); }
.icon-blue { color: var(--brand); background: var(--brand-soft); }
.icon-orange { color: var(--orange); background: var(--orange-soft); }
.icon-violet { color: var(--violet); background: var(--violet-soft); }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: #edf0f5; }
.progress-bar { height: 100%; border-radius: inherit; }
.progress-green { background: #48c665; }
.progress-blue { background: #3c71fa; }
.progress-orange { background: #ff891f; }
.budget-remain { text-align: right; font-size: 8px; }
.budget-remain strong { display: block; font-size: 9px; }
.saving-row {
    min-height: 43px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px 105px;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #f0f2f6;
    font-size: 9px;
}
.saving-row:first-child { border-top: 0; }
.saving-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.saving-icon { color: #6b5126; background: #fff4d8; }
.saving-percent { text-align: right; color: var(--ink-soft); }
.saving-benefit { justify-self: end; padding: 7px 9px; color: #23823a; border-radius: 9px; background: var(--green-soft); white-space: nowrap; font-size: 9px; }

.goal-card { background: linear-gradient(145deg, #fffdf7, #fff); }
.goal-content { display: grid; grid-template-columns: 78px 1fr; gap: 15px; align-items: center; }
.laptop-art { position: relative; width: 74px; height: 61px; }
.laptop-screen { position: absolute; top: 2px; left: 7px; width: 59px; height: 43px; border: 4px solid #25334a; border-radius: 4px 4px 2px 2px; background: linear-gradient(135deg, #7fc3ff, #2372e8 46%, #a9dcff); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.laptop-screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 43%, rgba(255,255,255,.35) 44%, transparent 60%); }
.laptop-base { position: absolute; left: 1px; bottom: 7px; width: 72px; height: 7px; border-radius: 1px 1px 7px 7px; background: linear-gradient(#cbd4df, #6c7888); box-shadow: 0 3px 5px rgba(20,33,61,.15); }
.goal-copy strong { display: block; margin-bottom: 12px; font-size: 11px; }
.goal-value { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: 9px; }
.goal-value b { font-size: 9px; }
.goal-remaining { margin: 12px 0 0; color: var(--brand); font-size: 9px; }
.outline-button { display: inline-flex; align-items: center; gap: 6px; margin-top: 15px; padding: 8px 11px; color: var(--brand); border: 1px solid #e2e7f1; border-radius: 9px; background: #fff; font-size: 9px; font-weight: 600; }

.spending-content { min-height: 135px; display: grid; grid-template-columns: 126px minmax(0, 1fr); align-items: center; gap: 6px; }
.donut {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#48c665 0 32%, #3970f6 32% 55%, #ff8a24 55% 69%, #7b5af4 69% 81%, #dde2eb 81% 100%);
}
.donut::before { content: ""; grid-area: 1/1; width: 76px; height: 76px; border-radius: 50%; background: #fff; }
.donut-center { position: relative; grid-area: 1/1; text-align: center; font-size: 13px; font-weight: 700; }
.donut-center span { display: block; margin-top: 2px; color: #a0a9ba; font-size: 8px; font-weight: 400; }
.legend { display: grid; gap: 9px; }
.legend-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 6px; font-size: 8px; }
.legend-dot { width: 5px; height: 5px; border-radius: 50%; }
.legend-row span:nth-child(2) { color: #596681; }
.legend-row strong { white-space: nowrap; font-size: 8px; }

.operation-list { margin-top: -3px; }
.operation-row {
    min-height: 37px;
    display: grid;
    grid-template-columns: minmax(105px, 1.15fr) .72fr .85fr 62px;
    align-items: center;
    gap: 8px;
    font-size: 8px;
}
.merchant { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.merchant-icon { width: 23px; height: 23px; color: #fff; border-radius: 50%; font-size: 8px; }
.merchant-red { background: #ee4a34; }
.merchant-yellow { color: #3d2d00; background: #ffcc32; }
.merchant-blue { background: #326de8; }
.merchant-green { background: #2db36e; }
.merchant-orange { background: #e99035; }
.operation-meta { overflow: hidden; color: #98a1b4; text-overflow: ellipsis; white-space: nowrap; }
.operation-amount { text-align: right; white-space: nowrap; font-size: 9px; font-weight: 600; }
.operations-footer { display: flex; justify-content: center; margin-top: 6px; padding: 10px 0 0; border-top: 1px solid #f0f2f6; }

.empty-panel {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    text-align: center;
    border: 1px dashed #e3e8f1;
    border-radius: 13px;
    background: #fbfcfe;
}
.empty-panel--compact { min-height: 138px; padding: 14px; }
.empty-panel__icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-bottom: 11px;
    border-radius: 11px;
}
.empty-panel__icon svg { width: 19px; height: 19px; stroke-width: 1.8; }
.empty-panel strong { margin-bottom: 5px; color: var(--ink-soft); font-size: 11px; }
.empty-panel > span:last-child { max-width: 310px; color: var(--muted); font-size: 9px; line-height: 1.5; }

.profile-page { max-width: 900px; }
.profile-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 19px;
}
.profile-page-header h2 { margin: 0 0 7px; font-size: 24px; letter-spacing: -.035em; }
.profile-page-header p { margin: 0; color: var(--muted); font-size: 12px; }
.profile-page-header .profile-eyebrow { margin-bottom: 7px; color: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.profile-back-link { flex: 0 0 auto; margin: 0; }
.profile-back-link svg { width: 14px; height: 14px; flex: 0 0 auto; stroke-width: 1.8; }
.profile-card { overflow: hidden; }
.profile-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 23px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #f8faff, #fff);
}
.profile-large-avatar {
    width: 48px;
    height: 48px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: var(--brand);
    border-radius: 14px;
    background: var(--brand-soft);
    font-size: 13px;
    font-weight: 800;
}
.profile-card-header strong, .profile-card-header span { display: block; }
.profile-card-header strong { margin-bottom: 3px; font-size: 14px; }
.profile-card-header div span { color: var(--muted); font-size: 10px; }
.profile-form { padding: 25px 23px 23px; }
.profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.profile-form .field { margin: 0; }
.profile-field-wide { grid-column: 1 / -1; }
.profile-login-input { position: relative; }
.profile-login-input > span {
    position: absolute;
    z-index: 1;
    left: 15px;
    top: 50%;
    color: #a1aabc;
    transform: translateY(-50%);
}
.profile-form .profile-login-input input { padding-left: 34px; }
.profile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin-top: 27px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.profile-actions > a { color: var(--muted); font-size: 12px; font-weight: 650; }
.profile-actions > a:hover { color: var(--ink); }
.profile-actions .profile-save-button { width: auto; min-width: 190px; padding: 0 20px; }
.profile-password-card { margin-top: 18px; overflow: hidden; }
.profile-password-header {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 20px 23px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #fbfaff, #fff);
}
.profile-password-icon {
    width: 40px;
    height: 40px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: var(--violet);
    border-radius: 12px;
    background: var(--violet-soft);
}
.profile-password-icon svg { width: 19px; height: 19px; stroke-width: 1.8; }
.profile-password-header h3 { margin: 0 0 3px; font-size: 14px; }
.profile-password-header p { margin: 0; color: var(--muted); font-size: 10px; }
.profile-password-form { padding: 24px 23px 23px; }
.profile-password-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 18px; }
.profile-password-form .field { margin: 0; }
.profile-password-actions { display: flex; justify-content: flex-end; margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.profile-password-actions .profile-password-button { width: auto; min-width: 180px; padding: 0 20px; }

.status-message { margin-bottom: 16px; padding: 12px 15px; color: #1e7f38; border: 1px solid #d8eedc; border-radius: 11px; background: #f1faf3; font-size: 12px; }
.mobile-brand, .mobile-bottom-nav { display: none; }

/* Accounts */
.metric-card-link {
    display: inline-flex;
    width: max-content;
    margin-top: 14px;
    padding: 8px 11px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 9px;
    background: rgba(255,255,255,.12);
    font-size: 10px;
    font-weight: 750;
}
.metric-card-link:hover { background: rgba(255,255,255,.2); }
.accounts-page { max-width: 1120px; }
.accounts-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    align-items: end;
    gap: 24px;
    margin-bottom: 20px;
}
.accounts-eyebrow { margin: 0 0 9px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.accounts-page-header h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.035em; }
.accounts-page-header > div > p:last-child { max-width: 630px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.accounts-total-card { padding: 17px 18px; color: #fff; border-radius: 15px; background: linear-gradient(135deg, var(--brand), #7459f5); box-shadow: 0 12px 26px rgba(56,103,244,.19); }
.accounts-total-card span, .accounts-total-card small { display: block; color: rgba(255,255,255,.72); font-size: 9px; }
.accounts-total-card strong { display: block; margin: 7px 0 5px; font-size: 22px; line-height: 1; letter-spacing: -.025em; }
.accounts-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .75fr); align-items: start; gap: 18px; }
.accounts-list-card, .account-create-card { overflow: hidden; }
.accounts-card-header, .account-create-header { display: flex; align-items: center; gap: 13px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.accounts-card-header { justify-content: space-between; }
.accounts-card-header h3, .account-create-header h3 { margin: 0 0 4px; font-size: 14px; }
.accounts-card-header p, .account-create-header p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.account-create-icon, .accounts-empty-icon {
    width: 40px;
    height: 40px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: var(--brand);
    border-radius: 12px;
    background: var(--brand-soft);
}
.account-create-icon svg, .accounts-empty-icon svg { width: 19px; height: 19px; stroke-width: 1.8; }
.accounts-empty { min-height: 294px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px; text-align: center; }
.accounts-empty strong { margin: 15px 0 7px; font-size: 14px; }
.accounts-empty p { max-width: 330px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.account-list { padding: 6px 0; }
.account-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px 20px; }
.account-row + .account-row { border-top: 1px solid var(--line); }
.account-type-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--brand); border-radius: 12px; background: var(--brand-soft); }
.account-type-icon--cash { color: var(--green); background: var(--green-soft); }
.account-type-icon--savings, .account-type-icon--deposit { color: var(--violet); background: var(--violet-soft); }
.account-type-icon svg { width: 20px; height: 20px; stroke-width: 1.7; }
.account-row-copy, .account-row-meta { min-width: 0; }
.account-row-copy strong, .account-row-copy small, .account-row-meta strong, .account-row-meta small { display: block; }
.account-row-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-row-copy small, .account-row-meta small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.account-row-meta { text-align: right; }
.account-row-meta strong { font-size: 13px; }
.account-row-meta strong.is-negative { color: var(--red); }
.account-create-form { padding: 21px; }
.account-create-form .field { margin-bottom: 17px; }
.account-create-form .field input, .account-create-form .field select { width: 100%; height: 46px; padding: 0 13px; color: var(--ink); border: 1px solid #dfe3ec; border-radius: 10px; outline: 0; background: #fff; font: inherit; font-size: 13px; transition: border .2s, box-shadow .2s; }
.account-create-form .field input:focus, .account-create-form .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(56,103,244,.1); }
.money-input { position: relative; }
.money-input input { padding-right: 37px !important; }
.money-input > span { position: absolute; top: 50%; right: 14px; color: var(--muted); font-size: 13px; transform: translateY(-50%); pointer-events: none; }
.account-checkbox { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 20px; cursor: pointer; }
.account-checkbox input { width: 15px; height: 15px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--brand); }
.account-checkbox strong, .account-checkbox small { display: block; }
.account-checkbox strong { color: var(--ink-soft); font-size: 11px; }
.account-checkbox small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.account-create-form .account-create-button { min-height: 46px; font-size: 13px; }

/* Transactions */
.operation-amount.is-income { color: var(--green); }
.operation-amount.is-expense { color: var(--red); }
.operation-amount.is-transfer { color: var(--brand); }
.expense-category-list { display: grid; gap: 12px; padding: 4px 1px; }
.expense-category-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; }
.expense-category-copy { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.expense-category-copy strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.expense-category-copy span { color: var(--muted); font-size: 8px; }
.expense-category-row .progress-track { grid-column: 1; }
.expense-category-row > b { grid-column: 2; grid-row: 1 / 3; white-space: nowrap; font-size: 9px; }
.transactions-page { max-width: 1120px; }
.transactions-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    align-items: end;
    gap: 24px;
    margin-bottom: 20px;
}
.transactions-eyebrow { margin: 0 0 9px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.transactions-page-header h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.035em; }
.transactions-page-header > div > p:last-child { max-width: 620px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.transactions-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.transaction-summary-card { padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.transaction-summary-card span, .transaction-summary-card strong { display: block; }
.transaction-summary-card span { margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.transaction-summary-card strong { white-space: nowrap; font-size: 14px; }
.transaction-summary-card--income { background: linear-gradient(145deg, #fff, #f7fcf8); }
.transaction-summary-card--income strong { color: var(--green); }
.transaction-summary-card--expense { background: linear-gradient(145deg, #fff, #fff8f8); }
.transaction-summary-card--expense strong { color: var(--red); }
.transactions-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .75fr); align-items: start; gap: 18px; }
.transactions-list-card, .transaction-create-card { overflow: hidden; }
.transactions-card-header, .transaction-create-header { display: flex; align-items: center; gap: 13px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.transactions-card-header { justify-content: space-between; }
.transactions-card-header h3, .transaction-create-header h3 { margin: 0 0 4px; font-size: 14px; }
.transactions-card-header p, .transaction-create-header p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.transaction-create-icon, .transactions-empty-icon { width: 40px; height: 40px; display: grid; flex: 0 0 auto; place-items: center; color: var(--brand); border-radius: 12px; background: var(--brand-soft); }
.transaction-create-icon svg, .transactions-empty-icon svg { width: 19px; height: 19px; stroke-width: 1.8; }
.transactions-empty { min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px; text-align: center; }
.transactions-empty strong { margin: 15px 0 7px; font-size: 14px; }
.transactions-empty p { max-width: 350px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.transactions-list { padding: 5px 0; }
.transaction-item { min-height: 69px; display: grid; grid-template-columns: 40px minmax(0, 1fr) 66px auto 58px; align-items: center; gap: 12px; padding: 12px 20px; }
.transaction-item + .transaction-item { border-top: 1px solid var(--line); }
.transaction-item-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.transaction-item-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.transaction-item-icon.is-income { color: var(--green); background: var(--green-soft); }
.transaction-item-icon.is-expense { color: var(--red); background: var(--red-soft); }
.transaction-item-icon.is-transfer { color: var(--brand); background: var(--brand-soft); }
.transaction-item-icon.is-opening { color: var(--brand); background: var(--brand-soft); }
.transaction-item-copy { min-width: 0; }
.transaction-item-copy strong, .transaction-item-copy small { display: block; }
.transaction-item-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-item-copy small { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-item-date { color: var(--muted); font-size: 9px; }
.transaction-item-amount { white-space: nowrap; text-align: right; font-size: 11px; }
.transaction-item-amount.is-income { color: var(--green); }
.transaction-item-amount.is-expense { color: var(--red); }
.transaction-item-amount.is-transfer { color: var(--brand); }
.transaction-item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.transaction-item-actions form { display: contents; }
.transaction-item-actions a, .transaction-item-actions button { width: 27px; height: 27px; display: grid; place-items: center; padding: 0; color: var(--muted); border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.transaction-item-actions a:hover { color: var(--brand); background: var(--brand-soft); }
.transaction-item-actions button:hover { color: var(--red); background: var(--red-soft); }
.transaction-item-actions svg { width: 14px; height: 14px; stroke-width: 1.8; }
.transaction-system-label { color: var(--muted); text-align: right; font-size: 8px; }
.transaction-create-form { padding: 21px; }
.transaction-create-form .field { margin-bottom: 16px; }
.transaction-create-form .field input, .transaction-create-form .field select { width: 100%; height: 46px; padding: 0 13px; color: var(--ink); border: 1px solid #dfe3ec; border-radius: 10px; outline: 0; background: #fff; font: inherit; font-size: 13px; transition: border .2s, box-shadow .2s; }
.transaction-create-form .field input:focus, .transaction-create-form .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(56,103,244,.1); }
.operation-type-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 17px; padding: 0; border: 0; }
.operation-type-switch--two { grid-template-columns: repeat(2, 1fr); }
.operation-type-switch legend { width: 100%; margin-bottom: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.operation-type-switch label { position: relative; cursor: pointer; }
.operation-type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.operation-type-switch span { height: 40px; display: grid; place-items: center; color: var(--muted); border: 1px solid #dfe3ec; border-radius: 10px; background: #fff; font-size: 11px; font-weight: 750; transition: border .2s, color .2s, background .2s, box-shadow .2s; }
.operation-type-switch input[value="expense"]:checked + span { color: var(--red); border-color: #ffd7d7; background: var(--red-soft); box-shadow: 0 0 0 3px rgba(240,68,68,.07); }
.operation-type-switch input[value="income"]:checked + span { color: var(--green); border-color: #ccebd4; background: var(--green-soft); box-shadow: 0 0 0 3px rgba(37,162,68,.07); }
.operation-type-switch input[value="transfer"]:checked + span { color: var(--brand); border-color: #d8e2ff; background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(56,103,244,.07); }
.operation-type-switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.operation-type-switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.operation-type-error { margin: -10px 0 15px; }
.transaction-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.transaction-transfer-fields { display: grid; grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr); align-items: start; gap: 8px; }
.transaction-transfer-fields[hidden] { display: none; }
.transfer-direction-icon { width: 26px; height: 46px; display: grid; place-items: center; margin-top: 28px; color: var(--brand); }
.transfer-direction-icon svg { width: 17px; height: 17px; stroke-width: 1.8; }
.optional-label { color: var(--muted); font-size: 9px; font-weight: 500; }
.transaction-create-form .transaction-create-button { min-height: 46px; font-size: 13px; }
.transaction-account-required { padding: 32px 21px; text-align: center; }
.transaction-account-required strong { display: block; font-size: 14px; }
.transaction-account-required p { margin: 8px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.transaction-account-required .primary-button { display: flex; align-items: center; justify-content: center; min-height: 46px; font-size: 13px; }
.transactions-categories-link { flex: 0 0 auto; margin: 0; }
.transaction-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.transaction-filters label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.transaction-filters select, .transaction-filters input { width: 100%; height: 39px; padding: 0 10px; color: var(--ink-soft); border: 1px solid #e1e5ed; border-radius: 9px; outline: 0; background: #fff; font-size: 12px; }
.transaction-filters select:focus, .transaction-filters input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(56,103,244,.08); }
.transaction-filter-actions { min-height: 39px; display: flex; align-items: center; gap: 10px; }
.transaction-filter-actions button { height: 39px; padding: 0 14px; color: #fff; border: 0; border-radius: 9px; background: var(--brand); font-size: 12px; font-weight: 750; cursor: pointer; }
.transaction-filter-actions a { color: var(--muted); font-size: 11px; font-weight: 650; }
.transaction-edit-page { max-width: 820px; }
.transaction-edit-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 19px; }
.transaction-edit-page-header h2 { margin: 0 0 7px; font-size: 24px; letter-spacing: -.035em; }
.transaction-edit-page-header p { margin: 0; color: var(--muted); font-size: 12px; }
.transaction-edit-back { flex: 0 0 auto; margin: 0; }
.transaction-edit-back svg { width: 14px; height: 14px; }
.transaction-edit-card { overflow: hidden; }
.transaction-edit-form { padding: 25px 23px 23px; }
.transaction-edit-main-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.transaction-transfer-fields--edit { gap: 14px; }
.transaction-edit-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.transaction-edit-actions > a { color: var(--muted); font-size: 12px; font-weight: 650; }
.transaction-edit-actions > a:hover { color: var(--ink); }
.transaction-edit-actions .primary-button { width: auto; min-width: 190px; padding: 0 20px; }
.receipt-transaction-lock { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 10px 12px; color: #315aa9; border: 1px solid #dce6ff; border-radius: 10px; background: #f5f8ff; font-size: 10px; font-weight: 650; }
.receipt-transaction-lock > span { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; border-radius: 50%; background: var(--brand); font-size: 10px; }

/* Categories */
.categories-page { max-width: 1120px; }
.categories-page-header { display: grid; grid-template-columns: minmax(0, 1fr) 210px; align-items: end; gap: 24px; margin-bottom: 20px; }
.categories-eyebrow { margin: 0 0 9px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.categories-page-header h2, .category-edit-page h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.035em; }
.categories-page-header > div > p:last-child { max-width: 660px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.categories-summary { padding: 17px 18px; color: #fff; border-radius: 15px; background: linear-gradient(135deg, var(--brand), #7459f5); box-shadow: 0 12px 26px rgba(56,103,244,.19); }
.categories-summary span, .categories-summary small { display: block; color: rgba(255,255,255,.72); font-size: 10px; }
.categories-summary strong { display: block; margin: 6px 0 4px; font-size: 24px; line-height: 1; }
.categories-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(315px, .72fr); align-items: start; gap: 18px; }
.categories-list-card, .category-create-card, .category-edit-card { overflow: hidden; }
.categories-card-header, .category-create-header { display: flex; align-items: center; gap: 13px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.categories-card-header h3, .category-create-header h3 { margin: 0 0 4px; font-size: 14px; }
.categories-card-header p, .category-create-header p { margin: 0; color: var(--muted); font-size: 11px; }
.category-create-icon { width: 40px; height: 40px; display: grid; flex: 0 0 auto; place-items: center; color: var(--brand); border-radius: 12px; background: var(--brand-soft); }
.category-create-icon svg { width: 19px; height: 19px; stroke-width: 1.8; }
.category-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.category-column + .category-column { border-left: 1px solid var(--line); }
.category-column-title { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.category-column-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.category-column-icon svg { width: 17px; height: 17px; stroke-width: 1.8; }
.category-column--expense .category-column-icon { color: var(--red); background: var(--red-soft); }
.category-column--income .category-column-icon { color: var(--green); background: var(--green-soft); }
.category-column-title h3 { margin: 0 0 2px; font-size: 13px; }
.category-column-title p { margin: 0; color: var(--muted); font-size: 10px; }
.category-tree { padding: 5px 0 9px; }
.category-tree-group + .category-tree-group { border-top: 1px solid #f0f2f6; }
.category-row { min-height: 50px; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 13px 9px 17px; }
.category-row--child { position: relative; min-height: 45px; padding-left: 31px; background: #fcfdff; }
.category-row--child::before { content: ''; position: absolute; left: 21px; top: 0; bottom: 50%; width: 7px; border-left: 1px solid #dce2ed; border-bottom: 1px solid #dce2ed; border-radius: 0 0 0 4px; }
.category-row-marker { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.category-column--expense .category-row-marker { background: #f47a7a; }
.category-column--income .category-row-marker { background: #55bd6c; }
.category-row-copy { min-width: 0; }
.category-row-copy strong, .category-row-copy small { display: block; }
.category-row-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.category-row-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.category-row-actions { display: flex; gap: 2px; }
.category-row-actions form { display: contents; }
.category-row-actions a, .category-row-actions button { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; color: var(--muted); border: 0; border-radius: 7px; background: transparent; cursor: pointer; }
.category-row-actions a:hover { color: var(--brand); background: var(--brand-soft); }
.category-row-actions button:hover { color: var(--red); background: var(--red-soft); }
.category-row-actions svg { width: 13px; height: 13px; stroke-width: 1.8; }
.category-create-form { padding: 21px; }
.category-create-form .field { margin-bottom: 17px; }
.category-create-form .field input, .category-create-form .field select { width: 100%; height: 46px; padding: 0 13px; color: var(--ink); border: 1px solid #dfe3ec; border-radius: 10px; outline: 0; background: #fff; font: inherit; font-size: 13px; }
.category-create-form .field input:focus, .category-create-form .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(56,103,244,.1); }
.category-type-error { margin: -10px 0 15px; }
.category-create-form .category-create-button { min-height: 46px; font-size: 13px; }
.category-edit-page { max-width: 760px; }
.category-edit-card { max-width: 620px; }
.category-edit-form { padding: 25px 23px 23px; }

/* Receipt import */
.receipts-page { max-width: 1180px; }
.receipts-page-header { display: grid; grid-template-columns: minmax(0, 1fr) 235px; align-items: end; gap: 24px; margin-bottom: 20px; }
.receipts-eyebrow { margin: 0 0 9px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.receipts-page-header h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.035em; }
.receipts-page-header > div > p:last-child { max-width: 690px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.receipt-provider-state { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #31559e; border: 1px solid #dbe5ff; border-radius: 14px; background: #f5f8ff; }
.receipt-provider-icon { width: 38px; height: 38px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 11px; background: #e6edff; }
.receipt-provider-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.receipt-provider-state strong, .receipt-provider-state small { display: block; }
.receipt-provider-state strong { margin-bottom: 3px; color: var(--ink-soft); font-size: 11px; }
.receipt-provider-state small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.receipts-grid { display: grid; grid-template-columns: minmax(330px, .72fr) minmax(0, 1.28fr); align-items: start; gap: 18px; }
.receipt-import-card, .receipts-history-card { overflow: hidden; }
.receipt-card-header { display: flex; align-items: center; gap: 13px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.receipt-card-header h3 { margin: 0 0 4px; font-size: 14px; }
.receipt-card-header p { margin: 0; color: var(--muted); font-size: 11px; }
.receipt-card-icon { width: 40px; height: 40px; display: grid; flex: 0 0 auto; place-items: center; color: var(--brand); border-radius: 12px; background: var(--brand-soft); }
.receipt-card-icon svg { width: 20px; height: 20px; stroke-width: 1.65; }
.receipt-import-form { padding: 21px; }
.receipt-scanner { position: relative; min-height: 190px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #cfd9ef; border-radius: 14px; background: linear-gradient(145deg, #f8faff, #f1f5ff); }
.receipt-scanner video { width: 100%; height: 230px; object-fit: cover; background: #101522; }
.receipt-camera-placeholder { display: grid; justify-items: center; padding: 26px; text-align: center; }
.receipt-camera-placeholder > span { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 12px; color: var(--brand); border-radius: 15px; background: #e5ecff; }
.receipt-camera-placeholder svg { width: 23px; height: 23px; stroke-width: 1.7; }
.receipt-camera-placeholder strong { font-size: 13px; }
.receipt-camera-placeholder small { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.receipt-scan-frame { position: absolute; inset: 50% auto auto 50%; width: 150px; height: 150px; border: 2px solid rgba(255,255,255,.9); border-radius: 15px; box-shadow: 0 0 0 999px rgba(8,17,38,.25); transform: translate(-50%, -50%); pointer-events: none; }
.receipt-camera-actions { display: flex; align-items: center; justify-content: center; gap: 13px; margin-top: 12px; }
.receipt-camera-actions .outline-button { margin: 0; }
.receipt-camera-start { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.receipt-camera-actions svg { width: 15px; height: 15px; }
.receipt-camera-stop { padding: 7px 3px; color: var(--muted); border: 0; background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.receipt-camera-status { min-height: 17px; margin: 8px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; }
.receipt-manual-toggle { display: block; margin: -7px auto 0; padding: 7px; color: var(--brand); border: 0; background: transparent; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.receipt-manual-panel { margin-top: 12px; padding-top: 17px; border-top: 1px solid var(--line); }
.receipt-manual-check { width: 100%; min-height: 42px; justify-content: center; margin: -1px 0 0; }
.receipt-detected { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; margin: 0; padding: 16px; border: 1px solid #ceddff; border-radius: 13px; background: #f5f8ff; }
.receipt-detected[hidden], .receipt-import-details[hidden], .receipt-capture-step[hidden] { display: none; }
.receipt-detected-icon { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; border-radius: 12px; background: var(--brand); box-shadow: 0 7px 16px rgba(56,103,244,.2); }
.receipt-detected-icon svg { width: 21px; height: 21px; stroke-width: 2.2; }
.receipt-detected-copy { min-width: 0; }
.receipt-detected-copy strong, .receipt-detected-copy small { display: block; }
.receipt-detected-copy strong { color: var(--ink); font-size: 13px; }
.receipt-detected-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.receipt-detected-copy code { display: block; max-height: 72px; overflow: auto; margin-top: 8px; padding: 9px 10px; color: #43536f; border: 1px solid #dfe6f4; border-radius: 8px; background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; white-space: normal; }
.receipt-detected-actions { grid-column: 2; display: flex; align-items: center; gap: 11px; margin-top: 2px; }
.receipt-detected-actions .primary-button { width: auto; min-height: 40px; padding: 0 15px; font-size: 11px; box-shadow: 0 7px 16px rgba(56,103,244,.16); }
.receipt-detected-actions > button:last-child { padding: 7px 2px; color: var(--muted); border: 0; background: transparent; font: inherit; font-size: 10px; font-weight: 650; cursor: pointer; }
.receipt-detected.is-confirmed { border-color: #d5ebda; background: #f5fbf7; }
.receipt-detected.is-confirmed .receipt-detected-icon { background: var(--green); box-shadow: 0 7px 16px rgba(37,162,68,.16); }
.receipt-import-details { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.receipt-details-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.receipt-details-heading > span { width: 28px; height: 28px; display: grid; flex: 0 0 auto; place-items: center; color: #fff; border-radius: 9px; background: var(--brand); font-size: 11px; font-weight: 800; }
.receipt-details-heading strong, .receipt-details-heading small { display: block; }
.receipt-details-heading strong { color: var(--ink); font-size: 13px; }
.receipt-details-heading small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.receipt-import-form .field { margin-bottom: 16px; }
.receipt-import-form .field input, .receipt-import-form .field select, .receipt-import-form .field textarea { width: 100%; padding: 0 13px; color: var(--ink); border: 1px solid #dfe3ec; border-radius: 10px; outline: 0; background: #fff; font: inherit; font-size: 12px; transition: border .2s, box-shadow .2s; }
.receipt-import-form .field input, .receipt-import-form .field select { height: 46px; }
.receipt-import-form .field textarea { min-height: 91px; padding-top: 11px; padding-bottom: 11px; resize: vertical; line-height: 1.45; }
.receipt-import-form .field input:focus, .receipt-import-form .field select:focus, .receipt-import-form .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(56,103,244,.1); }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.field-hint code { color: #52617e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.receipt-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.receipt-auto-category-note { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; margin: 0 0 18px; padding: 13px; color: #315a8c; border: 1px solid #dce8f7; border-radius: 11px; background: #f6faff; }
.receipt-auto-category-note > span { width: 36px; height: 36px; display: grid; place-items: center; color: var(--brand); border-radius: 10px; background: #e7efff; }
.receipt-auto-category-note svg { width: 18px; height: 18px; stroke-width: 1.8; }
.receipt-auto-category-note strong { display: block; color: var(--ink-soft); font-size: 11px; }
.receipt-auto-category-note p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.receipt-consent { display: grid; grid-template-columns: 17px minmax(0, 1fr); align-items: start; gap: 9px; margin: 2px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.5; cursor: pointer; }
.receipt-consent input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.receipt-consent-error { margin: -11px 0 16px; }
.receipt-import-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; font-size: 13px; }
.receipt-import-button svg { width: 17px; height: 17px; stroke-width: 1.8; }
.receipt-account-required { padding: 40px 22px; text-align: center; }
.receipt-account-required strong { font-size: 14px; }
.receipt-account-required p { margin: 8px 0 20px; color: var(--muted); font-size: 11px; }
.receipt-account-required .primary-button { display: flex; align-items: center; justify-content: center; min-height: 46px; }
.receipt-history-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.receipt-history-header h3 { margin: 0 0 4px; font-size: 14px; }
.receipt-history-header p { margin: 0; color: var(--muted); font-size: 10px; }
.receipt-history-header > a { color: var(--brand); font-size: 10px; font-weight: 700; }
.receipt-api-note { display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 10px; margin: 15px 18px 5px; padding: 12px 13px; color: #53617d; border: 1px solid #e5e9f2; border-radius: 11px; background: #fafbfe; }
.receipt-api-note > span { width: 23px; height: 23px; display: grid; place-items: center; color: var(--brand); border-radius: 50%; background: var(--brand-soft); font-size: 11px; font-weight: 800; }
.receipt-api-note p { margin: 0; font-size: 9px; line-height: 1.55; }
.receipt-api-note strong { color: var(--ink-soft); }
.receipts-empty { min-height: 300px; display: grid; align-content: center; justify-items: center; padding: 38px; text-align: center; }
.receipts-empty > span { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 13px; color: var(--brand); border-radius: 15px; background: var(--brand-soft); }
.receipts-empty svg { width: 23px; height: 23px; stroke-width: 1.65; }
.receipts-empty strong { font-size: 13px; }
.receipts-empty p { max-width: 330px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.receipt-list { padding: 5px 0 9px; }
.receipt-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 90px 95px; align-items: center; gap: 10px 12px; padding: 14px 18px; border-bottom: 1px solid #f0f2f6; }
.receipt-row:last-child { border-bottom: 0; }
.receipt-row-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--brand); border-radius: 11px; background: var(--brand-soft); }
.receipt-row-icon svg { width: 17px; height: 17px; stroke-width: 1.7; }
.receipt-row-copy { min-width: 0; }
.receipt-row-copy strong, .receipt-row-copy small, .receipt-row-copy > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-row-copy strong { font-size: 12px; }
.receipt-row-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.receipt-row-copy > span { margin-top: 4px; color: #a0a9bc; font-size: 8px; }
.receipt-row-date { color: var(--muted); font-size: 9px; text-align: right; }
.receipt-row-amount { color: var(--red); font-size: 12px; text-align: right; white-space: nowrap; }
.receipt-status { grid-column: 2 / -1; justify-self: start; padding: 4px 8px; color: #315aa9; border-radius: 999px; background: #edf3ff; font-size: 8px; font-weight: 750; }

/* Authentication */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 85% 12%, rgba(83,124,255,.13), transparent 28rem),
        radial-gradient(circle at 12% 85%, rgba(121,89,246,.08), transparent 26rem),
        #f5f7fb;
}
.auth-shell {
    width: min(960px, 100%);
    min-height: 590px;
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    overflow: hidden;
    border: 1px solid #e2e6ef;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(23,40,80,.12);
}
.auth-showcase {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 42px;
    color: #fff;
    background: linear-gradient(145deg, #2f63f5, #527bf9 62%, #765bf4);
}
.auth-showcase::before, .auth-showcase::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.auth-showcase::before { width: 290px; height: 290px; right: -130px; top: -90px; }
.auth-showcase::after { width: 240px; height: 240px; left: -120px; bottom: -90px; }
.auth-pitch { position: relative; z-index: 1; margin: auto 0 30px; }
.auth-pitch h2 { max-width: 350px; margin: 0 0 15px; font-size: 39px; line-height: 1.08; letter-spacing: -.045em; }
.auth-pitch p { max-width: 340px; margin: 0; color: rgba(255,255,255,.76); font-size: 15px; line-height: 1.65; }
.auth-mini-card { position: relative; z-index: 1; padding: 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: rgba(255,255,255,.12); backdrop-filter: blur(10px); }
.auth-mini-card span { display: block; color: rgba(255,255,255,.72); font-size: 11px; }
.auth-mini-card strong { display: block; margin: 6px 0 13px; font-size: 30px; font-weight: 600; transition: opacity .22s ease, transform .22s ease; }
.auth-mini-line { width: 100%; height: 28px; }
.auth-mini-line path { transition: d .7s ease, opacity .22s ease, transform .22s ease; transform-origin: center; }
.auth-mini-card.is-changing strong { opacity: .25; transform: translateY(4px); }
.auth-mini-card.is-changing .auth-mini-line path { opacity: .35; transform: translateY(2px); }
.auth-form-panel { display: grid; align-content: center; padding: 54px 64px; }
.auth-form-panel h1 { margin: 0 0 10px; font-size: 35px; line-height: 1.15; letter-spacing: -.04em; }
.auth-intro { margin: 0 0 31px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    margin-bottom: 16px;
    padding: 7px 10px;
    color: var(--brand);
    border: 1px solid #e0e7ff;
    border-radius: 9px;
    background: var(--brand-soft);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .02em;
}
.auth-eyebrow svg { width: 14px; height: 14px; }
.admin-security-card {
    position: relative;
    z-index: 1;
    min-height: 92px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 10px;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 16px;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
}
.admin-shield {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 13px;
    background: rgba(255,255,255,.13);
}
.admin-shield svg { width: 24px; height: 24px; stroke-width: 1.8; }
.admin-status-copy small { display: block; margin-bottom: 5px; color: rgba(255,255,255,.7); font-size: 11px; }
.admin-status-copy strong { display: block; font-size: 15px; }
.admin-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #71eb94; box-shadow: 0 0 0 5px rgba(113,235,148,.14); }
.field { margin-bottom: 19px; }
.field label { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.field input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid #dfe3ec;
    border-radius: 11px;
    outline: 0;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    transition: border .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(56,103,244,.1); }
.field-hint { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.field-error { margin: 7px 0 0; color: var(--red); font-size: 12px; }
.remember { display: flex; align-items: center; gap: 9px; margin: 2px 0 22px; color: #6f7b94; font-size: 13px; }
.remember input { accent-color: var(--brand); }
.primary-button { width: 100%; min-height: 50px; border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--brand), #527bf9); color: #fff; font-size: 15px; font-weight: 750; cursor: pointer; box-shadow: 0 10px 24px rgba(56,103,244,.2); transition: transform .2s, box-shadow .2s; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(56,103,244,.25); }
.secure-note { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 22px 0 0; color: #9ba4b6; font-size: 11px; }
.secure-note svg { width: 14px; }

@media (max-width: 1180px) {
    .app-shell { grid-template-columns: 196px minmax(0, 1fr); }
    .main-panel { padding: 24px 22px 28px; }
    .topbar { grid-template-columns: minmax(200px,1fr) minmax(220px,320px) auto; gap: 18px; }
    .metric-grid { grid-template-columns: 1.4fr repeat(3, .8fr); }
    .small-metric { padding: 15px; }
    .small-metric .amount { font-size: 20px; }
    .operation-row { grid-template-columns: minmax(95px,1fr) .7fr 62px; }
    .operation-row .operation-category { display: none; }
}

@media (max-width: 980px) {
    .app-shell { width: 100%; min-height: 100vh; margin: 0; grid-template-columns: 1fr; border: 0; border-radius: 0; }
    .sidebar { display: none; }
    .main-panel { padding: 18px 18px 90px; }
    .mobile-brand { display: inline-flex; }
    .topbar { grid-template-columns: 1fr auto; align-items: center; }
    .topbar .greeting { grid-column: 1 / -1; grid-row: 2; margin-top: 8px; }
    .search { display: none; }
    .profile-area { grid-column: 2; grid-row: 1; }
    .profile-copy { display: none; }
    .profile { min-width: auto; grid-template-columns: 38px; }
    .metric-grid { grid-template-columns: repeat(3, 1fr); }
    .free-card { grid-column: 1 / -1; }
    .middle-grid { grid-template-columns: 1fr; }
    .bottom-grid { grid-template-columns: repeat(2, 1fr); }
    .operations-card { grid-column: 1 / -1; }
    .mobile-bottom-nav {
        position: fixed;
        z-index: 30;
        left: 50%;
        bottom: 10px;
        width: min(520px, calc(100% - 20px));
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        padding: 7px 8px;
        border: 1px solid rgba(220,225,236,.9);
        border-radius: 17px;
        background: rgba(255,255,255,.93);
        box-shadow: 0 12px 35px rgba(25,41,78,.14);
        backdrop-filter: blur(18px);
        transform: translateX(-50%);
    }
    .mobile-nav-link { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #7e899f; border-radius: 11px; font-size: 8px; font-weight: 600; }
    .mobile-nav-link.active { color: var(--brand); background: var(--brand-soft); }
    .mobile-nav-link svg { width: 18px; height: 18px; }
}

@media (max-width: 680px) {
    body { background: #fff; }
    .main-panel { padding: 15px 13px 88px; }
    .topbar { margin-bottom: 15px; }
    .greeting h1 { font-size: 18px; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
    .free-card { min-height: 174px; }
    .small-metric { min-height: 145px; padding: 15px; }
    .small-metric.required { grid-column: 1 / -1; min-height: 120px; display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; align-content: center; }
    .small-metric.required .metric-icon { grid-row: 1 / 4; margin: 0; }
    .small-metric.required strong { align-self: end; }
    .small-metric.required small { margin-top: 4px; }
    .panel-card { padding: 16px 14px; }
    .bottom-grid { grid-template-columns: 1fr; }
    .operations-card { grid-column: auto; }
    .budget-head { display: none; }
    .budget-row { grid-template-columns: minmax(100px,1fr) 1fr 54px; gap: 8px; }
    .budget-plan, .budget-fact { display: none; }
    .saving-row { grid-template-columns: minmax(0,1fr) 42px 93px; }
    .saving-benefit { padding: 6px 7px; }
    .goal-content { grid-template-columns: 70px 1fr; }
    .spending-content { grid-template-columns: 118px 1fr; }
    .operation-row { grid-template-columns: minmax(100px,1fr) .8fr 62px; }
    .profile-page-header { display: block; }
    .profile-back-link { margin-top: 15px; }
    .profile-form-grid { grid-template-columns: 1fr; }
    .profile-field-wide { grid-column: auto; }
    .profile-card-header, .profile-form { padding-left: 18px; padding-right: 18px; }
    .profile-actions { align-items: stretch; flex-direction: column-reverse; text-align: center; }
    .profile-actions .profile-save-button { width: 100%; }
    .profile-password-header, .profile-password-form { padding-left: 18px; padding-right: 18px; }
    .profile-password-grid { grid-template-columns: 1fr; }
    .profile-password-actions .profile-password-button { width: 100%; }
    .accounts-page-header { grid-template-columns: 1fr; gap: 15px; }
    .accounts-total-card { width: 100%; }
    .accounts-grid { grid-template-columns: 1fr; }
    .account-create-card { grid-row: 1; }
    .accounts-list-card { grid-row: 2; }
    .account-row { padding-left: 16px; padding-right: 16px; }
    .transactions-page-header { grid-template-columns: 1fr; gap: 15px; }
    .transactions-summary { width: 100%; }
    .transactions-grid { grid-template-columns: 1fr; }
    .transaction-create-card { grid-row: 1; }
    .transactions-list-card { grid-row: 2; }
    .transaction-item { grid-template-columns: 38px minmax(0, 1fr) auto 58px; gap: 9px; padding-left: 16px; padding-right: 16px; }
    .transaction-item-date { display: none; }
    .transaction-filters { grid-template-columns: 1fr 1fr; padding-left: 16px; padding-right: 16px; }
    .transaction-form-grid, .transaction-edit-main-grid { grid-template-columns: 1fr; }
    .transaction-transfer-fields { grid-template-columns: 1fr; gap: 0; }
    .transfer-direction-icon { height: 24px; margin: -6px 0 4px; transform: rotate(90deg); }
    .transaction-edit-page-header { display: block; }
    .transaction-edit-back { margin-top: 15px; }
    .transaction-edit-actions { align-items: stretch; flex-direction: column-reverse; text-align: center; }
    .transaction-edit-actions .primary-button { width: 100%; }
    .categories-page-header { grid-template-columns: 1fr; gap: 15px; }
    .categories-summary { width: 100%; }
    .categories-grid { grid-template-columns: 1fr; }
    .category-create-card { grid-row: 1; }
    .categories-list-card { grid-row: 2; }
    .category-columns { grid-template-columns: 1fr; }
    .category-column + .category-column { border-left: 0; border-top: 1px solid var(--line); }
    .receipts-page-header { grid-template-columns: 1fr; gap: 15px; }
    .receipt-provider-state { width: 100%; }
    .receipts-grid { grid-template-columns: 1fr; }
    .receipt-form-grid { grid-template-columns: 1fr; gap: 0; }
    .receipt-detected { grid-template-columns: 36px minmax(0, 1fr); padding: 14px; }
    .receipt-detected-icon { width: 34px; height: 34px; }
    .receipt-detected-actions { grid-column: 1 / -1; align-items: stretch; flex-direction: column; }
    .receipt-detected-actions .primary-button { width: 100%; }
    .receipt-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
    .receipt-row-date { display: none; }
    .receipt-row-amount { grid-column: 3; grid-row: 1; }
    .receipt-status { grid-column: 2 / -1; }
    .auth-page { padding: 0; background: #fff; }
    .auth-shell { min-height: 100vh; display: block; border: 0; border-radius: 0; box-shadow: none; }
    .auth-showcase { display: none; }
    .auth-form-panel { min-height: 100vh; padding: 34px 24px; align-content: center; }
    .auth-form-panel h1 { font-size: 32px; }
    .auth-intro { font-size: 14px; }
}

@media (max-width: 390px) {
    .small-metric .amount { font-size: 18px; }
    .spending-content { grid-template-columns: 104px 1fr; }
    .donut { width: 96px; height: 96px; }
    .donut::before { width: 65px; height: 65px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
