/* Staff Attendance — clock page. Mobile-first; no external fonts or libraries. */
:root { --brand: #1f3a5f; --teal: #0f7c7c; --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0;
  --in: #059669; --out: #e11d48; --warn: #b54708; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #eef4f8;
  font: 16.5px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
h1, h2 { margin: 0; letter-spacing: -.015em; line-height: 1.2; }
p { margin: 0 0 12px; }
a { color: var(--teal); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(165deg, #e0f2f1 0%, #eef2ff 55%, #f8fafc 100%); }
.bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35; }
.bg i:nth-child(1) { width: 380px; height: 380px; background: var(--teal); left: -120px; top: -100px; }
.bg i:nth-child(2) { width: 340px; height: 340px; background: var(--brand); right: -120px; top: 30%; opacity: .25; }
.bg i:nth-child(3) { width: 300px; height: 300px; background: #10b981; left: 20%; bottom: -160px; opacity: .2; }

.top { max-width: 560px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b, .brand small { display: block; line-height: 1.2; }
.brand b { font-size: .95rem; } .brand small { color: var(--muted); font-size: .78rem; font-weight: 600; }
.brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; }
.mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--brand), var(--teal)); }
.clock-mini { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand); background: rgba(255,255,255,.8); padding: 5px 11px; border-radius: 999px; font-size: .9rem; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 12px 24px; }
.card { background: rgba(255,255,255,.96); border-radius: 26px; padding: 26px 22px; box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 24px 50px -24px rgba(31,58,95,.35); }
.screen { animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.secure-warn { background: #fef3c7; color: #92400e; padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; font-weight: 600; font-size: .9rem; }

.dots { display: flex; gap: 6px; justify-content: center; list-style: none; padding: 0; margin: 0 0 12px; }
.dots li { width: 34px; height: 6px; border-radius: 3px; background: rgba(31,58,95,.15); transition: background .2s; }
.dots li.on { background: var(--teal); }

.bigclock { text-align: center; margin: 4px 0 14px; }
.bigclock b { display: block; font-size: 3.4rem; font-weight: 850; letter-spacing: -.03em; color: var(--brand); font-variant-numeric: tabular-nums; line-height: 1; }
.bigclock span { color: var(--teal); font-weight: 700; }
h1 { text-align: center; font-size: 1.45rem; margin-bottom: 6px; }
h2 { font-size: 1.1rem; margin: 18px 0 10px; }
.lbl { display: block; font-weight: 700; font-size: .9rem; margin: 14px 0 6px; color: var(--ink-2); }
.lbl small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.lbl i { color: var(--out); font-style: normal; }
.hint { display: block; color: var(--muted); font-size: .8rem; margin: -2px 0 6px; }
.inp { width: 100%; font: inherit; padding: 13px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); }
.inp:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(15,124,124,.15); }
.inp.code { text-transform: uppercase; font-weight: 800; letter-spacing: .06em; text-align: center; font-size: 1.2rem; }
textarea.inp { resize: vertical; }

