/* Built with the Secure Platform Developer Agent (SPDA v1.1) -- Practices by: A2C (2026) */
/* Artifact: stylesheet of the attendance screens (admin, phone app, kiosk). The same look as the payroll system:
   the same tokens (tokens.css), typeface, buttons, cards, light and dark themes (docs/MARCA.md, ADR 0037). No inline styles: the CSP
   forbids them. The visible name comes from MARCA_NOMBRE (the server fills it into each page). */
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* the colors, radii and spacing come from tokens.css (loaded before this file; light and dark) */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-ctl); }
.skip:focus { top: 12px; }

/* brand bar: the visible name is configurable (MARCA_NOMBRE) */
.bar { background: var(--card); border-bottom: 1px solid var(--line); }
.bar .inner { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.logo-box { width: 40px; height: 40px; border-radius: var(--r-ctl); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.logo-box .logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand { font-weight: 700; color: var(--link); }
.brand small { display: block; font-weight: 400; color: var(--ink-2); font-size: .8rem; }

main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 16px; }
main.wide, .wide { max-width: 960px; }
h1 { font-size: 1.5rem; line-height: 1.2; margin: .2rem 0 1rem; }
h2 { font-size: 1.1rem; line-height: 1.2; margin: 0 0 12px; font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin: 14px 0; box-shadow: var(--shadow); }
.card h2:last-child { margin-bottom: 0; }
.schedule-list { list-style: none; padding: 0; margin: 4px 0 12px; }  /* «Mi horario» of the phone (#166) */
.schedule-list li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.schedule-list li:last-child { border-bottom: 0; }

button, .button { font: inherit; font-weight: 600; border: 0; border-radius: var(--r-ctl); padding: 10px 20px; background: var(--accent); color: var(--on-accent); min-height: 44px; cursor: pointer; transition: background-color .18s var(--ease); }
button:hover, .button:hover { background: var(--accent-strong); }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--field-line); }
button.secondary:hover { background: var(--bg); }
button.danger { background: var(--danger-solid); color: #fff; }
button.danger:hover { background: var(--danger-solid-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.big { width: 100%; font-size: 1.3rem; min-height: 72px; margin: 6px 0; }
input, select, textarea { font: inherit; width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid var(--field-line); border-radius: var(--r-ctl); background: var(--field-bg); color: var(--ink); }
input[type="checkbox"] { accent-color: var(--accent); }
label { display: block; margin: .8rem 0 .3rem; font-weight: 600; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 auto; }
.muted { color: var(--ink-2); font-size: .9rem; }
.hint { color: var(--ink-2); font-size: .88rem; margin: 4px 0 12px; }
.empty { color: var(--ink-2); background: var(--bg); border: 1px dashed var(--field-line); border-radius: var(--r-ctl); padding: 14px 16px; margin: 0; }
.ok { color: var(--ok); } .warn { color: var(--notice-ink); } .bad { color: var(--red); }
.status { min-height: 1.4em; }
.status.ok, .status.warn, .status.bad { padding: 10px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); }
.status.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.status.warn { background: var(--notice-bg); border-color: var(--notice-line); }
.status.bad { background: var(--red-bg); border-color: var(--red-line); }
.tabs { display: flex; gap: 6px; margin: 8px 0 12px; flex-wrap: wrap; }
.tabs button { flex: 1; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-ctl); }
.tabs button:hover { background: var(--accent-soft); }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.flag { display: inline-block; padding: 1px 10px; border-radius: var(--r-ctl); border: 1px solid var(--notice-line); background: var(--notice-bg); color: var(--notice-ink); font-size: .8rem; margin: 2px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
img.qr { width: 100%; max-width: 320px; background: #fff; padding: 8px; border-radius: var(--r-ctl); border: 1px solid var(--line); }
p, strong, label, h1, h2 { overflow-wrap: anywhere; }  /* secrets and long names wrap, never widen the page */
code { background: var(--bg); padding: 1px 6px; border-radius: 6px; word-break: break-all; }

/* password and secret fields: the eye, like the payroll system */
.pw { position: relative; }
.pw input { padding-right: 52px; }
.pw .eye { position: absolute; right: 2px; top: 0; width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; background: none; border: 0; color: var(--ink-2); border-radius: var(--r-ctl); }
.pw .eye:hover { background: none; color: var(--ink); }
.pw .eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw .eye .off { display: none; }
.pw .eye[aria-pressed="true"] .on { display: none; }
.pw .eye[aria-pressed="true"] .off { display: block; }

.kiosk .offline-code { font-size: 2.4rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; word-break: keep-all; }
.kiosk main { max-width: 900px; } .kiosk .keys button { min-height: 64px; font-size: 1.4rem; }
.kiosk .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 700px) { .kiosk .grid { grid-template-columns: 1fr; } }
.w100 { width: 100%; } .check { width: auto; min-height: 0; margin-right: 6px; }
.foot { text-align: center; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; letter-spacing: .03em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* organization help and details */
.org-lost { margin: -.25rem 0 .75rem; }
.org-lost summary { cursor: pointer; color: var(--link); font-size: .9rem; }
.org-data code { overflow-wrap: anywhere; background: var(--bg); padding: .1rem .4rem; border-radius: 6px; }
.row input[readonly] { flex: 1 1 14rem; min-width: 0; }

/* ---- B1: scan the kiosk, confirm, link help ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
label.button { display: inline-flex; align-items: center; justify-content: center; text-align: center; margin: 0; cursor: pointer; }
label.button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--field-line); }
label.button.secondary:hover { background: var(--bg); }
.visually-hidden:focus-visible + *, label.button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
#scan-video { border-radius: var(--r-ctl); background: #000; max-height: 60vh; object-fit: cover; }
.confirm { text-align: center; padding: 28px 20px; border-width: 2px; }
.confirm[data-kind="in"] { background: var(--ok-bg); border-color: var(--ok-line); }
.confirm[data-kind="out"] { background: var(--notice-bg); border-color: var(--notice-line); }
.confirm[data-kind="voided"] { background: var(--red-bg); border-color: var(--red-line); }
.confirm-kind { font-size: clamp(1.7rem, 8vw, 2.6rem); font-weight: 700; line-height: 1.1; margin: 0 0 8px; }
.confirm-name { font-size: clamp(1.3rem, 6vw, 1.9rem); margin: 4px 0; overflow-wrap: anywhere; }
.confirm-time { font-size: clamp(2.2rem, 12vw, 3.6rem); font-weight: 700; font-variant-numeric: tabular-nums; margin: 8px 0 12px; }
.linkcode { font-size: 2rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; }

/* ---- the map of the supervision screen (a small map of our own: tiles optional, geofences, punches) ---- */
.map { position: relative; height: 480px; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; touch-action: none; cursor: grab;
  background-color: var(--card-2); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; }
.map:active { cursor: grabbing; }
.map:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.map-tiles { position: absolute; inset: 0; }
.map-tiles img { position: absolute; max-width: none; user-select: none; }
.map-overlay { position: absolute; inset: 0; }
.map-controls { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.map-controls button { width: 36px; height: 36px; padding: 0; font-size: 1.2rem; line-height: 1; }
.map-scale { position: absolute; left: 10px; bottom: 26px; padding: 0 4px 2px; border: 2px solid var(--ink-3); border-top: 0; font-size: .72rem; color: var(--ink-3); background: color-mix(in srgb, var(--card) 80%, transparent); }
.map-credit { position: absolute; right: 0; bottom: 0; padding: 1px 6px; font-size: .7rem; background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--ink-3); }
.geofence { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 4; }
.site-dot { fill: var(--accent-strong); stroke: var(--card); stroke-width: 2; cursor: zoom-in; }
.site-dot:focus-visible { stroke: var(--focus); stroke-width: 3; outline: none; }
.site-name { font-size: 12px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-width: 3px; }
.kiosk rect:first-child { fill: var(--purple); stroke: var(--card); stroke-width: 1.5; }
.kiosk rect:last-child { fill: var(--card); }
.pt { cursor: pointer; }
.pt-in circle { fill: var(--ok); }
.pt-out rect { fill: var(--blue); }
.pt circle, .pt rect { stroke: var(--card); stroke-width: 1.5; }
.pt-low circle, .pt-low rect { stroke: var(--orange); stroke-width: 3; }
.pt-flag circle, .pt-flag rect { stroke: var(--red); stroke-width: 3; }
.pt-on circle, .pt-on rect { stroke: var(--ink); stroke-width: 3; }
.pt:focus-visible { outline: none; }
.pt:focus-visible circle, .pt:focus-visible rect { stroke: var(--focus); stroke-width: 4; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 10px 0 0; font-size: .85rem; color: var(--ink-2); }
.map-legend li { display: flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.sw-in { background: var(--ok); } .sw-out { background: var(--blue); border-radius: 2px; }
.sw-flag { border-color: var(--red); background: var(--card); } .sw-low { border-color: var(--orange); background: var(--card); }
.sw-fence { border: 2px dashed var(--accent); background: transparent; box-shadow: none; } .sw-kiosk { background: var(--purple); border-radius: 2px; }
tr.pick { cursor: pointer; }
tr.pick:hover, tr.pick:focus-visible { background: var(--accent-soft); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
dl.facts dt { color: var(--ink-2); } dl.facts dd { margin: 0; font-weight: 600; }
@media (max-width: 640px) { .map { height: 360px; } }

/* the links to the legal notices in the footer of every screen */
.legal-links { display: block; margin-bottom: 4px; }
.legal-links a { color: inherit; }

.feedback-dialog { width: min(36rem, 92vw); border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--card); color: var(--ink); }
.feedback-dialog textarea { width: 100%; box-sizing: border-box; }
.feedback-dialog::backdrop { background: rgb(0 0 0 / 45%); }

.held-photo { max-width: 160px; border-radius: var(--r-ctl); border: 1px solid var(--line); }
.plan-cell.outside button { text-decoration: underline wavy; }
