/* ============================================================
   BAIAC Intelligence Academy — Admin Panel CSS
   Enterprise SaaS Dashboard Design
   ============================================================ */

/* CSS Variables */
:root {
    --navy:          #0A1628;
    --navy-medium:   #0F2040;
    --navy-light:    #1A3050;
    --navy-hover:    #162236;
    --blue:          #1E40AF;
    --blue-hover:    #1E3A8A;
    --blue-light:    #EFF6FF;
    --blue-mid:      #BFDBFE;
    --text:          #1A1A2E;
    --text-primary:  #0F0F1A;
    --muted:         #52525B;
    --border:        #C4C4D4;
    --white:         #FFFFFF;
    --bg:            #EBEBF0;
    --surface:       #F4F4F8;
    --danger:        #DC2626;
    --danger-hover:  #B91C1C;
    --danger-light:  #FEF2F2;
    --success:       #16A34A;
    --success-light: #F0FDF4;
    --warning:       #D97706;
    --warning-light: #FFFBEB;
    --orange:        #EA580C;
    --orange-light:  #FFF7ED;
    --purple:        #7C3AED;
    --purple-light:  #F5F3FF;
    --sidebar-width: 260px;
    --topbar-height: 58px;
    --radius-sm:     2px;
    --radius:        4px;
    --radius-lg:     6px;
    --radius-xl:     8px;
    --shadow-sm:     0 1px 2px rgba(0,0,0,0.10);
    --shadow:        0 1px 3px rgba(0,0,0,0.14), 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md:     0 3px 6px rgba(0,0,0,0.14), 0 1px 3px rgba(0,0,0,0.10);
    --shadow-lg:     0 6px 16px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.10);
    --shadow-xl:     0 12px 32px rgba(0,0,0,0.20);
    --transition:    120ms ease;
    --transition-md: 200ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--blue-hover); }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p { color: var(--muted); }

img { max-width: 100%; height: auto; }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-md);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Dark scrollbar for sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* Logo area — white background pad for logo legibility */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    flex-shrink: 0;
    background: #FFFFFF;
}

.sidebar-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Section headers */
.sidebar-section-label {
    padding: 14px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    background: var(--navy-medium);
    margin-top: 4px;
    user-select: none;
}

.sidebar-nav {
    padding: 8px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-group {
    margin-bottom: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 16px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: var(--navy-light);
    color: rgba(255,255,255,0.92);
    text-decoration: none;
}

.nav-item.active {
    background: rgba(37,99,235,0.2);
    color: #93C5FD;
    border-left-color: var(--blue);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    opacity: 0.8;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-label { flex: 1; }

.nav-badge {
    background: var(--blue);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    letter-spacing: 0.2px;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 8px 12px;
}

.sidebar-footer {
    padding: 8px 0 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    background: var(--navy-medium);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-bottom: 2px;
}

.sidebar-user-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--blue), #7C3AED);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    line-height: 1.2;
}

.sidebar-user-role {
    font-size: 10.5px;
    color: rgba(255,255,255,0.35);
}

.nav-item--logout:hover {
    background: rgba(239,68,68,0.12);
    color: #FCA5A5;
    border-left-color: var(--danger);
}

/* Gradient overlay at bottom of sidebar content */
.sidebar-gradient-overlay {
    position: sticky;
    bottom: 0;
    height: 40px;
    background: linear-gradient(to top, var(--navy) 0%, transparent 100%);
    pointer-events: none;
    flex-shrink: 0;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    width: 100%;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}
.sidebar-toggle:hover {
    background: var(--bg);
    color: var(--text);
}

.page-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Notification dot */
.topbar-icon-btn {
    position: relative;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.topbar-icon-btn:hover { background: var(--bg); color: var(--text); }

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid white;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: default;
}

.admin-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
}

.admin-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--blue), #7C3AED);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    padding: 24px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header-left h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.page-header-left p {
    font-size: 13px;
    color: var(--muted);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 14px;
    width: fit-content;
}

.breadcrumb a {
    color: var(--muted);
    transition: color var(--transition);
}

.breadcrumb a:hover { color: var(--blue); }

.breadcrumb-sep { color: var(--border); font-size: 11px; }

