body { font-family: "JetBrains Mono", "Consolas", monospace; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2d3e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3d5e; }

.glass {
    background: rgba(18, 20, 29, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glow-green { box-shadow: 0 0 20px rgba(20, 184, 166, 0.15); }
.glow-blue { box-shadow: 0 0 20px rgba(34, 197, 94, 0.15); }
.glow-red { box-shadow: 0 0 20px rgba(239, 68, 68, 0.15); }
.glow-amber { box-shadow: 0 0 20px rgba(245, 158, 11, 0.15); }

.sidebar-link { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-link.active {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border-right: 2px solid #22c55e;
}
.sidebar-link:not(.active):hover {
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chart-wrap canvas { max-height: 300px; }
.swal2-popup { font-family: "JetBrains Mono", "Consolas", monospace !important; }

#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 39;
    transition: opacity 0.3s ease;
}
#sidebarOverlay.active { display: block; }

.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(18, 20, 29, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.mobile-menu-btn:hover { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.mobile-menu-btn.hidden-by-sidebar { display: none !important; }

.backdrop-blur-12 {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.swal-note-warning { color: #fbbf24; font-size: 13px; }
.swal-note-muted { color: #9ca3af; font-size: 13px; margin-top: 8px; }
.swal-note-danger { color: #fca5a5; font-size: 13px; }
.swal-note-small { color: #9ca3af; font-size: 13px; margin-top: 8px; }
.swal-result-ok { color: #2dd4bf; }
.swal-result-fail { color: #fb7185; }

.align-middle { vertical-align: middle; }
.bi.bi-icon-fix { display: inline-flex; align-items: center; }

@media (max-width: 1023px) {
    .mobile-menu-btn { display: flex; }

    #sidebar {
        position: fixed !important;
        left: -280px;
        top: 0;
        width: 260px !important;
        height: 100vh;
        z-index: 40;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    #sidebar.open {
        left: 0;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.4);
    }

    #mainContent {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .p-6 { padding: 16px !important; }
    .px-5 { padding-left: 12px !important; padding-right: 12px !important; }
    .px-6 { padding-left: 16px !important; padding-right: 16px !important; }

    .text-2xl { font-size: 1.25rem !important; }
    .text-xl { font-size: 1.125rem !important; }
    #kpiGrid .text-2xl { font-size: 1.15rem !important; }

    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .fixed.inset-0 > .glass {
        max-width: 100% !important;
        margin: 8px !important;
        max-height: calc(100vh - 16px) !important;
        border-radius: 16px !important;
    }

    button,
    .btn,
    a[class*="px-4"] {
        min-height: 44px;
    }

    .flex.items-center.justify-between {
        flex-wrap: wrap;
        gap: 12px;
    }

    .grid.grid-cols-2:not(.gap-3):not(.lg\:grid-cols-4):not(.lg\:grid-cols-5):not(.lg\:grid-cols-8) {
        grid-template-columns: 1fr !important;
    }
    .col-span-2 { grid-column: span 1 !important; }
}

@media (max-width: 639px) {
    .p-6 { padding: 12px !important; }
    .gap-4 { gap: 10px !important; }
    .gap-6 { gap: 12px !important; }
    .mb-6 { margin-bottom: 14px !important; }
    .grid.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

    .flex.items-center.gap-3 > button,
    .flex.items-center.gap-3 > a {
        font-size: 0.75rem;
    }

    .chart-wrap canvas { max-height: 200px !important; }
    .hide-mobile { display: none !important; }
}
