/* ==========================================
   AutoLedger.ai CSS Design System
   Theme: Glassmorphism Premium Obsidian Dark
   ========================================== */

/* Design Tokens & Variables */
:root {
    --bg-app: #0a0b10;
    --bg-main: #0e1017;
    --sidebar-width: 260px;
    
    /* Neon gradients & Brand Colors */
    --primary: #6366f1;         /* Neon Indigo */
    --primary-glow: rgba(99, 102, 241, 0.15);
    --secondary: #8b5cf6;       /* Neon Violet */
    --accent: #d946ef;          /* Neon Pink */
    
    /* Text Color */
    --text-primary: #f3f4f6;    /* Bright Silver */
    --text-secondary: #9ca3af;  /* Muted Gray */
    --text-muted: #6b7280;      /* Dark Gray */
    
    /* Status Colors */
    --color-green: #10b981;     /* Success / Approved */
    --color-red: #ef4444;       /* Danger / Cancelled */
    --color-yellow: #f59e0b;    /* Pending */
    
    /* Card Glassmorphism details */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-hover: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --glass-blur: blur(12px);
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    /* Font Stack */
    --font-primary: 'Outfit', 'Noto Sans KR', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-primary);
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

.auth-hidden {
    display: none !important;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 30% 15%, rgba(99, 102, 241, 0.18), transparent 35%),
        radial-gradient(circle at 75% 70%, rgba(16, 185, 129, 0.12), transparent 38%),
        var(--bg-app);
}

.login-screen.auth-hidden {
    display: none !important;
}

.login-card {
    width: min(100%, 380px);
    padding: 2rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(14, 16, 23, 0.86);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    backdrop-filter: var(--glass-blur);
}

.login-mark {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--color-green));
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.28);
    margin-bottom: 1.5rem;
}

.login-copy {
    margin-bottom: 1.5rem;
}

.login-eyebrow {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 0.35rem;
}

