:root {
    --bg-dark: #0a0a1a;
    --bg-panel: rgb(10, 10, 28);
    --bg-card: rgb(16, 16, 42);
    --bg-secondary: rgb(20, 20, 52);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-cyan: #06b6d4;
    --primary: #8b5cf6;
    --secondary: #06b6d4;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.12);
    --glass-blur: blur(4px);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Glassmorphism */
.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* SweetAlert2 modal - to'liq opak */
.swal2-popup {
    background: #0e0e2a !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.swal2-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.swal2-backdrop-show {
    background: rgba(0, 0, 0, 0.85) !important;
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    min-height: 100vh;
    padding-top: 35px; /* Adjust for fixed banner */
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-sidebar-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    transition: var(--transition);
}
.close-sidebar-btn:hover { color: var(--text-main); }

.sidebar-nav {
    padding: 15px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.nav-item i, .nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-wrapper {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.page-section {
    display: none;
    animation: fadeIn 0.4s ease;
}
.page-section.active {
    display: block;
}

/* ===== HEADER CONTAINER ===== */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== CARDS ===== */
.card {
    padding: 20px;
    margin-bottom: 20px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 24px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
}
.stat-value.danger-text { color: var(--danger); }

/* ===== CHARTS ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}
.chart-container {
    padding: 20px;
    max-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.chart-container canvas {
    max-height: 200px !important;
    max-width: 200px !important;
}
.chart-container h3 {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-muted);
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 20px;
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    padding: 0;
}

.table-container table,
#klassifikatorTable,
#oqituvchilarTable,
#daftarTable,
#fanlarTable {
    width: 100%;
    border-collapse: collapse;
}

.table-container table th,
.table-container table td,
#klassifikatorTable th,
#klassifikatorTable td,
#oqituvchilarTable th,
#oqituvchilarTable td,
#daftarTable th,
#daftarTable td,
#fanlarTable th,
#fanlarTable td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table-container table th,
#klassifikatorTable th,
#oqituvchilarTable th,
#daftarTable th,
#fanlarTable th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    background: rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
}

.table-container table tbody tr,
#klassifikatorTable tbody tr,
#oqituvchilarTable tbody tr,
#daftarTable tbody tr,
#fanlarTable tbody tr {
    transition: var(--transition);
}

.table-container table tbody tr:hover,
#klassifikatorTable tbody tr:hover,
#oqituvchilarTable tbody tr:hover,
#daftarTable tbody tr:hover,
#fanlarTable tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

/* Report tables injected via JS */
#reportContent table {
    width: 100%;
    border-collapse: collapse;
}
#reportContent table th,
#reportContent table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
#reportContent table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    background: rgba(0, 0, 0, 0.2);
}
#reportContent table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

/* ===== FORMS & INPUTS ===== */
.form-control {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
    cursor: pointer;
}

select.form-control option {
    background: #1a1a3e;
    color: var(--text-main);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Checkbox custom */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}
.btn-sm.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
}
.btn-sm.btn-danger { background: var(--danger); color: white; }
.btn-sm.btn-danger:hover { filter: brightness(1.1); }
.btn-sm.btn-danger-outline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-sm.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
}

/* ===== BADGES ===== */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
}

.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--accent); border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-success, .badge-faol { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-info { background: rgba(6, 182, 212, 0.15); color: var(--secondary); border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-vakant { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ===== MODAL ===== */
#modalContainer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#modalContainer .modal-content {
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    animation: modalSlideIn 0.3s ease;
}

/* Modal form-controls */
#modalContent .form-control {
    width: 100%;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== TABS ===== */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    padding: 12px 24px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
}

/* ===== REPORT CONTENT ===== */
.report-content {
    padding: 24px;
    min-height: 200px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.report-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== UPLOAD AREA ===== */
.upload-card {
    max-width: 600px;
}
.upload-card h3 {
    margin-bottom: 10px;
    color: var(--text-main);
}
.upload-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: var(--transition);
}
.file-upload-area:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 24px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
    backdrop-filter: blur(10px);
}

