/* =====================================================
   EXPENSE TRACKER MY - FULL WEBSITE STYLES
   Responsive design: Desktop-first with mobile support
   ===================================================== */

/* CSS Variables */
:root {
    color-scheme: dark;
    /* Colors - Dark Theme */
    --bg-primary: #0b1220;
    --bg-secondary: #111c2d;
    --bg-tertiary: #1b2b42;
    --bg-card: rgba(9, 17, 30, 0.72);
    --bg-glass: rgba(9, 17, 30, 0.6);
    --bg-sidebar: rgba(9, 17, 30, 0.75);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #a6b1c7;
    --text-muted: #7f8ba3;

    /* Accent Colors */
    --accent-primary: #22d3ee;
    --accent-secondary: #f59e0b;
    --accent-gradient: linear-gradient(135deg, #22d3ee 0%, #f59e0b 100%);

    /* Status Colors */
    --color-income: #34d399;
    --color-income-bg: rgba(52, 211, 153, 0.15);
    --color-expense: #f87171;
    --color-expense-bg: rgba(248, 113, 113, 0.15);
    --color-balance: #60a5fa;
    --color-balance-bg: rgba(96, 165, 250, 0.15);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(34, 211, 238, 0.25);
    --shadow-card: 0 10px 30px rgba(3, 8, 20, 0.45);

    /* Border */
    --border-color: rgba(226, 232, 240, 0.08);
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 72px;

    /* Typography */
    --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-family-display: 'Space Grotesk', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    --font-size-4xl: 40px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #0b1220 0%, #0c1b2a 50%, #0b1220 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    /* overflow-x: hidden; */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25);
}

/* Animated Background */
.bg-gradient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #22d3ee, #38bdf8);
    top: -200px;
    left: -150px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #14b8a6, #34d399);
    top: 50%;
    left: 60%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

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

/* =====================================================
   LOADING OVERLAY
   ===================================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading */
.skeleton-loader {
    width: 100%;
    height: 100%;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.skeleton {
    background: var(--bg-tertiary);
    background: linear-gradient(110deg, var(--bg-secondary) 8%, var(--bg-tertiary) 18%, var(--bg-secondary) 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: var(--border-radius-sm);
}

.skeleton-text {
    height: 1rem;
    width: 60%;
    margin-bottom: 0.5rem;
}

.skeleton-rect {
    width: 100%;
    height: 100px;
    border-radius: var(--border-radius);
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

.loading-overlay {
    /* Updated to allow skeleton visibility if needed, or we replace content inside */
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    /* Keeps opaque background */
    display: flex;
    /* justify-content: center; */
    /* Remove center alignment for skeleton layout */
    /* align-items: center; */
    padding: 0;
}

.loading-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
}

.skeleton-sidebar {
    width: 280px;
    height: 100%;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-lg);
}

.skeleton-main {
    flex: 1;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* =====================================================
   APP LAYOUT
   ===================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.logo-text {
    font-size: var(--font-size-xl);
    font-weight: 700;
    font-family: var(--font-family-display);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-close-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--border-radius-sm);
}

.btn-close-sidebar:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link svg {
    width: 22px;
    height: 22px;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 8px 18px rgba(34, 211, 238, 0.25);
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-sm);
}

.user-info svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.btn-add-transaction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: var(--font-family-display);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-mobile-actions {
    display: none;
    /* Hidden on desktop */
}

/* Base styles for sidebar action buttons */
.sidebar-action-btn {
    width: 100%;
    justify-content: flex-start;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    /* Remove padding override to match .nav-link, or keep if intended */
    /* padding: var(--space-sm) var(--space-md); */
}

.btn-add-transaction:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-add-transaction svg {
    width: 20px;
    height: 20px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =====================================================
   MOBILE BOTTOM NAVIGATION - 'Vision Dock' (iOS 26 Concept)
   ===================================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 var(--space-md) calc(20px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
    justify-content: center;
}

.bottom-nav-container {
    width: 100%;
    max-width: 360px;
    height: 64px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;

    /* Vision Glass Material */
    background: rgba(30, 30, 32, 0.75);
    backdrop-filter: blur(25px) saturate(200%) brightness(1.2);
    -webkit-backdrop-filter: blur(25px) saturate(200%) brightness(1.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 32px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    pointer-events: auto;
}

/* Container for nav items */
.bottom-nav-actions {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.bottom-nav-btn {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Spring animation */
    -webkit-tap-highlight-color: transparent;
}

/* Fluid Press State */
.bottom-nav-btn:active {
    transform: scale(0.85);
    background: rgba(255, 255, 255, 0.08);
}

.bottom-nav-btn i,
.bottom-nav-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hide labels for the Vision look */
.bottom-nav-btn span {
    display: none;
}

/* Active State - Glow & Fill */
.bottom-nav-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.bottom-nav-btn.active i,
.bottom-nav-btn.active svg {
    transform: scale(1.1);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

/* Active indicator dot - Removed for cleaner look, relying on bg and glow */
.bottom-nav-btn.active::after {
    display: none;
}

/* CENTRAL FAB (Integrated) */
.fab-dock-item {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-top: -24px;
    /* Breaks the top edge */
    background: var(--accent-gradient);
    box-shadow:
        0 8px 16px rgba(34, 211, 238, 0.35),
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(22, 22, 24, 1);
    /* fake border matching page bg to cut dock */
    display: flex;
    /* Always flex since we integrate it */
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 1002;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
}

.fab-dock-item:active {
    transform: scale(0.9);
}

.fab-dock-item i,
.fab-dock-item svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
}


/* Hide legacy separate FAB */
.fab {
    display: none !important;
}

/* Hide legacy mobile add button */
.btn-add-mobile {
    display: none;
}

/* =====================================================
   THE END
   ===================================================== */
.top-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.btn-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--border-radius-sm);
}

.btn-menu svg {
    width: 24px;
    height: 24px;
}

.btn-menu:hover {
    background: var(--bg-tertiary);
}

.page-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    font-family: var(--font-family-display);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.period-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-tertiary);
    padding: var(--space-sm);
    border-radius: var(--border-radius);
}