.breadcrumb-current {
    color: var(--text);
    font-weight: 500;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.card-body {
    padding: 20px 24px;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================================
   WELCOME BANNER
   ============================================================ */
.welcome-banner {
    background: linear-gradient(135deg, #0A1628 0%, #1E40AF 100%);
    color: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-banner h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.welcome-banner p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.97rem;
    color: rgba(255,255,255,0.85);
}

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: box-shadow var(--transition);
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card--blue::before   { background: var(--blue); }
.stat-card--green::before  { background: var(--success); }
.stat-card--yellow::before { background: var(--warning); }
.stat-card--red::before    { background: var(--danger); }
.stat-card--purple::before { background: var(--purple); }
.stat-card--orange::before { background: var(--orange); }

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon--blue   { background: var(--blue-light); color: var(--blue); }
.stat-icon--green  { background: var(--success-light); color: var(--success); }
.stat-icon--yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon--red    { background: var(--danger-light); color: var(--danger); }
.stat-icon--purple { background: var(--purple-light); color: var(--purple); }
.stat-icon--orange { background: var(--orange-light); color: var(--orange); }

.stat-info { flex: 1; min-width: 0; }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary) !important;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 13px;
    color: var(--muted) !important;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
}

.stat-trend--up   { color: var(--success); }
.stat-trend--down { color: var(--danger); }

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow var(--transition), border-color var(--transition);
    color: var(--text);
}

.quick-action-btn:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue-mid);
    color: var(--text);
    text-decoration: none;
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.quick-action-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    text-align: center;
    line-height: 1.3;
}

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--surface); }

.activity-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    margin-top: 1px;
}

.activity-content { flex: 1; min-width: 0; }

