/* ========================================
   MODERN ADMIN UI - CHIRA NET
   Enhanced styling - Non-destructive overrides
   ======================================== */

/* === GLOBAL ENHANCEMENTS === */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f1f5f9;
}

/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s ease;
    line-height: 1;
    box-sizing: border-box;
}
.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.2);
}
.mobile-menu-btn i {
    font-size: 16px;
    line-height: 1;
    display: block;
}

/* === SIDENAV ENHANCEMENTS === */
#sidenav {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.04) !important;
    width: 210px !important;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 10040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s ease;
}

/* Desktop main area */
#main {
    margin-left: 210px !important;
}

/* Menu items */
#sidenav a.menu {
    color: #334155 !important;
    padding: 10px 14px;
    border-left: 3px solid transparent;
    transition: all 0.25s ease;
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

/* Icon box - visible background for ALL menu items & dropdown sub-items */
#sidenav a.menu i.fa,
#sidenav .dropdown-btn i.fa:first-child,
#sidenav .dropdown-container a i.fa:first-child {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #e2e8f0 !important;
    color: #475569 !important;
    font-size: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    line-height: 32px;
    text-align: center;
    margin: 0 !important;
}

/* Fix FontAwesome icon visibility */
#sidenav a.menu i.fa::before,
#sidenav .dropdown-btn i.fa:first-child::before,
#sidenav .dropdown-container a i.fa:first-child::before {
    display: block;
    position: relative;
    z-index: 1;
}

/* Hover state for all sidebar icons */
#sidenav a.menu:hover,
#sidenav .dropdown-btn:hover,
#sidenav .dropdown-container a:hover {
    color: #1e293b !important;
    border-left-color: #6366f1;
    background: #f8fafc !important;
}

#sidenav a.menu:hover i.fa,
#sidenav .dropdown-btn:hover i.fa:first-child,
#sidenav .dropdown-container a:hover i.fa:first-child {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #ffffff !important;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Active state for all sidebar items */
#sidenav a.menu.active,
#sidenav .dropdown-btn.active,
#sidenav .dropdown-container a.active {
    background: linear-gradient(90deg, #eef2ff 0%, #f8fafc 100%) !important;
    color: #4f46e5 !important;
    border-left-color: #4f46e5;
    font-weight: 600;
}

#sidenav a.menu.active i.fa,
#sidenav .dropdown-btn.active i.fa:first-child,
#sidenav .dropdown-container a.active i.fa:first-child {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.45);
}

/* Dropdown buttons */
#sidenav .dropdown-btn {
    color: #334155 !important;
    padding: 10px 14px;
    border-left: 3px solid transparent;
    transition: all 0.25s ease;
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
}

/* Dropdown arrow icon */
#sidenav .dropdown-btn i.fa-caret-down,
#sidenav .dropdown-btn i.fa-angle-down,
#sidenav .dropdown-btn i.fa-chevron-down {
    background: transparent !important;
    color: #94a3b8 !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
    box-shadow: none !important;
    margin-left: auto;
    font-size: 10px !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

/* Rotate chevron when dropdown is active/open */
#sidenav .dropdown-btn.active i.fa-caret-down,
#sidenav .dropdown-btn.active i.fa-angle-down,
#sidenav .dropdown-btn.active i.fa-chevron-down {
    transform: rotate(180deg);
    color: #4f46e5 !important;
}

/* Dropdown container items */
#sidenav .dropdown-container a {
    color: #64748b !important;
    padding: 6px 12px 6px 32px !important;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center;
    gap: 10px;
}

#sidenav .dropdown-container a:hover {
    color: #4f46e5 !important;
    background: #f8fafc;
}

#sidenav .dropdown-container a.active {
    color: #4f46e5 !important;
    font-weight: 600;
}

/* Card header */
#sidenav .menu.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%) !important;
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
    padding: 14px 16px;
    font-size: 14px;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Ripple effect */
.nav-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.25);
    transform: scale(0);
    animation: navRipple 0.55s ease-out;
    pointer-events: none;
    z-index: 5;
}

@keyframes navRipple {
    to { transform: scale(4); opacity: 0; }
}

/* === CARD ENHANCEMENTS === */
.card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