.btn-period-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-period-nav svg {
    width: 18px;
    height: 18px;
}

.btn-period-nav:hover {
    background: var(--accent-primary);
}

.period-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    min-width: 160px;
    text-align: center;
}

.btn-icon-header {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-icon-header svg {
    width: 20px;
    height: 20px;
}

.btn-icon-header:hover {
    background: var(--accent-primary);
    color: white;
}

/* Language Toggle Button */
.btn-lang-toggle {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 36px;
    text-align: center;
}

.btn-lang-toggle:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* =====================================================
   VIEW CONTENT
   ===================================================== */
.view-content {
    display: none;
    padding: var(--space-xl);
    flex-direction: column;
    gap: var(--space-xl);
}

.view-content.active {
    display: flex;
}

.view-header-bar {
    margin-bottom: var(--space-md);
}

.view-header-bar h2 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    font-family: var(--font-family-display);
}

/* =====================================================
   SUMMARY CARDS
   ===================================================== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.summary-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    padding: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.summary-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.18);
    box-shadow: 0 14px 36px rgba(3, 8, 20, 0.55);
}

.card-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon-wrapper svg {
    width: 28px;
    height: 28px;
}

.card-icon-wrapper.income {
    background: var(--color-income-bg);
    color: var(--color-income);
}

.card-icon-wrapper.expense {
    background: var(--color-expense-bg);
    color: var(--color-expense);
}

.card-icon-wrapper.balance {
    background: var(--color-balance-bg);
    color: var(--color-balance);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.card-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    font-family: var(--font-family-display);
}

.summary-card.income .card-value {
    color: var(--color-income);
}

.summary-card.expense .card-value {
    color: var(--color-expense);
}

.summary-card.balance .card-value {
    color: var(--color-balance);
}

/* =====================================================
   DASHBOARD GRID
   ===================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.dashboard-left,
.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.18);
    box-shadow: 0 14px 36px rgba(3, 8, 20, 0.55);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    font-family: var(--font-family-display);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-text:hover {
    color: var(--accent-secondary);
}

.card-body {
    padding: var(--space-lg);
}

/* =====================================================
   CHARTS
   ===================================================== */
