:root {
    --bg: #080b12;
    --surface: #0d111a;
    --card: #121823;
    --elevated: #18202d;
    --border: #252d3a;
    --text: #f5f7fa;
    --muted: #9aa4b2;
    --quiet: #687386;
    --income: #22c55e;
    --income-soft: #86efac;
    --expense: #f05252;
    --expense-soft: #fda4a4;
    --insight: #6366f1;
    --lavender: #a78bfa;
    --shadow: 0 22px 60px rgba(0, 0, 0, .34);
    --radius: 18px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif
}

* {
    box-sizing: border-box
}

html {
    background: var(--bg);
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: radial-gradient(circle at 82% 10%, rgba(99, 102, 241, .08), transparent 27rem), var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select {
    font: inherit
}

button {
    cursor: pointer
}

.app-shell {
    min-height: 100vh
}

.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    gap: 34px;
    padding: 0 clamp(20px, 4vw, 64px);
    border-bottom: 1px solid rgba(37, 45, 58, .78);
    background: rgba(8, 11, 18, .88);
    backdrop-filter: blur(22px);
    position: sticky;
    top: 0;
    z-index: 20
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.04em
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--income);
    color: #06110a;
    font-size: 17px;
    font-weight: 800;
    box-shadow: 0 8px 28px rgba(34, 197, 94, .23)
}

.desktop-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    padding: 10px 13px;
    border-radius: 10px;
    transition: color .2s, background .2s, transform .2s
}

.nav-link i {
    font-size: 14px
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: rgba(255, 255, 255, .06);
    transform: translateY(-1px)
}

.nav-link.active {
    color: var(--income)
}

.profile-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(167, 139, 250, .22);
    color: var(--lavender);
    font-weight: 600
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    transition: all .2s
}

.icon-button:hover {
    background: rgba(255, 255, 255, .07);
    border-color: var(--border);
    color: var(--text);
    transform: translateY(-1px)
}

.page-wrap {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 58px 0 96px
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 34px
}

.eyebrow {
    margin: 0 0 9px;
    color: var(--quiet);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .19em
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(31px, 4vw, 48px);
    line-height: 1.1;
    letter-spacing: -.055em;
    font-weight: 650
}

.subheading {
    color: var(--muted);
    margin: 11px 0 0;
    max-width: 540px
}

.wave {
    font-size: .75em
}

.period-chip,
.filter-select,
.search-input {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    border-radius: 999px;
    padding: 11px 15px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap
}

.period-chip {
    transition: all .2s;
    position: relative
}

.period-chip:hover {
    border-color: #47536a;
    color: var(--text);
    transform: translateY(-1px)
}

/* ═══════════════════════════════════════════
   Date Range Picker Dropdown
   ═══════════════════════════════════════════ */

.date-range-wrap {
    position: relative;
    display: inline-block
}

.date-range-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 35;
    min-width: 280px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
    padding: 8px 0;
    animation: dateDropIn .18s ease
}

.date-range-dropdown.open {
    display: block
}

@keyframes dateDropIn {
    from { opacity: 0; transform: translateY(-6px) }
    to { opacity: 1; transform: none }
}

.date-range-dropdown .dr-header {
    padding: 14px 18px 10px;
    color: var(--quiet);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase
}

.dr-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 18px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s
}

.dr-option:hover {
    background: rgba(255, 255, 255, .05);
    color: var(--text)
}

.dr-option.active {
    color: var(--income);
    font-weight: 600
}

.dr-option i {
    font-size: 15px;
    width: 18px;
    text-align: center;
    color: var(--quiet)
}

.dr-option.active i {
    color: var(--income)
}

.dr-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 18px
}

.dr-custom-panel {
    display: none;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--border);
    margin-top: 4px
}

.dr-custom-panel.open {
    display: block
}

.dr-custom-panel label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 10px
}

.dr-custom-panel input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    min-height: 40px
}

.dr-custom-panel input[type="date"]:focus {
    border-color: var(--insight);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .17);
    outline: 0
}

.dr-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px
}

.dr-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s
}

.dr-cancel-btn {
    background: var(--surface);
    color: var(--muted)
}

.dr-cancel-btn:hover {
    background: var(--elevated);
    color: var(--text)
}

.dr-apply-btn {
    background: var(--income);
    color: #07120a;
    border-color: transparent
}

.dr-apply-btn:hover {
    background: #42d976
}

.dr-error {
    color: var(--expense-soft);
    font-size: 12px;
    margin-top: 6px;
    display: none
}

.dr-error.show {
    display: block
}

.date-range-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 34
}

.date-range-overlay.open {
    display: block
}

.period-chip.small {
    font-size: 13px;
    padding: 9px 13px
}

.balance-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 38px 42px;
    min-height: 260px;
    background: linear-gradient(125deg, rgba(18, 24, 35, .98), rgba(13, 17, 26, .95));
    box-shadow: var(--shadow)
}

.balance-hero:before {
    content: "";
    position: absolute;
    width: 470px;
    height: 300px;
    left: -80px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(34, 197, 94, .2), transparent 68%);
    pointer-events: none
}