.pin { display: flex; justify-content: center; gap: 14px; margin: 6px 0 12px; cursor: text; }
.pin i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #94a3b8; transition: background .15s, transform .15s; }
.pin i.on { background: var(--brand); border-color: var(--brand); transform: scale(1.1); }
.pin.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.pin-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 0 auto; }
.keypad button { font: inherit; font-size: 1.35rem; font-weight: 700; min-height: 56px; border-radius: 16px; border: 0; background: #f1f5f9; color: var(--ink); cursor: pointer; transition: background .1s, transform .05s; }
.keypad button:active { transform: scale(.96); background: #e2e8f0; }
.keypad button.soft { font-size: .9rem; color: var(--muted); background: transparent; }
.remember { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 14px 0 0; font-size: .88rem; color: var(--ink-2); }
.remember input { width: 18px; height: 18px; accent-color: var(--teal); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 750; cursor: pointer; border-radius: 16px; padding: 12px 20px; min-height: 52px; border: 2px solid transparent; transition: transform .1s, box-shadow .2s, opacity .2s; text-decoration: none; }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--teal)); box-shadow: 0 12px 24px -12px var(--brand); }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.big { width: 100%; min-height: 58px; font-size: 1.08rem; margin-top: 18px; }
.btn.sm { min-height: 38px; padding: 6px 12px; border-radius: 12px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:active:not(:disabled) { transform: scale(.98); }
:focus-visible { outline: 3px solid rgba(15,124,124,.5); outline-offset: 3px; }
.row { display: flex; gap: 10px; margin-top: 22px; }
.row.between > .btn { flex: 1; }
.error { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: #fff1f2; color: #be123c; font-weight: 600; font-size: .92rem; }

.who { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: linear-gradient(120deg, #f0fdfa, #eef2ff); }
.who b, .who small { display: block; }
.who b { font-size: 1.15rem; }
.who small { color: var(--muted); font-size: .86rem; }
.who .shift { color: var(--brand); font-weight: 700; }
.avatar { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem; background: linear-gradient(135deg, var(--brand), var(--teal)); flex: none; }
.last { margin: 10px 0 0; font-size: .86rem; color: var(--ink-2); background: #f8fafc; padding: 8px 12px; border-radius: 10px; }

.events { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ev { font: inherit; cursor: pointer; border-radius: 20px; padding: 16px 10px; border: 2px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .1s, box-shadow .2s, background .2s; }
.ev b { font-size: 1.1rem; } .ev small { color: var(--muted); font-size: .8rem; }
.ev-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; font-weight: 900; color: #fff; margin-bottom: 4px; }
.ev.in .ev-ic { background: var(--in); } .ev.out .ev-ic { background: var(--out); }
.ev.in.on { border-color: var(--in); background: #ecfdf5; box-shadow: 0 12px 24px -14px var(--in); }
.ev.out.on { border-color: var(--out); background: #fff1f2; box-shadow: 0 12px 24px -14px var(--out); }
.modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.modes button { font: inherit; font-size: .88rem; font-weight: 650; cursor: pointer; padding: 9px 14px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--ink-2); }
.modes button.on { border-color: var(--teal); background: var(--teal); color: #fff; }

.cam { position: relative; aspect-ratio: 3 / 4; max-height: 52vh; margin: 8px auto 12px; border-radius: 22px; overflow: hidden; background: #0f172a; width: 100%; max-width: 360px; }
.cam video, .cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam video { transform: scaleX(-1); }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #cbd5e1; font-weight: 600; text-align: center; padding: 20px; }
.cam-ring { position: absolute; inset: 14% 18% 22%; border: 3px dashed rgba(255,255,255,.55); border-radius: 50%; pointer-events: none; }
.cam.done .cam-ring, .cam.done .cam-msg { display: none; }
.cam-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gps { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: #f8fafc; border: 2px solid var(--line); }
.gps b, .gps small { display: block; } .gps small { color: var(--muted); font-size: .82rem; }
.gps > div { flex: 1; }
.gps-ic { font-size: 1.4rem; }
.gps.ok { border-color: #a7f3d0; background: #ecfdf5; }
.gps.warn { border-color: #fde68a; background: #fffbeb; }
.gps.bad { border-color: #fecdd3; background: #fff1f2; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; margin-left: 6px; color: #fff; }

.warn { background: #fffbeb; border: 1px solid #fde68a; border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.warn b { color: var(--warn); display: block; }
.warn .lbl { margin-top: 10px; }

.summary { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.summary img { width: 96px; height: 128px; object-fit: cover; border-radius: 14px; }
.summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: .9rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; word-break: break-word; }
.declare { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px; border-radius: 14px; background: #f8fafc; font-size: .92rem; cursor: pointer; }
.declare input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--teal); }

.done-ic { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 14px; color: var(--in); background: #d1fae5; }
.done-ic.out { color: var(--out); background: #ffe4e6; }
.tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .15s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-time { font-size: 2.6rem; font-weight: 850; color: var(--brand); margin: 4px 0; font-variant-numeric: tabular-nums; }
#doneTitle { font-size: 1.5rem; }
.foot { text-align: center; color: var(--muted); font-size: .75rem; padding: 0 16px 24px; max-width: 560px; margin: 0 auto; }
@media (min-width: 600px) { .card { padding: 32px 34px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .tick { stroke-dashoffset: 0; } }

/* Installable app */
.install { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 10px 10px 10px 12px; margin-bottom: 12px;
  box-shadow: 0 12px 30px -18px rgba(31,58,95,.45); border: 1px solid #dbeafe; animation: rise .3s ease both; }
.install img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.install-txt { flex: 1; min-width: 0; }
.install-txt b, .install-txt span { display: block; }
.install-txt b { font-size: .95rem; }
.install-txt span { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.install .btn.sm { min-height: 40px; padding: 6px 14px; flex: none; }
.install-x { border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 6px; }
.ios-help { background: #fff; border-radius: 18px; padding: 16px 18px; margin-bottom: 12px; border: 2px solid #bfdbfe; animation: rise .3s ease both; }
.ios-help ol { margin: 8px 0; padding-left: 20px; }
.ios-help li { margin: 6px 0; }
.ios-help svg { vertical-align: -3px; color: #2563eb; }
/* When running as an installed app: hide the web footer clutter, respect the phone's notch */
.is-app .top { padding-top: max(14px, env(safe-area-inset-top)); }
.is-app .foot { padding-bottom: max(24px, env(safe-area-inset-bottom)); }

/* Live seconds on the clock */
.bigclock b { display: inline-flex; align-items: baseline; justify-content: center; }
.bigclock { display: flex; flex-direction: column; align-items: center; }
.bigclock .sec { font-size: .5em; font-weight: 800; color: var(--teal); margin-left: 2px; min-width: 1.6em; text-align: left; }
.clock-mini { min-width: 5.6em; text-align: center; }
.bigclock b > span { color: var(--brand); font-weight: inherit; }
.bigclock b > span.sec { color: var(--teal); }

/* Shift reminders */
.remind { display: flex; gap: 12px; align-items: center; text-align: left; margin: 18px 0 4px; padding: 14px; border-radius: 18px; background: linear-gradient(120deg, #eff6ff, #f0fdfa); border: 1px solid #bfdbfe; }
.remind-ic { font-size: 1.6rem; }
.remind-txt { flex: 1; min-width: 0; }
.remind-txt b, .remind-txt span { display: block; }
.remind-txt span { font-size: .84rem; color: var(--muted); line-height: 1.4; }
.remind .btn.sm { min-height: 40px; padding: 6px 14px; flex: none; }

/* AM/PM label on the big clock */
.bigclock b > span.ampm { font-size: .34em; font-weight: 800; color: var(--brand); margin-left: 6px; letter-spacing: .02em; align-self: center; }
.clock-mini { min-width: 7.4em; }
.clock-mini { white-space: nowrap; flex: none; font-size: .82rem; padding: 5px 10px; }
.brand { min-width: 0; }
.brand b, .brand small { overflow: hidden; text-overflow: ellipsis; }
