/* =========================================================
   EXAM PORTAL – Comprehensive Styles
   ========================================================= */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --primary-bg: #eef2ff;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 4px 24px rgba(79,70,229,.08);
    --shadow-lg: 0 12px 40px rgba(79,70,229,.12);
    --transition: .2s ease;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #f0fdf4 100%);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* =========================================================
   Decorative blobs
   ========================================================= */

.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .4;
    pointer-events: none;
    z-index: 0;
}
.blob-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #c7d2fe, #a5b4fc);
    top: -120px; right: -100px;
}
.blob-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #ddd6fe, #c4b5fd);
    bottom: -100px; left: -80px;
}

/* =========================================================
   Navbar
   ========================================================= */

.navbar {
    position: relative;
    z-index: 10;
    padding: 16px 24px;
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(79,70,229,.08);
    border-radius: 14px;
    padding: 10px 20px;
    box-shadow: 0 2px 16px rgba(79,70,229,.06);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-900);
    text-decoration: none;
}
.nav-links {
    display: flex;
    gap: 4px;
}
.nav-link {
    padding: 7px 14px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-500);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition);
}
.nav-link:hover {
    color: var(--primary);
    background: var(--primary-bg);
}
.nav-link.active {
    color: var(--primary);
    background: var(--primary-bg);
}
.nav-link-logout {
    color: var(--danger);
}
.nav-link-logout:hover {
    color: #fff;
    background: var(--danger);
}

/* =========================================================
   Page container
   ========================================================= */

.page-container {
    flex: 1;
    position: relative;
    z-index: 1;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 40px;
}
.page-container.wide {
    max-width: 1280px;
}
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================
   Card
   ========================================================= */

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    border: 1px solid rgba(79,70,229,.06);
}
.card-header {
    margin-bottom: 24px;
}
.card-header h1,
.card-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.card-header p {
    color: var(--gray-500);
    font-size: .875rem;
}
.card-icon {
    margin-bottom: 12px;
}

/* Auth logos (login / register pages) */
.auth-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 16px;
}
.auth-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* =========================================================
   Forms
   ========================================================= */

.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    pointer-events: none;
    z-index: 2;
    transition: color var(--transition);
}

input,
select {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font-family: inherit;
    font-size: .925rem;
    color: var(--gray-800);
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    outline: none;
    transition: all var(--transition);
    appearance: none;
    -webkit-appearance: none;
}
input::placeholder { color: var(--gray-400); }
input:focus,
select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
input:focus + .input-icon,
select:focus + .input-icon,
input:focus ~ .input-icon,
select:focus ~ .input-icon {
    color: var(--primary);
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 01.708 0L8 8.293l2.646-2.647a.5.5 0 01.708.708l-3 3a.5.5 0 01-.708 0l-3-3a.5.5 0 010-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Error */
.form-group.error input,
.form-group.error select {
    border-color: var(--danger);
    background: var(--danger-bg);
}
.error-msg {
    display: block;
    font-size: .78rem;
    color: var(--danger);
    margin-top: 4px;
    min-height: 0;
}
.help-text {
    display: block;
    font-size: .78rem;
    color: var(--gray-400);
    margin-top: 4px;
}
.form-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: .85rem;
    color: var(--gray-500);
}
.form-footer-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.form-footer-text a:hover {
    text-decoration: underline;
}

/* Index row */
.index-row {
    display: flex;
    gap: 10px;
}
.index-display {
    flex: 1;
}
.index-display input {
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--primary);
}

