:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #61708a;
    --line: #d8e0ec;
    --blue: #123f7a;
    --blue-dark: #0a2d59;
    --blue-soft: #eaf1fb;
    --red: #c81e32;
    --red-dark: #9f1727;
    --amber: #93691a;
    --shadow: 0 18px 45px rgba(18, 63, 122, 0.14);
    --panel-shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(200, 30, 50, 0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(18, 63, 122, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(18, 63, 122, 0.08), rgba(245, 247, 251, 0) 330px),
        var(--bg);
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.45;
}

a {
    color: inherit;
}

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

.admin-workspace {
    align-items: flex-start;
    display: grid;
    gap: 18px;
    grid-template-columns: 260px minmax(0, 1fr);
    padding: 12px 12px 24px 0;
}

.admin-sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(234, 241, 251, 0.96));
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--panel-shadow);
    padding: 18px;
    position: sticky;
    top: 92px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.admin-sidebar-title h2 {
    margin: 4px 0 0;
    font-size: 24px;
}

.admin-sidebar-nav {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.sidebar-button {
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--blue);
    font-weight: 700;
    padding: 12px 14px;
    text-decoration: none;
    background: #ffffff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.sidebar-button:hover {
    transform: none;
    box-shadow: 0 10px 18px rgba(18, 63, 122, 0.12);
}

.sidebar-button.active {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    border-color: var(--blue-dark);
    color: #ffffff;
}

.admin-workspace .content {
    width: 100%;
    margin: 0;
    padding: 0;
}

body[data-admin-page="home"] [data-admin-page]:not([data-admin-page="home"]),
body[data-admin-page="register_employee"] [data-admin-page]:not([data-admin-page="register_employee"]),
body[data-admin-page="employees"] [data-admin-page]:not([data-admin-page="employees"]),
body[data-admin-page="attendance_log"] [data-admin-page]:not([data-admin-page="attendance_log"]),
body[data-admin-page="create_department"] [data-admin-page]:not([data-admin-page="create_department"]),
body[data-admin-page="backup_restore"] [data-admin-page]:not([data-admin-page="backup_restore"]),
body[data-admin-page="geofence"] [data-admin-page]:not([data-admin-page="geofence"]),
body[data-admin-page="monthly_report"] [data-admin-page]:not([data-admin-page="monthly_report"]) {
    display: none !important;
}

body[data-admin-page="home"] .setup-section,
body[data-admin-page="employees"] .setup-section,
body[data-admin-page="attendance_log"] .setup-section,
body[data-admin-page="monthly_report"] .setup-section {
    display: none !important;
}

body[data-admin-page="register_employee"] .setup-section,
body[data-admin-page="create_department"] .setup-section,
body[data-admin-page="backup_restore"] .setup-section,
body[data-admin-page="geofence"] .setup-section {
    display: grid;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(18px, 4vw, 56px);
    background: linear-gradient(135deg, rgba(8, 34, 70, 0.97), rgba(18, 63, 122, 0.96));
    border-bottom: 5px solid var(--red);
    box-shadow: 0 18px 40px rgba(8, 34, 70, 0.18);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 40;
}

.brand-lockup {
    align-items: center;
    display: flex;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    flex: 0 0 auto;
}

.brand-kicker {
    color: #c7d9f7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.brand {
    font-size: clamp(17px, 2.8vw, 20px);
    font-weight: 700;
    line-height: 1.25;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a,
.nav-links button,
.link-button {
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--blue);
    border-radius: 999px;
    padding: 10px 14px;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-links a:hover,
.nav-links button:hover,
.link-button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(18, 63, 122, 0.14);
}

.topbar .nav-links a,
.topbar .nav-links button {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.link-button.small-button {
    padding: 7px 10px;
    font-size: 14px;
}

.hero {
    width: min(980px, calc(100% - 32px));
    margin: auto;
    padding: 44px 0;
}

.clock-panel,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.clock-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, 420px);
    gap: 0;
    overflow: hidden;
}

