/* ==========================================================================
   School Faculty HRIS — Backoffice & Faculty Portal
   Built on Bootstrap 5.3. Tokens first, then layout, then components.
   ========================================================================== */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}

/* ---------------------------------------------------------------- Tokens */
:root {
    --brand: #2f5bea;
    --brand-600: #2449c9;
    --brand-soft: #edf2ff;
    --brand-ring: rgba(47, 91, 234, .18);

    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e5e9f2;
    --line-2: #eef1f7;
    --surface: #ffffff;
    --canvas: #f4f6fb;

    --sidebar-bg: #0e1628;
    --sidebar-bg-2: #131d33;
    --sidebar-ink: #a9b4c9;
    --sidebar-ink-strong: #ffffff;
    --sidebar-muted: #5f6b85;

    --success: #12a150;  --success-soft: #e8f7ee;
    --warning: #c77800;  --warning-soft: #fff5e1;
    --danger:  #dc3545;  --danger-soft:  #fdecee;
    --info:    #0b8ec2;  --info-soft:    #e6f5fb;
    --violet:  #7c4dff;  --violet-soft:  #f1ebff;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
    --sidebar-w: 272px;
    --topbar-h: 64px;

    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: .875rem;
    --bs-body-color: var(--ink-2);
    --bs-body-bg: var(--canvas);
    --bs-border-color: var(--line);
    --bs-primary: var(--brand);
    --bs-primary-rgb: 47, 91, 234;
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 47, 91, 234;
    --bs-link-hover-color: var(--brand-600);
}

/* Faculty Portal uses a teal accent so users always know which area they are in. */
[data-area="portal"] {
    --brand: #0f9488;
    --brand-600: #0b7a70;
    --brand-soft: #e7f6f4;
    --brand-ring: rgba(15, 148, 136, .18);
    --bs-primary-rgb: 15, 148, 136;
    --bs-link-color-rgb: 15, 148, 136;
    --sidebar-bg: #0c1f24;
    --sidebar-bg-2: #10292f;
}

html, body { height: 100%; }
body {
    background: var(--canvas);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.small-caps { font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }
.min-w-0 { min-width: 0; }

/* ---------------------------------------------------------------- Shell */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1; padding: 28px 32px 40px; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: var(--sidebar-ink);
    display: flex;
    flex-direction: column;
}
@media (min-width: 992px) {
    .sidebar { position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
}
.sidebar .offcanvas-header { border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    height: var(--topbar-h); padding: 0 22px;
    color: var(--sidebar-ink-strong);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}
.sidebar-brand img { width: 34px; height: 34px; }
.sidebar-brand .brand-title { font-weight: 700; font-size: .95rem; line-height: 1.1; }
.sidebar-brand .brand-sub { font-size: .6875rem; color: var(--sidebar-muted); letter-spacing: .06em; text-transform: uppercase; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 14px 12px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.nav-section { margin-top: 6px; }
.nav-link-side, .nav-group-toggle {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 9px 12px; border-radius: 9px;
    color: var(--sidebar-ink); font-weight: 500; font-size: .84rem;
    background: none; border: 0; text-align: left;
    transition: background-color .15s, color .15s;
}
.nav-link-side:hover, .nav-group-toggle:hover { color: var(--sidebar-ink-strong); background: rgba(255, 255, 255, .05); }
.nav-link-side .bi, .nav-group-toggle .bi:first-child { font-size: 1.05rem; width: 20px; text-align: center; opacity: .9; }
.nav-link-side.active {
    color: var(--sidebar-ink-strong);
    background: rgba(255, 255, 255, .08);
    box-shadow: inset 3px 0 0 var(--brand);
}
.nav-group-toggle .chev { margin-left: auto; font-size: .7rem; transition: transform .2s; opacity: .6; }
.nav-group-toggle[aria-expanded="true"] { color: var(--sidebar-ink-strong); }
.nav-group-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-sub { padding: 2px 0 6px 20px; margin-left: 10px; border-left: 1px solid rgba(255, 255, 255, .07); }
.nav-sub .nav-link-side { padding: 7px 12px; font-size: .8125rem; }
.nav-sub .nav-link-side .bi { font-size: .95rem; }
.nav-badge {
    margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px;
    background: var(--brand); color: #fff; font-size: .6875rem; font-weight: 600; text-align: center;
}
.sidebar-footer {
    padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .06);
    font-size: .75rem; color: var(--sidebar-muted);
}

/* Topbar */
.topbar {
    position: sticky; top: 0; z-index: 1020;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 32px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar-search { position: relative; max-width: 360px; flex: 1; }
.topbar-search .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar-search input { padding-left: 36px; background: var(--canvas); border-color: transparent; }
.topbar-search input:focus { background: #fff; }
.topbar-date { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.user-chip {
    display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px;
    border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.user-chip:hover { border-color: #d3d9e6; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .75rem;
    object-fit: cover; flex-shrink: 0;
}
.avatar-lg { width: 96px; height: 96px; font-size: 1.5rem; }
.avatar-md { width: 44px; height: 44px; }
.avatar-sm { width: 30px; height: 30px; }

/* Page header */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-header h1 { font-size: 1.5rem; margin: 0; }
.page-header .page-subtitle { color: var(--muted); margin: 4px 0 0; }
.breadcrumb { --bs-breadcrumb-divider-color: #b3bccd; --bs-breadcrumb-item-active-color: var(--muted); font-size: .75rem; margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }

.app-footer { padding: 16px 32px; color: var(--muted); font-size: .75rem; border-top: 1px solid var(--line); background: #fff; }

/* ---------------------------------------------------------------- Cards */
.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius);
    --bs-card-inner-border-radius: calc(var(--radius) - 1px);
    --bs-card-cap-bg: transparent;
    box-shadow: var(--shadow-sm);
}
.card-header { padding: 16px 20px; border-bottom-color: var(--line-2); display: flex; align-items: center; gap: 12px; }
.card-header .card-title { margin: 0; font-size: .95rem; font-weight: 650; color: var(--ink); }
.card-body { padding: 20px; }
.card-footer { background: #fbfcfe; border-top-color: var(--line-2); }

/* KPI cards */
.kpi { position: relative; overflow: hidden; height: 100%; }
.kpi .card-body { display: flex; gap: 16px; align-items: flex-start; }
.kpi-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.kpi-label { color: var(--muted); font-size: .8125rem; font-weight: 500; }
.kpi-value { color: var(--ink); font-size: 1.75rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.kpi-link { position: absolute; inset: 0; }

.tone-brand   { background: var(--brand-soft);   color: var(--brand); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-danger  { background: var(--danger-soft);  color: var(--danger); }
.tone-info    { background: var(--info-soft);    color: var(--info); }
.tone-violet  { background: var(--violet-soft);  color: var(--violet); }
.tone-muted   { background: var(--line-2);       color: var(--muted); }

/* Hero / welcome banner */
.hero {
    border: 0; color: #fff; overflow: hidden; position: relative;
    background: radial-gradient(1200px 300px at 100% 0%, rgba(255,255,255,.18), transparent 60%),
                linear-gradient(120deg, var(--brand) 0%, var(--brand-600) 100%);
}
.hero h2, .hero h3 { color: #fff; }
.hero .text-muted { color: rgba(255, 255, 255, .78) !important; }
.hero .card .text-muted { color: var(--muted) !important; }
.hero-chip { background: rgba(255,255,255,.16); color: #fff; border-radius: 99px; padding: 4px 12px; font-size: .75rem; font-weight: 500; }

/* ---------------------------------------------------------------- Tables */
.table {
    --bs-table-color: var(--ink-2);
    --bs-table-hover-bg: #f7f9fd;
    --bs-table-border-color: var(--line-2);
    margin-bottom: 0;
    font-size: .8438rem;
}
.table > thead th {
    background: #f8fafd;
    color: var(--muted);
    font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    border-bottom: 1px solid var(--line) !important;
    padding-top: 11px; padding-bottom: 11px; white-space: nowrap;
}
.table > :not(caption) > * > * { padding: 12px 16px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-card { border-radius: var(--radius); overflow: hidden; }
.table .cell-title { color: var(--ink); font-weight: 600; }
.table .cell-sub { color: var(--muted); font-size: .75rem; }
.table-actions { white-space: nowrap; text-align: right; }
.table-actions .btn { padding: 4px 8px; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state .bi { font-size: 2.25rem; color: #c3cad8; display: block; margin-bottom: 8px; }

/* ---------------------------------------------------------------- Badges */
.badge { font-weight: 600; font-size: .6875rem; padding: .38em .7em; border-radius: 99px; letter-spacing: .01em; }
.badge-soft-success   { background: var(--success-soft); color: var(--success); }
.badge-soft-warning   { background: var(--warning-soft); color: var(--warning); }
.badge-soft-danger    { background: var(--danger-soft);  color: var(--danger); }
.badge-soft-info      { background: var(--info-soft);    color: var(--info); }
.badge-soft-secondary { background: var(--line-2);       color: var(--muted); }
.badge-soft-primary   { background: var(--brand-soft);   color: var(--brand); }
.badge-soft-violet    { background: var(--violet-soft);  color: var(--violet); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ---------------------------------------------------------------- Forms & buttons */
.form-control, .form-select {
    border-color: var(--line); border-radius: var(--radius-sm);
    padding: .5rem .8rem; font-size: .875rem; color: var(--ink);
}
.form-control-sm, .form-select-sm { padding: .35rem .7rem; font-size: .8125rem; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.form-label { font-weight: 600; font-size: .78rem; color: var(--ink-2); margin-bottom: 6px; }
.form-label .req { color: var(--danger); }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--brand-ring); }
.form-section { padding-bottom: 8px; }
.form-section + .form-section { border-top: 1px solid var(--line-2); padding-top: 22px; }
.form-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.form-section-title .bi { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
.form-section-title h6 { margin: 0; font-size: .9rem; }

.btn { font-weight: 600; font-size: .8125rem; border-radius: var(--radius-sm); padding: .5rem .95rem; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn-sm { padding: .32rem .7rem; font-size: .78rem; border-radius: 8px; }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-600); --bs-btn-active-border-color: var(--brand-600);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-hover-bg: #f6f8fc; --bs-btn-hover-border-color: #d6dce8; --bs-btn-color: var(--ink-2); }
.btn-soft { background: var(--brand-soft); color: var(--brand); border: 0; }
.btn-soft:hover { background: var(--brand); color: #fff; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-ghost-danger { color: var(--danger); background: transparent; border: 0; }
.btn-ghost-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { color: var(--muted); background: transparent; border: 0; }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--line-2); background: #fcfdff; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 160px; }
.filter-bar .grow { flex: 1; min-width: 200px; }

/* Tabs */
.nav-tabs-line { border-bottom: 1px solid var(--line); gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs-line .nav-link {
    border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    color: var(--muted); font-weight: 600; font-size: .8125rem; padding: 12px 11px; white-space: nowrap;
}
.nav-tabs-line .nav-link:hover { color: var(--ink); }
.nav-tabs-line .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: none; }

/* Definition lists (profile details) */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 24px; }
.detail-grid dt { font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.detail-grid dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-word; }

/* Profile header */
.profile-cover { height: 96px; background: linear-gradient(120deg, var(--brand) 0%, var(--brand-600) 60%, #1e293b 140%); border-radius: var(--radius) var(--radius) 0 0; }
.profile-head { display: flex; gap: 20px; align-items: flex-end; padding: 0 24px 20px; margin-top: -48px; flex-wrap: wrap; }
.profile-head .avatar-lg { border: 4px solid #fff; box-shadow: var(--shadow); background: #fff; }
.profile-head > .flex-grow-1, .profile-head > .profile-stats { padding-top: 60px; }
.profile-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .8125rem; }
.profile-meta .bi { margin-right: 4px; }

/* Progress / load bars */
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.bar.over > span { background: var(--danger); }

/* Timetable */
.timetable { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; }
.timetable-day { background: #fafbfe; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; min-height: 140px; }
.timetable-day h6 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 2px 4px 10px; }
.slot { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 9px; padding: 8px 10px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.slot .slot-time { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.slot .slot-title { font-weight: 600; color: var(--ink); font-size: .8125rem; }

/* Timeline list */
.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean > li { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.list-clean > li:last-child { border-bottom: 0; }

/* Clock */
.clock-face { font-size: 3.25rem; font-weight: 700; color: var(--ink); letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }

/* Alerts */
.alert { border-radius: 12px; border: 0; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.alert .bi { font-size: 1.1rem; line-height: 1.2; }
.alert-success { background: var(--success-soft); color: #0b6b36; }
.alert-danger { background: var(--danger-soft); color: #a51d2d; }
.alert-warning { background: var(--warning-soft); color: #8a5300; }
.alert-info { background: var(--info-soft); color: #075e80; }

/* Modals */
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 24px 60px -12px rgba(16, 24, 40, .3); }
.modal-header { border-bottom-color: var(--line-2); padding: 18px 22px; }
.modal-title { font-size: 1rem; }
.modal-body { padding: 22px; }
.modal-footer { border-top-color: var(--line-2); padding: 14px 22px; background: #fbfcfe; border-radius: 0 0 18px 18px; }

/* Pagination */
.pagination { --bs-pagination-border-radius: 8px; --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--ink-2); --bs-pagination-font-size: .8125rem; margin: 0; }
.pagination-wrap { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .8125rem; }
.pagination-wrap nav > div:first-child { display: none !important; }
.pagination-wrap nav > div:last-child { display: flex !important; width: 100%; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagination-wrap p { margin: 0; }

/* ---------------------------------------------------------------- Auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-aside {
    position: relative; overflow: hidden; color: #fff; padding: 48px 56px;
    display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(900px 500px at 110% -10%, rgba(255,255,255,.18), transparent 60%),
                radial-gradient(700px 400px at -10% 110%, rgba(255,255,255,.10), transparent 60%),
                linear-gradient(140deg, var(--brand) 0%, var(--brand-600) 55%, #0f172a 130%);
}
.auth-aside h1 { color: #fff; font-size: 2.1rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; max-width: 460px; }
.auth-aside p { color: rgba(255,255,255,.8); max-width: 420px; font-size: .95rem; }
.auth-feature { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.9); margin-bottom: 12px; font-weight: 500; }
.auth-feature .bi { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); pointer-events: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.6rem; font-weight: 700; }
.input-icon { position: relative; }
.input-icon > .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon > .form-control { padding-left: 40px; height: 46px; }
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 991.98px) {
    .app-content { padding: 20px 16px 32px; }
    .topbar { padding: 0 16px; }
    .app-footer { padding: 14px 16px; }
    .sidebar { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--sidebar-bg); }
}

/* ---------------------------------------------------------------- Print */
.print-only { display: none; }
@media print {
    @page { margin: 12mm; }
    body { background: #fff; font-size: 11px; }
    .sidebar, .topbar, .app-footer, .no-print, .filter-bar, .pagination-wrap, .page-header .btn, .alert { display: none !important; }
    .app-content { padding: 0; }
    .card { box-shadow: none; border: 0; }
    .print-only { display: block; }
    .table > thead th { background: #f1f3f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .table > :not(caption) > * > * { padding: 5px 7px; }
    a { color: inherit; }
}

/* ---------------------------------------------------------------- Scan kiosk */
.kiosk {
    min-height: 100vh; display: flex; flex-direction: column;
    background: radial-gradient(1200px 500px at 100% 0%, rgba(47, 91, 234, .10), transparent 60%), var(--canvas);
}
.kiosk-top {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 14px 28px; color: #fff;
    background: linear-gradient(120deg, var(--sidebar-bg) 0%, #1b2a4a 100%);
}
.kiosk-clock { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kiosk-btn { color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); }
.kiosk-btn:hover { color: #fff; background: rgba(255, 255, 255, .2); }

.kiosk-main {
    flex: 1; display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; gap: 20px;
    padding: 20px 28px 28px; min-height: 0;
}
.kiosk-log { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 124px); }
.kiosk-log-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.log-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.log-item.is-new { animation: logIn .5s ease-out; background: var(--brand-soft); }
@keyframes logIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.log-empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.log-empty .bi { display: block; font-size: 2.4rem; color: #c3cad8; margin-bottom: 8px; }

.punch-am_in  { background: var(--success-soft); color: var(--success); }
.punch-am_out { background: var(--warning-soft); color: var(--warning); }
.punch-pm_in  { background: var(--info-soft); color: var(--info); }
.punch-pm_out { background: var(--violet-soft); color: var(--violet); }

.kiosk-panel { display: flex; flex-direction: column; padding: 24px; gap: 20px; }
.kiosk-scan { position: relative; margin-top: auto; }
.kiosk-scan > .bi { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--brand); }
.kiosk-scan .form-control { height: 60px; padding-left: 56px; font-size: 1.05rem; border-width: 2px; border-color: var(--brand-ring); border-radius: 14px; }
.kiosk-scan .form-control:focus { border-color: var(--brand); }
.kiosk-scan.is-busy .form-control { opacity: .6; }

.kiosk-idle { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; }
.kiosk-idle h2 { font-size: 2rem; font-weight: 700; margin: 18px 0 8px; }
.kiosk-idle p { max-width: 420px; }
.kiosk-idle-icon {
    width: 120px; height: 120px; border-radius: 32px; display: flex; align-items: center; justify-content: center;
    font-size: 3.6rem; color: var(--brand); background: var(--brand-soft); animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--brand-ring); } 50% { box-shadow: 0 0 0 18px transparent; } }

.kiosk-result { flex: 1; display: flex; flex-direction: column; gap: 22px; }
.kiosk-result.pop { animation: pop .35s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.kiosk-banner { display: flex; gap: 16px; align-items: center; padding: 18px 22px; border-radius: 16px; }
.kiosk-banner > .bi { font-size: 2.2rem; }
.kiosk-banner-title { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.kiosk-banner-msg { font-weight: 500; opacity: .9; }
.level-success .kiosk-banner { background: var(--success-soft); color: #0b6b36; }
.level-warning .kiosk-banner { background: var(--warning-soft); color: #8a5300; }
.level-error .kiosk-banner { background: var(--danger-soft); color: #a51d2d; }

.kiosk-person { display: flex; gap: 28px; align-items: center; }
.kiosk-photo { width: 180px; height: 180px; border-radius: 24px; object-fit: cover; box-shadow: var(--shadow); flex-shrink: 0; }
.kiosk-name { font-size: 2.2rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.15; margin-bottom: 10px; }
.kiosk-meta { font-size: 1.05rem; color: var(--ink-2); margin-top: 4px; }
.kiosk-meta .bi { color: var(--muted); margin-right: 8px; }

.kiosk-punches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: auto; }
.punch-tile { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fafbfe; }
.punch-tile-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--muted); }
.punch-tile-time { font-size: 1.4rem; font-weight: 700; color: #b3bccd; font-variant-numeric: tabular-nums; margin-top: 2px; }
.punch-tile.is-done .punch-tile-time { color: var(--ink); }
.punch-tile.is-current { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-ring); }
.punch-tile.is-current .punch-tile-time { color: var(--brand); }

@media (max-width: 991.98px) {
    .kiosk-main { grid-template-columns: 1fr; padding: 16px; }
    .kiosk-log { order: 2; max-height: 420px; }
    .kiosk-person { flex-direction: column; text-align: center; }
    .kiosk-punches { grid-template-columns: repeat(2, 1fr); }
    .kiosk-top { padding: 12px 16px; }
}

/* Kiosk webcam */
.kiosk-cam { width: min(100%, 480px); aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; background: #0e1628; box-shadow: var(--shadow); margin-bottom: 4px; }
.kiosk-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); /* mirror, like a selfie */ }
.table .punch-thumb { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; margin-left: 6px; vertical-align: middle; border: 1px solid var(--line); }
/* Kiosk camera runs out of sight: kept rendering (not display:none) so frames can still be captured. */
.kiosk-cam-alert {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
    background: var(--warning-soft); color: #8a5300; font-weight: 600; font-size: .9rem;
}
.kiosk-cam-alert.d-none { display: none; }
.kiosk-cam-hidden { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.kiosk-cam-hidden video { width: 320px; height: 240px; }
