:root {
    --navy: #08245c;
    --dark: #071326;
    --royal: #0a3f9f;
    --gold: #ffc400;
    --gold-deep: #e5a800;
    --ink: #0e1e3a;
    --muted: #59697e;
    --line: #d8e0eb;
    --surface: #f4f7fb;
    --white: #ffffff;
    --radius: 8px;
    --shadow: 0 18px 50px rgba(8, 36, 92, .16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--surface);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(8, 36, 92, .94), rgba(7, 19, 38, .88)),
        url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-pwa-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 50;
    width: min(520px, calc(100% - 24px));
    min-height: 58px;
    padding: 10px 10px 10px 12px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto 34px;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 196, 0, .38);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 18px 40px rgba(7, 19, 38, .24);
    transform: translate(-50%, -110%);
    opacity: 0;
    transition: transform .28s ease, opacity .28s ease;
}

.login-pwa-banner.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.login-pwa-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: rgba(255, 196, 0, .16);
    color: var(--royal);
}

.login-pwa-icon i {
    font-size: 22px;
}

.login-pwa-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.login-pwa-copy strong {
    color: var(--navy);
    font-size: 14px;
    line-height: 1.1;
}

.login-pwa-copy span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.login-pwa-install,
.login-pwa-close {
    border: 0;
    cursor: pointer;
}

.login-pwa-install {
    min-height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    color: var(--dark);
    font-size: 13px;
    font-weight: 900;
}

.login-pwa-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--navy);
}

.login-pwa-close i {
    font-size: 20px;
}

.login-pwa-install:hover,
.login-pwa-close:hover {
    filter: brightness(.98);
}

.login-card {
    position: relative;
    width: min(430px, 100%);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
    text-align: center;
}

.login-back-link {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--navy);
}

.login-back-link i {
    font-size: 20px;
}

.login-back-link:hover {
    border-color: var(--royal);
    color: var(--royal);
}

.login-logo {
    display: flex;
    width: 230px;
    margin: 0 auto 22px;
}

.login-logo img {
    width: 100%;
    height: auto;
}

.admin-kicker {
    display: inline-block;
    color: var(--gold-deep);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 4px 0 8px;
    color: var(--navy);
    font-size: 34px;
    line-height: 1;
}

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

.login-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(168, 53, 53, .25);
    border-radius: var(--radius);
    background: #fff1f1;
    color: #8b2424;
    font-weight: 800;
    font-size: 14px;
}

.login-form {
    display: grid;
    gap: 16px;
    text-align: left;
}

.login-form label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-weight: 800;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    outline: none;
}

.login-form input:focus {
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(10, 63, 159, .14);
}

.login-form .remember-user {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: fit-content;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

.remember-user input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--gold-deep);
    cursor: pointer;
}

.login-form button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    color: var(--dark);
    font-weight: 900;
    cursor: pointer;
}

.login-form button:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.login-security-notice {
    margin: -3px 0 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.login-pwa-details {
    margin-top: 18px;
    padding-top: 14px;
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.login-pwa-details div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.login-pwa-details strong {
    color: var(--navy);
    font-size: 12px;
    text-transform: none;
}

.login-pwa-details p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.login-loading-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 19, 38, .52);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(4px);
    transition: opacity .22s ease;
}

.login-loading-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.login-loading-dialog {
    width: min(310px, 100%);
    padding: 24px;
    display: grid;
    justify-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 196, 0, .28);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 22px 52px rgba(7, 19, 38, .32);
    text-align: center;
    transform: translateY(8px) scale(.98);
    transition: transform .22s ease;
}

.login-loading-modal.is-visible .login-loading-dialog {
    transform: translateY(0) scale(1);
}

.login-loading-ring {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(10, 63, 159, .16);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: login-loading-spin .78s linear infinite;
}

.login-loading-dialog strong {
    color: var(--navy);
    font-size: 18px;
}

.login-loading-dialog p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

@keyframes login-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 50px;
}

.login-form .password-toggle,
.admin-form .password-toggle,
.note-form .password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 36px;
    min-height: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--royal);
    box-shadow: none;
    transform: translateY(-50%);
}

.login-form .password-toggle:hover,
.login-form .password-toggle:focus-visible,
.admin-form .password-toggle:hover,
.admin-form .password-toggle:focus-visible,
.note-form .password-toggle:hover,
.note-form .password-toggle:focus-visible {
    background: rgba(10, 63, 159, .08);
    outline: none;
}

.password-toggle i {
    font-size: 20px;
    line-height: 1;
}

.staff-shell {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(7, 19, 38, .98), rgba(8, 36, 92, .9) 235px, var(--surface) 235px);
}

.staff-main {
    width: min(1060px, 100%);
    margin: 0 auto;
    padding: 14px clamp(12px, 4vw, 24px) 42px;
}

.staff-logo {
    display: inline-flex;
    width: 145px;
    grid-column: 1;
    grid-row: 1;
}

.staff-logo img {
    width: 100%;
    height: auto;
}

.staff-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(7, 19, 38, .3);
    color: var(--white);
}

.staff-hero-copy {
    min-width: 0;
    grid-column: 1;
    grid-row: 2;
}

