/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252b3b;
    --bg-card: #1e2433;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --border-color: #2d3748;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --hover-bg: #2d3748;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* Custom Scrollbar - Visible on dark background */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-secondary);
}

/* Layout */
.app-container { display: flex; height: 100%; position: relative; }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    color: var(--text-primary);
}
.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
.mobile-overlay.active {
    display: block;
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border-color); }
.logo { display: flex; align-items: center; text-decoration: none; color: var(--text-primary); transition: opacity 0.2s; }
.logo:hover { opacity: 0.8; }
.logo-icon { font-size: 24px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.logo-icon i { font-size: 24px; }
.logo-icon svg { width: 24px; height: 24px; }
.logo-text { font-weight: bold; font-size: 18px; margin-left: 10px; }

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    overflow-y: auto;
}
.nav-top { flex: 1; }
.nav-bottom { margin-top: auto; border-top: 1px solid var(--border-color); padding-top: 10px; }

.nav-item {
    display: flex; align-items: center; padding: 12px 24px;
    color: var(--text-secondary); text-decoration: none;
    border-left: 3px solid transparent; gap: 12px;
    transition: 0.2s;
}
.nav-item:hover, .nav-item.active { background: var(--hover-bg); color: white; }
.nav-item.active { border-left-color: var(--accent-blue); }
.nav-icon { font-size: 18px; width: 20px; text-align: center; }
.nav-icon i { font-size: 18px; }
.nav-text { flex: 1; }

/* Submenu */
.nav-group { margin-bottom: 5px; }
.nav-subitems { padding-left: 0; }
.nav-subitem { 
    padding-left: 54px; 
    font-size: 0.9em;
    border-left: 3px solid transparent;
}
.nav-subitem:hover { background: var(--hover-bg); color: white; }
.nav-subitem.active { border-left-color: var(--accent-blue); background: var(--hover-bg); }

/* Main Content */
.main-content { flex: 1; padding: 30px; overflow-y: auto; }
.content-header { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 30px; 
    align-items: center; 
    flex-wrap: wrap;
    gap: 15px;
}
.content-header h2 { margin: 0; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Dashboard Controls */
.dashboard-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}
.site-filter {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    min-width: 200px;
}
.site-filter:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Dashboard Grid - Unified Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card { 
    background: var(--bg-card); 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px solid var(--border-color);
}

.chart-card { 
    background: var(--bg-card); 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px solid var(--border-color);
}

.chart-card > div {
    width: 100%;
    max-width: 100%;
}

