/* ==========================================================================
   Z-Budget Core Stylesheet
   Design Language: Glassmorphic Space-Cyberpunk (Tailored for Gen Z)
   ========================================================================== */

:root {
    --bg-color: #07050f;
    --card-bg: rgba(20, 16, 38, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);
    
    /* Neon gradients & glow colors */
    --neon-pink: #ff3b30;
    --neon-purple: #af52de;
    --neon-blue: #5ac8fa;
    --neon-green: #30d158;
    --neon-orange: #ff9500;
    --neon-teal: #00c7be;
    
    --grad-primary: linear-gradient(135deg, var(--neon-pink), var(--neon-purple), var(--neon-blue));
    --grad-glow: linear-gradient(135deg, rgba(255, 59, 48, 0.3), rgba(175, 82, 222, 0.3), rgba(90, 200, 250, 0.3));
    --grad-button: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
}

/* Base reset & fonts */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Hide scrollbar by default, custom style */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Ambient glow backgrounds */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.55;
}
.glow-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--neon-purple) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    left: -100px;
}
.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--neon-blue) 0%, rgba(0,0,0,0) 70%);
    bottom: -150px;
    right: -100px;
}
.glow-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--neon-pink) 0%, rgba(0,0,0,0) 70%);
    top: 30%;
    right: 25%;
    opacity: 0.2;
}

/* Text & Colors utilities */
.text-neon-pink { color: #ff5e55; text-shadow: 0 0 10px rgba(255, 94, 85, 0.3); }
.text-neon-blue { color: #64d2ff; text-shadow: 0 0 10px rgba(100, 210, 255, 0.3); }
.text-neon-green { color: #34c759; text-shadow: 0 0 10px rgba(52, 199, 89, 0.3); }
.text-neon-orange { color: #ff9f0a; text-shadow: 0 0 10px rgba(255, 159, 10, 0.3); }
.text-right { text-align: right; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.m-0 { margin: 0; }
.p-0 { padding: 0 !important; }
.flex-1 { flex: 1; }
.flex-column { display: flex; flex-direction: column; }
.align-items-center { align-items: center; }
.opacity-0 { opacity: 0; }
.cursor-pointer { cursor: pointer; }

/* Main app grid layout */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    background: rgba(13, 9, 29, 0.85);
    border-right: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.logo-icon {
    width: 32px;
    height: 32px;
}
.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* User profile widget */
.user-profile-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.avatar-container {
    position: relative;
    width: 48px;
    height: 48px;
}
.avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--neon-purple);
}
.level-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--grad-button);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid var(--bg-color);
}
.profile-info {
    display: flex;
    flex-direction: column;
}
.profile-name {
    font-size: 0.95rem;
    font-weight: 700;
}
.profile-rank {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.xp-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}
.xp-bar-fill {
    height: 100%;
    background: var(--grad-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease-out;
}
.xp-text-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    position: relative;
}
.xp-gain-bubble {
    position: absolute;
    right: 0;
    top: -20px;
    background: var(--neon-green);
    color: black;
    font-weight: 800;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.xp-gain-bubble.show {
    opacity: 1;
    transform: translateY(0);
    animation: floatUp 1.2s forwards;
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(10px); }
    15% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(-5px); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* Nav Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}
.nav-icon {
    width: 20px;
    height: 20px;
    transition: var(--transition-smooth);
}
.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.nav-item.active {
    background: rgba(175, 82, 222, 0.15);
    border-left: 3px solid var(--neon-purple);
}
.nav-item.active .nav-icon {
    color: var(--neon-purple);
}

.btn-block {
    width: 100%;
}

/* Main content wrapper */
.content-container {
    padding: 2.5rem;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}
.header-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.75px;
}
.header-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.25rem;
}
.header-actions {
    display: flex;
    gap: 1rem;
}

/* Button UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.btn-primary {
    background: var(--grad-button);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 59, 48, 0.45);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}
.btn-danger {
    background: #ff3b30;
    color: white;
}
.btn-danger:hover {
    background: #e02d23;
}
.btn-icon-only {
    padding: 0.75rem;
    border-radius: 50%;
}
.btn-icon {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}
.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
}
.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}
.btn-close-modal:hover {
    color: var(--text-primary);
}

/* Glassmorphism card elements */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(25px) saturate(180%);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}
.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}
.header-with-action {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1.25rem;
}
.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.25px;
}
.card-body {
    flex: 1;
    display: flex;
    position: relative;
}
.card-hero {
    background: linear-gradient(135deg, rgba(22, 17, 44, 0.8), rgba(11, 8, 20, 0.9));
    border: 1px solid rgba(175, 82, 222, 0.2);
}