.hero-copy,
.period-net {
    position: relative;
    z-index: 1
}

.balance-value {
    font-size: clamp(47px, 8vw, 91px);
    line-height: 1;
    font-weight: 650;
    letter-spacing: -.07em;
    margin: 15px 0 11px
}

.hero-note,
.period-net small {
    color: var(--muted);
    margin: 0
}

.period-net {
    display: grid;
    justify-items: end;
    gap: 7px
}

.period-net strong {
    font-size: 28px
}

.text-income {
    color: var(--income-soft) !important
}

.text-expense {
    color: var(--expense-soft) !important
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 18px
}

.metric {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 19px 23px;
    background: var(--surface)
}

.metric>div {
    display: grid;
    gap: 2px
}

.metric span:not(.metric-icon) {
    color: var(--muted);
    font-size: 13px
}

.metric strong {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -.03em
}

.metric-icon {
    width: 35px;
    height: 35px;
    border-radius: 11px;
    display: grid;
    place-items: center
}

.metric-icon.income {
    color: var(--income);
    background: rgba(34, 197, 94, .12)
}

.metric-icon.expense {
    color: var(--expense);
    background: rgba(240, 82, 82, .12)
}

.metric-icon.insight {
    color: var(--lavender);
    background: rgba(167, 139, 250, .13)
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 28px 0
}

.money-action {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 24px 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--text);
    overflow: hidden;
    transition: transform .22s, border .22s, box-shadow .22s
}

.money-action:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow)
}

.money-action:after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    right: -70px;
    top: -80px;
    border-radius: 50%;
    opacity: .15
}

.income-action {
    background: linear-gradient(120deg, rgba(34, 197, 94, .12), var(--card))
}

.income-action:hover {
    border-color: rgba(34, 197, 94, .65)
}

.income-action:after {
    background: var(--income)
}

.expense-action {
    background: linear-gradient(120deg, rgba(240, 82, 82, .12), var(--card))
}

.expense-action:hover {
    border-color: rgba(240, 82, 82, .65)
}

.expense-action:after {
    background: var(--expense)
}

.action-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 20px;
    position: relative;
    z-index: 1
}

.income-action .action-icon {
    background: rgba(34, 197, 94, .2);
    color: var(--income-soft)
}

.expense-action .action-icon {
    background: rgba(240, 82, 82, .2);
    color: var(--expense-soft)
}

.money-action span:nth-child(2) {
    display: grid;
    gap: 3px;
    position: relative;
    z-index: 1
}

.money-action b {
    font-size: 16px
}

.money-action small {
    color: var(--muted)
}

.money-action .arrow {
    margin-left: auto;
    position: relative;
    z-index: 1;
    color: var(--muted)
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, .8fr);
    gap: 18px
}

.section-block,
.snapshot-panel,
.chart-card,
.settings-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(18, 24, 35, .76);
    padding: 28px
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px
}

.section-head h2,
.snapshot-panel h2,
.chart-card h2 {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.04em;
    margin: 0
}

.text-link {
    color: var(--muted);
    font-size: 13px;
    transition: color .2s
}

.text-link:hover {
    color: var(--text)
}

.timeline {
    display: grid
}

.timeline-item {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 13px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(37, 45, 58, .65);
    align-items: start
}

.timeline-item:last-child {
    border-bottom: 0
}

.timeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 7px;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .03)
}

.income-dot {
    background: var(--income)
}

.expense-dot {
    background: var(--expense)
}

.timeline-main {
    display: flex;
    justify-content: space-between;
    gap: 20px
}

.timeline-main div {
    display: grid;
    gap: 3px
}

.timeline-main small,
.timeline-item time {
    color: var(--muted);
    font-size: 12px
}

.timeline-item time {
    font-size: 11px;
    white-space: nowrap
}

.snapshot-panel {
    background: linear-gradient(160deg, rgba(99, 102, 241, .18), rgba(18, 24, 35, .88) 50%)
}

.snapshot-copy {
    color: var(--muted);
    font-size: 14px;
    margin: 14px 0 30px
}

.snapshot-line {
    display: flex;
    justify-content: space-between;
    padding: 13px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    font-size: 13px;
    color: var(--muted)
}

.snapshot-line b {
    font-size: 14px
}

.snapshot-progress {
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
    margin-top: 24px
}

.snapshot-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--lavender);
    box-shadow: 0 0 15px rgba(167, 139, 250, .4)
}

.snapshot-panel>small {
    display: block;
    color: var(--quiet);
    font-size: 11px;
    margin-top: 9px
}

.empty-state {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 75px 20px;
    border: 1px dashed #334054;
    border-radius: 15px
}

.empty-state.compact {
    padding: 45px 20px
}

.empty-state h2,
.empty-state h3 {
    margin: 16px 0 6px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.04em
}

.empty-state p {
    color: var(--muted);
    margin: 0 0 22px
}

.empty-orbit {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--lavender);
    background: rgba(99, 102, 241, .15);
    box-shadow: 0 0 0 9px rgba(99, 102, 241, .04)
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 17px;
    min-height: 46px;
    font-weight: 600;
    transition: transform .2s, box-shadow .2s, background .2s, border .2s;
    color: var(--text)
}

