/* ==========================================================================
   eRAsolar - Módulo de Control de Gastos de Mano de Obra
   Design System & Professional Dark Theme
   ========================================================================== */

:root {
    /* Palette */
    --era-dark-bg: #070b14;
    --era-card-bg: #0f172a;
    --era-card-secondary: #162038;
    --era-card-hover: #1c2a4a;
    
    --era-gold: #fdb813;
    --era-gold-hover: #e5a40b;
    --era-gold-glow: rgba(253, 184, 19, 0.25);
    
    --era-blue: #3b82f6;
    --era-blue-dark: #1d4ed8;
    --era-cyan: #38bdf8;
    --era-emerald: #10b981;
    --era-emerald-glow: rgba(16, 185, 129, 0.25);
    --era-amber: #f59e0b;
    --era-red: #ef4444;
    --era-red-glow: rgba(239, 68, 68, 0.25);
    --era-purple: #8b5cf6;
    
    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;
    
    /* Borders & Glass */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-blur: blur(16px);
    
    /* Radii & Shadows */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;
    
    --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
    --shadow-modal: 0 25px 60px -12px rgba(0, 0, 0, 0.85);
}

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

body {
    background-color: var(--era-dark-bg);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image: 
        radial-gradient(circle at 10% 0%, rgba(253, 184, 19, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Outfit', 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--era-dark-bg);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Container */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 3rem 1.5rem;
}

/* ==========================================================================
   Header & Session Bar
   ========================================================================== */
.main-header {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    position: sticky;
    top: 1rem;
    z-index: 40;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(253, 184, 19, 0.25));
}

.brand-title-group h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-badge {
    background: rgba(253, 184, 19, 0.15);
    color: var(--era-gold);
    border: 1px solid rgba(253, 184, 19, 0.35);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
}

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

/* Session Selectors */
.session-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.selector-pill {
    background: var(--era-card-secondary);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-pill);
    padding: 0.4rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.selector-pill:focus-within {
    border-color: var(--era-gold);
    box-shadow: 0 0 0 2px var(--era-gold-glow);
}

.selector-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.selector-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    padding-right: 0.5rem;
}

.selector-select option {
    background: var(--era-card-bg);
    color: var(--text-primary);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--era-blue);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header Action Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--era-gold) 0%, #f59e0b 100%);
    color: #090e1a;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(253, 184, 19, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(253, 184, 19, 0.45);
}

.btn-secondary {
    background: var(--era-card-secondary);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--era-card-hover);
    border-color: var(--border-highlight);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 15px var(--era-emerald-glow);
}

.btn-icon-only {
    padding: 0.6rem;
    border-radius: var(--radius-md);
}

/* ==========================================================================
   Project Overview & Budget Details Card
   ========================================================================== */
.project-banner {
    background: linear-gradient(135deg, #0f172a 0%, #172445 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.project-banner::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(253, 184, 19, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.banner-grid {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 1.5rem;
    align-items: center;
}

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

.project-info-header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.project-meta-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.pill-code {
    background: rgba(59, 130, 246, 0.15);
    color: var(--era-cyan);
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
}

.pill-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
}

.pill-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--era-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.project-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
}

.project-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.budget-breakdown-card {
    background: rgba(11, 19, 38, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--era-gold);
}

.breakdown-header button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.breakdown-header button:hover {
    color: var(--text-primary);
}

.breakdown-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
}

.breakdown-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.65rem;
    border-left: 3px solid var(--era-blue);
}

.breakdown-item.baq { border-left-color: var(--era-emerald); }
.breakdown-item.otras { border-left-color: var(--era-purple); }
.breakdown-item.imp { border-left-color: var(--era-amber); }

.breakdown-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.breakdown-val {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================================================
   KPI Cards & Semáforo
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--era-card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-highlight);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.kpi-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.kpi-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon-wrap.gold { background: rgba(253, 184, 19, 0.15); color: var(--era-gold); }
.kpi-icon-wrap.blue { background: rgba(59, 130, 246, 0.15); color: var(--era-blue); }
.kpi-icon-wrap.emerald { background: rgba(16, 185, 129, 0.15); color: var(--era-emerald); }
.kpi-icon-wrap.red { background: rgba(239, 68, 68, 0.15); color: var(--era-red); }
.kpi-icon-wrap.purple { background: rgba(139, 92, 246, 0.15); color: var(--era-purple); }

.kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 0.35rem;
}

.kpi-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Progress bar inside KPI */
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-top: 0.6rem;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill-emerald { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-fill-amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill-red { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Semáforo badge */
.semaforo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
}
.semaforo-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--era-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.semaforo-yellow {
    background: rgba(245, 158, 11, 0.15);
    color: var(--era-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.semaforo-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--era-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   Analytics / Charts Section
   ========================================================================== */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

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

.chart-card {
    background: var(--era-card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

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

.chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Category Legend Custom */
.category-summary-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.cat-sum-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
}

.cat-sum-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.4rem;
}

/* ==========================================================================
   Expenses Table & Filter Toolbar
   ========================================================================== */
.table-section {
    background: var(--era-card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
}

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

.toolbar-title-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.toolbar-title-group p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.filters-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap i {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    background: var(--era-card-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem 0.5rem 2.2rem;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    width: 200px;
    transition: all 0.2s ease;
}

.search-input:focus {
    width: 240px;
    border-color: var(--era-gold);
}

.filter-select {
    background: var(--era-card-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
}

.filter-select option {
    background: var(--era-card-bg);
}

/* Responsive Table */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.expenses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    text-align: left;
}

.expenses-table thead {
    background: #0b1329;
}

.expenses-table th {
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    border-bottom: 1px solid var(--border-highlight);
    white-space: nowrap;
}

.expenses-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s ease;
}

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

.expenses-table td {
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Category Badge inside table */
.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}

.cat-badge.logistica { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.cat-badge.alimentacion { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.cat-badge.hospedaje { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.cat-badge.imprevistos { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.table-user-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
}

.amount-cell {
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    white-space: nowrap;
}

.receipt-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--era-cyan);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.receipt-btn:hover {
    background: rgba(56, 189, 248, 0.15);
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-action:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.btn-action.delete:hover {
    color: var(--era-red);
    background: rgba(239, 68, 68, 0.15);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-dim);
}

/* ==========================================================================
   Modals & Forms
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 15, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--era-card-bg);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
}

.btn-close-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.modal-body {
    padding: 1.5rem;
}

/* Form Groups */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-input, .form-select, .form-textarea {
    background: var(--era-card-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--era-gold);
    box-shadow: 0 0 0 2px var(--era-gold-glow);
}

.form-textarea {
    resize: vertical;
    min-height: 70px;
}

/* Category Selection Buttons in Form */
.category-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

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

.cat-pick-btn {
    background: var(--era-card-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.cat-pick-btn i {
    font-size: 1.2rem;
}

.cat-pick-btn span {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
}

.cat-pick-btn.selected {
    background: rgba(253, 184, 19, 0.15);
    border-color: var(--era-gold);
    color: var(--era-gold);
    box-shadow: 0 0 12px var(--era-gold-glow);
}

.cat-pick-btn:hover:not(.selected) {
    background: var(--era-card-hover);
    color: var(--text-primary);
}

/* Conditional Helper Boxes in Form */
.conditional-field-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    margin-bottom: 1rem;
}

/* Receipt Upload Box */
.receipt-upload-area {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: all 0.2s ease;
}

.receipt-upload-area:hover {
    border-color: var(--era-cyan);
    background: rgba(56, 189, 248, 0.04);
}

.receipt-preview-wrap {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.receipt-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-highlight);
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 200;
}

.toast {
    background: var(--era-card-bg);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.1rem;
    color: #fff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-modal);
    animation: toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Mobile Quick Action Floating Button */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: linear-gradient(135deg, var(--era-gold) 0%, #f59e0b 100%);
    color: #090e1a;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(253, 184, 19, 0.45);
    border: none;
    z-index: 50;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-fab {
        display: flex;
    }
    .header-actions .btn-primary {
        display: none;
    }
}