.staff-hero span,
.staff-card-heading span,
.staff-metrics span {
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.staff-hero h1 {
    margin: 4px 0;
    font-size: clamp(28px, 4.2vw, 46px);
    line-height: 1;
}

.staff-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .78);
}

.staff-logout {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: #fff3f1;
    color: #b42318;
}

.staff-logout i {
    font-size: 22px;
}

.staff-notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(18, 183, 106, .24);
    border-radius: var(--radius);
    background: #ecfdf3;
    color: #067647;
    font-weight: 900;
}

.staff-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    align-items: start;
    gap: 16px;
}

.staff-card {
    padding: clamp(18px, 2.3vw, 24px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 10px 28px rgba(8, 36, 92, .09);
}

.staff-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.staff-card-heading.compact {
    margin-bottom: 12px;
}

.staff-card-heading h2 {
    margin: 4px 0 0;
    color: var(--navy);
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.08;
}

.staff-card-heading i {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: rgba(255, 196, 0, .15);
    color: var(--royal);
    font-size: 24px;
}

.staff-shift-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
}

.staff-shift-list div {
    min-height: 78px;
    padding: 13px;
    border-radius: var(--radius);
    background: var(--surface);
}

.staff-shift-list dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.staff-shift-list dd {
    margin: 4px 0 0;
    color: var(--ink);
    font-weight: 900;
}

.staff-location-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.staff-location-line span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.staff-map-button,
.staff-location-close {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--royal);
    cursor: pointer;
}

.staff-map-button {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.staff-map-button i {
    font-size: 20px;
}

.staff-map-button:hover,
.staff-location-close:hover {
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(10, 63, 159, .1);
}

.staff-map-button:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}

.staff-location-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 19, 38, .68);
}

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

.staff-location-dialog {
    position: relative;
    width: min(720px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    overflow: auto;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.staff-location-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.staff-location-close i {
    font-size: 21px;
}

.staff-location-header {
    padding-right: 42px;
    margin-bottom: 14px;
}

.staff-location-header span {
    color: var(--gold-deep);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.staff-location-header h2 {
    margin: 4px 0 6px;
    color: var(--navy);
    font-size: 26px;
    line-height: 1.1;
}

.staff-location-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.staff-company-map {
    width: 100%;
    min-height: 360px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.staff-location-coordinates {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.punch-card {
    display: grid;
    align-content: start;
}

.staff-clock-value {
    margin: 0;
    color: var(--navy);
    font-size: 44px;
    font-weight: 900;
    line-height: 1;
}

.staff-clock-label {
    margin: 8px 0 18px;
    color: var(--muted);
}

.staff-access-steps {
    display: grid;
    gap: 12px;
}

.staff-step {
    position: relative;
    display: grid;
    gap: 9px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff, var(--surface));
}

.staff-step::before {
    content: attr(data-step);
    position: absolute;
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 196, 0, .16);
    color: var(--gold-deep);
    font-size: 12px;
    font-weight: 900;
}

.staff-step-header {
    padding-right: 34px;
}

.staff-step-header span,
.staff-step-header strong {
    display: block;
}

.staff-step-header span {
    color: var(--gold-deep);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.staff-step-header strong {
    margin-top: 1px;
    color: var(--navy);
    font-size: 15px;
    line-height: 1.2;
}

.staff-geofence-status {
    margin: 0 0 14px;
    padding: 11px 12px;
    border: 1px solid rgba(229, 168, 0, .32);
    border-radius: var(--radius);
    background: rgba(255, 196, 0, .12);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.staff-geofence-status[data-status="ok"] {
    border-color: rgba(18, 183, 106, .28);
    background: #ecfdf3;
    color: #067647;
}

.staff-geofence-status[data-status="error"] {
    border-color: rgba(180, 35, 24, .25);
    background: #fff1f1;
    color: #8b2424;
}

.staff-geofence-status[data-status="checking"] {
    border-color: rgba(10, 63, 159, .2);
    background: rgba(10, 63, 159, .08);
    color: var(--navy);
}

.staff-step .staff-geofence-status,
.staff-step .staff-face-status {
    margin: 0;
}

.staff-face-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin: 0 0 14px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.staff-face-status strong,
.staff-face-status span {
    display: block;
}

.staff-face-status strong {
    color: var(--navy);
    font-size: 14px;
}

.staff-face-status span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.staff-face-status[data-status="ok"] {
    border-color: rgba(18, 183, 106, .28);
    background: #ecfdf3;
}

.staff-face-status[data-status="ok"] strong,
.staff-face-status[data-status="ok"] span {
    color: #067647;
}

.staff-face-status[data-status="error"] {
    border-color: rgba(180, 35, 24, .25);
    background: #fff1f1;
}

.staff-face-status[data-status="error"] strong,
.staff-face-status[data-status="error"] span {
    color: #8b2424;
}

.staff-face-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--navy);
    font-weight: 900;
    cursor: pointer;
}

.staff-face-button:hover {
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(10, 63, 159, .1);
}

.staff-face-button i {
    color: var(--gold-deep);
    font-size: 20px;
}

.staff-face-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 19, 38, .72);
}

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

.staff-face-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    overflow: auto;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.staff-face-camera {
    position: relative;
    width: min(360px, 100%);
    aspect-ratio: 1 / 1;
    margin: 0 auto 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--dark);
}

