:root {
    --wallet-bg: #f4faf9;
    --wallet-panel: #ffffff;
    --wallet-text: #113047;
    --wallet-muted: #78909c;
    --wallet-primary: #0aa978;
    --wallet-primary-dark: #087f61;
    --wallet-primary-soft: #e1f6ef;
    --wallet-danger: #ef5360;
    --wallet-border: #deeceb;
    --wallet-shadow: 0 10px 28px rgba(32, 76, 79, .07);
}

body.wallet-dashboard-body {
    margin: 0;
    background: var(--wallet-bg);
    color: var(--wallet-text);
    font-family: Inter, Montserrat, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.wallet-dashboard-body *,
.wallet-dashboard-body *::before,
.wallet-dashboard-body *::after { box-sizing: border-box; }
.wallet-dashboard-body button,
.wallet-dashboard-body input,
.wallet-dashboard-body select { font: inherit; }
.wallet-dashboard-body button,
.wallet-dashboard-body a { -webkit-tap-highlight-color: transparent; }
.wallet-dashboard-body button { color: inherit; }
.wallet-dashboard-body a { color: inherit; text-decoration: none; }
.wallet-dashboard-body [hidden] { display: none !important; }
.wallet-dashboard-body svg { display: block; }

.wallet-app {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    min-height: 100vh;
}

.wallet-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    padding: 27px 20px 22px;
    background: #f0faf7;
    border-right: 1px solid rgba(195, 223, 219, .72);
    z-index: 20;
}

