/* 555 Clock. Same look as 555 Queue (queue.555thainanese.my): cream paper, 555 red,
   Lilita One headlines over Poppins, a yellow seal and the red ribbon. */

:root {
  --red: #ee2329;
  --cream: #f4f1d8;
  --yellow: #f4c21c;
  --green: #1a572b;
  --ink: #241608;
  --line: #ded9c4;
  --muted: #70685b;
  --white: #fffef7;
  --paper: #f7f5eb;
  --blue: #245897;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 14px/1.6 Poppins, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .display { font-family: 'Lilita One', sans-serif; font-weight: 400; line-height: 1.04; }
h1 { font-size: clamp(46px, 6vw, 84px); letter-spacing: -1.6px; }
h2 { font-size: 36px; }
h3 { font-size: 24px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.red { color: var(--red); }
.skip { position: absolute; top: -60px; }
.skip:focus { top: 10px; left: 10px; padding: 10px; background: white; z-index: 10; }
.loading { padding: 80px; text-align: center; }
[hidden] { display: none !important; }

/* Top bar, brand and footer */
.topbar { width: 100%; height: 96px; max-width: 1440px; margin: auto; padding: 20px 5%; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 20px; }
.brand { display: flex; gap: 20px; align-items: center; text-decoration: none; }
.brand img { width: 92px; height: 55px; object-fit: contain; }
.brand .divider { height: 32px; border-left: 1px solid #c8c1a8; }
.toplinks { display: flex; gap: 18px; align-items: center; font-size: 12px; font-weight: 600; }
.toplinks a { text-decoration: none; }
.dot { display: inline-block; width: 8px; height: 8px; background: var(--green); border-radius: 50%; margin-right: 6px; flex-shrink: 0; }
.dot.off { background: var(--muted); }
.dot.warn { background: var(--red); }
.ribbon { display: flex; gap: 35px; justify-content: center; align-items: center; padding: 15px; background: var(--red); color: var(--cream); font-family: 'Lilita One'; font-size: 18px; overflow: hidden; white-space: nowrap; }
.ribbon b { color: var(--yellow); font-size: 25px; }
.footer { width: 100%; max-width: 1280px; margin: auto; padding: 26px 5%; display: flex; justify-content: space-between; gap: 20px; font-size: 10px; color: var(--muted); }
.footer a { margin-left: 15px; font-weight: 600; }

/* Cards, badges, fields, buttons */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 30px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 50px; background: #eaf1e5; color: var(--green); padding: 5px 10px; font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; white-space: nowrap; }
.badge.in { background: #eaf1e5; color: var(--green); }
.badge.break { background: var(--yellow); color: var(--ink); }
.badge.out, .badge.grey { background: #eeeae1; color: var(--muted); }
.badge.alert { background: #fde5e5; color: #a6171e; }
.badge.blue { background: #e4eaf8; color: var(--blue); }
label.field { display: block; font-size: 12px; font-weight: 600; margin-bottom: 17px; }
.field input, .field select, .field textarea { width: 100%; display: block; padding: 12px 13px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); margin-top: 6px; min-height: 46px; font-size: 16px; }
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: 11px; margin-top: 5px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 10px; padding: 12px 19px; border: 1px solid transparent; border-radius: 7px; background: var(--red); color: white; font-size: 12px; font-weight: 700; text-decoration: none; min-height: 45px; }
.btn.full { width: 100%; margin-top: 15px; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.green { background: var(--green); }
.btn.tiny { padding: 6px 10px; min-height: 35px; font-size: 11px; }
.btn.danger { background: #fde5e5; color: #a6171e; }
.form-error { color: #b31018; font-size: 12px; margin: 10px 0; }
.form-error:empty { display: none; }
.fineprint { text-align: center; font-size: 10px; color: var(--muted); margin-top: 13px; }
#toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 8px; z-index: 50; max-width: 90%; font-size: 13px; display: none; }
#toast.show { display: block; }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 28px; background: var(--white); width: min(520px, 92vw); color: var(--ink); max-height: calc(100dvh - 24px); overflow-y: auto; }
dialog::backdrop { background: #24160888; }
dialog h2 { font-size: 29px; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.modal-actions .spacer { margin-right: auto; }
.button-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) { .btn { transition: transform .15s, background .15s; } .btn:hover { transform: translateY(-1px); } }

/* ── The clock (kiosk) ─────────────────────────────────────────── */
.kiosk { min-height: 100svh; display: flex; flex-direction: column; }
.kiosk-main { flex: 1; width: 100%; max-width: 1280px; margin: auto; padding: 34px 5% 40px; }
.kiosk-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 30px; }
.kiosk-hero .eyebrow { margin-bottom: 10px; }
.big-time { font-family: 'Lilita One'; color: var(--red); font-size: clamp(76px, 11vw, 138px); line-height: .92; letter-spacing: -2px; display: flex; align-items: baseline; gap: 12px; font-variant-numeric: tabular-nums; }
.big-time small { font-size: .3em; letter-spacing: 0; color: var(--ink); }
.kiosk-date { font-size: 15px; font-weight: 600; margin-top: 10px; }
.kiosk-count { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.count-chip { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; min-width: 120px; }
.count-chip strong { display: block; font-family: 'Lilita One'; font-weight: 400; font-size: 34px; line-height: 1.1; }
.count-chip span { font-size: 11px; color: var(--muted); }
.count-chip.first { background: var(--red); border-color: var(--red); color: white; }
.count-chip.first span { color: #ffe3cf; }
.who { position: relative; text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; gap: 13px; align-items: center; min-height: 92px; color: var(--ink); box-shadow: 0 5px 0 #e7e1c8; }
.who:active { transform: translateY(3px); box-shadow: 0 2px 0 #e7e1c8; }
.who.in { border-color: #b9d1b4; }
.who.break { border-color: var(--yellow); }
.who-name { display: block; font-weight: 700; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.who-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.who > span:last-child { min-width: 0; }
.who .badge { margin-top: 7px; white-space: normal; line-height: 1.3; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-family: 'Lilita One'; font-size: 21px; color: white; background: var(--ink); flex-shrink: 0; letter-spacing: .5px; }
.avatar.c0 { background: var(--red); } .avatar.c1 { background: var(--green); } .avatar.c2 { background: var(--yellow); color: var(--ink); } .avatar.c3 { background: var(--blue); } .avatar.c4 { background: var(--ink); } .avatar.c5 { background: #b4561c; }
.avatar.lg { width: 76px; height: 76px; font-size: 30px; }
.avatar.sm { width: 34px; height: 34px; font-size: 14px; }
.who .state-dot { position: absolute; top: 12px; right: 12px; }
/* The home screen: the time on the left, the PIN pad on the right (stacked on narrow screens). */
.kiosk-home { display: grid; grid-template-columns: 1fr minmax(320px, 420px); gap: 40px; align-items: center; }
.kiosk-home .kiosk-hero { display: block; margin: 0; }
.kiosk-home .kiosk-count { justify-content: flex-start; margin-top: 26px; }
.home-pad { padding: 26px 26px 20px; }
.home-pad h2 { font-size: 34px; margin: 0 0 4px; }
.home-pad .pin-dots { margin: 20px 0 6px; }
.home-pad .pin-pad { margin-bottom: 12px; }
.who-pick { display: grid; gap: 10px; margin: 18px 0 4px; }
.kiosk-empty { text-align: center; padding: 50px 20px; border: 1px dashed #cfc9b3; border-radius: 16px; }
.kiosk-empty h3 { font-size: 28px; margin: 6px 0 8px; }
.kiosk-offline { background: var(--ink); color: var(--cream); text-align: center; padding: 9px; font-size: 12px; font-weight: 600; }

/* Punch dialog */
dialog.punch { width: min(560px, 94vw); padding: 26px 28px 24px; }
.punch-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.punch-head h2 { margin: 2px 0 0; font-size: 34px; overflow-wrap: anywhere; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 22px 0 6px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots i.on { background: var(--red); border-color: var(--red); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 6px; }
.pin-pad .btn { min-height: 66px; font-size: 26px; font-weight: 700; }
.pin-pad .btn.word { font-size: 14px; }
.punch-status { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; background: var(--cream); border-radius: 14px; padding: 14px; margin: 18px 0; }
.cam { width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: var(--ink); position: relative; display: grid; place-items: center; color: var(--cream); font-size: 10px; text-align: center; line-height: 1.3; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); position: absolute; inset: 0; }
.cam.flash::after { content: ''; position: absolute; inset: 0; background: white; animation: flash .35s ease-out forwards; }
@keyframes flash { from { opacity: .95; } to { opacity: 0; } }
.punch-status strong { display: block; font-size: 17px; line-height: 1.3; }
.punch-status .small { display: block; margin-top: 4px; }
.punch-status .forgot { color: #a6171e; font-weight: 600; }
.punch-actions { display: grid; gap: 12px; }
.punch-actions.two { grid-template-columns: 1fr 1fr; }
.punch-actions .btn { min-height: 76px; font-size: 18px; border-radius: 12px; flex-direction: column; gap: 2px; }
.punch-actions .btn small { display: block; font-size: 11px; font-weight: 500; opacity: .85; }
.punch-actions .btn span { display: block; }
.punch-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.done { text-align: center; padding: 6px 0 0; }
.done .badge { font-size: 11px; padding: 7px 14px; }
.done-time { font-family: 'Lilita One'; color: var(--red); font-size: clamp(72px, 16vw, 108px); line-height: 1.05; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.done-time small { font-size: .32em; color: var(--ink); margin-left: 6px; }
.done h2 { font-size: 30px; margin: 4px 0 8px; }
.done .modal-actions { justify-content: center; }
.done-bar { height: 5px; background: var(--cream); border-radius: 5px; overflow: hidden; margin-top: 20px; }
.done-bar i { display: block; height: 100%; background: var(--red); width: 100%; transform-origin: left; animation: drain linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }

/* Clock not set up yet */
.setup { min-height: 100svh; display: flex; flex-direction: column; }
.setup-main { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; max-width: 1180px; margin: auto; padding: 40px 5%; }
.setup-main h1 { margin: 16px 0 20px; }
.setup-photo { position: relative; border-radius: 16px; overflow: hidden; height: 380px; }
.setup-photo img { width: 100%; height: 100%; object-fit: cover; }
.seal { position: absolute; right: 16px; top: 16px; width: 96px; height: 96px; border-radius: 50%; background: var(--yellow); display: grid; align-content: center; text-align: center; transform: rotate(11deg); font-family: 'Lilita One'; font-size: 18px; line-height: 1.05; border: 2px dashed var(--ink); }
.steps { display: grid; gap: 10px; margin: 24px 0; font-size: 13px; }
.steps span { color: var(--red); font-weight: 700; margin-right: 8px; }

/* ── Managers ──────────────────────────────────────────────────── */
.login-wrap { max-width: 440px; margin: 50px auto; padding: 0 20px; }
.login-wrap h1 { font-size: 40px; margin: 10px 0; }
.pin-card { text-align: center; }
.pin-card .pin-dots { margin-top: 18px; }
.shell { display: grid; grid-template-columns: 225px 1fr; min-height: 100vh; background: var(--paper); }
.sidebar { background: var(--cream); border-right: 1px solid var(--line); padding: 27px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { flex-direction: column; gap: 10px; align-items: flex-start; padding: 0 16px 28px; }
.sidebar .brand img { width: 110px; height: 67px; }
.side-nav { display: flex; flex-direction: column; gap: 7px; }
.nav-btn { background: transparent; border: 0; text-align: left; padding: 13px 15px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 600; display: flex; gap: 13px; align-items: center; text-decoration: none; }
.nav-btn.active { background: var(--red); color: white; }
.nav-btn span:first-child { font-size: 18px; width: 20px; text-align: center; }
.nav-btn .pill { margin-left: auto; background: var(--red); color: white; border-radius: 20px; font-size: 10px; padding: 1px 7px; }
.nav-btn.active .pill { background: white; color: var(--red); }
.sidebar-bottom { margin-top: auto; font-size: 10px; padding: 20px 14px 0; border-top: 1px solid var(--line); }
.sidebar-bottom strong { display: block; font-size: 12px; color: var(--ink); margin-bottom: 8px; }
.workspace { min-width: 0; }
.staff-top { height: 76px; background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; gap: 15px; }
.staff-top strong { font-size: 12px; }
.staff-content { padding: 30px 34px 60px; max-width: 1600px; margin: auto; }
.clock-banner { background: var(--yellow); padding: 10px 34px; font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 26px; }
.page-heading h1 { font-size: 40px; letter-spacing: -.5px; margin: 6px 0 8px; }
.page-heading p { font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 24px; }
.metric { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.metric p { font-size: 11px; color: var(--muted); }
.metric strong { font-size: 34px; line-height: 1.5; font-family: 'Lilita One'; font-weight: 400; }
.metric em { font-size: 11px; font-style: normal; color: var(--muted); }
.metric:first-child { background: var(--red); border-color: var(--red); color: white; }
.metric:first-child p, .metric:first-child em { color: #ffe3cf; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap; }
.panel-head h3 { font-size: 22px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; color: var(--muted); border-radius: 6px; padding: 9px 13px; font-size: 11px; font-weight: 600; }
.tab.active { background: var(--cream); color: var(--ink); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { padding: 13px 20px; font-size: 9px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; background: #faf8f0; white-space: nowrap; }
td { padding: 15px 20px; border-bottom: 1px solid #eeeade; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.hours { font-family: 'Lilita One'; font-size: 20px; color: var(--red); }
/* The hours log: each break on its own line, so a break out sits beside its break in. */
.hours-log th, .hours-log td { padding-left: 14px; padding-right: 14px; }
.hours-log td.breaks, .hours-log td.t { white-space: nowrap; }
.hours-log .bl { display: block; line-height: 1.9; }
.hours-log .bl .sub { display: inline; margin-left: 4px; }
tr.clickable { cursor: pointer; }
@media (hover: hover) { tr.clickable:hover td { background: #fcfbf4; } }
.person { display: flex; gap: 11px; align-items: center; font-weight: 600; }
.person .sub { font-weight: 400; }
.flags { display: flex; gap: 5px; flex-wrap: wrap; }
.empty { padding: 50px 20px; text-align: center; }
.empty .empty-icon { font-size: 34px; color: var(--red); margin-bottom: 10px; }
.empty h3 { font-size: 24px; margin-bottom: 8px; }
.empty p { font-size: 12px; color: var(--muted); max-width: 360px; margin: auto; }
.alert-strip { background: #fde5e5; border: 1px solid #f6c3c3; color: #7d1015; border-radius: 12px; padding: 14px 18px; margin-bottom: 22px; display: grid; gap: 8px; }
.alert-strip .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.info-strip { border: 1px dashed #cfc9b3; border-radius: 10px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; gap: 15px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar select, .toolbar input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; min-height: 40px; font-size: 13px; color: var(--ink); }
.toolbar .tabs { background: var(--white); border: 1px solid var(--line); border-radius: 9px; padding: 4px; }
.custom-range { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.punch-list { list-style: none; margin: 0; padding: 0; }
.punch-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 12px 22px; border-bottom: 1px solid #eeeade; font-size: 12px; }
.punch-row:last-child { border-bottom: 0; }
.punch-row.undone { opacity: .5; }
.punch-row .sub { display: block; margin-top: 2px; }
.punch-row.undone strong { text-decoration: line-through; }
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--cream); display: grid; place-items: center; font-size: 9px; color: var(--muted); text-align: center; line-height: 1.2; border: 0; padding: 0; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-big { width: 100%; border-radius: 12px; display: block; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.settings-grid .card h3 { margin-bottom: 8px; }
.settings-grid .card > p { margin-bottom: 18px; }
.switch { display: flex; gap: 12px; align-items: center; font-weight: 600; font-size: 13px; margin: 6px 0 16px; }
.switch input { width: 22px; height: 22px; accent-color: var(--red); }
.device-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.device-row:last-child { border-bottom: 0; }
.break-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.break-row .field { margin: 0; }
.reasons { display: flex; gap: 6px; flex-wrap: wrap; margin: -8px 0 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 5px 11px; font-size: 11px; }
.chip.on { background: var(--ink); color: white; border-color: var(--ink); }
.evidence { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.evidence figure { margin: 0; font-size: 10px; color: var(--muted); }
.evidence .thumb { width: 100%; height: 96px; }
.evidence figcaption { margin-top: 4px; line-height: 1.35; }
.evidence figcaption b { color: var(--ink); }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { padding: 14px 22px; border-bottom: 1px solid #eeeade; font-size: 12px; display: grid; grid-template-columns: 130px 1fr; gap: 16px; }
.log-list li:last-child { border-bottom: 0; }
.log-list .why { display: block; color: var(--muted); margin-top: 3px; }
.log-list.compact li { padding: 8px 0; grid-template-columns: 110px 1fr; }
.note { padding: 12px 14px; background: var(--cream); border-radius: 8px; margin: 0 0 16px; }
.gap-top { margin-top: 17px; }
tr.day-row th { background: var(--cream); text-align: left; font-size: 10px; color: var(--ink); padding: 9px 20px; }
.section-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.field-label { font-size: 12px; font-weight: 600; margin: 0 0 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }
.btn .ico { width: 16px; height: 16px; }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; }

/* ── Leave: MC red, off day grey, annual leave green, emergency orange, unpaid blue.
   Waiting for a manager = a dashed outline. Written phone first, then widened. ── */
.lv-mc { --lv: #ee2329; --lv-soft: #fde5e5; --lv-ink: #a6171e; }
.lv-off { --lv: #8a8270; --lv-soft: #eeeae1; --lv-ink: #554e42; }
.lv-annual { --lv: #1a572b; --lv-soft: #e2eedf; --lv-ink: #1a572b; }
.lv-emergency { --lv: #e8761b; --lv-soft: #fdebd9; --lv-ink: #8f4308; }
.lv-unpaid { --lv: #245897; --lv-soft: #e4eaf8; --lv-ink: #245897; }
.lv { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-width: 0; border: 1.5px solid var(--lv-soft, #eeeae1); background: var(--lv-soft, #eeeae1); color: var(--lv-ink, var(--ink)); border-radius: 50px; padding: 1px 8px 1px 6px; font-size: 11px; font-weight: 700; line-height: 1.5; vertical-align: middle; }
.lv::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lv, var(--muted)); flex-shrink: 0; }
.lv > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv.pending { background: #fff; border-style: dashed; border-color: var(--lv, var(--muted)); }
.lv-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lv, var(--muted)); }
.lv-dot.pending { background: transparent; box-shadow: inset 0 0 0 1.5px var(--lv, var(--muted)); }

/* The phone tab bar and header (shown at 760 px and below) */
.tabbar, .phone-brand { display: none; }
.tab-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 600; line-height: 1.2; padding: 4px 2px; min-height: 54px; min-width: 0; border-radius: 12px; }
.tab-btn .ico { width: 46px; height: 28px; padding: 3px 11px; border-radius: 14px; stroke-width: 1.9; }
.tab-btn.active { color: var(--red); }
.tab-btn.active .ico { background: #fde5e5; }
.tab-btn .pill { position: absolute; top: 0; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; border: 2px solid var(--white); }

/* More (a sheet that slides up on phones) */
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: -8px auto 14px; }
.sheet-list { display: grid; gap: 8px; margin-top: 10px; }
.sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 14px; min-height: 60px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3; text-decoration: none; }
.sheet-item .ico { width: 24px; height: 24px; color: var(--red); }
.sheet-item small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.sheet-item.active { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red); }
.sheet-item.quiet .ico { color: var(--muted); }

/* Today: requests waiting, and who is off */
.req-strip { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; background: var(--yellow); color: var(--ink); border: 0; border-radius: 12px; padding: 13px 16px; margin-bottom: 14px; min-height: 58px; }
.req-strip strong { display: block; font-size: 15px; line-height: 1.3; }
.req-strip span span { display: block; font-size: 12px; }
.req-strip .go { font-weight: 700; font-size: 13px; white-space: nowrap; }
.off-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 22px; }
.off-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.off-person { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 50px; padding: 4px 8px 4px 4px; background: #fff; color: var(--ink); font-size: 12px; min-height: 38px; max-width: 100%; }
.person .sub .lv { margin-top: 3px; }

/* Calendar */
.cal-toolbar { display: grid; gap: 10px; margin-bottom: 12px; }
.cal-bar { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 8px; }
.cal-title { font-size: 26px; text-align: center; }
.icon-btn { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font-size: 22px; font-weight: 700; line-height: 1; display: grid; place-items: center; padding: 0 0 3px; }
.cal-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.cal-tools select { min-height: 46px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-size: 16px; min-width: 0; }
.cal { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 6px; margin-bottom: 10px; transition: opacity .15s; }
.cal.is-loading { opacity: .5; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-head span { text-align: center; font-size: 9px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); padding: 4px 0 5px; }
.cal-cell { min-width: 0; min-height: 60px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px 5px; border: 1.5px solid transparent; border-radius: 9px; background: var(--paper); color: var(--ink); text-align: center; overflow: hidden; }
.cal-cell.blank { background: transparent; }
.cal-cell.weekend { background: #f1eedf; }
.cal-cell.selected { border-color: var(--ink); background: #fff; }
.cal-num { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-num { background: var(--red); color: #fff; }
.cal-cell.future .cal-num { color: var(--muted); }
.cal-cell.today.future .cal-num { color: #fff; }
.cal-dots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px; min-height: 7px; max-width: 100%; }
.cal-dots b { font-size: 9px; line-height: 7px; color: var(--muted); }
.cal-chips, .cal-hours .dt { display: none; }
.cal-hours { margin-top: auto; font-size: 10px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-more { font-size: 10px; color: var(--muted); font-weight: 600; }
.cal-cell { container-type: inline-size; }
.lv i { font-style: normal; }
@container (max-width: 100px) { .cal-chips .lv-type { display: none; } }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 18px; font-size: 11px; color: var(--muted); }
.lv-key { display: inline-flex; gap: 6px; align-items: center; }
.cal-day .empty { padding: 30px 20px; }
.cal-day-part { padding: 2px 14px 14px; }
.cal-day-part.flush { padding: 2px 0 0; }
.cal-day-part.flush > .section-label, .cal-day-part.flush > div > p { padding: 0 14px; }
.cal-day-part.flush > div > p { padding-bottom: 14px; }
.leave-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.leave-row { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 11px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px 10px 12px; color: var(--ink); }
.leave-who { flex: 1; min-width: 0; font-size: 13px; }
.leave-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leave-who .sub { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 4px; }
.leave-row .chev { font-size: 24px; line-height: 1; color: var(--muted); padding: 0 4px 3px; }

/* Requests */
.req-list { display: grid; gap: 12px; margin-bottom: 22px; }
.req-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 15px; display: grid; gap: 11px; align-content: start; }
.req-card.pending { border-color: #e9d48f; box-shadow: inset 4px 0 0 var(--yellow); }
.req-card.rejected, .req-card.cancelled { background: #fbfaf4; }
.req-card.focus { border-color: var(--red); box-shadow: 0 0 0 3px #fde5e5; }
.req-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.req-top .person { min-width: 0; font-size: 14px; }
.req-top .sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.req-what { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.req-what .lv { font-size: 12px; padding: 3px 10px 3px 8px; }
.req-what strong { font-size: 15px; line-height: 1.35; }
.req-note { background: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 13px; overflow-wrap: anywhere; }
.req-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.req-decided { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.req-decided b { color: var(--ink); }
.req-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.req-actions.one { grid-template-columns: 1fr; }
.req-actions .btn { min-height: 52px; font-size: 14px; border-radius: 10px; }
.file-thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; border: 1px solid var(--line); background: var(--cream); padding: 0; overflow: hidden; display: grid; place-items: center; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb.pdf { align-content: center; gap: 2px; padding: 6px; }
.file-thumb.pdf span { font-family: 'Lilita One'; font-size: 20px; color: var(--red); line-height: 1; }
.file-thumb.pdf small { display: block; max-width: 64px; font-size: 9px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-title { font-weight: 600; margin: 4px 0 12px; overflow-wrap: anywhere; }
dialog.viewer .photo-big { max-height: 68dvh; object-fit: contain; background: var(--cream); }
.cal-day, .req-card { scroll-margin-top: 76px; }

/* + Add leave */
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.type-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 50px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; }
.type-chip::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--lv); }
.type-chip.on { border-color: var(--lv); background: var(--lv-soft); color: var(--lv-ink); }
.fields.keep { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.fields.keep input { min-width: 0; }
.days-line { font-size: 12px; font-weight: 600; margin: -8px 0 16px; min-height: 1em; }
.file-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-picks .btn { position: relative; min-height: 48px; }
.file-picks .btn:focus-within { outline: 3px solid var(--green); outline-offset: 2px; }
.file-previews { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.file-previews:empty { display: none; }
.file-preview { position: relative; }
.file-preview .x { position: absolute; top: -9px; right: -9px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--white); background: var(--ink); color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0; }

/* Team: phone links */
.link-box { background: var(--cream); border-radius: 12px; padding: 14px; margin: 16px 0 4px; }
.link-box .field { margin-bottom: 10px; }
.link-box input { font-size: 13px; }
.link-box p + p { margin-top: 4px; }
.link-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-bottom: 12px; }
.link-actions .btn { min-height: 48px; }
.link-actions .btn.ghost { background: #fff; }
#make-link { margin: 18px 0 4px; }
.phone-row { display: flex; gap: 10px; align-items: flex-start; }
.phone-row .ico { color: var(--muted); margin-top: 2px; }
.phone-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; background: var(--cream); border-radius: 10px; padding: 10px 12px; margin: 0 0 6px; }
.phone-line .ico { color: var(--muted); }
.phone-line .btn { margin-left: auto; }

/* Calendar and Requests from 761 px up: names in the boxes, cards side by side */
@media (min-width: 761px) {
  .cal-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .cal-bar { grid-template-columns: 46px minmax(220px, auto) 46px; }
  .cal-tools { grid-template-columns: minmax(200px, auto) auto; }
  .cal-tools select { font-size: 13px; }
  .cal { padding: 10px; }
  .cal-head, .cal-grid { gap: 6px; }
  .cal-head span { font-size: 10px; }
  .cal-cell { min-height: 112px; align-items: stretch; text-align: left; padding: 7px; gap: 4px; }
  .cal-num { width: 27px; height: 27px; }
  .cal-dots, .cal-hours .ph { display: none; }
  .cal-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
  .cal-chips .lv { font-size: 10px; }
  .cal-hours { font-size: 11px; }
  .cal-hours .dt { display: inline; }
  .cal-cell:hover { border-color: var(--line); }
  .cal-cell.selected:hover { border-color: var(--ink); }
  .cal-day-part { padding: 2px 22px 16px; }
  .cal-day-part.flush > .section-label, .cal-day-part.flush > div > p { padding: 0 22px; }
  .leave-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .req-list { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
  .req-card { padding: 18px; }
}

/* ── Smaller screens ───────────────────────────────────────────── */
@media (max-width: 1050px) {
  .shell { grid-template-columns: 190px 1fr; }
  .staff-content { padding: 25px 20px 60px; }
  .staff-top, .clock-banner { padding-left: 20px; padding-right: 20px; }
  .metrics { gap: 10px; }
  .metric { padding: 15px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 34px; }
  .setup-main { gap: 30px; }
}
@media (max-width: 1000px) {
  .ribbon { justify-content: flex-start; }
}
@media (max-width: 860px) {
  .kiosk-home { grid-template-columns: 1fr; gap: 24px; align-items: start; }
  .kiosk-home .kiosk-count { margin-top: 16px; }
  .home-pad { width: 100%; max-width: 460px; justify-self: center; }
  .kiosk-hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .kiosk-count { justify-content: flex-start; }
  .setup-main { grid-template-columns: 1fr; }
  .setup-photo { height: 220px; order: -1; }
}
@media (max-width: 760px) {
  h1 { font-size: 42px; }
  .topbar { height: 74px; padding: 14px 6%; }
  .brand img { width: 70px; height: 42px; }
  .brand { gap: 12px; }
  .brand .eyebrow { font-size: 9px; letter-spacing: 1px; }
  .toplinks .hide-sm { display: none; }
  .kiosk-main { padding: 22px 5% 30px; }
  .count-chip { min-width: 0; flex: 1; padding: 10px 14px; }
  .count-chip strong { font-size: 28px; }
  .who { padding: 12px; gap: 10px; min-height: 80px; }
  .who .avatar { width: 42px; height: 42px; font-size: 17px; }
  .who-name { font-size: 14px; }
  .who .badge { font-size: 9px; letter-spacing: .3px; padding: 4px 8px; }
  .ribbon { justify-content: flex-start; font-size: 15px; gap: 20px; }
  .footer { flex-wrap: wrap; font-size: 9px; }
  dialog.punch { padding: 20px 18px; }
  .punch-head h2 { font-size: 28px; }
  .pin-pad .btn { min-height: 58px; }
  .punch-actions .btn { min-height: 66px; font-size: 16px; }
  .cam { width: 84px; height: 84px; }

  /* Managers on a phone: no sidebar; a slim header and a tab bar fixed at the bottom
     (Today · Calendar · Requests · Timesheets · More), clear of the iPhone home bar. */
  .shell { display: block; }
  .sidebar { display: none; }
  .tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px #2416080f; padding: 5px max(4px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
  .staff-top { position: sticky; top: 0; z-index: 20; height: auto; min-height: 56px; padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
  .staff-top .desk-only, .staff-top #logout { display: none; }
  .phone-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
  .phone-brand img { width: 58px; height: 35px; object-fit: contain; }
  .phone-brand .eyebrow { font-size: 8.5px; letter-spacing: 1.4px; line-height: 1.35; padding-left: 10px; border-left: 1px solid #c8c1a8; }
  .clock-banner { padding: 9px 16px; flex-wrap: wrap; }
  .staff-content { padding: 20px max(14px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  body.has-tabbar #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .page-heading { display: block; margin-bottom: 18px; }
  .page-heading .actions { margin-top: 14px; }
  .page-heading h1 { font-size: 34px; }
  /* A page with one button keeps it beside the title, so the content starts higher. */
  .page-heading.tight { display: flex; align-items: flex-start; gap: 12px; }
  .page-heading.tight > div:first-child { flex: 1; min-width: 0; }
  .page-heading.tight .actions { margin-top: 20px; flex-shrink: 0; }

  /* Pop-ups slide up from the bottom on a phone, full width (not the clock's PIN pop-up). */
  dialog:where(:not(.punch)) { margin: auto 0 0; width: 100%; max-width: none; max-height: calc(100dvh - 32px); border-radius: 20px 20px 0 0; border-width: 1px 0 0; padding: 24px max(18px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  dialog h2 { font-size: 27px; }
  .modal-actions .btn { flex: 1 1 auto; min-height: 50px; }
  .modal-actions .spacer { order: 3; flex-basis: 100%; margin: 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric strong { font-size: 28px; }
  .panel-head { padding: 12px 14px; }
  th { padding: 10px 12px; }
  td { padding: 12px; font-size: 12px; }
  .punch-row { padding: 10px 14px; grid-template-columns: 44px 1fr auto; gap: 10px; }
  .thumb { width: 44px; height: 44px; }
  .settings-grid { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .fields { grid-template-columns: 1fr; gap: 0; }
  .log-list li { grid-template-columns: 1fr; gap: 2px; padding: 12px 14px; }
  .info-strip { flex-direction: column; align-items: flex-start; }
  .login-wrap { margin-top: 30px; }

  /* Tables become stacked cards on phones. */
  .stack table, .stack thead, .stack tbody, .stack tr, .stack td { display: block; }
  .stack thead { display: none; }
  .stack tbody { display: grid; gap: 10px; padding: 10px; }
  .stack tr { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
  .stack td { padding: 0; border: 0; min-width: 0; }
  .stack td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: 11px; }
  .stack td.lead { grid-column: 1; }
  .stack td.end { grid-column: 2; grid-row: 1; justify-self: end; text-align: right; }
  .stack td.full { grid-column: 1 / -1; }
  .stack td.num { text-align: left; }
  .stack td.hours::before { font-family: Poppins, Arial, sans-serif; }
  .stack tr.day-row { display: block; border: 0; padding: 8px 2px 0; }
  .stack tr.day-row th { display: block; background: none; padding: 0; font-size: 11px; letter-spacing: 1.5px; }
  .stack .hours-log td.breaks { white-space: normal; grid-column: 1 / -1; } /* each break list on its own line */
  .stack .hours-log td.t, .stack .hours-log td.num { white-space: normal; }
  .stack .hours-log .bl { display: inline; line-height: inherit; }
  .stack .hours-log .bl + .bl::before { content: ', '; }

  /* Thumb-sized controls; 16 px text in fields so iPhones don't zoom in. */
  .btn.tiny { min-height: 40px; padding: 8px 12px; }
  .chip { padding: 8px 12px; font-size: 12px; }
  .tab { padding: 10px 13px; font-size: 12px; }
  .toolbar select, .toolbar input { font-size: 16px; min-height: 44px; }
  .toolbar select { flex: 1 1 160px; min-width: 0; }
  .custom-range { width: 100%; }
  .custom-range input { flex: 1 1 0; min-width: 0; }
  .stack td.full .actions { justify-content: flex-start; }
  .field .fields { gap: 8px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  dialog:where(:not(.punch))[open] { animation: sheet-up .22s ease-out; }
}
@keyframes sheet-up { from { transform: translateY(48px); opacity: .3; } }
@media (max-width: 420px) {
  .punch-actions.two { grid-template-columns: 1fr; }
  .break-row { grid-template-columns: 1fr 1fr; }
  .break-row .btn { grid-column: 1 / -1; }
}
@media print {
  .sidebar, .staff-top, .clock-banner, .toolbar, .page-heading .actions, .no-print, .tabbar, .cal-toolbar, .req-actions { display: none !important; }
  .staff-content { padding-bottom: 0 !important; }
  .shell { display: block; background: white; }
  .panel { break-inside: avoid; }
}
