:root {
    --navy: #10243e;
    --navy-2: #173a61;
    --blue: #1769e0;
    --blue-dark: #0f55bc;
    --cyan: #dff4ff;
    --ink: #172033;
    --muted: #697386;
    --line: #dfe5ee;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --green: #178a5b;
    --green-soft: #e5f8ef;
    --amber: #a96800;
    --amber-soft: #fff3d9;
    --red: #c53838;
    --red-soft: #ffebeb;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); }
body { min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.topbar { min-height: 72px; padding: 12px clamp(18px, 4vw, 54px); display: flex; align-items: center; gap: 32px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--blue), var(--navy-2)); border-radius: 11px; font-weight: 800; box-shadow: 0 8px 20px #1769e033; }
.brand span:last-child { display: grid; line-height: 1.05; }
.brand small { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.brand-large { margin-bottom: 24px; }
.brand-large .brand-mark { width: 48px; height: 48px; font-size: 1.3rem; }
.topbar nav { display: flex; gap: 6px; flex: 1; }
.topbar nav a { padding: 9px 12px; border-radius: 9px; color: var(--muted); font-size: .92rem; }
.topbar nav a.active, .topbar nav a:hover { color: var(--navy); background: #edf4ff; }
.user-menu { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; }
.main-content { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 72px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.04; letter-spacing: -.035em; color: var(--navy); }
h2 { color: var(--navy); font-size: 1.28rem; }
p { color: var(--muted); line-height: 1.6; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--blue); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-header p { margin-bottom: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2, .section-heading p { margin-bottom: 3px; }

.card, .stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 35px #1720330a; }
.card { padding: clamp(20px, 3vw, 30px); margin-bottom: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card { padding: 22px; display: grid; gap: 12px; }
.stat-card span { color: var(--muted); font-size: .9rem; }
.stat-card strong { color: var(--navy); font-size: 2rem; }
.stat-warning { border-color: #f0d59a; background: #fffdf7; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.form-card label, label { display: grid; gap: 7px; margin-bottom: 15px; color: #39465b; font-size: .85rem; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 15px; }
.form-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
input, select, textarea { width: 100%; padding: 12px 13px; color: var(--ink); background: #fbfcfe; border: 1px solid #cfd7e3; border-radius: 10px; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #1769e01f; }
textarea { resize: vertical; }
.search-input { min-width: min(440px, 100%); }
.toolbar { display: flex; gap: 12px; align-items: center; }

.btn { border: 0; border-radius: 10px; padding: 11px 17px; font-weight: 750; transition: transform .12s, opacity .12s, background .12s; display: inline-flex; justify-content: center; align-items: center; gap: 7px; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: wait; opacity: .55; transform: none; }
.btn-primary { color: #fff; background: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { color: var(--navy); background: #eaf2ff; }
.btn-ghost { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.btn-warning { color: #6d4300; background: #ffd984; }
.btn-danger { color: #fff; background: var(--red); }
.btn-success { color: #fff; background: var(--green); }
.btn-small { padding: 7px 10px; font-size: .8rem; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-clock { min-height: 58px; padding: 16px 20px; font-size: .94rem; letter-spacing: .04em; }

.alert { margin: 15px 0; padding: 12px 14px; border-radius: 10px; font-size: .9rem; line-height: 1.45; }
.alert-error { color: #842727; background: var(--red-soft); border: 1px solid #f2bcbc; }
.alert-success { color: #126442; background: var(--green-soft); border: 1px solid #afe4cc; }
.status-pill { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 99px; color: var(--navy); background: #edf3f9; font-size: .76rem; font-weight: 800; }
.integration-status { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.integration-status > div:first-child { display: flex; align-items: center; gap: 14px; }
.integration-status h2 { margin: 3px 0 0; }
.integration-status dl { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 20px 36px; margin: 0; }
.integration-status dl div { display: grid; gap: 4px; }
.integration-status dt { color: var(--muted); font-size: .74rem; font-weight: 750; text-transform: uppercase; }
.integration-status dd { margin: 0; color: var(--navy); font-weight: 750; }
.status-dot { width: 15px; height: 15px; border-radius: 50%; background: #95a1b3; box-shadow: 0 0 0 6px #95a1b31c; }
.status-dot.is-connected { background: var(--green); box-shadow: 0 0 0 6px #178a5b1c; }
.status-dot.is-error { background: var(--red); box-shadow: 0 0 0 6px #c538381c; }
.incident-list { list-style: none; display: grid; gap: 12px; padding: 0; margin: 0; }
.incident-list li { display: grid; gap: 7px; padding: 14px; border: 1px solid #f0d59a; border-radius: 12px; background: #fffdf7; }
.incident-list small { color: var(--muted); }
code { overflow-wrap: anywhere; color: #445066; font-size: .75rem; }

.login-shell { min-height: calc(100vh - 150px); display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(40px, 8vw, 110px); }
.login-copy h1 { max-width: 760px; font-size: clamp(2.7rem, 6vw, 5.8rem); }
.login-copy p { max-width: 600px; font-size: 1.1rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px 24px; color: var(--green); font-weight: 700; font-size: .86rem; }
.login-card { max-width: 470px; width: 100%; justify-self: end; padding: clamp(26px, 5vw, 44px); }
.security-note { display: block; margin-top: 18px; color: var(--muted); line-height: 1.45; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 12px; color: var(--muted); font-size: .73rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; border-bottom: 1px solid var(--line); }
td { padding: 15px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; font-size: .9rem; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.actions { display: flex; gap: 7px; }
.empty-state { padding: 70px 20px; text-align: center; }
.empty-state.compact { padding: 30px 10px; color: var(--muted); }

.worker-shell { width: min(760px, 100%); margin: 0 auto; }
.worker-greeting { text-align: center; margin-bottom: 25px; }
.worker-greeting h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.clock-card { padding: clamp(28px, 7vw, 62px); text-align: center; border-top: 5px solid var(--line); }
.clock-card.is-working { border-top-color: var(--green); background: linear-gradient(180deg, #f7fffb, #fff 42%); }
.clock-card.is-break { border-top-color: #d28a10; background: linear-gradient(180deg, #fffbf1, #fff 42%); }
.clock-state { display: block; color: var(--navy); font-size: 1rem; font-weight: 900; letter-spacing: .12em; }
.clock-timer { display: block; margin: 18px 0 26px; color: var(--navy); font-size: clamp(3.2rem, 10vw, 6.4rem); font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.clock-summary, .totals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px; background: #f5f8fb; border-radius: 14px; }
.clock-summary span, .totals-grid span { display: grid; gap: 5px; color: var(--muted); font-size: .78rem; }
.clock-summary strong, .totals-grid strong { color: var(--navy); font-size: 1.05rem; }
.clock-actions { display: grid; gap: 10px; margin: 22px 0 18px; }
.text-link { color: var(--blue); font-weight: 750; font-size: .88rem; }

.journey-layout { align-items: start; }
.timeline { list-style: none; padding: 0; margin: 12px 0 25px; }
.timeline li { position: relative; display: grid; grid-template-columns: 18px 58px 1fr; gap: 10px; min-height: 64px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 16px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline-dot { width: 16px; height: 16px; margin-top: 2px; border: 4px solid #c8d9ed; background: var(--blue); border-radius: 50%; z-index: 1; }
.timeline li.corrected .timeline-dot { background: var(--amber); border-color: #ffe2aa; }
.timeline time { color: var(--navy); font-weight: 850; }
.timeline div { display: grid; gap: 4px; }
.timeline small { color: var(--amber); }

@media (max-width: 980px) {
    .topbar { flex-wrap: wrap; gap: 12px; }
    .topbar nav { order: 3; width: 100%; overflow-x: auto; }
    .user-menu { margin-left: auto; }
    .stat-grid, .stat-grid-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-shell { grid-template-columns: 1fr; }
    .login-copy { text-align: center; }
    .login-copy p { margin-inline: auto; }
    .trust-row { justify-content: center; }
    .login-card { justify-self: center; }
}

@media (max-width: 720px) {
    .main-content { width: min(100% - 22px, 1240px); padding-top: 25px; }
    .topbar { padding-inline: 12px; position: static; }
    .topbar nav a { white-space: nowrap; }
    .user-menu span { display: none; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .two-column, .form-grid, .form-grid-four { grid-template-columns: 1fr; }
    .stat-grid, .stat-grid-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card { padding: 16px; }
    .stat-card strong { font-size: 1.6rem; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .integration-status { align-items: flex-start; flex-direction: column; }
    .integration-status dl { justify-content: flex-start; }
    .clock-summary, .totals-grid { grid-template-columns: 1fr; }
    .clock-summary span, .totals-grid span { grid-template-columns: 1fr 1fr; align-items: center; text-align: left; }
    .clock-summary strong, .totals-grid strong { text-align: right; }
}
.account-link { display: inline-block; margin-top: 1rem; color: var(--accent, #3157d5); }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 0; }
.details-grid div { display: grid; gap: .25rem; }
.details-grid dt { color: var(--muted, #667085); font-size: .82rem; }
.details-grid dd { margin: 0; font-weight: 700; }