.activity-text {
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.activity-result {
    flex-shrink: 0;
    text-align: right;
}

.activity-score {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-time {
    font-size: 11px;
    color: var(--muted);
}

/* ============================================================
   DATA TABLES
   ============================================================ */
.table-wrapper {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    overflow: hidden;
}

.table-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.table-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead tr {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 2;
}

thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

thead th.sortable {
    cursor: pointer;
}
thead th.sortable:hover { color: var(--blue); }

thead th.sortable::after {
    content: ' ⇅';
    font-size: 10px;
    opacity: 0.4;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:nth-child(even) { background: var(--surface); }

tbody tr:hover { background: var(--blue-light) !important; }

tbody td {
    padding: 13px 14px;
    color: var(--text);
    vertical-align: middle;
    font-size: 14px;
}

.td-muted {
    color: var(--muted);
    font-size: 12.5px;
}

.td-truncate {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Student/entity avatar in table */
.entity-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.entity-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.entity-name { font-weight: 500; }
.entity-sub  { font-size: 11.5px; color: var(--muted); }

/* Drag handle */
.drag-handle {
    color: var(--muted);
    cursor: grab;
    opacity: 0.4;
    transition: opacity var(--transition);
}
.drag-handle:hover { opacity: 0.8; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
    background: var(--border);
    border-radius: 20px;
    height: 6px;
    overflow: hidden;
    min-width: 60px;
}

.progress-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 0.4s ease;
}

.progress-fill--blue   { background: var(--blue); }
.progress-fill--green  { background: var(--success); }
.progress-fill--red    { background: var(--danger); }
.progress-fill--yellow { background: var(--warning); }

.progress-with-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-pct {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    flex-shrink: 0;
    min-width: 36px;
    text-align: right;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}
.btn-primary:hover:not(:disabled) {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
    color: white;
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg);
    border-color: #CBD5E1;
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover:not(:disabled) {
    background: #16A34A;
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--blue);
    border-color: var(--blue);
}
.btn-outline-primary:hover:not(:disabled) {
    background: var(--blue-light);
    color: var(--blue);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-outline-danger:hover:not(:disabled) {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg);
    color: var(--text);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    padding: 6px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 11px 20px;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.badge-blue    { background: var(--blue-light); color: var(--blue); }
.badge-green   { background: var(--success-light); color: #15803D; }
.badge-red     { background: var(--danger-light); color: #B91C1C; }
.badge-yellow  { background: var(--warning-light); color: #92400E; }
.badge-gray    { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-orange  { background: var(--orange-light); color: #C2410C; }
.badge-purple  { background: var(--purple-light); color: #6D28D9; }

.badge-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.badge-green.badge-dot::before  { background: var(--success); }
.badge-yellow.badge-dot::before { background: var(--warning); }
.badge-red.badge-dot::before    { background: var(--danger); }
.badge-gray.badge-dot::before   { background: var(--muted); }

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-light);
    color: #15803D;
    border-color: #BBF7D0;
}

.alert-error {
    background: var(--danger-light);
    color: #B91C1C;
    border-color: #FECACA;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
    border-color: #FDE68A;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

/* Input with icon prefix */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--muted);
    pointer-events: none;
    z-index: 1;
}

.input-group .form-control {
    padding-left: 36px;
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition);
    outline: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--blue);
    box-shadow: none;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--bg);
    color: var(--muted);
    cursor: not-allowed;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar input {
    padding: 7px 12px 7px 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    outline: none;
    width: 220px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-bar input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
    width: 260px;
}

.search-bar .search-icon {
    position: absolute;
    left: 10px;
    color: var(--muted);
    pointer-events: none;
}

/* ============================================================
   FILTER ROW / DROPDOWN FILTERS
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.filter-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right: 4px;
}

.filter-bar select {
    padding: 6px 30px 6px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-bar select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.08);
}

/* ============================================================
   TABS
   ============================================================ */
.tab-bar {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-item {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
    text-decoration: none;
}

.tab-item:hover { color: var(--text); }

.tab-item.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    font-weight: 600;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,22,40,0.60);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.modal-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

.modal-body {
    padding: 20px 22px;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: var(--surface);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ============================================================
   SUMMARY STATS BAR
   ============================================================ */
.summary-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.summary-stat {
    flex: 1;
    padding: 16px 20px;
    text-align: center;
    border-right: 1px solid var(--border);
    min-width: 0;
}

.summary-stat:last-child { border-right: none; }

.summary-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.summary-stat-label {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--border);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
    background: #fff;
    padding: 16px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-img {
    height: 52px;
    width: auto;
    display: block;
    object-fit: contain;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-card .login-desc {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 28px;
}

.login-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 4px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--muted);
}

.empty-state svg {
    opacity: 0.2;
    margin-bottom: 16px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.empty-state h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    max-width: 320px;
    margin: 0 auto;
}

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton {
    background: var(--border);
    border-radius: var(--radius-sm);
}

.skeleton-text  { height: 14px; margin-bottom: 6px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 10px; }
.skeleton-box   { height: 80px; }

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 20px;
    transition: background var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* ============================================================
   DASHBOARD GRIDS
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
}

/* ============================================================
   EXAM QUESTIONS PAGE
   ============================================================ */
.question-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: box-shadow var(--transition);
}

.question-item:hover {
    box-shadow: var(--shadow-md);
}

.question-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 1px;
}

.question-text {
    flex: 1;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.question-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.question-option {
    font-size: 12.5px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.question-option.correct {
    color: #15803D;
    font-weight: 500;
}

.option-label {
    font-weight: 600;
    color: var(--text);
    font-size: 11px;
    background: var(--surface);
    border-radius: 4px;
    padding: 1px 5px;
    flex-shrink: 0;
}

.correct .option-label {
    background: var(--success-light);
    color: #15803D;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

/* ============================================================
   EXAM INFO CARD
   ============================================================ */
.exam-info-card {
    background: linear-gradient(135deg, var(--navy) 0%, #0F2044 100%);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    color: white;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.exam-info-card h2 {
    font-size: 18px;
    color: white;
    margin-bottom: 4px;
}

.exam-info-card p {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.exam-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.exam-stat {
    text-align: center;
}

.exam-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 2px;
}

.exam-stat-label {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   SECTION HEADING
   ============================================================ */
.section-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(1px);
}
.sidebar-backdrop.open {
    display: block;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #CBD5E1; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .main-content { width: 100%; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: flex;
    }
    .main-content {
        margin-left: 0;
    }
    .page-content {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .search-bar input {
        width: 160px;
    }
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .question-options {
        grid-template-columns: 1fr;
    }
    .exam-info-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .summary-bar {
        flex-direction: column;
    }
    .summary-stat { border-right: none; border-bottom: 1px solid var(--border); }
    .summary-stat:last-child { border-bottom: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .login-card { padding: 28px 20px; }
    .modal { border-radius: var(--radius-lg); }
    .admin-name { display: none; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   SMART SHIKKHA TABS
   ============================================================ */
.tabs-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.tab-btn:hover {
    color: var(--blue);
}

.tab-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