.login-copy h1 {
    font-size: 1.65rem;
    line-height: 1.2;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.login-field input {
    width: 100%;
    height: 46px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 0 0.95rem;
    font: inherit;
    outline: none;
}

.login-field input:focus {
    border-color: rgba(99, 102, 241, 0.75);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.login-error {
    min-height: 1.25rem;
    color: var(--color-red);
    font-size: 0.82rem;
    margin: 0.6rem 0 0.9rem;
}

.login-submit {
    width: 100%;
    justify-content: center;
    height: 46px;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* App Layout Structure */
.app-container {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 70% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
                radial-gradient(circle at 10% 80%, rgba(217, 70, 239, 0.06) 0%, transparent 50%),
                var(--bg-app);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 11, 16, 0.7);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.logo-icon {
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-name .dot {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.nav-item svg {
    transition: var(--transition-fast);
}

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

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-left: 3px solid var(--primary);
    border-radius: 4px var(--radius-md) var(--radius-md) 4px;
}

.nav-item.active svg {
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.logout-btn {
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.55rem;
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
    background: var(--glass-hover);
}

/* Main Content Area */
.main-content {
    flex: 1;
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: 2.5rem 3rem;
    background: var(--bg-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quick-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.welcome-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.35rem;
    background: linear-gradient(135deg, #ffffff 50%, #d1d5db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-text .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--glass-hover);
    border-color: var(--glass-border-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn-primary:hover {
    background: #5558e8;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Sections Base */
.section {
    margin-bottom: 2.5rem;
    min-width: 0;
    max-width: 100%;
}

/* Upload Container */
.upload-container {
    background: var(--glass-bg);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    backdrop-filter: var(--glass-blur);
    transition: var(--transition-normal);
}

.upload-container:hover, .upload-container.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
    box-shadow: 0 0 20px var(--primary-glow);
}

.upload-icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition-normal);
}

.upload-container:hover .upload-icon-container,
.upload-container.dragover .upload-icon-container {
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.upload-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.upload-text span {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.file-hint {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    margin-top: 0.75rem;
}

/* File Loaded Banner */
.file-loaded-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    backdrop-filter: var(--glass-blur);
    animation: slideDown 0.3s ease-out;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.file-info svg {
    color: var(--color-green);
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-clear:hover {
    color: var(--color-red);
    background: rgba(239, 68, 68, 0.1);
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: var(--glass-blur);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--glass-border-hover);
    background: var(--glass-hover);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

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

.p-green { background: rgba(16, 185, 129, 0.1); color: var(--color-green); }
.p-indigo { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.p-pink { background: rgba(217, 70, 239, 0.1); color: var(--accent); }
.p-red { background: rgba(239, 68, 68, 0.1); color: var(--color-red); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.stat-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.text-red {
    color: var(--color-red) !important;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.chart-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: var(--glass-blur);
}

.chart-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* Ledger Card Section */
.ledger-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    backdrop-filter: var(--glass-blur);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.ledger-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.ledger-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.ledger-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

/* Filter Bar Styling */
.filter-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: min(260px, 100%);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
    box-shadow: 0 0 12px var(--primary-glow);
}

.filter-groups {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 2 1 520px;
    min-width: 0;
}

.filter-select {
    min-width: 0;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-select option {
    background: var(--bg-main);
    color: var(--text-primary);
}

.upload-options {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.upload-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.upload-checkbox input {
    accent-color: var(--primary);
}

.table-select {
    width: 100%;
    min-width: 76px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.45rem;
    font-family: var(--font-primary);
    font-size: 0.75rem;
}

.table-select + .table-select {
    margin-top: 0.35rem;
}

.table-select option {
    background: var(--bg-main);
    color: var(--text-primary);
}

.amount-input,
.memo-input {
    width: 100%;
    min-width: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.45rem;
    font-family: var(--font-primary);
    font-size: 0.78rem;
}

.amount-input {
    text-align: right;
}

.memo-input {
    min-width: 0;
}

.dashboard-range {
    margin-bottom: 1.5rem;
}

.range-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.range-controls label,
.manual-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.date-input,
.manual-form-grid input,
.manual-form-grid select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    font-family: var(--font-primary);
}

.advice-section {
    margin-bottom: 1.5rem;
}

.advice-card {
    min-height: 160px;
}

.advice-text {
    color: var(--text-primary);
    white-space: pre-line;
    margin-top: 0.75rem;
}

.advice-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.advice-metrics span {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.settings-form-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.settings-form-row label {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.subscription-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.subscription-summary span {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
}

.subscription-table {
    min-width: 980px;
}

.subscription-table th:first-child,
.subscription-table td:first-child {
    width: 64px;
    text-align: center;
}

.subscription-table input[type="checkbox"] {
    accent-color: var(--primary);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    z-index: 500;
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    width: min(720px, 100%);
    background: var(--bg-main);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.manual-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.ledger-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.ledger-table th {
    background: rgba(255, 255, 255, 0.01);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.ledger-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    white-space: nowrap;
}

.ledger-table tbody tr {
    transition: var(--transition-fast);
}

.ledger-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.text-right {
    text-align: right;
}

/* Dynamic styling for cells */
.col-datetime {
    font-family: 'Outfit', sans-serif;
    color: var(--text-secondary);
}

.col-merchant {
    font-weight: 600;
    color: var(--text-primary);
}

.col-amount {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.amount-cancel {
    text-decoration: line-through;
    color: var(--text-muted);
}

.card-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-secondary);
}

/* Status Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Category Badge Dropdown Styles */
.category-select-wrapper {
    position: relative;
}

.category-select {
    width: 100%;
    max-width: 150px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.25rem 1.75rem 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: var(--transition-fast);
}

.category-select:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

.category-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.category-select-wrapper::after {
    content: "";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-40%);
    border-width: 4px 3.5px 0 3.5px;
    border-style: solid;
    border-color: var(--primary) transparent transparent transparent;
    pointer-events: none;
}

/* Category Specific Options colors (Dynamic colors via JS classes) */
.cat-shopping { background: rgba(244, 63, 94, 0.1); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.2); }
.cat-shopping-wrapper::after { border-top-color: #f43f5e !important; }

.cat-dining { background: rgba(249, 115, 22, 0.1); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.2); }
.cat-dining-wrapper::after { border-top-color: #f97316 !important; }

.cat-grocery { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.cat-grocery-wrapper::after { border-top-color: #10b981 !important; }

.cat-travel { background: rgba(6, 182, 212, 0.1); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.2); }
.cat-travel-wrapper::after { border-top-color: #06b6d4 !important; }

.cat-culture { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.2); }
.cat-culture-wrapper::after { border-top-color: #8b5cf6 !important; }

.cat-other { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--glass-border); }
.cat-other-wrapper::after { border-top-color: var(--text-secondary) !important; }

/* Empty state styling */
.empty-state {
    padding: 5rem 0 !important;
    text-align: center;
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
}

.empty-state-content p {
    font-size: 0.95rem;
}

.ledger-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Toast Message */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(14, 16, 23, 0.9);
    border: 1px solid var(--primary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
    z-index: 1000;
    backdrop-filter: var(--glass-blur);
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

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

/* Responsive Breakpoints */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    .brand {
        margin-bottom: 1.5rem;
    }
    .nav-menu {
        flex-direction: row;
    }
    .sidebar-footer {
        display: none;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 1.5rem;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-groups {
        flex-direction: column;
        flex-basis: auto;
    }
    .filter-select,
    .ledger-actions .btn,
    .quick-actions .btn,
    .year-selector-wrapper,
    .month-selector-wrapper {
        width: 100%;
    }
    .quick-actions,
    .ledger-actions {
        justify-content: stretch;
        width: 100%;
    }
}

/* View Panels Control */
.view-panel {
    display: none;
    min-width: 0;
    max-width: 100%;
}

.view-panel.active {
    display: block;
    animation: slideDown 0.4s ease-out;
}

/* Month Selector in Header */
.year-selector-wrapper,
.month-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.75rem;
}

.select-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.select-sm {
    padding: 0.5rem 1.75rem 0.5rem 1rem !important;
    font-size: 0.8rem !important;
    border-radius: var(--radius-sm) !important;
}

/* Gemini API Settings Card in Sidebar */
.sidebar-settings {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1.5rem;
    backdrop-filter: var(--glass-blur);
    transition: var(--transition-normal);
}

.sidebar-settings:hover {
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sparkle-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 4px rgba(217, 70, 239, 0.5));
}

.settings-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.key-input-wrapper {
    display: flex;
    gap: 0.25rem;
}

.key-input-wrapper input {
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.5rem;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

.key-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
}

.key-input-wrapper button {
    background: var(--primary);
    border: none;
    color: white;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.key-input-wrapper button:hover {
    background: var(--secondary);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.5);
}

/* AI Classification Action Button */
.btn-ai {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
    color: white;
}

.btn-ai::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: rotate(30deg);
    animation: sweep 3s infinite linear;
}

@keyframes sweep {
    0% { transform: translate(-100%, -100%) rotate(30deg); }
    100% { transform: translate(100%, 100%) rotate(30deg); }
}

.sparkle-anim {
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(255,255,255,0.4)); opacity: 0.8; }
    50% { filter: drop-shadow(0 0 8px var(--accent)); opacity: 1; }
}

/* AI loading overlay block */
.ai-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 7, 10, 0.85);
    backdrop-filter: blur(16px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-overlay.show {
    display: flex;
    opacity: 1;
}

.ai-overlay-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 3rem 2.5rem;
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px var(--primary-glow);
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-overlay-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-overlay-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.ai-glow-spinner {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
}

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

.spin {
    animation: spin 2s linear infinite;
}

.ai-log-terminal {
    background: #050608;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: monospace;
    font-size: 0.75rem;
    color: #10b981;
    height: 120px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.ai-log-line {
    margin-bottom: 0.25rem;
    word-break: break-all;
    opacity: 0.9;
    border-left: 2px solid #10b981;
    padding-left: 6px;
    line-height: 1.4;
}

/* Full Width Chart */
.full-width {
    grid-column: span 2;
}
