/* ============================================
   STUDENT PROFILING MANAGEMENT SYSTEM
   Modern, Responsive Design
   ============================================ */

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #e0e7ff;
    --secondary: #06b6d4;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --gray-900: #111827;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-300: #d1d5db;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --sidebar-width: 260px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow: 0 4px 16px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: var(--gray-700);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
/* ============================================
   LOGIN PAGE  (lp-* = login page namespace)
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: white;
}

.lp-wrap {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left decorative panel */
.lp-left {
    flex: 1;
    background: white;
    border-right: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

.lp-left::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(79,70,229,.05) 0%, transparent 65%);
    top: -100px; right: -100px;
    pointer-events: none;
}

.lp-left::after {
    content: '';
    position: absolute;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(124,58,237,.04) 0%, transparent 65%);
    bottom: -80px; left: -80px;
    pointer-events: none;
}

.lp-left-inner {
    position: relative;
    z-index: 1;
    color: var(--gray-900);
    max-width: 460px;
}

.lp-logo {
    width: 76px; height: 76px;
    background: var(--primary-light);
    border: 1.5px solid rgba(79,70,229,.15);
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px;
    color: var(--primary);
    margin-bottom: 28px;
}

.lp-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 18px;
    color: var(--gray-900);
}

.lp-title span { color: var(--primary); }

.lp-sub {
    font-size: 15px;
    line-height: 1.8;
    color: var(--gray-500);
    margin-bottom: 40px;
    max-width: 380px;
}

.lp-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lp-feat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.lp-feat i { font-size: 18px; color: var(--primary); opacity: .9; }

/* Right form panel */
.lp-right {
    width: 500px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: white;
}

.lp-card { width: 100%; max-width: 400px; }

.lp-card-head {
    text-align: center;
    margin-bottom: 36px;
}

.lp-card-icon {
    width: 60px; height: 60px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin: 0 auto 18px;
}

.lp-card-head h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.lp-card-head p { color: var(--gray-500); font-size: 14px; }

.lp-hint {
    margin-top: 24px;
    padding: 14px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.8;
    text-align: center;
}

/* ── Shared form bits ── */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-400, #9ca3af);
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 11px 40px 11px 40px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-900);
    transition: var(--transition);
    background: var(--white);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
    font-size: 14px;
}

.toggle-password:hover { color: var(--primary); }

.btn-login {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79,70,229,.45);
}

/* ── Change-password modal (first login) ── */
.cpw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, .7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cpw-overlay.active { display: flex; }

.cpw-modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 32px 80px rgba(0,0,0,.25);
    width: 100%;
    max-width: 440px;
    padding: 40px 36px 36px;
    position: relative;
    animation: cpwSlideIn .3s cubic-bezier(.34,1.4,.64,1) both;
}

@keyframes cpwSlideIn {
    from { opacity: 0; transform: translateY(32px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.cpw-modal-head {
    text-align: center;
    margin-bottom: 28px;
}

.cpw-modal-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary-light), #f3e8ff);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    color: var(--primary);
    margin: 0 auto 16px;
}

.cpw-modal-head h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.cpw-modal-head p {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.6;
}

.cpw-modal-x {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: var(--transition);
}
.cpw-modal-x:hover { background: var(--gray-100); color: var(--gray-700); }
    height: 5px;
    background: var(--gray-100);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 8px;
}

.cpw-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    transition: width .3s, background .3s;
}

.cpw-strength-label,
.cpw-match-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
    min-height: 16px;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard-body {
    display: flex;
    min-height: 100vh;
    background: var(--gray-50);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform .3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.brand-text span {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: white;
    line-height: 1.2;
}

.brand-text small {
    color: rgba(255,255,255,.4);
    font-size: 11px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 15px;
    flex-shrink: 0;
}

.student-av {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
}

.sidebar-user-info strong {
    display: block;
    color: white;
    font-size: 13px;
}

.sidebar-user-info small {
    color: rgba(255,255,255,.4);
    font-size: 11px;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
    flex: 1;
}

.menu-label {
    padding: 8px 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,.3);
    text-transform: uppercase;
    margin-top: 8px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 8px;
    margin: 2px 10px;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255,255,255,.08);
    color: white;
}