/* Dream Portal: YouTube-linked savings goal motivator */
.dream-portal-card {
    min-height: 430px;
    padding: 0;
    overflow: hidden;
    isolation: isolate;
    background: #07050f;
}

.dream-video-frame {
    --dream-progress: 0;
    --dream-blur: 7px;
    --dream-gray: 0.62;
    --dream-bright: 0.68;
    position: absolute;
    inset: -12%;
    filter: grayscale(var(--dream-gray)) blur(var(--dream-blur)) brightness(var(--dream-bright)) saturate(calc(0.35 + var(--dream-progress) * 1.2));
    transform: scale(calc(1.14 - var(--dream-progress) * 0.06));
    transition: filter 0.8s ease, transform 0.8s ease;
    z-index: 0;
}

.dream-video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.dream-video-overlay,
.dream-video-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dream-video-overlay {
    background:
        linear-gradient(90deg, rgba(7, 5, 15, 0.78), rgba(7, 5, 15, 0.18) 48%, rgba(7, 5, 15, 0.64)),
        linear-gradient(180deg, rgba(7, 5, 15, 0.34), rgba(7, 5, 15, 0.04), rgba(7, 5, 15, 0.68));
}

.dream-video-grain {
    opacity: 0.16;
    background-image:
        linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    mix-blend-mode: overlay;
}

.dream-portal-content {
    position: relative;
    z-index: 1;
    min-height: 430px;
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 2rem;
}

.dream-progress-orb {
    position: relative;
    width: 154px;
    height: 154px;
    flex: 0 0 154px;
}

.dream-progress-orb svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dream-progress-orb circle {
    fill: none;
    stroke-width: 9px;
    stroke-linecap: round;
}

.dream-ring-bg {
    stroke: rgba(255, 255, 255, 0.12);
}

.dream-ring-fill {
    stroke: var(--neon-blue);
    stroke-dasharray: 327;
    stroke-dashoffset: 327;
    filter: drop-shadow(0 0 12px rgba(90, 200, 250, 0.65));
    transition: stroke-dashoffset 0.7s ease;
}

.dream-progress-orb span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.2rem;
    font-weight: 900;
}

.dream-copy {
    max-width: 560px;
}

.dream-copy h2 {
    margin-top: 0.75rem;
    margin-bottom: 0.45rem;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.dream-copy p {
    color: var(--text-secondary);
    max-width: 48rem;
}

.dream-clarity-bar {
    width: min(440px, 100%);
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
}

.dream-clarity-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple), var(--neon-green));
    box-shadow: 0 0 18px rgba(90, 200, 250, 0.5);
    transition: width 0.7s ease;
}

#dream-sound-toggle {
    margin-left: auto;
    align-self: flex-start;
    white-space: nowrap;
}

/* Badge component */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-neon {
    background: rgba(90, 200, 250, 0.15);
    color: var(--neon-blue);
    border: 1px solid rgba(90, 200, 250, 0.25);
}
.badge-purple {
    background: rgba(175, 82, 222, 0.15);
    color: var(--neon-purple);
    border: 1px solid rgba(175, 82, 222, 0.25);
}

/* Views Layouts */
.view {
    display: none;
    flex-direction: column;
    flex: 1;
    width: 100%;
}
.view.active {
    display: flex;
}