.toast.success { background: linear-gradient(135deg, var(--success), #059669); }
.toast.error { background: linear-gradient(135deg, var(--danger), #dc2626); }
.toast.info { background: linear-gradient(135deg, var(--secondary), #0891b2); }

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== MOBILE ===== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 45px;
    left: 15px;
    z-index: 900;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.5rem;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        padding-top: 35px; /* Prevent banner overlap */
        background: #0f1020; /* Solid color to prevent glass distraction */
        z-index: 1000;
    }
    .sidebar.open { left: 0; }
    .close-sidebar-btn { display: block; }
    .mobile-menu-btn { display: block; }
    .content-wrapper { padding: 70px 15px 20px 15px; }
    .header-container { flex-direction: column; align-items: flex-start; gap: 12px; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-control { width: 100% !important; }
    .charts-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .teachers-grid { grid-template-columns: 1fr; }
    
    /* Make tables horizontally scrollable without breaking the layout */
    .table-responsive,
    .table-container {
        width: 100%;
        max-width: calc(100vw - 30px); /* Account for padding */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-container table,
    .table-responsive table,
    #klassifikatorTable,
    #oqituvchilarTable,
    #daftarTable,
    #fanlarTable {
        min-width: 900px; /* Force minimum width to enable horizontal scroll */
        white-space: normal;
    }
    
    .table-container table th,
    .table-container table td {
        white-space: nowrap; /* Prevent content from wrapping and making rows too tall */
    }
    
    /* Prevent main content from overflowing */
    .main-content,
    .page-section {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .report-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .report-filters {
        width: 100%;
    }
    
    .report-filters > * {
        width: 100%;
    }
}

/* ===== TEACHER CARDS ===== */
.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.teacher-card {
    padding: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.teacher-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15);
}

.teacher-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.teacher-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.teacher-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.teacher-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.teacher-card-body {
    padding: 16px 20px;
}

.teacher-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.teacher-detail:last-child {
    border-bottom: none;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.detail-value {
    color: var(--text-main);
    font-size: 0.9rem;
}

.teacher-card-actions {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}

.teacher-card-actions .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    justify-content: center;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SEARCH INPUT X ICON ===== */
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='red' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'></line><line x1='6' y1='6' x2='18' y2='18'></line></svg>") no-repeat center center;
    cursor: pointer;
    margin-left: 8px;
}

/* ===== CUSTOM DROPDOWN ===== */
.custom-dropdown-container {
    position: relative;
    display: inline-block;
}
.custom-dropdown-list {
    display: none;
    position: fixed;
    min-width: 350px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}
.custom-dropdown-list div {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.custom-dropdown-list div:last-child {
    border-bottom: none;
}
.custom-dropdown-list div:hover {
    background: var(--accent);
    color: white;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* Test Mode Banner */
.test-mode-banner {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
    z-index: 9999;
    box-sizing: border-box;
}
.test-mode-banner.light-theme-banner {
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}
.test-mode-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
}
@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}
.test-mode-banner i {
    margin-right: 5px;
    vertical-align: text-bottom;
}

/* ==========================================================================
   BENTO DASHBOARD (Obsidian Dark Glassmorphism)
   ========================================================================== */

.bento-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 15px;
    flex-wrap: wrap;
}

.bento-title-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bento-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
}

.bento-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.25);
    color: #34d399;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.bento-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
    animation: bentoPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes bentoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.bento-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bento-period-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 500;
}

.bento-period-pill i {
    color: #34d399;
}

.bento-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 12px;
    color: #34d399;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bento-btn-action:hover {
    background: rgba(52, 211, 153, 0.2);
    transform: translateY(-1px);
}

