/* Modern Finance App Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap');

:root {
    /* Modern color palette */
    --app-bg: #0f0f12;
    --app-bg-secondary: #16161a;
    --app-surface: #1c1c21;
    --app-surface-hover: #242429;
    --app-border: rgba(255, 255, 255, 0.08);
    --app-border-light: rgba(255, 255, 255, 0.04);
    
    /* Accent colors */
    --accent-primary: #6366f1;
    --accent-primary-light: #818cf8;
    --accent-success: #10b981;
    --accent-success-light: #34d399;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    --accent-error-light: #f87171;
    
    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    
    /* Mobile-friendly spacing */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
}

body {
    background: var(--app-bg);
    color: var(--text-primary);
    /* Respect safe area on iOS */
    padding-top: var(--safe-area-inset-top);
    padding-bottom: var(--safe-area-inset-bottom);
}

/* Emoji font support - ensures emojis render correctly across platforms */
.emoji, .win-emoji {
    font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "Twemoji Mozilla", sans-serif;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    /* Prevent emoji from being styled as text */
    -webkit-font-feature-settings: normal;
    font-feature-settings: normal;
    /* Ensure emoji renders as colored emoji, not text */
    font-variant-emoji: emoji;
    /* Prevent text styling from affecting emoji */
    text-transform: none;
    letter-spacing: normal;
}

/* Modern scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Hide scrollbar on mobile for cleaner look */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
}

/* Override MudBlazor theme */
.mud-theme-dark {
    --mud-palette-background: var(--app-bg) !important;
    --mud-palette-surface: var(--app-surface) !important;
    --mud-palette-appbar-background: var(--app-bg-secondary) !important;
    --mud-palette-drawer-background: var(--app-bg-secondary) !important;
    --mud-palette-primary: var(--accent-primary) !important;
    --mud-palette-success: var(--accent-success) !important;
    --mud-palette-error: var(--accent-error) !important;
    --mud-palette-warning: var(--accent-warning) !important;
}

/* App Bar Styling */
.mud-appbar {
    background: rgba(15, 15, 18, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--app-border) !important;
    box-shadow: none !important;
    z-index: 1100;
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100% - var(--drawer-width));
    transition: width 0.3s ease;
    /* Safe area support */
    padding-top: var(--safe-area-inset-top);
}

/* Modern Drawer */
.mud-drawer {
    background: var(--app-bg-secondary) !important;
    border-right: 1px solid var(--app-border) !important;
    z-index: 1000;
    position: fixed;
    top: 56px;
    height: calc(100vh - 56px);
    transition: width 0.3s ease;
}

.mud-navmenu {
    padding: 12px 8px;
}

.mud-nav-link {
    border-radius: 12px !important;
    margin: 4px 0 !important;
    padding: 12px 16px !important;
    transition: all 0.2s ease !important;
    color: var(--text-secondary) !important;
    /* Touch-friendly minimum height */
    min-height: 48px;
    display: flex !important;
    align-items: center !important;
}

.mud-nav-link:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--text-primary) !important;
}

.mud-nav-link.active {
    background: var(--gradient-primary) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.mud-nav-link .mud-icon-root {
    margin-right: 12px;
}

/* Collapsible sidebar styles */
.collapsible-sidebar {
    transition: width 0.3s ease;
}

.collapsible-sidebar.mud-drawer--closed {
    width: 72px !important;
}

.nav-menu-modern .mud-nav-link {
    display: flex;
    align-items: center;
    padding: 12px;
    transition: all 0.3s ease;
}

.nav-menu-modern .mud-nav-link .nav-text {
    display: none;
}

.mud-drawer--open .nav-menu-modern .mud-nav-link .nav-text {
    display: inline;
    margin-left: 12px;
}

/* Modern Cards */
.mud-card {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.3s ease !important;
}

.mud-card:hover {
    border-color: rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35) !important;
}

.mud-card-header {
    border-bottom: 1px solid var(--app-border);
}

/* Stat Cards */
.stat-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.stat-card.positive::before {
    background: var(--gradient-success);
}

.stat-card.negative::before {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: rgba(99, 102, 241, 0.1);
}

.stat-card .stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
}

.stat-card .stat-icon.error {
    background: rgba(239, 68, 68, 0.1);
}