.wallet-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 10px 28px;
}
.wallet-brand__mark { color: #3859e8; font-size: 30px; line-height: 1; }
.wallet-brand strong { display: block; font-size: 20px; letter-spacing: -.5px; }
.wallet-brand small { display: block; margin-top: 1px; color: #73909b; font-size: 9px; font-weight: 500; }

.wallet-nav { display: grid; gap: 8px; }
.wallet-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 0 15px;
    border-radius: 13px;
    color: #315367;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.wallet-nav a:hover,
.wallet-nav a:focus-visible { background: rgba(213, 241, 232, .7); color: var(--wallet-primary-dark); transform: translateX(2px); outline: none; }
.wallet-nav a.is-active { color: #087b59; background: #d9f3ea; box-shadow: inset 3px 0 var(--wallet-primary); }
.wallet-nav svg { width: 19px; height: 19px; flex: 0 0 auto; }

.wallet-sidebar__quote {
    margin: auto 9px 18px;
    padding: 16px;
    border: 1px solid #d7ebe6;
    border-radius: 14px;
    background: rgba(255,255,255,.64);
    color: #53727f;
    font-size: 12px;
    font-style: normal;
}
.wallet-sidebar__quote span { display: block; margin-top: 8px; }
.wallet-sidebar__version { padding: 0 12px; color: #91a6ac; font-size: 9px; line-height: 1.65; }

.wallet-main { min-width: 0; }
.wallet-topbar {
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 9px clamp(20px, 3vw, 48px);
    background: rgba(255,255,255,.91);
    border-bottom: 1px solid #e5efee;
    backdrop-filter: blur(14px);
}
.wallet-search {
    display: flex;
    align-items: center;
    gap: 9px;
    width: min(420px, 42vw);
    height: 38px;
    padding: 0 14px;
    border: 1px solid #e2eceb;
    border-radius: 11px;
    background: #f7fbfb;
    color: #75909b;
}
.wallet-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--wallet-text); font-size: 12px; }
.wallet-search input::placeholder { color: #9bb0b6; }
.wallet-topbar__date { display: flex; align-items: center; gap: 8px; margin-left: auto; color: #66828e; font-size: 11px; white-space: nowrap; }
.wallet-notification { position: relative; width: 38px; height: 38px; margin-left: 22px; border: 0; border-radius: 50%; background: #f3f8f8; cursor: pointer; }
.wallet-notification i { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #ef5360; }
.wallet-user { display: flex; align-items: center; gap: 8px; margin-left: 13px; font-size: 11px; }
.wallet-user > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(145deg,#d8f5ea,#cce7ff); color: #087f61; font-weight: 800; }
.wallet-user > b { color: #8da1a7; }

.wallet-content { width: min(100%, 1490px); margin: 0 auto; padding: 22px clamp(20px, 3vw, 48px) 48px; }
.wallet-breadcrumb { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; color: #8aa0a7; font-size: 11px; }
.wallet-breadcrumb strong { color: #496a78; }
.wallet-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.wallet-page-header h1 { margin: 0; color: #123248; font-size: clamp(26px, 2.3vw, 34px); line-height: 1.15; letter-spacing: -.8px; }
.wallet-page-header p { margin: 7px 0 0; color: #78909c; font-size: 13px; }

.wallet-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.wallet-button:hover { transform: translateY(-1px); }
.wallet-button:focus-visible { outline: 3px solid rgba(10,169,120,.2); outline-offset: 2px; }
.wallet-button--primary { background: var(--wallet-primary); color: #fff !important; box-shadow: 0 8px 18px rgba(10,169,120,.18); }
.wallet-button--primary:hover { background: #07976b; box-shadow: 0 10px 22px rgba(10,169,120,.24); }
.wallet-button--soft { background: #e8f8f2; color: #07805d !important; }
.wallet-button--ghost { border-color: #dbe8e7; background: #fff; }

.wallet-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.wallet-summary-card {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 110px;
    padding: 18px;
    border: 1px solid rgba(222,236,235,.9);
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    box-shadow: var(--wallet-shadow);
}
.wallet-summary-card__icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; margin-right: 13px; border-radius: 12px; background: #e9f3ff; color: #3b82f6; font-size: 20px; font-weight: 800; }
.wallet-summary-card--income .wallet-summary-card__icon { background: #def7ed; color: #0aa978; }
.wallet-summary-card--expense .wallet-summary-card__icon { background: #fff0f1; color: #ef5360; }
.wallet-summary-card--difference .wallet-summary-card__icon { background: #f0eafe; color: #7b52d5; }
.wallet-summary-card > div:last-child { min-width: 0; }
.wallet-summary-card span { display: block; margin-bottom: 4px; color: #79919b; font-size: 10px; font-weight: 650; }
.wallet-summary-card strong { display: block; overflow-wrap: anywhere; color: #113047; font-size: clamp(17px,1.35vw,22px); line-height: 1.25; letter-spacing: -.45px; }
.wallet-summary-card small { display: block; margin-top: 5px; color: #96a9ae; font-size: 9px; }
.wallet-summary-card strong.is-negative,
.wallet-transaction-amount.is-negative { color: var(--wallet-danger); }
.wallet-data-note { margin: 0 0 18px; padding: 10px 14px; border: 1px solid #d9eee7; border-radius: 11px; background: #ebf8f3; color: #51736f; font-size: 11px; }

.wallet-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .95fr); gap: 18px; align-items: start; }
.wallet-panel { min-width: 0; padding: 21px; border: 1px solid rgba(220,235,233,.92); border-radius: 17px; background: rgba(255,255,255,.96); box-shadow: var(--wallet-shadow); }
.wallet-section-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.wallet-section-heading h2 { margin: 0; color: #18374a; font-size: 16px; line-height: 1.35; letter-spacing: -.25px; }
.wallet-section-heading p { margin: 4px 0 0; color: #859ba3; font-size: 10px; }
.wallet-section-heading--inline { align-items: center; }
.wallet-section-heading select { height: 34px; max-width: 130px; padding: 0 28px 0 10px; border: 1px solid #dce8e7; border-radius: 9px; background: #fff; color: #54717e; font-size: 10px; outline: none; }
.wallet-icon-button,
.wallet-text-button { border: 0; background: transparent; color: #76909a; cursor: pointer; }
.wallet-text-button { color: #07805d; font-size: 10px; font-weight: 750; white-space: nowrap; }

.wallet-account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.wallet-account-card { min-width: 0; overflow: hidden; border: 1px solid #dfebea; border-radius: 15px; background: #fff; box-shadow: 0 7px 20px rgba(35,71,75,.06); transition: transform .2s ease, box-shadow .2s ease; }
.wallet-account-card:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(35,71,75,.1); }
.wallet-account-card.is-inactive { filter: saturate(.45); opacity: .7; }
.wallet-account-card::before { display: block; height: 3px; background: var(--wallet-color); content: ""; }
.wallet-account-card header { display: flex; align-items: center; min-width: 0; padding: 15px 15px 11px; }
.wallet-account-card header > div { min-width: 0; }
.wallet-account-card h3 { overflow: hidden; margin: 0; color: #173449; font-size: 13px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.wallet-account-card header p { overflow: hidden; margin: 2px 0 0; color: #8ba0a7; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.wallet-account-card header button { align-self: flex-start; margin-left: auto; padding: 0; border: 0; background: transparent; color: #8ca0a6; cursor: pointer; }
.wallet-account-logo { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; margin-right: 9px; border-radius: 10px; background: color-mix(in srgb, var(--wallet-color) 13%, white); color: var(--wallet-color); font-size: 14px; font-weight: 850; }
.wallet-account-card__balance { padding: 1px 15px 8px; }
.wallet-account-card__balance span { display: block; color: #91a4aa; font-size: 9px; }
.wallet-account-card__balance strong { display: block; overflow-wrap: anywhere; margin-top: 3px; color: #113047; font-size: clamp(17px, 1.35vw, 21px); line-height: 1.25; letter-spacing: -.45px; }
.wallet-account-card__trend { position: relative; min-height: 51px; padding: 4px 15px 10px; overflow: hidden; }
.wallet-account-card__trend > span { position: relative; z-index: 2; color: #07966c; font-size: 9px; font-weight: 750; }
.wallet-account-card__trend > span.is-negative { color: var(--wallet-danger); }
.wallet-account-card__trend small { position: relative; z-index: 2; color: #98aaaf; font-size: 8px; }
.wallet-account-card__trend svg { position: absolute; right: 10px; bottom: 3px; width: 44%; height: 36px; }
.wallet-account-card__trend polyline { fill: none; stroke: var(--wallet-color); stroke-width: 2; vector-effect: non-scaling-stroke; }
.wallet-account-card footer { display: flex; align-items: center; justify-content: space-between; min-height: 39px; padding: 0 15px; border-top: 1px solid #edf3f2; }
.wallet-account-card footer button { padding: 0; border: 0; background: transparent; color: #647f8a; font-size: 9px; font-weight: 700; cursor: pointer; }
.wallet-account-card footer button:last-child { color: var(--wallet-primary-dark); }

.wallet-panel--composition { min-height: 345px; }
.wallet-donut-wrap { position: relative; height: 185px; }
.wallet-donut-wrap canvas { position: relative; z-index: 1; }
.wallet-donut-wrap > div { position: absolute; top: 50%; left: 50%; z-index: 2; width: 104px; text-align: center; transform: translate(-50%,-50%); pointer-events: none; }
.wallet-donut-wrap span { display: block; color: #8ba0a7; font-size: 9px; }
.wallet-donut-wrap strong { display: block; overflow-wrap: anywhere; margin-top: 3px; font-size: 13px; }
.wallet-chart-legend { display: grid; gap: 8px; margin-top: 7px; }
.wallet-chart-legend span { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; color: #617d88; font-size: 9px; }
.wallet-chart-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--legend-color); }
.wallet-chart-legend strong { color: #244658; font-size: 9px; }

.wallet-panel--chart { min-height: 315px; }
.wallet-line-chart { position: relative; height: 230px; }
.wallet-panel--transactions { min-height: 315px; }
.wallet-transaction-table-wrap { width: 100%; overflow-x: auto; }
.wallet-transaction-table { width: 100%; min-width: 530px; border-collapse: collapse; table-layout: auto; }
.wallet-transaction-table th { padding: 7px 8px; border-bottom: 1px solid #e6efee; color: #8aa0a7; font-size: 8px; text-align: left; text-transform: uppercase; white-space: nowrap; }
.wallet-transaction-table td { padding: 11px 8px; border-bottom: 1px solid #edf3f2; color: #496876; font-size: 9px; vertical-align: middle; }
.wallet-transaction-table tr:last-child td { border-bottom: 0; }
.wallet-transaction-table td:nth-child(2) { white-space: nowrap; }
.wallet-transaction-amount { color: #07966c !important; font-weight: 750; white-space: nowrap; }
.wallet-transaction-amount.is-negative { color: var(--wallet-danger) !important; }
.wallet-transaction-wallet { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 7px; border-radius: 7px; background: #e9f3ff; color: #3b82f6; font-weight: 800; }
.wallet-transaction-wallet--techcombank { background: #fff0f1; color: #ef5360; }
.wallet-transaction-wallet--other { background: #e3f7ef; color: #0aa978; }
.wallet-type-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 3px 8px; border-radius: 999px; background: #dcf5eb; color: #07815e; font-size: 8px; font-weight: 750; white-space: nowrap; }
.wallet-type-badge--expense { background: #ffeaec; color: #d94351; }

.wallet-empty-state { display: grid; place-items: center; min-height: 202px; padding: 24px; border: 1px dashed #d8e7e5; border-radius: 13px; background: #f9fcfc; text-align: center; }
.wallet-empty-state > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #e7f6f1; color: #0a9d71; font-size: 18px; }
.wallet-empty-state strong { margin-top: 8px; font-size: 12px; }
.wallet-empty-state p { max-width: 330px; margin: 4px 0 0; color: #8aa0a7; font-size: 9px; }
.wallet-empty-state a { margin-top: 9px; color: #07805d; font-size: 9px; font-weight: 750; }

.wallet-panel--goals { grid-column: 1 / -1; }
.wallet-goal-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.wallet-goal-card { padding: 15px; border: 1px solid #e2edec; border-radius: 13px; background: #fbfdfd; }
.wallet-goal-card > div { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 7px; }
.wallet-goal-card > div > span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb,var(--goal-color) 13%,white); color: var(--goal-color); }
.wallet-goal-card > div > strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.wallet-goal-card > div > b { color: var(--goal-color); font-size: 10px; }
.wallet-goal-card p { margin: 11px 0 8px; color: #82979f; font-size: 9px; }
.wallet-goal-card p strong { color: #294b5b; }
.wallet-goal-card > i { display: block; height: 5px; overflow: hidden; border-radius: 999px; background: #e9f0ef; }
.wallet-goal-card > i b { display: block; height: 100%; border-radius: inherit; background: var(--goal-color); }
.wallet-empty-state--compact { min-height: 135px; }

.wallet-modal { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 20px; }
.wallet-modal__backdrop { position: absolute; inset: 0; background: rgba(11,36,45,.46); backdrop-filter: blur(4px); }
.wallet-modal__dialog { position: relative; z-index: 1; width: min(100%, 520px); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid rgba(255,255,255,.72); border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(13,47,58,.22); }
.wallet-modal__dialog > header { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid #e5efee; }
.wallet-modal__dialog > header > div { display: flex; align-items: center; gap: 11px; }
.wallet-modal__dialog > header > div > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #e1f6ef; color: #07805d; font-size: 20px; }
.wallet-modal__dialog h2 { margin: 0; font-size: 17px; }
.wallet-modal__dialog header p { margin: 2px 0 0; color: #849aa2; font-size: 10px; }
.wallet-modal__dialog > header > button { padding: 0; border: 0; background: transparent; color: #78909c; font-size: 24px; line-height: 1; cursor: pointer; }
.wallet-modal form { display: grid; gap: 14px; padding: 20px 22px 22px; }
.wallet-modal form > label,
.wallet-modal__row > label { display: grid; gap: 6px; }
.wallet-modal label > span { color: #496976; font-size: 10px; font-weight: 700; }
.wallet-modal label small { color: #9aabb0; font-weight: 500; }
.wallet-modal input:not([type="checkbox"]),
.wallet-modal select { width: 100%; height: 41px; padding: 0 12px; border: 1px solid #dbe8e7; border-radius: 10px; background: #fbfdfd; color: #18374a; outline: none; }
.wallet-modal input:focus,
.wallet-modal select:focus { border-color: #6acdb0; box-shadow: 0 0 0 3px rgba(10,169,120,.11); }
.wallet-field-suffix { position: relative; }
.wallet-field-suffix input { padding-right: 40px !important; }
.wallet-field-suffix i { position: absolute; top: 50%; right: 13px; color: #79919b; font-style: normal; transform: translateY(-50%); }
.wallet-modal__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.wallet-modal input[type="color"] { padding: 5px; }
.wallet-switch-field { grid-template-columns: auto 34px 1fr; align-items: center; }
.wallet-switch-field > span { grid-column: 1 / -1; }
.wallet-switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.wallet-switch-field i { position: relative; width: 34px; height: 19px; border-radius: 999px; background: #cfdcda; transition: background .2s; }
.wallet-switch-field i::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); content: ""; transition: transform .2s; }
.wallet-switch-field input:checked + i { background: var(--wallet-primary); }
.wallet-switch-field input:checked + i::after { transform: translateX(15px); }
.wallet-switch-field b { color: #69838d; font-size: 10px; }
.wallet-form-message { min-height: 18px; margin: 0; font-size: 10px; }
.wallet-form-message.is-success { color: #07805d; }
.wallet-form-message.is-error { color: #d94351; }
.wallet-modal form footer { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.wallet-modal-open { overflow: hidden; }

@media (max-width: 1200px) {
    .wallet-app { grid-template-columns: 202px minmax(0,1fr); }
    .wallet-sidebar { padding-inline: 14px; }
    .wallet-dashboard-grid { grid-template-columns: minmax(0,1.45fr) minmax(270px,1fr); }
    .wallet-account-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .wallet-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
    .wallet-app { display: block; }
    .wallet-sidebar { position: relative; width: 100%; height: auto; padding: 12px 18px; border-right: 0; border-bottom: 1px solid #dcebe8; }
    .wallet-brand { padding: 0 4px 12px; }
    .wallet-brand small,
    .wallet-sidebar__quote,
    .wallet-sidebar__version { display: none; }
    .wallet-nav { display: flex; gap: 6px; padding-bottom: 3px; overflow-x: auto; scrollbar-width: thin; }
    .wallet-nav a { flex: 0 0 auto; min-height: 39px; padding: 0 12px; font-size: 11px; white-space: nowrap; }
    .wallet-nav svg { width: 16px; height: 16px; }
    .wallet-topbar { min-height: 57px; padding-inline: 20px; }
    .wallet-user strong { display: none; }
    .wallet-content { padding: 18px 20px 36px; }
    .wallet-dashboard-grid { grid-template-columns: minmax(0,1fr); }
    .wallet-panel--composition { grid-row: auto; }
    .wallet-panel--goals { grid-column: auto; }
}

@media (max-width: 640px) {
    .wallet-topbar__date { display: none; }
    .wallet-search { width: 100%; }
    .wallet-notification { margin-left: 10px; }
    .wallet-user { margin-left: 8px; }
    .wallet-user > b { display: none; }
    .wallet-page-header { display: grid; }
    .wallet-page-header .wallet-button { width: 100%; }
    .wallet-summary { grid-template-columns: minmax(0,1fr); gap: 10px; }
    .wallet-summary-card { min-height: 94px; }
    .wallet-account-grid { grid-template-columns: minmax(0,1fr); }
    .wallet-section-heading--inline { align-items: flex-start; }
    .wallet-goal-grid { grid-template-columns: minmax(0,1fr); }
    .wallet-panel { padding: 17px; border-radius: 15px; }
    .wallet-account-card__balance strong { font-size: 21px; }
}

@media (max-width: 430px) {
    .wallet-sidebar { padding-inline: 12px; }
    .wallet-brand strong { font-size: 17px; }
    .wallet-content { padding-inline: 12px; }
    .wallet-topbar { padding-inline: 12px; }
    .wallet-notification { display: none; }
    .wallet-breadcrumb { margin-bottom: 13px; }
    .wallet-section-heading { gap: 9px; }
    .wallet-section-heading select { max-width: 110px; }
    .wallet-modal { padding: 10px; }
    .wallet-modal__dialog { max-height: calc(100vh - 20px); }
    .wallet-modal__row { grid-template-columns: minmax(0,1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .wallet-dashboard-body *,
    .wallet-dashboard-body *::before,
    .wallet-dashboard-body *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