.primary-button {
    background: var(--income);
    color: #07120a;
    box-shadow: 0 9px 24px rgba(34, 197, 94, .18)
}

.primary-button:hover {
    background: #42d976;
    color: #06110a;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(34, 197, 94, .25)
}

.secondary-button {
    border-color: var(--border);
    background: var(--card);
    color: var(--text)
}

.secondary-button:hover {
    border-color: #4b5970;
    background: var(--elevated);
    transform: translateY(-2px)
}

.full-width {
    width: 100%
}

.button-reset {
    border: 0;
    background: none;
    padding: 0
}

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap
}

.search-input {
    border-radius: 11px;
    min-width: 230px;
    flex: 1;
    outline: 0
}

.search-input:focus,
.filter-select:focus,
input:focus,
select:focus {
    border-color: var(--insight);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .17);
    outline: 0
}

.filter-select {
    border-radius: 11px;
    appearance: auto
}

.activity-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 19px 23px;
    background: rgba(18, 24, 35, .72);
    border-bottom: 1px solid rgba(37, 45, 58, .7);
    transition: background .2s
}

.activity-item:last-child {
    border-bottom: 0
}

.activity-item:hover {
    background: var(--elevated)
}

.category-symbol {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--category-color, #6366f1) 18%, transparent);
    font-size: 21px;
    flex: none
}

.activity-details {
    display: grid;
    gap: 3px;
    flex: 1
}

.activity-details span,
.activity-details time {
    font-size: 12px;
    color: var(--muted)
}

.activity-details time {
    font-size: 11px;
    color: var(--quiet)
}

.activity-amount {
    font-size: 15px
}

.icon-button.subtle {
    width: 32px;
    height: 32px
}

.category-columns {
    display: grid;
    gap: 34px
}

.category-section {
    border-top: 1px solid var(--border);
    padding-top: 27px
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 13px
}

.category-tile {
    position: relative;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 15px;
    padding: 20px;
    display: grid;
    gap: 9px;
    min-height: 145px;
    transition: transform .22s, border .22s
}

.category-tile:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--category-color) 60%, var(--border))
}

.category-tile .category-symbol {
    margin-bottom: 6px
}

.category-tile b {
    font-size: 15px
}

.category-tile small {
    font-size: 11px;
    color: var(--muted)
}

.tile-action {
    position: absolute;
    right: 10px;
    top: 10px;
    border: 0;
    background: transparent;
    color: var(--quiet);
    opacity: 0;
    transition: opacity .2s;
    color: var(--muted)
}

.category-tile:hover .tile-action {
    opacity: 1
}

.category-empty {
    border: 1px dashed #334054;
    border-radius: 15px;
    padding: 24px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    align-items: center
}

.settings-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px
}

.settings-card {
    display: grid;
    gap: 22px
}

.settings-card-head {
    display: flex;
    gap: 13px;
    align-items: center
}

.settings-card-head h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0
}

.settings-card-head p {
    font-size: 12px;
    color: var(--muted);
    margin: 3px 0 0
}

.settings-icon {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(34, 197, 94, .14);
    color: var(--income)
}

.settings-icon.insight {
    background: rgba(99, 102, 241, .15);
    color: var(--lavender)
}

.settings-icon.expense {
    background: rgba(240, 82, 82, .15);
    color: var(--expense)
}

form {
    display: grid;
    gap: 16px
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px
}

input,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    padding: 12px 13px;
    min-height: 45px
}

.label-optional,
.field-hint {
    color: var(--quiet);
    font-size: 11px
}

.preference-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    padding: 15px 0;
    color: var(--muted)
}

.preference-row b {
    color: var(--text)
}

.insight-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 18px
}

.insight-summary>div {
    background: var(--card);
    padding: 25px
}

.insight-summary span {
    display: block;
    color: var(--quiet);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .18em;
    margin-bottom: 9px
}

.insight-summary strong {
    font-size: 27px;
    font-weight: 650;
    letter-spacing: -.05em
}

.chart-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px
}

.chart-card {
    min-height: 360px
}

.chart-wrap {
    height: 270px;
    position: relative
}

.insight-copy {
    background: rgba(99, 102, 241, .1);
    border: 1px solid rgba(167, 139, 250, .2);
    border-radius: 14px;
    padding: 21px;
    color: var(--muted);
    display: flex;
    gap: 13px;
    align-items: flex-start;
    margin: 20px 0
}

.insight-copy i {
    color: var(--lavender);
    font-size: 19px
}

.insight-copy p {
    margin: 0
}

.inline-button {
    width: 100%
}

.drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(4px);
    z-index: 40
}

.action-drawer {
    position: fixed;
    z-index: 50;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(460px, 100%);
    padding: 54px 32px 30px;
    background: var(--card);
    border-left: 1px solid var(--border);
    box-shadow: -22px 0 80px rgba(0, 0, 0, .48);
    transform: translateX(100%);
    transition: transform .28s ease;
    overflow-y: auto
}