.staff-face-camera video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.staff-face-guide {
    position: absolute;
    left: 50%;
    top: 47%;
    width: 58%;
    height: 72%;
    border: 4px solid rgba(255, 255, 255, .88);
    border-radius: 50% / 44%;
    box-shadow:
        0 0 0 999px rgba(7, 19, 38, .18),
        0 0 22px rgba(7, 19, 38, .2);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.staff-face-guide::before,
.staff-face-guide::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 34%;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    transform: translateX(-50%);
}

.staff-face-guide::before {
    top: 31%;
}

.staff-face-guide::after {
    top: 54%;
}

.staff-face-guide[data-status="ok"] {
    border-color: #12b76a;
    box-shadow:
        0 0 0 999px rgba(7, 19, 38, .12),
        0 0 26px rgba(18, 183, 106, .45);
}

.staff-face-guide[data-status="warning"] {
    border-color: var(--gold);
}

.staff-face-guide[data-status="error"] {
    border-color: #b42318;
}

.staff-face-scan {
    position: absolute;
    left: 50%;
    top: 47%;
    width: 58%;
    height: 72%;
    overflow: hidden;
    border-radius: 50% / 44%;
    opacity: .95;
    pointer-events: none;
    transform: translate(-50%, -50%);
    clip-path: ellipse(50% 50% at 50% 50%);
}

.staff-face-scan::before {
    content: "";
    position: absolute;
    left: 9%;
    right: 9%;
    top: 90%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 196, 0, .98), #ffffff, rgba(255, 196, 0, .98), transparent);
    box-shadow:
        0 0 12px rgba(255, 196, 0, .8),
        0 0 24px rgba(255, 196, 0, .45);
    animation: staffFaceScanner 3.4s ease-in-out infinite alternate;
}

.staff-face-scan::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    top: 90%;
    height: 54px;
    background: linear-gradient(180deg, rgba(255, 196, 0, .28), transparent);
    filter: blur(2px);
    animation: staffFaceScannerGlow 3.4s ease-in-out infinite alternate;
}

@keyframes staffFaceScanner {
    from {
        top: 88%;
    }

    to {
        top: 10%;
    }
}

@keyframes staffFaceScannerGlow {
    from {
        top: 88%;
    }

    to {
        top: 10%;
    }
}

.staff-face-message {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(10, 63, 159, .18);
    border-radius: var(--radius);
    background: rgba(10, 63, 159, .08);
    color: var(--navy);
    font-size: 13px;
    font-weight: 800;
}

.staff-face-message[data-status="ok"] {
    border-color: rgba(18, 183, 106, .28);
    background: #ecfdf3;
    color: #067647;
}

.staff-face-message[data-status="checking"] {
    border-color: rgba(18, 183, 106, .28);
    background: #ecfdf3;
    color: #067647;
}

.staff-face-message[data-status="error"] {
    border-color: rgba(180, 35, 24, .25);
    background: #fff1f1;
    color: #8b2424;
}

.staff-punch-button {
    width: 100%;
    min-height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    color: var(--dark);
    font-weight: 900;
    cursor: pointer;
}

.staff-punch-button.danger {
    background: #b42318;
    color: var(--white);
}

.staff-punch-button:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.staff-punch-button i {
    font-size: 23px;
}

.staff-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.staff-metrics article {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 10px 28px rgba(8, 36, 92, .07);
}

.staff-metrics strong {
    display: block;
    margin-top: 6px;
    color: var(--navy);
    font-size: 32px;
    line-height: 1;
}

.staff-history {
    display: grid;
    gap: 10px;
}

.staff-history article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.staff-history article:last-child {
    border-bottom: 0;
}

.staff-history strong,
.staff-history span {
    display: block;
}

.staff-history span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    text-transform: capitalize;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
    transition: grid-template-columns .2s ease;
}

.admin-shell.is-sidebar-collapsed {
    grid-template-columns: 86px 1fr;
}

.admin-sidebar {
    min-height: 100vh;
    padding: 22px;
    background: var(--dark);
    color: var(--white);
    overflow: hidden;
}

.sidebar-toggle {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
    color: var(--gold);
    cursor: pointer;
}

.sidebar-toggle i {
    font-size: 24px;
}

.admin-brand {
    display: grid;
    gap: 4px;
    padding: 6px 6px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.admin-brand img {
    width: 190px;
    max-width: 100%;
    height: auto;
    transition: width .2s ease, opacity .2s ease;
}

.admin-brand small {
    color: var(--gold);
    font-weight: 800;
    text-transform: uppercase;
    transition: opacity .2s ease;
}

.admin-nav {
    display: grid;
    gap: 6px;
    margin-top: 22px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, .76);
    font-weight: 800;
    min-height: 45px;
    transition: justify-content .2s ease, padding .2s ease;
}

.admin-nav i {
    flex: 0 0 auto;
    color: var(--gold);
    font-size: 21px;
}

.admin-nav span {
    white-space: nowrap;
    transition: opacity .15s ease;
}

.admin-nav a:hover,
.admin-nav a.is-active {
    background: rgba(255, 255, 255, .08);
    color: var(--white);
}

.admin-shell.is-sidebar-collapsed .admin-sidebar {
    padding: 22px 14px;
}

.admin-shell.is-sidebar-collapsed .sidebar-toggle {
    width: 58px;
}

