:root {
    --navy-950: #071328;
    --navy-900: #0b1b38;
    --navy-800: #112a52;
    --blue: #0682a5;
    --gold: #c9982e;
    --text: #0e2246;
    --muted: #60708d;
    --line: #dce2eb;
    --card: rgba(255, 255, 255, .97);
    --success: #16c24a;
    --danger: #d92d3f;
    --shadow: 0 24px 70px rgba(2, 10, 27, .32);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overscroll-behavior: none;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-image: radial-gradient(
        circle farthest-corner at -24.7% -47.3%,
        rgba(6, 130, 165, 1) 0%,
        rgba(34, 48, 86, 1) 66.8%,
        rgba(15, 23, 42, 1) 100.2%
    );
    background-size: cover;
    background-color: transparent !important;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding:
        max(16px, env(safe-area-inset-top))
        max(22px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom))
        max(22px, env(safe-area-inset-left));
}

.venue-brand {
    height: clamp(82px, 12vh, 132px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.venue-brand img {
    display: block;
    width: auto;
    height: 100%;
    max-width: min(390px, 68vw);
    object-fit: contain;
}

/*
 * Narrower and taller than the previous version so the main card feels
 * more square on a landscape iPad instead of stretching across the screen.
 */
.login-card {
    width: min(860px, 88vw);
    height: min(610px, 66vh);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 25px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.staff-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    align-content: center;
    gap: 16px;
    padding: 28px 30px;
    scrollbar-width: thin;
}

.staff-tile {
    position: relative;
    min-width: 0;
    min-height: 164px;
    padding: 20px 14px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 6px 17px rgba(17, 42, 82, .08);
    cursor: pointer;
    transition:
        transform 70ms ease,
        box-shadow 90ms ease,
        border-color 90ms ease,
        background 90ms ease;
}

.staff-tile:active {
    transform: scale(.98);
}

.staff-tile:hover {
    transform: translateY(-2px);
    border-color: var(--blue);
    background: #fbfdff;
    box-shadow: 0 12px 24px rgba(17, 42, 82, .12);
}


.online-dot {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 11px;
    height: 11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 194, 74, .11);
}

.staff-name,
.staff-role,
.staff-time {
    display: block;
    text-align: center;
}

.staff-name {
    margin-top: 0;
    font-size: 18px;
    line-height: 1.15;
}

.staff-role {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.staff-time {
    margin-top: 11px;
    color: #405475;
    font-size: 12px;
}

.staff-time i {
    margin-right: 4px;
}

.login-card-footer {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 34px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 15px;
    font-weight: 650;
}

.status-item > i {
    font-size: 20px;
}

.status-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #9aa5b5;
}

.system-status.is-online .status-light {
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(22, 194, 74, .1);
}

.system-status.is-offline .status-light {
    background: var(--danger);
}

.clock-in-button {
    min-width: 360px;
    min-height: 68px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, .19);
    border-radius: 14px;
    background: rgba(7, 19, 40, .78);
    color: #fff;
    box-shadow: 0 12px 30px rgba(1, 6, 18, .2);
    cursor: pointer;
    font-size: 19px;
    font-weight: 700;
    backdrop-filter: blur(12px);
}

.clock-in-button:active {
    transform: scale(.985);
}

.clock-in-button i {
    color: #e4bd63;
}

.app-footer {
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
    letter-spacing: .04em;
}

.notice {
    margin: 18px 28px -5px;
    padding: 11px 14px;
    display: flex;
    gap: 9px;
    align-items: center;
    border-radius: 10px;
    font-size: 14px;
}

.notice-error {
    color: #9d2230;
    background: #fff0f2;
}

.notice-success {
    color: #176b36;
    background: #edf9f1;
}

.empty-state {
    grid-column: 1 / -1;
    align-self: center;
    text-align: center;
    color: var(--muted);
    padding: 45px;
}

