:root {
    --sky-1: #46b7ff;
    --sky-2: #0d7fd3;
    --ink: #172033;
    --muted: #687386;
    --line: #dfe7f2;

    /* Brand theme — overridden inline by AppSetting::cssVars() */
    --brand-from:         #0f2744;
    --brand-via:          #0b6672;
    --brand-to:           #0c9a88;
    --brand-accent:       #0a8274;
    --brand-accent-dark:  #077a6c;
    --brand-accent-light: #26c6ad;
}

body {
    color: var(--ink);
    background: #f5f8fc;
}

/* ── New Login Page ──────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    background: linear-gradient(180deg, color-mix(in srgb, var(--sky-1) 18%, #ffffff) 0%, #f0f5fa 100%);
}

.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Left panel */
.login-left {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 12%, rgba(255,255,255,.14) 0 9rem, transparent 9.1rem),
        radial-gradient(circle at 92% 88%, rgba(255,255,255,.08) 0 12rem, transparent 12.1rem),
        linear-gradient(150deg, var(--brand-from) 0%, var(--brand-via) 40%, var(--brand-to) 100%);
}

.login-left::before {
    content: "";
    position: absolute;
    bottom: -5rem;
    right: -5rem;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    border: 2.5rem solid rgba(255,255,255,.06);
    pointer-events: none;
}

.login-left::after {
    content: "";
    position: absolute;
    top: -4rem;
    left: -4rem;
    width: 15rem;
    height: 15rem;
    border-radius: 50%;
    border: 2rem solid rgba(255,255,255,.05);
    pointer-events: none;
}

.login-left__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    height: 100%;
    padding: 3rem 3.5rem;
}

/* Brand row */
.lbrand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lbrand__icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.28);
    font-size: 1.75rem;
    color: #fff;
    backdrop-filter: blur(8px);
}

.lbrand strong {
    display: block;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 850;
    letter-spacing: .02em;
}

.lbrand span {
    display: block;
    color: rgba(255,255,255,.68);
    font-size: .87rem;
    margin-top: .15rem;
}

/* Tagline */
.ltagline h1 {
    margin: 0 0 .85rem;
    color: #fff;
    font-size: clamp(1.8rem, 2.4vw, 2.5rem);
    font-weight: 850;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.ltagline p {
    margin: 0;
    color: rgba(255,255,255,.74);
    font-size: 1.02rem;
    line-height: 1.65;
}

/* Guide */
.lguide__title {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1.25rem;
    color: rgba(255,255,255,.88);
    font-size: .83rem;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.lguide__title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.2);
}

.lguide__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lguide__list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.lguide__num {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.24);
    color: #fff;
    font-size: .84rem;
    font-weight: 850;
}

.lguide__list strong {
    display: block;
    color: #fff;
    font-size: .97rem;
    font-weight: 750;
}

.lguide__list span {
    display: block;
    color: rgba(255,255,255,.62);
    font-size: .86rem;
    margin-top: .2rem;
    line-height: 1.45;
}

/* Schedule */
.lschedule {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.lschedule__item {
    flex: 1;
    padding: 1.1rem;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
}

.lschedule__item i {
    font-size: 1.25rem;
    color: rgba(255,255,255,.82);
}

.lschedule__item span {
    display: block;
    margin-top: .35rem;
    color: rgba(255,255,255,.6);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.lschedule__item strong {
    display: block;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 850;
    margin-top: .15rem;
}

/* Right panel */
.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 3.5rem;
    background: #fff;
    overflow-y: auto;
}

.lform {
    width: 100%;
    max-width: 420px;
}

.lform__head {
    margin-bottom: 2.25rem;
}

.lform__badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .42rem 1rem;
    border-radius: 999px;
    background: #dff5ef;
    color: var(--brand-accent);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
}

.lform__head h2 {
    margin: 0 0 .5rem;
    font-size: 2.1rem;
    font-weight: 850;
    color: #111827;
    letter-spacing: -.02em;
}

.lform__head p {
    margin: 0;
    color: #687386;
    font-size: .98rem;
}

.lform__error {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 10px;
    background: #fff0f2;
    border: 1px solid #fecdd3;
    color: #c0192a;
    font-size: .94rem;
    font-weight: 650;
}

/* Fields */
.lfield {
    margin-bottom: 1.4rem;
}

.lfield label {
    display: block;
    margin-bottom: .55rem;
    color: #2d3a4a;
    font-weight: 750;
    font-size: .97rem;
}

.lfield__wrap {
    position: relative;
}

.lfield__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0b0c2;
    font-size: 1.1rem;
    pointer-events: none;
}

.lfield__wrap input {
    width: 100%;
    padding: .9rem 2.85rem;
    border: 1.5px solid #dde7f0;
    border-radius: 12px;
    font-size: 1rem;
    color: #111827;
    background: #f7fbfe;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.lfield__wrap input:focus {
    border-color: var(--brand-accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 130, 116, .13);
}

.lfield__wrap input::placeholder { color: #b8c8d8; }

.lfield__eye {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0b0c2;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    transition: color .15s;
}
.lfield__eye:hover { color: var(--brand-accent); }

/* Submit button */
.lform__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    width: 100%;
    padding: 1rem 1.25rem;
    margin-top: .35rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-to) 0%, var(--brand-accent) 60%, var(--brand-accent-dark) 100%);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(10, 130, 116, .32);
    transition: opacity .18s, transform .12s, box-shadow .18s;
}

.lform__btn:hover {
    opacity: .93;
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(10, 130, 116, .42);
}

.lform__btn:active { transform: none; }

/* Hint box */
.lform__hint {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin-top: 1.75rem;
    padding: 1.1rem 1.15rem;
    border-radius: 12px;
    background: #f2fbf8;
    border: 1px solid #c8e8e2;
}

.lform__hint i {
    flex-shrink: 0;
    color: var(--brand-accent);
    font-size: 1.05rem;
    margin-top: .1rem;
}

.lform__hint p {
    margin: 0;
    color: #3a7a70;
    font-size: .9rem;
    line-height: 1.55;
}

.lform__footer {
    margin-top: 1.75rem;
    text-align: center;
    color: #a0b0c2;
    font-size: .84rem;
}

/* Responsive */
@media (max-width: 991px) {
    .login-split {
        grid-template-columns: 1fr;
    }

    .login-left__inner {
        padding: 2.25rem 1.5rem;
        gap: 1.75rem;
    }

    .lschedule { margin-top: 0; }

    .login-right {
        padding: 2.5rem 1.5rem;
        align-items: flex-start;
    }

    .lform { max-width: 100%; }

    .ltagline h1 { font-size: 1.7rem; }
}