.sidebar-menu li a.active {
    background: var(--primary);
    color: white;
}

.sidebar-menu li a i {
    width: 18px;
    font-size: 15px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 32px;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.page-header p {
    color: var(--gray-500);
    font-size: 14px;
}

/* Mobile Top Bar */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 400;
    background: var(--dark);
    padding: 0 16px;
    height: 56px;
    align-items: center;
    gap: 12px;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.mobile-topbar .mt-logo {
    width: 30px; height: 30px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: white;
    flex-shrink: 0;
}

.mobile-topbar .mt-title {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    min-width: 40px; min-height: 40px;
}

.menu-toggle:hover { background: rgba(255,255,255,.1); color: white; }

/* Sidebar close button (mobile only) */
.sidebar-close {
    display: none;
    position: absolute;
    top: 64px; right: 14px;
    width: 32px; height: 32px;
    background: rgba(255,255,255,.08);
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,.6);
    font-size: 14px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.sidebar-close:hover { background: rgba(255,255,255,.18); color: white; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 300;
    backdrop-filter: blur(2px);
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-blue .stat-icon { background: #e0e7ff; color: var(--primary); }
.stat-green .stat-icon { background: #dcfce7; color: #16a34a; }
.stat-purple .stat-icon { background: #f3e8ff; color: #9333ea; }
.stat-orange .stat-icon { background: #ffedd5; color: #ea580c; }

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

.card-body.p-0 { padding: 0; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-2 { margin-top: 10px; }

.form-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    max-width: 680px;
}

/* ============================================
   TABLES
   ============================================ */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-100);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-50);
    vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

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

.student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,.35);
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: #fee2e2;
    color: var(--danger);
    border: none;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-blue { background: #e0e7ff; color: #3730a3; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-red { background: #fee2e2; color: #b91c1c; }

/* ============================================
   ALERTS
   ============================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 500;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* ============================================
   CLASS GRID
   ============================================ */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.class-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: var(--transition);
}

.class-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.class-card-header {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.class-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.class-badge {
    background: rgba(255,255,255,.2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.class-card-body {
    padding: 20px;
}

.class-card-body h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.class-subject { color: var(--gray-500); margin-bottom: 2px; }
.class-year { font-size: 12px; color: var(--gray-400, #9ca3af); margin-bottom: 8px; }
.class-desc { font-size: 12px; color: var(--gray-500); margin-bottom: 12px; line-height: 1.5; }

.class-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--gray-500);
}

.class-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.class-card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 10px;
}

/* ============================================
   TWO COL LAYOUT (Class Students Page)
   ============================================ */
.two-col-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

.action-panel { display: flex; flex-direction: column; }

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 10px;
    color: var(--gray-400, #9ca3af);
    font-size: 13px;
}

.search-box input {
    padding: 7px 12px 7px 32px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    width: 200px;
    color: var(--gray-700);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    width: 240px;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-upload-content i {
    font-size: 32px;
    color: var(--gray-400, #9ca3af);
    display: block;
    margin-bottom: 8px;
}

.file-upload-content p {
    font-size: 13px;
    color: var(--gray-500);
}

.file-upload-content span {
    color: var(--primary);
    font-weight: 600;
}

.file-upload-content small {
    font-size: 11px;
    color: var(--gray-400, #9ca3af);
}

.file-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
}

.file-selected i { font-size: 24px; }

.text-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
}

.text-link:hover { text-decoration: underline; }

/* Form Controls */
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-700);
    background: white;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.required { color: var(--danger); }
.text-muted { color: var(--gray-500); }
.mb-3 { margin-bottom: 16px; }

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400, #9ca3af);
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
    display: block;
}

.empty-state p { font-size: 14px; }
.empty-state a { color: var(--primary); font-weight: 600; }

.empty-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 60px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.empty-card i { color: var(--gray-300); margin-bottom: 16px; }
.empty-card h3 { font-size: 20px; color: var(--gray-700); margin-bottom: 8px; }
.empty-card p { color: var(--gray-500); margin-bottom: 20px; }

/* ============================================
   STUDENT PROFILE PAGE
   ============================================ */
.profile-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

.profile-photo-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.photo-upload-area {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.photo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 16px;
    overflow: hidden;
    border: 4px solid var(--gray-100);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    gap: 4px;
}

.photo-placeholder i { font-size: 40px; }
.photo-placeholder span { font-size: 14px; }

.photo-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--primary);
    color: white;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 8px;
}

.photo-upload-btn:hover { background: var(--primary-dark); }

.profile-id-box {
    background: white;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    text-align: center;
}

.profile-id-box label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.profile-id-box strong {
    font-size: 18px;
    color: var(--gray-900);
    font-family: monospace;
}

/* Student Dashboard Summary Card */
.student-summary-card {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 24px;
    color: white;
    box-shadow: 0 8px 32px rgba(79,70,229,.3);
}

.summary-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,.3);
    flex-shrink: 0;
}

