/* ═════════════════════════════════════════════════════════════════
   SABAQ ZHOSPARY — Modern Premium Design System
   ═════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    /* Color Palette */
    --white: #ffffff;
    --page: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-2: #334155;
    --text-3: #64748b;
    --line: #e2e8f0;
    --line-subtle: #f1f5f9;

    /* Brand Primary (Indigo / Electric Blue) */
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-soft: #eff6ff;
    --blue-border: #bfdbfe;
    
    /* Status Colors */
    --green: #059669;
    --green-dark: #047857;
    --green-soft: #ecfdf5;
    --green-border: #a7f3d0;

    --orange: #d97706;
    --orange-dark: #b45309;
    --orange-soft: #fffbeb;
    --orange-border: #fde68a;

    --red: #dc2626;
    --red-dark: #b91c1c;
    --red-soft: #fef2f2;
    --red-border: #fca5a5;

    /* Radius & Transitions */
    --r: 10px;
    --r-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 36px -4px rgba(15, 23, 42, 0.12);
    --shadow-blue: 0 8px 24px -4px rgba(37, 99, 235, 0.25);
    --ease: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--page);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ─────────────────────────────────── */
header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    height: 64px;
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.brand-title { font-size: 1rem; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.brand-subtitle { font-size: 0.72rem; color: var(--text-3); font-weight: 500; }

.user-profile { display: flex; align-items: center; gap: 12px; }

.avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; color: white;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.2);
}

.user-name { font-size: 0.84rem; font-weight: 700; color: var(--text); }
.user-role { font-size: 0.7rem; color: var(--text-3); font-weight: 500; }

/* ─── LAYOUT ──────────────────────────────────── */
.app-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 36px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.35s ease-out;
}

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

/* ─── NAV TABS ────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1.5px solid var(--line);
    padding-bottom: 2px;
}

.nav-tab-btn {
    padding: 10px 22px;
    border: none;
    background: none;
    color: var(--text-3);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -3.5px;
    transition: var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px 6px 0 0;
}

.nav-tab-btn:hover { color: var(--text); background: rgba(255,255,255,0.6); }

.nav-tab-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    background: var(--white);
}

/* ─── STAT CARDS ──────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--ease);
    border: 1px solid var(--line-subtle);
    box-shadow: var(--shadow-sm);
}

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

.stat-label {
    font-size: 0.72rem;
    color: var(--text-3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: block;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.95rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
    line-height: 1;
}

.stat-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}

.stat-card.total .stat-icon    { background: #f1f5f9; color: #475569; }
.stat-card.pending .stat-icon  { background: var(--orange-soft); color: var(--orange); }
.stat-card.approved .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-card.rejected .stat-icon { background: var(--red-soft); color: var(--red); }
.stat-card.teachers .stat-icon { background: var(--blue-soft); color: var(--blue); }

/* ─── TOOLBAR ─────────────────────────────────── */
.toolbar {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line-subtle);
    box-shadow: var(--shadow-sm);
}

.tab-filters {
    display: flex;
    gap: 4px;
    background: var(--page);
    padding: 4px;
    border-radius: 8px;
}

.tab-btn {
    padding: 7px 16px;
    border: none;
    background: none;
    color: var(--text-3);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
    background: var(--white);
    color: var(--blue);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.count-pill {
    background: var(--line);
    color: var(--text-3);
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.tab-btn.active .count-pill {
    background: var(--blue-soft);
    color: var(--blue);
}

.filter-actions { display: flex; gap: 10px; align-items: center; }

.search-box { position: relative; width: 260px; }

.search-box input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    background: var(--page);
    border: 1.5px solid transparent;
    border-radius: var(--r);
    color: var(--text);
    font-size: 0.84rem;
    outline: none;
    font-family: inherit;
    font-weight: 500;
    transition: var(--ease);
}

.search-box input:focus {
    background: var(--white);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-box input::placeholder { color: var(--text-3); }

.search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 13px;
}

.select-box select {
    padding: 8px 14px;
    background: var(--page);
    border: 1.5px solid transparent;
    border-radius: var(--r);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: var(--ease);
}

.select-box select:focus {
    background: var(--white);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ─── TABLE ───────────────────────────────────── */
.table-panel {
    background: var(--white);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line-subtle);
    box-shadow: var(--shadow-sm);
}

.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
    padding: 13px 18px;
    background: #f8fafc;
    color: var(--text-3);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-subtle);
    font-size: 0.85rem;
    vertical-align: middle;
    color: var(--text);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

.teacher-name { font-weight: 700; color: var(--text); }
.teacher-sub  { font-size: 0.74rem; color: var(--text-3); margin-top: 2px; }

.topic-title { font-weight: 700; line-height: 1.35; }
.topic-meta  { font-size: 0.74rem; color: var(--text-3); margin-top: 3px; }

/* ─── STATUS BADGES ───────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-badge.pending {
    background: var(--orange-soft);
    color: var(--orange-dark);
    border: 1px solid var(--orange-border);
}

.status-badge.approved {
    background: var(--green-soft);
    color: var(--green-dark);
    border: 1px solid var(--green-border);
}

.status-badge.rejected {
    background: var(--red-soft);
    color: var(--red-dark);
    border: 1px solid var(--red-border);
}

/* ─── BUTTONS ─────────────────────────────────── */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--r);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary { 
    background: linear-gradient(135deg, #2563eb, #1d4ed8); 
    color: white; 
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35); 
}

.btn-success { 
    background: linear-gradient(135deg, #059669, #047857); 
    color: white; 
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}
.btn-success:hover { 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.btn-danger { 
    background: linear-gradient(135deg, #dc2626, #b91c1c); 
    color: white; 
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}
.btn-danger:hover { 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.btn-secondary {
    background: var(--page);
    color: var(--text-2);
    border: 1.5px solid var(--line);
}
.btn-secondary:hover { 
    background: var(--white); 
    border-color: var(--text-3);
}

.btn-ghost {
    background: none;
    color: var(--text-3);
    border: 1.5px solid transparent;
}
.btn-ghost:hover { background: var(--page); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 0.76rem; border-radius: 6px; }

/* ─── MODAL ───────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--ease);
    padding: 20px;
}

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

.modal-card {
    width: 100%;
    max-width: 640px;
    background: var(--white);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(12px);
    transition: var(--ease);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--line);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 26px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-3);
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--ease);
}
.modal-close:hover { background: var(--line); color: var(--text); }

.modal-body {
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.86rem;
    align-items: center;
}
.detail-row:last-of-type { border-bottom: none; }
.detail-label { color: var(--text-3); font-weight: 600; }
.detail-value { color: var(--text); font-weight: 700; }

.modal-footer {
    padding: 16px 26px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8fafc;
}

/* ─── FORM ────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--page);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    color: var(--text);
    font-size: 0.86rem;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: var(--ease);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-group textarea { min-height: 85px; resize: vertical; }

/* ─── LOGIN ───────────────────────────────────── */
.login-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top left, #eff6ff, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--white);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12);
    border: 1px solid var(--line);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.login-logo-icon {
    width: 58px; height: 58px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    color: white;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

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

.login-logo p { font-size: 0.82rem; color: var(--text-3); font-weight: 500; }

/* ─── TOAST ───────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 3000;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--r);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    min-width: 260px;
}

@keyframes toastIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.toast.success { background: #065f46; color: white; }
.toast.error   { background: #991b1b; color: white; }
.toast.info    { background: var(--blue); color: white; }

/* ─── SCROLLBAR ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }