@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --navy: #0f172a;
    --sidebar: #101c36;
    --sidebar-soft: #182747;
    --surface: #ffffff;
    --background: #f4f7fb;
    --text: #172033;
    --muted: #718096;
    --border: #e6ebf3;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --shadow: 0 14px 35px rgba(15, 23, 42, .07);
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    font-family: "Cairo", sans-serif;
    color: var(--text);
    background: var(--background);
    margin: 0;
}

a { text-decoration: none; }

.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 11px;
    min-height: 46px;
    box-shadow: none !important;
}

.form-control:focus, .form-select:focus {
    border-color: rgba(37, 99, 235, .65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .08) !important;
}

.btn {
    border-radius: 11px;
    font-weight: 700;
    padding: .65rem 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    border-color: var(--primary);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 275px;
    flex: 0 0 275px;
    background: linear-gradient(180deg, var(--sidebar), #0d1730);
    color: white;
    min-height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
}

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

.brand-mark {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    font-size: 20px;
    box-shadow: 0 8px 22px rgba(59,130,246,.3);
}

.sidebar-brand strong {
    display: block;
    font-size: 14px;
    line-height: 1.5;
    max-width: 175px;
}

.sidebar-brand small {
    display: block;
    color: #9fb0d0;
    font-size: 10px;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 18px 12px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-nav a {
    color: #b7c5df;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 5px;
    border-radius: 12px;
    font-size: 14px;
    transition: .2s ease;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    color: #fff;
    background: var(--sidebar-soft);
    transform: translateX(-2px);
}

.sidebar-nav a.active {
    box-shadow: inset -3px 0 0 #60a5fa;
}

.sidebar-nav i { width: 22px; text-align: center; }

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 15px 8px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: #9fb0d0;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34,197,94,.12);
}

.main-area {
    margin-right: 275px;
    width: calc(100% - 275px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 84px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.sidebar-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    display: none;
}

.topbar-title { flex: 1; }

.topbar-title h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.topbar-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.user-menu img, .avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
}

.avatar-placeholder {
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, #64748b, #334155);
    font-weight: 800;
}

.content-area {
    padding: 26px;
    flex: 1;
}

.app-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-size: 12px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.form-panel { padding: 24px; }

.panel-header {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 { margin: 0; font-size: 17px; font-weight: 800; }
.panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.welcome-panel {
    background:
        radial-gradient(circle at 12% 10%, rgba(96,165,250,.35), transparent 28%),
        linear-gradient(135deg, #172554, #1e3a8a 62%, #2563eb);
    color: white;
    padding: 28px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    box-shadow: 0 18px 35px rgba(30,64,175,.18);
}

.welcome-panel .eyebrow { color: #bfdbfe; font-size: 13px; }
.welcome-panel h2 { font-size: 26px; font-weight: 800; margin: 6px 0; }
.welcome-panel p { margin: 0; color: #dbeafe; }

.welcome-year {
    min-width: 220px;
    padding: 17px;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.09);
    border-radius: 16px;
    backdrop-filter: blur(7px);
}

.welcome-year span, .welcome-year small { display: block; color: #bfdbfe; font-size: 12px; }
.welcome-year strong { display: block; font-size: 20px; margin: 5px 0; }
.welcome-year a { color: white; font-weight: 700; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 17px;
    display: flex;
    align-items: center;
    gap: 13px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 19px;
}

.icon-blue { background: #dbeafe; color: #2563eb; }
.icon-green { background: #dcfce7; color: #16a34a; }
.icon-purple { background: #ede9fe; color: #7c3aed; }
.icon-orange { background: #ffedd5; color: #ea580c; }
.icon-teal { background: #ccfbf1; color: #0f766e; }

.stat-card span { color: var(--muted); font-size: 11px; display: block; }
.stat-card strong { display: block; font-size: 24px; margin-top: 2px; }

.timeline { padding: 10px 22px 20px; }
.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 16px 1fr auto;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
}
.timeline-item:last-child { border: 0; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); margin-top: 6px; }
.timeline-item strong { font-size: 13px; }
.timeline-item p, .timeline-item time { color: var(--muted); font-size: 11px; margin: 3px 0 0; }

.release-list { padding: 15px 22px 22px; }
.release-list div { display: flex; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.release-list i { color: var(--success); }
.release-list .pending { color: var(--muted); }
.release-list .pending i { color: var(--muted); }

.modern-table { margin: 0; }
.modern-table thead th {
    background: #f8fafc;
    color: #64748b;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    padding: 14px 16px;
    white-space: nowrap;
}
.modern-table td {
    padding: 14px 16px;
    border-color: #eef2f7;
    font-size: 13px;
    vertical-align: middle;
}
.modern-table tbody tr:hover { background: #fbfdff; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell small { display: block; color: var(--muted); margin-top: 2px; }
.table-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #e0e7ff;
    color: #4338ca;
    font-weight: 800;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    min-width: min(100%, 440px);
}
.search-form > i { position: absolute; right: 14px; color: var(--muted); z-index: 2; }
.search-form .form-control { padding-right: 40px; }

.empty-state { padding: 35px; text-align: center; color: var(--muted); }
.empty-state i { font-size: 34px; margin-bottom: 10px; }
.empty-state p { margin: 0; }

.form-section-title {
    font-weight: 800;
    color: #1e3a8a;
    border-right: 4px solid var(--primary);
    padding-right: 10px;
    margin-bottom: 17px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.role-choice-grid, .permission-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.choice-card, .permission-item {
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: .2s ease;
}

.choice-card:has(input:checked), .permission-item:has(input:checked) {
    border-color: #93c5fd;
    background: #eff6ff;
}

.choice-card input, .permission-item input { margin-top: 4px; }
.choice-card strong, .permission-item strong { display: block; font-size: 13px; }
.choice-card small, .permission-item small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }

.role-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    height: 100%;
    box-shadow: var(--shadow);
}
.role-card-head { display: flex; justify-content: space-between; align-items: center; }
.role-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #4f46e5; background: #eef2ff; }
.role-card h3 { font-size: 17px; margin: 15px 0 5px; }
.role-card code { font-size: 11px; }
.role-card p { color: var(--muted); font-size: 12px; min-height: 38px; margin: 12px 0; }
.role-metrics { display: flex; gap: 18px; font-size: 12px; color: var(--muted); }
.role-metrics strong { color: var(--text); }

.permission-group { border: 1px solid var(--border); border-radius: 15px; margin-bottom: 15px; overflow: hidden; }
.permission-group h4 { font-size: 14px; background: #f8fafc; padding: 12px 15px; margin: 0; border-bottom: 1px solid var(--border); }
.permission-grid { padding: 13px; }

.upload-card { border: 1px dashed #cbd5e1; padding: 15px; border-radius: 15px; height: 100%; }
.upload-preview { height: 130px; border-radius: 12px; background: #f8fafc; display: grid; place-items: center; margin-bottom: 12px; overflow: hidden; color: #94a3b8; font-size: 30px; }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.upload-card small { display: block; color: var(--muted); margin-top: 7px; font-size: 10px; }

.position-list { max-height: 460px; overflow: auto; }
.position-item { display: grid; grid-template-columns: 1fr 64px 38px 38px; gap: 7px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.sort-input { text-align: center; }
.mini-switch input { display: none; }
.mini-switch span { width: 34px; height: 19px; background: #cbd5e1; display: block; border-radius: 20px; position: relative; cursor: pointer; }
.mini-switch span::after { content: ""; width: 13px; height: 13px; background: white; border-radius: 50%; position: absolute; top: 3px; right: 3px; transition: .2s; }
.mini-switch input:checked + span { background: var(--success); }
.mini-switch input:checked + span::after { transform: translateX(-15px); }

.profile-head { display: flex; align-items: center; gap: 15px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.profile-head h3 { margin: 0; }
.profile-head p { color: var(--muted); margin: 4px 0 0; }
.profile-avatar-large { width: 82px; height: 82px; border-radius: 22px; overflow: hidden; background: #e0e7ff; color: #4338ca; display: grid; place-items: center; font-size: 30px; font-weight: 800; }
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.info-list div { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.info-list span { color: var(--muted); font-size: 12px; }
.info-list strong { font-size: 12px; text-align: left; }

.audit-json { width: min(620px, 70vw); margin-top: 10px; background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 12px; direction: ltr; text-align: left; }
.audit-json pre { white-space: pre-wrap; font-size: 11px; margin: 5px 0 12px; color: #bfdbfe; }

.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #eff6ff, #f8fafc 45%, #eef2ff);
    display: grid;
    place-items: center;
    padding: 25px;
    position: relative;
    overflow-x: hidden;
}

.auth-decoration { position: fixed; border-radius: 50%; filter: blur(2px); opacity: .45; }
.auth-decoration-one { width: 360px; height: 360px; background: #bfdbfe; top: -140px; right: -100px; }
.auth-decoration-two { width: 300px; height: 300px; background: #ddd6fe; bottom: -120px; left: -100px; }

.auth-wrapper { width: min(100%, 540px); position: relative; z-index: 2; }

.auth-card, .install-card {
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 70px rgba(30,41,59,.12);
    backdrop-filter: blur(16px);
}

.install-card { width: min(94vw, 820px); margin-inline: calc((540px - min(94vw, 820px))/2); }
.install-header { display: flex; gap: 16px; align-items: center; margin-bottom: 25px; }
.install-header h1 { font-size: 22px; margin: 0 0 5px; font-weight: 800; }
.install-header p { color: var(--muted); margin: 0; }

.auth-logo { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #1d4ed8, #60a5fa); font-size: 28px; box-shadow: 0 14px 30px rgba(37,99,235,.25); margin: 0 auto 18px; }
.install-header .auth-logo { margin: 0; flex: 0 0 auto; }
.auth-card h1 { font-size: 22px; font-weight: 800; }
.auth-card p { color: var(--muted); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; top: 15px; right: 15px; color: #94a3b8; }
.input-icon .form-control { padding-right: 43px; }
.password-toggle { position: absolute; left: 10px; top: 8px; border: 0; background: transparent; color: #64748b; width: 34px; height: 30px; }
.auth-note { color: var(--muted); background: #f8fafc; border-radius: 12px; padding: 12px; font-size: 11px; margin-top: 18px; text-align: center; }
.requirements-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.requirement { padding: 11px; border-radius: 11px; display: flex; gap: 8px; align-items: center; font-size: 12px; }
.requirement.passed { background: #f0fdf4; color: #15803d; }
.requirement.failed { background: #fef2f2; color: #b91c1c; }

.error-page { min-height: 60vh; display: grid; place-items: center; align-content: center; text-align: center; gap: 10px; padding: 30px; }
.error-code { font-size: 82px; font-weight: 800; line-height: 1; color: #cbd5e1; }
.error-page h1 { font-size: 25px; margin: 0; }
.error-page p { color: var(--muted); }

.sidebar-overlay { display: none; }

@media (max-width: 1199.98px) {
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-right: 0; width: 100%; }
    .sidebar-toggle { display: inline-grid; place-items: center; }
    .sidebar-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1025; }
    .sidebar-overlay.show { display: block; }
    .role-choice-grid, .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .content-area { padding: 15px; }
    .topbar { padding: 0 14px; height: 74px; }
    .topbar-title h1 { font-size: 16px; }
    .topbar-title p { display: none; }
    .welcome-panel { align-items: stretch; flex-direction: column; padding: 21px; }
    .welcome-panel h2 { font-size: 21px; }
    .welcome-year { min-width: auto; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel-header { padding: 16px; }
    .form-panel { padding: 17px; }
    .role-choice-grid, .permission-grid { grid-template-columns: 1fr; }
    .app-footer { flex-direction: column; text-align: center; }
    .requirements-grid { grid-template-columns: 1fr; }
    .install-card { margin-inline: 0; padding: 20px; }
    .install-header { align-items: flex-start; }
    .search-form { min-width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .auth-body { padding: 12px; }
    .auth-card { padding: 22px 18px; }
    .position-item { grid-template-columns: 1fr 55px 34px 34px; }
}

@media print {
    .sidebar, .topbar, .app-footer, .sidebar-overlay, .btn, form { display: none !important; }
    .main-area { margin: 0; width: 100%; }
    .content-area { padding: 0; }
    .panel { box-shadow: none; border: 0; }
}

.signature-preview {
    height: 110px;
    border: 1px dashed var(--border);
    border-radius: 13px;
    background: #f8fafc;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.signature-preview img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 8px; }
.signature-link { margin-right: 7px; color: #7c3aed; }

/* V1.1 — Academic structure */
.academic-subnav {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    scrollbar-width: thin;
}
.academic-subnav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    white-space: nowrap;
    padding: 10px 13px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
}
.academic-subnav a:hover, .academic-subnav a.active {
    color: #1d4ed8;
    background: #eff6ff;
}
.academic-hero {
    background: linear-gradient(135deg, #0f172a, #1e3a8a 60%, #2563eb);
    color: #fff;
    border-radius: 22px;
    padding: 27px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    box-shadow: 0 18px 35px rgba(30,64,175,.16);
}
.academic-hero .eyebrow { color: #bfdbfe; font-size: 12px; }
.academic-hero h2 { margin: 5px 0 7px; font-size: 24px; font-weight: 800; }
.academic-hero p { margin: 0; color: #dbeafe; font-size: 13px; }
.academic-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.filter-bar { padding: 16px 22px; background: #fbfdff; border-bottom: 1px solid var(--border); }
.setup-steps { padding: 10px 22px 20px; }
.setup-steps > div { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--border); }
.setup-steps > div:last-child { border-bottom: 0; }
.setup-steps > div > span { width: 30px; height: 30px; border-radius: 10px; background: #dbeafe; color: #1d4ed8; display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.setup-steps p { margin: 0; }
.setup-steps strong, .setup-steps small { display: block; }
.setup-steps strong { font-size: 13px; }
.setup-steps small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.update-hero { display: flex; gap: 18px; align-items: center; padding: 20px; border-radius: 18px; background: #eff6ff; }
.update-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: #2563eb; color: #fff; font-size: 25px; flex: 0 0 auto; }
.update-hero span { color: var(--muted); font-size: 11px; }
.update-hero h2 { margin: 4px 0; font-size: 24px; font-weight: 800; }
.update-hero p { margin: 0; color: #64748b; font-size: 12px; }

@media (max-width: 1399.98px) {
    .academic-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .academic-hero { flex-direction: column; align-items: stretch; padding: 21px; }
    .academic-hero h2 { font-size: 20px; }
    .academic-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar { padding: 14px; }
    .update-hero { align-items: flex-start; }
}
@media (max-width: 480px) {
    .academic-stats { grid-template-columns: 1fr; }
    .update-hero { flex-direction: column; }
}

/* V1.2 — Students, credentials and configurable footer */
.student-cell { display: flex; align-items: center; gap: 11px; min-width: 245px; }
.student-cell img, .student-avatar-placeholder { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; flex: 0 0 auto; }
.student-avatar-placeholder { display: grid; place-items: center; color: #2563eb; background: #eff6ff; font-size: 18px; }
.student-cell strong, .student-cell small { display: block; }
.student-cell small { color: var(--muted); font-size: 10px; margin-top: 3px; direction: ltr; text-align: right; }
.student-photo-upload .upload-preview { height: 220px; }
.student-photo-upload .upload-preview img { object-fit: cover; padding: 0; }
.student-profile-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; }
.student-profile-card { padding: 25px; text-align: center; }
.student-profile-photo { width: 145px; height: 165px; margin: 0 auto 16px; border-radius: 24px; background: #eff6ff; color: #2563eb; display: grid; place-items: center; overflow: hidden; font-size: 50px; }
.student-profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.student-profile-card h2 { font-size: 19px; font-weight: 800; margin: 0 0 10px; line-height: 1.7; }
.student-profile-actions { margin-top: 22px; display: flex; gap: 8px; justify-content: center; }
.details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.details-grid > div { padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: #fbfdff; }
.details-grid > div.wide { grid-column: span 2; }
.details-grid span, .details-grid strong { display: block; }
.details-grid span { color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.details-grid strong { font-size: 12px; line-height: 1.7; }
.credential-panel { background: linear-gradient(180deg, #fff, #f8fbff); }
.credential-display { border: 1px solid var(--border); border-radius: 15px; overflow: hidden; margin-bottom: 14px; }
.credential-display > div { display: flex; justify-content: space-between; gap: 15px; padding: 13px 14px; border-bottom: 1px solid var(--border); align-items: center; }
.credential-display > div:last-child { border-bottom: 0; }
.credential-display span { color: var(--muted); font-size: 11px; }
.credential-display code, .initial-credential-box code { font-size: 14px; direction: ltr; }
.credential-secret { background: #0f172a; color: #fef08a !important; padding: 6px 10px; border-radius: 9px; font-size: 17px !important; letter-spacing: 2px; }
.footer-preview { background: #0f172a; color: #e2e8f0; border-radius: 15px; padding: 17px; display: flex; justify-content: space-between; gap: 15px; }
.auth-footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; gap: 15px; padding: 12px 24px; color: #64748b; font-size: 11px; background: rgba(255,255,255,.72); border-top: 1px solid rgba(226,232,240,.85); backdrop-filter: blur(12px); }
.student-access-link { display: flex; align-items: center; justify-content: center; margin-top: 14px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; padding: 11px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.student-access-card { width: min(100%, 560px); }
.initial-credential-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 16px; border: 1px solid #bfdbfe; background: #eff6ff; padding: 17px; border-radius: 15px; margin-bottom: 15px; }
.initial-credential-box span { color: #64748b; font-size: 11px; }
.initial-credential-box strong { font-size: 13px; }
.success-icon { width: 82px; height: 82px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: #dcfce7; color: #16a34a; font-size: 40px; }

@media (max-width: 991.98px) {
    .student-profile-grid { grid-template-columns: 1fr; }
    .student-profile-card { display: grid; grid-template-columns: 105px 1fr; text-align: right; column-gap: 17px; align-items: center; }
    .student-profile-photo { width: 105px; height: 120px; grid-row: span 3; margin: 0; }
    .student-profile-actions { justify-content: flex-start; margin-top: 8px; }
}
@media (max-width: 767.98px) {
    .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-footer, .footer-preview { flex-direction: column; text-align: center; gap: 4px; }
    .auth-body { padding-bottom: 78px; }
}
@media (max-width: 480px) {
    .details-grid { grid-template-columns: 1fr; }
    .details-grid > div.wide { grid-column: auto; }
    .student-profile-card { display: block; text-align: center; }
    .student-profile-photo { margin: 0 auto 15px; width: 125px; height: 145px; }
    .student-profile-actions { justify-content: center; }
    .initial-credential-box { grid-template-columns: 1fr; text-align: center; }
}

/* V1.3.1 — Student photo sizing and profile layout hotfix */
.student-profile-grid,
.student-profile-card,
.student-profile-card > *,
.details-grid,
.details-grid > div,
.student-cell,
.student-cell > div {
    min-width: 0;
}

.student-profile-card,
.student-photo-upload,
.student-profile-photo,
.student-photo-upload .upload-preview {
    overflow: hidden;
}

.student-profile-photo,
.student-photo-upload .upload-preview {
    position: relative;
    isolation: isolate;
}

.student-profile-photo img,
.student-photo-upload .upload-preview img,
.student-cell img.student-photo-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    object-position: center 18%;
}

.student-cell img.student-photo-image {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px;
    min-height: 46px;
}

.student-profile-photo {
    flex: 0 0 auto;
    aspect-ratio: 29 / 33;
}

.student-profile-card h2,
.student-cell strong,
.details-grid strong,
.credential-display strong,
.credential-display code {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.student-profile-actions {
    flex-wrap: wrap;
}

@media (max-width: 991.98px) {
    .student-profile-card h2,
    .student-profile-card .badge,
    .student-profile-actions {
        min-width: 0;
    }
}

/* V1.4 Employees and teachers */
.filter-bar { padding: 18px 22px; border-bottom: 1px solid var(--border); background: #fbfdff; }
.employee-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.employee-cell img, .employee-avatar { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 46px; object-fit: cover; object-position: center top; }
.employee-avatar { display: grid; place-items: center; background: #e0e7ff; color: #4338ca; }
.employee-avatar.large { width: 58px; height: 58px; flex-basis: 58px; font-size: 22px; }
.employee-cell strong { display: block; font-size: 13px; }
.employee-cell small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.pagination-wrap { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 18px 22px; border-top: 1px solid var(--border); }
.employee-photo-preview { height: 250px !important; border-radius: 16px; overflow: hidden; background: #f3f6fb; }
.employee-photo-preview img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.teacher-toggle-card { padding: 20px; border: 1px solid #c7d2fe; background: #f5f7ff; border-radius: 16px; }
.employee-profile-hero { padding: 24px; display: grid; grid-template-columns: 110px 1fr auto; gap: 22px; align-items: center; overflow: visible; }
.employee-profile-photo { width: 110px; height: 125px; border-radius: 20px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg,#e0e7ff,#dbeafe); color: #4338ca; font-size: 36px; box-shadow: 0 10px 24px rgba(30,64,175,.12); }
.employee-profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.employee-profile-main .eyebrow { font-size: 11px; color: var(--muted); }
.employee-profile-main h2 { font-size: 24px; font-weight: 800; margin: 5px 0; }
.employee-profile-main p { color: var(--muted); margin-bottom: 12px; }
.employee-profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.details-grid { padding: 22px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.details-grid > div { padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: #fbfdff; min-width: 0; }
.details-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.details-grid strong { font-size: 13px; overflow-wrap: anywhere; }
.details-grid .details-wide { grid-column: span 4; }
.account-state { display: flex; gap: 13px; align-items: flex-start; padding: 16px; border-radius: 15px; }
.account-state i { font-size: 23px; margin-top: 2px; }
.account-state strong, .account-state span { display: block; }
.account-state span { font-size: 12px; margin-top: 5px; }
.account-state.success { background: #ecfdf5; color: #166534; }
.account-state.warning { background: #fff7ed; color: #9a3412; }
.account-employee-summary { display: flex; align-items: center; gap: 14px; padding: 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 15px; }
.account-employee-summary strong, .account-employee-summary span { display: block; }
.account-employee-summary span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.assignment-permissions { display: flex; flex-wrap: wrap; gap: 28px; padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: #fbfdff; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; border: 1px solid #fecaca; background: #fff7f7; border-radius: 17px; }
.danger-zone p { color: #991b1b; font-size: 12px; margin: 5px 0 0; }

@media (max-width: 992px) {
    .employee-profile-hero { grid-template-columns: 90px 1fr; }
    .employee-profile-photo { width: 90px; height: 105px; }
    .employee-profile-actions { grid-column: 1 / -1; }
    .details-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .details-grid .details-wide { grid-column: span 2; }
}
@media (max-width: 576px) {
    .employee-profile-hero { grid-template-columns: 1fr; text-align: center; }
    .employee-profile-photo { margin: auto; }
    .employee-profile-actions { justify-content: center; }
    .details-grid { grid-template-columns: 1fr; padding: 15px; }
    .details-grid .details-wide { grid-column: span 1; }
    .danger-zone, .pagination-wrap { flex-direction: column; align-items: stretch; }
}

/* V11.0.15 — sidebar functional grouping */
.sidebar-section-title {
    margin: .9rem .85rem .35rem;
    padding-top: .65rem;
    border-top: 1px solid rgba(148, 163, 184, .16);
    color: rgba(226, 232, 240, .62);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.sidebar-nav > .sidebar-section-title:first-of-type {
    margin-top: .35rem;
    border-top: 0;
    padding-top: .2rem;
}
