﻿/* ===== CashPilot — Premium Mobile App ===== */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --primary-glow: rgba(79,70,229,0.15);
    --accent: #7c3aed;
    --accent-light: #f5f3ff;
    --success: #059669;
    --success-light: #d1fae5;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #cffafe;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --radius-full: 9999px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
    --top-bar-h: 60px;
    --bottom-nav-h: 68px;
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: var(--gray-800);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
    min-height: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

/* ===== APP SHELL — Top Bar ===== */
.top-bar {
    background: var(--gradient-primary);
    color: white;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--top-bar-h);
    z-index: 200;
    display: flex;
    align-items: center;
}
.top-bar::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.03), transparent);
    pointer-events: none;
}
.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.logo {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}
.logo-icon { font-size: 1.4rem; }
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
}
.user-greeting {
    opacity: 0.9;
    font-weight: 500;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-link {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.18);
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}
.btn-link:active { background: rgba(255,255,255,0.3); transform: scale(0.95); }

/* ===== APP SHELL — Bottom Tab Bar ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: var(--bottom-nav-h);
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid rgba(0,0,0,0.05);
    z-index: 200;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 0.62rem;
    flex: 1;
    position: relative;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    gap: 2px;
}
.nav-item.active { color: var(--primary); }
.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 0 0 4px 4px;
}
.nav-item.active .nav-icon { transform: translateY(-1px) scale(1.08); }
.nav-item:active { transform: scale(0.9); transition: transform 0.08s; }
.nav-icon {
    font-size: 1.35rem;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-label { font-weight: 600; letter-spacing: 0.02em; }

/* ===== MAIN CONTENT ===== */
.main-content {
    padding: calc(var(--top-bar-h) + 16px) 16px calc(var(--bottom-nav-h) + 16px);
    min-height: 100vh;
}

.desktop-static-footer {
    display: none;
}

/* ===== AUTH LAYOUT ===== */
.auth-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}
.auth-layout::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.auth-layout::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* ===== AUTH CARD ===== */
.auth-card {
    background: var(--white);
    border-radius: 24px;
    padding: 36px 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}
.auth-logo p { color: var(--gray-500); margin-top: 6px; font-size: 0.92rem; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 0.88rem; color: var(--gray-500); }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 700; }

.auth-tips {
    max-width: 400px;
    margin: 16px auto 0;
    background: rgba(255,255,255,0.85);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-align: left;
}
.auth-tips-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}
.auth-tips-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--gray-600);
}
.auth-tips-list li { margin-bottom: 2px; }

.auth-about {
    max-width: 400px;
    margin: 12px auto 0;
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-align: left;
    border: 1px solid rgba(0,0,0,0.06);
}
.auth-about-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 6px;
}
.auth-about-subtitle {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-700);
    margin: 10px 0 6px;
}
.auth-about-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--gray-600);
}
.auth-about-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--gray-600);
}
.auth-about-list li { margin-bottom: 2px; }

.auth-about-launch {
    width: 100%;
    max-width: 400px;
    margin: 12px auto 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.auth-about-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.auth-about-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
}

.auth-about-modal-card {
    position: relative;
    z-index: 1;
    width: min(92vw, 420px);
    margin: 12vh auto 0;
    background: linear-gradient(160deg, #1e1b4b 0%, #312e81 35%, #4f46e5 100%);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--shadow-xl);
    padding: 18px;
    max-height: 82vh;
    overflow-y: auto;
}

.auth-about-modal-card .auth-about-title {
    color: #ffffff;
}

.auth-about-modal-card .auth-about-subtitle {
    color: rgba(255,255,255,0.92);
}

.auth-about-modal-card .auth-about-text,
.auth-about-modal-card .auth-about-list {
    color: rgba(255,255,255,0.88);
}

.auth-about-modal-card .auth-brand-content--modal {
    position: static;
    z-index: auto;
    max-width: none;
    padding: 0;
    color: #ffffff;
}

.auth-about-modal-card .auth-brand-logo {
    font-size: 2.2rem;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
}

.auth-about-modal-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.auth-about-modal-card .auth-brand-tagline {
    font-size: 0.88rem;
    line-height: 1.55;
    font-weight: 400;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.92);
}

.auth-about-modal-card .auth-brand-about {
    margin-top: 0;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 14px;
    padding: 14px;
}

.auth-about-modal-card .auth-brand-about-title {
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #ffffff;
}

.auth-about-modal-card .auth-brand-about-text {
    font-size: 0.78rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    margin: 0 0 10px;
}

.auth-about-modal-card .auth-brand-about-grid {
    display: grid;
    gap: 8px;
}