.admin-shell.is-sidebar-collapsed .admin-brand {
    justify-items: center;
    padding: 4px 0 18px;
}

.admin-shell.is-sidebar-collapsed .admin-brand img {
    width: 54px;
}

.admin-shell.is-sidebar-collapsed .admin-brand small,
.admin-shell.is-sidebar-collapsed .admin-nav span {
    width: 0;
    opacity: 0;
    overflow: hidden;
}

.admin-shell.is-sidebar-collapsed .admin-nav a {
    justify-content: center;
    gap: 0;
    padding: 12px 0;
}

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

.private-page-loader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 19, 38, .38);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(3px);
    transition: opacity .22s ease;
}

.private-page-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.private-page-loader-card {
    min-width: 178px;
    padding: 18px 20px;
    display: grid;
    justify-items: center;
    gap: 11px;
    border: 1px solid rgba(255, 196, 0, .24);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 20px 48px rgba(7, 19, 38, .28);
    color: var(--navy);
    font-size: 13px;
    font-weight: 900;
}

.private-loader-ring {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(10, 63, 159, .15);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: private-loader-spin .78s linear infinite;
}

.private-content-ready .admin-content,
.private-content-ready .staff-main {
    animation: private-content-in .28s ease both;
}

@keyframes private-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes private-content-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px clamp(20px, 4vw, 42px);
    border-bottom: 1px solid var(--line);
    background: var(--white);
}

.admin-topbar h1 {
    margin: 2px 0 0;
    color: var(--navy);
    font-size: 34px;
    line-height: 1;
}

.topbar-tools {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.language-switcher button {
    min-width: 46px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.language-switcher button.is-active {
    background: var(--dark);
    color: var(--white);
    box-shadow: 0 8px 18px rgba(7, 19, 38, .12);
}

.flag-icon {
    position: relative;
    width: 18px;
    height: 12px;
    display: inline-block;
    flex: 0 0 18px;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(7, 19, 38, .18);
}

.flag-us {
    background:
        linear-gradient(#1f4f9a 0 0) 0 0 / 42% 54% no-repeat,
        repeating-linear-gradient(
            to bottom,
            #b22234 0 7.69%,
            #ffffff 7.69% 15.38%
        );
}

.flag-us::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    box-shadow:
        4px 0 rgba(255, 255, 255, .9),
        2px 3px rgba(255, 255, 255, .9);
}

.flag-es {
    background: linear-gradient(
        to bottom,
        #c60b1e 0 25%,
        #ffc400 25% 75%,
        #c60b1e 75% 100%
    );
}

.staff-language-switcher {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 20;
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 28px rgba(7, 19, 38, .18);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: right;
}

.admin-user strong,
.admin-user span {
    display: block;
}

.admin-user strong {
    color: var(--navy);
}

.admin-user span {
    color: var(--muted);
    font-size: 13px;
}

.admin-user a {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: #fff3f1;
    color: #b42318;
}

.admin-user i {
    font-size: 22px;
}

.admin-content {
    padding: clamp(20px, 4vw, 42px);
    padding-bottom: 96px;
}

.admin-content > * + * {
    margin-top: 20px;
}

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

.metric-card {
    min-height: 150px;
    padding: 20px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 10px 28px rgba(8, 36, 92, .07);
}

.metric-card i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: var(--radius);
    background: rgba(255, 196, 0, .14);
    color: var(--royal);
    font-size: 23px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin-top: 6px;
    color: var(--navy);
    font-size: 34px;
    line-height: 1;
}

.admin-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.attendance-report-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.attendance-report-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
    align-items: end;
    gap: 12px;
}

.client-attendance-form {
    grid-template-columns: repeat(2, minmax(150px, 1fr)) auto;
}

.attendance-report-form .button-row {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.attendance-report-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.attendance-report-summary article {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.attendance-report-summary span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.attendance-report-summary strong {
    color: var(--navy);
    font-size: 20px;
}

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

.live-summary-card {
    min-height: 106px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 10px 28px rgba(8, 36, 92, .07);
}

.live-summary-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.live-summary-card strong {
    color: var(--navy);
    font-size: 31px;
    line-height: 1;
}

.live-summary-card.is-live {
    border-top-color: #12b76a;
}

.admin-panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 10px 28px rgba(8, 36, 92, .07);
}

.form-panel {
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(10, 63, 159, .45) rgba(216, 224, 235, .55);
    scrollbar-width: thin;
}

.form-panel::-webkit-scrollbar {
    width: 9px;
}

.form-panel::-webkit-scrollbar-track {
    background: rgba(216, 224, 235, .55);
    border-radius: 999px;
}

.form-panel::-webkit-scrollbar-thumb {
    background: rgba(10, 63, 159, .45);
    border-radius: 999px;
}

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

.panel-heading.compact {
    margin-bottom: 12px;
}

.panel-heading h2 {
    margin: 0;
    color: var(--navy);
    font-size: 21px;
}

.panel-heading span {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 196, 0, .16);
    color: var(--navy);
    font-size: 12px;
    font-weight: 900;
}

.focus-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.focus-list li {
    display: flex;
    gap: 10px;
    color: var(--muted);
}