/* ── End new login ───────────────────────────────────────────────── */

.login-sky {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 16%, rgba(255,255,255,.75), transparent 18rem),
        radial-gradient(circle at 82% 20%, rgba(255,255,255,.45), transparent 15rem),
        linear-gradient(145deg, #72cdfd 0%, #2aa4ed 44%, #0872c3 100%);
}

.login-sky::before,
.login-sky::after {
    content: "";
    position: fixed;
    left: -8rem;
    right: -8rem;
    height: 12rem;
    border-radius: 999px;
    background: rgba(255,255,255,.28);
    filter: blur(18px);
}

.login-sky::before {
    top: 9%;
    transform: rotate(-2deg);
}

.login-sky::after {
    bottom: 10%;
    transform: rotate(2deg);
}

.login-panel {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(4, 70, 125, .24);
}

.login-emblem {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: #0872c3;
    font-weight: 800;
    letter-spacing: .04em;
    box-shadow: 0 16px 35px rgba(4, 70, 125, .18);
}

.form-control {
    border-color: #d4dfec;
}

.form-control:focus {
    border-color: var(--sky-2);
    box-shadow: 0 0 0 .25rem rgba(13, 127, 211, .14);
}

.btn-primary {
    --bs-btn-bg: #0878cf;
    --bs-btn-border-color: #0878cf;
    --bs-btn-hover-bg: #0669b6;
    --bs-btn-hover-border-color: #0669b6;
}

.app-shell {
    background:
        linear-gradient(180deg, #eef7fb 0, #f7fbff 22rem, #eef4fa 100%);
    min-height: 100vh;
    padding-bottom: 0;
}

.admin-shell {
    padding-bottom: 0;
    background: #f2f5f9;
}

.panel,
.metric {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(18, 42, 74, .05);
}

.panel {
    padding: 1.25rem;
}

.metric {
    padding: 1.15rem;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: .35rem;
}

.metric strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.camera-panel {
    overflow: hidden;
}

.camera-video {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    background: #0f1d2e;
    transform: scaleX(-1);
}

.camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    margin-top: 1rem;
}

.registered-face {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.table th {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
}

@media (max-width: 576px) {
    .login-panel {
        padding: 1.25rem !important;
    }

    .camera-actions .btn {
        width: 100%;
    }
}

.teacher-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 76px;
    padding: .75rem 2.35rem;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid #dbe6f0;
    box-shadow: 0 6px 24px rgba(39, 79, 116, .06);
    backdrop-filter: blur(12px);
}

.teacher-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.teacher-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    width: 260px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--brand-from) 0%, var(--brand-via) 58%, var(--brand-to) 100%);
    box-shadow: 4px 0 28px rgba(8,30,56,.22);
    transition: transform .27s cubic-bezier(.4,0,.2,1);
}

.teacher-sidebar__brand {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.2rem 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.teacher-sidebar__logo {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.28);
    color: #fff;
    font-size: 1.2rem;
}

.teacher-sidebar__brand strong { display: block; color: #fff; font-weight: 800; font-size: .95rem; }
.teacher-sidebar__brand small { display: block; color: rgba(255,255,255,.56); font-size: .72rem; }

.teacher-sidebar__nav { flex: 1; overflow-y: auto; padding: .6rem 0; }

.teacher-sidebar__nav a {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 2px .6rem;
    padding: .68rem .85rem;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 650;
    border-radius: 9px;
}

.teacher-sidebar__nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.teacher-sidebar__nav a.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 #5eead4; }
.teacher-sidebar__nav i { width: 20px; text-align: center; font-size: 1.1rem; }

.teacher-sidebar__footer {
    padding: .85rem .95rem;
    border-top: 1px solid rgba(255,255,255,.12);
}

.teacher-sidebar__user {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .2rem 0 .75rem;
}

.teacher-sidebar .teacher-avatar { width: 36px; height: 36px; font-size: .86rem; background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.28); color: #fff; }
.teacher-sidebar .teacher-identity strong { color: #fff; font-size: .86rem; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.teacher-sidebar .teacher-identity span { color: rgba(255,255,255,.56); font-size: .72rem; }

.teacher-sidebar__logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    padding: .58rem 1rem;
    border: 1.5px solid rgba(255,255,255,.16);
    border-radius: 9px;
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.75);
    font-size: .86rem;
    font-weight: 650;
}

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

.teacher-sidebar-overlay.show { display: block; }

.teacher-topbar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1.5px solid #dce7f1;
    border-radius: 10px;
    background: #fff;
    color: #52647a;
    font-size: 1.3rem;
}

.teacher-topbar__title {
    flex: 1;
    color: #121a2d;
    font-size: 1.25rem;
    font-weight: 800;
    text-align: left;
}

.teacher-topbar__user {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.topbar-icon {
    width: 44px;
    height: 44px;
    border: 1px solid #dce7f1;
    border-radius: 14px;
    background: #fff;
    color: #52647a;
    box-shadow: 0 8px 18px rgba(37, 67, 98, .06);
}

.teacher-avatar {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #dff5ef;
    border: 1px solid #c8e8df;
    color: #0b877a;
    font-weight: 800;
}

.teacher-identity {
    display: grid;
    line-height: 1.15;
}

.teacher-identity strong {
    color: #151d31;
    font-size: .98rem;
    letter-spacing: .02em;
}

.teacher-identity span {
    color: #7a8aa1;
    font-size: .86rem;
    margin-top: .25rem;
}

.teacher-main {
    max-width: 100%;
    padding: 2.25rem 2.65rem 2rem;
}

@media (min-width: 992px) {
    .teacher-sidebar { transform: none !important; }
    .teacher-wrap { margin-left: 260px; }
    .teacher-topbar__toggle { display: none !important; }
}

@media (max-width: 991px) {
    .teacher-sidebar { transform: translateX(-100%); }
    .teacher-sidebar.open { transform: translateX(0); }
    .teacher-topbar__toggle { display: inline-flex; }
}

.teacher-hero {
    position: relative;
    overflow: hidden;
    padding: 2.55rem 2.6rem;
    color: #fff;
    border-radius: 26px;
    background:
        radial-gradient(circle at 98% 10%, rgba(255,255,255,.2) 0 8rem, transparent 8.1rem),
        radial-gradient(circle at 90% 96%, rgba(255,255,255,.15) 0 6.5rem, transparent 6.6rem),
        linear-gradient(120deg, var(--brand-from) 0%, var(--brand-via) 42%, var(--brand-to) 100%);
    box-shadow: 0 22px 50px color-mix(in srgb, var(--brand-accent) 28%, transparent);
}

.teacher-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1rem;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.teacher-hero h1 {
    max-width: 980px;
    margin: 1.35rem 0 .85rem;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    font-weight: 850;
    letter-spacing: 0;
}

.teacher-hero p {
    max-width: 1120px;
    margin: 0;
    color: rgba(255,255,255,.88);
    font-size: 1.13rem;
}

.teacher-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
    margin-top: 1.9rem;
}