/* Grid on Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}
.span-two-cols {
    grid-column: span 2;
}

/* Progress Ring Layout */
.ring-card-layout {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    gap: 2rem;
}
.ring-container {
    position: relative;
    width: 150px;
    height: 150px;
}
.progress-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}
.progress-ring-bg {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 14px;
}
.progress-ring-fill {
    fill: transparent;
    stroke: url(#ringGrad);
    stroke-width: 14px;
    stroke-dasharray: 534; /* 2 * PI * r (r=85) */
    stroke-dashoffset: 534;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-in-out;
}
.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.percent-label {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
}
.sub-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: -4px;
}
.ring-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stat-headline {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.stat-goal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.stat-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.stat-block:last-child {
    border-bottom: none;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.stat-val {
    font-size: 1.05rem;
    font-weight: 700;
}

/* Forecast layout on dashboard */
.forecast-headline-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}
.forecast-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.forecast-value {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 2px;
}
.forecast-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.chart-container {
    width: 100%;
    height: 120px;
    position: relative;
}
.mini-chart {
    width: 100% !important;
    height: 100% !important;
}

/* Recent transaction list */
.transaction-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.tx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.95rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition-smooth);
}
.tx-item:last-child {
    border-bottom: none;
}
.tx-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.tx-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.tx-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
/* Category icon box styles */
.cat-food { background: rgba(255, 59, 48, 0.15); color: #ff5e55; }
.cat-transport { background: rgba(90, 200, 250, 0.15); color: #64d2ff; }
.cat-entertainment { background: rgba(175, 82, 222, 0.15); color: #bf5af2; }
.cat-shopping { background: rgba(255, 149, 0, 0.15); color: #ff9f0a; }
.cat-bills { background: rgba(0, 199, 190, 0.15); color: #30d158; }
.cat-income { background: rgba(48, 209, 88, 0.15); color: #30d158; }

.tx-details {
    display: flex;
    flex-direction: column;
}
.tx-desc {
    font-size: 0.95rem;
    font-weight: 600;
}
.tx-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.tx-financial {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.tx-amount {
    font-size: 0.95rem;
    font-weight: 700;
}
.tx-xp-indicator {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--neon-green);
    margin-top: 2px;
}
.loading-placeholder {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Compact challenges list dashboard */
.challenges-compact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}
.challenge-compact-item {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 0.85rem 1rem;
}
.challenge-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.challenge-title {
    font-size: 0.85rem;
    font-weight: 700;
}
.challenge-progress-fraction {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.challenge-progress-bar-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    width: 100%;
    overflow: hidden;
}
.challenge-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-blue));
    border-radius: 2px;
}

/* --- VIEW: TRANSACTIONS (LEDGER) --- */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    gap: 1.5rem;
}
.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 320px;
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}
#tx-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.65rem 0.65rem 0.65rem 2.5rem;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}
#tx-search-input:focus {
    border-color: var(--neon-purple);
    background: rgba(255, 255, 255, 0.08);
}
.category-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 2px;
}
.filter-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
}
.filter-pill:hover, .filter-pill.active {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}
.filter-pill.active {
    background: var(--neon-purple);
    border-color: var(--neon-purple);
}

/* Ledger table styling */
.ledger-container .card-body {
    display: block;
    width: 100%;
}

.ledger-table-header {
    display: grid;
    grid-template-columns: minmax(96px, 120px) minmax(180px, 1fr) minmax(130px, 150px) minmax(110px, 130px) 48px;
    column-gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ledger-rows {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.ledger-row {
    display: grid;
    grid-template-columns: minmax(96px, 120px) minmax(180px, 1fr) minmax(130px, 150px) minmax(110px, 130px) 48px;
    column-gap: 1rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    align-items: center;
    transition: var(--transition-smooth);
}
.ledger-row:last-child {
    border-bottom: none;
}
.ledger-row:hover {
    background: rgba(255, 255, 255, 0.015);
}
.col-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 0;
}
.col-desc {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.col-category {
    display: flex;
    min-width: 0;
}
.col-amount {
    font-weight: 700;
    min-width: 0;
    text-align: right;
}
.col-actions {
    display: flex;
    justify-content: flex-end;
}
.btn-delete-tx {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 4px;
}
.btn-delete-tx:hover {
    color: var(--neon-pink);
}

/* category-pill badge */
.category-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- VIEW: TRENDS (FORECAST) --- */
.trends-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.75rem;
}
.detailed-chart-container {
    width: 100%;
    height: 300px;
    position: relative;
}
.detailed-chart {
    width: 100% !important;
    height: 100% !important;
}
.prediction-stats-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}
.stat-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
}
.stat-card-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}
.stat-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 4px;
    letter-spacing: -0.5px;
}
.trends-intro-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Budget Health List */
.budget-health-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}
.health-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.health-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
}
.health-category {
    font-weight: 700;
}
.health-nums {
    color: var(--text-secondary);
}
.health-progress-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    width: 100%;
    overflow: hidden;
}
.health-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease-out;
}
.fill-green { background: var(--neon-green); }
.fill-orange { background: var(--neon-orange); }
.fill-red { background: var(--neon-pink); }