/* Inline form (subject add) */
.inline-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    padding: 12px 20px;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(79,70,229,.35);
}
.btn-primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}
.btn-secondary {
    background: var(--primary-bg);
    color: var(--primary);
}
.btn-secondary:hover { background: #dde3fb; }

.btn-danger-ghost {
    background: none;
    color: var(--danger);
    padding: 6px 10px;
    font-size: .8rem;
}
.btn-danger-ghost:hover {
    background: var(--danger-bg);
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: .95rem;
    margin-top: 8px;
}
.btn-arrow { transition: transform var(--transition); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* Spinner */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
.spinner.dark {
    border-color: rgba(79,70,229,.2);
    border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* =========================================================
   Tabs
   ========================================================= */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: 24px;
    padding-bottom: 0;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-400);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--transition);
}
.tab-btn:hover {
    color: var(--gray-600);
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn .25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Tables
   ========================================================= */

.table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.data-table th {
    background: var(--gray-50);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: .78rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 1px solid var(--gray-200);
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}
.data-table tbody tr:hover {
    background: var(--gray-50);
}
.table-empty {
    text-align: center;
    padding: 32px 14px !important;
    color: var(--gray-400);
    font-size: .875rem;
}

/* =========================================================
   Subject cards (expandable with exam types)
   ========================================================= */

.subject-card {
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #fff;
    transition: box-shadow var(--transition);
}
.subject-card:hover {
    box-shadow: 0 2px 12px rgba(79,70,229,.06);
}
.subject-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--gray-50);
    gap: 12px;
}
.subject-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}
.subject-card-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.subject-chevron {
    flex-shrink: 0;
    color: var(--gray-400);
    transition: transform .25s ease;
}
.subject-chevron.expanded {
    transform: rotate(90deg);
}
.exam-count-badge {
    flex-shrink: 0;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: .2px;
    text-transform: uppercase;
}
.subject-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Icon buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon:hover {
    background: var(--primary-bg);
    color: var(--primary);
}
.btn-icon-danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Student actions dropdown */
.student-actions-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 180px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 50;
    padding: 4px;
    margin-top: 4px;
}
.student-actions-menu.active {
    display: block;
}
.student-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    font-size: .84rem;
    color: var(--text-primary);
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s;
    text-align: left;
    white-space: nowrap;
}
.student-action-item:hover {
    background: var(--gray-50);
}
.student-action-item svg {
    flex-shrink: 0;
    color: var(--gray-400);
}
.student-action-item:hover svg {
    color: var(--primary);
}
.student-action-danger {
    color: var(--danger);
}
.student-action-danger svg {
    color: var(--danger) !important;
}
.student-action-danger:hover {
    background: var(--danger-bg);
}
.student-action-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}

/* Expandable body */
.subject-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
    padding: 0 16px;
}
.subject-card-body.expanded {
    max-height: 600px;
    padding: 16px;
    border-top: 1px solid var(--gray-100);
}

/* Exam types section */
.exam-types-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.et-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.exam-types-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--gray-400);
}
.btn-add-exam-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1.5px dashed var(--primary);
    border-radius: 8px;
    background: none;
    color: var(--primary);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-add-exam-sm:hover {
    background: var(--primary-bg);
    border-style: solid;
}

/* Exam type list */
.et-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}
.et-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}
.et-list-item:last-child {
    border-bottom: none;
}
.et-list-item:hover {
    background: var(--gray-50);
}
.et-list-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}
.et-list-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
}
.et-list-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.et-list-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.et-list-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.et-list-edit,
.et-list-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--gray-300);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    padding: 0;
}
.et-list-edit:hover {
    background: var(--primary-bg);
    color: var(--primary);
}
.et-list-remove:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Exam types empty state */
.et-empty-state {
    text-align: center;
    padding: 20px 12px;
    color: var(--gray-400);
}
.et-empty-state svg {
    margin-bottom: 6px;
}
.et-empty-state p {
    font-size: .82rem;
    font-weight: 500;
    color: var(--gray-400);
    margin: 0;
}

/* Legacy compat */
.subjects-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* =========================================================
   Dashboard – Student
   ========================================================= */