.auth-about-modal-card .auth-brand-about-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.76rem;
    line-height: 1.45;
    color: rgba(255,255,255,0.95);
}

.auth-about-modal-card .auth-mock-card {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
}

.auth-about-modal-card .auth-mock-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.auth-about-modal-card .auth-mock-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.auth-about-modal-card .auth-mock-label {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.03em;
    opacity: 0.75;
    text-transform: uppercase;
}

.auth-about-modal-card .auth-mock-value {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 3px;
}

.auth-about-modal-card .auth-mock-bar-row {
    height: 6px;
    background: rgba(255,255,255,0.14);
    border-radius: 999px;
    overflow: hidden;
}

.auth-about-modal-card .auth-brand-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.auth-about-modal-card .auth-feature {
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    padding: 7px 10px;
    border-radius: 999px;
}

.auth-about-modal-card .auth-brand-proof {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.auth-about-modal-card .auth-proof-avatars {
    display: flex;
}

.auth-about-modal-card .auth-proof-avatars span {
    margin-left: -5px;
    font-size: 1.15rem;
}

.auth-about-modal-card .auth-proof-avatars span:first-child {
    margin-left: 0;
}

.auth-about-modal-card .auth-brand-proof p {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.4;
    color: rgba(255,255,255,0.92);
}

.auth-about-modal-card .auth-brand-proof strong {
    color: #c7d2fe;
}

.auth-about-modal-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.9);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.auth-about-modal.hidden {
    display: none;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    border: 1px solid rgba(0,0,0,0.03);
    transition: box-shadow 0.2s;
}
.card-header {
    font-size: 0.72rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 10px;
}
.card-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}
.card-value.positive { color: var(--success); }
.card-value.negative { color: var(--danger); }
.card-subtitle { font-size: 0.8rem; color: var(--gray-500); margin-top: 4px; }

/* ===== STAT CARDS ===== */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 12px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.2s;
}
.stat-card .stat-icon { font-size: 1.5rem; margin-bottom: 6px; }
.stat-card .stat-label {
    font-size: 0.68rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.stat-card .stat-value { font-size: 1.25rem; font-weight: 800; margin-top: 4px; letter-spacing: -0.01em; }

/* ===== HERO BANNER (Day Cash / Profit) ===== */
.day-cash-banner {
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    padding: 22px 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25);
}
.day-cash-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.day-cash-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.day-cash-banner h2 {
    font-size: 0.72rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    position: relative;
}
.day-cash-banner .day-profit {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 6px 0;
    letter-spacing: -0.02em;
    position: relative;
}
.day-cash-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 6px;
    position: relative;
    font-weight: 500;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.quick-actions--home {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100%;
    overflow-x: visible !important;
}
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 6px;
    background: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.72rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid rgba(0,0,0,0.03);
    letter-spacing: 0.01em;
    line-height: 1.3;
    text-align: center;
}
.quick-action-btn:active { transform: scale(0.93); box-shadow: var(--shadow-xs); }
.quick-action-btn .action-icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, box-shadow 0.2s;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:active { box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2); }
.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}
.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}
.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
    box-shadow: var(--shadow-xs);
}
.btn-outline:active { background: var(--gray-50); box-shadow: none; }
.btn-sm { padding: 9px 16px; font-size: 0.82rem; border-radius: var(--radius-xs); }
.btn-group { display: flex; gap: 10px; }
.btn-group .btn { flex: 1; }

/* ===== FORMS ===== */
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; min-width: 0; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 7px;
    letter-spacing: 0.02em;
}
.form-input,
select.form-input,
textarea.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--gray-800);
    background: var(--white);
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
    font-weight: 500;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.form-input::placeholder { color: var(--gray-400); font-weight: 400; }
.form-error { color: var(--danger); font-size: 0.75rem; margin-top: 5px; font-weight: 600; }
.form-help { color: var(--gray-500); font-size: 0.75rem; margin-top: 5px; }

