/* ============================================================================
   Ad Holic Attendance
   Same family as Finance and the Team CRM (Inter + Space Grotesk, the Ad Holic
   gradient), built for one thumb: the screen most people ever see is a single
   round button.
   ========================================================================== */

:root {
  --ink: #14172a;
  --ink-soft: #2c3350;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e7e9f1;
  --line-soft: #f0f2f8;
  --canvas: #f6f7fb;
  --surface: #ffffff;

  --brand: #2e5bff;
  --brand-ink: #1e3eb8;
  --brand-tint: #eef2ff;
  --magenta: #c0117a;
  --violet: #6d3ae0;
  --violet-tint: #f1ebff;
  --grad: linear-gradient(135deg, #c0117a 0%, #6d3ae0 50%, #2e5bff 100%);

  --green: #12855c;
  --green-tint: #e6f6ef;
  --red: #c9373d;
  --red-tint: #fdecec;
  --amber: #9a5b00;
  --amber-tint: #fff4e5;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(20, 23, 42, .05);
  --shadow: 0 1px 2px rgba(20, 23, 42, .04), 0 6px 20px rgba(20, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(20, 23, 42, .18);
  --nav-h: 64px;

  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; margin: 0; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 19px; }
h3 { font-size: 16px; margin: 22px 0 10px; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(46, 91, 255, .38); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------ Loading bar */
#progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 90; pointer-events: none;
  background: var(--grad); transform: scaleX(0); transform-origin: left; opacity: 0;
  transition: opacity .2s;
}
#progress.on { opacity: 1; animation: load 1.4s ease-in-out infinite; }
@keyframes load { 0% { transform: scaleX(.05); } 60% { transform: scaleX(.75); } 100% { transform: scaleX(.95); } }

/* ---------------------------------------------------------------- Top bar */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(16px, 4vw, 28px); padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.03em;
  display: flex; align-items: center; gap: 8px; white-space: nowrap; margin-right: auto;
}
.brand-logo { height: 28px; width: 28px; display: block; }
.tabs { display: none; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; border: 0; background: transparent; color: var(--muted);
  font-size: 14.5px; font-weight: 600; padding: 8px 13px; border-radius: 999px; white-space: nowrap;
  transition: background .14s, color .14s;
}
.tab:hover { color: var(--ink); background: var(--line-soft); }
.tab.on { color: var(--brand-ink); background: var(--brand-tint); }
.tab .badge { position: static; margin-left: 6px; vertical-align: 1px; }
.who { border: 0; background: none; padding: 0; border-radius: 50%; display: flex; }
.brand[data-go] { cursor: pointer; }

.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}

