/*
  FinTrack — visual identity: "Sky Glass 3D"
  Bright sky-blue palette, white glass surfaces with a visible bottom
  "thickness" edge so cards and buttons read as physical 3D tiles,
  orb-style accents, and soft motion (entrance, float, tilt, press).
  Monetary figures use Sora with tabular numerals; interface text uses
  Plus Jakarta Sans.
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
    /* sky scale */
    --sky-50:  #F0F9FF;
    --sky-100: #E0F2FE;
    --sky-200: #BAE6FD;
    --sky-300: #7DD3FC;
    --sky-400: #38BDF8;
    --sky-500: #0EA5E9;
    --sky-600: #0284C7;
    --sky-700: #0369A1;
    --sky-800: #075985;
    --sky-900: #0C4A6E;
    --navy:    #082F49;

    --bg: #EEF8FF;
    --surface: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.72);
    --ink: #0B2540;
    --ink-soft: #4F6B85;
    --line: #D6ECFA;
    --edge: #CBE7F9;            /* the 3D "thickness" under cards */

    --good: #0E9F6E;
    --good-soft: #DDF7EC;
    --warn: #D98A06;
    --warn-soft: #FFF2D6;
    --bad: #E0434B;
    --bad-soft: #FDE3E4;

    /* legacy aliases — older inline styles reference these names */
    --paper: var(--bg);
    --paper-raised: var(--surface);
    --forest: var(--sky-600);
    --forest-deep: var(--sky-900);
    --brass: var(--sky-400);
    --brass-soft: var(--sky-100);

    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 26px;

    --shadow-3d: 0 1px 0 rgba(255,255,255,0.9) inset, 0 5px 0 var(--edge), 0 22px 36px -18px rgba(3, 105, 161, 0.35);
    --shadow-3d-hover: 0 1px 0 rgba(255,255,255,0.9) inset, 0 8px 0 var(--edge), 0 30px 46px -18px rgba(3, 105, 161, 0.42);

    --font-ui: 'Plus Jakarta Sans', 'Hind Siliguri', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Sora', 'Plus Jakarta Sans', 'Hind Siliguri', 'Noto Sans Bengali', sans-serif;
    --font-serif: var(--font-display); /* legacy alias */

    --ease-spring: cubic-bezier(.2, .9, .3, 1.25);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(1200px 600px at 100% -10%, #D2EEFF 0%, transparent 60%),
        radial-gradient(900px 500px at -10% 110%, #DDF3FF 0%, transparent 60%),
        var(--bg);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}
html { overflow-x: clip; }

/* Drifting background orbs */
body::before, body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
}
body::before {
    width: 420px; height: 420px;
    background: radial-gradient(circle at 30% 30%, #7DD3FC, transparent 70%);
    top: 10%; right: -120px;
    animation: drift-a 18s ease-in-out infinite;
}
body::after {
    width: 360px; height: 360px;
    background: radial-gradient(circle at 60% 40%, #BAE6FD, transparent 70%);
    bottom: -80px; left: 20%;
    animation: drift-b 22s ease-in-out infinite;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky-300); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--sky-200); color: var(--navy); }

.figure, .money, .stat-value, .table td.amount, .amount-cell {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 252px;
    flex-shrink: 0;
    margin: 14px 0 14px 14px;
    height: calc(100vh - 28px);
    position: sticky;
    top: 14px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    color: #E8F6FF;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(160px 160px at 85% 8%, rgba(255,255,255,0.28), transparent 70%),
        radial-gradient(220px 220px at 0% 100%, rgba(125,211,252,0.45), transparent 70%),
        linear-gradient(165deg, var(--sky-500) 0%, var(--sky-600) 45%, var(--sky-800) 100%);
    box-shadow: 0 6px 0 var(--sky-900), 0 30px 50px -20px rgba(7, 89, 133, 0.6);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.35rem 1.25rem 1.15rem;
}

.brand-logo {
    width: 42px; height: 42px;
    flex-shrink: 0;
    filter: drop-shadow(0 6px 8px rgba(8, 47, 73, 0.35));
    transition: transform .5s var(--ease-spring);
}
.sidebar-brand:hover .brand-logo { transform: rotateY(360deg); }

.brand-name {
    font-family: var(--font-display);
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}
.brand-name span { color: var(--sky-100); font-weight: 600; }

.brand-mark { display: none; } /* legacy glyph replaced by the SVG logo */

.sidebar-nav {
    flex: 1;
    padding: 0.4rem 0.75rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.8rem;
    border-radius: 14px;
    color: rgba(240, 249, 255, 0.86);
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    position: relative;
    transition: background .2s ease, color .2s ease, transform .25s var(--ease-spring), box-shadow .2s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    transform: translateX(4px);
}

.nav-link.active {
    background: #fff;
    color: var(--sky-700);
    box-shadow: 0 4px 0 rgba(8, 47, 73, 0.28), 0 12px 20px -8px rgba(8, 47, 73, 0.45);
    transform: translateY(-1px);
}

.nav-icon {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.14);
    flex-shrink: 0;
    transition: background .2s ease;
}
.nav-icon svg { width: 17px; height: 17px; }
.nav-link.active .nav-icon {
    background: linear-gradient(145deg, var(--sky-300), var(--sky-500));
    color: #fff;
    box-shadow: 0 3px 0 var(--sky-700);
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.16);
}

.logout-link { color: #FFE1E3; }
.logout-link:hover { background: rgba(224, 67, 75, 0.25); }

.sidebar-overlay { display: none; }

/* ---------- Main area ---------- */
.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 14px 14px 0;
    padding: 0.85rem 1.25rem;
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 0 var(--edge), 0 16px 30px -18px rgba(3,105,161,0.35);
    position: sticky;
    top: 14px;
    z-index: 30;
}

.menu-toggle {
    display: none;
    width: 40px; height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--sky-700);
    box-shadow: 0 3px 0 var(--edge);
}
.menu-toggle svg { width: 20px; height: 20px; }

.page-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    flex: 1;
    background: linear-gradient(90deg, var(--sky-900), var(--sky-600));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-date {
    color: var(--sky-800);
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--sky-50);
    border: 1px solid var(--line);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
}