.action-drawer.open {
    transform: translateX(0)
}

.drawer-backdrop.open {
    display: block
}

.drawer-close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--muted)
}

.action-drawer h2 {
    font-size: 29px;
    font-weight: 650;
    letter-spacing: -.06em;
    margin: 0 0 29px
}

.amount-input {
    display: flex;
    align-items: center;
    gap: 10px
}

.amount-input span {
    font-size: 27px;
    color: var(--income);
    font-weight: 600
}

.amount-input input {
    font-size: 31px;
    font-weight: 650;
    letter-spacing: -.05em;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding-left: 0;
    background: transparent
}

.quick-amounts {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: -5px
}

.quick-amounts button {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    padding: 7px 11px;
    font-size: 12px
}

.quick-amounts button:hover {
    border-color: var(--income);
    color: var(--income-soft)
}

.action-drawer.category-drawer {
    z-index: 55
}

.icon-grid,
.color-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.icon-choice,
.color-choice {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    display: grid;
    place-items: center;
    font-size: 18px
}

.icon-choice:hover,
.icon-choice.selected {
    border-color: var(--insight);
    background: rgba(99, 102, 241, .15)
}

.color-choice {
    background: var(--choice-color);
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--card), 0 0 0 3px transparent
}

.color-choice.selected {
    box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--text)
}

.category-preview {
    display: flex;
    align-items: center;
    gap: 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 15px;
    background: var(--surface)
}

.category-preview>span {
    font-size: 28px
}

.category-preview div {
    display: grid;
    gap: 2px
}

.category-preview small {
    color: var(--muted);
    font-size: 12px
}

.mobile-nav {
    display: none
}

.landing {
    min-height: 100vh;
    background: radial-gradient(circle at 72% 32%, rgba(99, 102, 241, .13), transparent 26rem), radial-gradient(circle at 15% 67%, rgba(34, 197, 94, .07), transparent 23rem), var(--bg)
}

.landing-nav {
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(22px, 6vw, 90px);
    border-bottom: 1px solid rgba(37, 45, 58, .6)
}

.landing-links {
    display: flex;
    align-items: center;
    gap: 27px;
    color: var(--muted);
    font-size: 13px
}

.landing-links a:hover {
    color: var(--text)
}

.compact-button {
    min-height: 40px;
    padding: 9px 13px;
    font-size: 12px
}

.landing-hero {
    max-width: 1250px;
    margin: 0 auto;
    min-height: 670px;
    padding: 92px clamp(22px, 5vw, 72px);
    display: grid;
    grid-template-columns: 1fr .9fr;
    align-items: center;
    gap: 50px
}

.hero-content h1 {
    font-size: clamp(54px, 7vw, 92px);
    line-height: .98;
    letter-spacing: -.085em;
    margin: 18px 0 25px
}

.hero-content h1 em,
.landing-feature em {
    color: var(--income-soft);
    font-style: normal
}

.hero-subtitle {
    max-width: 470px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7
}

.hero-actions {
    display: flex;
    gap: 11px;
    margin-top: 31px;
    flex-wrap: wrap
}

.trust-note {
    display: flex;
    gap: 19px;
    color: var(--quiet);
    font-size: 11px;
    margin-top: 26px
}

.trust-note i {
    color: var(--income);
    margin-right: 5px
}

.flow-visual {
    height: 440px;
    position: relative;
    display: grid;
    place-items: center
}

.glow-orb {
    position: absolute;
    width: 430px;
    height: 430px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, .16), rgba(99, 102, 241, .03) 42%, transparent 69%);
    filter: blur(8px)
}

.balance-orb {
    position: relative;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(167, 139, 250, .4);
    border-radius: 50%;
    display: grid;
    place-content: center;
    text-align: center;
    background: radial-gradient(circle at 50% 35%, rgba(99, 102, 241, .28), rgba(18, 24, 35, .97) 63%);
    box-shadow: 0 0 0 16px rgba(99, 102, 241, .035), 0 20px 70px rgba(0, 0, 0, .45);
    z-index: 2
}

.balance-orb strong {
    font-size: 31px;
    font-weight: 650;
    letter-spacing: -.07em;
    margin: 5px 0
}

.balance-orb small {
    color: var(--muted)
}

.float-pill {
    position: absolute;
    z-index: 3;
    display: grid;
    gap: 1px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(18, 24, 35, .87);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
    animation: float 5s ease-in-out infinite
}

.float-pill span {
    font-weight: 650
}

.float-pill small {
    color: var(--muted);
    font-size: 11px
}

.pill-income {
    top: 48px;
    left: 4%;
    border-color: rgba(34, 197, 94, .5);
    color: var(--income-soft)
}

.pill-expense {
    right: 3%;
    top: 135px;
    border-color: rgba(240, 82, 82, .48);
    color: var(--expense-soft);
    animation-delay: -1.5s
}

.pill-food {
    bottom: 38px;
    left: 14%;
    border-color: rgba(240, 82, 82, .35);
    color: var(--expense-soft);
    animation-delay: -3s
}