/* --- VIEW: QUESTS & GOALS --- */
.goals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.goals-panel, .challenges-panel {
    display: flex;
    flex-direction: column;
}

.ai-studio-panel {
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    background: rgba(20, 16, 38, 0.65);
    backdrop-filter: blur(25px) saturate(180%);
}

.panel-caption {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ai-studio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.ai-model-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 210px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.035);
}

.ai-model-card h3 {
    margin: 0;
    font-size: 1rem;
}

.ai-model-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.45;
}

.ai-model-card .btn {
    margin-top: auto;
}

.model-tag {
    width: fit-content;
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    background: rgba(175, 82, 222, 0.14);
    border: 1px solid rgba(175, 82, 222, 0.25);
    color: var(--neon-purple);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.ai-studio-output {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(90, 200, 250, 0.18);
    background: rgba(90, 200, 250, 0.06);
    color: var(--text-secondary);
    line-height: 1.55;
}

.ai-studio-output strong {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--text-primary);
}

.ai-studio-output ul {
    margin: 0;
    padding-left: 1.1rem;
}

.ai-studio-output li {
    margin-bottom: 0.45rem;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.panel-subtitle {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* Goals Render items */
.goals-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.goal-item-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    position: relative;
    transition: var(--transition-smooth);
}
.goal-item-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}
.goal-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.goal-item-title {
    font-size: 1rem;
    font-weight: 700;
}
.btn-delete-goal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px;
    transition: var(--transition-smooth);
}
.btn-delete-goal:hover {
    color: var(--neon-pink);
}
.goal-nums-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 1rem;
}
.goal-current-amt {
    font-size: 1.4rem;
    font-weight: 800;
}
.goal-target-amt {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.goal-progress-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}
.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-teal), var(--neon-blue));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease-out;
}
.goal-video-chip {
    display: inline-flex;
    margin-top: 0.65rem;
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    background: rgba(90, 200, 250, 0.12);
    border: 1px solid rgba(90, 200, 250, 0.22);
    color: var(--neon-blue);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.goal-video-chip.muted {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}
.goal-input-quick-add {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.goal-input-quick-add input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    flex: 1;
}
.goal-input-quick-add input:focus {
    border-color: var(--neon-teal);
}

/* Challenges board items */
.challenges-board-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.challenge-card {
    background: rgba(22, 17, 44, 0.5);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    transition: var(--transition-smooth);
}
.challenge-card.completed {
    border-color: rgba(48, 209, 88, 0.25);
    background: rgba(48, 209, 88, 0.03);
}
.challenge-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--neon-purple);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}
.challenge-checkbox.checked {
    background: var(--neon-purple);
    border-color: var(--neon-purple);
}
.challenge-checkbox svg {
    color: white;
    width: 14px;
    height: 14px;
    display: none;
}
.challenge-checkbox.checked svg {
    display: block;
}
.challenge-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.challenge-title-text {
    font-size: 1rem;
    font-weight: 700;
}
.challenge-desc-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.challenge-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.challenge-pbar-container {
    flex: 1;
    max-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.challenge-pbar-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    width: 100%;
}
.challenge-pbar-fill {
    height: 100%;
    background: var(--grad-button);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.challenge-pbar-txt {
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.challenge-reward-badge {
    background: rgba(48, 209, 88, 0.12);
    color: var(--neon-green);
    border: 1px solid rgba(48, 209, 88, 0.2);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
}


/* --- VIEW: AI CHAT (Z-BOT) --- */
.chat-container-layout {
    display: flex;
    flex-direction: column;
    height: 60vh;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}
.chat-messages-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scroll-behavior: smooth;
}

/* Chat bubble styling */
.chat-bubble {
    display: flex;
    gap: 0.75rem;
    max-width: 75%;
    animation: slideUpFade 0.3s ease-out;
}
.chat-bubble.bot {
    align-self: flex-start;
}
.chat-bubble.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-avatar.bot-avatar {
    border: 1.5px solid var(--neon-purple);
}
.chat-avatar.user-avatar {
    border: 1.5px solid var(--neon-blue);
}
.chat-message-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 0.85rem 1.1rem;
    font-size: 0.9rem;
    line-height: 1.45;
}
.chat-bubble.bot .chat-message-content {
    border-top-left-radius: 2px;
    background: rgba(255, 255, 255, 0.02);
}
.chat-bubble.user .chat-message-content {
    border-top-right-radius: 2px;
    background: rgba(175, 82, 222, 0.12);
    border-color: rgba(175, 82, 222, 0.18);
}
.chat-message-content p {
    margin-bottom: 0.5rem;
}
.chat-message-content p:last-child {
    margin-bottom: 0;
}
.chat-message-content ul {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.chat-message-content li {
    margin-bottom: 0.25rem;
}
.chat-message-content blockquote {
    border-left: 3px solid var(--neon-purple);
    padding-left: 0.75rem;
    margin: 0.75rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Chat suggestions Row */
.chat-suggestions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    overflow-x: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(0, 0, 0, 0.1);
}
.suggestion-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.45rem 0.85rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-family: var(--font-sans);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
}
.suggestion-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: white;
}