.topbar-user {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.25rem 0.8rem 0.25rem 0.25rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 3px 0 var(--edge);
}
.user-avatar {
    width: 2.1rem; height: 2.1rem; border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, #BAE6FD 0%, var(--sky-500) 55%, var(--sky-700) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700;
    box-shadow: inset 0 -3px 6px rgba(8,47,73,0.3), 0 4px 10px -2px rgba(2,132,199,0.5);
    text-shadow: 0 1px 2px rgba(8,47,73,0.4);
}
.user-name { font-size: 0.88rem; font-weight: 700; color: var(--ink); }

.content {
    padding: 1.5rem 1.5rem 2.5rem;
    max-width: 1320px;
    width: 100%;
}

/* ---------- Entrance animation (CSS-only, so content shows even without JS) ---------- */
.panel, .stat-card, .hero, .auth-card, .auth-showcase {
    animation: rise-in .7s var(--ease-spring) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}

/* ---------- Cards / panels ---------- */
.panel {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-3d);
    position: relative;
    transition: transform .35s var(--ease-spring), box-shadow .35s ease;
}
.panel:hover { box-shadow: var(--shadow-3d-hover); }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.panel-title::before {
    content: "";
    width: 10px; height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff 0%, var(--sky-400) 45%, var(--sky-700) 100%);
    box-shadow: 0 2px 4px rgba(2,132,199,0.5);
    flex-shrink: 0;
}

.panel-subtitle { color: var(--ink-soft); font-size: 0.84rem; margin-top: 0.15rem; }

/* ---------- Stat cards: 3D tiles with an orb accent ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.15rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    --accent: var(--sky-500);
    --accent-2: var(--sky-700);
    --accent-soft: var(--sky-100);
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(140px 120px at 100% 0%, var(--accent-soft), transparent 70%),
        var(--surface);
    border: 1px solid rgba(255,255,255,0.95);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.25rem 1.2rem;
    box-shadow: var(--shadow-3d);
    transform-style: preserve-3d;
    transition: transform .35s var(--ease-spring), box-shadow .35s ease;
    will-change: transform;
}
.stat-card:hover { box-shadow: var(--shadow-3d-hover); }

/* glossy sphere in the corner */
.stat-card::before {
    content: "";
    position: absolute;
    width: 34px; height: 34px;
    top: 12px; right: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #fff 0%, var(--accent) 42%, var(--accent-2) 100%);
    box-shadow: inset -4px -5px 9px rgba(8,47,73,0.25), 0 8px 14px -5px var(--accent);
    opacity: 0.95;
    animation: bob 5s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * -0.7s);
}
/* bottom accent bar */
.stat-card::after {
    content: "";
    position: absolute;
    left: 1.25rem; right: 1.25rem; bottom: 0;
    height: 4px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.stat-card.accent-income  { --accent: #34D399; --accent-2: #059669; --accent-soft: #E3FBF1; }
.stat-card.accent-expense { --accent: #FB7185; --accent-2: #E11D48; --accent-soft: #FFE8EC; }
.stat-card.accent-balance { --accent: var(--sky-400); --accent-2: var(--sky-700); --accent-soft: var(--sky-100); }
.stat-card.accent-savings { --accent: #818CF8; --accent-2: #4F46E5; --accent-soft: #EEF0FF; }
.stat-card.accent-budget  { --accent: #FBBF24; --accent-2: #D97706; --accent-soft: #FFF5DB; }

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 0.45rem;
    padding-right: 40px;
    position: relative;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    position: relative;
    transform: translateZ(30px);
}

.stat-note { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.3rem; position: relative; }

/* ---------- Dashboard hero banner ---------- */
.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1.9rem 2rem;
    margin-bottom: 1.75rem;
    border-radius: var(--radius-lg);
    color: #fff;
    background:
        radial-gradient(420px 260px at 85% 20%, rgba(255,255,255,0.35), transparent 70%),
        radial-gradient(360px 260px at 0% 100%, rgba(125,211,252,0.55), transparent 70%),
        linear-gradient(120deg, var(--sky-400) 0%, var(--sky-500) 40%, var(--sky-700) 100%);
    box-shadow: 0 7px 0 var(--sky-800), 0 34px 50px -22px rgba(3,105,161,0.65);
}
.hero::before { /* moving light sweep */
    content: "";
    position: absolute;
    top: -50%; left: -30%;
    width: 40%; height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    transform: rotate(18deg);
    animation: sweep 7s ease-in-out infinite;
    pointer-events: none;
}
.hero-text { position: relative; z-index: 1; }
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}
.hero-eyebrow .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #A7F3D0;
    box-shadow: 0 0 0 0 rgba(167,243,208,0.8);
    animation: pulse 2s ease-out infinite;
}
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 2.6vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 0.45rem;
    text-shadow: 0 2px 0 rgba(8,47,73,0.18);
}
.hero-sub { margin: 0 0 1.2rem; opacity: 0.92; max-width: 44ch; }
.hero-balance {
    display: inline-flex;
    flex-direction: column;
    padding: 0.8rem 1.1rem;
    margin-bottom: 1.2rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.35);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 0 rgba(8,47,73,0.18);
}
.hero-balance small { font-size: 0.76rem; font-weight: 600; opacity: 0.9; }
.hero-balance strong {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.hero-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.hero-art {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
}
.hero-art img {
    width: 100%;
    max-width: 440px;
    height: auto;
    filter: drop-shadow(0 20px 30px rgba(8,47,73,0.3));
    animation: hover-y 6s ease-in-out infinite;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
    text-align: left;
    padding: 0.75rem 0.85rem;
    color: var(--sky-800);
    font-weight: 700;
    font-size: 0.76rem;
    background: linear-gradient(180deg, var(--sky-50), var(--sky-100));
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #EAF5FD;
    vertical-align: middle;
    transition: background .15s ease;
}
.table tbody tr { transition: transform .2s ease; }
.table tbody tr:hover td { background: #F5FBFF; }
.table tr:last-child td { border-bottom: none; }
.table td.amount { text-align: right; font-weight: 700; }
.table .amount.positive { color: var(--good); }
.table .amount.negative { color: var(--bad); }
.table-actions { display: flex; gap: 0.4rem; }

/* ---------- Buttons: 3D press ---------- */
.btn {
    --btn-edge: var(--sky-800);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.68rem 1.15rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    border: 1px solid transparent;
    line-height: 1;
    position: relative;
    transform: translateY(0);
    transition: transform .12s ease, box-shadow .12s ease, background .2s ease, color .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); }

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, var(--sky-400) 0%, var(--sky-600) 100%);
    box-shadow: 0 4px 0 var(--sky-800), 0 12px 18px -8px rgba(2,132,199,0.7), inset 0 1px 0 rgba(255,255,255,0.4);
    text-shadow: 0 1px 1px rgba(8,47,73,0.3);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 6px 0 var(--sky-800), 0 16px 22px -8px rgba(2,132,199,0.75), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn-primary:active { box-shadow: 0 1px 0 var(--sky-800), 0 4px 8px -4px rgba(2,132,199,0.6), inset 0 1px 0 rgba(255,255,255,0.4); }