.flow-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, .6), transparent);
    width: 180px;
    transform-origin: left
}

.line-left {
    left: 25%;
    top: 31%;
    transform: rotate(28deg)
}

.line-right {
    right: 22%;
    top: 42%;
    transform: rotate(152deg)
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-9px)
    }
}

.landing-section,
.landing-feature {
    max-width: 1090px;
    margin: 0 auto;
    padding: 100px clamp(22px, 5vw, 72px)
}

.landing-section h2,
.landing-feature h2 {
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.06;
    letter-spacing: -.07em;
    margin: 14px 0 52px
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px
}

.steps>div {
    border-top: 1px solid var(--border);
    padding-top: 22px
}

.steps span {
    color: var(--income);
    font-family: monospace
}

.steps h3 {
    font-size: 18px;
    letter-spacing: -.03em;
    margin: 28px 0 10px
}

.steps p,
.feature-note p {
    color: var(--muted);
    line-height: 1.7
}

.landing-feature {
    display: flex;
    justify-content: space-between;
    gap: 50px;
    border-top: 1px solid var(--border);
    padding-bottom: 130px
}

.landing-feature h2 {
    margin-bottom: 0
}

.feature-note {
    max-width: 300px;
    padding-top: 25px
}

.feature-note i {
    color: var(--lavender);
    font-size: 24px
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
    background: radial-gradient(circle at 50% 15%, rgba(99, 102, 241, .12), transparent 30rem), var(--bg)
}

.auth-brand {
    position: absolute;
    top: 32px;
    left: clamp(25px, 6vw, 80px)
}

.auth-card {
    width: min(450px, 100%);
    border: 1px solid var(--border);
    background: rgba(18, 24, 35, .86);
    border-radius: 22px;
    padding: 38px;
    box-shadow: var(--shadow)
}

.auth-card h1 {
    font-size: 36px;
    font-weight: 650;
    line-height: 1.05;
    letter-spacing: -.07em;
    margin: 0 0 12px
}

.auth-card .subheading {
    margin-bottom: 29px
}

.auth-switch {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin: 25px 0 0
}

.auth-switch a {
    color: var(--income-soft)
}

.form-error {
    color: var(--expense-soft);
    background: rgba(240, 82, 82, .11);
    border: 1px solid rgba(240, 82, 82, .28);
    padding: 11px 13px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px
}

.toast-region {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    display: grid;
    gap: 8px
}

.toast-message {
    background: var(--elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--income);
    border-radius: 11px;
    padding: 13px 17px;
    box-shadow: var(--shadow);
    animation: toast-in .25s ease;
    color: var(--text);
    font-size: 13px
}