/* Radio group */
.radio-group { display: flex; gap: 10px; }
.radio-option { flex: 1; position: relative; }
.radio-option input[type="radio"] { position: absolute; opacity: 0; }
.radio-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
    background: var(--white);
    font-size: 0.88rem;
}
.radio-option input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* ===== ALERTS / TOASTS ===== */
.messages {
    position: fixed;
    top: var(--top-bar-h);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 10px 16px 0;
    z-index: 150;
}
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0,0,0,0.04);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert-success { background: var(--success-light); color: #065f46; border-left: 4px solid var(--success); }
.alert-error, .alert-danger { background: var(--danger-light); color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info { background: var(--info-light); color: #155e75; border-left: 4px solid var(--info); }
.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    color: inherit;
    padding: 0 0 0 12px;
}

/* ===== TRANSACTION LIST ===== */
.transaction-list { list-style: none; }
.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.1s;
}
.transaction-item:last-child { border-bottom: none; }
.transaction-item.new-highlight {
    background: var(--success-light);
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
    animation: highlightFade 3s ease-out forwards;
}
@keyframes highlightFade {
    0% { background: var(--success-light); }
    100% { background: transparent; }
}
.compact-list .transaction-item { padding: 8px 0; }
.compact-list .transaction-desc { font-size: 0.82rem; }
.compact-list .transaction-cat { font-size: 0.7rem; }
.transaction-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.transaction-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.transaction-icon.income { background: var(--success-light); }
.transaction-icon.expense { background: var(--danger-light); }
.transaction-icon.sale { background: var(--info-light); }
.transaction-icon.purchase { background: var(--warning-light); }
.transaction-desc {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-800);
}
.transaction-cat { font-size: 0.73rem; color: var(--gray-500); margin-top: 1px; }
.transaction-amount { font-weight: 800; font-size: 0.92rem; white-space: nowrap; flex-shrink: 0; letter-spacing: -0.01em; }
.transaction-amount.positive { color: var(--success); }
.transaction-amount.negative { color: var(--danger); }

/* Date-grouped transactions */
.txn-date-group {
    margin-bottom: 16px;
}
.txn-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px;
    margin-bottom: 4px;
}
.txn-date-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.txn-date-totals {
    font-size: 0.72rem;
    font-weight: 600;
}
.txn-delete-btn,
.txn-reverse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #fff7ed;
    border: 1px solid #fdba74;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    color: #c2410c;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.txn-delete-btn:hover,
.txn-reverse-btn:hover {
    background: #ffedd5;
    border-color: #fb923c;
    color: #9a3412;
}
.transaction-item--reversed {
    opacity: 0.78;
}
.txn-status-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.66rem;
    font-weight: 700;
    vertical-align: middle;
}

/* ===== PRODUCT LIST ===== */
.product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background: var(--white);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.1s;
}
.product-item:active { transform: scale(0.99); }
.product-info h3 { font-size: 0.92rem; font-weight: 700; color: var(--gray-800); }
.product-info .product-meta { font-size: 0.76rem; color: var(--gray-500); margin-top: 2px; }
.product-stock { text-align: right; }
.product-stock .stock-count { font-weight: 800; font-size: 1.1rem; }
.product-stock .stock-label {
    font-size: 0.68rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.low-stock { color: var(--danger) !important; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 10px;
}
.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.progress-bar-fill.warning { background: var(--gradient-warm); }
.progress-bar-fill.danger { background: var(--gradient-danger); }
.progress-bar-fill.success { background: var(--gradient-success); }

/* ===== SECTION HEADERS ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-title { font-size: 0.92rem; font-weight: 800; color: var(--gray-800); letter-spacing: -0.01em; }
.section-link { font-size: 0.8rem; color: var(--primary); text-decoration: none; font-weight: 700; transition: opacity 0.15s; }
.section-link:active { opacity: 0.6; }

/* ===== INSIGHTS ===== */
.insight-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--info-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(0,0,0,0.03);
    line-height: 1.45;
}
.insight-card.warning { background: var(--warning-light); }
.insight-card.success { background: var(--success-light); }
.insight-card.danger { background: var(--danger-light); }
.insight-icon { font-size: 1.25rem; flex-shrink: 0; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-400); }
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.7; }
.empty-state p { font-size: 0.9rem; line-height: 1.5; max-width: 240px; margin: 0 auto; }
.empty-state .btn { margin-top: 20px; display: inline-flex; width: auto; }

/* ===== FILTER CHIPS (transaction type tabs) ===== */
.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding: 2px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
}
.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}
.filter-chip:active { transform: scale(0.95); }

/* ===== PURCHASE / SEGMENTED TABS ===== */
.purchase-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.purchase-tab {
    flex: 1;
    padding: 11px 8px;
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.01em;
}
.purchase-tab.active {
    color: var(--primary);
    background: var(--white);
    box-shadow: var(--shadow-md);
}
.purchase-tab:active { transform: scale(0.96); }

/* ===== SEARCHABLE DROPDOWN ===== */
.product-select-wrap { position: relative; }
.product-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 6px;
    animation: dropdownShow 0.15s ease-out;
}
@keyframes dropdownShow {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.product-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.1s;
    border-bottom: 1px solid var(--gray-50);
}
.product-dropdown-item:last-child { border-bottom: none; }
.product-dropdown-item:active { background: var(--primary-light); }
.product-dropdown-add {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 1px solid var(--gray-100);
    transition: background 0.1s;
}
.product-dropdown-add:active { background: var(--primary-light); }

