:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #1e293b;
  --borde: #334155;
  --texto: #e2e8f0;
  --texto-tenue: #94a3b8;
  --accent: #38bdf8;
  --verde: #22c55e;
  --amarillo: #eab308;
  --rojo: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.pantalla {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 { font-size: 1.4rem; margin: 8px 0 0; text-align: center; }
.subtitulo { color: var(--texto-tenue); text-align: center; margin: 0 0 8px; font-size: 0.95rem; }

.tarjeta {
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 20px;
}

label { display: block; font-size: 0.85rem; color: var(--texto-tenue); margin-bottom: 6px; }
input, select {
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--borde);
  background: var(--campo-bg);
  color: var(--texto);
  margin-bottom: 14px;
}
input:focus, select:focus { outline: 2px solid var(--accent); }

button {
  width: 100%;
  padding: 18px;
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  color: white;
}
button.primario { background: var(--accent); color: var(--on-accent); }
button.grande { padding: 28px; font-size: 1.4rem; }
button.secundario { background: transparent; border: 1px solid var(--borde); color: var(--texto); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.entrada { background: var(--verde); color: var(--on-verde); }
button.salida { background: var(--rojo); color: var(--on-rojo); }

.error {
  background: var(--err-bg);
  border: 1px solid var(--rojo);
  color: var(--err-tx);
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.info { color: var(--texto-tenue); font-size: 0.9rem; text-align: center; }
.aviso {
  background: var(--warn-bg);
  border: 1px solid var(--amarillo);
  color: var(--warn-tx);
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}
.exito {
  background: var(--ok-bg);
  border: 1px solid var(--verde);
  color: var(--ok-tx);
  padding: 16px;
  border-radius: 10px;
  text-align: center;
}

video, canvas.preview {
  width: 100%;
  border-radius: 12px;
  background: #000;
}

.selfie-miniatura {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--borde);
}

.fila { display: flex; align-items: center; gap: 12px; }
.fila-fin { display: flex; gap: 10px; }
.fila-fin button { flex: 1; }

.pie { text-align: center; color: var(--texto-tenue); font-size: 0.8rem; margin-top: 8px; }
.oculto { display: none !important; }

.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 4px solid var(--borde); border-top-color: var(--accent);
  animation: girar 0.8s linear infinite; margin: 0 auto;
}
@keyframes girar { to { transform: rotate(360deg); } }

.cola-pendiente {
  font-size: 0.8rem;
  color: var(--amarillo);
  text-align: center;
}

.logo-empresa {
  max-height: 72px;
  max-width: 220px;
  object-fit: contain;
  margin: 12px auto 0;
  display: block;
  border-radius: 10px;
}

/* Novedades y resumen de hoy */
textarea {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid var(--borde);
  background: var(--campo-bg);
  color: var(--texto);
  margin-bottom: 14px;
  resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); }
label.check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
label.check input { width: 22px; height: 22px; margin: 0; }
.titulo-hoy { font-size: 1rem; margin: 0 0 10px; }
.lista-hoy { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lista-hoy li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; padding-bottom: 8px; border-bottom: 1px solid var(--borde); }
.lista-hoy li:last-child { border-bottom: none; padding-bottom: 0; }
.lista-hoy .hora { color: var(--texto-tenue); white-space: nowrap; }
.lista-hoy .etq { font-weight: 600; }
.lista-hoy .urgente { color: var(--rojo); font-weight: 700; }