/* Upcoming exams widget */
.upcoming-exams-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.upcoming-exam-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 340px;
}
.upcoming-exam-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 8px;
    min-width: 52px;
    padding: 6px 8px;
    flex-shrink: 0;
}
.upcoming-exam-day {
    font-size: 1.2rem;
    font-weight: 700;
    color: #92400e;
    line-height: 1.2;
}
.upcoming-exam-month {
    font-size: .65rem;
    font-weight: 600;
    color: #b45309;
    text-transform: uppercase;
}
.upcoming-exam-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.upcoming-exam-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upcoming-exam-subject {
    font-size: .78rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Top Performer widget (student dashboard) */
.top-performer-card {
    border-left: 4px solid #d97706;
}
.tp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.tp-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tp-body {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px 18px;
}
.tp-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #d97706;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.tp-info {
    flex: 1;
    min-width: 0;
}
.tp-name {
    font-weight: 700;
    font-size: .95rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tp-index {
    font-size: .78rem;
    color: var(--gray-500);
}
.tp-score {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.tp-mark {
    font-size: 1.3rem;
    font-weight: 800;
    color: #92400e;
}

.dashboard-welcome {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.avatar {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.info-item {
    background: var(--gray-50);
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}
.info-label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--gray-400);
    margin-bottom: 2px;
}
.info-value {
    font-size: .9rem;
    font-weight: 600;
    color: var(--gray-800);
    word-break: break-all;
}
.info-value.primary {
    color: var(--primary);
    letter-spacing: .5px;
}

.marks-summary {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--primary-bg);
    border-radius: 8px;
    font-size: .9rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 6px;
}
.marks-summary strong {
    color: var(--primary);
    font-size: 1.05rem;
}

/* =========================================================
   Empty state
   ========================================================= */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}
.empty-state svg {
    margin-bottom: 12px;
}
.empty-state p {
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 4px;
}
.empty-state span {
    font-size: .85rem;
}

/* =========================================================
   Marks editor (admin)
   ========================================================= */

.mark-input {
    width: 120px;
    padding: 8px 12px 8px 12px;
    font-size: .9rem;
    text-align: right;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
    color: var(--gray-800);
    font-weight: 600;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
    margin-left: auto;
    display: block;
}
.mark-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

/* =========================================================
   Modal
   ========================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    width: 92%;
    max-width: 420px;
    text-align: center;
    transform: translateY(20px) scale(.96);
    transition: transform .3s ease;
    position: relative;
}
.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}
.modal h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}
.modal p {
    color: var(--gray-500);
    font-size: .85rem;
    line-height: 1.5;
}
.success-icon {
    margin-bottom: 16px;
}

/* =========================================================
   Toast
   ========================================================= */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #fff;
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--gray-700);
    animation: slideIn .35s ease;
    max-width: 380px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--primary); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

/* =========================================================
   Searchable student dropdown
   ========================================================= */

.student-search-wrapper {
    position: relative;
}
.student-search-filters {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.filter-select {
    flex: 1;
    padding: 8px 30px 8px 12px !important;
    font-size: .82rem;
    border-radius: 8px;
    cursor: pointer;
}
.student-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
    max-height: 260px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}
.student-dropdown.open {
    display: block;
}
.student-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}
.student-dropdown-item:last-child {
    border-bottom: none;
}
.student-dropdown-item:hover,
.student-dropdown-item.highlighted {
    background: var(--primary-bg);
}
.student-dropdown-item .student-name {
    font-weight: 600;
    font-size: .875rem;
    color: var(--gray-800);
}
.student-dropdown-item .student-meta {
    font-size: .75rem;
    color: var(--gray-500);
}
.student-dropdown-item .student-meta .match-highlight {
    background: #fef08a;
    color: var(--gray-800);
    padding: 0 2px;
    border-radius: 2px;
}
.student-dropdown-empty {
    padding: 16px 14px;
    text-align: center;
    color: var(--gray-400);
    font-size: .85rem;
}
.selected-student-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 14px;
    background: var(--primary-bg);
    border: 1.5px solid rgba(79,70,229,.15);
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--primary);
}
.selected-student-badge.hidden {
    display: none;
}
.clear-student-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color var(--transition);
}
.clear-student-btn:hover {
    color: var(--danger);
}

/* =========================================================
   Delete confirmation modal buttons
   ========================================================= */

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 16px rgba(239,68,68,.35);
}

/* =========================================================
   Marks tab toolbar
   ========================================================= */

.marks-tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* =========================================================
   Upload marks modal
   ========================================================= */