.time-area {
    padding: clamp(28px, 5vw, 56px);
    background:
        linear-gradient(135deg, rgba(200, 30, 50, 0.92), rgba(18, 63, 122, 0.96)),
        var(--blue);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 390px;
}

.date-label {
    color: #f4d8dd;
    font-size: 17px;
    margin-bottom: 18px;
}

.live-time {
    font-size: clamp(48px, 8vw, 82px);
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.time-note {
    margin-top: 20px;
    color: #e8f0ff;
    font-size: 18px;
}

.form-area {
    padding: clamp(26px, 4vw, 42px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1,
h2 {
    margin: 0 0 10px;
    letter-spacing: -0.03em;
}

.muted {
    color: var(--muted);
    margin: 0 0 24px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

input,
select {
    width: 100%;
    border: 1px solid #b9c7c3;
    border-radius: 14px;
    color: var(--ink);
    font: inherit;
    padding: 13px 14px;
    background: #ffffff;
}

input[type="file"] {
    padding: 11px 12px;
}

input:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(18, 63, 122, 0.14);
    outline: 0;
}

.camera-card {
    border: 1px solid var(--line);
    border-left: 4px solid var(--red);
    border-radius: 18px;
    margin-top: 16px;
    padding: 14px;
    background: #fbfdff;
}

.camera-card[hidden] {
    display: none;
}

.camera-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.camera-header span {
    color: var(--muted);
    display: block;
    font-size: 14px;
    margin-top: 3px;
}

.camera-frame {
    aspect-ratio: 1;
    background: #0c1727;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
    width: 100%;
}

.camera-frame video,
.camera-frame img,
.camera-frame canvas {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.camera-frame [hidden] {
    display: none;
}

.camera-message {
    color: var(--muted);
    font-size: 14px;
    margin: 10px 0 0;
    min-height: 18px;
}

.offline-status {
    align-items: center;
    background: var(--blue-soft);
    border: 1px solid #b8cbea;
    border-radius: 6px;
    color: var(--blue);
    display: flex;
    gap: 9px;
    margin: 0 0 18px;
    padding: 10px 12px;
}

.offline-status.offline {
    background: #fdecec;
    border-color: #efb8b8;
    color: var(--red-dark);
}

.offline-status strong {
    color: inherit;
    font-size: 13px;
    margin-left: auto;
}

.status-dot {
    background: var(--blue);
    border-radius: 999px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.offline-status.offline .status-dot {
    background: var(--red);
}

.install-app-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 18px;
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px;
}

.install-app-card[hidden] {
    display: none;
}

.install-app-card span {
    color: var(--ink);
    font-weight: 700;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.button {
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 14px 16px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.full-button {
    display: block;
    width: 100%;
}

.confirmation-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 315px;
}

.confirmation-label {
    align-self: flex-start;
    background: var(--blue-soft);
    border-radius: 999px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 7px 11px;
    text-transform: uppercase;
}

.confirmation-screen h1 {
    font-size: clamp(28px, 6vw, 42px);
    line-height: 1.08;
}

.confirmation-screen p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.45;
    margin: 8px 0 22px;
}

.confirmation-screen dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 20px;
}

.confirmation-screen dl div {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
}

.confirmation-screen dt {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 5px;
}

.confirmation-screen dd {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.button.primary {
    background: var(--red);
}

.button.primary:hover {
    background: var(--red-dark);
}

.button.secondary {
    background: var(--blue);
}

.button.secondary:hover {
    background: var(--blue-dark);
}

.button.danger {
    background: var(--red);
}

.alert {
    border-radius: 16px;
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid transparent;
}

.alert.success {
    background: var(--blue-soft);
    border-color: #b8cbea;
    color: var(--blue);
}

.alert.error {
    background: #fdecec;
    border-color: #efb8b8;
    color: #8c2525;
}

.alert.warning {
    background: #fff6e7;
    border-color: #f2d298;
    color: #855b10;
}

.content {
    width: 100%;
    margin: 16px 0 28px;
}

.panel {
    padding: clamp(18px, 3vw, 30px);
}

.admin-dashboard {
    display: grid;
    gap: 20px;
    align-content: start;
}

.dashboard-hero {
    align-items: end;
    background:
        linear-gradient(135deg, rgba(18, 63, 122, 0.98), rgba(42, 94, 148, 0.95) 58%, rgba(200, 30, 50, 0.9)),
        var(--blue);
    color: #ffffff;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 560px);
    overflow: hidden;
    position: relative;
    border-radius: 24px;
    isolation: isolate;
}

.dashboard-hero::before,
.dashboard-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    z-index: -1;
}

.dashboard-hero::before {
    width: 320px;
    height: 320px;
    top: -140px;
    right: -70px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
}

.dashboard-hero::after {
    width: 230px;
    height: 230px;
    bottom: -100px;
    left: -70px;
    background: radial-gradient(circle, rgba(255, 215, 220, 0.24), rgba(255, 215, 220, 0));
}

.dashboard-hero .muted {
    color: #e5edf8;
    margin-bottom: 0;
}

.dashboard-title h1 {
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.03;
    margin-bottom: 12px;
}

.eyebrow {
    color: var(--red);
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.dashboard-hero .eyebrow {
    color: #ffd9de;
}

.filter-panel {
    align-items: end;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr auto auto;
    padding: 14px;
    backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.filter-panel label {
    color: #ffffff;
    font-size: 13px;
}

.filter-panel input,
.filter-panel select {
    border-color: rgba(255, 255, 255, 0.55);
}

.filter-panel .button {
    min-width: 82px;
}

.stats-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--panel-shadow);
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
    transform: none;
    box-shadow: 0 18px 34px rgba(18, 63, 122, 0.15);
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--blue), var(--red));
}

.stat-card span,
.stat-card small {
    color: var(--muted);
    display: block;
}

.stat-card span {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.stat-card strong {
    color: var(--blue);
    display: block;
    font-size: 36px;
    line-height: 1;
    margin: 12px 0 8px;
}

.stat-card small {
    font-size: 13px;
}

.dashboard-section,
.records-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--panel-shadow);
    padding: clamp(18px, 3vw, 26px);
    position: relative;
}

