/* ===================================================
   TIME SCHOOL LMS - MODERN EMERALD GREEN & WHITE THEME
   Inspired by Digital Twin (Image 4) & Modern Clean SaaS
=================================================== */

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

:root {
    --bg-main: #f4fbf7;
    --bg-auth: linear-gradient(135deg, #e6f9f0 0%, #f4fbf7 40%, #d1fae5 100%);
    --bg-card: #ffffff;
    --bg-panel: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.88);
    --bg-subtle: #f8fafc;
    --bg-subtle-hover: #f1f5f9;
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-dark: #047857;
    --primary-light: #ecfdf5;
    --primary-soft: rgba(16, 185, 129, 0.12);
    --primary-glow: rgba(16, 185, 129, 0.30);
    --primary-border: #a7f3d0;
    --accent: #16a34a;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 12% 18%, var(--primary-soft) 0%, transparent 45%),
        radial-gradient(circle at 88% 82%, var(--primary-soft) 0%, transparent 45%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===================================================
   View Container Management
=================================================== */
.view-container {
    display: none;
    min-height: 100vh;
}

.view-container.active-view {
    display: flex;
}

/* ===================================================
   AUTH VIEW (Dosanov Academy Dark Navy Glass Login)
=================================================== */
#auth-view {
    min-height: 100vh;
    width: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    background: radial-gradient(circle at 20% 25%, #0c2335 0%, #070e1b 48%, #050912 100%);
    overflow: hidden;
}

#auth-view.active-view {
    display: flex;
}

#auth-view::before {
    content: '';
    position: absolute;
    top: -140px;
    left: -140px;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.16) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(50px);
    z-index: 1;
}

#auth-view::after {
    content: '';
    position: absolute;
    bottom: -160px;
    right: -140px;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: 1;
}

.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 425px;
    background: #0c1424;
    border-radius: 26px;
    padding: 36px 30px 28px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    overflow: hidden;
    animation: fadeInScale 0.4s ease-out;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 40%, #8b5cf6 75%, #10b981 100%);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-logo-frame {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    background: #0b1629;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    padding: 4px;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
    transition: transform 0.3s ease;
}

.auth-logo-frame:hover {
    transform: scale(1.04);
}

.auth-logo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 17px;
    display: block;
}

.auth-brand-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.auth-brand-subtitle {
    font-size: 0.86rem;
    color: #94a3b8;
    margin-bottom: 22px;
    font-weight: 400;
}

/* Subject Pills 2x2 Grid */
.auth-subjects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-subject-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 0.2s ease;
}

.auth-subject-pill:hover {
    transform: translateY(-1px);
}

.auth-subject-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.auth-subject-pill.pill-blue {
    background: rgba(14, 116, 144, 0.20);
    border-color: rgba(56, 189, 248, 0.35);
    color: #bae6fd;
}
.auth-subject-pill.pill-blue .dot { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }

.auth-subject-pill.pill-rose {
    background: rgba(159, 18, 57, 0.20);
    border-color: rgba(251, 113, 133, 0.35);
    color: #fecdd3;
}
.auth-subject-pill.pill-rose .dot { background: #fb7185; box-shadow: 0 0 8px #fb7185; }

.auth-subject-pill.pill-green {
    background: rgba(6, 95, 70, 0.24);
    border-color: rgba(52, 211, 153, 0.35);
    color: #a7f3d0;
}
.auth-subject-pill.pill-green .dot { background: #34d399; box-shadow: 0 0 8px #34d399; }

.auth-subject-pill.pill-amber {
    background: rgba(146, 64, 14, 0.22);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fde68a;
}
.auth-subject-pill.pill-amber .dot { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }

/* Auth Input Fields */
.auth-field-group {
    margin-bottom: 16px;
    text-align: left;
}

.auth-field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.auth-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #070c17;
    border: 1.5px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    padding: 2px 14px;
    transition: var(--transition);
}

.auth-input-container:focus-within {
    border-color: #38bdf8;
    background: #09101e;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.auth-leading-icon {
    font-size: 1rem;
    color: #64748b;
    margin-right: 11px;
    transition: color 0.2s;
}

.auth-input-container:focus-within .auth-leading-icon {
    color: #38bdf8;
}

.auth-input-container input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 13px 0;
    font-size: 0.94rem;
    color: #f1f5f9;
    font-weight: 500;
}

.auth-input-container input::placeholder {
    color: #475569;
    font-weight: 400;
}