.upload-template-info {
    background: var(--primary-bg);
    border: 1.5px solid #c7d2fe;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.upload-template-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}
.upload-template-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.upload-col-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 6px;
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}
.upload-col-optional {
    color: var(--gray-400);
    border-style: dashed;
}
.upload-col-optional small {
    font-weight: 500;
}
.upload-template-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
.upload-template-download:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.upload-dropzone {
    border: 2px dashed var(--gray-200);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--gray-400);
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}
.upload-dropzone p {
    margin: 10px 0 4px;
    font-size: .85rem;
    color: var(--gray-500);
}
.upload-browse-link {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
}
.upload-formats {
    font-size: .72rem;
    color: var(--gray-400);
}

.upload-selected-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    margin-top: 12px;
    background: #f8fafc;
}
.upload-selected-file span {
    flex: 1;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upload-file-remove {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color var(--transition);
}
.upload-file-remove:hover {
    color: var(--danger);
}

.upload-results {
    margin-top: 16px;
}
.upload-result-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 600;
}
.upload-result-success {
    background: var(--success-bg);
    color: var(--success);
}
.upload-result-warning {
    background: #fef3c7;
    color: #d97706;
}
.upload-result-error {
    background: #fef2f2;
    color: var(--danger);
}
.upload-errors {
    margin-top: 10px;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}
.upload-errors-title {
    font-size: .75rem;
    font-weight: 700;
    color: var(--gray-500);
    margin-bottom: 6px;
}
.upload-error-row {
    font-size: .75rem;
    color: var(--danger);
    padding: 3px 0;
    border-bottom: 1px solid #f1f5f9;
}
.upload-error-row:last-child {
    border-bottom: none;
}

/* =========================================================
   Marks – student cards with marks
   ========================================================= */

.marks-card {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.marks-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(79,70,229,.06);
}
.mc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.mc-student-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.mc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .95rem;
    flex-shrink: 0;
}
.mc-name {
    font-size: .92rem;
    font-weight: 700;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mc-meta {
    font-size: .75rem;
    color: var(--gray-400);
    font-weight: 500;
}
.mc-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 8px;
    white-space: nowrap;
    color: var(--primary);
    background: var(--primary-bg);
    border: 1.5px solid #c7d2fe;
    cursor: pointer;
    transition: all var(--transition);
    width: auto;
    height: auto;
}
.mc-edit-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.mc-marks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.mc-subject-block {
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #f1f5f9;
}
.mc-subject-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
}
.mc-mark-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.mc-et-name {
    flex: 1;
    font-size: .78rem;
    color: var(--gray-600);
    font-weight: 500;
}
.mc-mark-val {
    font-size: .78rem;
    font-weight: 700;
    color: var(--gray-700);
}
.mc-no-marks {
    font-size: .8rem;
    color: var(--gray-400);
    font-style: italic;
    padding: 4px 0;
}

/* =========================================================
   Marks – subject grouping (edit modal)
   ========================================================= */

.marks-subject-group {
    margin-bottom: 20px;
}
.marks-subject-group:last-child {
    margin-bottom: 0;
}
.marks-subject-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--primary-bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}
.marks-subject-header svg {
    color: var(--primary);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .mc-header { flex-direction: column; align-items: flex-start; }
    .mc-marks-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Student profile
   ========================================================= */

.profile-index-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-bg);
    border: 1.5px solid #c7d2fe;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: .85rem;
    color: var(--primary);
}
.profile-index-badge strong {
    font-weight: 700;
    letter-spacing: .5px;
}
.profile-index-hint {
    margin-left: auto;
    font-size: .72rem;
    color: var(--gray-400);
    font-weight: 500;
}

.profile-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid var(--gray-200);
}
.profile-section-label svg {
    color: var(--gray-400);
}

.form-row {
    display: flex;
    gap: 14px;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .profile-index-badge {
        flex-wrap: wrap;
    }
    .profile-index-hint {
        margin-left: 0;
        width: 100%;
        margin-top: 4px;
    }
}

/* =========================================================
   Forgot password / Reset password
   ========================================================= */

