/* CSS Variables for theming */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --accent-color: #22c55e;
    --accent-hover: #16a34a;
    --accent-light: rgba(34, 197, 94, 0.1);
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #242424;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --accent-light: rgba(34, 197, 94, 0.15);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== ANIMATIONS ========== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

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

@keyframes typingCursor {
    0%, 100% { border-right-color: var(--accent-color); }
    50% { border-right-color: transparent; }
}

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

.anim-fade-in {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.35s; }
.stagger-4 { animation-delay: 0.5s; }
.stagger-5 { animation-delay: 0.65s; }

/* ========== LANDING / LOGIN PAGE ========== */

.landing {
    display: flex;
    min-height: 100vh;
    background: #0a0a0a;
    color: #ffffff;
}

.landing-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: linear-gradient(135deg, #0a0a0a 0%, #111 50%, #0a1a0f 100%);
    position: relative;
    overflow: hidden;
}

.landing-info::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(34, 197, 94, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.landing-info-inner {
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.landing-logo-svg {
    animation: float 3s ease-in-out infinite;
}

.landing-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #22c55e, #86efac);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-tagline {
    font-size: 1.1rem;
    color: #a0a0a0;
    line-height: 1.7;
    margin-bottom: 36px;
}

.landing-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 36px;
}

.landing-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: background 0.3s, border-color 0.3s;
}

.landing-feature:hover {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.2);
}

.feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.landing-feature strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
    color: #ffffff;
}

.landing-feature p {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.5;
    margin: 0;
}

.landing-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-badge {
    padding: 5px 12px;
    font-size: 0.75rem;
    border-radius: 20px;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
    font-weight: 500;
}

