/* ControlPrint Asistencia — verde de marca, grises del logo y los gajos de la rueda de color */
:root {
  --paper: #f4f6f5; --sheet: #ffffff; --ink: #2b2b2a; --ink-2: #585857; --rule: #dfe4e2;
  --brand: #00a99d;          /* verde ControlPrint (logo) */
  --brand-strong: #007f76;   /* botones y enlaces: mismo tono, texto blanco legible */
  --brand-soft: #e0f4f2; --on-brand: #ffffff;
  --w-yellow: #f2b91d; --w-red: #de2f21; --w-lime: #94bf24; --w-blue: #2272b5; --w-gray: #70706e; --w-dark: #585857;
  --ok: #4f6e0e; --ok-soft: #eef5dc; --warn: #8a6400; --warn-soft: #fdf3d6; --info: #1d64a0; --info-soft: #e4eef8;
  --bad: #c0281b; --bad-soft: #fbe5e2; --mute-soft: #ebeeed;
  --f-display: "Quicksand", "Century Gothic", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121716; --sheet: #1b2120; --ink: #e9ecea; --ink-2: #a9b0ad; --rule: #2c3432;
    --brand: #2cc4b7; --brand-strong: #2cc4b7; --brand-soft: #0f2e2b; --on-brand: #0f1716;
    --w-gray: #8a8a88; --w-dark: #6a6a68;
    --ok: #a6d14a; --ok-soft: #1f2a10; --warn: #f2c14a; --warn-soft: #2f2610; --info: #6aa8e0; --info-soft: #132538;
    --bad: #f07a6e; --bad-soft: #3a1915; --mute-soft: #242b29;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 0 32px; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; line-height: 1.1; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 .7em; }
a { color: var(--brand-strong); }
.label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.dash { color: var(--ink-2); }
.small { font-size: .82rem; }
.center { text-align: center; display: grid; gap: 8px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Cabecera */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { display: block; height: 46px; width: auto; }
.brand .sub { display: block; font-family: var(--f-display); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; border-left: 1px solid var(--rule); padding-left: 12px; }
.top-right { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.clock-mini { text-align: right; }
.clock-mini .t { font-size: 1.2rem; font-weight: 600; }
.clock-mini .d { font-size: .8rem; color: var(--ink-2); }
.who-mini { display: flex; align-items: center; gap: 10px; font-weight: 600; border-left: 1px solid var(--rule); padding-left: 16px; }
.who-mini form { margin: 0; }

.colorbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: 14px; gap: 2px; }
.colorbar i { flex: 1; }
.colorbar i:nth-child(1) { background: var(--w-yellow); } .colorbar i:nth-child(2) { background: var(--w-red); }
.colorbar i:nth-child(3) { background: var(--w-lime); } .colorbar i:nth-child(4) { background: var(--w-blue); }
.colorbar i:nth-child(5) { background: var(--w-gray); } .colorbar i:nth-child(6) { background: var(--w-dark); }
.colorbar i:nth-child(7) { background: var(--brand); flex: 6; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 22px; overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; text-decoration: none; white-space: nowrap; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.tab:hover { color: var(--ink); }

/* Piezas */
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--rule); background: var(--sheet); padding: 9px 16px;
  border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: wait; }
input[type=text], input[type=email], input[type=tel], input[type=time], input[type=date], input[type=number], input:not([type]), select {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0; font-size: 1rem; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form { display: grid; gap: 14px; }
.form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.narrow { max-width: 560px; margin: 0 auto; }
.check { display: flex; gap: 8px; align-items: center; }
.acts-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.sec { margin-bottom: 8px; }
.mb { margin-bottom: 24px; }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--brand-soft); margin-bottom: 16px; }
.form .notice, .panel .notice { margin-bottom: 0; }
.notice.err { background: var(--bad-soft); color: var(--ink); border-left: 4px solid var(--bad); }
.notice.ok-n { background: var(--ok-soft); border-left: 4px solid var(--ok); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-none { background: var(--mute-soft); color: var(--ink-2); }
.s-work { background: var(--ok-soft); color: var(--ok); }
.s-lunch { background: var(--warn-soft); color: var(--warn); }
.s-out { background: var(--info-soft); color: var(--info); }
.flag { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: var(--bad-soft); color: var(--bad); white-space: nowrap; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* Reloj y marcación */
.kiosk, .login { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.bigclock { padding: 28px 24px; border-top: 5px solid var(--brand); }
.bigclock .t { font-weight: 600; font-size: clamp(3rem, 9vw, 5.2rem); line-height: 1; letter-spacing: -.03em; }
.bigclock .t small { font-size: .38em; color: var(--brand); letter-spacing: 0; }
.bigclock .d { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; margin-top: 10px; }
.bigclock .d::first-letter { text-transform: uppercase; }
.sched { margin-top: 20px; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 10px; border-top: 1px dashed var(--rule); padding-top: 14px; }
.sched .v { font-weight: 600; }
.punch { display: flex; flex-direction: column; gap: 18px; }
.who { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.who h2 { font-size: 1.9rem; overflow-wrap: anywhere; }
.steps { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 8px; }
.step { border: 1px solid var(--rule); border-radius: 8px; padding: 10px; min-width: 0; }
.step.done { background: var(--paper); }
.step .v { font-weight: 600; font-size: 1.1rem; }
.step.next { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.action { font-family: var(--f-display); font-size: 1.3rem; font-weight: 700; padding: 18px; border-radius: 12px; width: 100%; }
.botones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.botones.uno { grid-template-columns: minmax(0, 1fr); }
.boton-marca { display: grid; gap: 6px; text-align: center; margin: 0; }
.action svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.action { min-height: 72px; }
.btn.lunch { background: var(--w-yellow); border-color: var(--w-yellow); color: #2b2b2a; }
.btn.lunch:hover { filter: brightness(1.05); }
.flag.warn { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 420px) { .botones { grid-template-columns: minmax(0, 1fr); } }
.done-msg { text-align: center; padding: 12px 10px 4px; }
.done-msg .big { font-size: 3.2rem; font-weight: 600; line-height: 1.1; margin: 4px 0 8px; }
.ok { color: var(--ok); font-weight: 700; }
.late { color: var(--bad); font-weight: 700; }

/* Tablas */
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.stat { background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; min-width: 130px; flex: 1; }
.stat .v { font-size: 1.5rem; font-weight: 600; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; vertical-align: middle; }
th { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; background: var(--paper); }
.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; background: var(--paper); border-bottom: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.toolbar .field { width: 180px; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.list-item:last-child { border-bottom: 0; }
.list-item .meta { min-width: 0; overflow-wrap: anywhere; }
.logo-login img { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto 4px; }
fieldset.horario { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
fieldset.horario legend { font-family: var(--f-display); font-weight: 700; padding: 0 6px; }
.vigente { display: grid; gap: 12px; }
.pos { color: var(--ok); font-weight: 600; } .neg { color: var(--bad); font-weight: 600; }
.foot { margin-top: 36px; font-size: .78rem; color: var(--ink-2); text-align: center; }


/* Panel de captura (ubicación + selfie) */
.captura-bg { position: fixed; inset: 0; z-index: 50; background: rgb(18 23 22 / .6); display: flex; align-items: flex-start; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.captura { width: min(460px, 100%); display: grid; gap: 14px; }
.captura h2 { font-size: 1.4rem; }
.cap-paso { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--rule); border-radius: 10px; }
.cap-paso.ok { border-color: var(--brand); background: var(--brand-soft); }
.cap-paso.err { border-color: var(--bad); background: var(--bad-soft); }
.cap-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; flex: none; }
.cap-paso.ok .cap-ico { background: var(--brand); color: var(--on-brand); }
.cap-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cam { margin-top: 10px; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 1; max-width: 100%; width: 100%; }
.cam video, .cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam video { transform: scaleX(-1); }
.cam-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cam-acts .btn { cursor: pointer; }
.btn.primary:disabled { background: var(--mute-soft); border-color: var(--rule); color: var(--ink-2); opacity: 1; cursor: not-allowed; }

/* Perfil y evidencia */
.stack { display: grid; gap: 20px; min-width: 0; }
.datos { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 12px 0; }
.datos dt { color: var(--ink-2); font-size: .85rem; } .datos dd { margin: 0; overflow-wrap: anywhere; }
.miniatura { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; border: 2px solid var(--brand); }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ev { display: grid; gap: 10px; align-content: start; }
.ev .foto { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--paper); display: block; }
.ev .mapa { width: 100%; height: 170px; border: 0; border-radius: 8px; background: var(--paper); }
.ev .sin { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: var(--paper); color: var(--ink-2); font-size: .85rem; text-align: center; padding: 10px; }

@media (max-width: 780px) {
  .kiosk, .login, .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clock-mini { display: none; }
  .who-mini { border-left: 0; padding-left: 0; }
  .toolbar .field { width: calc(50% - 6px); }
}
@media (max-width: 420px) { .form .row { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