/* Chat Input Row */
.chat-input-row {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(13, 9, 29, 0.4);
    align-items: center;
}
.chat-input-row input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 0.75rem 1.25rem;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}
.chat-input-row input:focus {
    border-color: var(--neon-purple);
    background: rgba(255, 255, 255, 0.08);
}


/* --- VIEW: SETTINGS --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.form-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
    width: 100%;
}
.form-control:focus {
    border-color: var(--neon-purple);
    background: rgba(255, 255, 255, 0.08);
}
.budget-settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.form-group-budget {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.form-group-budget label {
    font-size: 0.95rem;
    font-weight: 600;
}
.form-control-inline {
    width: 120px;
    text-align: right;
}
.form-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0.5rem 0;
}
.button-row {
    display: flex;
    gap: 1rem;
}


/* --- MODALS LAYOUT --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 5, 15, 0.75);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.modal-card {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-large {
    max-width: 640px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.25px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
.form-row {
    display: flex;
    gap: 1rem;
}
.category-selection-wrapper {
    position: relative;
    width: 100%;
}
.ai-status-bubble {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(175, 82, 222, 0.15);
    border: 1px solid rgba(175, 82, 222, 0.25);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neon-purple);
    pointer-events: none;
}
.ai-status-pulse {
    width: 6px;
    height: 6px;
    background: var(--neon-purple);
    border-radius: 50%;
    animation: pulse 1s infinite alternate;
}
.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}


/* Camera Viewport */
.camera-viewport-container {
    width: 100%;
    height: 360px;
    background: #000;
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.camera-video-element, .camera-canvas-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.camera-fallback-screen {
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.pulse-opacity {
    animation: pulseOpacity 2s infinite ease-in-out;
}

/* Scanner Beam */
.scanner-laser {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--neon-pink), transparent);
    box-shadow: 0 0 12px var(--neon-pink);
    animation: scan 2.5s linear infinite;
    pointer-events: none;
}

.camera-controls-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(0, 0, 0, 0.4);
}
.btn-shutter {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: 3px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.btn-shutter:hover {
    transform: scale(1.05);
}
.btn-shutter:active {
    transform: scale(0.95);
}
.shutter-inner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: white;
    border: 2px solid black;
}


/* --- LEVEL UP SPLASH CELEBRATION --- */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 5, 15, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.splash-content {
    text-align: center;
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.splash-badge {
    background: var(--grad-primary);
    padding: 0.4rem 1.25rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    box-shadow: 0 0 20px rgba(175, 82, 222, 0.4);
}
.splash-title {
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    margin-top: 1rem;
    background: linear-gradient(135deg, white, #ffb3ff, #64d2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.2));
}
.splash-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-purple);
    margin-top: 0.5rem;
}
.splash-xp-reward {
    background: rgba(48, 209, 88, 0.15);
    color: var(--neon-green);
    border: 1px solid rgba(48, 209, 88, 0.3);
    padding: 0.5rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    margin-top: 2rem;
}