.stat-card .stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.stat-card .stat-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Glass morphism panels */
.glass-panel {
    background: rgba(28, 28, 33, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--app-border);
    border-radius: 20px;
}

/* Modern Buttons */
.mud-button-filled {
    border-radius: 12px !important;
    text-transform: none !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3) !important;
    transition: all 0.2s ease !important;
    /* Touch-friendly minimum size */
    min-height: 44px;
    min-width: 44px;
}

.mud-button-filled:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4) !important;
}

.mud-button-outlined {
    border-radius: 12px !important;
    text-transform: none !important;
    font-weight: 500 !important;
    border-width: 1.5px !important;
    min-height: 44px;
    min-width: 44px;
}

/* Modern Inputs */
.mud-input-outlined .mud-input-outlined-border {
    border-radius: 12px !important;
    border-color: var(--app-border) !important;
    transition: all 0.2s ease !important;
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(99, 102, 241, 0.5) !important;
}

.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* Modern Tables */
.mud-table {
    background: transparent !important;
    border-radius: 16px !important;
    overflow: hidden;
}

.mud-table-head {
    background: rgba(255, 255, 255, 0.02) !important;
}

.mud-table-cell {
    border-bottom: 1px solid var(--app-border) !important;
    padding: 16px !important;
}

.mud-table-cell {
    font-variant-numeric: tabular-nums;
}

.mud-table-row:hover {
    background: rgba(99, 102, 241, 0.05) !important;
}

.mud-table-row:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

/* Transaction list items */
.transaction-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--app-border);
    transition: all 0.2s ease;
    /* Touch-friendly minimum height */
    min-height: 72px;
}

.transaction-item:hover {
    background: rgba(99, 102, 241, 0.05);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    background: rgba(99, 102, 241, 0.1);
    flex-shrink: 0;
}

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

.transaction-description {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    /* Prevent text overflow */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.transaction-amount {
    font-weight: 600;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    margin-left: 12px;
}

.transaction-amount.positive {
    color: var(--accent-success);
}

.transaction-amount.negative {
    color: var(--text-primary);
}

/* Account cards */
.account-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    /* Touch-friendly minimum height */
    min-height: 80px;
}

.account-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.account-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 4px;
}

.logo-initials {
    font-weight: 700;
    font-size: 14px;
    color: white;
    letter-spacing: -0.5px;
}

/* Progress bars */
.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-bar-fill.success {
    background: var(--gradient-success);
}

.progress-bar-fill.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.progress-bar-fill.danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

/* Chips/Tags */
.modern-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary-light);
}

.modern-chip.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success-light);
}

.modern-chip.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.modern-chip.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-error-light);
}

/* Section headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title .mud-icon-root {
    color: var(--accent-primary);
}

/* Page headers */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Modern alerts */
.mud-alert {
    border-radius: 12px !important;
    border: 1px solid var(--app-border) !important;
}

/* Dialogs - Mobile optimized */
.mud-dialog {
    border-radius: 20px !important;
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    max-height: 90vh;
    overflow-y: auto;
}

/* Tabs */
.mud-tabs {
    background: transparent !important;
}

.mud-tab {
    border-radius: 12px !important;
    text-transform: none !important;
    font-weight: 500 !important;
    min-height: 48px;
}

/* Snackbar */
.mud-snackbar {
    border-radius: 12px !important;
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
}

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.05) 25%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto;
}

/* Blazor error UI */
#blazor-error-ui {
    background: var(--app-surface);
    border-top: 1px solid var(--accent-error);
    color: var(--text-primary);
    bottom: 0;
    display: none;
    left: 0;
    padding: 16px 24px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    /* Safe area support */
    padding-bottom: calc(16px + var(--safe-area-inset-bottom));
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 12px;
    color: var(--text-secondary);
}

/* MudBlazor specific overrides */
.mud-main-content {
    background: var(--app-bg) !important;
    padding-top: 48px !important;
    min-height: 100vh;
}

.main-content-area {
    padding-top: 48px !important;
}

.mud-container {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
}

.main-container {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
}

.mud-divider {
    border-color: var(--app-border) !important;
}

.mud-list-item {
    border-radius: 12px !important;
    min-height: 48px;
}