/* ===== BOTTOM SHEET MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: modalFadeIn 0.2s ease-out;
}
.modal-overlay.hidden { display: none; }
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-card {
    background: var(--white);
    border-radius: 24px 24px 0 0;
    padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0));
    width: 100%;
    max-width: 480px;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-card::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 99px;
    margin: 0 auto 18px;
}
.modal-card h3 { margin: 0 0 18px; font-size: 1.05rem; font-weight: 800; color: var(--gray-900); letter-spacing: -0.01em; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.page-header h1 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; }

/* ===== REPORT TABLE ===== */
.report-table { width: 100%; border-collapse: collapse; }
.report-table th,
.report-table td {
    padding: 11px 8px;
    text-align: left;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--gray-100);
}
.report-table th {
    font-weight: 700;
    color: var(--gray-500);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.report-table td { font-weight: 500; }

/* ===== HTMX ===== */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.82rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 14px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ===== REPORT STICKY NAV ===== */
.report-sticky-nav {
    margin-bottom: 16px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 0; height: 0; }
.product-dropdown::-webkit-scrollbar { width: 3px; }
.product-dropdown::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* ===== DESKTOP — keep mobile, center app shell ===== */
@media (min-width: 481px) {
    body.app-shell {
        border-left: 1px solid var(--gray-200);
        border-right: 1px solid var(--gray-200);
        box-shadow: 0 0 60px rgba(0,0,0,0.06);
    }
}

/* ===== LARGE SCREEN — STRICT DESKTOP APP SHELL ===== */
@media (min-width: 1100px) {
    :root {
        --desktop-header-h: 56px;
        --desktop-sidebar-w: 230px;
        --desktop-footer-h: 40px;
        --desktop-bg: #f0f2f5;
    }

    /* Page scrolls naturally */
    html {
        height: auto;
        overflow-y: scroll;       /* always show scrollbar track */
    }
    body.app-shell {
        height: auto;
        overflow: visible;        /* let page flow normally */
        max-width: none;
        margin: 0;
        border: none;
        box-shadow: none;
        background: var(--desktop-bg);
        overscroll-behavior-y: auto;
    }

    /* ── HEADER ── fixed top, full width */
    .top-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        transform: none;
        max-width: none;
        height: var(--desktop-header-h);
        padding: 0 24px;
        z-index: 200;
        border-bottom: 1px solid rgba(0,0,0,0.08);
    }

    .top-bar::after { display: none; }

    .top-bar-inner {
        max-width: none;
        margin: 0;
    }

    /* ── LEFT SIDEBAR ── fixed, between header and footer */
    .bottom-nav {
        position: fixed;
        top: var(--desktop-header-h);
        left: 0;
        bottom: var(--desktop-footer-h);
        width: var(--desktop-sidebar-w);
        max-width: none;
        height: auto;
        transform: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 4px;
        padding: 16px 12px;
        border-top: none;
        border-right: 1px solid var(--gray-200);
        border-radius: 0;
        box-shadow: none;
        background: var(--desktop-bg);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        overflow-y: auto;
        z-index: 200;
    }

    .nav-item {
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 0.82rem;
        color: var(--gray-600);
    }

    .nav-item .nav-icon { font-size: 1.1rem; }

    .nav-item.active {
        background: var(--primary-light);
        color: var(--primary-dark);
    }

    .nav-item.active::before { display: none; }

    .nav-item:hover:not(.active) {
        background: var(--gray-100);
    }

    /* ── MESSAGES ── */
    .messages {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        max-width: 800px;
        margin: 0 auto 16px;
        padding: 0;
        z-index: 1;
    }

    .messages .alert {
        max-width: none;
    }

    /* ── CONTENT AREA ── normal flow, offset for fixed edges */
    .main-content {
        position: relative;
        margin-left: var(--desktop-sidebar-w);
        padding: calc(var(--desktop-header-h) + 24px) 32px calc(var(--desktop-footer-h) + 24px) 32px;
        min-height: 100vh;
        max-width: none;
        background: var(--desktop-bg);
    }

    /* nice thin scrollbar */
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 99px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: var(--gray-400);
    }

    /* ── FOOTER ── fixed bottom, full width */
    .desktop-static-footer {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: var(--desktop-footer-h);
        padding: 0;
        z-index: 200;
    }

    .desktop-static-footer-inner {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--gradient-primary);
        color: rgba(255,255,255,0.85);
        font-size: 0.75rem;
        padding: 0 28px;
        border: none;
        border-radius: 0;
    }

    .desktop-static-footer-inner a {
        color: rgba(255,255,255,0.95);
        text-decoration: none;
        font-weight: 700;
    }

    .desktop-static-footer-inner a:hover {
        text-decoration: underline;
        color: #fff;
    }

    /* ── Sticky report nav at top of content ── */
    .report-sticky-nav {
        position: sticky;
        top: var(--desktop-header-h);
        z-index: 50;
        background: var(--desktop-bg);
        padding: 12px 0;
        margin: -24px -32px 12px;
        padding-left: 32px;
        padding-right: 32px;
        border-bottom: 1px solid var(--gray-200);
    }

    .report-sticky-nav .quick-actions {
        margin-bottom: 0;
    }

    /* ── Content tweaks ── */
    .quick-actions {
        grid-template-columns: repeat(4, minmax(140px, 1fr));
        gap: 12px;
    }

    .card,
    .stat-card,
    .product-item,
    .insight-card {
        border-radius: 18px;
    }

    /* ── TWO-COLUMN LAYOUT ── */
    .desktop-two-col {
        display: grid;
        grid-template-columns: 1fr 360px;
        gap: 28px;
        align-items: start;
    }

    /* Inventory layout: stats first in HTML (mobile), products first on desktop */
    .inventory-layout .inventory-products { order: 1; }
    .inventory-layout .inventory-stats   { order: 2; }

    .desktop-col-main {
        min-width: 0;
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: 18px;
        padding: 24px;
    }

    .history-sidebar {
        background: var(--white);
        border-radius: 18px;
        border: 1px solid var(--gray-200);
        padding: 16px;
        position: sticky;
        top: calc(var(--desktop-header-h) + 24px);
        max-height: calc(100vh - var(--desktop-header-h) - var(--desktop-footer-h) - 48px);
        overflow-y: auto;
    }

    .history-sidebar .section-header {
        margin-bottom: 8px;
    }

    .history-sidebar .transaction-list {
        list-style: none;
    }

    .history-sidebar .transaction-item {
        padding: 8px 0;
        border-bottom: 1px solid var(--gray-100);
    }

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

    .history-sidebar .transaction-desc {
        font-size: 0.78rem;
    }

    .history-sidebar .transaction-cat {
        font-size: 0.7rem;
    }

    .history-sidebar .transaction-amount {
        font-size: 0.78rem;
    }
}