.focus-list i {
    color: var(--royal);
    font-size: 20px;
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-list div {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.activity-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.activity-list strong,
.activity-list span {
    display: block;
}

.activity-list span,
.empty-state {
    color: var(--muted);
}

.admin-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.admin-actions h2 {
    margin: 0 0 4px;
    color: var(--navy);
    font-size: 26px;
}

.admin-actions p {
    margin: 0;
    color: var(--muted);
}

.admin-button,
.button-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-button {
    min-height: 34px;
    justify-content: center;
    padding: 7px 12px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    color: var(--dark);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.1;
    cursor: pointer;
}

.admin-button.secondary {
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--royal);
}

.admin-button.danger {
    background: #b42318;
    color: var(--white);
}

.admin-button.small {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
}

.admin-button i {
    font-size: 17px;
}

.table-wrap {
    overflow-x: auto;
}

.live-time-scroll-wrap {
    max-height: 505px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(10, 63, 159, .45) rgba(216, 224, 235, .55);
    scrollbar-width: thin;
}

.live-time-scroll-wrap::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.live-time-scroll-wrap::-webkit-scrollbar-track {
    background: rgba(216, 224, 235, .55);
    border-radius: 999px;
}

.live-time-scroll-wrap::-webkit-scrollbar-thumb {
    background: rgba(10, 63, 159, .45);
    border-radius: 999px;
}

.live-time-scroll-wrap .admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--white);
}

.table-search-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.staff-action-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.table-search-field {
    position: relative;
    width: min(360px, 100%);
}

.table-search-field i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: var(--royal);
    font-size: 19px;
    transform: translateY(-50%);
}

.table-search-field input {
    width: 100%;
    height: 42px;
    padding: 0 42px 0 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f7faff;
    color: var(--navy);
    font-weight: 800;
    outline: 0;
}

.table-search-field input:focus {
    border-color: rgba(0, 61, 165, .45);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, .1);
}

.table-search-spinner {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 61, 165, .16);
    border-top-color: var(--gold);
    border-radius: 50%;
    opacity: 0;
    transform: translateY(-50%) scale(.8);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}

.table-search-spinner.is-active {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    animation: searchSpin .65s linear infinite;
}

@keyframes searchSpin {
    to {
        transform: translateY(-50%) scale(1) rotate(360deg);
    }
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--navy);
    font-size: 12px;
    text-transform: uppercase;
}

.admin-table td {
    color: var(--ink);
}

.admin-table td strong,
.admin-table td span {
    display: block;
}

.admin-table td span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.contact-cell {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    width: fit-content;
}

.whatsapp-link {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(18, 140, 126, .24);
    border-radius: 999px;
    background: rgba(37, 211, 102, .12);
    color: #128c7e;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.whatsapp-link:hover {
    border-color: rgba(18, 140, 126, .42);
    background: rgba(37, 211, 102, .2);
    transform: translateY(-1px);
}

.whatsapp-link i {
    font-size: 17px;
}

.status-badge {
    display: inline-flex !important;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(10, 63, 159, .1);
    color: var(--royal) !important;
    font-weight: 900;
    text-transform: capitalize;
}

.live-status.is-live {
    background: rgba(18, 183, 106, .14);
    color: #067647 !important;
}

.is-live-row {
    background: rgba(18, 183, 106, .045);
}

.is-late-row {
    background: rgba(180, 35, 24, .035);
}

.is-attendance-ok-row {
    background: rgba(18, 183, 106, .035);
}

.admin-table tr.is-attendance-ok-row > td {
    border-color: rgba(18, 183, 106, .22);
}

.is-late-attendance {
    color: #b42318 !important;
    font-weight: 900;
}

.is-good-attendance {
    color: #067647 !important;
    font-weight: 900;
}

.admin-table td.is-good-attendance,
.admin-table td.is-good-attendance strong {
    color: #067647 !important;
}