.summary-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}

.summary-info { flex: 1; }
.summary-info h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.summary-info p { font-size: 13px; opacity: 0.8; display: flex; align-items: center; gap: 8px; }

.summary-stats { text-align: center; }
.stat-num { display: block; font-size: 32px; font-weight: 800; }
.stat-lbl { font-size: 12px; opacity: 0.7; }

/* Class List (Student) */
.class-list { display: flex; flex-direction: column; gap: 1px; }

.class-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-50);
    transition: var(--transition);
}

.class-list-item:hover { background: var(--gray-50); }
.class-list-item:last-child { border-bottom: none; }

.cli-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.cli-info { flex: 1; }
.cli-info strong { display: block; font-size: 14px; color: var(--gray-900); }
.cli-info span { font-size: 13px; color: var(--gray-500); }
.cli-info small { font-size: 12px; color: var(--gray-400, #9ca3af); }
.cli-meta { text-align: right; }
.cli-meta small { display: block; font-size: 12px; color: var(--gray-400, #9ca3af); margin-top: 4px; }

/* ============================================
   CHANGE PASSWORD PAGE
   ============================================ */
.change-pw-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
}

.change-pw-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.change-pw-icon {
    width: 72px;
    height: 72px;
    background: var(--primary-light);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--primary);
    margin: 0 auto 20px;
}

.change-pw-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.change-pw-card .text-muted {
    margin-bottom: 28px;
    font-size: 14px;
}

.change-pw-card .form-group { text-align: left; }

/* Password strength bar */
.password-strength {
    height: 4px;
    background: var(--gray-100);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .3s, background .3s;
}

/* ============================================
   EXISTING STUDENT SEARCH
   ============================================ */
.search-results-list {
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
    margin-top: -2px;
    background: white;
    box-shadow: var(--shadow);
}

.sr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-50);
    transition: var(--transition);
}

.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--primary-light); }

.sr-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.sr-info { flex: 1; min-width: 0; }
.sr-info strong { display: block; font-size: 13px; color: var(--gray-900); }
.sr-info small { font-size: 12px; color: var(--gray-500); }

.sr-enroll-hint {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .15s;
}

.sr-item:hover .sr-enroll-hint { opacity: 1; }

.sr-empty {
    padding: 16px;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
}

.selected-student-preview {
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 8px;
}

.selected-student-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.selected-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.selected-student-info strong { display: block; color: var(--gray-900); font-size: 14px; }
.selected-student-info small  { color: var(--gray-500); font-size: 12px; }

