/* ============================================================
   O'QITUVCHI PRO - Zamonaviy UI/UX
   ============================================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text: #334155;
    --text-muted: #94a3b8;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --navbar-height: 65px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f1f5f9;
    color: var(--text);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* ============ LOGIN PAGE ============ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1100px;
    width: 100%;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    min-height: 600px;
}

.login-left {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 60px 50px;
    display: flex;
    align-items: center;
}

.login-brand {
    width: 100%;
}

.brand-icon {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.login-brand h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.feature-item i {
    color: #fbbf24;
    font-size: 18px;
}

.login-right {
    padding: 60px 50px;
    display: flex;
    align-items: center;
}

.login-card {
    width: 100%;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.login-header p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.login-form .form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 6px;
}

.login-form .form-control {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    transition: all 0.2s;
}

.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-form .btn-primary {
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    background: var(--primary);
    border: none;
    margin-top: 10px;
}

.login-form .btn-primary:hover {
    background: var(--primary-dark);
}

.login-footer {
    margin-top: 30px;
    text-align: center;
}

@media (max-width: 768px) {
    .login-wrapper {
        grid-template-columns: 1fr;
    }
    .login-left {
        display: none;
    }
    .login-right {
        padding: 40px 30px;
    }
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: white;
    border-right: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.logo-text h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.3px;
}

.logo-text small {
    color: var(--text-muted);
    font-size: 11px;
}

.btn-close-sidebar {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.sidebar-user {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.avatar-circle-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.avatar-lg {
    width: 90px;
    height: 90px;
    font-size: 36px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-menu {
    flex: 1;
    padding: 12px;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-menu li a:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.sidebar-menu li.active a {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ============ MAIN WRAPPER ============ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ============ TOP NAVBAR ============ */
.top-navbar {
    height: var(--navbar-height);
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
}

.btn-toggle-sidebar:hover {
    background: #f1f5f9;
}

.page-title-nav {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-search {
    position: relative;
    width: 280px;
}

.nav-search input {
    padding: 8px 16px 8px 38px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #f8fafc;
    width: 100%;
    font-size: 13px;
}

.nav-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.nav-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.nav-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon-btn:hover {
    background: #e2e8f0;
}

.badge-notif {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 20px;
    font-weight: 500;
    color: var(--dark);
}

.nav-user-btn:hover {
    background: #f1f5f9;
}

/* Notification dropdown */
.notif-dropdown {
    width: 360px;
    max-height: 500px;
    overflow-y: auto;
    padding: 0;
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
}

.notif-dropdown .dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mark-all-read {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
}

.notif-item:hover {
    background: #f8fafc;
}

.notif-item.unread {
    background: #eff6ff;
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.notif-msg {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
}

.notif-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

/* ============ MAIN CONTENT ============ */
.main-content {
    padding: 24px;
}

/* ============ PAGE HEADER ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

/* ============ CARDS ============ */
.card-custom {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 0;
}

.card-custom-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-custom-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.card-custom-body {
    padding: 20px;
}

/* ============ STAT CARDS ============ */
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}

.stat-primary .stat-icon { background: linear-gradient(135deg, #6366f1, #818cf8); }
.stat-success .stat-icon { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-warning .stat-icon { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-danger .stat-icon { background: linear-gradient(135deg, #ef4444, #f87171); }
.stat-info .stat-icon { background: linear-gradient(135deg, #3b82f6, #60a5fa); }

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-link {
    position: absolute;
    bottom: 10px;
    right: 16px;
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.stat-card:hover .stat-link {
    opacity: 1;
}

/* ============ INFO CARDS ============ */
.info-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.info-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card-header h6 {
    margin: 0;
    font-weight: 600;
}

.info-card-body {
    padding: 20px;
}

.big-number {
    font-size: 42px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.attendance-mini {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ============ TABLE ============ */
.table {
    margin: 0;
}

.table thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border: none;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 14px;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

/* ============ BADGES ============ */
.badge {
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

/* ============ BUTTONS ============ */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-group-sm .btn {
    padding: 4px 10px;
    font-size: 13px;
}

/* ============ FORMS ============ */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--dark);
    margin-bottom: 6px;
}

/* ============ MODAL ============ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    margin: 0;
    font-size: 15px;
}

/* ============ TEACHER CARD ============ */
.teacher-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.teacher-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.teacher-card-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
}

.teacher-card-header h5 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.teacher-card-body {
    padding: 20px;
}

.teacher-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.teacher-info i {
    color: var(--primary);
    width: 16px;
}

.teacher-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.stat-item {
    text-align: center;
}

.stat-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
}

.teacher-card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ============ GROUP CARD ============ */
.group-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s;
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.group-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.group-card-header h5 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.group-card-body {
    padding: 16px 20px;
}

.group-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.group-progress {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.group-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ============ LESSON ITEM ============ */
.lesson-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
}

.lesson-time {
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.lesson-info {
    flex: 1;
}

.lesson-info strong {
    display: block;
    color: var(--dark);
    margin-bottom: 2px;
}

.lesson-actions {
    flex-shrink: 0;
}

/* ============ STAT MINI ============ */
.stat-mini {
    background: white;
    padding: 14px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border);
}

.stat-mini .stat-num {
    font-size: 24px;
    font-weight: 800;
}

.stat-mini .stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-mini.stat-success { border-color: #10b981; }
.stat-mini.stat-success .stat-num { color: #10b981; }
.stat-mini.stat-danger { border-color: #ef4444; }
.stat-mini.stat-danger .stat-num { color: #ef4444; }
.stat-mini.stat-warning { border-color: #f59e0b; }
.stat-mini.stat-warning .stat-num { color: #f59e0b; }
.stat-mini.stat-info { border-color: #3b82f6; }
.stat-mini.stat-info .stat-num { color: #3b82f6; }
.stat-mini.stat-primary { border-color: #6366f1; }
.stat-mini.stat-primary .stat-num { color: #6366f1; }

/* ============ PROGRESS ============ */
.progress {
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ============ ERROR PAGE ============ */
.error-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.error-content h1 {
    font-size: 120px;
    font-weight: 900;
    color: var(--primary);
    margin: 0;
    line-height: 1;
}

.error-content h3 {
    font-size: 28px;
    margin: 10px 0;
}

.error-icon {
    font-size: 60px;
    color: var(--primary);
    margin-bottom: 20px;
}

/* ============ PAYMENT STATS ============ */
.pay-stat {
    padding: 10px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
}

.pay-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .nav-search {
        display: none;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 16px;
    }
    
    .page-header h2 {
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stat-icon {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
    
    .card-custom-body {
        padding: 14px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ============ PRINT ============ */
@media print {
    .sidebar, .top-navbar, .btn, .page-header button {
        display: none !important;
    }
    .main-wrapper {
        margin-left: 0;
    }
    .card-custom {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-custom, .stat-card, .teacher-card, .group-card {
    animation: fadeIn 0.3s ease;
}