.dashboard-section::before,
.records-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(90deg, rgba(18, 63, 122, 0.85), rgba(200, 30, 50, 0.78));
}

.section-heading {
    align-items: end;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-heading .muted {
    max-width: 520px;
    text-align: right;
}

.section-heading h2,
.records-toolbar h2 {
    font-size: 26px;
    margin-bottom: 4px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
}

.profile-review-shell {
    display: grid;
    gap: 12px;
}

.profile-name-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-name-button {
    border: 1px solid #b8cbea;
    background: #f4f8ff;
    color: var(--blue);
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.profile-name-button:hover {
    background: #e6eefb;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(18, 63, 122, 0.12);
}

.profile-name-button:focus-visible {
    outline: 2px solid rgba(18, 63, 122, 0.35);
    outline-offset: 2px;
}

.profile-review-note {
    margin: 0;
}

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 18px;
}

body.modal-open {
    overflow: hidden;
}

.profile-modal[hidden] {
    display: none;
}

.profile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 22, 41, 0.58);
}

.profile-modal-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 42px rgba(9, 22, 41, 0.25);
    padding: 20px;
    animation: modal-pop 0.2s ease;
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-modal-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    position: absolute;
    right: 14px;
    top: 10px;
}

.profile-modal-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-right: 56px;
}

.profile-modal-head h3 {
    margin: 0 0 3px;
    font-size: 24px;
}

.profile-modal-head p {
    margin: 0;
    color: var(--muted);
}