.empty-state i,
.empty-state strong,
.empty-state span {
    display: block;
}

.empty-state i {
    margin-bottom: 13px;
    font-size: 38px;
}

.empty-state span {
    margin-top: 6px;
}

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

.pulse-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(3, 11, 26, .48);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.modal-card {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 20px;
    background: rgba(249, 250, 252, .98);
    box-shadow: 0 28px 80px rgba(1, 8, 22, .38);
    animation: modalIn 100ms ease-out both;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.98);
    }

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

.pin-card {
    width: min(410px, 94vw);
    padding: 22px;
}

.pin-profile {
    display: block;
    text-align: center;
}


.pin-profile h2 {
    margin: 0 0 6px;
    text-align: center;
    font-size: 25px;
}

.pin-profile p {
    margin: 0;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.native-pin-input {
    position: fixed;
    opacity: 0;
    pointer-events: none;
}

.pin-dots {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.pin-dots span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #c4ccd8;
    transition:
        background 60ms ease,
        transform 60ms ease;
}

.pin-dots span.is-filled {
    background: var(--navy-800);
    transform: scale(1.08);
}

.pin-dots.is-error span {
    background: var(--danger);
}

.pin-error {
    min-height: 19px;
    text-align: center;
    color: var(--danger);
    font-size: 13px;
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pin-key {
    height: 59px;
    border: 1px solid #e0e5ec;
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 3px 8px rgba(18, 40, 75, .07);
    cursor: pointer;
    font-size: 27px;
}

.pin-key:active {
    transform: scale(.97);
    background: #f1f4f8;
}

.pin-key-action {
    font-size: 20px;
}

.pin-key-submit {
    border-color: var(--navy-800);
    background: var(--navy-800);
    color: #fff;
}

.cancel-pin {
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 650;
}

.pin-card.is-shaking {
    animation: shake 180ms linear;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.clock-card {
    width: min(820px, 94vw);
    max-height: 82vh;
    padding: 25px;
    overflow: auto;
}

.clock-card-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.clock-card-header h2 {
    margin: 0 0 5px;
    font-size: 27px;
}

.clock-card-header p {
    margin: 0;
    color: var(--muted);
}

.modal-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #e9edf3;
    color: var(--text);
    cursor: pointer;
}

.all-staff-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    gap: 13px;
}

.clock-staff-tile {
    min-height: 160px;
    padding: 17px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.clock-staff-tile.is-clocked {
    opacity: .48;
    cursor: default;
}

.clock-staff-initials {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #e9eef5;
    color: var(--navy-800);
    font-size: 18px;
    font-weight: 800;
}

.clock-staff-tile strong,
.clock-staff-tile span,
.clock-staff-tile small {
    display: block;
    text-align: center;
}

.clock-staff-tile span:not(.clock-staff-initials) {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.clock-staff-tile small {
    margin-top: 9px;
    color: #526584;
}

@media (max-width: 980px) {
    .login-card {
        width: min(780px, 94vw);
    }

    .staff-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
        align-content: start;
    }

    .all-staff-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }
}

@media (max-width: 820px) {
    .login-shell {
        justify-content: flex-start;
        gap: 10px;
    }

    .venue-brand {
        height: 100px;
    }

    .login-card {
        width: 100%;
        height: calc(100dvh - 218px);
        min-height: 480px;
        border-radius: 19px;
    }

    .staff-grid {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
        gap: 12px;
        padding: 20px;
    }

    .login-card-footer {
        padding: 0 22px;
    }

    .clock-in-button {
        min-width: min(360px, 85vw);
        min-height: 55px;
    }
}

@media (max-width: 620px) {
    body {
        overflow-y: auto;
    }

    .login-card {
        height: auto;
        max-height: none;
    }

    .staff-grid {
        grid-template-columns: repeat(2, minmax(125px, 1fr));
        overflow: visible;
    }

    .login-card-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 24px;
    }

    .all-staff-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}