.btn-outline {
    background: var(--surface);
    border-color: var(--line);
    color: var(--sky-800);
    box-shadow: 0 3px 0 var(--edge);
}
.btn-outline:hover { border-color: var(--sky-300); box-shadow: 0 5px 0 var(--sky-200); }
.btn-outline:active { box-shadow: 0 0 0 var(--edge); }

.btn-danger {
    background: var(--surface);
    border-color: #F8C9CC;
    color: var(--bad);
    box-shadow: 0 3px 0 #F8D3D5;
}
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); box-shadow: 0 5px 0 #A3242B; }
.btn-danger:active { box-shadow: 0 0 0 #A3242B; }

.btn-sm { padding: 0.45rem 0.7rem; font-size: 0.78rem; border-radius: 10px; }

.btn-brass { /* legacy name — now the light sky "accent" button */
    color: var(--sky-900);
    background: linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 100%);
    border-color: #A5DBFA;
    box-shadow: 0 3px 0 var(--sky-300);
}
.btn-brass:hover { box-shadow: 0 5px 0 var(--sky-300); }
.btn-brass:active { box-shadow: 0 0 0 var(--sky-300); }

.btn-glass { /* used on the hero banner */
    color: #fff;
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 4px 0 rgba(8,47,73,0.25);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.btn-glass:hover { background: rgba(255,255,255,0.28); }
.btn-white {
    color: var(--sky-700);
    background: #fff;
    box-shadow: 0 4px 0 rgba(8,47,73,0.3), 0 14px 20px -10px rgba(8,47,73,0.5);
}
.btn-white:active { box-shadow: 0 1px 0 rgba(8,47,73,0.3); }

/* ripple (added by JS) */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
    transform: scale(0);
    animation: ripple .6s ease-out forwards;
    pointer-events: none;
}
.btn { overflow: hidden; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1rem; }
.form-field { display: flex; flex-direction: column; gap: 0.38rem; margin-bottom: 0.95rem; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.8rem; font-weight: 700; color: var(--sky-900); }
.form-field input,
.form-field select,
.form-field textarea {
    padding: 0.7rem 0.85rem;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    background: linear-gradient(180deg, #FAFDFF, #fff);
    color: var(--ink);
    box-shadow: inset 0 2px 4px rgba(3,105,161,0.06);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.form-field input:hover, .form-field select:hover, .form-field textarea:hover { border-color: var(--sky-200); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none;
    border-color: var(--sky-400);
    box-shadow: 0 0 0 4px rgba(56,189,248,0.2), inset 0 2px 4px rgba(3,105,161,0.04);
}
.form-field input:disabled { background: var(--sky-50); color: var(--ink-soft); }
.field-error { color: var(--bad); font-size: 0.78rem; min-height: 1em; font-weight: 600; }
.form-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.6rem; }

/* ---------- Filters bar ---------- */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: end;
    margin-bottom: 1.2rem;
    padding: 0.9rem;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--sky-50), #F8FCFF);
    border: 1px solid var(--line);
}
.filters-bar .form-field { margin-bottom: 0; min-width: 150px; }