.auth-eye-toggle {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.auth-eye-toggle:hover {
    color: #cbd5e1;
}

/* Cyan-Blue-Violet Gradient Submit Button */
.auth-btn-submit {
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 52%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 26px rgba(59, 130, 246, 0.35);
    transition: var(--transition);
    margin-top: 8px;
}

.auth-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.48);
    filter: brightness(1.06);
}

.auth-btn-submit:active {
    transform: translateY(0);
}

.auth-footer-phone {
    margin-top: 22px;
    display: flex;
    justify-content: center;
}

.auth-phone-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px 7px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.auth-phone-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(16, 185, 129, 0.45);
    color: #ffffff;
}

.auth-phone-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.16);
    color: #10b981;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
}

/* ===================================================
   MAIN APP LAYOUT (Sidebar, Topbar, Content Area)
=================================================== */
#app-view {
    width: 100%;
    min-height: 100vh;
    display: none;
}

#app-view.active-view {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 270px;
    min-width: 270px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Close button inside sidebar for mobile */
.sidebar-mobile-close {
    display: none;
    position: absolute;
    top: 18px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: #64748b;
    font-size: 1.15rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.sidebar-mobile-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 992px) {
    body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .mobile-only {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: #f1f5f9;
        border: 1.5px solid var(--border);
        color: #0f172a;
        font-size: 1.25rem;
        cursor: pointer;
        transition: var(--transition);
        margin-right: 6px;
    }

    .mobile-only:hover {
        background: #ecfdf5;
        color: #10b981;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 285px !important;
        max-width: 85vw !important;
        min-width: 0 !important;
        z-index: 9999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35) !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .sidebar-mobile-close {
        display: flex !important;
    }

    #app-view {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
    }

    .topbar {
        padding: 0 16px !important;
        height: 66px !important;
    }

    .topbar .page-title h2 {
        font-size: 1.15rem !important;
    }

    .content-wrapper {
        padding: 16px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .clock-display {
        padding: 5px 10px !important;
        font-size: 0.8rem !important;
    }
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.sidebar .logo img {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 12px var(--primary-soft);
}

.sidebar .logo h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.sidebar .logo h2 span {
    color: var(--primary);
}

/* User Profile in Sidebar */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 24px;
}

.user-profile .avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-light);
    border: 1.5px solid var(--primary-border);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    overflow: hidden;
    flex-shrink: 0;
}

.user-profile .user-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* Nav Links */
.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.nav-links li a i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-links li a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-links li a:hover i {
    color: var(--primary);
}

.nav-links li a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    box-shadow: 0 6px 16px var(--primary-glow);
}

.nav-links li a.active i {
    color: #ffffff;
}

.nav-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.nav-footer #logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #ef4444;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.nav-footer #logout-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: transparent;
}

/* Topbar */
.topbar {
    height: 74px;
    background: var(--bg-topbar);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.topbar .page-title h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.4px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.clock-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    padding: 7px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.92rem;
}

.theme-switcher button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-switcher button:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    padding: 28px 32px 40px;
}

/* ===================================================
   CARDS & GRIDS (Fixing Image 1 & 2 Layout)
=================================================== */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.glass-card:hover {
    box-shadow: var(--shadow-md);
}

/* STATS GRID - 3 COLUMNS RESPONSIVE (Fixing Image 1 full-width stretch!) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid, .stats-grid-4 {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-border);
}

.stat-card.clickable-filter {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.stat-card.clickable-filter::after {
    content: "\f0b0";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.6;
    transition: var(--transition);
}

.stat-card.clickable-filter:hover::after {
    opacity: 1;
    color: var(--primary);
}

.stat-card.clickable-filter.active-filter {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-light) 100%);
    box-shadow: 0 8px 22px var(--primary-soft);
    transform: translateY(-2px);
}

.stat-card.clickable-filter.active-filter::after {
    opacity: 1;
    color: var(--primary);
}

.kassa-revenue-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.kassa-revenue-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.kassa-revenue-pill strong {
    color: var(--text-main);
    font-weight: 800;
}

.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
}

/* ===================================================
   BUTTONS
=================================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto !important;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.94rem;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 6px 14px !important;
    font-size: 0.84rem !important;
    border-radius: 10px !important;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto !important;
    padding: 6px 12px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto !important;
    padding: 10px 20px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.94rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-subtle-hover);
    color: var(--text-main);
}

/* ===================================================
   DATA TABLES
=================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg-card);
}

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

.data-table thead th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 1.5px solid var(--border);
}

.data-table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    font-size: 0.92rem;
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: var(--primary-light);
}

.data-table tfoot td {
    padding: 14px 18px;
    background: var(--bg-subtle);
    border-top: 2px solid var(--border);
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 700;
}

/* To'lov holati qator ranglari: Yashil (To'lagan), Sariq (Qisman), Qizil (Qarzdor) */
.data-table tbody tr.pay-status-paid {
    background: rgba(16, 185, 129, 0.12);
}
.data-table tbody tr.pay-status-paid td:first-child {
    box-shadow: inset 4px 0 0 #10b981;
}
.data-table tbody tr.pay-status-paid:hover {
    background: rgba(16, 185, 129, 0.21);
}

