:root {
    --navy: #0B2F63;
    --navy-2: #08264f;
    --blue: #1769C2;
    --blue-soft: #eaf3ff;
    --ink: #172033;
    --muted: #6c7890;
    --line: #dce4ef;
    --surface: #ffffff;
    --background: #f4f7fb;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(11, 47, 99, .12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(23, 105, 194, .10), transparent 34rem),
        var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

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

.app-shell {
    min-height: 100vh;
}

.screen {
    width: min(100%, 560px);
    min-height: 100vh;
    margin: 0 auto;
    padding: max(22px, env(safe-area-inset-top)) 18px max(94px, calc(74px + env(safe-area-inset-bottom)));
}

.is-hidden {
    display: none !important;
}

.splash {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    color: #fff;
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,.14), transparent 14rem),
        linear-gradient(160deg, var(--navy), var(--navy-2));
}

.brand-mark {
    position: relative;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    overflow: hidden;
    border-radius: 15px;
    color: var(--navy);
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

.brand-mark--large {
    width: 80px;
    height: 80px;
    border-radius: 24px;
}

.brand-mark--small {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.brand-mark__hand {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -3px;
    transform: translateX(-1px);
}

.brand-mark--large .brand-mark__hand {
    font-size: 46px;
}

.brand-mark--small .brand-mark__hand {
    font-size: 21px;
}

.brand-mark__dot {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 10px;
    height: 10px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--blue);
}

.brand-mark--large .brand-mark__dot {
    right: 13px;
    bottom: 13px;
    width: 16px;
    height: 16px;
    border-width: 4px;
}

.brand-mark--small .brand-mark__dot {
    right: 5px;
    bottom: 5px;
    width: 8px;
    height: 8px;
    border-width: 2px;
}

.splash__brand {
    margin-top: 8px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1.2px;
}

.splash__subtitle {
    font-size: 14px;
    color: rgba(255,255,255,.76);
}

.splash__loader {
    width: 34px;
    height: 4px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.2);
}

.splash__loader::after {
    content: "";
    display: block;
    width: 50%;
    height: 100%;
    border-radius: inherit;
    background: #fff;
    animation: load 1s ease-in-out infinite alternate;
}

@keyframes load {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

.top-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--navy);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -.5px;
}

.screen--login {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 34px;
    padding-bottom: 34px;
}

.login-card,
.clock-card,
.location-card,
.action-card,
.history-card {
    border: 1px solid rgba(11, 47, 99, .07);
    border-radius: var(--radius-xl);
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
}

.login-card {
    padding: 26px 22px;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.eyebrow--light {
    color: rgba(255,255,255,.72);
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    color: var(--navy);
    font-size: clamp(30px, 8vw, 42px);
    line-height: 1.02;
    letter-spacing: -1.5px;
}

h2 {
    margin-bottom: 0;
    font-size: 20px;
    letter-spacing: -.5px;
}

.muted {
    color: var(--muted);
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.login-form label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 15px;
    outline: 0;
    padding: 0 15px;
    color: var(--ink);
    background: #f9fbfe;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.login-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(23, 105, 194, .11);
}

.button {
    min-height: 52px;
    border: 0;
    border-radius: 15px;
    padding: 0 18px;
    font-weight: 800;
    cursor: pointer;
}

.button--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    box-shadow: 0 12px 24px rgba(23, 105, 194, .20);
}

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

.form-note {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
}

.screen--home {
    padding-top: max(16px, env(safe-area-inset-top));
}

.home-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.top-brand--home {
    font-size: 18px;
}

.home-header__hello {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.connectivity {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid rgba(23, 105, 194, .15);
    border-radius: 999px;
    padding: 0 11px;
    color: var(--navy);
    background: var(--blue-soft);
    font-size: 11px;
    font-weight: 800;
}

.connectivity.is-offline {
    color: var(--danger);
    border-color: rgba(180,35,24,.15);
    background: #fff2f0;
}

.connectivity__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.company-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-radius: var(--radius-lg);
    padding: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--navy), #104b91);
    box-shadow: 0 18px 35px rgba(11,47,99,.22);
}

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

.company-card strong {
    font-size: 18px;
}

.company-card span {
    margin-top: 4px;
    color: rgba(255,255,255,.7);
    font-size: 12px;
}

.icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 14px;
    color: #fff;
    background: rgba(255,255,255,.08);
}

.icon-button svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.clock-card {
    margin-top: 16px;
    padding: 24px 18px;
    text-align: center;
}

.clock-card__date {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.clock-card__time {
    margin: 7px 0 4px;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
    font-size: clamp(48px, 14vw, 68px);
    font-weight: 800;
    letter-spacing: -3px;
    line-height: 1;
}

.clock-card__zone {
    color: var(--muted);
    font-size: 11px;
}

.location-card {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 16px;
    padding: 16px;
}

.location-card__icon,
.empty-state__icon {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    color: var(--blue);
    background: var(--blue-soft);
}

.location-card svg,
.empty-state svg,
.bottom-nav svg,
.punch-button svg,
.modal-card svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.location-card__body {
    min-width: 0;
}

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

.location-card__body strong {
    font-size: 13px;
}

.location-card__body span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.action-card {
    margin-top: 16px;
    padding: 16px;
}

.punch-button {
    display: flex;
    width: 100%;
    min-height: 88px;
    align-items: center;
    gap: 15px;
    border: 0;
    border-radius: 22px;
    padding: 16px 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    box-shadow: 0 16px 32px rgba(23,105,194,.24);
    text-align: left;
    cursor: pointer;
}

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

.punch-button__icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,.12);
}

.punch-button strong,
.punch-button small {
    display: block;
}

.punch-button strong {
    font-size: 17px;
}

.punch-button small {
    margin-top: 3px;
    color: rgba(255,255,255,.72);
    font-size: 11px;
}

.action-card__hint {
    margin: 12px 4px 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.history-card {
    margin-top: 16px;
    padding: 20px 18px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.text-button {
    border: 0;
    padding: 4px;
    color: var(--blue);
    background: transparent;
    font-size: 12px;
    font-weight: 800;
}

.empty-state {
    display: flex;
    gap: 13px;
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

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

.empty-state strong {
    font-size: 13px;
}

.empty-state span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(100%, 560px);
    min-height: calc(68px + env(safe-area-inset-bottom));
    margin: 0 auto;
    border-top: 1px solid var(--line);
    padding: 8px 8px env(safe-area-inset-bottom);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(16px);
}

.bottom-nav__item {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: 0;
    color: #8a95a9;
    background: transparent;
    font-size: 10px;
    font-weight: 700;
}

.bottom-nav__item svg {
    width: 21px;
}

.bottom-nav__item.is-active {
    color: var(--navy);
}

.toast {
    position: fixed;
    right: 18px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    left: 18px;
    z-index: 80;
    width: min(calc(100% - 36px), 520px);
    margin: 0 auto;
    border-radius: 15px;
    padding: 13px 15px;
    color: #fff;
    background: #18243b;
    box-shadow: 0 15px 35px rgba(0,0,0,.18);
    font-size: 12px;
    line-height: 1.45;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: end center;
    padding: 18px;
    background: rgba(7, 23, 45, .54);
    backdrop-filter: blur(8px);
}

.modal-card {
    width: min(100%, 520px);
    border-radius: 28px;
    padding: 24px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0,0,0,.25);
}

.modal-card__icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 18px;
    color: #fff;
    background: var(--blue);
}

.modal-card h2 {
    margin-bottom: 8px;
    color: var(--navy);
    font-size: 24px;
}

.modal-card p {
    color: var(--muted);
    line-height: 1.55;
}

@media (min-width: 700px) {
    body {
        padding: 28px 0;
    }

    .screen {
        min-height: calc(100vh - 56px);
        border: 1px solid rgba(11,47,99,.07);
        border-radius: 34px;
        background: rgba(244,247,251,.88);
        box-shadow: 0 35px 100px rgba(11,47,99,.12);
    }

    .bottom-nav {
        bottom: 28px;
        border: 1px solid var(--line);
        border-radius: 0 0 34px 34px;
    }

    .modal-backdrop {
        place-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

.company-choice { display: grid; gap: 8px; margin: 20px 0; text-align: left; }
.company-choice select { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 12px; background: white; color: #0B2F63; font: inherit; }
.receipt-row { padding: 12px 0; border-bottom: 1px solid #e2e8f0; color: #0B2F63; }
#login-error { color: #b42318; }
#preview-modal-message { overflow-wrap: anywhere; }