.forgot-pw-link {
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
.forgot-pw-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.pw-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.pw-strength-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.pw-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width .3s ease, background .3s ease;
}
.pw-strength-label {
    font-size: .72rem;
    font-weight: 700;
    min-width: 70px;
    text-align: right;
}

/* =========================================================
   Students toolbar & pagination
   ========================================================= */

.students-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.students-search-box {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}
.students-search-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-400);
    pointer-events: none;
    z-index: 2;
}
.students-search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    font-size: .875rem;
    border-radius: 10px;
}
.students-filters {
    display: flex;
    gap: 8px;
}
.students-result-info {
    font-size: .78rem;
    color: var(--gray-400);
    font-weight: 600;
    margin-bottom: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    color: var(--gray-600);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.pg-btn:hover:not(.pg-disabled):not(.pg-active) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}
.pg-btn.pg-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79,70,229,.25);
}
.pg-btn.pg-disabled {
    opacity: .35;
    cursor: not-allowed;
}
.pg-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 34px;
    color: var(--gray-400);
    font-size: .82rem;
    font-weight: 600;
}

/* =========================================================
   Dashboard widgets
   ========================================================= */

.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.dash-stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow var(--transition);
}
.dash-stat-card:hover {
    box-shadow: 0 4px 16px rgba(79,70,229,.08);
}
.dash-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dash-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}
.dash-stat-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .3px;
}

.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dash-widget {
    padding: 24px;
}

/* Overview filters */
.overview-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

/* Grade badges */
.grade-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.grade-a { background: #ecfdf5; color: #059669; }
.grade-b { background: #eff6ff; color: #2563eb; }
.grade-c { background: #fffbeb; color: #d97706; }
.grade-s { background: #fff7ed; color: #ea580c; }
.grade-f { background: #fef2f2; color: #dc2626; }
.grade-— { background: var(--gray-100); color: var(--gray-400); }

/* Chart legend */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 16px;
    justify-content: center;
}
.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
}
.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.chart-legend-label {
    color: var(--gray-600);
    font-weight: 500;
}
.chart-legend-value {
    color: var(--gray-400);
    font-weight: 600;
}

/* Top scorer widget */
.top-scorer-widget {
    text-align: center;
    width: 100%;
    padding: 8px 0;
}
.top-scorer-medal {
    margin-bottom: 8px;
}
.top-scorer-mark {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}
.top-scorer-pct {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-400);
}
.top-scorer-grade {
    margin-bottom: 12px;
}
.top-scorer-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 14px;
}
.top-scorer-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    text-align: left;
}
.top-scorer-detail {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 8px 12px;
}
.top-scorer-detail-label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--gray-400);
    margin-bottom: 1px;
}
.top-scorer-detail-value {
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* =========================================================
   Footer
   ========================================================= */

.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray-400);
    font-size: .8rem;
    position: relative;
    z-index: 1;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 640px) {
    .navbar { padding: 12px 12px; }
    .nav-inner { padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
    .nav-links { gap: 2px; }
    .nav-link { padding: 6px 10px; font-size: .78rem; }
    .page-container { padding: 16px 12px 32px; }
    .card { padding: 24px 18px; }
    .index-row { flex-direction: column; }
    .info-grid { grid-template-columns: 1fr; }
    .inline-form { flex-direction: column; }
    .blob-1 { width: 300px; height: 300px; }
    .blob-2 { width: 250px; height: 250px; }
    .tabs { overflow-x: auto; gap: 0; }
    .tab-btn { padding: 10px 12px; font-size: .8rem; }
    .students-toolbar { flex-direction: column; }
    .students-filters { width: 100%; }
    .students-filters select { flex: 1; }
    .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
    .dash-two-col { grid-template-columns: 1fr; }
    .subject-card-header { padding: 12px; }
    .subject-card-body.expanded { padding: 12px; }
    .exam-count-badge { display: none; }
    .et-section-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .top-scorer-details { grid-template-columns: 1fr; }
    .overview-filters { flex-direction: column; }
    .lb-podium { flex-direction: column; gap: 12px; align-items: center; }
    .lb-podium-card { min-width: 200px; }
    .lb-podium-card.lb-podium-gold { order: -1; }
    .lb-my-rank-banner { flex-direction: column; gap: 4px; text-align: center; }
}

/* =========================================================
   LEADERBOARD
   ========================================================= */
.leaderboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

/* My rank banner (student view) */
.lb-my-rank-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
}
.lb-my-rank-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.lb-my-rank-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.lb-my-rank-mark {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}
.lb-my-rank-of {
    font-size: .82rem;
    color: var(--gray-500);
}

