:root {
    --primary-color: #3b82f6;
    /* Bright Blue */
    --primary-hover: #2563eb;
    --secondary-color: #f8fafc;
    --text-color: #334155;
    --text-light: #64748b;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    /* More transparent */
    --border-radius: 16px;
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
    /* Very light, clean background */
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Main Wrapper for Split Layout */
.main-wrapper {
    display: flex;
    width: 100%;
    max-width: 1200px;
    /* Slightly compact */
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 600px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Left Panel (Info & Stats) */
.left-panel {
    flex: 0.9;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    /* Soft Blue Gradient */
    color: white;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.left-logo-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 25px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.left-logo-container img {
    max-width: 380px;
    height: auto;
    display: block;
}

.left-panel-content {
    position: relative;
    z-index: 2;
}

.left-panel h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.left-panel p {
    font-size: 16px;
    opacity: 0.95;
    margin-bottom: 40px;
    font-weight: 400;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card h3 {
    font-size: 24px;
    font-weight: 700;
}

.stat-card p {
    font-size: 13px;
    margin: 4px 0 0;
    opacity: 0.9;
    font-weight: 500;
}

/* Right Panel (Form) */
.right-panel {
    flex: 1.1;
    padding: 50px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.top-auth {
    position: absolute;
    top: 25px;
    right: 35px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.login-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 99px;
    /* Pill shape */
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.login-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Optional: Make the Admin/Login button stand out more if desired */
.login-link[href*="login"],
.login-link[href*="admin"] {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.login-link[href*="login"]:hover,
.login-link[href*="admin"]:hover {
    background: var(--primary-hover);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.form-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    color: #1e293b;
    letter-spacing: -0.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #475569;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    font-size: 15px;
    background: #f8fafc;
    color: #334155;
    transition: all 0.2s ease;
    font-weight: 500;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Radio Button Styling */
.type-selector {
    margin-bottom: 30px;
}

.radio-group {
    display: flex;
    gap: 15px;
}

.radio-box {
    flex: 1;
    position: relative;
}

.radio-box input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
    z-index: 5;
}

.radio-box span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 2px solid #f1f5f9;
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s;
    background: #fff;
}

.radio-box input:checked+span {
    border-color: var(--primary-color);
    background: #eff6ff;
    /* Very light blue */
    color: var(--primary-color);
}

.radio-box span div {
    font-size: 24px;
    margin-bottom: 6px;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.submit-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.hidden {
    display: none;
}

.footer {
    text-align: center;
    margin-top: 25px;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
        background: #fff;
    }

    .main-wrapper {
        flex-direction: column;
        border-radius: 0;
        box-shadow: none;
        border: none;
    }

    .left-panel {
        padding: 30px 20px;
        text-align: center;
        border-radius: 0 0 24px 24px;
    }

    .stats-grid {
        gap: 12px;
    }

    .right-panel {
        padding: 30px 20px;
    }

    .top-auth {
        position: static;
        margin-bottom: 20px;
        justify-content: center;
        display: flex;
    }

    /* Logo/Banner specific mobile fix */
    .left-logo-container {
        margin: 0 auto 25px auto;
        max-width: 100%;
        width: auto;
        /* Allow it to shrink */
        display: inline-block;
        /* Ensure text-align center works if margin auto fails */
    }

    .left-logo-container img {
        max-width: 100%;
        /* Ensure image connects responsively */
        height: auto;
    }
}

/* Admin Panel Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 15px -3px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8fafc;
    color: #3b82f6;
    border-color: #cbd5e1;
}

.btn-danger {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
}

.btn-danger:hover {
    background: #ffe4e6;
    color: #be123c;
    border-color: #fda4af;
}

/* =========================================
   MONITORING PAGE STYLES
   ========================================= */

.monitoring-page {
    /* Override flex from body */
    display: block !important;
    padding: 20px;
}

.monitoring-page .container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px; /* Kichik padding mobil uchun */
}

/* Desktop uchun kattaroq padding */
@media (min-width: 768px) {
    .monitoring-page .container {
        padding: 0 40px;
    }
}

/* Juda katta ekranlar uchun max-width */
@media (min-width: 1920px) {
    .monitoring-page .container {
        max-width: 1800px;
        padding: 0 60px;
    }
}

.monitoring-page .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.monitoring-page .header h1 {
    font-size: 26px;
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    margin: 50px 0 25px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Custom marker for section title instead of border-left */
.section-title::before {
    content: '';
    display: block;
    width: 8px;
    height: 32px;
    background: linear-gradient(to bottom, #3b82f6, #60a5fa);
    border-radius: 4px;
}

.charts-row,
.table-container {
    background: white;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.01);
    margin-bottom: 40px;
    border: 1px solid #f1f5f9;
}

.charts-row {
    display: block;
}

.chart-container {
    position: relative;
    width: 100%;
}

.table-container {
    overflow-x: auto;
}

.monitoring-page table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px; /* Kattalashtirildi */
}

.monitoring-page th,
.monitoring-page td {
    text-align: left;
    padding: 16px 14px; /* Paddinglar kengaytirildi, yengil hajm berildi */
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    transition: background 0.2s ease, transform 0.2s ease;
}

.monitoring-page th {
    background: #f8fafc;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 #e2e8f0; /* Sticky tepadan ajralishi uchun line */
}

.monitoring-page th:first-child {
    border-top-left-radius: 14px;
}

.monitoring-page th:last-child {
    border-top-right-radius: 14px;
}

.monitoring-page tr:last-child td {
    border-bottom: none;
}

.monitoring-page tbody tr:nth-child(even) td {
    background-color: #fafbfc;
}

.monitoring-page tbody tr:hover td {
    background-color: #f1f5f9; /* Yengil hover effekti */
}

/* Badges */
.badge-student,
.badge-teacher,
.badge-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.badge-student {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.badge-teacher {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    color: #be185d;
    border: 1px solid #fbcfe8;
}

.badge-total {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #334155;
    border: 1px solid #e2e8f0;
}

/* Total Number styling inside tables */
.monitoring-page td b {
    font-size: 15px;
    color: #0f172a;
}