/* Main Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr) 320px;
    gap: 18px;
    margin-bottom: 24px;
}

/* Cards Base */
.bento-card {
    background: rgba(22, 25, 32, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.bento-card:hover {
    border-color: rgba(52, 211, 153, 0.25);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 20px rgba(52, 211, 153, 0.05);
    transform: translateY(-2px);
}

/* Card Placements */
.bento-card-hours {
    grid-column: span 2;
    min-height: 250px;
}

.bento-card-courses {
    grid-column: span 2;
    min-height: 250px;
}

.bento-card-teachers {
    grid-column: span 2;
    min-height: 250px;
}

.bento-card-tall-growth {
    grid-column: 7;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 520px;
    background: linear-gradient(180deg, rgba(22, 26, 34, 0.9) 0%, rgba(16, 20, 26, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bento-card-score {
    grid-column: span 3;
    min-height: 230px;
}

.bento-card-flow {
    grid-column: span 3;
    min-height: 230px;
}

/* Card Headers */
.bento-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.bento-icon-squircle {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.22) 0%, rgba(16, 185, 129, 0.06) 100%);
    border: 1px solid rgba(52, 211, 153, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.bento-icon-squircle i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bento-card-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: 0.1px;
    flex: 1;
}

.bento-badge-sm {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
}

/* Card Footers */
.bento-card-footer {
    margin-top: 14px;
}

.bento-big-number {
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 4px;
}

.bento-sub-label {
    font-size: 0.78rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bento-sub-label.text-success {
    color: #34d399;
    font-weight: 500;
}

/* Progress List (Card 1) */
.bento-progress-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 6px 0;
}

.bento-progress-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bento-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    color: #94a3b8;
    font-weight: 500;
}

.bento-progress-track {
    width: 100%;
    height: 7px;
    background: #252a33;
    border-radius: 999px;
    overflow: hidden;
}

.bento-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-emerald {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

.fill-lime {
    background: linear-gradient(90deg, #84cc16 0%, #bef264 100%);
    box-shadow: 0 0 10px rgba(190, 242, 100, 0.3);
}

/* Vertical Bars (Card 2) */
.bento-vbars-container {
    display: flex;
    justify-content: center;
    gap: 28px;
    align-items: flex-end;
    height: 100px;
    margin: 8px 0 12px 0;
    padding: 0 8px 4px 8px;
}

.bento-vbar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
    flex: 1;
}

.bento-vbar-pill {
    width: 34px;
    border-radius: 14px;
    background: linear-gradient(180deg, #34d399 0%, #059669 100%);
    min-height: 16px;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(52, 211, 153, 0.3);
}

.bento-vbar-label {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.bento-vbar-val {
    font-size: 0.72rem;
    color: #f1f5f9;
    font-weight: 600;
}

/* Segmented Bar (Card 3) */
.bento-segmented-wrap {
    margin: 10px 0;
}

.bento-segmented-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    display: flex;
    overflow: hidden;
    background: #252a33;
    gap: 2px;
}

.bento-segment {
    height: 100%;
    transition: width 0.8s ease;
}

.seg-emerald { background: #34d399; }
.seg-lime { background: #bef264; }
.seg-olive { background: #a3e635; }

.bento-segmented-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    gap: 6px;
}

.legend-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 2px;
}

.dot-emerald { background: #34d399; box-shadow: 0 0 6px #34d399; }
.dot-lime { background: #bef264; box-shadow: 0 0 6px #bef264; }
.dot-olive { background: #a3e635; box-shadow: 0 0 6px #a3e635; }

.legend-label {
    font-size: 0.7rem;
    color: #94a3b8;
}

.legend-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
}

/* Card 4: Tall Growth Card */
.bento-nav-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 16px;
    gap: 6px;
}

.bento-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.bento-nav-btn:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.35);
    color: #34d399;
    transform: translateY(-1px);
}

.bento-growth-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 10px 0;
}

.bento-growth-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.bento-ring-wrapper {
    position: relative;
    width: 170px;
    height: 170px;
    margin: 0 auto;
}

.bento-ring-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ring-bg {
    fill: none;
    stroke: #252a33;
    stroke-width: 13;
}

.ring-fg-assigned {
    fill: none;
    stroke: #34d399;
    stroke-width: 13;
    stroke-linecap: butt;
    transform-origin: 80px 80px;
    transition: stroke-dasharray 0.8s ease, transform 0.8s ease;
    filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.45));
}

.ring-fg-vacant {
    fill: none;
    stroke: #bef264;
    stroke-width: 13;
    stroke-linecap: butt;
    transform-origin: 80px 80px;
    transition: stroke-dasharray 0.8s ease, transform 0.8s ease;
    filter: drop-shadow(0 0 4px rgba(190, 242, 100, 0.35));
}

.bento-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bento-ring-pct {
    font-size: 2.1rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -1px;
}

.bento-ring-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
}

.ring-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #cbd5e1;
}