/* Make bar chart cards same height as stat cards */
.chart-card-bar {
    padding: 20px 20px 16px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chart-card-bar h3 {
    margin-bottom: 2px;
}

.chart-card-bar > div {
    flex: 1;
    min-height: 0;
}

.chart-card-bar .apexcharts-canvas {
    max-width: 100%;
}

.chart-card-bar .apexcharts-legend {
    padding: 0 !important;
    margin: 0 !important;
}

/* Allow tooltips to escape card bounds */
.chart-card-bar .apexcharts-tooltip {
    position: absolute !important;
}

/* ApexCharts tooltip always on top */
.apexcharts-tooltip {
    z-index: 10000 !important;
}

.apexcharts-tooltip.apexcharts-theme-dark {
    background: rgba(30, 36, 51, 0.95) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.stat-card h3, .chart-card h3 { 
    font-size: 14px; 
    color: var(--text-secondary); 
    margin-bottom: 10px; 
}

/* Extra wide screens (>=2048px): 8 columns */
@media (min-width: 2048px) {
    .dashboard-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .stat-card,
    .chart-card-bar {
        grid-column: span 1;
    }
    
    .chart-card-wide {
        grid-column: span 8;
    }
}

/* Large screens (1400-2047px): 4 columns */
@media (max-width: 2047px) and (min-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stat-card,
    .chart-card-bar {
        grid-column: span 1;
    }
    
    .chart-card-wide {
        grid-column: span 4;
    }
}

/* Medium screens (900-1399px): 2 columns */
@media (max-width: 1399px) and (min-width: 900px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card,
    .chart-card-bar {
        grid-column: span 1;
    }
    
    .chart-card-wide {
        grid-column: span 2;
    }
}
.stat-value { font-size: 28px; font-weight: bold; margin: 10px 0; }
.stat-change { font-size: 0.9em; display: inline-block; }
.stat-change i { font-size: 0.9em; }
.stat-change.positive { color: var(--accent-green); }
.stat-change.negative { color: var(--accent-red); }
.stat-change.neutral { color: var(--text-secondary); }
.stat-label { 
    font-size: 0.85em; 
    color: var(--text-secondary); 
    font-weight: 600; 
    letter-spacing: 0.5px;
}

/* Dual stat cards (two values in one card) */
.stat-card-dual .stat-dual-container {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}
.stat-card-dual .stat-dual-item {
    flex: 1;
    text-align: center;
}
.stat-card-dual .stat-dual-label {
    display: block;
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.stat-card-dual .stat-dual-value {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    color: var(--text-primary);
}

/* Date Range Filter - Full Width Above Stats */
.date-range-filter {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.date-range-filter h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.date-range-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.date-range-quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-quick {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.btn-quick:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}
.date-range-inputs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.date-input {
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 13px;
    width: 150px;
}
.date-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}
.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}
.date-range-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Site Tiles */
.site-tiles { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 20px; 
    padding: 20px 0;
}
.site-tile { 
    background: var(--bg-card); 
    padding: 30px; 
    border-radius: 12px; 
    border: 1px solid var(--border-color); 
    cursor: pointer; 
    text-align: center; 
    transition: all 0.3s ease;
}
.site-tile:hover { 
    transform: translateY(-5px); 
    border-color: var(--accent-blue);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.2);
}
.site-icon { font-size: 40px; margin-bottom: 15px; }
.site-icon i { font-size: 40px; }
.site-tile h3 { font-size: 18px; margin: 0; color: var(--text-primary); }

/* HTML Data Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead {
    background: var(--bg-secondary);
}
.data-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.data-table tbody tr:hover {
    background: var(--hover-bg);
}
.data-table tbody tr:last-child {
    border-bottom: none;
}
.data-table td {
    padding: 15px 20px;
    font-size: 14px;
}
.data-table code {
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--accent-blue);
    font-family: 'Courier New', monospace;
}
.data-table code.code-white {
    color: var(--text-primary);
}
.data-table code.small {
    font-size: 12px;
    max-width: 200px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}
.badge-blue { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.badge-gray { background: rgba(160, 174, 192, 0.2); color: var(--text-secondary); }
.badge-green { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.badge-red { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.badge-yellow { background: rgba(245, 158, 11, 0.2); color: var(--accent-yellow); }

/* AG Grid Overrides */
.ag-theme-quartz-dark {
    --ag-background-color: var(--bg-card);
    --ag-header-background-color: var(--bg-secondary);
    --ag-odd-row-background-color: var(--bg-card);
    --ag-border-color: var(--border-color);
    --ag-row-hover-color: var(--hover-bg);
    --ag-foreground-color: var(--text-primary);
    --ag-secondary-foreground-color: var(--text-secondary);
}

/* White scrollbars for AG Grid */
.ag-theme-quartz-dark ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
.ag-theme-quartz-dark ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 6px;
}
.ag-theme-quartz-dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}
.ag-theme-quartz-dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
/* Firefox */
.ag-theme-quartz-dark * {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) var(--bg-secondary);
}

/* Force scrollbar visibility on desktop */
.ag-theme-quartz-dark .ag-body-horizontal-scroll {
    overflow-x: auto !important;
}
.ag-theme-quartz-dark .ag-body-viewport {
    overflow-x: auto !important;
}

.btn-action { 
    padding: 6px 12px; 
    background: var(--bg-tertiary); 
    border: 1px solid var(--border-color); 
    color: white; 
    cursor: pointer; 
    border-radius: 4px; 
    margin-right: 5px;
    font-size: 12px;
    transition: 0.2s;
}
.btn-action:hover { background: var(--accent-blue); }
.btn-action.delete:hover { background: var(--accent-red); }
.btn-action.cancel { background: var(--bg-tertiary); }
.btn-action.cancel:hover { background: var(--accent-yellow); }