.mud-list-item:hover {
    background: rgba(99, 102, 241, 0.05) !important;
}

.mud-select-input, .mud-input {
    background: var(--app-surface) !important;
}

/* Icon buttons - Touch-friendly */
.mud-icon-button {
    border-radius: 12px !important;
    min-width: 44px;
    min-height: 44px;
}

.mud-icon-button:hover {
    background: rgba(99, 102, 241, 0.1) !important;
}

/* Tooltips */
.mud-tooltip {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 8px !important;
}

/* Menu */
.mud-menu .mud-list {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 12px !important;
}

.mud-menu-item {
    border-radius: 8px !important;
    margin: 4px !important;
    min-height: 44px;
}

.hamburger-left {
    margin-left: 10px;
}

/* Holdings table specific styles */
.holdings-table .mud-table-cell {
    font-variant-numeric: tabular-nums;
}

.holdings-table .mud-table-row:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

/* Investment account card enhancements */
.account-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.account-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.account-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 4px;
}

.logo-initials {
    font-weight: 700;
    font-size: 14px;
    color: white;
    letter-spacing: -0.5px;
}

/* ================================================
   MOBILE RESPONSIVE STYLES
   ================================================ */

/* Tablet and below (max-width: 960px) */
@media (max-width: 960px) {
    /* App bar adjustments */
    .mud-appbar {
        width: 100% !important;
    }
    
    /* Drawer overlay mode on tablet */
    .mud-drawer {
        top: 0;
        height: 100vh;
        z-index: 1200;
    }
    
    /* Main content full width */
    .mud-main-content {
        margin-left: 0 !important;
    }
    
    /* Container padding */
    .mud-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    
    /* Stat cards 2 columns on tablet */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
    
    /* Page title smaller */
    .page-title {
        font-size: 26px;
    }
    
    /* Table responsive */
    .mud-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Dialog full width */
    .mud-dialog {
        margin: 16px !important;
        width: calc(100% - 32px) !important;
        max-width: none !important;
    }
}

