:root {
  --bg: #f4f6f9; --panel: #fff; --ink: #1d2433; --muted: #5f6878; --line: #dfe4ec;
  --azul: #1f4e79; --verde: #1e8e5a; --rojo: #c0392b; --ambar: #b9770e; --ambar-claro: #fff6e0;
  --radio: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
  padding: env(safe-area-inset-top) 0 calc(76px + env(safe-area-inset-bottom)); min-height: 100vh; }
.oculto { display: none !important; }
#cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); }
#cab .logo { height: 34px; width: auto; }
#quien { text-align: right; font-size: 14px; color: var(--muted); }
#quien b { color: var(--ink); display: block; font-size: 15px; }
#quien button { font: inherit; font-size: 13px; background: none; border: 0; color: var(--azul); padding: 0; text-decoration: underline; cursor: pointer; }
main { padding: 16px; max-width: 560px; margin: 0 auto; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 22px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.peq { font-size: 14px; }
.cargando { color: var(--muted); text-align: center; margin-top: 40px; }
.caja { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px; margin: 12px 0; }
.aviso { background: var(--ambar-claro); border: 1px solid #f0d58c; border-radius: var(--radio); padding: 14px 16px; margin: 12px 0; }
.error { background: #fdecea; border: 1px solid #f5c2bc; color: #7b2318; border-radius: var(--radio); padding: 12px 16px; margin: 12px 0; }
.bien { background: #e7f6ee; border: 1px solid #b7e2c9; color: #155c3b; border-radius: var(--radio); padding: 12px 16px; margin: 12px 0; }

/* reloj y estado */
.reloj { text-align: center; margin: 6px 0 2px; font-size: 56px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.dia { text-align: center; color: var(--muted); margin-bottom: 14px; }
.estado { text-align: center; font-size: 18px; margin: 8px 0 14px; }
.estado b { display: inline-block; padding: 3px 12px; border-radius: 999px; color: #fff; }
.estado .dentro { background: var(--verde); } .estado .fuera { background: #7a8394; } .estado .pausa { background: var(--ambar); }

/* botones */
button, .boton { font: inherit; cursor: pointer; }
.boton { display: block; width: 100%; border: 0; border-radius: var(--radio); padding: 18px; font-size: 20px; font-weight: 700; color: #fff; background: var(--azul); text-align: center; text-decoration: none; margin: 10px 0; }
.boton:disabled { opacity: .55; }
.boton.grande { padding: 30px 18px; font-size: 26px; }
.boton.entrada { background: var(--verde); } .boton.salida { background: var(--rojo); } .boton.pausa { background: var(--ambar); }
.boton.sec { background: #fff; color: var(--azul); border: 2px solid var(--azul); font-size: 17px; padding: 13px; }
.enlace { background: none; border: 0; color: var(--azul); text-decoration: underline; padding: 6px 0; font-size: 15px; }

/* formularios */
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { font: inherit; width: 100%; padding: 13px 12px; border: 1px solid #c9d0db; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid #b9d3ee; border-color: var(--azul); }
input.pin { letter-spacing: 6px; font-size: 22px; text-align: center; }
.fila { display: flex; gap: 10px; } .fila > * { flex: 1; }

/* listas */
.lista { list-style: none; padding: 0; margin: 0; }
.lista li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.lista .hora { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef1f6; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.chip.ojo { background: var(--ambar-claro); color: #8a5a06; } .chip.mal { background: #fdecea; color: #7b2318; } .chip.ok { background: #e7f6ee; color: #155c3b; }
.dias .d { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.dias .d .arriba { display: flex; justify-content: space-between; gap: 8px; }
.dias .d .tramos { color: var(--muted); font-size: 15px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.dias .d.vacio { opacity: .55; }
.mes { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mes button { font-size: 22px; border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 48px; height: 44px; }
.total { display: flex; justify-content: space-around; text-align: center; }
.total b { display: block; font-size: 24px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.doc:last-child { border-bottom: 0; }
.doc .ico { font-size: 24px; }
.doc .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* pestañas abajo */
#pestanas { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#pestanas a { flex: 1; text-align: center; padding: 8px 0 10px; text-decoration: none; color: var(--muted); font-size: 22px; }
#pestanas a span { display: block; font-size: 12px; }
#pestanas a.activa { color: var(--azul); font-weight: 700; }

/* diálogo */
#dialogo { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
#dialogo-caja { background: #fff; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
