/* Custom CSS for AutoGest - Premium Freelancer ERP Design System */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Elegant Dark/Glass Theme */
    --bg-app: #090d16;
    --bg-surface: rgba(17, 24, 39, 0.7);
    --bg-surface-hover: rgba(31, 41, 55, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    
    /* Brand Color Palette */
    --primary: #8b5cf6; /* Vibrant violet */
    --primary-glow: rgba(139, 92, 246, 0.35);
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --secondary: #10b981; /* Emerald */
    --secondary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    /* Semantic Colors */
    --accent: #f59e0b; /* Amber */
    --danger: #ef4444; /* Rose */
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    --info: #0ea5e9; /* Sky */
    
    /* Text Colors */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-on-primary: #ffffff;
    
    /* Layout Constants */
    --sidebar-width: 280px;
    --header-height: 70px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    /* Smooth Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* LIGHT THEME OVERRIDES */
.light-theme {
    --bg-app: #f4f6fa;
    --bg-surface: rgba(255, 255, 255, 0.8);
    --bg-surface-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-main: #1f2937;
    --text-muted: #6b7280;
}

.light-theme body {
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.03) 0px, transparent 50%) !important;
}

.light-theme .sidebar {
    background: rgba(255, 255, 255, 0.95) !important;
    border-right: 1px solid var(--border-color) !important;
}

.light-theme .sidebar-brand {
    background: var(--primary-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.light-theme .sidebar-link {
    color: #4b5563 !important;
}

.light-theme .sidebar-link:hover, .light-theme .sidebar-link.active {
    background: rgba(139, 92, 246, 0.06) !important;
    color: var(--primary) !important;
}

.light-theme .sidebar-link.active {
    background: var(--primary-gradient) !important;
    color: var(--text-on-primary) !important;
    box-shadow: 0 4px 15px var(--primary-glow) !important;
}

.light-theme .user-name {
    color: #1f2937 !important;
}

.light-theme .btn-logout {
    color: #4b5563 !important;
}

.light-theme .btn-logout:hover {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.light-theme .header {
    background: rgba(255, 255, 255, 0.6) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.light-theme .form-control {
    background-color: rgba(0, 0, 0, 0.02) !important;
    color: #1f2937 !important;
}

.light-theme .form-control:focus {
    background-color: rgba(0, 0, 0, 0.01) !important;
}

.light-theme .form-control::placeholder {
    color: rgba(0, 0, 0, 0.35) !important;
}

.light-theme select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234b5563'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
}

.light-theme select.form-control option {
    background: #ffffff !important;
    color: #1f2937 !important;
}

.light-theme .btn-outline {
    color: #4b5563 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

.light-theme .btn-outline:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.25) !important;
}

.light-theme .custom-table th {
    color: #4b5563 !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.08) !important;
}

.light-theme .custom-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: #1f2937 !important;
}

.light-theme .custom-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.01) !important;
}

.light-theme .tabs-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.light-theme .tab-btn {
    color: #4b5563 !important;
}

.light-theme .tab-btn:hover {
    color: #1f2937 !important;
}

.light-theme .tab-btn.active {
    color: var(--primary) !important;
}

.light-theme .invoice-builder-table th {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

/* APP LAYOUT */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR STYLING */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 15, 30, 0.95);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    margin-bottom: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px var(--primary-glow);
    color: var(--text-on-primary);
}

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

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

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-on-primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.user-info {
    flex-grow: 1;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

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

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

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

/* MAIN CONTENT CONTAINER */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    background: rgba(9, 13, 22, 0.5);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 90;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.content-body {
    padding: 2.5rem;
    flex-grow: 1;
}

/* CARDS / CONTAINERS */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
    margin-bottom: 1.75rem;
}

.glass-card:hover {
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 10px 40px 0 rgba(139, 92, 246, 0.05);
}