.toast-message.error {
    border-left-color: var(--expense)
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@media(max-width:900px) {
    .desktop-nav {
        gap: 0
    }

    .nav-link {
        font-size: 0
    }

    .nav-link i {
        font-size: 16px
    }

    .landing-hero {
        grid-template-columns: 1fr;
        padding-top: 70px
    }

    .flow-visual {
        height: 390px
    }

    .content-grid,
    .chart-grid {
        grid-template-columns: 1fr
    }

    .settings-layout {
        grid-template-columns: 1fr
    }

    .page-wrap {
        padding-top: 42px
    }
}

@media(max-width:650px) {
    body {
        font-size: 14px
    }

    .topbar {
        height: 66px;
        padding: 0 17px;
        gap: 12px
    }

    .desktop-nav {
        display: none
    }

    .profile-menu {
        margin-left: auto
    }

    .page-wrap {
        width: calc(100% - 28px);
        padding: 32px 0 110px
    }

    .page-heading {
        display: grid;
        gap: 18px;
        margin-bottom: 24px
    }

    .page-heading h1 {
        font-size: 36px
    }

    .period-chip {
        justify-self: start
    }

    .balance-hero {
        display: grid;
        gap: 28px;
        padding: 28px 23px;
        min-height: 0
    }

    .balance-value {
        font-size: 50px
    }

    .period-net {
        justify-items: start
    }

    .metric-row {
        grid-template-columns: 1fr
    }

    .metric {
        padding: 16px 19px
    }

    .action-grid {
        grid-template-columns: 1fr;
        gap: 11px;
        margin: 20px 0
    }

    .money-action {
        padding: 19px
    }

    .section-block,
    .snapshot-panel,
    .chart-card,
    .settings-card {
        padding: 21px
    }

    .timeline-main {
        display: grid;
        gap: 4px
    }

    .activity-item {
        padding: 16px 13px;
        gap: 10px
    }

    .activity-amount {
        font-size: 13px
    }

    .activity-item .icon-button {
        width: 27px
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .category-tile {
        padding: 15px;
        min-height: 132px
    }

    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 72px;
        z-index: 30;
        justify-content: space-around;
        align-items: center;
        background: rgba(13, 17, 26, .94);
        border-top: 1px solid var(--border);
        backdrop-filter: blur(20px);
        padding-bottom: env(safe-area-inset-bottom)
    }

    .mobile-nav-link {
        display: grid;
        justify-items: center;
        gap: 4px;
        color: var(--quiet);
        font-size: 10px;
        min-width: 54px;
        padding: 8px 5px
    }

    .mobile-nav-link i {
        font-size: 18px
    }

    .mobile-nav-link.active {
        color: var(--income)
    }

    .landing-nav {
        height: 70px;
        padding: 0 20px
    }

    .landing-links a:not(.nav-login):not(.compact-button) {
        display: none
    }

    .landing-links {
        gap: 9px
    }

    .landing-hero {
        padding: 62px 22px 30px;
        min-height: auto
    }

    .hero-content h1 {
        font-size: 56px
    }

    .hero-subtitle {
        font-size: 15px
    }

    .flow-visual {
        height: 340px;
        transform: scale(.86);
        margin: -9px -32px
    }

    .landing-section,
    .landing-feature {
        padding: 70px 22px
    }

    .landing-section h2,
    .landing-feature h2 {
        font-size: 40px;
        margin-bottom: 38px
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 29px
    }

    .steps h3 {
        margin-top: 14px
    }

    .landing-feature {
        display: grid;
        gap: 20px
    }

    .auth-card {
        padding: 26px 21px
    }

    .auth-card h1 {
        font-size: 31px
    }

    .auth-brand {
        top: 22px;
        left: 22px
    }

    .filter-bar {
        display: grid;
        grid-template-columns: 1fr 1fr
    }

    .search-input {
        min-width: 0;
        grid-column: 1/-1
    }

    .filter-bar .period-chip {
        justify-self: stretch;
        justify-content: center
    }

    .insight-summary strong {
        font-size: 20px
    }

    .insight-summary>div {
        padding: 17px 12px
    }

    .insight-summary span {
        font-size: 8px
    }

    .toast-region {
        left: 14px;
        right: 14px;
        bottom: 84px
    }

    .toast-message {
        width: 100%
    }
}

/* ═══════════════════════════════════════════
   Category Selector (Transaction Drawer)
   ═══════════════════════════════════════════ */

.cat-selector {
    display: grid;
    gap: 14px
}

.cat-label {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
    font-weight: 600
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 10px
}

.cat-card {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 18px 10px 15px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all .22s ease;
    min-height: 88px;
    text-align: center;
    position: relative
}

.cat-card:hover {
    border-color: color-mix(in srgb, var(--cat-color, var(--insight)) 55%, var(--border));
    transform: translateY(-3px);
    background: color-mix(in srgb, var(--cat-color, var(--insight)) 8%, var(--surface));
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18)
}

.cat-card:active {
    transform: translateY(0);
    transition-duration: .08s
}

.cat-card-icon {
    font-size: 28px;
    line-height: 1;
    transition: transform .2s
}

.cat-card:hover .cat-card-icon {
    transform: scale(1.12)
}

.cat-card-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--muted);
    transition: color .2s
}

.cat-card:hover .cat-card-name {
    color: var(--text)
}

.cat-card-add {
    border-style: dashed;
    border-color: rgba(37, 45, 58, .9);
    color: var(--quiet)
}

.cat-card-add:hover {
    color: var(--text);
    border-color: var(--insight);
    background: rgba(99, 102, 241, .08)
}

.cat-card-add .cat-card-icon {
    font-size: 20px;
    color: var(--quiet)
}

.cat-card-add:hover .cat-card-icon {
    color: var(--lavender)
}

.cat-card-parent-only {
    border-style: dashed;
    opacity: .8
}

.cat-card-parent-only:hover {
    opacity: 1
}

/* ─── Subcategory panel ─── */

.cat-sub {
    animation: catSlideIn .22s ease
}

@keyframes catSlideIn {
    from {
        opacity: 0;
        transform: translateX(16px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.cat-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 13px;
    padding: 6px 0;
    cursor: pointer;
    margin-bottom: 4px;
    transition: color .2s
}

.cat-back:hover {
    color: var(--income-soft)
}

/* ─── Chosen category display ─── */

.cat-chosen {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1.5px solid color-mix(in srgb, var(--income) 40%, var(--border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--income) 6%, var(--surface));
    animation: catSlideIn .2s ease
}

.cat-chosen-info {
    display: flex;
    align-items: center;
    gap: 12px
}

.cat-chosen-icon {
    font-size: 26px;
    line-height: 1
}

.cat-chosen-info b {
    display: block;
    font-size: 14px
}

.cat-chosen-path {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px
}

.cat-change {
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s
}

.cat-change:hover {
    border-color: var(--insight);
    color: var(--text);
    background: rgba(99, 102, 241, .08)
}

/* ═══════════════════════════════════════════
   Category Tree (Management Page)
   ═══════════════════════════════════════════ */

.cat-tree-list {
    display: grid;
    gap: 8px
}

.cat-tree-item {
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--card);
    overflow: hidden;
    transition: border-color .2s
}

.cat-tree-item:hover {
    border-color: color-mix(in srgb, var(--category-color, var(--insight)) 45%, var(--border))
}

.cat-tree-parent {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    background: var(--card)
}

.cat-tree-parent .category-symbol {
    flex: none
}

.cat-tree-info {
    flex: 1;
    display: grid;
    gap: 3px
}

.cat-tree-info b {
    font-size: 15px
}

.cat-tree-info small {
    font-size: 11px;
    color: var(--muted)
}

.cat-tree-actions {
    display: flex;
    gap: 4px;
    align-items: center
}

.cat-tree-children {
    padding: 0 16px 14px;
    display: grid;
    gap: 4px;
    border-top: 1px solid rgba(37, 45, 58, .6);
    margin-top: -1px;
    padding-top: 12px
}

.cat-tree-child {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background .2s
}

.cat-tree-child:hover {
    background: rgba(255, 255, 255, .04)
}

.tree-connector {
    width: 16px;
    height: 16px;
    border-left: 1.5px solid var(--border);
    border-bottom: 1.5px solid var(--border);
    border-radius: 0 0 0 6px;
    flex: none;
    margin-left: 6px
}

.cat-child-icon {
    font-size: 18px;
    flex: none
}

.cat-child-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500
}