/* Confetti particles */
.confetti-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}
.confetti-particle {
    position: absolute;
    width: 8px;
    height: 14px;
    background: #ffd300;
    opacity: 0.8;
    border-radius: 2px;
    animation: fall 3s infinite linear;
}

.dream-confetti-container {
    position: fixed;
    inset: 0;
    z-index: 1100;
    pointer-events: none;
    overflow: hidden;
}

.dream-confetti-piece {
    position: absolute;
    top: -20px;
    width: 9px;
    height: 16px;
    border-radius: 2px;
    animation: dreamConfettiFall 2.8s linear forwards;
}


/* --- MOBILE UI SYSTEM (RESPONSIVE) --- */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: rgba(13, 9, 29, 0.92);
    border-top: 1px solid var(--card-border);
    backdrop-filter: blur(25px);
    z-index: 90;
    justify-content: space-around;
    align-items: center;
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    padding: 8px 16px;
}
.mobile-nav-item.active {
    color: var(--neon-purple);
}
.mobile-nav-item svg {
    transition: var(--transition-smooth);
}
.mobile-nav-item.active svg {
    color: var(--neon-purple);
    transform: translateY(-2px);
}

.fab-btn {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--grad-button);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
    z-index: 85;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.fab-btn:active {
    transform: scale(0.9);
}


/* Media Queries */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .span-two-cols {
        grid-column: span 1;
    }
    .trends-grid {
        grid-template-columns: 1fr;
    }
    .goals-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .ai-studio-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 64px; /* for mobile bottom nav */
    }
    
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none; /* hide sidebar on mobile */
    }
    
    .mobile-nav {
        display: flex; /* show bottom bar on mobile */
    }
    
    .fab-btn {
        display: flex; /* show FAB on mobile */
    }
    
    .content-container {
        padding: 1.5rem;
    }
    
    .content-header {
        margin-bottom: 1.75rem;
    }
    
    .header-title {
        font-size: 1.75rem;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.85rem;
    }
    .search-input-wrapper {
        max-width: 100%;
    }
    
    .ledger-table-header {
        display: none; /* hide table headers on mobile */
    }
    .ledger-row {
        grid-template-columns: 1fr 80px;
        column-gap: 0.75rem;
        grid-template-areas: 
            "desc amount"
            "date category"
            "actions actions";
        row-gap: 6px;
        padding: 1rem 0.85rem;
        border-radius: var(--border-radius-sm);
        background: rgba(255, 255, 255, 0.015);
        border: 1px solid rgba(255, 255, 255, 0.04);
        margin-bottom: 0.75rem;
    }
    .col-date {
        grid-area: date;
    }
    .col-desc {
        grid-area: desc;
        font-size: 0.95rem;
        white-space: normal;
    }
    .col-category {
        grid-area: category;
        justify-content: flex-end;
    }
    .col-amount {
        grid-area: amount;
        font-size: 1rem;
    }
    .col-actions {
        grid-area: actions;
        border-top: 1px solid rgba(255, 255, 255, 0.04);
        padding-top: 6px;
        margin-top: 4px;
        justify-content: flex-end;
    }
    
    .ring-card-layout {
        flex-direction: column !important;
        gap: 1.5rem;
        text-align: center;
    }
    .dream-portal-content {
        min-height: 520px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-end;
    }
    #dream-sound-toggle {
        margin-left: 0;
        align-self: flex-start;
    }
    .ring-stats {
        width: 100%;
    }
    
    .prediction-stats-row {
        flex-direction: column;
    }
    
    .button-row {
        flex-direction: column;
    }
    
    .chat-container-layout {
        height: 68vh;
    }
    .chat-bubble {
        max-width: 85%;
    }
}


/* --- ANIMATIONS DEFINITIONS --- */
@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.4; }
    100% { transform: scale(1.1); opacity: 1; }
}
@keyframes pulseOpacity {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}
@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); opacity: 0.8; }
    80% { transform: scale(0.95); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes fall {
    0% { top: -20px; transform: rotate(0deg); }
    100% { top: 105%; transform: rotate(360deg); }
}
@keyframes dreamConfettiFall {
    0% { transform: translate3d(0, -20px, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate3d(var(--drift), 108vh, 0) rotate(760deg); opacity: 0.9; }
}

.animate-fade-in {
    animation: slideUpFade 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