/* === BUTTON ENHANCEMENTS === */
.btn, input[type="submit"] {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
}

.btn:hover, input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-custom {
    border-radius: 8px;
    font-weight: 500;
}

/* === TABLE ENHANCEMENTS === */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 14px;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 13px;
}

.table tr:hover td {
    background: #f8fafc;
}

/* === FORM ENHANCEMENTS === */
.form-control {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* === BADGE ENHANCEMENTS === */
.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

/* === ALERT ENHANCEMENTS === */
.bg-danger {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border-radius: 8px;
    padding: 10px 14px;
}

.bg-success {
    background: #dcfce7 !important;
    color: #16a34a !important;
    border-radius: 8px;
    padding: 10px 14px;
}

/* === DASHBOARD SPECIFIC === */
.dashboard-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 16px;
    padding: 20px 24px;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.2);
}

.dashboard-hero h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
}

.dashboard-hero p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.stat-card {
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.stat-card .icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    margin-bottom: 10px;
}

.stat-card .icon-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-card .icon-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-card .icon-green { background: linear-gradient(135deg, #10b981, #059669); }

.stat-card .stat-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.hotspot-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.hotspot-card .card-header {
    background: linear-gradient(90deg, #f8fafc 0%, #eef2ff 100%);
    border-bottom: 1px solid #e2e8f0;
}

.hotspot-tile {
    border-radius: 12px;
    padding: 14px;
    color: #fff;
    transition: all 0.2s ease;
}

.hotspot-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.hotspot-tile h1 {
    font-size: 26px;
    margin: 0 0 6px;
    font-weight: 700;
}

.hotspot-tile .small-text {
    font-size: 12px;
    opacity: 0.9;
}

.bg-tile-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-tile-green { background: linear-gradient(135deg, #10b981, #059669); }
.bg-tile-yellow { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-tile-red { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* ========================================
   DASHBOARD MODERN UI
   ======================================== */
.dashboard-shell {
    padding: 12px 8px 20px;
}

/* Hero Section Enhanced */
.dashboard-hero {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%) !important;
    border-radius: 20px !important;
    padding: 24px 28px !important;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.dashboard-hero h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.dashboard-hero p {
    margin: 0;
    opacity: 0.95;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* Stat Cards Enhanced */
.stat-card {
    border: 0;
    border-radius: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06);
    height: 100%;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.1);
}

.stat-card .icon-wrap {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
}

.stat-card .icon-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-card .icon-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-card .icon-green { background: linear-gradient(135deg, #10b981, #059669); }

.stat-card .stat-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.5;
}

/* Hotspot Tiles Enhanced */
.hotspot-tile {
    border-radius: 16px;
    padding: 18px;
    color: #fff;
    height: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
}

.hotspot-tile::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hotspot-tile:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.2);
}

.hotspot-tile a {
    color: #fff;
    text-decoration: none;
    display: block;
    position: relative;
    z-index: 1;
}

.hotspot-tile h1 {
    font-size: 32px;
    margin: 0 0 8px;
    font-weight: 700;
}

.hotspot-tile .small-text {
    font-size: 13px;
    opacity: 0.95;
}

/* Traffic Chart Container */
#trafficMonitor {
    min-height: 250px;
    border-radius: 12px;
    overflow: hidden;
}

/* Income Card */
.income-card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.12);
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    overflow: hidden;
    transition: all 0.3s ease;
}

.income-card:hover {
    box-shadow: 0 14px 38px rgba(16, 185, 129, 0.18);
}

.income-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.income-card-header .income-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    margin: 0;
}

.income-card-header .income-title i {
    font-size: 18px;
}

.income-card-header .income-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.income-card-body {
    padding: 14px 18px;
}

.income-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.income-row:last-child {
    border-bottom: 0;
}

.income-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.income-icon-today {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.income-icon-month {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.income-info {
    flex: 1;
}

.income-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.income-value {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.income-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
}

body.dm-dark:not(.holiday-active) .income-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
    border: 1px solid #334155 !important;
}

body.dm-dark:not(.holiday-active) .income-card-header {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%) !important;
}

body.dm-dark:not(.holiday-active) .income-label {
    color: #94a3b8 !important;
}

body.dm-dark:not(.holiday-active) .income-value {
    color: #e2e8f0 !important;
}

body.dm-dark:not(.holiday-active) .income-sub {
    color: #64748b !important;
}

/* Log Table Container */
#r_3 .overflow {
    border-radius: 12px;
    background: #f8fafc;
}