.cat-tree-child .cat-tree-actions {
    opacity: 0;
    transition: opacity .2s
}

.cat-tree-child:hover .cat-tree-actions {
    opacity: 1
}

.cat-add-sub-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px dashed rgba(37, 45, 58, .8);
    border-radius: 10px;
    background: transparent;
    color: var(--quiet);
    padding: 10px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
    margin-top: 4px
}

.cat-add-sub-inline:hover {
    border-color: var(--insight);
    color: var(--lavender);
    background: rgba(99, 102, 241, .06)
}

/* ═══════════════════════════════════════════
   Mobile Responsive — Category UI
   ═══════════════════════════════════════════ */

@media(max-width:650px) {
    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px
    }

    .cat-card {
        padding: 14px 8px 12px;
        min-height: 80px;
        border-radius: 12px
    }

    .cat-card-icon {
        font-size: 24px
    }

    .cat-card-name {
        font-size: 10px
    }

    .cat-chosen {
        padding: 12px 13px
    }

    .cat-chosen-icon {
        font-size: 22px
    }

    .cat-tree-parent {
        padding: 14px 12px;
        gap: 10px
    }

    .cat-tree-info b {
        font-size: 14px
    }

    .cat-tree-child .cat-tree-actions {
        opacity: 1
    }

    .cat-tree-child {
        padding: 8px 8px
    }
}

/* ═══════════════════════════════════════════
   Transaction Action Menu (three-dot dropdown)
   ═══════════════════════════════════════════ */

.tx-action-wrap {
    position: relative;
    flex: none
}

.tx-action-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 25;
    min-width: 200px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--card);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .45);
    padding: 6px;
    animation: txMenuIn .15s ease
}

.tx-action-menu.open {
    display: block
}

@keyframes txMenuIn {
    from { opacity: 0; transform: translateY(-4px) scale(.96) }
    to { opacity: 1; transform: none }
}

.tx-action-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s
}

.tx-action-menu button:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--text)
}

.tx-action-menu button i {
    font-size: 15px;
    width: 18px;
    text-align: center
}

.tx-action-menu .tx-action-danger {
    color: var(--expense-soft)
}

.tx-action-menu .tx-action-danger:hover {
    background: rgba(240, 82, 82, .12);
    color: var(--expense)
}

/* ═══════════════════════════════════════════
   Modal System
   ═══════════════════════════════════════════ */

.modal-backdrop-mt {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(6px);
    z-index: 60
}

.modal-backdrop-mt.open {
    display: block;
    animation: fadeIn .2s ease
}

.modal-mt {
    display: none;
    position: fixed;
    z-index: 65;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(480px, calc(100% - 32px));
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 32px 80px rgba(0, 0, 0, .55)
}

.modal-mt.open {
    display: block;
    animation: modalIn .22s ease
}

@keyframes fadeIn {
    from { opacity: 0 }
    to { opacity: 1 }
}

@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -48%) scale(.96) }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1) }
}

.modal-mt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 0
}

.modal-mt-header h3 {
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -.03em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px
}

.modal-mt-danger .modal-mt-header h3 {
    color: var(--expense-soft)
}

.modal-mt-danger .modal-mt-header h3 i {
    color: var(--expense)
}

.modal-mt-body {
    padding: 20px 24px
}

.modal-mt-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 22px;
    border-top: 1px solid var(--border);
    padding-top: 18px
}

/* ─── Danger button ─── */

.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(240, 82, 82, .4);
    border-radius: 12px;
    padding: 12px 20px;
    min-height: 46px;
    font-weight: 600;
    background: rgba(240, 82, 82, .15);
    color: var(--expense-soft);
    transition: all .2s;
    cursor: pointer
}

.danger-button:hover:not(:disabled) {
    background: var(--expense);
    color: #fff;
    border-color: var(--expense);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(240, 82, 82, .25)
}

.danger-button:disabled {
    opacity: .4;
    cursor: not-allowed
}

/* ─── Transaction View Details ─── */

.tx-detail-card {
    display: grid;
    gap: 0
}

.tx-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(37, 45, 58, .6);
    font-size: 14px
}