/* DASHBOARD SPECIFICS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.kpi-card.kpi-success::before {
    background: var(--secondary-gradient);
}

.kpi-card.kpi-warning::before {
    background: var(--accent);
}

.kpi-card.kpi-danger::before {
    background: var(--danger-gradient);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.kpi-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kpi-footer .trend-up {
    color: var(--secondary);
}

.kpi-footer .trend-down {
    color: var(--danger);
}

.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-on-primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}

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

.btn-secondary {
    background: var(--secondary-gradient);
    color: var(--text-on-primary);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--danger-gradient);
    color: var(--text-on-primary);
}

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

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

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-table td {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-main);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr {
    transition: var(--transition-smooth);
}

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

/* BADGES / FISCAL STATUS */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-paid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-overdue {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-draft {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* FORMS AND INPUTS */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

select.form-control option {
    background: #090d16;
    color: #fff;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* TAB MODULE */
.tabs-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.75rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

/* LOGIN LAYOUT */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2.25rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

/* MODELOS FISCALES */
.fiscal-container {
    background: #ffffff;
    color: #333333;
    border-radius: var(--radius-lg);
    border: 1px solid #dddddd;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-top: 1.5rem;
}

.fiscal-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 3px solid #111111;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.fiscal-title-block {
    text-transform: uppercase;
}

.fiscal-title-block h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.fiscal-title-block p {
    font-size: 0.85rem;
    color: #666666;
    font-weight: 600;
}

.fiscal-badge {
    background: #111111;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.fiscal-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.fiscal-table th, .fiscal-table td {
    border: 1px solid #cccccc;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
}

.fiscal-table th {
    background: #f5f5f5;
    color: #111111;
    font-weight: 700;
    text-transform: uppercase;
}

.fiscal-table td.cell-num {
    text-align: right;
    font-weight: 600;
}

.fiscal-table tr.highlight-row {
    background: #fffbeb;
    font-weight: 700;
}

.fiscal-table tr.total-row {
    background: #f0fdf4;
    font-weight: 800;
}

.fiscal-table tr.total-row td {
    border-top: 2px solid #15803d;
    border-bottom: 2px solid #15803d;
}

.fiscal-table td.cell-index {
    width: 40px;
    text-align: center;
    background: #f5f5f5;
    font-weight: 700;
    color: #555555;
}

/* DYNAMIC INVOICE ITEMS BUILDER */
.invoice-builder-table {
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.invoice-builder-table th {
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.invoice-builder-table td {
    padding: 0.5rem 0;
}

/* PRINT MEDIA OVERRIDES FOR INVOICE REPRESENTATION */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        background-image: none !important;
    }
    
    .sidebar, .header, .btn, .tabs-header, .alert, form .btn-primary {
        display: none !important;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
    }
    
    .content-body {
        padding: 0 !important;
    }
    
    .glass-card {
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        backdrop-filter: none !important;
    }
    
    .invoice-print-container {
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
        color: #333333 !important;
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
    }
    
    .invoice-print-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 40px;
        border-bottom: 2px solid #eeeeee;
        padding-bottom: 20px;
    }
    
    .invoice-print-logo {
        font-size: 2rem;
        font-weight: 800;
        color: #333333;
    }
    
    .invoice-print-details {
        text-align: right;
    }
    
    .invoice-print-addresses {
        display: flex;
        justify-content: space-between;
        margin-bottom: 40px;
    }
    
    .invoice-print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 40px;
    }
    
    .invoice-print-table th, .invoice-print-table td {
        border-bottom: 1px solid #eeeeee;
        padding: 12px;
        text-align: left;
    }
    
    .invoice-print-table th {
        background-color: #fafafa;
        font-weight: bold;
    }
    
    .invoice-print-totals {
        display: flex;
        justify-content: flex-end;
    }
    
    .invoice-print-totals-table {
        width: 300px;
        border-collapse: collapse;
    }
    
    .invoice-print-totals-table td {
        padding: 8px 12px;
        border-bottom: 1px solid #eeeeee;
    }
    
    .invoice-print-totals-table tr.grand-total {
        font-weight: bold;
        font-size: 1.2rem;
        background-color: #fafafa;
    }
}

/* --- RESPONSIVE UTILITIES AND GRIDS --- */

.btn-menu-mobile {
    display: none;
}

/* Filters Form Grid */
.filter-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
    gap: 1rem;
    align-items: end;
}

/* Dashboard Recent Transactions Grid */
.recent-transactions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Invoices Summary / Notes Grid */
.invoice-summary-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

/* Expenses Totals Block */
.expenses-totals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Mobile responsive adjustments */
@media (max-width: 1024px) {
    .recent-transactions-grid {
        grid-template-columns: 1fr;
    }
    
    .invoice-summary-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Layout Overrides */
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        box-shadow: 20px 0 30px rgba(0,0,0,0.5);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .header {
        padding: 0 1rem;
    }
    
    .content-body {
        padding: 1.25rem;
    }
    
    /* Header Mobile Actions & Buttons */
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions .btn .hide-mobile {
        display: none; /* Hide text, leave only icon */
    }
    
    .header-actions .btn {
        padding: 0.5rem;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        justify-content: center;
    }
    
    .header-actions .btn i {
        margin: 0 !important;
    }
    
    /* Hamburger Menu Button */
    .btn-menu-mobile {
        background: none;
        border: none;
        color: var(--text-main);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition-smooth);
        margin-right: 0.5rem;
    }
    
    .btn-menu-mobile:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    
    /* Backdrop/Overlay */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .mobile-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Filter Grid Collapsing */
    .filter-form-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-form-grid > div:last-child {
        display: flex;
        justify-content: stretch;
        gap: 0.5rem;
    }
    
    .filter-form-grid .btn {
        flex: 1;
    }
    
    /* Expenses Totals Block */
    .expenses-totals-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .expenses-totals-grid > div {
        padding: 0.5rem 0;
        border-bottom: 1px dashed var(--border-color);
    }
    
    .expenses-totals-grid > div:last-child {
        border-bottom: none;
    }
    
    /* Quick summary alignment */
    .glass-card[style*="display: flex"] {
        padding: 1rem !important;
    }

    /* Alert Banner mobile adjustments */
    .alert-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .alert-banner > div:last-child {
        text-align: left !important;
        width: 100%;
        border-top: 1px dashed var(--border-color);
        padding-top: 0.75rem;
    }

    /* Fiscal Container & Table responsive adjustments */
    .fiscal-container {
        padding: 1.25rem !important;
        margin-top: 1rem !important;
    }
    
    .fiscal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .fiscal-badge {
        align-self: flex-end;
    }
    
    .fiscal-table th, .fiscal-table td {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
}

/* Alert Banner */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}