/* Podium */
.lb-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.lb-podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 20px 24px 16px;
    border-radius: 14px;
    min-width: 160px;
    position: relative;
    transition: transform .15s;
}
.lb-podium-card:hover { transform: translateY(-3px); }

.lb-podium-gold {
    background: linear-gradient(135deg, #fef9c3, #fde68a);
    border: 2px solid #f59e0b;
    order: 0;
}
.lb-podium-silver {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border: 2px solid #94a3b8;
}
.lb-podium-bronze {
    background: linear-gradient(135deg, #fef3e2, #fed7aa);
    border: 2px solid #f97316;
}
.lb-podium-me {
    box-shadow: 0 0 0 3px var(--primary), 0 4px 14px rgba(99, 102, 241, .2);
}
.lb-podium-icon {
    font-size: 1.6rem;
    line-height: 1;
}
.lb-podium-rank {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-500);
    margin-bottom: 4px;
}
.lb-podium-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 2px;
}
.lb-podium-gold .lb-podium-avatar { background: #d97706; }
.lb-podium-silver .lb-podium-avatar { background: #64748b; }
.lb-podium-bronze .lb-podium-avatar { background: #ea580c; }

.lb-podium-name {
    font-weight: 700;
    font-size: .9rem;
    color: var(--gray-800);
    text-align: center;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-podium-index {
    font-size: .72rem;
    color: var(--gray-500);
}
.lb-podium-mark {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gray-800);
    margin-top: 2px;
}
.lb-podium-meta {
    font-size: .7rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Leaderboard table */
.lb-table-wrap {
    overflow-x: auto;
}
.lb-table {
    border-collapse: separate;
    border-spacing: 0;
}
.lb-table tbody tr { transition: background .1s; }
.lb-table tbody tr:hover { background: #f8fafc; }
.lb-row-top td { background: #fffbeb; }
.lb-row-me td { background: #eef2ff !important; font-weight: 600; }
.lb-cell-name {
    display: flex;
    align-items: center;
    gap: 10px;
}
.lb-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem;
    flex-shrink: 0;
}
.lb-you-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 1px 7px;
    border-radius: 8px;
    margin-left: 4px;
}

/* ── Superadmin toggle switches ── */
.sa-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
}
.sa-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.sa-switch input { opacity: 0; width: 0; height: 0; }
.sa-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    transition: .25s;
}
.sa-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .25s;
}
.sa-switch input:checked + .sa-slider {
    background: var(--primary);
}
.sa-switch input:checked + .sa-slider::before {
    transform: translateX(22px);
}

/* ── Attendance sub-tabs ── */
.att-sub-content { display: none; }
.att-sub-content.active { display: block; }

/* ── Attendance row action buttons ── */
.att-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    margin-left: 4px;
    transition: background .15s, color .15s, border-color .15s;
}
.att-action-mark {
    color: var(--primary);
    background: var(--primary-bg);
    border-color: var(--primary);
}
.att-action-mark:hover {
    background: var(--primary);
    color: #fff;
}
.att-action-edit {
    color: var(--text-secondary);
    background: var(--surface);
    border-color: var(--border);
}
.att-action-edit:hover {
    background: var(--bg);
    color: var(--text-primary);
}
.att-action-delete {
    color: var(--danger);
    background: #fef2f2;
    border-color: var(--danger);
}
.att-action-delete:hover {
    background: var(--danger);
    color: #fff;
}

/* ── Online Edit ── */
.oe-mark-input {
    width: 100%;
    text-align: right;
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}
.oe-mark-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
    outline: none;
}