/* ========================================
   DONUT CHART ICON FIX
   ======================================== */
/* Fix for donut/pie chart icons in nav menu */
.sidenav .menu i,
.sidenav .dropdown-btn i,
.sidenav .dropdown-container a i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    font-size: 14px;
}

/* Ensure donut icon displays correctly */
.fa-pie-chart,
.fa-circle-o-notch {
    display: inline-block !important;
    font-family: 'FontAwesome' !important;
}

/* ========================================
   MOBILE DASHBOARD
   ======================================== */
@media (max-width: 767.98px) {
    .dashboard-shell {
        padding: 8px 4px 16px;
    }
    
    .dashboard-hero {
        padding: 18px 16px !important;
        border-radius: 16px !important;
        margin-bottom: 14px;
    }
    
    .dashboard-hero h2 {
        font-size: 18px;
    }
    
    .dashboard-hero p {
        font-size: 12px;
    }
    
    .stat-card {
        padding: 14px;
        border-radius: 12px;
    }
    
    .stat-card .icon-wrap {
        width: 42px;
        height: 42px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .stat-card .stat-label {
        font-size: 11px;
    }
    
    .stat-card .stat-value {
        font-size: 13px;
    }
    
    .hotspot-tile {
        padding: 14px;
        border-radius: 12px;
    }
    
    .hotspot-tile h1 {
        font-size: 24px;
    }
    
    .hotspot-tile .small-text {
        font-size: 11px;
    }
    
    #trafficMonitor {
        min-height: 180px;
    }
    
    .income-card-header {
        padding: 12px 14px;
    }
    .income-card-header .income-title {
        font-size: 14px;
    }
    .income-card-body {
        padding: 12px 14px;
    }
    .income-row {
        padding: 8px 0;
    }
    .income-icon-wrap {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .income-value {
        font-size: 14px;
    }
    .income-label {
        font-size: 11px;
    }
    
    #r_3 table {
        font-size: 11px !important;
    }
    
    #r_3 .overflow {
        height: 250px !important;
    }
}

@media (max-width: 480px) {
    .dashboard-hero {
        padding: 14px 12px !important;
    }
    
    .dashboard-hero h2 {
        font-size: 16px;
    }
    
    .hotspot-tile h1 {
        font-size: 20px;
    }
    
    .stat-card .stat-value {
        font-size: 12px;
    }
}