/* ===== DESKTOP AUTH LAYOUT ===== */
/* Mobile: brand panel hidden, form centered (existing behavior) */
.auth-brand-panel { display: none; }
.auth-form-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

@media (min-width: 900px) {
    body:has(.auth-layout) {
        max-width: none;
        margin: 0;
    }

    .auth-layout {
        flex-direction: row;
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
        background: var(--gray-50);
        overflow: visible;
    }

    /* Left branding panel */
    .auth-brand-panel {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50%;
        height: 100vh;
        position: sticky;
        top: 0;
        background: linear-gradient(160deg, #1e1b4b 0%, #312e81 30%, #4f46e5 60%, #7c3aed 100%);
        overflow: hidden;
    }

    /* Animated floating shapes */
    .auth-bg-shapes {
        position: absolute;
        inset: 0;
        pointer-events: none;
        overflow: hidden;
    }
    .auth-shape {
        position: absolute;
        border-radius: 50%;
        opacity: 0.08;
        background: white;
    }
    .auth-shape-1 {
        width: 300px; height: 300px;
        top: -60px; right: -40px;
        animation: authFloat 8s ease-in-out infinite;
    }
    .auth-shape-2 {
        width: 200px; height: 200px;
        bottom: 10%; left: -50px;
        animation: authFloat 10s ease-in-out 2s infinite reverse;
    }
    .auth-shape-3 {
        width: 120px; height: 120px;
        top: 40%; right: 15%;
        opacity: 0.05;
        animation: authFloat 12s ease-in-out 4s infinite;
    }
    .auth-shape-4 {
        width: 80px; height: 80px;
        bottom: 25%; left: 30%;
        opacity: 0.06;
        animation: authFloat 9s ease-in-out 1s infinite reverse;
    }

    @keyframes authFloat {
        0%, 100% { transform: translateY(0) scale(1); }
        50% { transform: translateY(-20px) scale(1.05); }
    }

    .auth-brand-content {
        position: relative;
        z-index: 1;
        color: var(--white);
        padding: 60px 48px;
        max-width: 760px;
    }

    .auth-brand-logo {
        font-size: 3.2rem;
        margin-bottom: 8px;
        filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
    }

    .auth-brand-content h1 {
        font-size: 2.6rem;
        font-weight: 800;
        letter-spacing: -0.03em;
        margin-bottom: 12px;
        text-shadow: 0 2px 20px rgba(0,0,0,0.2);
    }

    .auth-brand-tagline {
        font-size: 1.2rem;
        opacity: 0.9;
        margin-bottom: 28px;
        line-height: 1.6;
        font-weight: 300;
    }

    .auth-brand-about {
        margin-top: 22px;
        background: rgba(255,255,255,0.12);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 16px;
        padding: 16px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .auth-brand-about-title {
        font-size: 0.95rem;
        font-weight: 800;
        margin-bottom: 8px;
        color: #ffffff;
    }

    .auth-brand-about-text {
        font-size: 0.78rem;
        line-height: 1.65;
        color: rgba(255,255,255,0.9);
        margin: 0 0 12px;
    }

    .auth-brand-about-grid {
        display: grid;
        gap: 8px;
    }

    .auth-brand-about-item {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        font-size: 0.76rem;
        line-height: 1.5;
        color: rgba(255,255,255,0.95);
    }

    .auth-brand-about-icon {
        flex-shrink: 0;
        margin-top: 1px;
    }

    .auth-about-launch,
    .auth-about-modal {
        display: none;
    }

    /* Mock dashboard card */
    .auth-mock-card {
        background: rgba(255,255,255,0.1);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 16px;
        padding: 20px;
        margin-bottom: 24px;
    }
    .auth-mock-header {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.8rem;
        font-weight: 600;
        opacity: 0.85;
        margin-bottom: 16px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .auth-mock-dot {
        width: 8px; height: 8px;
        border-radius: 50%;
        display: inline-block;
    }
    .auth-mock-dot.green { background: #34d399; box-shadow: 0 0 6px #34d399; }
    .auth-mock-stats {
        display: flex;
        gap: 16px;
        margin-bottom: 14px;
    }
    .auth-mock-stat {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .auth-mock-label {
        font-size: 0.7rem;
        opacity: 0.6;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    .auth-mock-value {
        font-size: 1rem;
        font-weight: 700;
    }
    .auth-mock-value.green { color: #34d399; }
    .auth-mock-value.red { color: #fb7185; }
    .auth-mock-value.white { color: #fff; }
    .auth-mock-bar-row {
        height: 6px;
        background: rgba(255,255,255,0.1);
        border-radius: 3px;
        overflow: hidden;
    }
    .auth-mock-bar {
        height: 100%;
        background: linear-gradient(90deg, #34d399, #a78bfa);
        border-radius: 3px;
        animation: authBarGrow 2s ease-out forwards;
    }
    @keyframes authBarGrow {
        from { width: 0 !important; }
    }

    /* Feature pills */
    .auth-brand-features {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 28px;
    }

    .auth-feature {
        font-size: 0.82rem;
        font-weight: 600;
        background: rgba(255,255,255,0.12);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255,255,255,0.1);
        padding: 8px 14px;
        border-radius: 20px;
        transition: background 0.2s;
    }
    .auth-feature:hover {
        background: rgba(255,255,255,0.2);
    }

    /* Social proof */
    .auth-brand-proof {
        display: flex;
        align-items: center;
        gap: 12px;
        padding-top: 20px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .auth-proof-avatars {
        display: flex;
    }
    .auth-proof-avatars span {
        font-size: 1.5rem;
        margin-left: -6px;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    }
    .auth-proof-avatars span:first-child { margin-left: 0; }
    .auth-brand-proof p {
        font-size: 0.82rem;
        opacity: 0.75;
        line-height: 1.4;
    }
    .auth-brand-proof strong {
        color: #a5b4fc;
    }

    /* Right form panel */
    .auth-form-panel {
        width: 50%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px;
        background: var(--gray-50);
    }

    .auth-layout::before,
    .auth-layout::after {
        display: none;
    }

    .auth-card {
        max-width: 560px;
        width: 100%;
        padding: 40px 36px;
        border-radius: 20px;
    }
}

/* ── Stock Take Table ──────────────────────── */
.stock-table-wrap {
    padding: 0;
    overflow-x: auto;
}
.stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.stock-table thead {
    background: var(--gray-50);
    position: sticky;
    top: 0;
    z-index: 1;
}
.stock-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.stock-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.stock-table tbody tr:hover {
    background: var(--gray-50);
}
.stock-product-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.stock-badge-low {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #fef2f2;
    color: #ef4444;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}
.stock-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.88rem;
    background: var(--white);
    text-align: right;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.stock-input:disabled {
    background: transparent;
    border-color: transparent;
    color: var(--gray-700);
    cursor: default;
}
.stock-input:not(:disabled) {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79,70,229,0.1);
}
.stock-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}
.stock-btn-edit,
.stock-btn-save,
.stock-btn-cancel {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
.stock-btn-edit:hover { background: var(--gray-100); }
.stock-btn-save:hover { background: #dcfce7; }
.stock-btn-cancel {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-400);
}
.stock-btn-cancel:hover { background: #fef2f2; color: #ef4444; }

/* ═══════════════════════════════════════════════
   REPORT STYLES
   ═══════════════════════════════════════════════ */

/* Day navigator */
.day-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 10px 12px;
    margin-bottom: 14px;
    min-height: 56px;
}
.day-nav-arrow {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    transition: background 0.15s, color 0.15s;
    min-width: 80px;
}
.day-nav-arrow:first-child { justify-content: flex-start; }
.day-nav-arrow:last-child  { justify-content: flex-end; }
.day-nav-arrow:hover { background: var(--primary); color: var(--white); }
.day-nav-arrow-icon {
    font-size: 1.4rem;
    line-height: 1;
    font-weight: 300;
}
.day-nav-arrow-label { white-space: nowrap; }
.day-nav-center {
    text-align: center;
    flex: 1;
    min-width: 0;
}
.day-nav-weekday {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    font-weight: 600;
}
.day-nav-date {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-top: 1px;
}
.day-nav-arrow--today {
    cursor: default;
}
.day-nav-today-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 20px;
}

/* Stat row: flex row of stat cards */
.report-stat-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.report-stat {
    flex: 1;
    background: var(--white);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-width: 0;
}
.report-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500);
    margin-bottom: 2px;
}
.report-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    word-break: break-all;
}
.report-stat-value--positive { color: var(--success); }
.report-stat-value--negative { color: var(--danger); }
.report-stat-change {
    font-size: 0.72rem;
    margin-top: 2px;
    color: var(--gray-400);
}
.report-stat-change.positive { color: var(--success); }
.report-stat-change.negative { color: var(--danger); }

/* Big value — centered hero number */
.report-big-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 4px 0;
}
.report-big-value.positive { color: var(--success); }
.report-big-value.negative { color: var(--danger); }

/* Bar chart — horizontal bars for categories / daily trend */
.report-bar-chart {
    background: var(--gray-100);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    position: relative;
}
.report-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
    min-width: 2px;
}

/* Vertical bar chart */
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 110px;
    padding-top: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.chart-bar-col {
    flex: 1;
    min-width: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}
.chart-bar-fill {
    width: 100%;
    max-width: 22px;
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}
.chart-bar-fill--green { background: var(--success); }
.chart-bar-fill--red   { background: var(--danger); }
.chart-bar-fill--blue  { background: var(--primary); }
.chart-bar-label {
    font-size: 0.6rem;
    color: var(--gray-400);
    margin-top: 4px;
    font-weight: 600;
}
.chart-bar-tooltip {
    position: absolute;
    top: -18px;
    font-size: 0;
    color: var(--gray-600);
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
.chart-bar-col:hover .chart-bar-tooltip {
    font-size: 0.6rem;
    opacity: 1;
}
.chart-bar-col:hover .chart-bar-fill {
    opacity: 0.75;
}

/* Breakdown rows */
.breakdown-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.breakdown-info { min-width: 0; }
.breakdown-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.breakdown-sub {
    font-size: 0.7rem;
    color: var(--gray-400);
}
.breakdown-amount {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ratio bar (income vs expense) */
.ratio-bar {
    height: 10px;
    border-radius: 6px;
    background: var(--danger);
    overflow: hidden;
}
.ratio-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}
.ratio-bar-fill--green { background: var(--success); }

/* P&L waterfall statement */
.pl-waterfall { padding: 0; }
.pl-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
}
.pl-row:last-child { border-bottom: none; }
.pl-row-label { flex: 1; color: var(--gray-700); }
.pl-row-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-row-pct {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400);
    margin-left: 8px;
    min-width: 40px;
    text-align: right;
}
.pl-row--revenue { background: rgba(5,150,105,0.04); }
.pl-row--revenue .pl-row-label { font-weight: 700; color: var(--success); }
.pl-row--revenue .pl-row-amount { color: var(--success); }
.pl-row--sub .pl-row-label {
    padding-left: 12px;
    font-size: 0.8rem;
    color: var(--gray-500);
}
.pl-row--sub .pl-row-amount { font-weight: 500; color: var(--gray-600); font-size: 0.82rem; }
.pl-row--deduct { background: rgba(220,38,38,0.03); }
.pl-row--deduct .pl-row-label { color: var(--danger); }
.pl-row--deduct .pl-row-amount { color: var(--danger); }
.pl-row--subtotal {
    background: var(--gray-50);
    border-top: 2px solid var(--gray-200);
    border-bottom: 2px solid var(--gray-200);
}
.pl-row--subtotal .pl-row-label { font-weight: 700; }
.pl-row--subtotal .pl-row-amount { font-weight: 800; }
.pl-row--total {
    background: var(--gray-800);
    color: white;
    border-radius: 0 0 var(--radius) var(--radius);
}
.pl-row--total .pl-row-label { font-weight: 700; color: white; }
.pl-row--total .pl-row-amount { font-size: 1rem; }
.pl-row--total .pl-row-pct { color: rgba(255,255,255,0.6); }

/* Chart bar stack (overlapping bars) */
.chart-bar-stack {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-end;
}
.chart-bar-fill--overlay {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    opacity: 0.8;
}
.report-quick-date,
.date-preset {
    background: var(--gray-100);
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.report-quick-date:hover,
.date-preset:hover {
    background: var(--primary);
    color: var(--white);
}

/* Date filter component */
.date-filter {
    padding: 12px 16px;
    margin-bottom: 12px;
}
.date-filter-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
    max-width: 480px;
}
.date-filter-field {
    flex: 1 1 120px;
    min-width: 100px;
    max-width: 180px;
}
.date-filter-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin-bottom: 4px;
}
.date-filter-input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-800);
    background: var(--gray-50);
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
.date-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
}
.date-filter-btn {
    padding: 8px 20px;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-end;
}
.date-filter-presets {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Report table */
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.report-table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500);
    padding: 6px 8px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.report-table td {
    padding: 8px;
    border-bottom: 1px solid var(--gray-100);
}
.report-table tfoot td {
    border-top: 2px solid var(--gray-200);
    border-bottom: none;
}