.profile-modal-avatar {
    align-items: center;
    justify-content: center;
    display: flex;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(18, 63, 122, 0.14), rgba(200, 30, 50, 0.16));
    border: 2px solid rgba(18, 63, 122, 0.12);
    flex: 0 0 auto;
}

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

.profile-modal-avatar span {
    color: var(--blue);
    font-size: 24px;
    font-weight: 800;
}

.profile-modal-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.profile-modal-metrics div {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
}

.profile-modal-metrics dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.profile-modal-metrics dd {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.admin-box {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    background: #fbfdff;
    min-width: 0;
}

a.admin-box {
    color: inherit;
    display: block;
    text-decoration: none;
}

.overview-link-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 160px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.overview-link-card:hover {
    transform: none;
    box-shadow: 0 16px 30px rgba(18, 63, 122, 0.12);
}

body[data-admin-page] .nav-links a:hover,
body[data-admin-page] .nav-links button:hover,
body[data-admin-page] .link-button:hover,
body[data-admin-page] .button:hover,
body[data-admin-page] .profile-name-button:hover {
    transform: none;
}

.admin-box h2 {
    font-size: 20px;
}

.backup-box {
    margin-bottom: 18px;
    border-top: 4px solid var(--blue);
}

.backup-actions {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, auto) minmax(260px, 1fr);
    align-items: start;
}

.backup-actions .button {
    width: 100%;
}

.primary-admin-box {
    border-top: 4px solid var(--red);
}

.import-box {
    border-top: 4px solid var(--blue);
}

.wide-admin-box {
    grid-column: span 2;
}

.directory-grid {
    grid-template-columns: minmax(280px, 0.75fr) minmax(420px, 1.25fr);
}

.directory-grid .wide-admin-box {
    grid-column: auto;
}

.employees-box {
    min-width: 0;
}

.stacked-form {
    display: grid;
    gap: 12px;
}

.stacked-form label {
    margin-bottom: -4px;
}

.register-snapshot-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.register-mini-stat strong {
    font-size: clamp(26px, 3.6vw, 40px);
}

.register-admin-grid {
    align-items: start;
}

.bootstrap-register-surface {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        var(--panel);
}

.bootstrap-register-card {
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
}

.bootstrap-employees-surface {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        var(--panel);
}

.bootstrap-employees-card {
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
}

.bootstrap-overview-surface {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        var(--panel);
}

.bootstrap-overview-card {
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
    min-height: 148px;
}

.overview-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.overview-hero-chip {
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    text-transform: uppercase;
}

.bootstrap-filter-bar {
    background: rgba(18, 63, 122, 0.05);
    border: 1px solid rgba(18, 63, 122, 0.14);
    border-radius: 14px;
    padding: 10px 12px;
}

.bootstrap-home-offline {
    border-radius: 12px;
}

.bootstrap-home-clock-panel {
    overflow: visible;
    align-items: start;
}

.bootstrap-home-time-area {
    position: sticky;
    top: 108px;
    border-radius: 22px 0 0 22px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.bootstrap-home-time-area .live-time {
    text-shadow: 0 10px 18px rgba(4, 16, 32, 0.35);
    letter-spacing: 0.02em;
}

.bootstrap-home-form-area {
    border: 1px solid rgba(18, 63, 122, 0.1);
    border-left: 0;
    border-radius: 0 22px 22px 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
}

.admin-login-hero {
    width: min(620px, calc(100% - 24px));
}

.admin-login-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        var(--panel);
    box-shadow: 0 18px 36px rgba(17, 24, 39, 0.09);
}

.admin-login-head {
    margin-bottom: 14px;
}

.admin-login-head .muted {
    margin: 0;
}

.admin-login-form {
    gap: 10px;
}

.admin-login-form .form-control {
    border-radius: 12px;
    padding: 11px 12px;
}

.admin-login-actions {
    margin-top: 6px;
    grid-template-columns: 1fr 1fr;
}