/* Mobile phones (max-width: 600px) */
@media (max-width: 600px) {
    /* Reduce base spacing */
    .mud-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }
    
    /* Stat cards single column on mobile */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* Smaller stat cards on mobile */
    .stat-card {
        padding: 16px;
        border-radius: 16px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
    
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 12px;
    }
    
    .stat-card .stat-label {
        font-size: 12px;
    }
    
    /* Page header adjustments */
    .page-header-container {
        padding: 12px 16px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .page-header-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
    }
    
    .page-header-title {
        font-size: 18px !important;
    }
    
    .page-header-icon {
        width: 36px !important;
        height: 36px !important;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    /* Section header stacking */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    /* Card adjustments */
    .content-card {
        border-radius: 12px !important;
    }
    
    .card-header {
        padding: 14px 16px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .card-body {
        padding: 12px 16px !important;
    }
    
    .card-body.no-padding {
        padding: 0 !important;
    }
    
    /* Transaction items */
    .transaction-item {
        padding: 12px 16px;
        min-height: 64px;
    }
    
    .transaction-logo,
    .transaction-icon {
        width: 40px;
        height: 40px;
        margin-right: 12px;
    }
    
    .transaction-description {
        font-size: 14px;
    }
    
    .transaction-meta {
        font-size: 12px;
    }
    
    .transaction-amount {
        font-size: 14px;
    }
    
    /* Account items */
    .account-item {
        padding: 12px 16px;
    }
    
    .account-logo {
        width: 36px;
        height: 36px;
        margin-right: 12px;
    }
    
    .account-name {
        font-size: 13px;
    }
    
    .account-balance {
        font-size: 13px;
    }
    
    /* Budget items */
    .budget-grid {
        grid-template-columns: 1fr !important;
    }
    
    .budget-item {
        padding: 14px;
    }
    
    .budget-item-amounts {
        flex-direction: column;
        gap: 8px;
    }
    
    .amount-group:last-child {
        align-items: flex-start;
    }
    
    /* Progress cards */
    .progress-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    /* Empty state */
    .empty-state {
        padding: 40px 16px;
    }
    
    .empty-state-icon {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }
    
    .empty-state-title {
        font-size: 16px;
    }
    
    .empty-state-text {
        font-size: 13px;
    }
    
    /* Tables - horizontal scroll with hints */
    .mud-table {
        border-radius: 12px !important;
    }
    
    .mud-table-cell {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
    
    .mud-table-head .mud-table-cell {
        font-size: 11px !important;
        padding: 8px 12px !important;
    }
    
    /* Table pager */
    .mud-table-pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 12px !important;
    }
    
    /* Dialog full screen on mobile */
    .mud-dialog {
        margin: 8px !important;
        width: calc(100% - 16px) !important;
        max-height: calc(100vh - 16px);
        border-radius: 16px !important;
    }
    
    .mud-dialog-content {
        padding: 16px !important;
    }
    
    .mud-dialog-actions {
        padding: 12px 16px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .mud-dialog-actions .mud-button-root {
        flex: 1;
        min-width: 100px;
    }
    
    /* App bar title - hide subtitle on mobile */
    .mud-appbar .mud-text-h6 {
        font-size: 1rem;
    }
    
    /* Date navigation */
    .date-nav {
        flex-shrink: 0;
    }
    
    .date-display {
        min-width: 120px !important;
        font-size: 13px !important;
        padding: 6px 8px !important;
    }
    
    /* Summary bar */
    .summary-bar {
        flex-direction: column;
        padding: 12px !important;
        gap: 12px !important;
    }
    
    .summary-stats {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .search-field,
    .category-filter,
    .account-filter,
    .cashflow-filter {
        width: 100% !important;
    }
    
    .stat-chips {
        width: 100%;
        justify-content: space-between !important;
        margin-left: 0 !important;
    }
    
    .stat-chip {
        padding: 6px 10px;
        font-size: 12px;
        flex: 1;
        justify-content: center;
    }
    
    /* Buttons touch-friendly */
    .mud-button-filled,
    .mud-button-outlined {
        min-height: 44px;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    
    /* Icon buttons */
    .mud-icon-button {
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Inputs */
    .mud-input {
        font-size: 16px !important; /* Prevent iOS zoom on focus */
    }
    
    /* Selects */
    .mud-select {
        font-size: 16px !important;
    }
    
    /* Toggle groups */
    .mud-toggle-group {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mud-toggle-item {
        padding: 6px 12px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }
    
    /* Content grid single column */
    .content-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .content-card.sidebar {
        order: 0 !important;
    }
    
    /* Account cards on mobile */
    .account-card {
        padding: 14px;
        border-radius: 12px;
    }
    
    /* Net worth / investments charts */
    .chart-container {
        min-height: 200px !important;
    }
}

/* Very small phones (max-width: 375px) */
@media (max-width: 375px) {
    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    .stat-card .stat-value {
        font-size: 20px;
    }
    
    .page-header-title {
        font-size: 16px !important;
    }
    
    .transaction-item {
        padding: 10px 12px;
    }
    
    .stat-chips {
        flex-wrap: wrap;
    }
    
    .stat-chip {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Landscape phone orientation */
@media (max-width: 900px) and (orientation: landscape) {
    .mud-dialog {
        max-height: 90vh;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-card .stat-value {
        font-size: 20px;
    }
}

/* Touch device specific */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects that might cause issues on touch */
    .stat-card:hover {
        transform: none;
    }
    
    .account-card:hover {
        transform: none;
    }
    
    .mud-button-filled:hover {
        transform: none;
    }
    
    /* Increase tap targets */
    .mud-icon-button {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Remove hover states that look odd on touch */
    .transaction-item:hover,
    .account-item:hover {
        background: transparent;
    }
    
    /* Active states instead */
    .transaction-item:active,
    .account-item:active {
        background: rgba(99, 102, 241, 0.1);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --app-border: rgba(255, 255, 255, 0.2);
    }
    
    .stat-card,
    .content-card,
    .account-card {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .stat-card:hover,
    .account-card:hover,
    .mud-button-filled:hover {
        transform: none !important;
    }
}

/* ================================================
   MUDBLAZOR DATEPICKER FIX
   Prevents global button styles from breaking calendar
   ================================================ */
.mud-picker .mud-button-root,
.mud-picker-calendar-day .mud-button-root {
    min-width: unset !important;
    min-height: unset !important;
}
