/* updated 7-26-2026*/
:root {
    --ink: #122033;
    --muted: #667085;
    --line: #e6eaf0;
    --bg: #f6f8fb;
    --primary: #2f6f4e;
    --primary-dark: #23553b;
    --green: #3d8b61;
    --orange: #e9822b;
    --panel: #ffffff;
    --shadow: 0 18px 45px rgba(18, 32, 51, .08);
}

/* Final sidebar theme overrides. */
.app-shell { grid-template-columns: 250px 1fr; }
.sidebar { background: #f1f4f2; color: #46535c; border-right: 1px solid #d9e1dc; padding: 28px 18px; }
.brand { color: #087f5b; margin: 0 10px 22px; gap: 9px; }
.brand-mark img { width: 34px; height: 34px; }
.brand small { color: #9aa3ad; font-size: .68rem; }
.sidebar-profile { display: flex; align-items: center; gap: 9px; padding: 10px 9px; margin: 0 0 22px; background: #fff; border: 1px solid #e8ebef; border-radius: 10px; box-shadow: 0 5px 15px rgba(32,42,56,.05); }
.sidebar-profile-avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: #69a89a; font-size: .8rem; font-weight: 700; }
.sidebar-profile span:nth-child(2) { min-width: 0; display: grid; line-height: 1.15; }
.sidebar-profile strong { overflow: hidden; color: #26333d; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile small { margin-top: 3px; color: #9aa3ad; font-size: .65rem; }
.sidebar-profile > i { margin-left: auto; color: #7d8790; font-size: .9rem; }
.sidebar .nav { gap: 2px; }
.sidebar .nav-link { min-height: 38px; padding: 8px 10px; gap: 11px; color: #52616a; border-radius: 8px; font-size: .8rem; font-weight: 500; }
.sidebar .nav-link i { width: 16px; color: #71808a; font-size: .95rem; text-align: center; }
.sidebar .nav-link:hover { color: #174d36; background: #dcebe2; }
.sidebar .nav-link.active { color: #fff; background: #176b47; box-shadow: 0 5px 12px rgba(23,107,71,.18); }
.sidebar .nav-link.active i { color: #fff; }
.nav-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e8ebef; }
.sidebar .nav-submenu { margin-left: 16px; padding-left: 10px; border-left-color: #dfe4e8; }
.sidebar .nav-sub-link { min-height: 32px; color: #818b94; font-size: .74rem; }
.sidebar .nav-sub-link:hover { color: #174d36; background: #dcebe2; }
.sidebar .nav-sub-link.active { color: #fff; background: #176b47; }

/* Keep the selected sidebar item dark green, including the current page. */
.app-shell .sidebar .nav-link.active,
.app-shell .sidebar .nav-group-toggle.active,
.app-shell .sidebar .nav-sub-link.active {
    color: #fff !important;
    background: #145a3b !important;
    border-color: #145a3b !important;
    box-shadow: 0 6px 14px rgba(20, 90, 59, .22);
}
.app-shell .sidebar .nav-link.active i,
.app-shell .sidebar .nav-group-toggle.active i {
    color: #fff !important;
}

/* Small navigation and content motion. */
.main-panel {
    animation: none;
}
.sidebar .nav-link {
    transition: background-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.sidebar .nav-link:active {
    transform: translateX(3px) scale(.985);
}
.sidebar .nav-link.active {
    animation: activeNavIn .2s ease-out both;
}
@keyframes contentFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes activeNavIn {
    from { transform: translateX(-4px); }
    to { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
    .main-panel, .sidebar .nav-link.active { animation: none; }
    .sidebar .nav-link { transition: none; }
}

/* Improve sidebar text contrast. */
.app-shell .sidebar .nav-link,
.app-shell .sidebar .nav-group-toggle {
    color: #34434d;
    font-weight: 500;
}
.app-shell .sidebar .nav-link.active,
.app-shell .sidebar .nav-group-toggle.active {
    font-weight: 600;
}
.app-shell .sidebar .nav-link i,
.app-shell .sidebar .nav-group-toggle i {
    color: #52636d;
}
.app-shell .sidebar .nav-sub-link {
    color: #465761;
    font-weight: 500;
}
.app-shell .sidebar .brand small,
.app-shell .sidebar .sidebar-profile small {
    color: #687780;
}

/* Compact, consistent typography for tables and module controls. */
.main-panel .table,
.main-panel .dataTable {
    font-size: .82rem;
}
.main-panel .table thead th,
.main-panel .dataTable thead th {
    color: #52616a;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .035em;
    vertical-align: middle;
}
.main-panel .table tbody td,
.main-panel .dataTable tbody td {
    color: #26343d;
    font-size: .82rem;
    vertical-align: middle;
}
.main-panel .table small,
.main-panel .dataTable small {
    font-size: .72rem;
}
.main-panel .dataTables_length,
.main-panel .dataTables_filter,
.main-panel .dataTables_info,
.main-panel .dataTables_paginate,
.main-panel .dataTables_length label,
.main-panel .dataTables_filter label {
    font-size: .78rem;
    color: #61717a;
}
.main-panel .dataTables_filter input,
.main-panel .dataTables_length select {
    font-size: .78rem;
    min-height: 36px;
}
.main-panel .table .btn,
.main-panel .dataTable .btn,
.main-panel .panel .form-label {
    font-size: .78rem;
}
@media (min-width: 981px) { .student-shell { display: grid; grid-template-columns: 250px 1fr; } .student-shell .sidebar { display: block; } }

/* Compact two-step student form. */
#studentModal .modal-dialog { max-width: 860px; }
#studentModal .modal-body { padding-top: 12px; }
#studentModal .modal-content { max-height: calc(100vh - 1rem); overflow: hidden; }
#studentModal .modal-body { overflow-y: auto; }
#studentModal .student-modal-actions-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; padding-top: 14px; border-top: 1px solid #e5ece7; }
#studentModal .student-modal-footer-note { display: inline-flex; align-items: center; gap: 6px; color: #718078; font-size: .75rem; }
#studentModal .student-modal-footer-note i { color: #23704d; font-size: .9rem; }
#studentModal .student-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
#studentModal .student-modal-actions .btn { min-width: 94px; font-weight: 600; }
.student-stepper { display: flex; align-items: center; max-width: 180px; }
.student-stepper span { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #ccd6d1; border-radius: 50%; color: #728078; background: #fff; font-size: .75rem; font-weight: 700; }
.student-stepper span.active, .student-stepper span.complete { color: #fff; border-color: var(--primary); background: var(--primary); }
.student-stepper i { height: 2px; flex: 1; background: #dbe4df; }
.student-form-step .form-label { margin-bottom: .28rem; font-size: .8rem; }
.student-form-step .form-control, .student-form-step .form-select { min-height: 40px; padding: .45rem .7rem; }
.student-face-step-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.student-face-step-head h6 { margin: 3px 0 4px; font-size: 1rem; }
.student-face-step-head p { max-width: 520px; margin: 0; color: var(--muted); font-size: .82rem; }
.student-face-capture-step { grid-template-columns: minmax(0, 1fr) 220px; }
.student-face-capture-step .student-camera-frame { min-height: 280px; }
.student-face-tips { display: grid; align-content: start; gap: 8px; padding: 16px; border: 1px solid #d9e9df; border-radius: 8px; color: #365244; background: #f1faf4; font-size: .8rem; }
.student-face-tips > i { color: var(--primary); font-size: 1.1rem; }
.student-face-tips strong { color: #234534; }
.student-face-tips ul { margin: 0; padding-left: 18px; }
.student-face-tips small { color: #587063; line-height: 1.35; }
#studentViewModal .modal-dialog { max-width: 760px; }
#studentViewModal .modal-body { padding-top: 12px; }
#studentViewModal .face-image-grid { grid-template-columns: minmax(160px, 260px); }
.student-profile-header { align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #e5ece7; background: linear-gradient(135deg, #f4fbf6, #fff); }
.student-profile-avatar { width: 46px; height: 46px; display: grid; flex: 0 0 46px; place-items: center; border-radius: 50%; color: #fff; background: #24734f; box-shadow: 0 6px 14px rgba(36,115,79,.2); font-size: 1.1rem; font-weight: 800; }
.student-profile-title { min-width: 0; flex: 1; }
.student-profile-title .eyebrow { font-size: .62rem; }
.student-profile-title h5 { margin: 2px 0; font-size: 1.08rem; }
.student-profile-title small { color: #65756c; font-size: .76rem; }
.student-profile-status .badge { font-size: .7rem; }
#studentViewModal .modal-body { display: grid; gap: 14px; padding-top: 16px; }
.student-profile-section { padding: 14px; border: 1px solid #e2e9e4; border-radius: 8px; background: #fff; }
.student-profile-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.student-profile-section-head h6 { margin: 0; color: #243a2e; font-size: .88rem; }
.student-profile-section-head h6 i { margin-right: 6px; color: #23704d; }
.student-profile-section-head small { color: #738278; font-size: .7rem; }
.student-profile-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.student-profile-details > div { min-width: 0; padding: 9px 10px; border-radius: 7px; background: #f7faf8; }
.student-profile-details small, .student-profile-details strong { display: block; }
.student-profile-details small { margin-bottom: 3px; color: #718178; font-size: .64rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.student-profile-details strong { overflow-wrap: anywhere; color: #263b30; font-size: .8rem; }
.student-face-profile-section { background: #fbfdfc; }
#studentViewModal .face-image-grid figure { max-width: 230px; box-shadow: none; }
#studentViewModal .face-image-grid figcaption { font-size: .72rem; }
@media (max-width: 640px) {
    .student-profile-header { align-items: flex-start; flex-wrap: wrap; }
    .student-profile-status { order: 3; margin-left: 58px; }
    .student-profile-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    #studentModal .modal-dialog, #studentViewModal .modal-dialog { margin: .5rem; }
    #studentModal .student-modal-actions-row { align-items: stretch; flex-direction: column; }
    #studentModal .student-modal-actions { justify-content: stretch; }
    #studentModal .student-modal-actions .btn { flex: 1 1 auto; }
    .student-face-capture-step { grid-template-columns: 1fr; }
    .student-face-capture-step .student-camera-frame { min-height: 250px; }
    .student-face-step-head { display: block; }
    .student-face-step-head .badge { margin-top: 8px; }
}

/* Tighter inputs for the two-step student form. */
#studentModal .student-form-step .row.g-3 {
    --bs-gutter-y: .7rem;
}
#studentModal .student-form-step .form-label {
    margin-bottom: .2rem;
    font-size: .76rem;
}
#studentModal .student-form-step .form-control,
#studentModal .student-form-step .form-select {
    min-height: 36px !important;
    padding: .32rem .65rem !important;
    font-size: .86rem;
}
#studentModal .student-form-step .input-group .btn {
    min-height: 36px;
    padding: .32rem .65rem;
    font-size: .82rem;
}
#studentModal #studentPasswordNote {
    display: block;
    margin-top: .25rem;
    font-size: .68rem;
    line-height: 1.25;
}

/* Clear two-step progress UI in the student form. */
#studentModal .student-stepper {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e0e8e3;
    border-radius: 8px;
    background: #f8fbf9;
}
#studentModal .student-step {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7a8981;
}
#studentModal .student-step > span {
    width: 28px;
    height: 28px;
    display: grid;
    flex: 0 0 28px;
    place-items: center;
    border: 1px solid #cbd8d0;
    border-radius: 50%;
    color: #728078;
    background: #fff;
    font-size: .76rem;
    font-weight: 700;
}
#studentModal .student-step strong,
#studentModal .student-step small {
    display: block;
    line-height: 1.15;
}
#studentModal .student-step strong { font-size: .76rem; color: inherit; }
#studentModal .student-step small { margin-top: 2px; font-size: .66rem; color: #8b9891; }
#studentModal .student-step.active,
#studentModal .student-step.complete { color: #1f6948; }
#studentModal .student-step.active > span,
#studentModal .student-step.complete > span { border-color: #1f6948; color: #fff; background: #1f6948; }
#studentModal .student-step-line { height: 1px; min-width: 26px; flex: 1; background: #d8e3dc; }
#studentModal .student-step.complete + .student-step-line { background: #75ac8c; }
.attendance-grid { align-items: start; }
.attendance-guide-panel { align-self: start; }
.attendance-activity-list { gap: 8px; }
.attendance-activity-list > .attendance-activity { min-height: 66px; padding: 10px 12px; }
.attendance-activity-list .date-pill { width: 48px; min-width: 48px; padding: 6px 4px; font-size: .68rem; }
.attendance-activity-list .activity-copy strong { font-size: .84rem; }
.attendance-activity-list .activity-copy small { font-size: .73rem; }
.attendance-activity-list .js-attendance-activity-card { cursor: pointer; transition: border-color .16s ease, background-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.attendance-activity-list .js-attendance-activity-card:hover,
.attendance-activity-list .js-attendance-activity-card:focus-visible { border-color: #9fcab0; background: #f5fbf7; box-shadow: 0 5px 14px rgba(30, 91, 60, .1); outline: none; transform: translateY(-1px); }
.attendance-grid > article:first-child { align-self: start; }
#attendanceActivitiesModal .attendance-activity-list { padding: 2px; }
#attendanceActivitiesModal .attendance-activity-list > .attendance-activity { min-height: 62px; }
.student-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.student-review-grid > div { min-height: 74px; padding: 12px; border: 1px solid #e1e8e4; border-radius: 8px; background: #fbfdfc; }
.student-review-grid small, .student-review-grid strong { display: block; }
.student-review-grid small { margin-bottom: 5px; color: #718078; font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.student-review-grid strong { color: #263b30; font-size: .84rem; overflow-wrap: anywhere; }
.student-review-face { display: grid; grid-template-columns: minmax(0, 1fr) 148px; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border: 1px solid #e1e8e4; border-radius: 8px; background: #fbfdfc; }
.student-review-face small, .student-review-face strong { display: block; }
.student-review-face small { margin-bottom: 5px; color: #718078; font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.student-review-face strong { color: #263b30; font-size: .84rem; }
.student-review-face p { color: #718078; font-size: .78rem; }
.student-review-face img { width: 148px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 7px; background: #111827; }
@media (max-width: 520px) {
    #studentModal .student-stepper { gap: 7px; padding: 8px; }
    #studentModal .student-step small { display: none; }
    #studentModal .student-step strong { font-size: .7rem; }
    .student-review-grid { grid-template-columns: 1fr; }
    .student-review-face { grid-template-columns: 1fr; }
}

/* High-contrast active navigation. */
.sidebar { background: #f1f4f2; color: #46535c; border-right-color: #d9e1dc; }
.sidebar .nav-link { color: #52616a; }
.sidebar .nav-link:hover { color: #174d36; background: #dcebe2; }
.sidebar .nav-link.active { color: #fff; background: #176b47; box-shadow: 0 5px 12px rgba(23,107,71,.18); }
.sidebar .nav-link.active i { color: #fff; }
.sidebar .nav-sub-link.active { color: #fff; background: #176b47; }

/* Compact light navigation inspired by the reference UI. */
.sidebar {
    background: #f8f9fb;
    color: #53606d;
    border-right: 1px solid #e5e7eb;
    padding: 28px 18px;
}
.app-shell { grid-template-columns: 250px 1fr; }
.brand { color: #087f5b; margin: 0 10px 22px; gap: 9px; }
.brand-mark img { width: 34px; height: 34px; }
.brand span:last-child { font-size: 1.02rem; }
.brand small { color: #9aa3ad; font-size: .68rem; }
.sidebar-profile { display: flex; align-items: center; gap: 9px; padding: 10px 9px; margin: 0 0 22px; background: #fff; border: 1px solid #e8ebef; border-radius: 10px; box-shadow: 0 5px 15px rgba(32,42,56,.05); }
.sidebar-profile-avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: #69a89a; font-size: .8rem; font-weight: 700; }
.sidebar-profile span:nth-child(2) { min-width: 0; display: grid; line-height: 1.15; }
.sidebar-profile strong { overflow: hidden; color: #26333d; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile small { margin-top: 3px; color: #9aa3ad; font-size: .65rem; }
.sidebar-profile > i { margin-left: auto; color: #7d8790; font-size: .9rem; }
.sidebar .nav { gap: 2px; }
.sidebar .nav-link { min-height: 36px; padding: 8px 10px; gap: 11px; color: #66717b; border-radius: 7px; font-size: .78rem; font-weight: 500; }
.sidebar .nav-link i { width: 16px; color: #7d8790; font-size: .95rem; text-align: center; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { color: #17212b; background: #e9ebee; }
.sidebar .nav-link.active i { color: #17212b; }
.nav-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e8ebef; }
.nav-group-toggle { color: #66717b; }
.sidebar .nav-submenu { margin-left: 16px; padding-left: 10px; border-left-color: #dfe4e8; }
.sidebar .nav-sub-link { min-height: 32px; color: #818b94; font-size: .74rem; }
.sidebar .nav-sub-link:hover, .sidebar .nav-sub-link.active { color: #17212b; background: #e9ebee; }
@media (min-width: 981px) {
    .student-shell { display: grid; grid-template-columns: 250px 1fr; }
    .student-shell .sidebar { display: block; }
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { text-decoration: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; background: #173d2b; color: #fff; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; margin-bottom: 28px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.brand-mark img { width: 68px; height: 68px; object-fit: contain; }
.brand span:last-child { display: grid; line-height: 1.1; }
.brand small { color: #bdd6c7; font-size: .78rem; margin-top: 4px; }
.sidebar .nav { gap: 4px; }
.sidebar .nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; color: #dbe9df; border-radius: 8px; padding: 10px 12px; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { background: rgba(255,255,255,.11); color: #fff; }
.nav-logo-icon { width: 28px; height: 28px; object-fit: contain; }
.nav-group-toggle { width: 100%; border: 0; text-align: left; background: transparent; }
.nav-group-chevron { margin-left: auto; font-size: .78rem; transition: transform .18s ease; }
.nav-group-toggle[aria-expanded="true"] .nav-group-chevron { transform: rotate(180deg); }
.nav-submenu { display: grid; gap: 2px; margin: 4px 0 8px 34px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.18); }
.sidebar .nav-sub-link { min-height: 34px; padding: 7px 10px; font-size: .86rem; color: #bdd6c7; border-radius: 6px; }
.sidebar .nav-sub-link i { width: 16px; font-size: .84rem; opacity: .82; }
.sidebar .nav-sub-link:hover, .sidebar .nav-sub-link.active { background: rgba(255,255,255,.07); color: #fff; }
.main-panel { min-width: 0; padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: clamp(1.45rem, 2vw, 2.1rem); letter-spacing: 0; }
.eyebrow { color: var(--primary); text-transform: uppercase; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 8px; display: inline-grid; place-items: center; color: var(--ink); background: #fff; position: relative; }
.pulse { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 99px; background: #e5484d; box-shadow: 0 0 0 4px rgba(229,72,77,.15); }
.avatar-chip { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px 6px 6px; }
.avatar-chip span { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: #e7f1ea; color: var(--primary); font-weight: 800; }
.logout-btn { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; color: #7f1d1d; background: #fff; border: 1px solid #f1d7d7; border-radius: 8px; padding: 8px 12px; font-weight: 700; }
.logout-btn:hover { color: #991b1b; background: #fff5f5; }
.student-bottom-nav { display: none; }
.hero-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 32px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #183d2c, #2f6f4e 58%, #6aa57e); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.hero-band h2 { font-size: clamp(1.8rem, 3vw, 3rem); max-width: 720px; margin: 0 0 8px; letter-spacing: 0; }
.hero-band p { color: rgba(255,255,255,.82); margin: 0; }
.hero-band .eyebrow { color: #c8f7dc; }
.qr-card { width: 170px; min-height: 170px; flex: 0 0 auto; border-radius: 8px; background: rgba(255,255,255,.14); display: grid; place-items: center; text-align: center; padding: 16px; border: 1px solid rgba(255,255,255,.2); }
.qr-card i { font-size: 3rem; }
.qr-card span, .qr-card strong { display: block; }
.stat-grid, .role-grid, .quality-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.stat-card { padding: 20px; display: grid; gap: 7px; }
.stat-card i { color: var(--primary); font-size: 1.35rem; }
.stat-card span, .panel p, small, .report-list span { color: var(--muted); }
.stat-card strong { font-size: 2rem; letter-spacing: 0; }
.content-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.panel { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel h3, .panel-head h3 { margin: 0; font-size: 1.05rem; letter-spacing: 0; }
.event-list, .admin-list, .report-list, .verification-stack { display: grid; gap: 12px; }
.event-list > div, .admin-list > div, .report-list > div { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.event-list strong, .event-list small, .admin-list span { display: block; }
.attendance-activity { justify-content: space-between; }
.attendance-activity .activity-copy { min-width: 0; flex: 1; }
.attendance-activity .btn { white-space: nowrap; }
.empty-state { display: grid !important; justify-items: start; gap: 8px !important; }
.empty-state i { color: var(--muted); font-size: 1.6rem; }
.date-pill { width: 54px; min-width: 54px; border-radius: 8px; padding: 8px 6px; text-align: center; font-weight: 800; font-size: .75rem; color: var(--primary); background: #e7f1ea; }
.date-pill.green { color: var(--green); background: #e8f8ef; }
.date-pill.orange { color: var(--orange); background: #fff2e8; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.timeline li { display: flex; gap: 12px; color: var(--muted); }
.timeline span, .status-dot { width: 10px; height: 10px; border-radius: 99px; background: #e5484d; margin-top: 7px; flex: 0 0 auto; }
.status-dot.ok { background: var(--green); }
.status-dot.warn { background: var(--orange); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.search-box { min-height: 46px; flex: 1; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; }
.search-box input { border: 0; outline: 0; width: 100%; background: transparent; }
.table td small { display: block; }
.role-card { min-height: 150px; }
.role-card i { color: var(--primary); font-size: 1.6rem; }
.split, .attendance-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr); gap: 16px; }
.map-visual { height: 320px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, rgba(24,61,44,.92), rgba(47,111,78,.84)), repeating-linear-gradient(45deg, transparent 0 20px, rgba(255,255,255,.14) 20px 22px); text-align: center; }
.map-visual i { display: block; font-size: 3.2rem; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.metric-row span { padding: 12px; border-radius: 8px; background: #f7f9fc; color: var(--muted); }
.metric-row strong { display: block; color: var(--ink); }
.camera-frame { position: relative; min-height: 360px; border-radius: 8px; background: #111827; overflow: hidden; display: grid; place-items: center; }
.camera-frame.compact { min-height: 330px; }
.attendance-camera-frame { min-height: 0; aspect-ratio: 16 / 9; border: 1px solid #1f2a3a; }
.student-face-capture { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(220px, .7fr); gap: 14px; align-items: start; }
.student-camera-frame { min-height: 300px; }
.face-image-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.face-image-grid figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f8fafc; }
.face-image-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #111827; }
.face-image-grid figcaption { padding: 8px; font-size: .8rem; color: var(--muted); text-align: center; }
video { width: 100%; height: 100%; object-fit: cover; background: radial-gradient(circle at 50% 30%, #26364e, #0b1220); }
.attendance-camera-frame video { position: absolute; inset: 0; object-fit: fill; }
.attendance-overlay-canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.scan-line { position: absolute; inset-inline: 10%; top: 24%; height: 2px; background: #20e3a2; box-shadow: 0 0 18px #20e3a2; animation: scan 2.8s infinite ease-in-out; }
.camera-frame.capture-complete .scan-line { animation-play-state: paused; opacity: 0; }
.face-guide { position: absolute; width: min(48%, 250px); aspect-ratio: 3 / 4; border: 2px solid rgba(32, 227, 162, .85); border-radius: 45%; box-shadow: 0 0 0 999px rgba(3, 7, 18, .18), 0 0 24px rgba(32, 227, 162, .35); pointer-events: none; }
.camera-status-pill { position: absolute; left: 16px; bottom: 16px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 12px; border-radius: 8px; color: #fff; background: rgba(15, 31, 53, .86); backdrop-filter: blur(8px); font-size: .85rem; font-weight: 700; }
.camera-status-pill.ready { background: rgba(22, 163, 106, .9); }
.camera-status-pill.denied { background: rgba(229, 72, 77, .9); }
@keyframes scan { 50% { top: 76%; } }
.capture-btn { position: absolute; bottom: 16px; }
.camera-action-stack { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: center; gap: 10px; z-index: 3; }
.camera-action-stack .btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.camera-action-stack .capture-btn { position: static; bottom: auto; }
.attendance-student-panel { margin-top: 12px; padding: 14px; border: 1px solid #bfe6cc; border-radius: 8px; background: #f0fbf4; }
.attendance-student-avatar { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 8px; color: var(--primary); background: #dff3e7; font-size: 1.25rem; }
.attendance-student-kicker { display: block; margin-bottom: 2px; color: var(--green); font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.attendance-student-panel strong { display: block; color: var(--ink); line-height: 1.2; }
.attendance-face-live-card { margin-top: 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.attendance-face-live-card small,
.attendance-face-live-card strong { display: block; }
.attendance-face-live-card small { color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.attendance-face-live-card strong { color: var(--ink); line-height: 1.25; }
.attendance-face-live-card > span { min-width: 56px; padding: 8px 10px; border-radius: 8px; color: var(--muted); background: #eef2f7; text-align: center; font-weight: 800; }
.attendance-face-preview-grid { display: grid; grid-template-columns: repeat(2, 54px); gap: 8px; }
.attendance-face-preview-grid figure { margin: 0; display: grid; gap: 4px; }
.attendance-face-preview-grid img { width: 54px; height: 54px; display: block; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #111827; }
.attendance-face-preview-grid img:not([src]),
.attendance-face-preview-grid img[src=""] { visibility: hidden; background: #eef2f7; }
.attendance-face-preview-grid figcaption { color: var(--muted); font-size: .64rem; line-height: 1; text-align: center; }
.attendance-face-status-copy { min-width: 0; }
.attendance-face-log { margin-top: 8px; display: grid; gap: 4px; max-height: 78px; overflow-y: auto; color: var(--muted); font-size: .78rem; line-height: 1.25; }
.attendance-face-log:empty { display: none; }
.attendance-face-log div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; align-items: start; }
.attendance-face-log time { color: #8a96a8; font-variant-numeric: tabular-nums; }
.attendance-face-live-card.detected { border-color: #bfe6cc; background: #f0fbf4; }
.attendance-face-live-card.detected > span { color: #fff; background: var(--green); }
.attendance-face-live-card.warning { border-color: #fed7aa; background: #fff7ed; }
.attendance-face-live-card.warning > span { color: #7c2d12; background: #fed7aa; }
.attendance-face-live-card.error { border-color: #fecaca; background: #fff5f5; }
.attendance-face-live-card.error > span { color: #fff; background: #e5484d; }
.student-permission-card { display: grid; gap: 10px; }
.attendance-guide-panel .panel-head { margin-bottom: 0; }
.attendance-guide-panel .student-permission-card { margin-top: 12px; }
.attendance-info-toggle { width: 36px; height: 36px; min-width: 36px; color: var(--primary); background: #f4fbf7; border-color: #b9d9c5; }
.attendance-info-toggle:hover,
.attendance-info-toggle[aria-expanded="true"] { color: #fff; background: var(--primary); border-color: var(--primary); }
.student-permission-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.student-permission-row:first-child { grid-template-columns: 32px minmax(0, 1fr); }
.student-permission-row i { font-size: 1.1rem; }
.student-permission-row strong,
.student-permission-row span { display: block; }
.student-permission-row span { color: var(--muted); font-size: .9rem; line-height: 1.35; }
.student-permission-row .btn { white-space: nowrap; }
.attendance-modal-actions { gap: 8px; }
.verification-stack > div { display: grid; grid-template-columns: 34px 1fr; gap: 0 8px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.verification-stack span { grid-column: 2; color: var(--muted); }
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.segmented button { border: 0; border-radius: 6px; background: transparent; padding: 9px 14px; color: var(--muted); }
.segmented .active { background: var(--primary); color: #fff; }
.quality-grid { grid-template-columns: repeat(4, 1fr); }
.metric-card strong { font-size: 2rem; color: var(--primary); }
.backup-panel i { font-size: 3rem; color: var(--green); }
.notification-badge { min-width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; color: #fff; background: #e5484d; }
.about-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 32px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #183d2c, #2f6f4e); box-shadow: var(--shadow); }
.about-hero h2 { margin: 0 0 8px; font-size: clamp(1.8rem, 3vw, 3rem); letter-spacing: 0; }
.about-hero p { max-width: 720px; margin: 0; color: rgba(255,255,255,.82); }
.about-seal { width: 118px; height: 118px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); }
.about-seal i { font-size: 3rem; }
.about-seal img { width: 86px; height: 86px; object-fit: contain; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 12px 24px rgba(18, 32, 51, .18); }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.about-card i { color: var(--primary); font-size: 1.7rem; }
.song-box { min-height: 190px; display: grid; align-items: center; padding: 18px; border: 1px dashed #b9c4d6; border-radius: 8px; color: var(--muted); background: #f8fafc; }
.official-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.official-grid div { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.official-grid span { display: block; color: var(--muted); margin-top: 4px; }
.official-card { min-height: 86px; }
.official-photo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #f8fafc;
    border: 2px solid #eef2f7;
}
.official-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.official-profile-card {
    min-height: 220px;
    padding: 20px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 14px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #fbfcfe);
    box-shadow: 0 12px 28px rgba(18, 32, 51, .06);
}
.official-profile-photo {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    background: #f8fafc;
    border: 4px solid #fff;
    box-shadow: 0 12px 24px rgba(18, 32, 51, .14);
}
.official-profile-card p {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.official-profile-card strong {
    display: block;
    font-size: 1.02rem;
    color: var(--ink);
}
.about-cms-card {
    height: 100%;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}
.about-cms-card strong,
.about-cms-card small {
    display: block;
}
.auth-page { min-height: 100vh; background: #eef3f8; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 480px; gap: 28px; padding: 28px; }
.auth-art { border-radius: 8px; color: #fff; padding: 42px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(135deg, rgba(24,61,44,.92), rgba(47,111,78,.78)), url("../img/wallpaper.png") center/cover; }
.auth-art h1 { max-width: 720px; font-size: clamp(2.2rem, 5vw, 5rem); letter-spacing: 0; }
.auth-art p { max-width: 560px; color: rgba(255,255,255,.78); }
.auth-metrics { display: flex; gap: 12px; flex-wrap: wrap; }
.auth-metrics span { padding: 14px 16px; border-radius: 8px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.2); }
.auth-card, .capture-panel { align-self: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 30px; box-shadow: var(--shadow); }
.auth-card h2 { letter-spacing: 0; }
.auth-switch { margin-top: 22px; text-align: center; color: var(--muted); }
.login-wrap {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(280px, 405px);
    align-content: center;
    justify-content: end;
    min-height: 100vh;
    padding: 24px clamp(32px, 8vw, 140px) 24px 24px;
    background: url("../img/wallpaper2.png") center / cover no-repeat;
}
.login-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 50% 48%, transparent 28%, rgba(0, 0, 0, .18) 78%);
}
.login-card {
    width: min(100%, 380px);
    padding: 26px 28px 24px;
    background: rgba(0, 16, 6, .46);
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .38);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.login-university-logo {
    display: block;
    width: 76px;
    height: 76px;
    object-fit: contain;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 26px rgba(0, 0, 0, .28);
}
.login-system-title {
    display: grid;
    gap: 2px;
    max-width: 280px;
    margin: 0 auto 20px;
    text-align: center;
    color: rgba(255, 255, 255, .68);
    line-height: 1.28;
}
.login-system-title strong {
    color: #ffda4a;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1;
    margin-bottom: 4px;
}
.login-system-title span {
    font-size: .7rem;
    font-weight: 400;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
}
.login-brand span:last-child {
    display: grid;
    line-height: 1.1;
}
.login-brand small,
.login-card p,
.login-card .auth-switch,
.login-card .form-check-label {
    color: rgba(255, 255, 255, .76);
}
.login-card h1 {
    margin: 0 0 8px;
    font-size: clamp(1.55rem, 5vw, 1.85rem);
    letter-spacing: 0;
    text-align: center;
}
.login-card p {
    margin-bottom: 26px;
    text-align: center;
}
.login-card .form-label {
    color: rgba(255, 255, 255, .86);
}
.login-card .input-group-text,
.login-card .form-control {
    min-height: 44px;
    color: #fff;
    background: rgba(0, 13, 5, .38);
    border-color: rgba(255, 255, 255, .24);
}
.login-card .input-group-text {
    color: rgba(255, 255, 255, .84);
    min-width: 46px;
    justify-content: center;
}
.login-card .form-control::placeholder {
    color: rgba(255, 255, 255, .68);
}
.login-card .form-control:focus {
    color: #fff;
    background: rgba(0, 18, 7, .52);
    border-color: rgba(106, 165, 126, .72);
    box-shadow: 0 0 0 3px rgba(106, 165, 126, .22);
}
.login-card .link-primary,
.login-card .auth-switch a {
    color: #d6eadc !important;
}
.login-card .btn-primary {
    --bs-btn-bg: #6aa57e;
    --bs-btn-border-color: #6aa57e;
    --bs-btn-color: #102418;
    --bs-btn-hover-bg: #5b936d;
    --bs-btn-hover-border-color: #5b936d;
    min-height: 44px;
    font-weight: 500;
}
.signup-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 24px clamp(18px, 4vw, 56px);
    background: url("../img/wallpaper2.png") center / cover no-repeat;
}
.signup-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 50% 48%, transparent 28%, rgba(0, 0, 0, .18) 78%);
}
.signup-shell {
    width: min(100%, 1180px);
    max-height: calc(100vh - 48px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.signup-shell-wide {
    width: min(100%, 1360px);
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}
.signup-intro {
    display: grid;
    gap: 24px;
    align-content: center;
    min-height: 100%;
    padding: clamp(22px, 3vw, 34px);
    color: #fff;
    background: linear-gradient(180deg, rgba(23, 61, 43, .98), rgba(47, 111, 78, .94));
}
.signup-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}
.signup-brand img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .24);
}
.signup-brand span {
    display: grid;
    line-height: 1.15;
}
.signup-brand strong {
    color: #ffda4a;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .1em;
}
.signup-brand small,
.signup-intro p {
    color: rgba(255, 255, 255, .78);
}
.signup-intro h1 {
    max-width: 360px;
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: 0;
}
.signup-intro .eyebrow {
    color: #c8f7dc;
}
.signup-steps {
    display: grid;
    gap: 10px;
    max-width: 340px;
}
.signup-steps span {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    color: rgba(255, 255, 255, .7);
    background: rgba(255, 255, 255, .08);
}
.signup-steps span.active {
    color: #fff;
    background: rgba(255, 255, 255, .15);
}
.signup-steps i {
    color: #ffda4a;
}
.signup-panel {
    width: 100%;
    padding: clamp(20px, 3vw, 32px);
    background: #fff;
}
.signup-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
}
.signup-panel-head.complete {
    margin-bottom: 18px;
}
.signup-panel-head h2 {
    margin: 0 0 6px;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    letter-spacing: 0;
}
.signup-panel-head p {
    margin: 0;
    color: var(--muted);
}
.signup-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--primary);
    background: #e7f1ea;
    font-size: 1.3rem;
}
.signup-icon.success {
    color: var(--green);
    background: #e8f8ef;
}
.signup-form-stack {
    display: grid;
    gap: 14px;
}
.signup-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.signup-complete-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
    gap: 18px;
    align-items: start;
}
.signup-wizard-step {
    grid-column: 1 / -1;
}
.signup-fields,
.signup-capture-panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}
.signup-face-capture {
    grid-template-columns: 1fr;
}
.signup-face-capture .student-camera-frame {
    min-height: 320px;
}
.signup-face-capture .capture-btn {
    left: 16px;
    right: 16px;
    width: auto;
}
.register-wrap { grid-template-columns: minmax(0, 1fr) 430px; }
.register-card { align-self: stretch; }
.signup-account-row .form-label {
    min-height: 1.35rem;
    white-space: nowrap;
}
.signup-account-row .form-control {
    width: 100%;
}
.sample-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.student-sample-row,
.signup-sample-row,
.approval-face-samples,
.view-face-samples { grid-template-columns: 1fr; }
.sample-row span { height: 44px; border-radius: 8px; display: grid; place-items: center; background: #e7f1ea; color: var(--primary); font-weight: 800; }
.sample-row span.done { background: #e8f8ef; color: var(--green); }
.capture-note { display: flex; gap: 12px; padding: 14px; margin-bottom: 14px; border: 1px solid #fed7aa; border-radius: 8px; color: #7c2d12; background: #fff7ed; }
.capture-note i { font-size: 1.25rem; color: var(--orange); }
.capture-note strong, .capture-note span { display: block; }
.capture-note span { font-size: .92rem; line-height: 1.35; }
.quality-list { display: grid; gap: 8px; color: var(--muted); margin-bottom: 16px; }
.btn { border-radius: 8px; font-weight: 700; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark); }
.text-bg-primary { color: #fff !important; background-color: var(--primary) !important; }
.link-primary { color: var(--primary) !important; }
.form-control, .form-select, .input-group-text { border-radius: 8px; border-color: var(--line); }

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 20; transform: translateX(-105%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .stat-grid, .role-grid, .quality-grid { grid-template-columns: repeat(2, 1fr); }
    .official-grid, .official-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split, .attendance-grid, .auth-wrap, .register-wrap { grid-template-columns: 1fr; }
    .signup-shell,
    .signup-shell-wide {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .signup-intro {
        min-height: auto;
        align-content: start;
    }
    .signup-intro h1 {
        max-width: 760px;
    }
    .signup-steps {
        grid-template-columns: repeat(3, 1fr);
        max-width: none;
    }
    .auth-art { min-height: 440px; }
}

@media (max-width: 720px) {
    .main-panel, .auth-wrap { width: 100%; max-width: 100%; min-width: 0; padding: 16px; overflow-x: hidden; }
    .main-panel .panel { width: 100%; max-width: 100%; min-width: 0; overflow: visible; padding: 16px; }
    .main-panel .panel-head { align-items: flex-start; flex-wrap: wrap; }
    .main-panel .panel-head > div { min-width: 0; flex: 1 1 150px; }
    .main-panel .panel-head > .d-flex { width: 100%; flex-wrap: wrap; }
    .main-panel .panel-head .btn { flex: 1 1 auto; }
    .main-panel .table-responsive { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .main-panel .dataTables_wrapper { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .main-panel .dataTables_length, .main-panel .dataTables_filter { float: none !important; width: 100%; margin-bottom: 10px; text-align: left !important; }
    .main-panel .dataTables_filter input { width: 100%; max-width: 100%; margin-left: 0 !important; }
    .main-panel .dataTables_info, .main-panel .dataTables_paginate { float: none !important; width: 100%; margin-top: 10px; text-align: left !important; }
    .main-panel .dataTable { min-width: 620px; }
    .student-main-panel {
        padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
    }
    .student-main-panel + .student-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 30;
        min-height: 64px;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        align-items: center;
        gap: 4px;
        padding: 7px;
        border: 1px solid rgba(226, 232, 240, .9);
        border-radius: 8px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 14px 36px rgba(18, 32, 51, .18);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .student-main-panel + .student-bottom-nav a {
        position: relative;
        min-width: 0;
        min-height: 50px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 3px;
        padding: 6px 4px;
        border-radius: 8px;
        color: #667085;
        font-size: .7rem;
        line-height: 1.1;
        text-align: center;
        overflow: hidden;
        transform: translateY(0) scale(1);
        transition: color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .student-main-panel + .student-bottom-nav a::before {
        content: "";
        position: absolute;
        inset: 8px 12px;
        z-index: -1;
        border-radius: 8px;
        background: rgba(47, 111, 78, .1);
        opacity: 0;
        transform: scale(.72);
        transition: opacity .18s ease, transform .18s ease;
    }
    .student-main-panel + .student-bottom-nav a:active,
    .student-main-panel + .student-bottom-nav a.is-tapping {
        transform: translateY(-2px) scale(.96);
    }
    .student-main-panel + .student-bottom-nav a:active::before,
    .student-main-panel + .student-bottom-nav a.is-tapping::before {
        opacity: 1;
        transform: scale(1);
    }
    .student-main-panel + .student-bottom-nav a i {
        font-size: 1.15rem;
        line-height: 1;
        transition: transform .18s ease;
    }
    .student-main-panel + .student-bottom-nav a span {
        max-width: 100%;
        overflow: hidden;
        color: inherit;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .student-main-panel + .student-bottom-nav a.active {
        color: #fff;
        background: var(--primary);
        box-shadow: 0 8px 18px rgba(47, 111, 78, .24);
        animation: studentNavPop .26s ease both;
    }
.student-main-panel + .student-bottom-nav a.active i {
        transform: translateY(-1px) scale(1.08);
    }
    @keyframes studentNavPop {
        0% { transform: translateY(0) scale(.96); }
        70% { transform: translateY(-2px) scale(1.04); }
        100% { transform: translateY(0) scale(1); }
    }
    @media (prefers-reduced-motion: reduce) {
        .student-main-panel + .student-bottom-nav a,
        .student-main-panel + .student-bottom-nav a::before,
        .student-main-panel + .student-bottom-nav a i {
            transition: none;
            animation: none;
        }
    }
    .student-main-panel .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        margin-bottom: 14px;
    }
    .student-main-panel .topbar > div:first-of-type {
        min-width: 0;
    }
    .student-main-panel .topbar h1 {
        font-size: 1.35rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .student-main-panel .topbar-actions {
        width: auto;
        justify-content: flex-end;
        gap: 8px;
    }
    .student-main-panel .topbar-actions .icon-btn,
    .student-main-panel .topbar-actions .logout-btn {
        display: none;
    }
    .student-main-panel .avatar-chip {
        min-width: 42px;
        width: 42px;
        height: 42px;
        padding: 6px;
        justify-content: center;
    }
    .student-main-panel .avatar-chip strong {
        display: none;
    }
    .student-shell {
        display: block;
    }
    .student-shell .sidebar {
        display: none;
    }
    .signup-page {
        align-items: start;
        padding: 14px;
    }
    .signup-shell,
    .signup-shell-wide {
        max-height: none;
        min-height: calc(100vh - 28px);
    }
    .signup-intro {
        gap: 16px;
        padding: 18px;
    }
    .signup-brand img {
        width: 58px;
        height: 58px;
    }
    .signup-intro h1 {
        font-size: 1.85rem;
        margin-bottom: 8px;
    }
    .signup-steps {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .signup-steps span {
        min-height: 40px;
        padding: 8px 10px;
    }
    .signup-panel {
        padding: 16px;
    }
    .signup-panel-head {
        display: grid;
        gap: 10px;
        margin-bottom: 16px;
    }
    .signup-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        font-size: 1.1rem;
    }
    .signup-complete-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .signup-fields,
    .signup-capture-panel {
        padding: 12px;
    }
    .signup-face-capture .student-camera-frame {
        min-height: 280px;
    }
    .signup-face-capture .capture-btn {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    .login-wrap {
        justify-content: center;
        padding: 16px;
    }
    .topbar, .hero-band, .toolbar { align-items: flex-start; flex-direction: column; }
    .topbar-actions { width: 100%; justify-content: space-between; }
    .stat-grid, .role-grid, .quality-grid, .content-grid { grid-template-columns: 1fr; }
    .about-grid, .official-grid, .official-card-grid { grid-template-columns: 1fr; }
    .about-hero { flex-direction: column; align-items: flex-start; }
    .span-7, .span-5 { grid-column: auto; }
    .qr-card { width: 100%; }
    .metric-row { grid-template-columns: 1fr; }
    .event-list > div, .admin-list > div, .report-list > div { align-items: flex-start; }
    .attendance-activity { flex-wrap: wrap; }
    .attendance-activity .btn { width: 100%; }
    .auth-art { padding: 26px; min-height: 420px; }
    .auth-art h1 { font-size: 2.2rem; }
    .student-face-capture { grid-template-columns: 1fr; }
    #faceAttendanceModal .modal-dialog {
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
        align-items: stretch;
    }
    #faceAttendanceModal .modal-content {
        min-height: 100%;
        max-height: 100vh;
        border-radius: 0;
        display: flex;
    }
    #faceAttendanceModal .modal-header {
        flex: 0 0 auto;
        padding: 14px 16px 8px;
    }
    #faceAttendanceModal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 10px 14px;
    }
    #faceAttendanceModal .modal-title {
        font-size: 1rem;
    }
    #faceAttendanceModal #faceModalSubtitle {
        display: block;
        max-width: 280px;
        line-height: 1.35;
    }
    #faceAttendanceModal .attendance-camera-frame {
        width: 100%;
        max-height: 42vh;
        aspect-ratio: 4 / 3;
    }
    #faceAttendanceModal .attendance-camera-frame video {
        object-fit: cover;
    }
    #faceAttendanceModal .camera-status-pill {
        left: 10px;
        right: auto;
        bottom: 10px;
        max-width: calc(100% - 20px);
        min-height: 32px;
        padding: 7px 10px;
        font-size: .78rem;
    }
    .student-permission-row {
        grid-template-columns: 30px minmax(0, 1fr);
    }
    .student-permission-row .btn {
        grid-column: 2;
        justify-self: start;
    }
    .attendance-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 16px 16px;
    }
    .attendance-modal-actions .btn {
        width: 100%;
        min-height: 46px;
        margin: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
    }
    .attendance-modal-actions #allowAttendanceLocation,
    .attendance-modal-actions #allowAttendanceCamera {
        color: var(--primary);
        border-color: #b9d9c5;
        background: #f4fbf7;
    }
    .attendance-modal-actions #captureAttendanceFace {
        min-height: 50px;
        background: var(--primary);
        border-color: var(--primary);
    }
    .attendance-modal-actions #captureAttendanceFace:disabled {
        color: #7f8a9a;
        background: #edf1f5;
        border-color: #dce3eb;
        opacity: 1;
    }
    .attendance-modal-actions .attendance-cancel-action {
        min-height: 40px;
        color: var(--muted);
        background: transparent;
        border-color: transparent;
    }
    .attendance-face-live-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: start;
        gap: 9px;
        padding: 10px;
    }
    .attendance-face-preview-grid {
        grid-column: auto;
        grid-template-columns: repeat(2, 42px);
        gap: 6px;
    }
    .attendance-face-preview-grid img {
        width: 42px;
        height: 42px;
        aspect-ratio: auto;
    }
    .attendance-face-preview-grid figcaption {
        font-size: .58rem;
    }
    .attendance-face-live-card small {
        font-size: .68rem;
    }
    .attendance-face-live-card strong {
        font-size: .9rem;
        line-height: 1.2;
    }
    .attendance-face-live-card > span {
        min-width: 48px;
        padding: 7px 8px;
        font-size: .82rem;
    }
    .attendance-face-log {
        max-height: 52px;
        font-size: .68rem;
    }
    .attendance-student-panel {
        padding: 10px;
    }
    .attendance-student-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }
}

@media (max-width: 720px) and (max-height: 720px) {
    #faceAttendanceModal .attendance-camera-frame {
        max-height: 34vh;
        aspect-ratio: 16 / 9;
    }
    .attendance-face-log {
        display: none;
    }
    .attendance-modal-actions .btn {
        min-height: 42px;
    }
    .attendance-modal-actions #captureAttendanceFace {
        min-height: 44px;
    }
}

/* Final sidebar theme overrides. */
@media (min-width: 1101px) {
    .app-shell { grid-template-columns: 250px 1fr; }
}
.sidebar { background: #f8f9fb; color: #53606d; border-right: 1px solid #e5e7eb; padding: 28px 18px; }
.brand { color: #087f5b; margin: 0 10px 22px; gap: 9px; }
.brand-mark img { width: 34px; height: 34px; }
.brand small { color: #9aa3ad; font-size: .68rem; }
.sidebar-profile { display: flex; align-items: center; gap: 9px; padding: 10px 9px; margin: 0 0 22px; background: #fff; border: 1px solid #e8ebef; border-radius: 10px; box-shadow: 0 5px 15px rgba(32,42,56,.05); }
.sidebar-profile-avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: #69a89a; font-size: .8rem; font-weight: 700; }
.sidebar-profile span:nth-child(2) { min-width: 0; display: grid; line-height: 1.15; }
.sidebar-profile strong { overflow: hidden; color: #26333d; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile small { margin-top: 3px; color: #9aa3ad; font-size: .65rem; }
.sidebar-profile > i { margin-left: auto; color: #7d8790; font-size: .9rem; }
.sidebar .nav { gap: 2px; }
.sidebar .nav-link { min-height: 36px; padding: 8px 10px; gap: 11px; color: #66717b; border-radius: 7px; font-size: .78rem; font-weight: 500; }
.sidebar .nav-link i { width: 16px; color: #7d8790; font-size: .95rem; text-align: center; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { color: #17212b; background: #e9ebee; }
.sidebar .nav-link.active i { color: #17212b; }
.nav-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e8ebef; }
.sidebar .nav-submenu { margin-left: 16px; padding-left: 10px; border-left-color: #dfe4e8; }
.sidebar .nav-sub-link { min-height: 32px; color: #818b94; font-size: .74rem; }
.sidebar .nav-sub-link:hover, .sidebar .nav-sub-link.active { color: #17212b; background: #e9ebee; }
@media (min-width: 981px) { .student-shell { display: grid; grid-template-columns: 250px 1fr; } .student-shell .sidebar { display: block; } }