.btn-icon-risk {
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    transition: 0.2s;
}
.btn-icon-risk:hover {
    color: var(--text-primary);
}
.btn-icon-risk i {
    font-size: 16px;
}

/* Buttons */
.btn { 
    padding: 10px 20px; 
    border-radius: 6px; 
    border: none; 
    cursor: pointer; 
    font-weight: 500;
    font-size: 14px;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn i {
    font-size: 16px;
}
.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: var(--bg-tertiary); color: white; border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--hover-bg); }

/* Logs Filters */
.logs-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}
.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.filter-select {
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}
.filter-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}
.filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}
.log-detail {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}
.log-detail:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
}

/* Modals */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.7); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 1000; 
}
.modal { 
    background: var(--bg-secondary); 
    width: 500px; 
    max-width: 90%; 
    padding: 0; 
    border-radius: 8px; 
    border: 1px solid var(--border-color); 
}
.modal-small {
    width: 400px;
}
.modal-header { 
    padding: 20px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px 20px 20px;
}
.btn-close { 
    background: none; 
    border: none; 
    color: var(--text-secondary); 
    font-size: 24px; 
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-close i {
    font-size: 24px;
}
.btn-close:hover { color: white; }
.form-group { margin-bottom: 15px; }
.form-group label { 
    display: block; 
    margin-bottom: 5px; 
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}
.form-group input, .form-group select { 
    width: 100%; 
    padding: 10px 12px; 
    background: var(--bg-primary); 
    border: 1px solid var(--border-color); 
    color: white; 
    border-radius: 4px;
    font-size: 14px;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
}
.form-group input[readonly] {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}
.modal-actions { 
    display: flex; 
    justify-content: flex-end; 
    gap: 10px; 
    margin-top: 20px;
}

/* Sidebar Panel (Right) - Payment History */
.sidebar-panel { 
    position: fixed; 
    top: 0; 
    right: -600px; 
    width: 600px; 
    height: 100%; 
    background: var(--bg-secondary); 
    transition: right 0.3s ease; 
    z-index: 900; 
    display: flex; 
    flex-direction: column; 
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    border-left: 1px solid var(--border-color);
}
.sidebar-panel.active { right: 0; }
.sidebar-panel .sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-panel .sidebar-header h3 {
    margin: 0;
    font-size: 18px;
}
.sidebar-content { 
    padding: 20px; 
    overflow-y: auto; 
    flex: 1; 
}
.user-details-summary { 
    background: var(--bg-card); 
    padding: 15px; 
    margin-bottom: 20px; 
    border-radius: 6px;
    border: 1px solid var(--border-color);
    line-height: 1.6;
}
.sidebar-content h4 {
    margin: 20px 0 10px 0;
    font-size: 16px;
    color: var(--text-secondary);
}
body.sidebar-open::before { 
    content: ''; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    z-index: 800; 
}

/* Login Page */
.login-page { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
    min-height: 100vh;
    width: 100%;
}
.login-box { 
    background: var(--bg-secondary); 
    padding: 40px; 
    border-radius: 12px; 
    width: 400px;
    max-width: 90%;
    text-align: center;
    border: 1px solid var(--border-color);
}
.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}
.login-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.login-logo svg {
    width: 48px;
    height: 48px;
}

/* Animated Chart Bars in Login Logo */
@keyframes barPulse1 {
    0% { 
        transform: scaleY(1);
        transform-origin: bottom;
    }
    25% { 
        transform: scaleY(0.5);
        transform-origin: bottom;
    }
    50% { 
        transform: scaleY(1);
        transform-origin: bottom;
    }
    100% { 
        transform: scaleY(1);
        transform-origin: bottom;
    }
}

@keyframes barPulse2 {
    0% { 
        transform: scaleY(1);
        transform-origin: bottom;
    }
    25% { 
        transform: scaleY(0.65);
        transform-origin: bottom;
    }
    50% { 
        transform: scaleY(1);
        transform-origin: bottom;
    }
    100% { 
        transform: scaleY(1);
        transform-origin: bottom;
    }
}