/* ============================================
   PROFILE VIEW (Teacher viewing student)
   ============================================ */
.profile-view-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.profile-view-header {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    color: white;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255,255,255,.3);
    flex-shrink: 0;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
}

.profile-view-info h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.student-id-display { font-size: 14px; opacity: .85; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.detail-item {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-50);
    border-right: 1px solid var(--gray-50);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.detail-item label i { color: var(--primary); }
.detail-item span { font-size: 14px; color: var(--gray-900); font-weight: 500; }

/* ============================================
   RESPONSIVE — SMALL DESKTOP (≤1280px)
   ============================================ */
@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .class-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   RESPONSIVE — TABLET / LARGE PHONE (≤1024px)
   ============================================ */
@media (max-width: 1024px) {
    /* Sidebar: collapse to overlay */
    .sidebar { transform: translateX(-100%); z-index: 350; }
    .sidebar.open { transform: translateX(0); box-shadow: 6px 0 32px rgba(0,0,0,.3); }
    .sidebar-close { display: flex; }
    .sidebar-overlay.active { display: block; }
    .mobile-topbar { display: flex; }
    .main-content { margin-left: 0; padding: 72px 24px 28px; }

    /* Login */
    .lp-wrap { flex-direction: column; }
    .lp-left { flex: none; padding: 36px 32px; }
    .lp-right { width: 100%; padding: 36px 32px; }

    /* Content layouts */
    .two-col-layout { grid-template-columns: minmax(0, 1fr); }
    .action-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
    .profile-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
    .form-grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .svp-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 20px; }
}

/* ============================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .main-content { padding: 68px 16px 24px; }

    /* Login */
    .lp-title { font-size: 26px; }
    .lp-sub { font-size: 13px; margin-bottom: 24px; }
    .lp-features { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
    .lp-feat { padding: 10px 12px; font-size: 12px; }
    .lp-left { padding: 28px 24px; }
    .lp-right { padding: 28px 24px; }

    /* Layouts */
    .profile-layout { grid-template-columns: minmax(0, 1fr); }
    .profile-details-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .action-panel { display: flex; flex-direction: column; }
    .svp-layout { grid-template-columns: minmax(0, 1fr); }
    /* Photo card → horizontal strip on mobile */
    .svp-photo-card { display: grid; grid-template-columns: 130px minmax(0, 1fr); text-align: left; }
    .svp-photo-wrap { grid-column: 1; grid-row: 1 / span 3; width: 130px; max-height: none; aspect-ratio: unset; border-radius: 0; align-self: stretch; }
    .svp-photo-initials { font-size: 52px; }
    .svp-photo-name { padding: 16px 16px 3px; font-size: 15px; }
    .svp-photo-id { padding: 3px 16px 6px; }
    .svp-status-wrap { padding: 0 16px 12px; }
    .svp-member-since { grid-column: 1 / -1; justify-content: flex-start; }

    /* Stats */
    .stat-number { font-size: 24px; }
    .stat-icon { width: 46px; height: 46px; font-size: 19px; }

    /* Page header */
    .page-header { flex-wrap: wrap; gap: 12px; }
    .page-header h1 { font-size: 21px; }

    /* Forms */
    .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .form-card { padding: 24px 20px; }
    .card-body { padding: 18px; }
    .card-header { padding: 14px 18px; }

    /* Summary card */
    .student-summary-card { flex-direction: column; text-align: center; gap: 16px; padding: 20px; }
    .student-summary-card .summary-info p { justify-content: center; }
}

/* ============================================
   RESPONSIVE — SMALL MOBILE (≤640px)
   ============================================ */