.live-chip {
    display: inline-flex !important;
    width: fit-content;
    margin-top: 5px !important;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(18, 183, 106, .14);
    color: #067647 !important;
    font-size: 11px !important;
    font-weight: 900;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.table-actions a {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border: 1px solid rgba(10, 63, 159, .18);
    border-radius: 7px;
    background: rgba(10, 63, 159, .08);
    color: var(--royal);
    font-size: 12px;
    font-weight: 900;
}

.table-actions a:hover {
    border-color: rgba(10, 63, 159, .32);
    background: rgba(10, 63, 159, .14);
}

.delete-form {
    display: inline-flex;
}

.delete-button {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(180, 35, 24, .22);
    border-radius: 7px;
    background: #fff3f1;
    color: #b42318;
    cursor: pointer;
}

.delete-button i {
    font-size: 16px;
}

.admin-form,
.note-form {
    display: grid;
    gap: 16px;
}

.form-submit-fallback {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.floating-save-button {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 850;
    width: 68px;
    height: 68px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    color: var(--dark);
    box-shadow: 0 16px 36px rgba(8, 36, 92, .24);
    cursor: pointer;
}

.floating-save-button i {
    font-size: 27px;
}

.floating-save-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.floating-save-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(8, 36, 92, .3);
}

.floating-save-button:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.form-section {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(244, 247, 251, .58);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-form label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-weight: 800;
    font-size: 14px;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.note-form textarea {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    outline: none;
}

.admin-form textarea,
.note-form textarea {
    resize: vertical;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.note-form textarea:focus {
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(10, 63, 159, .14);
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.staff-picker-card {
    max-height: 178px;
    display: grid;
    gap: 8px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    scrollbar-color: rgba(10, 63, 159, .45) rgba(216, 224, 235, .55);
    scrollbar-width: thin;
}

.staff-picker-card::-webkit-scrollbar {
    width: 8px;
}

.staff-picker-card::-webkit-scrollbar-track {
    background: rgba(216, 224, 235, .55);
    border-radius: 999px;
}

.staff-picker-card::-webkit-scrollbar-thumb {
    background: rgba(10, 63, 159, .45);
    border-radius: 999px;
}

.staff-picker-option {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px !important;
    min-height: 52px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
}

.staff-picker-option:has(input:checked) {
    border-color: rgba(10, 63, 159, .35);
    background: rgba(10, 63, 159, .08);
}

.staff-picker-option input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    padding: 0;
    accent-color: var(--royal);
}

.staff-picker-option span,
.staff-picker-option strong,
.staff-picker-option small {
    display: block;
}

.staff-picker-option strong {
    color: var(--navy);
    font-size: 13px;
}

.staff-picker-option small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.staff-picker-empty {
    margin: 0;
    padding: 10px;
    color: var(--muted);
    font-size: 13px;
}

.location-control-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(244, 247, 251, .74);
}

.location-control-card strong,
.location-control-card span {
    display: block;
}

.location-control-card strong {
    color: var(--navy);
}

.location-control-card span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.location-control-card:has(.location-map-button:focus),
.location-control-card:hover {
    border-color: rgba(10, 63, 159, .24);
    background: rgba(10, 63, 159, .05);
}

.location-map-button i {
    font-size: 21px;
}

.location-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 19, 38, .62);
}

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

.location-dialog {
    position: relative;
    width: min(860px, 100%);
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.location-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
}

.location-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.location-search-box {
    position: relative;
    margin-bottom: 12px;
}

.location-search-box label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-size: 14px;
    font-weight: 800;
}

.location-search-input-wrap {
    position: relative;
    display: block;
}

.location-search-input-wrap i {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--royal);
    font-size: 19px;
    transform: translateY(-50%);
}

.location-search-input-wrap input {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    outline: none;
}

.location-search-input-wrap input:focus {
    border-color: var(--royal);
    box-shadow: 0 0 0 3px rgba(10, 63, 159, .14);
}

.location-search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 1200;
    max-height: 230px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 16px 40px rgba(8, 36, 92, .18);
}

.location-search-results[hidden] {
    display: none;
}

.location-search-results button {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.location-search-results button:hover {
    background: rgba(10, 63, 159, .08);
}

.location-search-results strong,
.location-search-results span {
    display: block;
}

.location-search-results strong {
    color: var(--navy);
    font-size: 13px;
}

.location-search-results span,
.location-search-results p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.client-location-map {
    width: 100%;
    height: min(460px, 58vh);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.client-location-map .leaflet-control-layers {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(8, 36, 92, .14);
}

.client-location-map .leaflet-control-layers-expanded {
    padding: 8px 10px;
    color: var(--navy);
    font: 12px/1.35 Arial, Helvetica, sans-serif;
    font-weight: 800;
}

.client-location-map .leaflet-control-layers label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 3px 0;
}

.client-location-map .leaflet-control-layers input {
    width: auto;
    min-height: auto;
    margin: 0;
    accent-color: var(--gold-deep);
}

.location-coordinates {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.location-coordinates span {
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.location-coordinates strong {
    color: var(--navy);
}

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

.option-card,
.shift-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.check-label {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 9px !important;
}

.check-label input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    height: 18px;
    padding: 0;
    accent-color: var(--royal);
}

.inline-check {
    align-self: end;
    min-height: 44px;
}

.mini-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 10px;
    margin-top: 12px;
}

.shift-list {
    display: grid;
    gap: 12px;
}

.shift-card {
    display: grid;
    gap: 12px;
}

.shift-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.shift-card-head strong {
    color: var(--navy);
}

.icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--royal);
    cursor: pointer;
}

.icon-button i {
    font-size: 19px;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 19, 38, .58);
    opacity: 1;
    transition: opacity .24s ease;
}

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

.confirm-modal.is-opening {
    animation: modalOverlayIn .24s ease both;
}

.confirm-modal.is-closing {
    opacity: 0;
    pointer-events: none;
}

.confirm-dialog {
    position: relative;
    width: min(420px, 100%);
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 14px 16px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity .24s ease, transform .24s ease;
}

.confirm-modal.is-opening .confirm-dialog {
    animation: modalDialogIn .28s cubic-bezier(.16, 1, .3, 1) both;
}

.confirm-modal.is-closing .confirm-dialog {
    opacity: 0;
    transform: translateY(10px) scale(.97);
}

.confirm-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.confirm-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: #fff3f1;
    color: #b42318;
}

.save-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: rgba(255, 196, 0, .18);
    color: var(--royal);
}

.logout-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: #fff3f1;
    color: #b42318;
}

.save-icon i {
    font-size: 24px;
}

.confirm-icon i,
.logout-icon i {
    font-size: 24px;
}

.confirm-dialog h2 {
    align-self: end;
    margin: 0;
    color: var(--navy);
}