.data-table tbody tr.pay-status-partial {
    background: rgba(245, 158, 11, 0.14);
}
.data-table tbody tr.pay-status-partial td:first-child {
    box-shadow: inset 4px 0 0 #f59e0b;
}
.data-table tbody tr.pay-status-partial:hover {
    background: rgba(245, 158, 11, 0.24);
}

.data-table tbody tr.pay-status-unpaid {
    background: rgba(239, 68, 68, 0.12);
}
.data-table tbody tr.pay-status-unpaid td:first-child {
    box-shadow: inset 4px 0 0 #ef4444;
}
.data-table tbody tr.pay-status-unpaid:hover {
    background: rgba(239, 68, 68, 0.21);
}

body[data-theme-mode="dark"] .data-table tbody tr.pay-status-paid {
    background: rgba(16, 185, 129, 0.17);
}
body[data-theme-mode="dark"] .data-table tbody tr.pay-status-paid:hover {
    background: rgba(16, 185, 129, 0.26);
}
body[data-theme-mode="dark"] .data-table tbody tr.pay-status-partial {
    background: rgba(245, 158, 11, 0.17);
}
body[data-theme-mode="dark"] .data-table tbody tr.pay-status-partial:hover {
    background: rgba(245, 158, 11, 0.26);
}
body[data-theme-mode="dark"] .data-table tbody tr.pay-status-unpaid {
    background: rgba(239, 68, 68, 0.17);
}
body[data-theme-mode="dark"] .data-table tbody tr.pay-status-unpaid:hover {
    background: rgba(239, 68, 68, 0.26);
}

.pay-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.stat-subtext {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 700;
}

.stat-card.status-card-paid {
    border-color: rgba(16, 185, 129, 0.38);
}
.stat-card.status-card-partial {
    border-color: rgba(245, 158, 11, 0.42);
}
.stat-card.status-card-unpaid {
    border-color: rgba(239, 68, 68, 0.38);
}

/* Form Controls & Inputs */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

/* ===================================================
   BADGES (Pill Badges)
=================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.badge-gold {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.badge-green {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.badge-blue {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.badge-purple {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ===================================================
   10-BALLIK BAHOLASH TIZIMI
=================================================== */
.score-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 14px 0;
}

.score-btn {
    padding: 12px 6px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.score-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.score-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.9rem;
}
.score-badge.high { background: #ecfdf5; color: #059669; border: 1.5px solid #a7f3d0; }
.score-badge.mid { background: #fffbeb; color: #d97706; border: 1.5px solid #fde68a; }
.score-badge.low { background: #fef2f2; color: #dc2626; border: 1.5px solid #fecaca; }

.inline-score-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.inline-score-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

.inline-score-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
}

.inline-score-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    border-color: var(--primary-dark);
    box-shadow: 0 3px 10px var(--primary-glow);
}

/* ===================================================
   DAVOMAT TUGMALARI
=================================================== */
.att-group {
    display: flex;
    gap: 6px;
}

.att-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: #f8fafc;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.att-btn.present.active {
    background: #10b981;
    color: #ffffff;
    border-color: #059669;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.att-btn.absent.active {
    background: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

.att-btn.excused.active {
    background: #f59e0b;
    color: #ffffff;
    border-color: #d97706;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

/* ===================================================
   MARKAZ REYTINGI SHOHSUPASI (Podium)
=================================================== */
.rating-podium {
    display: grid;
    grid-template-columns: 1fr 1.18fr 1fr;
    gap: 18px;
    align-items: flex-end;
    margin-bottom: 28px;
    padding: 14px 0;
}

.podium-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 24px 18px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.podium-card:hover {
    transform: translateY(-4px);
}

.podium-card.first {
    border-color: #eab308;
    background: linear-gradient(180deg, rgba(234, 179, 8, 0.14) 0%, var(--bg-card) 100%);
    box-shadow: 0 14px 36px rgba(234, 179, 8, 0.22);
}

.podium-card.second {
    border-color: #94a3b8;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.14) 0%, var(--bg-card) 100%);
}

.podium-card.third {
    border-color: #d97706;
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.14) 0%, var(--bg-card) 100%);
}