.teacher-hero__stats div {
    padding: 1.25rem 1.35rem;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 16px;
    background: rgba(255,255,255,.18);
}

.teacher-hero__stats span,
.teacher-section-label {
    display: block;
    color: rgba(255,255,255,.74);
    font-size: .86rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.teacher-hero__stats strong {
    display: block;
    margin-top: .35rem;
    color: #fff;
    font-size: 1.55rem;
    line-height: 1;
}

.teacher-alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1rem 1.2rem;
    border: 1px solid #f2d483;
    border-radius: 14px;
    background: #fff6d6;
    color: #805c00;
}

.teacher-alert a {
    color: #805c00;
    font-weight: 800;
    text-decoration: none;
}

.teacher-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 1.75rem;
}

.teacher-action {
    display: grid;
    justify-items: center;
    min-height: 166px;
    padding: 1.7rem 1rem;
    color: #141d31;
    text-align: center;
    text-decoration: none;
    border: 1px solid #dce7f0;
    border-radius: 18px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 16px 34px rgba(41, 67, 91, .05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.teacher-action:hover {
    transform: translateY(-3px);
    border-color: #bfd6e7;
    box-shadow: 0 20px 42px rgba(41, 67, 91, .1);
}

.teacher-action__icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 16px;
    font-size: 1.65rem;
}

.teacher-action__icon--teal { color: #078277; background: #e9edff; }
.teacher-action__icon--gray { color: #758291; background: #edf0f3; }
.teacher-action__icon--blue { color: #2c7df0; background: #e6f6fb; }
.teacher-action__icon--green { color: #17a970; background: #e4f1eb; }

.teacher-action strong {
    font-size: 1.12rem;
}

.teacher-action small {
    margin-top: .55rem;
    color: #5f6f85;
    font-size: .92rem;
}

.teacher-status-panel,
.teacher-table-panel,
.teacher-summary-panel {
    border: 1px solid #dce7f0;
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 18px 42px rgba(43, 72, 101, .06);
}

.teacher-status-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-top: 2.1rem;
    padding: 2rem;
}

.teacher-status-panel .teacher-section-label {
    color: #8191a8;
}

.teacher-status-panel h2 {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: .75rem 0 .8rem;
    color: #121a2d;
    font-size: 1.65rem;
    font-weight: 850;
}

.teacher-status-panel h2 i {
    color: var(--brand-accent);
}

.teacher-status-panel p {
    margin: 0;
    color: #6d7b8f;
    font-size: 1.04rem;
}

.teacher-status-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.15rem;
    margin-top: 1.35rem;
    color: #7b8ca5;
    font-size: .95rem;
}

.teacher-status-action {
    display: grid;
    justify-items: end;
    gap: .8rem;
    color: #8796ad;
    text-align: right;
}

.btn-teacher {
    --bs-btn-bg: var(--brand-accent);
    --bs-btn-border-color: var(--brand-accent);
    --bs-btn-hover-bg: var(--brand-accent-dark);
    --bs-btn-hover-border-color: var(--brand-accent-dark);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    border-radius: 12px;
    font-weight: 800;
}

.teacher-month-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.teacher-mini-stat {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    min-height: 105px;
    border: 1px solid #dce7f0;
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 16px 34px rgba(43, 72, 101, .05);
}

.teacher-mini-stat::after {
    content: "";
    position: absolute;
    top: -2.2rem;
    right: -2rem;
    width: 5.6rem;
    height: 5.6rem;
    border-radius: 50%;
    background: #eef5f5;
}

.teacher-mini-stat strong {
    font-size: 2rem;
    line-height: 1;
    z-index: 1;
}

.teacher-mini-stat span {
    color: #4e5e74;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
    z-index: 1;
}

.teacher-mini-stat--green strong { color: var(--brand-accent); }
.teacher-mini-stat--blue strong { color: #2d80f3; }
.teacher-mini-stat--yellow strong { color: #f2a300; }
.teacher-mini-stat--purple strong { color: #7342da; }
.teacher-mini-stat--red strong { color: #d9414f; }

.teacher-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr);
    gap: 1.35rem;
    margin-top: 2.15rem;
}

.teacher-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.35rem 1.55rem;
    border-bottom: 1px solid #dce7f0;
}

.teacher-panel-header h2 {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
    color: #151d31;
    font-size: 1.12rem;
    font-weight: 850;
}

.teacher-panel-header h2 i {
    color: var(--brand-accent);
}

.teacher-panel-header a,
.teacher-panel-header span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .85rem;
    color: var(--brand-accent);
    text-decoration: none;
    border: 1px solid #bfded9;
    border-radius: 12px;
    background: #eefaf6;
    font-weight: 800;
}

.teacher-table {
    --bs-table-bg: transparent;
}

.teacher-table th {
    padding: 1.15rem 1.55rem;
    color: #4e5e74;
    background: #f3f7fb;
    border-bottom-color: #dce7f0;
    letter-spacing: .08em;
}

.teacher-table td {
    padding: 1.25rem 1.55rem;
    color: #111827;
    border-color: #dce7f0;
    font-weight: 650;
}

.teacher-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .8rem;
    border-radius: 999px;
    color: #16a66e;
    background: #e9fbf0;
    font-weight: 800;
}

.teacher-badge--danger {
    color: #d9414f;
    background: #fff0f2;
}

.teacher-badge--warning {
    color: #a36a00;
    background: #fff7dd;
}

.teacher-badge--muted {
    color: #64748b;
    background: #eef2f6;
}

.teacher-summary-panel {
    overflow: hidden;
}

.teacher-summary-panel .teacher-panel-header span {
    color: var(--brand-accent);
    border: 0;
    border-radius: 999px;
    background: #dff5ef;
}

.teacher-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.6rem 1.55rem .75rem;
    color: #6d7b8f;
}

.teacher-progress-row strong {
    color: var(--brand-accent);
}

.teacher-progress {
    height: 12px;
    margin: 0 1.55rem 1.15rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e7edf4;
}

.teacher-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-accent);
}

.teacher-summary-list {
    padding: 0 1.55rem 1.15rem;
}

.teacher-summary-list div {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 0;
    border-top: 1px solid #e5edf4;
}

.teacher-summary-list i {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--brand-accent);
    background: #e9f8f5;
    border: 1px solid #cfebe5;
    font-size: 1.35rem;
}

.teacher-summary-list strong,
.teacher-summary-list small {
    display: block;
}

.teacher-summary-list strong {
    color: #141d31;
    font-size: 1.08rem;
}

.teacher-summary-list small {
    color: #7b8ca5;
}

.teacher-summary-list b {
    color: var(--brand-accent);
    font-size: 1.05rem;
}

.teacher-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 74px;
    padding: .35rem 2rem;
    background: rgba(255,255,255,.97);
    border-top: 1px solid #dce7f0;
    box-shadow: 0 -10px 24px rgba(43, 72, 101, .08);
    backdrop-filter: blur(12px);
}

.teacher-bottom-nav a,
.teacher-bottom-nav button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: .2rem;
    width: 100%;
    min-height: 56px;
    color: #7f8da3;
    text-decoration: none;
    border: 0;
    background: transparent;
    font-size: .8rem;
    font-weight: 750;
}

.teacher-bottom-nav form {
    margin: 0;
}

.teacher-bottom-nav i {
    font-size: 1.55rem;
}

.teacher-bottom-nav .active {
    color: var(--brand-accent);
}