/* Report sticky nav */
.report-sticky-nav {
    margin-bottom: 12px;
}
.report-sticky-nav .quick-actions {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

/* Settings page: two-column grid */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
.settings-col { min-width: 0; }

/* Mobile tabs */
.settings-tabs {
    display: flex;
    gap: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    overflow: hidden;
}
.settings-tab {
    flex: 1;
    padding: 10px 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    border: none;
    background: var(--white);
    color: var(--gray-500);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.settings-tab.active {
    background: var(--primary);
    color: white;
}
.settings-panel--hidden {
    display: none;
}

/* Desktop: always show both, hide tabs */
@media (min-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: start;
    }
    .settings-tabs { display: none; }
    .settings-panel--hidden { display: block; }
}

/* User manual styles */
.manual-card { padding: 14px 16px; }
.manual-intro {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}
.manual-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.manual-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.manual-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}
.manual-section p {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--gray-600);
    margin: 0;
}
.manual-list {
    margin: 6px 0 0 0;
    padding-left: 18px;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--gray-600);
}
.manual-list li { margin-bottom: 2px; }

/* Responsive: stack stat rows on very narrow screens */
@media (max-width: 360px) {
    .report-stat-row {
        flex-direction: column;
    }
    .report-stat-value {
        font-size: 0.95rem;
    }
    .report-big-value {
        font-size: 1.3rem;
    }
}
.hidden { display: none !important; }