.chart-container {
    height: 280px;
    position: relative;
}

.chart-container.chart-bar {
    height: 220px;
}

/* =====================================================
   TRANSACTIONS LIST
   ===================================================== */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.transaction-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.transaction-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transaction-icon svg {
    width: 22px;
    height: 22px;
}

.transaction-details {
    flex: 1;
    min-width: 0;
}

.transaction-category {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.transaction-amount {
    font-size: var(--font-size-lg);
    font-weight: 600;
    text-align: right;
}

.transaction-amount.expense {
    color: var(--color-expense);
}

.transaction-amount.income {
    color: var(--color-income);
}

/* =====================================================
   CATEGORY LIST
   ===================================================== */
.category-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.category-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 20px;
    height: 20px;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.category-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-base);
}

.category-amount {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-secondary);
}

/* =====================================================
   YTD CARD
   ===================================================== */
.ytd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.ytd-item {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.ytd-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

.ytd-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    font-family: var(--font-family-display);
}

.ytd-value.income {
    color: var(--color-income);
}

.ytd-value.expense {
    color: var(--color-expense);
}

/* =====================================================
   YEARLY STATS
   ===================================================== */
.yearly-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.stat-item {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-item.full {
    grid-column: 1 / -1;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.stat-value.income {
    color: var(--color-income);
}

.stat-value.expense {
    color: var(--color-expense);
}

/* Year Selector Dropdown */
.year-select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.year-select:hover {
    border-color: var(--accent-primary);
}

.year-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Report Tabs */
.report-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    background: var(--bg-secondary);
    padding: var(--space-sm);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.report-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.report-tab svg {
    width: 20px;
    height: 20px;
}

.report-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.report-tab.active {
    background: var(--accent-gradient);
    color: white;
}

/* Report Panels */
.report-panel {
    display: none;
}

.report-panel.active {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Report Year Header */
.report-year-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.report-year-header h2 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 0;
}

/* Report Panel Summary Grid */
.report-panel .summary-grid {
    gap: var(--space-xl);
}

/* Report Dashboard Grid */
.report-panel .dashboard-grid {
    margin-top: 0;
}

/* Report Period Header */
.report-period-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.report-period-info {
    text-align: center;
    min-width: 200px;
}

.report-period-info h2 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0 0 var(--space-xs) 0;
}

.period-label-detail {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Card Change Indicator */
.card-change {
    display: block;
    font-size: var(--font-size-xs);
    margin-top: var(--space-xs);
}

.card-change.positive {
    color: var(--color-income);
}

.card-change.negative {
    color: var(--color-expense);
}

.card-change.neutral {
    color: var(--text-muted);
}

/* =====================================================
   INSIGHTS GRID
   ===================================================== */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 1024px) {
    .insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }
}

.insight-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.insight-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--border-radius-sm);
    color: white;
}

.insight-icon svg {
    width: 24px;
    height: 24px;
}

.insight-icon.top-category {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.insight-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.insight-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.insight-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-family-display);
}

.insight-value.positive {
    color: var(--color-income);
}

.insight-value.negative {
    color: var(--color-expense);
}

/* Big Stat Card */
.monthly-avg-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
}

.big-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    font-family: var(--font-family-display);
}