@media (max-width: 640px) {
    .main-content { padding: 62px 10px 20px; }

    /* Stats — 2 compact columns */
    .stats-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .stat-card { padding: 14px 12px; gap: 10px; }
    .stat-number { font-size: 20px; }
    .stat-icon { width: 40px; height: 40px; font-size: 17px; border-radius: 10px; }
    .stat-label { font-size: 11px; }

    /* Page header */
    .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .page-header h1 { font-size: 18px; }
    .page-header > a.btn { width: 100%; justify-content: center; }

    /* Login */
    .lp-left { padding: 20px 16px; }
    .lp-right { padding: 20px 16px; }
    .lp-logo { width: 52px; height: 52px; font-size: 22px; margin-bottom: 14px; }
    .lp-title { font-size: 20px; margin-bottom: 10px; }
    .lp-sub { display: none; }
    .lp-features { gap: 6px; }
    .lp-feat { padding: 8px 10px; font-size: 11px; gap: 6px; }
    .lp-feat i { font-size: 14px; }
    .lp-card-head { margin-bottom: 20px; }
    .lp-card-head h2 { font-size: 20px; }

    /* Forms — prevent iOS zoom + stack */
    .form-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .form-card { padding: 16px; max-width: 100%; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }
    .form-control, .input-wrapper input,
    select.form-control, textarea.form-control { font-size: 16px; }

    /* Class grid */
    .class-grid { grid-template-columns: minmax(0, 1fr); }

    /* Profile */
    .profile-details-grid { grid-template-columns: minmax(0, 1fr); }
    .profile-view-header { flex-direction: column; text-align: center; gap: 12px; padding: 20px; }
    .svp-fields { grid-template-columns: minmax(0, 1fr); }
    .svp-layout { gap: 14px; }
    .svp-section-header { padding: 14px 16px; }
    .svp-field { padding: 12px 16px; }
    .svp-class-item { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .svp-class-meta { flex-basis: 100%; display: flex; align-items: center; gap: 8px; text-align: left; padding-left: 50px; }
    /* Photo card — compact at small mobile */
    .svp-photo-card { grid-template-columns: 90px minmax(0, 1fr); }
    .svp-photo-wrap { width: 90px; }
    .svp-photo-initials { font-size: 36px; }
    .svp-photo-name { padding: 14px 14px 2px; font-size: 14px; }
    .svp-photo-id { padding: 2px 14px 5px; }
    .svp-status-wrap { padding: 0 14px 10px; }

    /* Cards */
    .card-body { padding: 14px; }
    .card-header { padding: 12px 14px; }
    .empty-card { padding: 40px 20px; }

    /* Summary card */
    .student-summary-card { padding: 16px; gap: 12px; }
    .summary-avatar { width: 64px; height: 64px; }
    .summary-info h2 { font-size: 16px; }
    .stat-num { font-size: 26px; }
    .class-list-item { padding: 12px 14px; gap: 12px; }

    /* Buttons */
    .btn { min-height: 40px; }
    .btn-sm { min-height: 34px; }

    /* Modals */
    .cpw-modal { padding: 28px 20px 24px; }
    .svp-modal { padding: 8px; }

    /* Tables → card layout on mobile */
    .table-responsive { overflow-x: unset; }
    .data-table { border: none; }
    .data-table thead { display: none; }
    .data-table tbody tr {
        display: block;
        background: white;
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--gray-100);
        overflow: hidden;
    }
    .data-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 14px;
        border-bottom: 1px solid var(--gray-50);
        font-size: 13px;
        min-height: 44px;
    }
    .data-table td:last-child { border-bottom: none; }
    .data-table td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: var(--gray-500);
        flex-shrink: 0;
        min-width: 64px;
    }
    .data-table td[data-label='']::before { display: none; }
}

/* ============================================
   RESPONSIVE — EXTRA SMALL (≤400px)
   ============================================ */
@media (max-width: 400px) {
    .main-content { padding: 58px 8px 16px; }
    .stats-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .lp-features { grid-template-columns: minmax(0, 1fr); }
    .lp-left { padding: 14px 12px; }
    .lp-right { padding: 14px 12px; }
    .cpw-modal { padding: 20px 14px; }
}