.confirm-dialog p {
    grid-column: 2;
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.confirm-actions {
    grid-column: 2;
    justify-content: flex-end;
    margin-top: 6px;
}

@keyframes modalOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalDialogIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.96);
    }

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

@media (prefers-reduced-motion: reduce) {
    .confirm-modal,
    .confirm-dialog {
        transition: none;
    }

    .confirm-modal.is-opening,
    .confirm-modal.is-opening .confirm-dialog {
        animation: none;
    }
}

@media (max-width: 480px) {
    .confirm-dialog {
        grid-template-columns: 1fr;
    }

    .confirm-dialog p,
    .confirm-actions {
        grid-column: 1;
    }

    .confirm-actions {
        justify-content: stretch;
    }

    .confirm-actions .admin-button {
        width: 100%;
    }
}

.detail-grid {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 18px;
}

.detail-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.detail-list div {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 4px 0 0;
    color: var(--ink);
    font-weight: 800;
}

.detail-note {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface);
}

.detail-note strong {
    color: var(--navy);
}

.detail-note p {
    margin-bottom: 0;
    color: var(--muted);
}

.compact-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.compact-list p {
    margin: 0;
}

.compact-list span {
    display: block;
    margin-top: 3px;
}

.note-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.time-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.time-action-grid form,
.time-action-grid .admin-button {
    width: 100%;
}

.note-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.note-item p {
    margin: 0 0 8px;
}