.teacher-bottom-nav .active i {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-top: -16px;
    border-radius: 14px;
    background: #dff5ef;
    box-shadow: 0 12px 22px rgba(10, 130, 116, .16);
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    overflow: hidden;
    padding: 2.55rem 2.6rem;
    color: #fff;
    border-radius: 26px;
    background:
        radial-gradient(circle at 94% 4%, rgba(255,255,255,.2) 0 9rem, transparent 9.1rem),
        radial-gradient(circle at 8% 92%, rgba(255,255,255,.13) 0 6rem, transparent 6.1rem),
        linear-gradient(120deg, #102b4c 0%, #0b6f76 48%, #12a081 100%);
    box-shadow: 0 22px 50px rgba(15, 55, 78, .2);
}

.admin-hero h1 {
    margin: 1.35rem 0 .85rem;
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 850;
}

.admin-hero p {
    max-width: 860px;
    margin: 0;
    color: rgba(255,255,255,.86);
    font-size: 1.12rem;
}

.admin-hero__summary {
    min-width: 220px;
    padding: 1.35rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 18px;
    background: rgba(255,255,255,.16);
}

.admin-hero__summary span,
.admin-hero__summary small {
    display: block;
    color: rgba(255,255,255,.75);
    font-weight: 750;
}

.admin-hero__summary strong {
    display: block;
    margin: .45rem 0;
    font-size: 3rem;
    line-height: 1;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.admin-stat {
    position: relative;
    overflow: hidden;
    min-height: 136px;
    padding: 1.35rem;
    border: 1px solid #dce7f0;
    border-radius: 18px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 16px 34px rgba(43, 72, 101, .05);
}

.admin-stat::after {
    content: "";
    position: absolute;
    right: -2rem;
    top: -2rem;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: rgba(10, 130, 116, .08);
}

.admin-stat i {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-bottom: .9rem;
    border-radius: 14px;
    font-size: 1.35rem;
}

.admin-stat span {
    display: block;
    color: #64748b;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.admin-stat strong {
    display: block;
    margin-top: .35rem;
    color: #121a2d;
    font-size: 2rem;
    line-height: 1;
}

.admin-stat--teal i { color: var(--brand-accent); background: #e7f7f4; }
.admin-stat--green i { color: #16a66e; background: #e9fbf0; }
.admin-stat--blue i { color: #2d80f3; background: #eaf3ff; }
.admin-stat--purple i { color: #7342da; background: #f1ecff; }
.admin-stat--red i { color: #d9414f; background: #fff0f2; }
.admin-stat--yellow i { color: #d99000; background: #fff7dd; }

.admin-actions {
    margin-top: 1.5rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr);
    gap: 1.35rem;
    margin-top: 1.6rem;
}

.admin-grid--bottom {
    grid-template-columns: minmax(0, 1.5fr) minmax(330px, .85fr);
}

.admin-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: end;
    gap: .75rem;
    min-height: 220px;
    padding: 1.4rem 1.3rem;
}

.admin-bars div {
    display: grid;
    justify-items: center;
    gap: .45rem;
    color: #718096;
    font-size: .78rem;
    font-weight: 750;
}

.admin-bars b {
    width: 100%;
    max-width: 34px;
    min-height: 8px;
    border-radius: 999px 999px 6px 6px;
    background: linear-gradient(180deg, var(--brand-to), var(--brand-accent));
}

.admin-bars span {
    color: var(--brand-accent);
    font-weight: 850;
}

.admin-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 2.15rem 2.35rem;
    color: #fff;
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 10%, rgba(255,255,255,.18) 0 7rem, transparent 7.1rem),
        linear-gradient(120deg, #102b4c 0%, #0b7776 54%, #12a081 100%);
    box-shadow: 0 20px 46px rgba(15, 55, 78, .18);
}

.admin-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .7rem;
}

.admin-page-head h1 {
    margin: 1.1rem 0 .55rem;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 850;
}

.admin-page-head p {
    max-width: 780px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: 1.05rem;
}

.admin-page-panel {
    margin-top: 1.5rem;
}

.report-filter {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 16px;
    background: rgba(255,255,255,.15);
}

.report-filter input {
    min-height: 42px;
    padding: .45rem .75rem;
    color: #102033;
    border: 0;
    border-radius: 10px;
    background: #fff;
    font-weight: 750;
}

.face-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.face-card {
    display: grid;
    grid-template-columns: 116px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid #dce7f0;
    border-radius: 18px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 16px 34px rgba(43, 72, 101, .05);
}

.face-card img {
    width: 116px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid #dce7f0;
    background: #eef4fa;
}

.face-card h2 {
    margin: 0;
    color: #121a2d;
    font-size: 1.12rem;
    font-weight: 850;
}

.face-card p {
    margin: .25rem 0 .8rem;
    color: #64748b;
}

.face-card span {
    display: block;
    color: #7b8ca5;
    font-size: .9rem;
    margin-top: .3rem;
}

.violation-head {
    background:
        radial-gradient(circle at 90% 18%, rgba(255,255,255,.18) 0 7rem, transparent 7.1rem),
        linear-gradient(120deg, #311a42 0%, #7b1e3b 48%, #a3481f 100%);
}

.violation-rules {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.violation-rules article {
    display: grid;
    gap: .5rem;
    padding: 1.35rem;
    border: 1px solid #dce7f0;
    border-radius: 18px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 16px 34px rgba(43, 72, 101, .05);
}

.violation-rules i {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #d9414f;
    background: #fff0f2;
    font-size: 1.45rem;
}

.violation-rules strong {
    color: #121a2d;
    font-size: 1.1rem;
}

.violation-rules span {
    color: #64748b;
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    min-width: 250px;
}

.user-actions .btn {
    font-weight: 750;
}

/* ── Dark mode ──────────────────────────────────────────────────── */

[data-theme="dark"] body {
    background: #0d1a26;
    color: #dde4ed;
}

[data-theme="dark"] .app-shell {
    background: linear-gradient(180deg, #0a1520 0, #0d1f2e 22rem, #0a1828 100%);
}

[data-theme="dark"] .teacher-topbar {
    background: rgba(12, 20, 30, .97);
    border-color: #1a2d3e;
}

[data-theme="dark"] .teacher-topbar__title { color: #dde4ed; }

[data-theme="dark"] .teacher-identity strong { color: #dde4ed; }
[data-theme="dark"] .teacher-identity span   { color: #7b8ca5; }

[data-theme="dark"] .topbar-icon {
    background: #162030;
    border-color: #1a2d3e;
    color: #8a9ab0;
}

[data-theme="dark"] .teacher-avatar {
    background: #0f2e28;
    border-color: #1a4038;
    color: var(--brand-accent-light);
}

[data-theme="dark"] .teacher-bottom-nav {
    background: rgba(12, 20, 30, .97);
    border-color: #1a2d3e;
}

[data-theme="dark"] .teacher-bottom-nav a,
[data-theme="dark"] .teacher-bottom-nav button { color: #6b7e95; }

[data-theme="dark"] .teacher-bottom-nav .active { color: var(--brand-accent-light); }

[data-theme="dark"] .teacher-bottom-nav .active i {
    background: #0f2a25;
    box-shadow: 0 12px 22px rgba(10, 130, 116, .2);
}

[data-theme="dark"] .panel,
[data-theme="dark"] .metric { background: #132030; border-color: #1a2d3e; }

[data-theme="dark"] .teacher-table-panel,
[data-theme="dark"] .teacher-summary-panel,
[data-theme="dark"] .teacher-status-panel,
[data-theme="dark"] .teacher-mini-stat,
[data-theme="dark"] .teacher-action,
[data-theme="dark"] .admin-stat,
[data-theme="dark"] .face-card {
    background: #132030;
    border-color: #1a2d3e;
}

[data-theme="dark"] .teacher-action { color: #dde4ed; }
[data-theme="dark"] .teacher-action small { color: #7b8ca5; }
[data-theme="dark"] .teacher-action:hover { border-color: #2a4560; }

[data-theme="dark"] .teacher-panel-header  { border-color: #1a2d3e; }
[data-theme="dark"] .teacher-panel-header h2 { color: #dde4ed; }

[data-theme="dark"] .teacher-panel-header a,
[data-theme="dark"] .teacher-panel-header span {
    color: var(--brand-accent-light);
    border-color: #1a3a35;
    background: #0e2520;
}

[data-theme="dark"] .teacher-summary-panel .teacher-panel-header span {
    background: #0e2520;
    color: var(--brand-accent-light);
}

[data-theme="dark"] .teacher-summary-list div { border-color: #1a2d3e; }
[data-theme="dark"] .teacher-summary-list strong { color: #dde4ed; }
[data-theme="dark"] .teacher-summary-list small  { color: #7b8ca5; }
[data-theme="dark"] .teacher-summary-list b      { color: var(--brand-accent-light); }

[data-theme="dark"] .teacher-summary-list i {
    background: #0e2520;
    border-color: #1a4038;
    color: var(--brand-accent-light);
}

[data-theme="dark"] .teacher-progress          { background: #1a2d3e; }
[data-theme="dark"] .teacher-progress-row      { color: #7b8ca5; }
[data-theme="dark"] .teacher-progress-row strong { color: var(--brand-accent-light); }

[data-theme="dark"] .teacher-status-panel h2   { color: #dde4ed; }
[data-theme="dark"] .teacher-status-panel p    { color: #7b8ca5; }
[data-theme="dark"] .teacher-status-meta       { color: #7b8ca5; }
[data-theme="dark"] .teacher-section-label     { color: rgba(255,255,255,.55); }

[data-theme="dark"] .teacher-alert {
    background: #2a1e00;
    border-color: #5a3d00;
    color: #ffd666;
}
[data-theme="dark"] .teacher-alert a { color: #ffd666; }

[data-theme="dark"] .teacher-table th {
    background: #1a2d3e;
    color: #8a9ab0;
    border-color: #1a2d3e;
}

[data-theme="dark"] .teacher-table td {
    color: #dde4ed;
    border-color: #1a2d3e;
}

[data-theme="dark"] .teacher-badge          { color: var(--brand-accent-light); background: #0e2520; }
[data-theme="dark"] .teacher-badge--danger  { color: #ff6b78; background: #2a1018; }
[data-theme="dark"] .teacher-badge--muted   { color: #8a9ab0; background: #1a2d3e; }

[data-theme="dark"] .admin-stat span   { color: #8a9ab0; }
[data-theme="dark"] .admin-stat strong { color: #dde4ed; }
[data-theme="dark"] .admin-stat::after { background: rgba(255,255,255,.03); }

[data-theme="dark"] .admin-bars div  { color: #7b8ca5; }
[data-theme="dark"] .admin-bars span { color: var(--brand-accent-light); }

[data-theme="dark"] .face-card h2 { color: #dde4ed; }
[data-theme="dark"] .face-card p  { color: #7b8ca5; }
[data-theme="dark"] .face-card span { color: #6b7e95; }
[data-theme="dark"] .face-card img { border-color: #1a2d3e; background: #0d1a26; }

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: #1a2d3e;
    border-color: #1e3348;
    color: #dde4ed;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: #1a2d3e;
    border-color: var(--brand-accent-light);
    color: #dde4ed;
    box-shadow: 0 0 0 .25rem rgba(38, 198, 173, .18);
}

[data-theme="dark"] .modal-content {
    background: #132030;
    border-color: #1a2d3e;
    color: #dde4ed;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer { border-color: #1a2d3e; }

[data-theme="dark"] .modal-title  { color: #dde4ed; }

[data-theme="dark"] .btn-light {
    background: #1a2d3e;
    border-color: #1e3348;
    color: #dde4ed;
}
[data-theme="dark"] .btn-light:hover {
    background: #1e3450;
    color: #fff;
}

[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }

[data-theme="dark"] .alert-success { background: #0e2a1e; border-color: #1a5035; color: #6ee7b7; }
[data-theme="dark"] .alert-danger  { background: #2a1018; border-color: #5a1828; color: #fca5a5; }
[data-theme="dark"] .alert-warning { background: #2a1e00; border-color: #5a3d00; color: #fcd34d; }

[data-theme="dark"] .table {
    --bs-table-color: #dde4ed;
    --bs-table-bg: transparent;
    --bs-table-border-color: #1a2d3e;
}

[data-theme="dark"] .text-muted { color: #7b8ca5 !important; }

[data-theme="dark"] .report-filter {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.12);
}

[data-theme="dark"] .report-filter input {
    background: #1a2d3e;
    color: #dde4ed;
}

/* ── End dark mode ─────────────────────────────────────────────── */

@media (max-width: 992px) {
    .teacher-topbar {
        grid-template-columns: 1fr auto;
        padding: .75rem 1rem;
    }

    .teacher-topbar::before {
        display: none;
    }

    .teacher-topbar__title {
        grid-column: 1;
        text-align: left;
    }

    .teacher-topbar__user {
        grid-column: 2;
    }

    .topbar-icon,
    .teacher-identity {
        display: none;
    }

    .teacher-main {
        padding: 1.25rem 1rem 1.5rem;
    }

    .teacher-hero {
        padding: 1.65rem;
        border-radius: 20px;
    }

    .teacher-hero__stats,
    .teacher-actions,
    .teacher-month-stats,
    .teacher-grid,
    .admin-stats,
    .admin-grid,
    .admin-grid--bottom,
    .face-grid,
    .violation-rules {
        grid-template-columns: 1fr;
    }

    .admin-hero {
        display: grid;
        padding: 1.65rem;
        border-radius: 20px;
    }

    .admin-hero__summary {
        min-width: 0;
    }

    .admin-page-head {
        display: grid;
        padding: 1.65rem;
        border-radius: 20px;
    }

    .report-filter {
        display: grid;
    }

    .admin-page-actions {
        justify-content: stretch;
    }

    .admin-page-actions .btn {
        width: 100%;
    }

    .face-card {
        grid-template-columns: 88px 1fr;
    }

    .face-card img {
        width: 88px;
    }

    .teacher-status-panel {
        display: grid;
        padding: 1.35rem;
    }

    .teacher-status-action {
        justify-items: start;
        text-align: left;
    }

    .teacher-bottom-nav {
        grid-template-columns: repeat(4, 1fr);
        overflow-x: auto;
        padding: .35rem .55rem;
    }

    .teacher-bottom-nav a,
    .teacher-bottom-nav button {
        min-width: 82px;
    }
}

/* ── Attendance / Presensi page ─────────────────────────────── */

.gps-info-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(18, 42, 74, .06);
    transition: background .2s, border-color .2s;
}

.gps-info-panel.gps-out {
    border-color: #fca5a5;
    background: #fff5f5;
}

.distance-donut-wrap {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    min-width: 0;
}

.distance-donut {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.distance-donut svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.distance-donut-track { fill: none; stroke: #e2e8f0; stroke-width: 7; }

.distance-donut-fill {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dashoffset .8s ease, stroke .4s ease;
}

.distance-donut-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: .64rem;
    font-weight: 800;
    color: #2d3a4a;
    text-align: center;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.gps-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .28rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 800;
    white-space: nowrap;
}

.gps-status.loading   { background: #f0f4f8; color: #64748b; }
.gps-status.in-range  { background: #dcfce7; color: #16a34a; }
.gps-status.out-range { background: #fee2e2; color: #dc2626; }

.accuracy-bar {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.accuracy-bar-fill {
    height: 100%;
    border-radius: inherit;
    transition: width .5s ease, background .5s ease;
}

.presensi-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: 1rem;
}

.presensi-card-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: 1.4rem .75rem;
    border: none;
    border-radius: 18px;
    font-size: .92rem;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition: all .2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.presensi-card-btn:not(:disabled):active { transform: scale(.96); }

.presensi-card-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.btn-presensi-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, .22);
}

.btn-masuk  { background: linear-gradient(135deg, var(--brand-to) 0%, var(--brand-accent) 100%); color: #fff; }
.btn-pulang { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: #fff; }

.presensi-card-btn.done {
    background: #f1f5f9 !important;
    color: #475569 !important;
    box-shadow: none;
    border: 1.5px solid #e2e8f0;
}

.presensi-card-btn.done .btn-presensi-icon {
    background: #e2e8f0;
    color: #94a3b8;
}

.done-check {
    position: absolute;
    top: .65rem;
    right: .75rem;
    font-size: 1rem;
    color: #22c55e;
}

.status-today-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem 0;
    border-bottom: 1px solid var(--line);
    font-size: .93rem;
}

.status-today-row:last-child { border-bottom: 0; padding-bottom: 0; }

#presensiMap {
    height: 300px;
    border-radius: 0;
    background: #eef4fa;
}

.gps-refresh-fab {
    display: none;
    position: fixed;
    right: 1.25rem;
    bottom: 5.5rem;
    z-index: 40;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--brand-accent);
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(10, 130, 116, .45);
    place-items: center;
    transition: box-shadow .2s;
}

@media (max-width: 768px) {
    .gps-refresh-fab { display: grid; }
    #presensiMap { height: 240px; }
}

@keyframes fab-spin { to { transform: rotate(360deg); } }
.gps-refresh-fab.spinning .fab-gps-icon { animation: fab-spin .8s linear infinite; }

.selfie-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #0f1d2e;
    border: 1px solid #1a2d3e;
}

.selfie-container video {
    width: 100%;
    height: auto;
    display: block;
    transform: scaleX(-1);
}

.selfie-cam-loading {
    padding: 2.5rem 1rem;
    text-align: center;
    color: rgba(255, 255, 255, .75);
}

[data-theme="dark"] .card {
    background: #132030;
    border-color: #1a2d3e;
    color: #dde4ed;
}

[data-theme="dark"] .card-header {
    background: #0d1a26;
    border-color: #1a2d3e;
    color: #dde4ed;
}

[data-theme="dark"] .card-footer {
    background: #0d1a26;
    border-color: #1a2d3e;
    color: #8a9ab0;
}

[data-theme="dark"] .gps-info-panel {
    background: #132030;
    border-color: #1a2d3e;
}

[data-theme="dark"] .gps-info-panel.gps-out {
    background: #2a1018;
    border-color: #5a1828;
}

[data-theme="dark"] .distance-donut-label { color: #dde4ed; }
[data-theme="dark"] .distance-donut-track { stroke: #1a2d3e; }

[data-theme="dark"] .gps-status.loading   { background: #1a2d3e; color: #8a9ab0; }
[data-theme="dark"] .gps-status.in-range  { background: #0e2a1e; color: #6ee7b7; }
[data-theme="dark"] .gps-status.out-range { background: #2a1018; color: #fca5a5; }

[data-theme="dark"] .accuracy-bar { background: #1a2d3e; }

[data-theme="dark"] .presensi-card-btn.done {
    background: #1a2d3e !important;
    color: #8a9ab0 !important;
    border-color: #1a2d3e;
}

[data-theme="dark"] .presensi-card-btn.done .btn-presensi-icon {
    background: #0d1a26;
    color: #4e5e74;
}

[data-theme="dark"] .status-today-row { border-color: #1a2d3e; }

[data-theme="dark"] #presensiMap { background: #0d1a26; }

[data-theme="dark"] .badge.bg-success-subtle { background-color: #0e2a1e !important; color: #6ee7b7 !important; }
[data-theme="dark"] .badge.bg-secondary-subtle { background-color: #1a2d3e !important; color: #8a9ab0 !important; }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
    position: relative;
    border: 2px dashed var(--bs-border-color);
    border-radius: .75rem;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--bs-body-bg);
}
.upload-zone:hover,
.upload-zone--drag {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .04);
}
.upload-zone--has-file { border-style: solid; border-color: var(--bs-success); }

.upload-zone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.upload-zone__icon  { font-size: 2.2rem; color: var(--bs-secondary); display: block; margin-bottom: .5rem; }
.upload-zone__text  { font-size: .9rem; font-weight: 600; color: var(--bs-body-color); }
.upload-zone__hint  { font-size: .775rem; color: var(--bs-secondary-color); margin-top: .2rem; }
.upload-zone__filename {
    font-size: .85rem;
    font-weight: 600;
    color: var(--bs-success);
    margin: 0;
}

[data-theme="dark"] .upload-zone {
    border-color: #2a3a4a;
    background: #0d1a26;
}
[data-theme="dark"] .upload-zone:hover,
[data-theme="dark"] .upload-zone--drag {
    border-color: #4f8ef7;
    background: rgba(79,142,247,.06);
}
[data-theme="dark"] .upload-zone--has-file { border-color: #6ee7b7; }
[data-theme="dark"] .upload-zone__filename  { color: #6ee7b7; }

/* ── Admin Sidebar Layout ───────────────────────────────────── */

/* Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    width: 260px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--brand-from) 0%, var(--brand-via) 58%, var(--brand-to) 100%);
    box-shadow: 4px 0 28px rgba(8,30,56,.22);
    overflow: hidden;
    transition: transform .27s cubic-bezier(.4,0,.2,1);
}

.admin-sidebar__brand {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.3rem 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}

.admin-sidebar__logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.28);
    color: #fff;
    font-size: 1.3rem;
}

.admin-sidebar__brand strong {
    display: block;
    color: #fff;
    font-weight: 800;
    font-size: .97rem;
    line-height: 1.2;
}

.admin-sidebar__brand small {
    display: block;
    color: rgba(255,255,255,.48);
    font-size: .73rem;
    margin-top: .1rem;
}

/* Nav scroll area */
.admin-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.14) transparent;
}

.admin-sidebar__nav::-webkit-scrollbar { width: 3px; }
.admin-sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }

/* Section headers */
.nav-section {
    padding: .9rem 1.3rem .28rem;
    color: rgba(255,255,255,.36);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
    user-select: none;
}

/* Nav links */
.admin-sidebar__nav a {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 1px .6rem;
    padding: .68rem .85rem;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    border-radius: 9px;
    transition: background .14s, color .14s, box-shadow .14s;
    position: relative;
}

.admin-sidebar__nav a:hover {
    background: rgba(255,255,255,.09);
    color: #fff;
}

.admin-sidebar__nav a.active {
    background: rgba(255,255,255,.14);
    color: #fff;
    box-shadow: inset 3px 0 0 #5eead4;
}

.admin-sidebar__nav a i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.admin-sidebar__nav a span { flex: 1; }

/* Pending badge */
.sidebar-badge {
    min-width: 20px;
    padding: .15rem .45rem;
    border-radius: 99px;
    background: #f59e0b;
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    text-align: center;
    flex-shrink: 0;
}

/* Footer */
.admin-sidebar__footer {
    padding: .8rem .95rem;
    border-top: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}

.admin-sidebar__user {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .35rem 0 .7rem;
}

.admin-sidebar__avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    border: 1.5px solid rgba(255,255,255,.28);
    color: #fff;
    font-weight: 800;
    font-size: .85rem;
}

.admin-sidebar__user div strong {
    display: block;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    max-width: 158px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-sidebar__user div small {
    color: rgba(255,255,255,.48);
    font-size: .72rem;
}

.admin-sidebar__logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    padding: .58rem 1rem;
    border: 1.5px solid rgba(255,255,255,.16);
    border-radius: 9px;
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.68);
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .14s, color .14s;
}

.admin-sidebar__logout:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}

/* Mobile overlay */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0,0,0,.42);
    backdrop-filter: blur(2px);
}

.admin-sidebar-overlay.show { display: block; }

/* Admin content wrapper */
.admin-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Admin topbar */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: .85rem;
    height: 66px;
    padding: 0 1.75rem;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #dbe6f0;
    box-shadow: 0 4px 18px rgba(39,79,116,.06);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.admin-topbar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1.5px solid #dce7f1;
    border-radius: 10px;
    background: #fff;
    color: #52647a;
    cursor: pointer;
    font-size: 1.3rem;
    transition: background .14s, color .14s;
}

.admin-topbar__toggle:hover { background: #eef4fb; color: var(--brand-accent); }

.admin-topbar__title {
    flex: 1;
    color: #121a2d;
    font-size: 1.08rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-topbar__right {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}

/* Admin main */
.admin-main {
    flex: 1;
    padding: 2rem 2.25rem;
}

/* ── Desktop: sidebar always visible ─── */
@media (min-width: 992px) {
    .admin-sidebar  { transform: none !important; }
    .admin-wrap     { margin-left: 260px; }
    .admin-topbar__toggle { display: none !important; }
}

/* ── Mobile: sidebar hidden by default ─ */
@media (max-width: 991px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-topbar__toggle { display: flex; }
    .admin-main { padding: 1.25rem 1rem; }
}

/* ── Dark mode overrides ─────────────── */
[data-theme="dark"] .admin-shell { background: #0a1628; }

[data-theme="dark"] .admin-topbar {
    background: rgba(10,22,38,.97);
    border-bottom-color: #1a2d3e;
}

[data-theme="dark"] .admin-topbar__title { color: #e2eaf4; }

[data-theme="dark"] .admin-topbar__toggle {
    border-color: #2a3a4a;
    background: #0d1a26;
    color: #8a9ab0;
}

[data-theme="dark"] .admin-topbar__toggle:hover {
    background: #1a2d3e;
    color: #5eead4;
}

[data-theme="dark"] .admin-wrap { background: #0a1628; }

/* ── Profile Page ─────────────────────────────────────────── */
.profile-hero {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    padding: 2rem 2rem 0;
    color: #fff;
}
.profile-hero__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e3a5f 0%, #0d9488 55%, #06b6d4 100%);
    z-index: 0;
}
.profile-hero__bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.profile-hero__body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
}
.profile-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    border: 3px solid rgba(255,255,255,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: .03em;
}
.profile-hero__info { flex: 1; min-width: 0; }
.profile-hero__name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-hero__meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 0 .3rem;
    flex-wrap: wrap;
}
.profile-hero__username { font-size: .9rem; opacity: .85; }
.profile-hero__since    { font-size: .8rem; opacity: .7; margin: 0; }

.profile-stat-row {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1px;
    background: rgba(255,255,255,.15);
    border-top: 1px solid rgba(255,255,255,.15);
    margin: 0 -2rem;
}
.profile-stat-chip {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .9rem .5rem;
    gap: .15rem;
}
.profile-stat-chip + .profile-stat-chip { border-left: 1px solid rgba(255,255,255,.15); }
.profile-stat-chip__val { font-size: 1.25rem; font-weight: 700; line-height: 1; }
.profile-stat-chip__lbl { font-size: .7rem; opacity: .8; text-align: center; }
.profile-stat-chip--ok   .profile-stat-chip__val { color: #6ee7b7; }
.profile-stat-chip--warn .profile-stat-chip__val { color: #fbbf24; }

/* face card */
.profile-face-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 2px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    flex-wrap: wrap;
}
.profile-face-card--enrolled { border-color: #0d9488; }
.profile-face-card--empty    { border-color: #f59e0b; }
.profile-face-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.profile-face-card--enrolled .profile-face-card__icon { background: #d1fae5; color: #065f46; }
.profile-face-card--empty    .profile-face-card__icon { background: #fef3c7; color: #92400e; }
.profile-face-card__body { flex: 1; min-width: 0; }

[data-theme="dark"] .profile-face-card { border-color: #2a3a4a; background: #0d1a26; }
[data-theme="dark"] .profile-face-card--enrolled { border-color: #0d9488; }
[data-theme="dark"] .profile-face-card--empty    { border-color: #f59e0b; }
[data-theme="dark"] .profile-face-card--enrolled .profile-face-card__icon { background: #0e2a1e; color: #6ee7b7; }
[data-theme="dark"] .profile-face-card--empty    .profile-face-card__icon { background: #2a1e06; color: #fbbf24; }

@media (max-width: 575px) {
    .profile-hero { padding: 1.25rem 1.25rem 0; }
    .profile-stat-row { margin: 0 -1.25rem; }
    .profile-hero__name { font-size: 1.15rem; }
    .profile-avatar-lg  { width: 60px; height: 60px; font-size: 1.5rem; }
}

/* ── Attendance History ───────────────────────────────────────────── */

.hist-stat {
    border-radius: 12px;
    border-left: 4px solid transparent;
}
.hist-stat__val {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}
.hist-stat__lbl {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: .25rem;
    opacity: .7;
}
.hist-stat--hadir { border-left-color: #16a34a; color: #16a34a; }
.hist-stat--izin  { border-left-color: #2563eb; color: #2563eb; }
.hist-stat--sakit { border-left-color: #d97706; color: #d97706; }
.hist-stat--alpa  { border-left-color: #dc2626; color: #dc2626; }
.hist-stat--cuti  { border-left-color: #0891b2; color: #0891b2; }

.hist-table thead th { white-space: nowrap; }
.hist-weekend td { background: rgba(0,0,0,.025); color: var(--muted); }

[data-theme="dark"] .hist-stat--hadir { color: #4ade80; border-left-color: #4ade80; }
[data-theme="dark"] .hist-stat--izin  { color: #60a5fa; border-left-color: #60a5fa; }
[data-theme="dark"] .hist-stat--sakit { color: #fbbf24; border-left-color: #fbbf24; }
[data-theme="dark"] .hist-stat--alpa  { color: #f87171; border-left-color: #f87171; }
[data-theme="dark"] .hist-stat--cuti  { color: #22d3ee; border-left-color: #22d3ee; }
[data-theme="dark"] .hist-weekend td  { background: rgba(255,255,255,.04); }

/* ── Attendance Settings ─────────────────────────────────────────── */

.settings-icon-wrap {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.settings-icon--masuk  { background: rgba(22,163,74,.12); color: #16a34a; }
.settings-icon--pulang { background: rgba(37,99,235,.12);  color: #2563eb; }

.settings-timeline {
    position: relative;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    margin-top: .25rem;
}
.stl-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stl-ok     { background: linear-gradient(90deg, #bbf7d0, #86efac); }
.stl-late   { background: linear-gradient(90deg, #fde68a, #fbbf24); }
.stl-closed { background: linear-gradient(90deg, #e2e8f0, #cbd5e1); }
.stl-label  { font-size: .68rem; font-weight: 700; letter-spacing: .03em; color: rgba(0,0,0,.55); }

.stl-tick {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0; bottom: 0;
    display: flex; align-items: center;
    pointer-events: none;
}
.stl-tick span {
    background: #fff;
    border: 2px solid rgba(0,0,0,.18);
    border-radius: 6px;
    font-size: .68rem;
    font-weight: 700;
    padding: 1px 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.stl-tick--akhir { left: auto; right: 0; transform: none; }

[data-theme="dark"] .stl-tick span { background: #1e293b; border-color: rgba(255,255,255,.2); color: #e2e8f0; }
[data-theme="dark"] .stl-closed    { background: linear-gradient(90deg, #334155, #475569); }