/* ============================================
   STUDENT VIEW PROFILE  (view_student.php)
   ============================================ */
.svp-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}

/* ── Left sidebar: photo card ── */
.svp-photo-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    text-align: center;
}

.svp-photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 300px;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.svp-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.svp-photo-initials {
    font-size: 88px;
    font-weight: 800;
    color: var(--primary);
    opacity: .35;
    line-height: 1;
    user-select: none;
}

.svp-photo-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    padding: 18px 20px 4px;
    line-height: 1.3;
}

.svp-photo-id {
    font-size: 13px;
    color: var(--gray-500);
    padding: 4px 20px 14px;
    font-family: monospace;
    letter-spacing: .5px;
}

.svp-photo-id i { color: var(--primary); margin-right: 5px; }

.svp-status-wrap {
    padding: 0 20px 14px;
}

.svp-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.svp-status i { font-size: 8px; }

.svp-status-active  { background: #dcfce7; color: #15803d; }
.svp-status-pending { background: #fef9c3; color: #92400e; }

.svp-member-since {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    padding: 12px 20px;
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.svp-member-since i { color: var(--primary); }

/* ── Right: detail sections ── */
.svp-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.svp-section-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.svp-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.svp-section-header i {
    width: 28px;
    height: 28px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.svp-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 8px 0;
}

.svp-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--gray-50);
}

.svp-field:nth-last-child(-n+2):not(.svp-field-full) { border-bottom: none; }

.svp-field-full {
    grid-column: 1 / -1;
    border-bottom: none;
}

.svp-field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.svp-field-label i { color: var(--primary); }

.svp-field-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
}

.svp-age {
    font-size: 12px;
    color: var(--gray-500);
    margin-left: 6px;
}

.svp-empty { color: var(--gray-400, #9ca3af); font-style: italic; font-weight: 400; }

.svp-cred {
    display: inline-block;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 3px 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    letter-spacing: .4px;
}

.svp-cred-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.svp-pw-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 14px;
    padding: 3px 5px;
    border-radius: 5px;
    transition: var(--transition);
    line-height: 1;
}
.svp-pw-toggle:hover { color: var(--primary); background: var(--primary-light); }

.svp-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.svp-link:hover { text-decoration: underline; }

/* Enrolled classes list inside section */
.svp-class-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--gray-50);
    grid-column: 1 / -1;
}

.svp-class-item:last-child { border-bottom: none; }

.svp-class-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.svp-class-info { flex: 1; }
.svp-class-info strong { display: block; font-size: 14px; color: var(--gray-900); }
.svp-class-info span  { font-size: 12px; color: var(--gray-500); }

.svp-class-meta { text-align: right; }
.svp-class-meta small { display: block; font-size: 12px; color: var(--gray-400, #9ca3af); margin-top: 4px; }

/* Clickable photo */
.svp-photo-clickable {
    cursor: zoom-in;
    position: relative;
    transition: opacity .2s;
}
.svp-photo-clickable::after {
    content: '\f00e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    background: rgba(0,0,0,.0);
    transition: background .2s;
    pointer-events: none;
}
.svp-photo-clickable:hover::after { background: rgba(0,0,0,.35); }

/* Photo modal */
.svp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.85);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.svp-modal.active { display: flex; }

.svp-modal-inner {
    position: relative;
    max-width: min(680px, 95vw);
    max-height: 92vh;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,.6);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.svp-modal-inner img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.svp-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    border: 1.5px solid rgba(255,255,255,.25);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background .2s;
}
.svp-modal-close:hover { background: rgba(255,255,255,.2); }