/* Auth Panel (right side) */
.landing-auth {
    flex: 0 0 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-mobile-logo {
    display: none;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-header h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: 600;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* ========== FORM STYLES ========== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ========== BUTTON STYLES ========== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

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

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

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    padding: 8px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* ========== MESSAGES ========== */

.error-message {
    color: var(--error-color);
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.success-message {
    color: var(--success-color);
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.1);
    display: none;
}

.success-message:not(:empty) {
    display: block;
}

/* ========== DASHBOARD LAYOUT ========== */

.dashboard {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    align-items: start;
}

.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-header {
    margin-bottom: 30px;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #22c55e, #86efac);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item span {
    font-size: 1.25rem;
}

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

.nav-item.active {
    background: var(--accent-color);
    color: white;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-footer .btn {
    width: auto;
    min-width: 140px;
}

.theme-toggle {
    margin-bottom: 15px;
    text-align: center;
}

/* ========== MAIN CONTENT ========== */

.main-content {
    padding: 30px;
    background: var(--bg-secondary);
    overflow-y: auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.view-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-header h1 {
    font-size: 2rem;
}

.view-header p {
    color: var(--text-secondary);
    margin-top: 5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ========== STATS GRID ========== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 3rem;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* ========== AI INSIGHTS CARD ========== */

.ai-insights-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.ai-insights-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #22c55e, #86efac, #22c55e);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.ai-insights-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ai-insights-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
}

.ai-insights-header h3 .ai-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.ai-insights-body {
    min-height: 60px;
}

.ai-insights-placeholder {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
}

.ai-insights-placeholder p {
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.ai-insights-content {
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.ai-insights-content p {
    margin-bottom: 8px;
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    color: var(--text-secondary);
}

.ai-loading .spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.btn-ai {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.btn-ai:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== CHARTS GRID ========== */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.chart-card h3 {
    margin-bottom: 20px;
    font-size: 1.25rem;
}

/* Chart empty states */
.chart-container {
    position: relative;
    min-height: 200px;
}

.chart-empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    min-height: 200px;
}

.chart-empty-state.visible {
    display: flex;
}

.chart-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.chart-empty-state .empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.chart-empty-state .empty-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 240px;
}

/* ========== TABLE EMPTY STATE ========== */

.table-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.table-empty-state .empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

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

.table-empty-state .empty-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.table-empty-state .btn {
    display: inline-flex;
    width: auto;
    font-size: 0.9rem;
    padding: 10px 24px;
}

/* ========== FILTERS ========== */

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.filters input[type="text"] {
    flex: 1;
    min-width: 200px;
}

/* ========== TABLE ========== */

.table-container {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.expenses-table {
    width: 100%;
    border-collapse: collapse;
}

.expenses-table th {
    background: var(--bg-secondary);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.expenses-table td {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.expenses-table tr:hover {
    background: var(--bg-secondary);
}

.expenses-table .empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.amount {
    font-weight: 600;
    font-size: 1.1rem;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* ========== FORM CONTAINER ========== */

.form-container {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 800px;
}

/* ========== UPLOAD AREA ========== */

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.upload-area.drag-over {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-area h3 {
    margin-bottom: 10px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ========== OCR RESULT ========== */

.ocr-result {
    margin-top: 30px;
}

.ocr-result h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* ========== LOADING SPINNER ========== */

.loading {
    text-align: center;
    padding: 60px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* ========== MODAL ========== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    padding: 16px;
    align-items: flex-start;
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    margin: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.close-modal:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* ========== MOBILE HEADER & NAV ========== */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow);
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: none;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.menu-toggle:hover {
    background: var(--border-color);
}

.mobile-header-title {
    margin-left: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, #22c55e, #86efac);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.mobile-nav-overlay.is-open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    flex-direction: column;
    z-index: 201;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
}

.mobile-nav.is-open {
    display: flex;
    transform: translateX(0);
}

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

.mobile-nav-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.menu-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.mobile-nav-item {
    display: block;
    padding: 14px 20px;
    min-height: 48px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mobile-nav-item.active {
    background: var(--accent-color);
    color: white;
    font-weight: 600;
}

.mobile-nav-footer {
    margin-top: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--border-color);
}

.btn-block {
    width: 100%;
}

/* ========== RESPONSIVE: LANDING PAGE ========== */

@media (max-width: 1024px) {
    .landing {
        flex-direction: column;
        background: #0a0a0a;
    }

    .landing-info {
        padding: 48px 24px 32px;
    }

    .landing-info-inner {
        max-width: 560px;
    }

    /* Seamless dark theme on mobile — no jarring white section */
    .landing-auth {
        flex: none;
        padding: 32px 24px 48px;
        background: linear-gradient(180deg, #0a0a0a 0%, #0d1117 30%, #0a1a0f 100%);
        color: #ffffff;
    }

    .landing-auth .auth-card {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(34, 197, 94, 0.25);
        border-radius: 16px;
        padding: 28px 24px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .landing-auth .auth-header h2 {
        color: #ffffff;
    }

    .landing-auth .auth-header p {
        color: #a0a0a0;
    }

    .landing-auth .tab-btn {
        color: #888;
    }

    .landing-auth .tab-btn.active {
        color: #22c55e;
    }

    .landing-auth .auth-tabs {
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }

    .landing-auth .form-group label {
        color: #e5e5e5;
    }

    .landing-auth .form-group input,
    .landing-auth .form-group select,
    .landing-auth .form-group textarea {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    .landing-auth .form-group input::placeholder,
    .landing-auth .form-group textarea::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }

    .landing-auth .form-group small {
        color: #888;
    }

    .landing-auth .btn-primary {
        box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
    }

    .landing-auth .error-message {
        background: rgba(239, 68, 68, 0.15);
        color: #fca5a5;
    }

    .auth-mobile-logo {
        display: flex;
    }

    /* Scroll-triggered fade-in for auth section on mobile */
    .landing-auth {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

    .landing-auth.auth-visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Dashboard responsive */
    .dashboard {
        grid-template-columns: 1fr;
        padding-top: 56px;
    }

    .sidebar {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        padding: 20px 16px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .landing-title {
        font-size: 1.5rem;
    }

    .landing-tagline {
        font-size: 1rem;
    }

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

    .filters {
        flex-direction: column;
        gap: 10px;
    }

    .filters input,
    .filters select {
        width: 100%;
        min-width: 0;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .expenses-table {
        min-width: 600px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .view-header h1 {
        font-size: 1.5rem;
    }

    .form-container {
        padding: 20px 16px;
    }

    .form-actions {
        flex-wrap: wrap;
    }

    .form-actions .btn {
        min-height: 44px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .upload-area h3 {
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;
        margin: 16px;
        max-height: calc(100vh - 32px);
        padding: 20px 16px;
    }

    .modal-header {
        margin-bottom: 16px;
    }

    .actions {
        flex-wrap: wrap;
    }

    .btn-sm {
        min-height: 40px;
        padding: 8px 12px;
    }

    .ai-insights-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .landing-info {
        padding: 32px 16px 24px;
    }

    .landing-auth {
        padding: 24px 16px 40px;
    }

    .landing-feature {
        padding: 12px;
    }

    .dashboard {
        padding-top: 56px;
    }

    .main-content {
        padding: 16px 12px;
    }

    .landing-auth .auth-card {
        padding: 24px 20px;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }

    .tab-btn {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        font-size: 2.5rem;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .chart-card {
        padding: 16px;
    }

    .chart-card h3 {
        font-size: 1rem;
    }

    .header-actions .btn {
        width: 100%;
    }
}

/* Touch-friendly: ensure minimum tap targets */
@media (hover: none) and (pointer: coarse) {
    .nav-item,
    .btn,
    .tab-btn {
        min-height: 44px;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }
}