@keyframes barPulse3 {
    0% { 
        transform: scaleY(1);
        transform-origin: bottom;
    }
    25% { 
        transform: scaleY(0.55);
        transform-origin: bottom;
    }
    50% { 
        transform: scaleY(1);
        transform-origin: bottom;
    }
    100% { 
        transform: scaleY(1);
        transform-origin: bottom;
    }
}

.login-logo .bar-1 {
    animation: barPulse1 3s ease-in-out infinite;
}

.login-logo .bar-2 {
    animation: barPulse2 3.5s ease-in-out infinite;
    animation-delay: 0.3s;
}

.login-logo .bar-3 {
    animation: barPulse3 3.2s ease-in-out infinite;
    animation-delay: 0.6s;
}

.login-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.5px;
}
.login-header p {
    color: var(--text-secondary);
    margin: 0;
}
.login-form {
    text-align: left;
}
.btn-block { 
    width: 100%; 
    margin-top: 20px;
    justify-content: center;
}
.alert-error { 
    color: var(--accent-red); 
    background: rgba(239, 68, 68, 0.1); 
    padding: 10px; 
    margin-bottom: 15px; 
    border-radius: 4px;
    border: 1px solid var(--accent-red);
    text-align: center;
}

/* Responsive - Mobile (<=899px) */
@media (max-width: 899px) {
    .mobile-menu-toggle {
        display: block;
        right: 15px;
        left: auto;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-header {
        padding: 15px 20px;
    }
    
    .logo-text {
        max-width: 80%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.2;
    }
    
    .sidebar-panel { 
        width: 100%; 
        right: -100%;
        z-index: 1100;
    }
    
    .main-content {
        width: 100%;
        padding: 70px 15px 15px;
    }
    
    /* Date Range Filter - Mobile */
    .date-range-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .date-range-controls {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    .date-range-quick {
        width: 100%;
        flex-direction: column;
    }
    .btn-quick {
        width: 100%;
    }
    .date-range-inputs {
        width: 100%;
        flex-direction: column;
    }
    .date-input {
        width: 100%;
    }
    .date-range-actions {
        width: 100%;
    }
    .date-range-actions .btn {
        flex: 1;
    }
    
    .site-tiles { 
        grid-template-columns: 1fr; 
    }
    
    /* Dashboard Grid - Mobile: 1 column */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card,
    .chart-card-wide,
    .chart-card-bar {
        grid-column: span 1;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table { 
        font-size: 12px;
        min-width: 800px;
    }
    
    .data-table th, .data-table td { 
        padding: 10px; 
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Logs filters mobile */
    .logs-filters {
        flex-direction: column;
        gap: 10px;
    }
    .filter-group {
        width: 100%;
    }
    .filter-actions {
        width: 100%;
        margin-left: 0;
    }
    .filter-actions .btn {
        flex: 1;
    }
    
    /* AG-Grid mobile pagination styles */
    .ag-theme-quartz-dark .ag-paging-panel {
        font-size: 10px;
        height: 40px;
        padding: 0 2px;
    }
    
    .ag-theme-quartz-dark .ag-paging-button,
    .ag-theme-quartz-dark .ag-paging-page-summary-panel,
    .ag-theme-quartz-dark .ag-paging-row-summary-panel {
        font-size: 10px;
        padding: 0 1px;
    }
    
    .ag-theme-quartz-dark .ag-paging-button {
        min-width: 24px;
        padding: 0 1px;
    }
    
    .ag-theme-quartz-dark .ag-select {
        font-size: 10px;
        height: 26px;
        padding: 0 1px;
        max-width: 50px;
    }
    
    .ag-theme-quartz-dark .ag-paging-page-summary-panel {
        margin: 0 1px;
    }
    
    .ag-theme-quartz-dark .ag-paging-row-summary-panel {
        margin: 0 1px;
    }
    
    .ag-theme-quartz-dark .ag-paging-row-summary-panel {
        margin: 0 4px;
    }
    
    /* Login page mobile centering */
    .login-page {
        padding: 20px;
    }
    
    .login-box {
        margin: auto;
    }
}