.svp-modal-caption {
    width: 100%;
    padding: 12px 20px;
    background: rgba(0,0,0,.6);
    color: rgba(255,255,255,.8);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ============================================
   SVP RESPONSIVE — placed after base SVP styles
   so they correctly override them in the cascade
   ============================================ */
@media (max-width: 1024px) {
    .svp-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 768px) {
    .svp-layout { grid-template-columns: minmax(0, 1fr); }
    /* Photo card → horizontal strip */
    .svp-photo-card { display: grid; grid-template-columns: 130px minmax(0, 1fr); text-align: left; }
    .svp-photo-wrap { grid-column: 1; grid-row: 1 / span 3; width: 130px; max-height: none; aspect-ratio: unset; border-radius: 0; align-self: stretch; }
    .svp-photo-initials { font-size: 52px; }
    .svp-photo-name { padding: 16px 16px 3px; font-size: 15px; }
    .svp-photo-id { padding: 3px 16px 6px; }
    .svp-status-wrap { padding: 0 16px 12px; }
    .svp-member-since { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 640px) {
    .svp-fields { grid-template-columns: minmax(0, 1fr); }
    .svp-layout { gap: 14px; }
    .svp-section-header { padding: 14px 16px; }
    .svp-field { padding: 12px 16px; }
    .svp-class-item { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .svp-class-meta { flex-basis: 100%; display: flex; align-items: center; gap: 8px; text-align: left; padding-left: 50px; }
    /* Photo card — compact at small mobile */
    .svp-photo-card { grid-template-columns: 90px minmax(0, 1fr); }
    .svp-photo-wrap { width: 90px; }
    .svp-photo-initials { font-size: 36px; }
    .svp-photo-name { padding: 14px 14px 2px; font-size: 14px; }
    .svp-photo-id { padding: 2px 14px 5px; }
    .svp-status-wrap { padding: 0 14px 10px; }
}

/* =============================================
   STUDENT LIST (class_students.php)
   ============================================= */
.sl-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 20px;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-100);
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .6px;
}
.sl-col-num    { width: 24px; flex-shrink: 0; text-align: center; }
.sl-col-av     { width: 42px; flex-shrink: 0; }
.sl-col-name   { flex: 1; }
.sl-col-status { width: 76px; flex-shrink: 0; }
.sl-col-actions{ width: 104px; flex-shrink: 0; text-align: right; }

.sl-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background .15s;
}
.sl-item:last-child { border-bottom: none; }
.sl-item:hover { background: var(--gray-50); }

.sl-num {
    width: 24px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-300);
    text-align: center;
}

.sl-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.sl-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.sl-info { flex: 1; min-width: 0; }
.sl-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sl-meta {
    display: flex;
    gap: 14px;
    margin-top: 3px;
    flex-wrap: wrap;
}
.sl-id, .sl-email {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}
.sl-id  { font-family: monospace; }
.sl-id i, .sl-email i { font-size: 10px; color: var(--gray-400); }

.sl-status  { width: 76px;  flex-shrink: 0; }
.sl-actions { width: 104px; flex-shrink: 0; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.sl-btn-label { font-size: 12px; }

/* Student List — Responsive */
@media (max-width: 1024px) {
    .sl-email { display: none; }
    .sl-col-actions { width: 80px; }
    .sl-actions { width: 80px; }
}
@media (max-width: 768px) {
    .sl-header { display: none; }
    .sl-item { padding: 11px 16px; gap: 10px; }
    .sl-btn-label { display: none; }
    .sl-actions { width: auto; }
    .sl-col-actions { width: auto; }
    /* Card-header search box stretches on narrow screens */
    .students-panel .card-header { flex-wrap: wrap; gap: 10px; }
    .students-panel .search-box { width: 100%; }
    .students-panel .search-box input,
    .students-panel .search-box input:focus { width: 100%; }
}
@media (max-width: 640px) {
    .sl-num     { display: none; }
    .sl-col-num { display: none; }
    .sl-col-av  { display: none; }
    .sl-avatar  { width: 36px; height: 36px; font-size: 13px; }
    .sl-name    { font-size: 13px; }
    .sl-status  { width: auto; }
}