/* ------------------------------------------------------------------- View */
.view {
  width: 100%; max-width: 640px; margin: 0 auto;
  padding: 20px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 42px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.eyebrow { color: var(--muted); font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.sec { font-size: 13px; font-family: var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 24px 2px 8px; display: flex; align-items: center; gap: 8px; }
.sec.bad { color: var(--red); }
.sec .count { background: var(--line); color: var(--ink-soft); border-radius: 999px; padding: 1px 8px; font-size: 12px; letter-spacing: 0; }
.sec.bad .count { background: var(--red-tint); color: var(--red); }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14.5px;
  text-decoration: none; white-space: nowrap; transition: transform .08s, background .14s, border-color .14s, opacity .14s;
}
.btn:hover { border-color: #d5d9e6; background: #fcfcfe; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #23284a; }
.btn.danger { color: var(--red); border-color: #f3c9cb; background: var(--surface); }
.btn.danger.block, .btn.danger[data-sure="1"] { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--faint); border-top-color: var(--ink); animation: spin .7s linear infinite;
}
.btn.primary.busy::after, .btn.danger.block.busy::after { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { border: 0; background: none; padding: 6px 4px; color: var(--brand); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link.back { text-decoration: none; padding-left: 0; margin-bottom: 6px; }
.link.busy { opacity: .5; }

/* ---------------------------------------------------------------- Notices */
.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--faint);
  border-radius: var(--radius-sm); padding: 11px 14px; margin: 12px 0 0; font-size: 14px;
}
.notice.good { border-left-color: var(--green); background: var(--green-tint); border-color: #cdeadd; }
.notice.warn { border-left-color: #e0a100; background: var(--amber-tint); border-color: #f5e2c2; }
.notice.bad  { border-left-color: var(--red); background: var(--red-tint); border-color: #f6d3d4; }

/* ------------------------------------------------------- Today: the punch */
.today h1 { margin-bottom: 4px; }
.punch-card {
  margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); padding: 26px 20px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.punch-status { font-weight: 600; color: var(--ink-soft); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.punch-clock { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1.1; letter-spacing: -.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.punch-sub { color: var(--muted); font-size: 14px; }

.punch {
  position: relative; width: 196px; height: 196px; border-radius: 50%; border: 0; margin: 22px 0 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: transform .12s ease;
}
.punch-verb { font-family: var(--font-display); font-weight: 700; font-size: 25px; letter-spacing: -.02em; }
.punch-hint { font-size: 13px; opacity: .85; max-width: 140px; line-height: 1.3; text-align: center; }
button.punch:active { transform: scale(.97); }

.punch.go { background: var(--grad); color: #fff; box-shadow: 0 14px 34px rgba(109, 58, 224, .34), inset 0 0 0 6px rgba(255, 255, 255, .16); }
.punch.stop {
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  border: 6px solid transparent; color: var(--ink); box-shadow: 0 10px 28px rgba(20, 23, 42, .10);
  width: 168px; height: 168px; margin-top: 18px;
}
.punch.done { background: var(--green-tint); color: var(--green); width: 112px; height: 112px; margin: 18px 0 2px; }
.punch.locating { cursor: progress; }
.punch.locating::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 3px solid rgba(109, 58, 224, .35); animation: ping 1.4s ease-out infinite;
}
@keyframes ping { from { transform: scale(.94); opacity: 1; } to { transform: scale(1.12); opacity: 0; } }

.punch-msg {
  width: 100%; margin-top: 16px; text-align: left; background: var(--red-tint); border: 1px solid #f6d3d4;
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14.5px; color: #7d1f24;
}
.punch-msg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.rowlink {
  width: 100%; margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-align: left;
  color: var(--faint);
}
.rowlink span { display: flex; flex-direction: column; color: var(--ink); }
.rowlink small { color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ Tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 9px; min-width: 0; }
.tile span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile strong { font-family: var(--font-display); font-size: 20px; letter-spacing: -.02em; white-space: nowrap; }
.tile.bad { border-color: #f3c9cb; background: var(--red-tint); }
.tile.bad strong { color: var(--red); }

/* ---------------------------------------------------------------- Stepper */
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.stepper strong { font-family: var(--font-display); font-size: 16px; text-align: center; }
.stepper small { font-family: var(--font-body); font-weight: 500; font-size: 13px; }
.step { width: 44px; height: 40px; border: 0; background: transparent; border-radius: 10px; font-size: 24px; line-height: 1; color: var(--ink-soft); }
.step:hover { background: var(--line-soft); }
.step:disabled { color: var(--line); cursor: default; background: none; }

/* ------------------------------------------------------------ Lists, rows */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list.faded { opacity: .78; }
.row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--faint); min-height: 60px;
}
.row:last-child { border-bottom: 0; }
button.row:hover { background: #fafbfe; }
button.row:active { background: var(--line-soft); }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-title small { font-weight: 500; font-size: 13px; }
.row-sub { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.row-end { display: flex; align-items: center; gap: 8px; flex-shrink: 0; color: var(--ink); font-weight: 600; }
.row-ico { color: var(--ink-soft); display: flex; }
.row.nil .row-title { color: var(--faint); font-weight: 500; }
.row.day { min-height: 54px; padding-top: 9px; padding-bottom: 9px; }
.row.day.off { background: #fafbfd; }
.daynum { width: 38px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; color: var(--ink); }
.daynum small { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.daynum b { font-family: var(--font-display); font-size: 18px; }
.row.nil .daynum b { color: var(--faint); }

.pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-soft); color: var(--ink-soft); white-space: nowrap; }
.pill.green  { background: var(--green-tint);  color: var(--green); }
.pill.red    { background: var(--red-tint);    color: var(--red); }
.pill.amber  { background: var(--amber-tint);  color: var(--amber); }
.pill.violet { background: var(--violet-tint); color: var(--violet); }
.pill.blue   { background: var(--brand-tint);  color: var(--brand-ink); }
.pill.grey   { background: var(--line-soft);   color: var(--muted); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 700; font-size: 13.5px; letter-spacing: .02em;
  background: hsl(var(--h, 230) 70% 94%); color: hsl(var(--h, 230) 55% 34%);
}
.who .avatar { width: 36px; height: 36px; }

.empty { text-align: center; padding: 26px 18px; background: var(--surface); border: 1px dashed #d9dde9; border-radius: var(--radius); color: var(--muted); }
.empty strong { display: block; color: var(--ink-soft); font-family: var(--font-display); font-size: 16px; }
.empty p { margin-top: 4px; font-size: 14px; }
.empty .btn { margin-top: 12px; }

/* ------------------------------------------------------------------ Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card.me { display: flex; align-items: center; gap: 12px; }
.card.req { padding: 14px; }
.req-head { display: flex; align-items: center; gap: 12px; }
.req-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.quote { margin-top: 10px; padding: 9px 12px; background: var(--canvas); border-radius: 10px; font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.facts > div { background: var(--canvas); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.facts span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.facts strong { font-family: var(--font-display); font-size: 18px; }
.facts small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }

details { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
details.block { border: 0; margin-top: 22px; padding: 0; }
details.block .list { margin-top: 10px; }
summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); font-size: 14px; padding: 4px 0; }
.log { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13.5px; color: var(--ink-soft); }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.log li:last-child { border: 0; }

/* ------------------------------------------------------------------ Forms */
form label, .field { display: block; font-weight: 600; font-size: 14px; margin-top: 14px; }
.field > .label { display: block; }
form small, .field small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 5px; line-height: 1.4; }
.opt { font-weight: 400; color: var(--faint); font-size: 13px; }
input:not([type=checkbox]), select, textarea {
  display: block; width: 100%; margin-top: 6px; min-height: 46px; padding: 10px 12px;
  border: 1px solid #d9dde9; border-radius: 12px; background: var(--surface); font-size: 16px; font-weight: 400;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(46, 91, 255, .16); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.with-btn { display: flex; gap: 8px; align-items: stretch; margin-top: 6px; }
.with-btn input { margin-top: 0; min-width: 0; }
.with-btn .btn { min-height: 46px; flex-shrink: 0; }
.unit { display: flex; align-items: center; gap: 10px; }
.unit input { max-width: 130px; }
.unit span { margin-top: 6px; color: var(--muted); font-weight: 500; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
label.check input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--violet); }
label.check small { margin-top: 2px; }
.form h2 { margin-top: 6px; }
.form h2 + label, .form h2 + .field { margin-top: 12px; }
.form h2:not(:first-child) { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.form-actions { margin-top: 20px; }
.form-error { margin-top: 12px; color: var(--red); background: var(--red-tint); border-radius: 10px; padding: 9px 12px; font-size: 14px; font-weight: 500; }
.fine { font-size: 13px; color: var(--muted); text-align: center; margin-top: 14px; }

.locbox { margin-top: 6px; padding: 12px 14px; border-radius: 12px; background: var(--green-tint); border: 1px solid #cdeadd; display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.locbox strong { font-family: var(--font-display); font-size: 17px; font-variant-numeric: tabular-nums; }
.locbox span { font-size: 13.5px; color: var(--ink-soft); }
.locbox.unset { background: var(--amber-tint); border-color: #f5e2c2; }
.locbox + .btn { margin-top: 10px; width: 100%; }
.locbox + .btn + .with-btn { margin-top: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { margin: 0; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid #d9dde9; background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(46, 91, 255, .38); }

/* ----------------------------------------------------------------- Drawer */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 23, 42, .45); animation: fade .18s ease; }
.drawer-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: rise .22s cubic-bezier(.2, .8, .2, 1);
}
.drawer-panel h2 { padding-right: 44px; }
.drawer-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--line-soft); color: var(--ink-soft); font-size: 15px; z-index: 2; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.drawer-actions .btn { flex: 1 1 140px; }
.drawer-panel .tiles { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
.drawer-panel .list { margin-top: 4px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

/* ------------------------------------------------------- Phone bottom bar */
.mobile-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.mnav { flex: 1 1 0; min-width: 0; height: var(--nav-h); border: 0; background: none; color: var(--faint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; }
.mnav-ico { position: relative; display: flex; padding: 3px 14px; border-radius: 999px; transition: background .14s; }
.mnav.on { color: var(--brand-ink); }
.mnav.on .mnav-ico { background: var(--brand-tint); }
.mnav .badge { position: absolute; top: -4px; right: 2px; }

/* Staff have no bottom bar, so nothing needs to clear it. */
body.no-nav .view { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
body.no-nav .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ------------------------------------------------------------------ Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 95; max-width: min(92vw, 440px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px;
  box-shadow: var(--shadow-lg); font-weight: 500; font-size: 14.5px; text-align: center; width: max-content;
  animation: toast-in .2s ease;
}
/* Its own keyframes: the shared "rise" would replace the centring transform. */
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.toast.bad { background: #8e1f25; }

/* ---------------------------------------------------------------- Sign in */
.auth { min-height: calc(100dvh - 60px); display: grid; place-items: center; padding: 12px 0; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px 22px 24px; position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.auth-logo { width: 54px; height: 54px; display: block; margin-bottom: 12px; }
.auth-card h1 { font-size: 24px; }
.auth-card .btn { margin-top: 20px; }
.view[data-view="login"] { padding-bottom: 20px; }

/* --------------------------------------------------------------- Skeleton */
.skel > * { background: linear-gradient(90deg, #eceef5 25%, #f6f7fb 37%, #eceef5 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 12px; }
.skel-line { height: 26px; margin-bottom: 10px; }
.skel-line.thin { height: 14px; }
.skel-line.w40 { width: 55%; } .skel-line.w25 { width: 35%; }
.skel-round { width: 196px; height: 196px; border-radius: 50% !important; margin: 34px auto; }
.skel-card { height: 76px; margin-top: 12px; border-radius: var(--radius) !important; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ------------------------------------------------------------ Wide screens */
@media (min-width: 900px) {
  .tabs { display: flex; }
  .brand { margin-right: 8px; }
  .mobile-nav { display: none !important; }
  .view { max-width: 760px; padding: 28px 24px 48px; }
  .toast { bottom: 28px; }
  .drawer-panel {
    left: auto; top: 0; bottom: 0; width: 460px; max-height: none; border-radius: 0;
    padding: 26px 24px; animation: slide .22s cubic-bezier(.2, .8, .2, 1);
  }
  @keyframes slide { from { transform: translateX(28px); opacity: 0; } }
  h1 { font-size: 30px; }
}
@media (max-width: 380px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .brand span:not(.accent) { display: none; }
}

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

/* ============================================================== Version 2 */

/* The punch button carries a QR mark above its words. */
.punch svg { margin-bottom: 2px; opacity: .92; }
.punch.go { gap: 2px; }
.punch.working { opacity: .7; cursor: progress; }
.punch.working::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 3px solid rgba(109, 58, 224, .35); animation: ping 1.4s ease-out infinite;
}
.punch-card .link { margin-top: 6px; }
.punch-card .punch-sub strong { color: var(--ink); }
.pills.center { justify-content: center; margin-top: 8px; }

.two-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.two-btn .btn { white-space: normal; text-align: center; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
.today .two-btn { margin-top: 10px; }

.tile.good { border-color: #cdeadd; background: var(--green-tint); }
.tile.good strong { color: var(--green); }
.tile.warn { border-color: #f5e2c2; background: var(--amber-tint); }
.tile.warn strong { color: var(--amber); }
.tile strong { font-size: 18px; }

.bal { margin-top: 10px; font-size: 14px; color: var(--ink-soft); line-height: 1.45; }
.bal .neg { color: var(--red); }
.small { font-size: 13px; }
label.inline { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }
label.inline select { margin-top: 0; min-height: 40px; width: auto; flex: 1 1 auto; padding: 6px 10px; }
.card.req .muted.small { margin-top: 10px; }
.row.absent .row-title { color: var(--red); }

/* Radio chips (the no-QR reasons) share the checkbox chip look. */
.chip input[type=radio] + span { min-width: 0; padding: 0 14px; }

/* ----------------------------------------------------------------- Camera */
.scanner {
  position: fixed; inset: 0; z-index: 80; background: #0d0f1c; color: #fff;
  display: flex; flex-direction: column; gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
}
.scan-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-display); font-size: 19px; }
.scan-x { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 16px; }
.scan-stage { position: relative; flex: 1 1 auto; min-height: 0; border-radius: 22px; overflow: hidden; background: #000; }
.scan-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
  position: absolute; left: 50%; top: 50%; width: min(64vw, 280px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 22px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .38); border: 3px solid rgba(255, 255, 255, .9);
}
.scan-frame::after {
  content: ""; position: absolute; left: 8%; right: 8%; height: 2px; top: 12%; background: #e91d7f;
  box-shadow: 0 0 12px #e91d7f; animation: scanline 1.8s ease-in-out infinite alternate;
}
@keyframes scanline { to { top: 86%; } }
.scan-msg { text-align: center; font-size: 15px; color: rgba(255, 255, 255, .86); min-height: 22px; }
.btn.ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn.ghost-light:hover { background: rgba(255, 255, 255, .08); }

/* ---------------------------------------------------------- The QR code */
.qr-box { display: grid; place-items: center; padding: 14px; margin: 12px 0 4px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.qr-box svg { width: min(240px, 70vw); height: auto; display: block; }

/* What gets printed: only the poster. */
.print-area { display: none; }
@media print {
  @page { size: A4 portrait; margin: 14mm; }
  body > *:not(.print-area) { display: none !important; }
  body { background: #fff; }
  .print-area { display: block !important; }
  .poster { text-align: center; color: #14172a; font-family: var(--font-body); padding-top: 6mm; }
  .poster-logo { width: 26mm; height: 26mm; }
  .poster h1 { font-family: var(--font-display); font-size: 34pt; margin: 6mm 0 3mm; }
  .poster p { font-size: 16pt; margin: 0; }
  .poster-qr { width: 130mm; margin: 10mm auto 8mm; }
  .poster-qr svg { width: 100%; height: auto; }
  .poster-foot { color: #667085; font-size: 12pt !important; }
}