.stat-sublabel {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* =====================================================
   CATEGORY BREAKDOWN
   ===================================================== */
.category-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.category-breakdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.category-breakdown-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-breakdown-icon svg {
    width: 18px;
    height: 18px;
}

.category-breakdown-info {
    flex: 1;
}

.category-breakdown-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.category-breakdown-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.category-breakdown-fill {
    height: 100%;
    border-radius: 2px;
}

.category-breakdown-amount {
    text-align: right;
}

.category-breakdown-amount .category-breakdown-percent {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Expandable Category Trend Styles */
.category-breakdown-wrapper {
    border-radius: var(--border-radius-sm);
    transition: background 0.2s ease;
}

.category-breakdown-wrapper:hover {
    background: var(--bg-tertiary);
}

.category-breakdown-item.clickable {
    cursor: pointer;
    padding: var(--space-sm) var(--space-xs);
    border-radius: var(--border-radius-sm);
    transition: background 0.2s ease;
}

.category-breakdown-chevron {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    margin-left: var(--space-sm);
}

.category-breakdown-chevron svg {
    width: 16px;
    height: 16px;
}

.category-breakdown-wrapper.expanded .category-breakdown-chevron {
    transform: rotate(180deg);
}

.category-trend-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-top: 0;
}

.category-trend-container.active {
    max-height: 600px;
    padding: var(--space-md);
    opacity: 1;
    margin-top: var(--space-sm);
    border: 1px solid var(--border-color);
}

.category-trend-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.category-trend-header {
    margin-bottom: var(--space-md);
}

.category-trend-header h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.category-trend-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.category-trend-charts.single-chart {
    grid-template-columns: 1fr;
}

.category-trend-charts.single-chart .trend-chart-container {
    height: 200px;
}

.trend-chart-section h5 {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 0 var(--space-sm) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trend-chart-container {
    height: 150px;
    position: relative;
}

.category-trend-error {
    padding: var(--space-md);
    text-align: center;
    color: var(--color-expense);
}

/* Mobile: Stack trend charts vertically */
@media (max-width: 768px) {
    .category-trend-charts {
        grid-template-columns: 1fr;
    }

    .category-trend-container.active {
        max-height: 800px;
    }

    .trend-chart-container {
        height: 180px;
    }
}

/* =====================================================
   TOP EXPENSES
   ===================================================== */
.top-expenses-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.top-expense-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.top-expense-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.top-expense-info {
    flex: 1;
}

.top-expense-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.top-expense-date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.top-expense-amount {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-expense);
}

/* =====================================================
   FLOATING ACTION BUTTON
   ===================================================== */
.fab {
    display: none;
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: var(--accent-gradient);
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    z-index: 50;
    transition: all var(--transition-fast);
}

.fab svg {
    width: 28px;
    height: 28px;
}

.fab:hover {
    transform: scale(1.1);
}

.fab:active {
    transform: scale(0.95);
}

/* =====================================================
   MODALS
   ===================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-base);
    overflow: hidden;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content.modal-lg {
    max-width: 640px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-close svg {
    width: 18px;
    height: 18px;
}

.btn-close:hover {
    background: var(--color-expense);
    color: white;
}

.modal-body {
    padding: var(--space-lg);
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* =====================================================
   FORMS
   ===================================================== */
.type-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.type-tab {
    flex: 1;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.type-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.type-tab[data-type="expense"].active {
    background: var(--color-expense);
    border-color: var(--color-expense);
}

.type-tab[data-type="income"].active {
    background: var(--color-income);
    border-color: var(--color-income);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.form-group input[type="color"] {
    height: 48px;
    padding: var(--space-xs);
    cursor: pointer;
}

/* Date Input - Enhanced Styling */
.form-group input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    padding-right: 48px;
    cursor: pointer;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.8;
    cursor: pointer;
    filter: none;
}

.form-group input[type="date"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

.form-group input[type="date"]::-webkit-datetime-edit {
    color: var(--text-primary);
}

.form-group input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.form-group input[type="date"]::-webkit-datetime-edit-text,
.form-group input[type="date"]::-webkit-datetime-edit-month-field,
.form-group input[type="date"]::-webkit-datetime-edit-day-field,
.form-group input[type="date"]::-webkit-datetime-edit-year-field {
    color: var(--text-primary);
}

/* Dark theme for date picker popup */
::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    filter: invert(0.6);
}

/* Custom Date Picker Popup */
.datepicker-popup {
    position: fixed;
    z-index: 1000;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.datepicker-popup.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.datepicker-title {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.datepicker-nav {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.datepicker-nav:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.datepicker-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.datepicker-days-header span {
    text-align: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: var(--space-sm);
}

.datepicker-day {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.datepicker-day:hover:not(.other-month):not(.selected) {
    background: var(--bg-tertiary);
}

.datepicker-day.other-month {
    color: var(--text-muted);
    opacity: 0.4;
    cursor: default;
}

.datepicker-day.today {
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.datepicker-day.selected {
    background: var(--accent-gradient);
    color: white;
}

.datepicker-footer {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.datepicker-today {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.datepicker-today:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Icon Picker Grid */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    max-height: 200px;
    overflow-y: auto;
}

.icon-picker-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    border: 2px solid transparent;
    transition: all 0.15s ease;
    color: var(--text-secondary);
}

.icon-picker-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.icon-picker-item.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.icon-picker-item svg {
    width: 20px;
    height: 20px;
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.btn-primary {
    flex: 1;
    align-items: center;
    padding: var(--space-md) var(--space-sm);
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: var(--font-family-display);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
    margin-bottom: var(--space-sm);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
}

.btn-danger {
    padding: var(--space-md);
    background: var(--color-expense-bg);
    border: 1px solid var(--color-expense);
    border-radius: var(--border-radius-sm);
    color: var(--color-expense);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: var(--color-expense);
    color: white;
}

.btn-danger svg {
    width: 18px;
    height: 18px;
}

.btn-icon-left {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

/* =====================================================
   SETTINGS
   ===================================================== */
.settings-group {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
}

.settings-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-group h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.app-info {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Day Picker for Salary Day */
.day-picker {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    margin-top: var(--space-sm);
}

.day-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.day-picker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.day-picker-day:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.day-picker-day.selected {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.day-picker-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.day-picker-day.disabled:hover {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transform: none;
}

.day-picker-last {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
}

.day-picker-last:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.day-picker-last.selected {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.day-picker-last svg {
    width: 16px;
    height: 16px;
}

.day-picker-selected {
    margin-top: var(--space-md);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.day-picker-selected strong {
    color: var(--accent-primary);
    font-size: var(--font-size-lg);
    margin-left: var(--space-xs);
}

/* =====================================================
   CATEGORY MANAGEMENT
   ===================================================== */
.category-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.category-tab {
    flex: 1;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.category-manage-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    max-height: 400px;
    overflow-y: auto;
}

.category-manage-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-manage-item:hover {
    background: var(--bg-secondary);
}

.category-manage-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-manage-icon svg {
    width: 20px;
    height: 20px;
}

.category-manage-info {
    flex: 1;
}

.category-manage-name {
    font-size: var(--font-size-base);
    font-weight: 500;
}

.category-manage-edit {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-manage-edit:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-md);
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state-text {
    font-size: var(--font-size-base);
    color: var(--text-muted);
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--color-income);
    color: var(--color-income);
}

.toast.error {
    border-color: var(--color-expense);
    color: var(--color-expense);
}

/* =====================================================
   UTILITIES
   ===================================================== */
.hidden {
    display: none !important;
}

.cat-icon {
    width: 20px;
    height: 20px;
}

/* =====================================================
   DEBT TRACKING
   ===================================================== */

/* View Header Actions */
.view-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.view-header-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-secondary-sm {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all var(--transition-fast);
}

.btn-secondary-sm:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary-sm svg {
    width: 16px;
    height: 16px;
}

.btn-primary-sm {
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: var(--font-family-display);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all var(--transition-fast);
}

.btn-primary-sm:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-primary-sm svg {
    width: 14px;
    height: 14px;
}

/* Debt Tabs */
.debt-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.debt-tab {
    flex: 1;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
}

.debt-tab svg {
    width: 16px;
    height: 16px;
}

.debt-tab:hover {
    background: var(--bg-secondary);
}

.debt-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.debt-tab[data-debt-type="payable"].active {
    background: var(--color-expense);
    border-color: var(--color-expense);
}

.debt-tab[data-debt-type="receivable"].active {
    background: var(--color-income);
    border-color: var(--color-income);
}

/* Debt Summary Card */
.debt-summary-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.debt-summary-item {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.debt-summary-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debt-summary-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.debt-summary-item.payable .debt-summary-value {
    color: var(--color-expense);
}

.debt-summary-item.receivable .debt-summary-value {
    color: var(--color-income);
}

.debt-summary-item.installment .debt-summary-value {
    color: var(--accent-primary);
}

/* Debt Panels */
.debt-panel {
    display: none;
}

.debt-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.panel-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

/* Debt List */
.debt-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Debt Card */
.debt-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: var(--space-lg);
    transition: all var(--transition-fast);
}

.debt-card:hover {
    border-color: var(--accent-primary);
}

.debt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.debt-card-info {
    flex: 1;
}

.debt-card-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.debt-card-description {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.debt-card-amount {
    text-align: right;
}

.debt-card-current {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.debt-card.payable .debt-card-current {
    color: var(--color-expense);
}

.debt-card.receivable .debt-card-current {
    color: var(--color-income);
}

.debt-card-original {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Progress Bar */
.debt-progress {
    margin-bottom: var(--space-md);
}

.debt-progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.debt-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width var(--transition-base);
}

.debt-card.payable .debt-progress-fill {
    background: var(--color-expense);
}

.debt-card.receivable .debt-progress-fill {
    background: var(--color-income);
}

.debt-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Debt Card Meta */
.debt-card-meta {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.debt-card-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.debt-card-meta-item svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.debt-card-meta-item.due-soon {
    color: var(--color-warning);
}

.debt-card-meta-item.due-soon svg {
    color: var(--color-warning);
}

/* Debt Card Actions */
.debt-card-actions {
    display: flex;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.btn-debt-action {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all var(--transition-fast);
}

.btn-debt-action:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-debt-action svg {
    width: 14px;
    height: 14px;
}

/* Expand toggle button */
.btn-expand-toggle .expand-icon {
    transition: transform 0.3s ease;
}

/* Expandable Debt Card History */
.debt-card-history {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    border-top: 1px solid transparent;
    margin-top: 0;
}

.debt-card-history.expanded {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
}

.debt-history-loading {
    text-align: center;
    padding: var(--space-md);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.debt-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    color: var(--text-muted);
}

.debt-history-empty svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.debt-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.debt-history-count {
    background: var(--accent-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--font-size-xs);
}

.debt-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.debt-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.debt-history-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.debt-history-date {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.debt-history-notes {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.debt-history-amount {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-income);
}

.debt-history-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.btn-icon-sm:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-icon-sm.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-expense);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-icon-sm svg {
    width: 14px;
    height: 14px;
}

/* Installment Card */
.installment-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: var(--space-lg);
    transition: all var(--transition-fast);
}

.installment-card:hover {
    border-color: var(--accent-primary);
}

.installment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.installment-card-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.installment-card-type {
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.installment-card-type.epp {
    background: rgba(34, 211, 238, 0.2);
    color: var(--accent-primary);
}

.installment-card-type.balance_transfer {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.installment-card-bank {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.installment-card-amounts {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.installment-amount-item {
    text-align: center;
}

.installment-amount-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.installment-amount-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.installment-progress {
    margin-bottom: var(--space-md);
}

.installment-progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.installment-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width var(--transition-base);
}

.installment-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.installment-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.installment-payment-day {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.installment-payment-day svg {
    width: 14px;
    height: 14px;
}

/* Credit Card List */
.credit-card-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-height: 400px;
    overflow-y: auto;
}

.credit-card-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.credit-card-item:hover {
    background: var(--bg-secondary);
}

.credit-card-icon {
    width: 48px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.credit-card-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.credit-card-info {
    flex: 1;
}

.credit-card-name {
    font-size: var(--font-size-base);
    font-weight: 500;
}

.credit-card-number {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Payment Info */
.payment-info {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.payment-info-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.payment-info-name {
    font-weight: 600;
}

.payment-info-balance {
    font-weight: 600;
    color: var(--color-expense);
}

.payment-info-original {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Payment History */
.payment-history {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.payment-history h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

#payment-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 200px;
    overflow-y: auto;
}

.payment-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.payment-history-date {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.payment-history-notes {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.payment-history-amount {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-income);
    margin-right: var(--space-sm);
}

.btn-payment-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-payment-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-expense);
}

.btn-payment-delete svg {
    width: 16px;
    height: 16px;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* Checkbox Group */
.checkbox-group {
    margin-top: var(--space-md);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.checkbox-label span {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Empty debt state */
.debt-empty {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.debt-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

@media (max-width: 768px) {
    .debt-tabs {
        flex-wrap: wrap;
    }

    .debt-tab {
        flex: 1 1 calc(50% - var(--space-xs));
    }

    .debt-summary-card {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .debt-card-meta {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .installment-card-amounts {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .installment-amount-item {
        display: flex;
        justify-content: space-between;
        text-align: left;
    }
}

/* =====================================================
   RESPONSIVE - TABLET
   ===================================================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .view-content {
        padding: var(--space-lg);
    }
}

/* =====================================================
   RESPONSIVE - MOBILE
   ===================================================== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --header-height: 64px;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .btn-close-sidebar {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    /* Main wrapper takes full width */
    .main-wrapper {
        margin-left: 0;
    }

    /* Show hamburger menu */
    .btn-menu {
        display: flex;
    }

    /* Adjust header */
    .top-header {
        padding: 0 var(--space-md);
        flex-wrap: wrap;
        height: auto;
        padding-top: var(--space-md);
        padding-bottom: var(--space-md);
        gap: var(--space-md);
    }

    .header-left {
        width: 100%;
        order: 1;
    }

    .header-right {
        width: 100%;
        order: 2;
        justify-content: space-between;
    }

    /* Hide header settings/lang on mobile */
    .header-right #btn-lang-toggle,
    .header-right #btn-settings {
        display: none;
    }

    /* Show sidebar mobile actions */
    .sidebar-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
        margin-top: var(--space-sm);
        border-top: 1px solid var(--border-color);
        padding-top: var(--space-sm);
    }

    /* Make sidebar scrollable on mobile */
    .sidebar {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-nav {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .sidebar-footer {
        flex-shrink: 0;
        padding-bottom: env(safe-area-inset-bottom, var(--space-md));
    }

    .period-selector {
        flex: 1;
    }

    .period-label {
        min-width: auto;
        font-size: var(--font-size-xs);
    }

    /* Hide desktop settings in header */
    #btn-settings,
    #btn-export {
        display: none;
    }

    /* Summary cards stack on mobile */
    .summary-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .summary-card {
        padding: var(--space-lg);
    }

    .card-value {
        font-size: var(--font-size-xl);
    }

    /* View content padding */
    .view-content {
        padding: var(--space-md);
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
        gap: var(--space-lg);
    }

    /* Card adjustments */
    .card-header {
        padding: var(--space-md);
    }

    .card-body {
        padding: var(--space-md);
    }

    /* Charts smaller */
    .chart-container {
        height: 220px;
    }

    .chart-container.chart-bar {
        height: 180px;
    }

    /* YTD grid */
    .ytd-grid {
        grid-template-columns: 1fr;
    }

    /* Stats */
    .stat-row {
        grid-template-columns: 1fr;
    }

    /* Show FAB */
    .fab {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Modal full screen on mobile */
    .modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        height: 100%;
    }

    .modal-body {
        max-height: calc(100vh - 80px);
    }

    /* Toast above FAB */
    .toast {
        bottom: calc(var(--space-xl) + 80px);
    }
}

/* =====================================================
   RESPONSIVE - SMALL MOBILE
   ===================================================== */
@media (max-width: 375px) {
    .logo-text {
        font-size: var(--font-size-lg);
    }

    .page-title {
        font-size: var(--font-size-lg);
    }

    .card-icon-wrapper {
        width: 48px;
        height: 48px;
    }

    .card-icon-wrapper svg {
        width: 24px;
        height: 24px;
    }
}