.bento-growth-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 14px;
}

.bento-health-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.bento-status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
}

.bento-health-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #ffffff;
}

.bento-health-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

/* Split Header (Cards 5 & 6) */
.bento-card-split-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.bento-sub-metric {
    font-size: 0.76rem;
    margin-top: 3px;
}

.bento-score-box {
    text-align: right;
}

.bento-score-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #34d399;
    line-height: 1;
}

.bento-score-status {
    font-size: 0.72rem;
    color: #cbd5e1;
    font-weight: 600;
}

/* 10-Segment Pill Battery Blocks (Card 5) */
.bento-pill-blocks {
    display: flex;
    gap: 5px;
    margin: 14px 0;
}

.pill-block {
    flex: 1;
    height: 22px;
    border-radius: 5px;
    background: #252a33;
    transition: all 0.3s ease;
}

.pill-block.active {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.pill-block.active-lime {
    background: #bef264;
    box-shadow: 0 0 8px rgba(190, 242, 100, 0.4);
}

/* Score / Card Footers */
.bento-score-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 12px;
    margin-top: 10px;
}

.bento-tiny-label {
    font-size: 0.7rem;
    color: #94a3b8;
}

.bento-med-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.bento-insights-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.bento-insights-pill:hover {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.35);
    color: #34d399;
    transform: translateY(-1px);
}

.bento-insights-pill i {
    font-size: 0.88rem;
    color: #34d399;
}

/* Flow Comparative Bars (Card 6) */
.bento-flow-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
}

.flow-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flow-label {
    font-size: 0.75rem;
    color: #cbd5e1;
    width: 48px;
    font-weight: 500;
}

.flow-track {
    flex: 1;
    height: 9px;
    background: #252a33;
    border-radius: 999px;
    overflow: hidden;
}

.flow-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-val {
    font-size: 0.75rem;
    color: #ffffff;
    font-weight: 600;
    min-width: 65px;
    text-align: right;
}

/* Detailed Courses Table */
.bento-table-card {
    background: rgba(22, 25, 32, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin-top: 10px;
}

.bento-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.bento-table-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
}

.bento-table-title i {
    color: #34d399;
}

.bento-table-sub {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 3px 0 0 0;
}

.bento-btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bento-btn-outline:hover {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.3);
}

.bento-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.bento-table thead th {
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bento-table thead th:first-child { border-radius: 10px 0 0 10px; }
.bento-table thead th:last-child { border-radius: 0 10px 10px 0; }

.bento-table tbody td {
    padding: 14px 16px;
    font-size: 0.88rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.bento-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.bento-pill-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-emerald { background: rgba(52, 211, 153, 0.12); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.25); }
.tag-amber { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.25); }

/* Responsive Layout */
@media (max-width: 1200px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-card-hours { grid-column: span 1; }
    .bento-card-courses { grid-column: span 1; }
    .bento-card-teachers { grid-column: span 1; }
    .bento-card-score { grid-column: span 1; }
    .bento-card-flow { grid-column: span 1; }
    .bento-card-tall-growth {
        grid-column: span 2;
        grid-row: auto;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-card-hours,
    .bento-card-courses,
    .bento-card-teachers,
    .bento-card-tall-growth,
    .bento-card-score,
    .bento-card-flow {
        grid-column: span 1;
    }
    .bento-top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