/* ---------- Progress bars (3D tubes) ---------- */
.progress-track {
    height: 12px;
    background: linear-gradient(180deg, #DCEFFB, #EEF8FE);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 3px rgba(3,105,161,0.15);
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    position: relative;
    background: linear-gradient(180deg, var(--sky-300) 0%, var(--sky-500) 55%, var(--sky-600) 100%);
    box-shadow: inset 0 -2px 2px rgba(8,47,73,0.2);
    animation: grow-x 1.2s var(--ease-spring) both;
    transform-origin: left center;
}
.progress-fill::after { /* glossy highlight + moving shine */
    content: "";
    position: absolute;
    inset: 2px 6px auto 6px;
    height: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,0.55);
}
.progress-fill::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shine 2.4s linear infinite;
    border-radius: inherit;
}
.progress-fill.warn { background: linear-gradient(180deg, #FCD34D, #F59E0B 60%, #D97706); }
.progress-fill.bad  { background: linear-gradient(180deg, #FDA4AF, #F43F5E 60%, #E11D48); }
.progress-fill.brass { background: linear-gradient(180deg, #A5F3FC, var(--sky-400) 55%, var(--sky-600)); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 2px 0 rgba(0,0,0,0.06);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-safe { background: var(--good-soft); color: var(--good); }
.badge-warning { background: var(--warn-soft); color: #B26F00; }
.badge-near { background: #FFE6CC; color: #B4530B; }
.badge-exceeded { background: var(--bad-soft); color: var(--bad); }

/* ---------- Modal (3D flip-in) ---------- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(8, 47, 73, 0.38);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center;
    z-index: 100; padding: 1rem;
    perspective: 1200px;
}
.modal-backdrop.open { display: flex; animation: fade-in .25s ease both; }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 6px 0 var(--edge), 0 40px 70px -20px rgba(8,47,73,0.55);
    border-top: 5px solid var(--sky-400);
}
.modal-backdrop.open .modal { animation: modal-in .55s var(--ease-spring) both; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.1rem;
}
.modal-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.modal-close {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--sky-50);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1.2rem;
    color: var(--sky-800);
    box-shadow: 0 3px 0 var(--edge);
    transition: transform .3s var(--ease-spring);
}
.modal-close:hover { transform: rotate(90deg); }

/* ---------- Flash messages ---------- */
.flash {
    padding: 0.85rem 1.05rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid transparent;
    animation: slide-down .45s var(--ease-spring) both;
}
.flash-success { background: var(--good-soft); color: #08744F; border-color: #B7EBD5; box-shadow: 0 3px 0 #C8F0DF; }
.flash-error { background: var(--bad-soft); color: #B4232A; border-color: #F7C3C6; box-shadow: 0 3px 0 #F9D2D4; }

/* ---------- Empty states ---------- */
.empty-state {
    text-align: center;
    padding: 2.6rem 1rem;
    color: var(--ink-soft);
}
.empty-state .empty-icon {
    width: 76px; height: 76px;
    margin: 0 auto 0.9rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem;
    color: #fff;
    border-radius: 24px;
    background: linear-gradient(150deg, var(--sky-300), var(--sky-600));
    box-shadow: 0 6px 0 var(--sky-800), 0 18px 26px -10px rgba(2,132,199,0.7), inset 0 2px 0 rgba(255,255,255,0.4);
    transform: rotate(-6deg);
    animation: hover-y 4s ease-in-out infinite;
}
.empty-state h3 { font-family: var(--font-display); color: var(--ink); margin: 0 0 0.35rem; }

/* ---------- Auth pages ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    perspective: 1400px;
}

.auth-showcase {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    padding: 2.25rem 2.5rem;
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
        radial-gradient(500px 300px at 90% 10%, rgba(255,255,255,0.35), transparent 70%),
        radial-gradient(420px 320px at 0% 100%, rgba(125,211,252,0.6), transparent 70%),
        linear-gradient(140deg, var(--sky-400) 0%, var(--sky-500) 35%, var(--sky-700) 100%);
    box-shadow: 0 8px 0 var(--sky-800), 0 40px 60px -25px rgba(3,105,161,0.7);
}
.auth-showcase::before {
    content: "";
    position: absolute;
    top: -40%; left: -40%;
    width: 50%; height: 180%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(20deg);
    animation: sweep 8s ease-in-out infinite;
}
.showcase-brand { display: flex; align-items: center; gap: 0.75rem; position: relative; }
.showcase-brand img { width: 52px; height: 52px; filter: drop-shadow(0 8px 10px rgba(8,47,73,0.35)); }
.showcase-brand span { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.showcase-copy { position: relative; margin-top: 2.2rem; max-width: 30rem; }
.showcase-copy h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.035em;
    margin: 0 0 0.75rem;
    text-shadow: 0 3px 0 rgba(8,47,73,0.18);
}
.showcase-copy p { margin: 0; opacity: 0.92; font-size: 1rem; }
.showcase-art { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.showcase-art img {
    width: 100%;
    max-width: 520px;
    filter: drop-shadow(0 28px 34px rgba(8,47,73,0.35));
    animation: hover-y 6s ease-in-out infinite;
}
.showcase-chips { position: relative; display: flex; flex-wrap: wrap; gap: 0.55rem; }
.showcase-chips span {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem; font-weight: 700;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 3px 0 rgba(8,47,73,0.2);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.showcase-chips span::before { content: "✓"; font-weight: 800; }

.auth-card {
    align-self: center;
    justify-self: center;
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255,255,255,0.95);
    border-radius: 28px;
    padding: 2.4rem 2.2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 7px 0 var(--edge), 0 40px 60px -28px rgba(3,105,161,0.45);
    animation-delay: 120ms;
}
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.4rem;
    perspective: 600px;
}
.auth-brand .brand-logo {
    width: 74px; height: 74px;
    margin-bottom: 0.5rem;
    animation: coin-flip 6s ease-in-out infinite;
    filter: drop-shadow(0 12px 14px rgba(2,132,199,0.4));
}
.auth-brand .brand-name { color: var(--sky-900); font-size: 1.4rem; }
.auth-brand .brand-name span { color: var(--sky-500); }
.auth-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.3rem; text-align: center; }
.auth-subtitle { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 1.5rem; text-align: center; }
.auth-footer { text-align: center; margin-top: 1.35rem; font-size: 0.88rem; color: var(--ink-soft); }
.auth-card .btn-primary { padding: 0.85rem 1.15rem; font-size: 0.95rem; }

/* ---------- Charts ---------- */
.chart-wrap { position: relative; height: 280px; }
.chart-wrap.small { height: 220px; }

/* ---------- Grid layouts ---------- */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-3 > .panel, .grid-2 > .panel { margin-bottom: 1.5rem; }
.grid-2 > *, .grid-3 > * { min-width: 0; }

/* ---------- Category swatches ---------- */
.cat-dot {
    width: 0.7rem; height: 0.7rem; border-radius: 50%; display: inline-block; margin-right: 0.45rem;
    box-shadow: inset -1px -2px 3px rgba(0,0,0,0.2);
}

/* ---------- Keyframes ---------- */
@keyframes rise-in {
    from { opacity: 0; transform: perspective(1200px) translateY(22px) rotateX(10deg) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@keyframes drift-a { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-80px, 60px) scale(1.15); } }
@keyframes drift-b { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(90px, -50px) scale(0.9); } }
@keyframes bob { 0%,100% { transform: translateY(0) translateZ(40px); } 50% { transform: translateY(-6px) translateZ(40px); } }
@keyframes hover-y { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes sweep { 0%, 60% { left: -40%; } 100% { left: 130%; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(167,243,208,0.8); } 100% { box-shadow: 0 0 0 10px rgba(167,243,208,0); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: rotateX(-18deg) translateY(30px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes coin-flip {
    0%, 70%, 100% { transform: rotateY(0deg); }
    85% { transform: rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- Print ---------- */
@media print {
    body::before, body::after { display: none; }
    .sidebar, .topbar, .filters-bar, .table-actions, .btn, .no-print, .hero-art { display: none !important; }
    .main-area { width: 100%; }
    .content { padding: 0; max-width: none; }
    body { background: #fff; }
    .panel, .stat-card { box-shadow: none; border: 1px solid #ddd; animation: none; }
    .hero { color: var(--ink); background: #fff; box-shadow: none; border: 1px solid #ddd; }
}


/* =====================================================================
   AI Assistant
   ===================================================================== */
.flash-warn { background: var(--warn-soft); color: #8A5600; border-color: #F6D9A0; box-shadow: 0 3px 0 #F9E3B8; }

.ai-top { align-items: start; }
.ai-mode {
    font-size: 0.74rem; font-weight: 700; padding: 0.3rem 0.65rem; border-radius: 999px;
    background: var(--sky-50); color: var(--sky-700); border: 1px solid var(--sky-200);
}
.ai-mode.on { background: linear-gradient(135deg, var(--sky-500), var(--sky-700)); color: #fff; border-color: transparent; }

/* chat */
.ai-chat-panel { display: flex; flex-direction: column; }
.ai-messages {
    height: 400px; overflow-y: auto; padding: 0.9rem; margin-bottom: 0.8rem;
    background: linear-gradient(180deg, var(--sky-50), #fff); border: 1px solid var(--line); border-radius: 16px;
    display: flex; flex-direction: column; gap: 0.6rem; scroll-behavior: smooth;
}
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble {
    max-width: 86%; padding: 0.7rem 0.9rem; border-radius: 16px; font-size: 0.9rem; line-height: 1.6;
    background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 0 var(--edge); overflow-wrap: anywhere;
}
.ai-msg.bot .ai-bubble { border-top-left-radius: 6px; }
.ai-msg.user .ai-bubble { background: linear-gradient(135deg, var(--sky-500), var(--sky-700)); color: #fff; border-color: transparent; border-top-right-radius: 6px; box-shadow: 0 2px 0 var(--sky-800); }
.ai-msg.error .ai-bubble { background: var(--bad-soft); color: #B4232A; border-color: #F7C3C6; }
.ai-bubble p { margin: 0 0 0.45rem; } .ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble ul { margin: 0.2rem 0 0.45rem; padding-left: 1.1rem; } .ai-bubble li { margin: 0.15rem 0; }
.ai-typing { display: inline-flex; gap: 4px; padding: 0.2rem 0; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sky-400); animation: aiDot 1.2s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.ai-chip {
    font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; padding: 0.4rem 0.7rem; border-radius: 999px;
    background: #fff; color: var(--sky-800); border: 1px solid var(--sky-200); transition: background .15s, transform .15s;
}
.ai-chip:hover { background: var(--sky-50); transform: translateY(-1px); }
.ai-input { display: flex; gap: 0.5rem; align-items: flex-end; }
.ai-input textarea {
    flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 0.7rem 0.85rem; font: inherit; font-size: 0.9rem;
    border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
.ai-input textarea:focus { outline: none; border-color: var(--sky-400); box-shadow: 0 0 0 4px rgba(56,189,248,0.2); }
.ai-input .btn { height: 44px; }
.ai-input .btn:disabled { opacity: .6; }

/* forecast */
.ai-forecast { padding: 0.2rem 0 0.6rem; }
.ai-forecast-amount { font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; color: var(--sky-700); letter-spacing: -0.02em; }
.ai-forecast-range { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.1rem; }
.ai-forecast-text { font-size: 0.9rem; margin: 0.6rem 0 0; }
.ai-mini-stats, .ai-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; margin: 0.6rem 0 1rem; }
.ai-mini-stats > div, .ai-plan > div { background: var(--sky-50); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 0.75rem; }
.ai-mini-stats small, .ai-plan small { display: block; font-size: 0.74rem; color: var(--ink-soft); margin-bottom: 0.15rem; }
.ai-mini-stats strong, .ai-plan strong { font-size: 1rem; }
.ai-subhead { font-size: 0.85rem; margin: 1rem 0 0.5rem; color: var(--sky-900); }
.ai-cat-list { list-style: none; margin: 0; padding: 0; }
.ai-cat-list li { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 0.6rem; align-items: center; font-size: 0.85rem; padding: 0.3rem 0; }
.ai-bar { height: 8px; border-radius: 6px; background: var(--sky-100); overflow: hidden; }
.ai-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--sky-400), var(--sky-600)); }
.ai-note { font-size: 0.78rem; color: var(--ink-soft); margin: 0.9rem 0 0; }
.ai-muted { font-size: 0.76rem; color: var(--ink-soft); font-weight: 500; }
.ai-warn-line { background: var(--warn-soft); color: #8A5600; border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.85rem; margin: 0 0 0.9rem; }

/* budget table */
.ai-budget-table td { vertical-align: top; }
.ai-budget-input {
    width: 7.5rem; text-align: right; padding: 0.45rem 0.6rem; font: inherit; font-weight: 700;
    border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.ai-budget-input:focus { outline: none; border-color: var(--sky-400); box-shadow: 0 0 0 3px rgba(56,189,248,0.2); }
.ai-budget-check { width: 17px; height: 17px; accent-color: var(--sky-600); margin-top: 0.3rem; }
.ai-change { font-size: 0.74rem; margin-top: 0.2rem; }
.ai-change.down { color: var(--good); } .ai-change.up { color: #B26F00; }
.ai-reason { font-size: 0.84rem; color: var(--ink); min-width: 16rem; line-height: 1.5; }

/* alerts */
.ai-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.ai-alert { display: flex; gap: 0.75rem; padding: 0.8rem 0.95rem; border-radius: 14px; border: 1px solid #F6D9A0; background: var(--warn-soft); }
.ai-alert.high { border-color: #F7C3C6; background: var(--bad-soft); }
.ai-alert-icon {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; color: #fff; background: var(--warn);
}
.ai-alert.high .ai-alert-icon { background: var(--bad); }
.ai-alert p { margin: 0.2rem 0 0; font-size: 0.88rem; line-height: 1.55; }
.ai-alert-title { font-weight: 700; font-size: 0.88rem; display: flex; gap: 0.5rem; align-items: center; }
.ai-sev { font-size: 0.7rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: rgba(255,255,255,0.7); }

/* report */
.ai-report-tools { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }
.ai-report-tools select {
    padding: 0.45rem 0.6rem; font: inherit; font-size: 0.82rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.ai-report { line-height: 1.75; transition: opacity .2s; }
.ai-report.loading { opacity: .45; pointer-events: none; }
.ai-report-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; border-bottom: 2px solid var(--sky-100); padding-bottom: 0.6rem; margin-bottom: 0.9rem; }
.ai-report-head h3 { margin: 0; font-size: 1.15rem; color: var(--sky-800); }
.ai-report section { margin-bottom: 1rem; }
.ai-report h4 { margin: 0 0 0.3rem; font-size: 0.95rem; color: var(--sky-900); }
.ai-report p { margin: 0 0 0.4rem; font-size: 0.92rem; }
.ai-report ul { margin: 0.2rem 0 0; padding-left: 1.2rem; font-size: 0.9rem; }
.ai-report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; margin-bottom: 1.1rem; }
.ai-rstat { border-radius: 12px; padding: 0.65rem 0.8rem; background: var(--sky-50); border: 1px solid var(--line); border-left: 4px solid var(--sky-500); }
.ai-rstat.income { border-left-color: var(--good); } .ai-rstat.expense { border-left-color: var(--bad); } .ai-rstat.savings { border-left-color: var(--warn); }
.ai-rstat small { display: block; font-size: 0.75rem; color: var(--ink-soft); }
.ai-rstat strong { font-size: 1.05rem; }
.ai-report-tips { background: var(--sky-50); border: 1px solid var(--line); border-radius: 14px; padding: 0.8rem 1rem; }

/* dashboard widget */
.ai-widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem; }
.ai-widget-card { background: var(--sky-50); border: 1px solid var(--line); border-radius: 14px; padding: 0.85rem 1rem; font-size: 0.88rem; line-height: 1.55; }
.ai-widget-card h4 { margin: 0 0 0.35rem; font-size: 0.82rem; color: var(--sky-800); text-transform: none; }
.ai-widget-card .big { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--sky-700); }
.ai-report-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--sky-500), var(--sky-700)); color: #fff; border-radius: 16px; padding: 0.9rem 1.1rem; margin-bottom: 1.25rem; box-shadow: 0 5px 0 var(--sky-800); }
.ai-report-banner strong { font-size: 0.95rem; }

@media (max-width: 640px) {
    .ai-messages { height: 340px; }
    .ai-bubble { max-width: 94%; }
    .ai-cat-list li { grid-template-columns: 6rem 1fr auto; }
    .ai-forecast-amount { font-size: 1.7rem; }
}
.ai-budget-table td.amount { white-space: nowrap; }

/* ---------- Clickable dashboard stat cards ---------- */
a.stat-card { display: block; color: inherit; text-decoration: none; cursor: pointer; }
a.stat-card:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 3px; }
.stat-card.accent-loan-out { --accent: #FB923C; --accent-2: #EA580C; --accent-soft: #FFEDD5; }
.stat-card.accent-loan-in  { --accent: #2DD4BF; --accent-2: #0D9488; --accent-soft: #D9FBF5; }

/* ---------- Loans page ---------- */
.loan-tabs { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1.5rem; padding-bottom: 6px; }
.loan-tab {
    font: inherit; font-size: 0.95rem; font-weight: 800; cursor: pointer; line-height: 1;
    padding: 0.85rem 1.7rem; border-radius: 14px;
    color: var(--sky-800); border: 1px solid var(--sky-200);
    background: linear-gradient(180deg, #ffffff 0%, var(--sky-100) 100%);
    box-shadow: 0 5px 0 var(--sky-300), 0 14px 18px -10px rgba(2,132,199,0.55), inset 0 1px 0 rgba(255,255,255,0.95);
    transform: translateY(0);
    transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.loan-tab:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--sky-300), 0 18px 22px -10px rgba(2,132,199,0.6), inset 0 1px 0 rgba(255,255,255,0.95); }
.loan-tab:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--sky-300), 0 4px 8px -4px rgba(2,132,199,0.5), inset 0 1px 0 rgba(255,255,255,0.95); }
.loan-tab.active {
    color: #fff; border-color: transparent;
    background: linear-gradient(180deg, var(--sky-400) 0%, var(--sky-600) 100%);
    text-shadow: 0 1px 1px rgba(8,47,73,0.3);
    box-shadow: 0 5px 0 var(--sky-800), 0 14px 20px -8px rgba(2,132,199,0.7), inset 0 1px 0 rgba(255,255,255,0.4);
}
.loan-tab.active:active { box-shadow: 0 1px 0 var(--sky-800), 0 4px 8px -4px rgba(2,132,199,0.6), inset 0 1px 0 rgba(255,255,255,0.4); }
.loan-pane[hidden] { display: none; }
.loan-history { margin-top: 0.75rem; font-size: 0.85rem; }
.loan-history summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.loan-history ul { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.loan-history li {
    display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0; border-bottom: 1px dashed var(--line);
}
.loan-history li > span:first-child { flex: 1; min-width: 0; color: var(--ink-soft); }
.loan-pay-del {
    border: none; background: transparent; color: var(--bad); font-size: 1.2rem;
    line-height: 1; cursor: pointer; padding: 0 0.3rem;
}
@media (max-width: 900px) { .loan-tab { flex: 1 1 100%; text-align: center; } }

/* ---------- Bank & mobile banking statements ---------- */
.acc-statement { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 0.5rem; }
.acc-statement th { text-align: left; font-weight: 700; color: var(--ink-soft); padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.acc-statement td { padding: 0.4rem; border-bottom: 1px dashed var(--line); vertical-align: top; }
.acc-statement .num { text-align: right; white-space: nowrap; }
.acc-statement .positive { color: var(--good); font-weight: 700; }
.acc-statement .negative { color: var(--bad); font-weight: 700; }
.acc-statement tr[hidden] { display: none; }
.acc-sub { font-size: 0.72rem; color: var(--ink-soft); }
.acc-filters { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.acc-filters input, .acc-filters select {
    font: inherit; padding: 0.5rem 0.75rem; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.acc-filter-note { font-size: 0.75rem; color: var(--ink-soft); }

/* ---------- Notification bell (top bar) ---------- */
.notif { position: relative; }
.notif-btn {
    position: relative; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--sky-800); border: 1px solid var(--sky-200);
    background: linear-gradient(180deg, #ffffff 0%, var(--sky-100) 100%);
    box-shadow: 0 4px 0 var(--sky-300), 0 10px 14px -8px rgba(2,132,199,0.55), inset 0 1px 0 rgba(255,255,255,0.95);
    transition: transform .12s ease, box-shadow .12s ease;
}
.notif-btn:hover { transform: translateY(-2px); }
.notif-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sky-300), inset 0 1px 0 rgba(255,255,255,0.95); }
.notif-btn svg { width: 21px; height: 21px; }
.notif-badge {
    position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px; background: linear-gradient(180deg, #FB7185, var(--bad)); color: #fff;
    font-size: 0.7rem; font-weight: 800; line-height: 20px; text-align: center;
    box-shadow: 0 2px 0 #9F1239, 0 0 0 2px #fff;
}
.notif-badge[hidden], .notif-panel[hidden], .notif-empty[hidden] { display: none; }
.notif-panel {
    position: absolute; right: 0; top: calc(100% + 14px); z-index: 60;
    width: min(390px, 92vw); max-height: 70vh; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 24px 50px -16px rgba(2,132,199,0.45), 0 4px 0 var(--sky-200);
}
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; border-radius: 18px 18px 0 0; }
.notif-readall { border: none; background: transparent; color: var(--sky-600); font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.notif-readall:hover { text-decoration: underline; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.notif-item:hover { background: var(--sky-50); }
.notif-item.unread { background: var(--sky-50); box-shadow: inset 4px 0 0 var(--bad); }
.notif-ai { font-size: 0.72rem; font-weight: 800; color: var(--sky-600); }
.notif-item strong { font-size: 0.9rem; color: var(--ink); }
.notif-text { font-size: 0.82rem; line-height: 1.55; color: var(--ink-soft); }
.notif-item time { font-size: 0.72rem; color: var(--ink-soft); }
.notif-empty { padding: 1.4rem 1.1rem; text-align: center; font-size: 0.85rem; color: var(--ink-soft); }
@media (max-width: 700px) {
    .notif-panel { position: fixed; left: 4vw; right: 4vw; top: 70px; width: auto; }
}

/* ---------- AI Assistant: BNG / ENG language switch ---------- */
.ai-lang-bar { display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.ai-lang-label { font-size: 0.8rem; font-weight: 700; color: var(--sky-800); }
.lang-switch {
    display: inline-flex; padding: 5px; gap: 4px; border-radius: 16px;
    background: linear-gradient(180deg, var(--sky-100), #ffffff);
    border: 1px solid var(--sky-200);
    box-shadow: inset 0 2px 4px rgba(2,132,199,0.15), 0 1px 0 #fff;
}
.lang-btn {
    min-width: 62px; text-align: center; padding: 0.55rem 1rem; border-radius: 12px;
    font-size: 0.85rem; font-weight: 800; letter-spacing: 0.04em; text-decoration: none;
    color: var(--sky-800); background: transparent; transform: translateY(0);
    transition: transform .12s ease, box-shadow .12s ease, background .2s ease, color .2s ease;
}
.lang-btn:hover { background: rgba(255,255,255,0.8); }
.lang-btn.active {
    color: #fff; background: linear-gradient(180deg, var(--sky-400) 0%, var(--sky-600) 100%);
    box-shadow: 0 4px 0 var(--sky-800), 0 10px 14px -8px rgba(2,132,199,0.7), inset 0 1px 0 rgba(255,255,255,0.4);
    text-shadow: 0 1px 1px rgba(8,47,73,0.3); transform: translateY(-2px);
}
.lang-btn:active { transform: translateY(2px); }

/* ---------- Subscription ---------- */
.sub-chip {
    display: inline-flex; align-items: center; padding: 0.5rem 0.9rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 800; text-decoration: none; white-space: nowrap;
    color: var(--sky-800); border: 1px solid var(--sky-200);
    background: linear-gradient(180deg, #fff, var(--sky-100));
    box-shadow: 0 3px 0 var(--sky-300), inset 0 1px 0 rgba(255,255,255,0.95);
}
.sub-chip.soon { color: #fff; border-color: transparent; background: linear-gradient(180deg, #FB923C, #EA580C); box-shadow: 0 3px 0 #9A3412; }
@media (max-width: 900px) { .sub-chip { display: none; } }
.sub-alert {
    margin-bottom: 1rem; padding: 0.85rem 1.1rem; border-radius: 14px; font-size: 0.9rem;
    background: #FFF7ED; border: 1px solid #FED7AA; color: #9A3412;
}
.sub-alert a { font-weight: 800; color: #C2410C; }
.sub-alert-bad { background: #FFF1F2; border-color: #FECDD3; color: #9F1239; }
.sub-status { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sub-status-label { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }
.sub-status-value { font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.sub-status-sub { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.2rem; }
.sub-pending-note { font-size: 0.85rem; font-weight: 700; color: #92400E; background: #FEF3C7; padding: 0.6rem 0.9rem; border-radius: 12px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.plan-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem; cursor: pointer; font: inherit;
    padding: 1.3rem 1rem; border-radius: 18px; color: var(--ink);
    border: 2px solid var(--sky-200); background: linear-gradient(180deg, #fff, var(--sky-100));
    box-shadow: 0 6px 0 var(--sky-300), 0 14px 18px -10px rgba(2,132,199,0.5);
    transition: transform .12s ease, box-shadow .12s ease;
}
.plan-card:hover { transform: translateY(-3px); }
.plan-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--sky-300); }
.plan-card.selected { border-color: var(--sky-600); background: linear-gradient(180deg, var(--sky-400), var(--sky-600)); color: #fff; box-shadow: 0 6px 0 var(--sky-800), 0 14px 20px -8px rgba(2,132,199,0.7); }
.plan-name { font-weight: 800; font-size: 1rem; }
.plan-price { font-size: 2rem; font-weight: 800; }
.plan-note { font-size: 0.78rem; font-weight: 700; opacity: 0.85; }
.pay-methods { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1.2rem; padding-bottom: 6px; }
.pay-method {
    font: inherit; font-weight: 800; cursor: pointer; padding: 0.8rem 1.7rem; border-radius: 14px; color: #fff; border: none;
    background: var(--m, #E2136E); box-shadow: 0 5px 0 var(--m-dark, #9D0D4E); opacity: 0.55;
    transition: transform .12s ease, box-shadow .12s ease, opacity .2s ease;
}
.pay-method.selected { opacity: 1; transform: translateY(-2px); box-shadow: 0 7px 0 var(--m-dark, #9D0D4E), 0 14px 18px -8px rgba(0,0,0,0.35); }
.pay-method:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--m-dark, #9D0D4E); }
.pay-bkash { --m: #E2136E; --m-dark: #9D0D4E; }
.pay-nagad { --m: #F6921E; --m-dark: #B45F09; }
.pay-rocket { --m: #8C3494; --m-dark: #5E2064; }
.pay-box { background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: 16px; padding: 1.1rem 1.2rem; }
.pay-line { margin: 0.4rem 0; font-size: 0.95rem; }
.pay-number-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 0.5rem 0; }
.pay-number { font-size: 1.7rem; font-weight: 800; letter-spacing: 0.04em; color: var(--sky-800); }
.pay-amount { font-size: 1.2rem; }
.pay-steps { margin: 0.6rem 0 0 1.2rem; padding: 0; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.7; }

/* ---------- Password show/hide (eye icon) ---------- */
.pw-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.form-field .pw-wrap input { width: 100%; padding-right: 2.6rem; }
.pw-toggle {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--sky-600);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.pw-toggle:hover { background: var(--sky-50); color: var(--sky-800); }
.pw-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(56,189,248,0.35); }
.pw-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
input::-ms-reveal, input::-ms-clear { display: none; }

/* ---------- Coupon code (subscription step 3) ---------- */
.coupon-box { margin-bottom: 1rem; padding: 0.9rem 1rem; border-radius: 14px; background: linear-gradient(180deg, var(--sky-50), #F8FCFF); border: 1px dashed var(--sky-200); }
.coupon-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--sky-900); margin-bottom: 0.4rem; }
.coupon-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.coupon-row input { flex: 1 1 180px; min-width: 0; padding: 0.6rem 0.85rem; border: 1.5px solid var(--line); border-radius: 12px; font-family: inherit; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; background: #fff; color: var(--ink); }
.coupon-row input:focus { outline: none; border-color: var(--sky-400); box-shadow: 0 0 0 4px rgba(56,189,248,0.2); }
.coupon-msg { min-height: 1.1em; font-size: 0.8rem; font-weight: 600; margin-top: 0.4rem; }
.coupon-msg.ok { color: var(--ok, #0E7C4A); }
.coupon-msg.bad { color: var(--bad); }
.pay-old { color: var(--ink-soft); font-size: 0.95rem; margin-left: 0.3rem; }

/* ---------- Admin: coupon form ---------- */
.coupon-admin-form { margin-bottom: 1rem; padding: 0.9rem; border-radius: 16px; background: linear-gradient(180deg, var(--sky-50), #F8FCFF); border: 1px solid var(--line); }
.coupon-admin-form .form-field { margin-bottom: 0; }

/* ---------- Dashboard: one colour per stat card ---------- */
.stat-card.dash-1  { --accent: #34D399; --accent-2: #059669; --accent-soft: #E3FBF1; }  /* Total income */
.stat-card.dash-2  { --accent: #FB7185; --accent-2: #E11D48; --accent-soft: #FFE8EC; }  /* Total expenses */
.stat-card.dash-3  { --accent: #38BDF8; --accent-2: #0369A1; --accent-soft: #E0F2FE; }  /* Current balance */
.stat-card.dash-4  { --accent: #818CF8; --accent-2: #4F46E5; --accent-soft: #EEF0FF; }  /* Total savings */
.stat-card.dash-5  { --accent: #FBBF24; --accent-2: #D97706; --accent-soft: #FFF5DB; }  /* Monthly budget */
.stat-card.dash-6  { --accent: #A3E635; --accent-2: #4D7C0F; --accent-soft: #F0FBD9; }  /* Budget remaining */
.stat-card.dash-7  { --accent: #C084FC; --accent-2: #7E22CE; --accent-soft: #F5EAFF; }  /* Savings goal progress */
.stat-card.dash-8  { --accent: #FB923C; --accent-2: #EA580C; --accent-soft: #FFEDD5; }  /* Bank loan (I owe) */
.stat-card.dash-9  { --accent: #F472B6; --accent-2: #BE185D; --accent-soft: #FDE7F3; }  /* Lend Money: Taking */
.stat-card.dash-10 { --accent: #2DD4BF; --accent-2: #0F766E; --accent-soft: #D9FBF5; }  /* Lend Money: Giving */
.stat-card.dash-11 { --accent: #60A5FA; --accent-2: #1D4ED8; --accent-soft: #E0ECFF; }  /* Total in banks */
.stat-card.dash-12 { --accent: #E879F9; --accent-2: #A21CAF; --accent-soft: #FBE8FE; }  /* Total in mobile banking */
.stat-card.dash-13 { --accent: #C2A37A; --accent-2: #7C5A2E; --accent-soft: #F6EEE2; }  /* Bank & mobile fees */

/* ---------- Site footer ---------- */
.site-footer {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #0C4A6E 0%, #0369A1 55%, #0EA5E9 100%);
    color: #E0F2FE;
    box-shadow: 0 14px 30px -18px rgba(3,105,161,0.6);
}
.site-footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; }
.site-footer-block { display: flex; flex-direction: column; gap: 0.35rem; min-width: 200px; }
.site-footer-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #7DD3FC; margin-bottom: 0.15rem; }
.site-footer-name { font-size: 0.95rem; font-weight: 600; color: #fff; }
.site-footer-link { display: inline-flex; align-items: center; gap: 0.5rem; color: #E0F2FE; text-decoration: none; font-size: 0.88rem; word-break: break-all; }
.site-footer-link:hover { color: #fff; text-decoration: underline; }
.site-footer-link svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-footer-link[href^="https://wa.me"] svg { fill: currentColor; stroke: none; }
@media (max-width: 600px) { .site-footer { padding: 1rem; } .site-footer-block { min-width: 0; width: 100%; } }