/* ========================================
   TABLET DASHBOARD
   ======================================== */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .dashboard-shell {
        padding: 10px 6px 16px;
    }
    
    .dashboard-hero {
        padding: 20px 22px !important;
    }
    
    .dashboard-hero h2 {
        font-size: 22px;
    }
    
    .hotspot-tile h1 {
        font-size: 26px;
    }
    
    #trafficMonitor {
        min-height: 200px;
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   RESPONSIVE - TABLET (768px - 1024px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    #sidenav {
        width: 200px !important;
    }
    
    #main {
        margin-left: 200px !important;
    }
    
    .dashboard-hero {
        padding: 18px 20px;
    }
    
    .dashboard-hero h2 {
        font-size: 20px;
    }
    
    .hotspot-tile h1 {
        font-size: 22px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-card .icon-wrap {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* ========================================
/* ========================================
   RESPONSIVE - MOBILE (max-width: 767px)
   ======================================== */
@media (max-width: 767px) {
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: inline-flex !important;
    }
    
    /* Navbar mobile */
    #navbar {
        padding: 4px 8px;
    }
    
    #navbar #brand .brand-name {
        display: inline-block !important;
        font-weight: 700;
        font-size: 13px;
        color: #fff;
    }
    
    #navbar .top-user-pill .role,
    #navbar .theme-music-btn .label,
    #navbar #cpage,
    #navbar .cpage-title {
        display: none !important;
    }
    
    #navbar .top-user-pill {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Main content full width */
    #main {
        margin-left: 0 !important;
        padding: 8px !important;
        padding-top: 56px !important;
        position: relative;
        z-index: 1;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    /* Hide sidenav on mobile - JS will open it */
    #sidenav {
        width: 0 !important;
        border-right: 0 !important;
        overflow-x: hidden;
        z-index: 10040;
    }

    /* When sidenav is open on mobile */
    #sidenav.sidenav-open {
        width: 210px !important;
        border-right: 1px solid #c1c1c1 !important;
    }

    /* Hide menu items on mobile - JS handles toggle via inline !important */
    #sidenav a.menu,
    #sidenav .dropdown-btn,
    #sidenav .dropdown-container,
    #sidenav .dropdown-container a {
        display: none;
    }

    /* When sidenav is open on mobile, show menu items */
    #sidenav.sidenav-open a.menu,
    #sidenav.sidenav-open .dropdown-btn,
    #sidenav.sidenav-open .dropdown-container,
    #sidenav.sidenav-open .dropdown-container a {
        display: flex;
    }

    #sidenav.sidenav-open .dropdown-container {
        display: none;
    }
    #sidenav.sidenav-open .dropdown-container.menu-open {
        display: block;
    }
    
    /* Dashboard mobile */
    .dashboard-hero {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .dashboard-hero h2 {
        font-size: 18px;
    }
    
    .dashboard-hero p {
        font-size: 12px;
    }
    
    .stat-card {
        padding: 12px;
        border-radius: 10px;
    }
    
    .stat-card .icon-wrap {
        width: 36px;
        height: 36px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .stat-card .stat-label {
        font-size: 11px;
    }
    
    .stat-card .stat-value {
        font-size: 13px;
    }
    
    /* Hotspot tiles mobile */
    .hotspot-card .card-body {
        padding: 10px;
    }
    
    .hotspot-tile {
        padding: 12px;
        border-radius: 10px;
    }
    
    .hotspot-tile h1 {
        font-size: 20px;
    }
    
    .hotspot-tile .small-text {
        font-size: 11px;
    }
    
    /* Cards mobile */
    .card {
        border-radius: 10px;
    }
    
    .card-header {
        padding: 10px 12px;
    }
    
    .card-header h3 {
        font-size: 14px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    /* Table mobile */
    .table th, .table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    /* Buttons mobile */
    .btn, input[type="submit"] {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    /* Language and timer idle */
    #navbar .slang,
    #navbar select[name="slang"] {
        display: inline-block !important;
        min-width: 60px;
    }
    
    #navbar a[title="Idle Timeout"] {
        display: inline-flex !important;
    }
}

/* ========================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
    #main {
        padding: 6px !important;
        padding-top: 56px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .dashboard-hero {
        padding: 14px;
    }
    
    .dashboard-hero h2 {
        font-size: 16px;
    }
    
    .hotspot-tile h1 {
        font-size: 18px;
    }
    
    .stat-card .stat-value {
        font-size: 12px;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
html.dm-dark body:not(.holiday-active),
body.dm-dark:not(.holiday-active) {
    background: #0f172a;
}
html.dm-dark:not(.holiday-active),
body.dm-dark:not(.holiday-active) {
    
    .card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .card-header {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: #334155;
    }
    
    .card-header h3 {
        color: #e2e8f0;
    }
    
    .table th {
        background: #1e293b;
        color: #94a3b8;
        border-color: #334155;
    }
    
    .table td {
        color: #e2e8f0;
        border-color: #1e293b;
    }
    
    .table tr:hover td {
        background: #334155;
    }
    
    .form-control {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    #sidenav {
        background: #1e293b !important;
        border-color: #334155 !important;
    }
    
    #sidenav a.menu {
        color: #94a3b8 !important;
    }
    
    #sidenav a.menu:hover {
        background: #334155 !important;
        color: #e2e8f0 !important;
    }
    
    #sidenav a.active {
        background: linear-gradient(90deg, #312e81 0%, transparent 100%) !important;
        color: #a5b4fc !important;
    }
    
    .stat-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .stat-card .stat-value {
        color: #e2e8f0;
    }
    
    .stat-card .stat-label {
        color: #94a3b8;
    }
    
    .bg-danger {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
    }
    
    .bg-success {
        background: #14532d !important;
        color: #86efac !important;
    }
}