.stock-row-editing {
    background: #f5f3ff;
}
.stock-row-editing:hover {
    background: #f5f3ff;
}
.stock-row-saved {
    animation: stockSaveFlash 1.5s ease-out;
}
@keyframes stockSaveFlash {
    0%   { background: #dcfce7; }
    100% { background: transparent; }
}

/* ── Stock Table Mobile Cards ──────────────── */
@media (max-width: 1099px) {
    .stock-table-wrap {
        overflow-x: visible;
        padding: 8px;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    .stock-table thead { display: none; }
    .stock-table,
    .stock-table tbody,
    .stock-table tr,
    .stock-table td {
        display: block;
        width: 100%;
    }
    .stock-table tbody tr {
        padding: 12px 14px;
        margin-bottom: 8px;
        border: 1px solid var(--gray-100);
        border-radius: 12px;
        background: var(--white);
    }
    .stock-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: none;
    }
    .stock-table td::before {
        content: attr(data-label);
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--gray-500);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        min-width: 80px;
        flex-shrink: 0;
    }
    .stock-table td.stock-product-name {
        font-size: 0.95rem;
        font-weight: 600;
        padding-bottom: 6px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--gray-100);
    }
    .stock-table td.stock-product-name::before {
        display: none;
    }
    .stock-table td.stock-actions {
        justify-content: flex-end;
        padding-top: 8px;
        margin-top: 4px;
        border-top: 1px solid var(--gray-100);
    }
    .stock-table td.stock-actions::before {
        display: none;
    }
    .stock-input {
        width: auto;
        flex: 1;
        max-width: 140px;
        text-align: right;
    }
    .stock-row-editing {
        border-color: var(--primary);
        box-shadow: 0 0 0 2px rgba(79,70,229,0.08);
    }
}