.bootstrap-search-item {
    display: grid;
    gap: 6px;
}

.bootstrap-employees-card .table {
    --bs-table-striped-bg: rgba(18, 63, 122, 0.03);
}

.bootstrap-employees-card .table thead th {
    background: rgba(18, 63, 122, 0.08);
    border-bottom-width: 1px;
    color: var(--blue-dark);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bootstrap-attendance-surface {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        var(--panel);
}

.bootstrap-attendance-surface .table {
    --bs-table-striped-bg: rgba(18, 63, 122, 0.03);
}

.bootstrap-attendance-surface .table thead th {
    background: rgba(18, 63, 122, 0.08);
    border-bottom-width: 1px;
    color: var(--blue-dark);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bootstrap-department-surface {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        var(--panel);
}

.bootstrap-department-card {
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
}

.bootstrap-department-card .table {
    --bs-table-striped-bg: rgba(18, 63, 122, 0.03);
}

.bootstrap-department-card .table thead th {
    background: rgba(18, 63, 122, 0.08);
    border-bottom-width: 1px;
    color: var(--blue-dark);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bootstrap-backup-surface {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        var(--panel);
}

.bootstrap-backup-card {
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
}

.bootstrap-backup-actions {
    grid-template-columns: minmax(240px, 0.55fr) minmax(320px, 1fr);
}

.bootstrap-geofence-surface {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        var(--panel);
}

.bootstrap-geofence-card {
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
}

.bootstrap-geofence-card .form-check-input {
    margin-top: 0;
}

.bootstrap-monthly-surface {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        var(--panel);
}

.bootstrap-monthly-card {
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
}

.bootstrap-monthly-card .table {
    --bs-table-striped-bg: rgba(18, 63, 122, 0.03);
}

.bootstrap-monthly-card .table thead th {
    background: rgba(18, 63, 122, 0.08);
    border-bottom-width: 1px;
    color: var(--blue-dark);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.monthly-live-charts {
    margin-top: 4px;
}

.monthly-live-chart-card {
    display: grid;
    gap: 10px;
}

.monthly-live-chart-head h3 {
    font-size: 20px;
    margin: 0;
}

.monthly-live-chart-head .muted {
    margin: 4px 0 0;
}

.monthly-live-canvas-wrap {
    height: 320px;
}

.monthly-live-canvas-wrap-pie {
    height: 320px;
}

.monthly-live-updated {
    font-size: 12px;
    margin: 4px 0 0;
}

.register-inline-alert {
    margin: 2px 0 2px;
}

.register-admin-grid .import-box {
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    margin: -6px 0 2px;
}

.warning-hint {
    color: var(--amber);
    font-weight: 700;
}

.import-file-input {
    background: #f7faff;
    border: 1px dashed #96add6;
    border-radius: 14px;
    padding: 10px 12px;
}

.checkbox-field {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-bottom: 0;
}

.checkbox-field input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.geofence-tools {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.geofence-status {
    color: var(--muted);
    font-size: 13px;
}

.monthly-report-section {
    display: grid;
    gap: 18px;
}

.analysis-box {
    display: grid;
    gap: 18px;
}

.monthly-report-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.monthly-report-form .button {
    height: fit-content;
}

.monthly-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.monthly-stat-card strong {
    font-size: clamp(22px, 3vw, 34px);
}

.monthly-chart-wrap {
    overflow: hidden;
}

.monthly-chart {
    align-items: flex-end;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.monthly-chart-day {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 76px;
}

.monthly-chart-bars {
    align-items: flex-end;
    display: flex;
    gap: 8px;
    height: 180px;
    justify-content: center;
    width: 100%;
}

.monthly-chart-bar-group {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 28px;
}

.monthly-chart-bar-track {
    align-items: flex-end;
    background: #eef4fb;
    border: 1px solid var(--line);
    border-radius: 999px;
    display: flex;
    height: 160px;
    overflow: hidden;
    width: 100%;
}

.monthly-chart-bar-track-late {
    background: #fff3f4;
}

.monthly-chart-bar {
    border-radius: 999px;
    min-height: 4px;
    width: 100%;
}

.monthly-chart-bar-complete {
    background: linear-gradient(180deg, var(--blue), #4a79bb);
}

.monthly-chart-bar-late {
    background: linear-gradient(180deg, var(--red), #ef7d8b);
}

.monthly-chart-bar-group span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.monthly-chart-meta {
    display: grid;
    gap: 2px;
    text-align: center;
}

.monthly-chart-meta strong {
    color: var(--ink);
    font-size: 16px;
}

.monthly-chart-meta span,
.monthly-chart-meta small {
    color: var(--muted);
    font-size: 11px;
}

.monthly-chart-total {
    display: none;
}

.monthly-summary-table-wrap {
    max-height: 42vh;
}

.staff-filter-bar {
    margin-bottom: 8px;
}

.staff-filter-bar .search-item {
    min-width: min(100%, 360px);
}

.compact-toolbar {
    align-items: flex-start;
    margin-bottom: 12px;
}

.mini-table-wrap {
    max-height: 52vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.editable-table input,
.editable-table select,
td input,
td select {
    min-width: 135px;
    padding: 9px 10px;
}

.row-form {
    display: flex;
    gap: 8px;
}

.action-cell {
    align-items: center;
    display: flex;
    gap: 6px;
    min-width: 140px;
}

.action-cell .inline-form {
    margin: 0;
}

.small-empty {
    padding: 18px;
}

.inline-form {
    display: inline;
}

.danger-link {
    color: var(--red);
    padding: 7px 10px;
}

.toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar select {
    min-width: 190px;
}

.toolbar label {
    margin-bottom: 6px;
}

.export-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.records-filter-bar {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(240px, 1fr) minmax(150px, 180px);
    align-items: end;
}

.records-filter-item {
    display: grid;
    gap: 6px;
}

.records-filter-item label {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.records-filter-item input,
.records-filter-item select {
    border-radius: 12px;
    padding: 9px 10px;
}

.records-filter-summary {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin: 10px 0 8px;
}

.records-toolbar {
    border-bottom: 1px solid var(--line);
    margin-bottom: 0;
    padding-bottom: 16px;
}

.records-panel .table-wrap {
    margin: 0 -10px -8px;
    max-height: 62vh;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
}

.records-panel table,
.mini-table-wrap table {
    min-width: 980px;
}

.records-panel table {
    min-width: 0;
    table-layout: fixed;
}

.records-panel th,
.records-panel td {
    white-space: normal;
    word-break: break-word;
    padding: 8px 7px;
    font-size: 12px;
}

.records-panel td input,
.records-panel td select {
    min-width: 0;
    padding: 7px 8px;
    font-size: 12px;
}

.records-panel .photo-link img {
    height: 40px;
    width: 40px;
    border-radius: 10px;
}

.records-panel .action-cell {
    flex-direction: column;
    align-items: stretch;
    min-width: 88px;
}

.records-panel .action-cell .link-button {
    width: 100%;
    text-align: center;
}

.mini-table-wrap::-webkit-scrollbar,
.records-panel .table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.mini-table-wrap::-webkit-scrollbar-thumb,
.records-panel .table-wrap::-webkit-scrollbar-thumb {
    background: rgba(18, 63, 122, 0.35);
    border-radius: 999px;
}

.mini-table-wrap::-webkit-scrollbar-track,
.records-panel .table-wrap::-webkit-scrollbar-track {
    background: rgba(18, 63, 122, 0.08);
    border-radius: 999px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f7f9fc;
    color: #31455d;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody tr:hover {
    background: #f9fbff;
}

.photo-link {
    display: inline-flex;
}

.photo-link img {
    border: 2px solid var(--line);
    border-radius: 14px;
    display: block;
    height: 52px;
    object-fit: cover;
    width: 52px;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 13px;
    font-weight: 700;
}

.badge.complete {
    background: var(--blue-soft);
    color: var(--blue);
}

.badge.incomplete {
    background: #fff2d6;
    color: var(--amber);
}

.flag-badge {
    display: inline-block;
    border-radius: 999px;
    background: #fdecec;
    border: 1px solid #efb8b8;
    color: #8c2525;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
}

.empty {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed #b9c7c3;
    border-radius: 18px;
    background: #fbfdff;
}

.print-report,
.employee-print-report {
    display: none;
}

@media (max-width: 760px) {
    body {
        background: var(--bg);
    }

    .hero {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .content {
        width: 100%;
        margin: 12px 0 24px;
    }

    .clock-panel {
        grid-template-columns: 1fr;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .time-area {
        min-height: 230px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand-lockup {
        align-items: flex-start;
    }

    .actions {
        grid-template-columns: 1fr;
    }

    .form-area {
        min-height: calc(100vh - 315px);
    }

    .confirmation-screen dl {
        grid-template-columns: 1fr;
    }

    .admin-dashboard {
        width: 100%;
    }

    .admin-workspace {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .admin-sidebar {
        position: relative;
        top: auto;
    }

    .dashboard-hero,
    .filter-panel,
    .stats-grid,
    .admin-grid,
    .directory-grid,
    .profile-modal-metrics {
        grid-template-columns: 1fr;
    }

    .bootstrap-home-clock-panel {
        overflow: hidden;
    }

    .bootstrap-home-time-area {
        position: relative;
        top: auto;
        border-radius: 0;
    }

    .bootstrap-home-form-area {
        border: 0;
        border-radius: 0;
    }

    .admin-login-hero {
        width: 100%;
    }

    .admin-login-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-hero,
    .dashboard-section,
    .records-panel {
        border-radius: 18px;
    }

    .wide-admin-box {
        grid-column: auto;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .section-heading .muted {
        text-align: left;
    }

    .dashboard-title h1 {
        font-size: 34px;
    }

    .filter-panel .button {
        width: 100%;
    }

    .filter-panel input,
    .filter-panel select,
    .toolbar select {
        width: 100%;
        min-width: 0;
    }

    .records-filter-bar {
        grid-template-columns: 1fr;
    }

    .backup-actions {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        gap: 12px;
    }

    .profile-modal-metrics {
        gap: 8px;
    }

    .profile-modal-metrics div {
        padding: 9px 10px;
    }

    .row-form {
        min-width: 260px;
    }
}

@media (max-width: 980px) {
    .admin-workspace {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: relative;
        top: auto;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        grid-template-columns: 1fr 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }

    .register-snapshot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wide-admin-box {
        grid-column: span 2;
    }

    .directory-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .content,
    .admin-dashboard {
        width: 100%;
    }

    .dashboard-hero,
    .dashboard-section,
    .records-panel,
    .admin-box,
    .panel {
        border-radius: 16px;
    }

    .stats-grid,
    .register-snapshot-grid,
    .admin-grid,
    .filter-panel {
        grid-template-columns: 1fr;
    }

    .section-heading {
        margin-bottom: 14px;
    }

    .section-heading h2,
    .records-toolbar h2 {
        font-size: 22px;
    }

    .dashboard-title h1 {
        font-size: 30px;
    }

    .stat-card strong {
        font-size: 30px;
    }

    .profile-modal-metrics {
        grid-template-columns: 1fr;
    }

    .records-panel table,
    .mini-table-wrap table {
        min-width: 0;
    }

    .records-panel .table-wrap {
        max-height: 58vh;
    }

    .toolbar {
        align-items: stretch;
    }

    .export-links,
    .toolbar form {
        width: 100%;
    }

    .export-links .link-button,
    .toolbar .button,
    .toolbar .link-button {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .profile-name-button,
    .profile-modal-card,
    .button,
    .link-button {
        transition: none;
        animation: none;
    }
}

@media print {
    @page {
        size: landscape;
        margin: 0.35in;
    }

    body {
        background: #ffffff;
        color: #000000;
    }

    .topbar,
    .dashboard-hero,
    .admin-grid,
    .dashboard-section,
    .stats-grid,
    .export-links,
    .records-filter-bar,
    .records-filter-summary,
    #recordsFilterEmpty,
    .filter-panel,
    .photo-link img,
    .records-panel {
        display: none;
    }

    .content {
        margin: 0;
        width: 100%;
    }

    .panel {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    body[data-print-mode="attendance"] .print-report,
    body:not([data-print-mode]) .print-report {
        display: block;
        padding: 0;
    }

    body[data-print-mode="monthly"] .monthly-report-section {
        display: block;
        padding: 0;
    }

    body[data-print-mode="monthly"] .monthly-report-section .analysis-box {
        display: grid;
        padding: 0;
    }

    body[data-print-mode="monthly"] .monthly-report-section .monthly-report-form,
    body[data-print-mode="monthly"] .monthly-report-section .button {
        display: none;
    }

    body[data-print-mode="monthly"] .monthly-report-section .monthly-chart {
        overflow: visible;
    }

    body[data-print-mode="employees"] .employee-print-report {
        display: block;
        padding: 0;
    }

    body[data-print-mode="employees"] .print-report {
        display: none;
    }

    body[data-print-mode="monthly"] .print-report,
    body[data-print-mode="monthly"] .employee-print-report {
        display: none;
    }

    .print-report-header {
        align-items: flex-start;
        border-bottom: 3px solid var(--blue);
        display: flex;
        justify-content: space-between;
        gap: 18px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .print-report-header h2 {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .print-report-header p {
        margin: 0;
        color: #444;
    }

    .print-report-meta {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-width: 320px;
    }

    .print-report-meta div {
        border: 1px solid #c9d3e1;
        border-radius: 10px;
        padding: 8px 10px;
    }

    .print-report-meta span {
        color: #5b6573;
        display: block;
        font-size: 11px;
        text-transform: uppercase;
    }

    .print-report-meta strong {
        display: block;
        font-size: 13px;
        margin-top: 2px;
    }

    .print-department-block {
        margin-bottom: 18px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-department-heading {
        align-items: center;
        display: flex;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 10px;
    }

    .print-department-heading h3 {
        font-size: 18px;
        margin: 0;
    }

    .print-department-heading span {
        color: #516070;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
        margin-bottom: 10px;
    }

    .print-table th,
    .print-table td {
        border: 1px solid #c9d3e1;
        padding: 6px 7px;
    }

    .print-table th {
        background: #f2f6fc;
        color: #20324d;
    }

    .print-table td {
        background: #ffffff;
    }

    .employee-directory-print-table {
        font-size: 10px;
    }

    .employee-directory-print-table th:first-child,
    .employee-directory-print-table td:first-child {
        text-align: right;
        width: 34px;
    }

    .employee-directory-print-table th:nth-child(2),
    .employee-directory-print-table td:nth-child(2) {
        width: 125px;
    }

    .employee-directory-print-table th:nth-child(3),
    .employee-directory-print-table td:nth-child(3) {
        width: 265px;
    }

    .toolbar {
        border-bottom: 3px solid var(--blue);
        display: block;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    table {
        font-size: 11px;
    }

    th,
    td {
        padding: 7px 5px;
    }

}

@media (max-width: 430px) {
    .topbar {
        padding: 14px 16px;
    }

    .nav-links {
        width: 100%;
    }

    .nav-links a,
    .nav-links button {
        flex: 1 1 0;
        justify-content: center;
        text-align: center;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .live-time {
        font-size: 46px;
    }

    .date-label,
    .time-note,
    .confirmation-screen p {
        font-size: 16px;
    }
}