.tx-detail-row:last-child {
    border-bottom: 0
}

.tx-detail-row.hero {
    display: grid;
    gap: 8px;
    text-align: center;
    padding: 20px 0 24px;
    border-bottom: 1px solid var(--border)
}

.tx-detail-category {
    font-size: 16px;
    font-weight: 600
}

.tx-detail-amount {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.05em
}

.tx-detail-label {
    color: var(--muted);
    font-size: 13px
}

/* ─── Transaction Delete Preview ─── */

.del-tx-preview {
    text-align: center;
    padding: 18px 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    margin-bottom: 16px
}

.del-tx-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px
}

.del-tx-amount {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.04em
}

.del-tx-date {
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px
}

.del-warning-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--expense-soft);
    font-size: 13px;
    margin: 0;
    padding: 12px;
    border-radius: 10px;
    background: rgba(240, 82, 82, .08);
    border: 1px solid rgba(240, 82, 82, .18)
}

.del-warning-note i {
    color: var(--expense);
    font-size: 16px;
    flex: none;
    margin-top: 1px
}

/* ═══════════════════════════════════════════
   Archived Categories Page
   ═══════════════════════════════════════════ */

.archived-categories-link-wrap {
    margin-top: 28px
}

.archived-categories-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
    text-decoration: none
}

.archived-categories-link:hover {
    border-color: var(--quiet);
    color: var(--text);
    background: var(--elevated);
    transform: translateY(-2px)
}

.archived-categories-link i:first-child {
    font-size: 16px;
    color: var(--quiet)
}

.archived-categories-link i:last-child {
    margin-left: auto;
    font-size: 12px;
    color: var(--quiet)
}

.archived-count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(240, 82, 82, .18);
    color: var(--expense-soft);
    font-size: 11px;
    font-weight: 700
}

/* ─── Status Badges ─── */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase
}

.status-badge.archived {
    color: var(--quiet)
}

.status-badge.active {
    color: var(--income)
}

/* ─── Reactivate & Delete Forever Buttons ─── */

.reactivate-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid rgba(34, 197, 94, .3);
    border-radius: 10px;
    background: rgba(34, 197, 94, .08);
    color: var(--income-soft);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap
}

.reactivate-button:hover:not(:disabled) {
    background: rgba(34, 197, 94, .18);
    border-color: var(--income);
    color: var(--income);
    transform: translateY(-1px)
}

.reactivate-button:disabled {
    opacity: .4;
    cursor: not-allowed
}

.reactivate-button.small {
    padding: 5px 9px;
    font-size: 11px;
    border-radius: 8px
}

.delete-forever-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid rgba(240, 82, 82, .25);
    border-radius: 10px;
    background: rgba(240, 82, 82, .06);
    color: var(--expense-soft);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap
}

.delete-forever-button:hover {
    background: rgba(240, 82, 82, .15);
    border-color: var(--expense);
    color: var(--expense);
    transform: translateY(-1px)
}

.delete-forever-button.small {
    padding: 5px 9px;
    font-size: 11px;
    border-radius: 8px
}

/* ─── Category Delete Modal Content ─── */

.del-warning-box {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 18px 20px;
    margin-bottom: 16px
}

.del-warning-box p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px
}

.del-impact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px
}

.del-impact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(37, 45, 58, .5);
    font-size: 13px;
    color: var(--text)
}

.del-impact-list li:last-child {
    border-bottom: 0
}

.del-impact-list li i {
    color: var(--expense-soft);
    font-size: 15px;
    width: 18px;
    text-align: center
}

.del-type-confirm {
    margin-top: 16px
}

.del-type-confirm label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px
}

.del-type-confirm input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .03em
}

.del-type-confirm input:focus {
    border-color: var(--expense);
    box-shadow: 0 0 0 3px rgba(240, 82, 82, .15);
    outline: 0
}

.text-muted {
    color: var(--muted) !important;
    font-size: 11px
}

/* ─── Archived page - cat-tree-child actions always visible ─── */

.archived-cat-item .cat-tree-child .cat-tree-actions {
    opacity: 1
}

.archived-cat-item .cat-tree-actions {
    gap: 8px;
    flex-wrap: wrap
}

/* ═══════════════════════════════════════════
   Responsive — New Components
   ═══════════════════════════════════════════ */

@media(max-width:650px) {
    .tx-action-menu {
        right: -8px;
        min-width: 180px
    }

    .modal-mt {
        width: calc(100% - 24px)
    }

    .modal-mt-body {
        padding: 16px 18px
    }

    .modal-mt-footer {
        padding: 0 18px 18px;
        flex-direction: column
    }

    .modal-mt-footer button {
        width: 100%
    }

    .tx-detail-amount {
        font-size: 26px
    }

    .archived-categories-link-wrap {
        margin-top: 20px
    }

    .cat-tree-actions {
        flex-wrap: wrap
    }

    .reactivate-button,
    .delete-forever-button {
        padding: 7px 10px;
        font-size: 11px
    }

    .del-tx-amount {
        font-size: 22px
    }
}