.podium-crown {
    font-size: 2.2rem;
    margin-bottom: 8px;
}
.podium-card.first .podium-crown { color: #facc15; }
.podium-card.second .podium-crown { color: #94a3b8; }
.podium-card.third .podium-crown { color: #f59e0b; }

.podium-rank-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.first .podium-rank-badge { background: #eab308; color: #000; }
.second .podium-rank-badge { background: #94a3b8; color: #fff; }
.third .podium-rank-badge { background: #d97706; color: #fff; }

.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.88rem;
    background: #f1f5f9;
    color: #475569;
}
.rank-number.gold { background: #eab308; color: #000; box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3); }
.rank-number.silver { background: #94a3b8; color: #fff; }
.rank-number.bronze { background: #d97706; color: #fff; }

.data-table tbody tr.rating-row-me {
    background: rgba(16, 185, 129, 0.12);
}
.data-table tbody tr.rating-row-me td:first-child {
    box-shadow: inset 4px 0 0 #10b981;
}
.data-table tbody tr.rating-row-me:hover {
    background: rgba(16, 185, 129, 0.18);
}

body[data-theme-mode="dark"] .data-table tbody tr.rating-row-me {
    background: rgba(16, 185, 129, 0.20);
}
body[data-theme-mode="dark"] .data-table tbody tr.rating-row-me td:first-child {
    box-shadow: inset 4px 0 0 #34d399;
}
body[data-theme-mode="dark"] .data-table tbody tr.rating-row-me:hover {
    background: rgba(16, 185, 129, 0.28);
}

/* ===================================================
   MODALS
=================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: 26px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.close-modal {
    background: var(--bg-subtle);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

.modal-body {
    padding: 26px 28px;
    max-height: 82vh;
    overflow-y: auto;
}

/* 2 ta Yonma-yon Qulay Form Qatorlari */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 2px;
}

.modal-section-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 12px;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-section-divider:first-child {
    margin-top: 0;
}

.modal-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

@media (max-width: 640px) {
    .modal {
        max-width: 95vw;
        border-radius: 20px;
    }
    .modal-header {
        padding: 16px 20px;
    }
    .modal-body {
        padding: 20px 18px;
    }
    .form-row-2 {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===================================================
   QUICK ACTIONS BAR (Direktor Dashboadi)
=================================================== */
.quick-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-border);
    color: var(--primary);
    transform: translateY(-2px);
}

.quick-action-btn i {
    color: var(--primary);
    font-size: 1rem;
}

/* ===================================================
   DASHBOARD ANALYTICS (Charts & Visuals)
=================================================== */
.dashboard-analytics-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

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

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.chart-wrapper {
    position: relative;
    height: 260px;
    width: 100%;
    margin-top: 14px;
}

/* ===================================================
   KASSA (Modal Guided Steps & Amount Chips)
=================================================== */
/* Step badges for guided workflow */
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    margin-right: 6px;
    box-shadow: 0 2px 6px var(--primary-glow);
}

/* Modern Amount Chips */
.quick-amount-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 16px;
}

.amount-chip {
    padding: 8px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.amount-chip:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
}

.amount-chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ===================================================
   COURSES (Kurslar Kartochkalari)
=================================================== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-border);
}

.course-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.course-icon-badge {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border: 1.5px solid var(--primary-border);
}

.course-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.course-price-tag {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    margin: 10px 0;
}

.course-meta-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

/* ===================================================
   SETTINGS (Sozlamalar & Logo Uploader & Full Theme)
=================================================== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.logo-uploader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed var(--primary-border);
    background: var(--bg-subtle);
    border-radius: 22px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.logo-uploader-box:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.logo-preview-img {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    object-fit: cover;
    margin-bottom: 16px;
    border: 3px solid var(--primary);
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* Color Palette Picker */
.color-palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.color-palette-item {
    padding: 14px 10px;
    border-radius: 16px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: var(--transition);
}

.color-palette-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-border);
}

.color-palette-item.active {
    border-color: var(--primary);
    box-shadow: 0 4px 14px var(--primary-glow);
    background: var(--primary-light);
}

.color-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}

.custom-color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

@media (max-width: 640px) {
    .custom-color-grid {
        grid-template-columns: 1fr;
    }
}

.custom-color-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--bg-subtle);
}

.custom-color-box label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    cursor: pointer;
}

.custom-color-box input[type="color"] {
    width: 44px;
    height: 34px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 2px;
    background: var(--bg-card);
    cursor: pointer;
}