.note-item span {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1050px) {
    .staff-grid {
        grid-template-columns: 1fr;
    }

    .staff-punch-panel {
        order: -1;
    }

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

    .admin-sidebar {
        min-height: auto;
    }

    .admin-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

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

@media (max-width: 680px) {
    .staff-shell {
        background:
            linear-gradient(180deg, rgba(7, 19, 38, .98), rgba(8, 36, 92, .9) 170px, var(--surface) 170px);
    }

    .staff-main {
        padding: 10px 8px 22px;
    }

    .staff-logo {
        width: 106px;
    }

    .staff-hero {
        grid-template-columns: minmax(0, 1fr) 40px;
        align-items: center;
        gap: 6px 10px;
        margin-bottom: 10px;
        padding: 9px;
    }

    .staff-hero span {
        font-size: 10px;
    }

    .staff-hero h1 {
        max-width: 100%;
        margin: 2px 0;
        font-size: clamp(24px, 8.5vw, 34px);
        overflow-wrap: anywhere;
    }

    .staff-hero p {
        font-size: 12px;
    }

    .staff-logout {
        width: 40px;
        height: 40px;
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
    }

    .staff-hero-copy {
        grid-column: 1;
        grid-row: 2;
    }

    .staff-grid,
    .staff-metrics,
    .staff-shift-list {
        grid-template-columns: 1fr;
    }

    .staff-grid {
        gap: 10px;
    }

    .staff-punch-panel {
        order: -1;
    }

    .staff-card {
        padding: 14px;
        border-radius: 8px;
        box-shadow: 0 8px 22px rgba(8, 36, 92, .08);
    }

    .staff-card-heading {
        gap: 10px;
        margin-bottom: 12px;
    }

    .staff-card-heading h2 {
        font-size: 23px;
    }

    .staff-card-heading i {
        width: 40px;
        height: 40px;
        font-size: 21px;
    }

    .staff-shift-list {
        gap: 8px;
    }

    .staff-shift-list div {
        min-height: 66px;
        padding: 10px;
    }

    .staff-shift-list dt {
        font-size: 10px;
    }

    .staff-shift-list dd {
        font-size: 15px;
    }

    .staff-location-line {
        align-items: center;
    }

    .staff-map-button {
        width: 32px;
        height: 32px;
    }

    .staff-location-dialog {
        max-height: calc(100vh - 24px);
        padding: 16px;
    }

    .staff-location-header h2 {
        font-size: 22px;
    }

    .staff-company-map {
        min-height: 280px;
    }

    .staff-face-dialog {
        max-height: calc(100vh - 24px);
        padding: 16px;
    }

    .staff-face-camera {
        width: 100%;
    }

    .staff-clock-value {
        font-size: 35px;
    }

    .staff-clock-label {
        margin-bottom: 12px;
        font-size: 14px;
        line-height: 1.45;
    }

    .staff-geofence-status,
    .staff-face-status,
    .staff-face-message {
        font-size: 12px;
    }

    .staff-face-status {
        padding: 11px;
    }

    .staff-punch-button {
        min-height: 56px;
    }

    .staff-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 12px 0;
    }

    .staff-metrics article {
        min-width: 0;
        padding: 12px 8px;
        text-align: center;
    }

    .staff-metrics strong {
        font-size: 24px;
    }

    .staff-metrics span {
        font-size: 9px;
        line-height: 1.25;
    }

    .staff-history article {
        align-items: flex-start;
        gap: 8px;
        padding: 11px 0;
    }

    .admin-shell,
    .admin-shell.is-sidebar-collapsed {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .admin-sidebar,
    .admin-shell.is-sidebar-collapsed .admin-sidebar {
        padding: 12px 8px;
    }

    .sidebar-toggle,
    .admin-shell.is-sidebar-collapsed .sidebar-toggle {
        width: 38px;
        height: 34px;
        margin-bottom: 10px;
    }

    .sidebar-toggle i {
        font-size: 21px;
    }

    .admin-brand,
    .admin-shell.is-sidebar-collapsed .admin-brand {
        justify-items: center;
        padding: 2px 0 12px;
    }

    .admin-brand img,
    .admin-shell.is-sidebar-collapsed .admin-brand img {
        width: 38px;
    }

    .admin-brand small,
    .admin-nav span {
        width: 0;
        opacity: 0;
        overflow: hidden;
    }

    .admin-nav {
        gap: 4px;
        margin-top: 12px;
    }

    .admin-nav a,
    .admin-shell.is-sidebar-collapsed .admin-nav a {
        min-height: 36px;
        justify-content: center;
        gap: 0;
        padding: 8px 0;
    }

    .admin-nav i {
        font-size: 18px;
    }

    .admin-topbar,
    .topbar-tools,
    .admin-user,
    .admin-panels,
    .admin-actions,
    .detail-grid {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
        text-align: left;
    }

    .admin-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding: 9px 10px;
    }

    .topbar-tools {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        text-align: right;
    }

    .language-switcher {
        gap: 2px;
        padding: 2px;
    }

    .language-switcher button {
        min-width: 34px;
        height: 26px;
        gap: 3px;
        font-size: 9px;
    }

    .flag-icon {
        font-size: 12px;
    }

    .staff-language-switcher {
        top: 8px;
        right: 8px;
    }

    .admin-kicker {
        font-size: 8px;
        line-height: 1;
    }

    .admin-topbar h1 {
        margin-top: 1px;
        font-size: 19px;
    }

    .admin-user {
        flex-direction: row;
        align-items: center;
        gap: 7px;
        text-align: right;
    }

    .admin-user strong {
        font-size: 11px;
        line-height: 1.05;
    }

    .admin-user span {
        font-size: 10px;
        line-height: 1.05;
    }

    .admin-user a {
        width: 30px;
        height: 30px;
    }

    .admin-user i {
        font-size: 17px;
    }

    .admin-content {
        padding: 12px;
        padding-bottom: 78px;
    }

    .admin-content > * + * {
        margin-top: 12px;
    }

    .floating-save-button {
        right: 14px;
        bottom: 14px;
        width: 54px;
        height: 54px;
    }

    .floating-save-button i {
        font-size: 23px;
    }

    .admin-actions {
        gap: 10px;
        margin-bottom: 12px;
    }

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

    .admin-actions p {
        font-size: 12px;
        line-height: 1.35;
    }

    .staff-action-tools {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .staff-action-tools .table-search-field {
        width: 100%;
    }

    .admin-button {
        min-height: 34px;
        padding: 7px 11px;
        font-size: 12px;
    }

    .admin-panel {
        padding: 12px;
    }

    .live-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
    }

    .attendance-report-form,
    .attendance-report-summary {
        grid-template-columns: 1fr;
    }

    .attendance-report-form .button-row {
        justify-content: stretch;
    }

    .attendance-report-form .admin-button {
        width: 100%;
    }

    .live-summary-card {
        min-height: 78px;
        padding: 12px;
    }

    .live-summary-card span {
        font-size: 10px;
    }

    .live-summary-card strong {
        font-size: 24px;
    }

    .form-panel {
        max-height: calc(100vh - 118px);
    }

    .panel-heading {
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .panel-heading h2 {
        font-size: 18px;
    }

    .metric-card {
        min-height: 110px;
        padding: 14px;
    }

    .metric-card strong {
        font-size: 25px;
    }

    .metric-card i {
        width: 34px;
        height: 34px;
        margin-bottom: 10px;
        font-size: 19px;
    }

    .admin-nav,
    .metric-grid,
    .form-row,
    .option-grid,
    .mini-row {
        grid-template-columns: 1fr;
    }

    .admin-table {
        min-width: 560px;
        font-size: 12px;
    }

    .admin-table th,
    .admin-table td {
        padding: 9px 8px;
    }

    .admin-table td span {
        font-size: 11px;
    }

    .status-badge {
        padding: 4px 7px;
        font-size: 11px;
    }

    .table-actions {
        gap: 6px;
    }

    .table-actions a,
    .delete-button {
        min-height: 29px;
        height: 29px;
    }

    .table-actions a {
        padding: 5px 8px;
        font-size: 12px;
    }

    .delete-button {
        width: 29px;
    }

    .admin-form,
    .note-form {
        gap: 12px;
    }

    .admin-form input,
    .admin-form select,
    .admin-form textarea,
    .note-form textarea {
        min-height: 40px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .form-section,
    .option-card,
    .shift-card,
    .detail-note,
    .note-item {
        padding: 12px;
    }

    .location-dialog {
        padding: 18px;
    }

    .location-search-row {
        flex-direction: column;
    }

    .client-location-map {
        height: 360px;
    }

    .detail-list {
        gap: 10px;
    }

    .time-action-grid {
        grid-template-columns: 1fr;
    }

    .detail-list div {
        padding-bottom: 9px;
    }

    .confirm-dialog {
        padding: 22px;
    }

    .login-pwa-banner {
        top: 10px;
        grid-template-columns: 34px minmax(0, 1fr) 34px;
    }

    .login-pwa-install {
        grid-column: 1 / -1;
        width: 100%;
    }
}
