:root {
  --fondo: #f4f6fa;
  --superficie: #fff;
  --texto: #10151c;
  --suave: #5b6675;
  --acento: #0b57d0;
  --borde: #dbe1ea;
  --rojo: #b3261e;
  --verde: #1b6b3a;
  --radio: 16px;
  --sombra: 0 2px 10px rgba(16, 21, 28, .07);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.45;
}
.oculto { display: none !important; }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1rem; margin: 0 0 .6rem; }
a { color: var(--acento); }

/* acceso */
.acceso { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.acceso-caja {
  background: var(--superficie); padding: 2rem; border-radius: 22px; width: min(420px, 100%);
  box-shadow: var(--sombra); display: flex; flex-direction: column; gap: .9rem;
}
.acceso-caja p { margin: 0; color: var(--suave); font-size: .95rem; }
.acceso-caja input {
  font: inherit; font-size: 1.6rem; letter-spacing: .35em; text-align: center;
  padding: .7rem; border-radius: 12px; border: 2px solid var(--borde);
}
.error { color: var(--rojo); font-size: .9rem; min-height: 1.2rem; }

/* panel */
.panel { max-width: 1180px; margin: 0 auto; padding: 1rem 1rem 4rem; }
.cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sub { margin: .2rem 0 0; color: var(--suave); font-size: .9rem; }
.cabecera-acciones { display: flex; gap: .5rem; flex-wrap: wrap; }

button { font: inherit; cursor: pointer; }
.primario {
  background: var(--acento); color: #fff; border: none; border-radius: 12px;
  padding: .7rem 1rem; font-weight: 650;
}
.secundario {
  background: var(--superficie); color: var(--texto); border: 1px solid var(--borde);
  border-radius: 12px; padding: .5rem .8rem; text-decoration: none; font-size: .9rem;
}
.peligro { background: transparent; color: var(--rojo); border: 1px solid #f0c4c0; border-radius: 10px; padding: .35rem .6rem; font-size: .85rem; }

.pestanas { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .6rem; margin-bottom: 1rem; border-bottom: 1px solid var(--borde); }
.pestanas button {
  background: transparent; border: none; padding: .5rem .8rem; border-radius: 10px;
  color: var(--suave); font-weight: 600; white-space: nowrap;
}
.pestanas button.activa { background: #e7eefb; color: var(--acento); }
.cuenta { background: var(--rojo); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .4rem; margin-left: .25rem; }
.cuenta:empty, .cuenta.cero { display: none; }

.tab { display: none; }
.tab.activa { display: block; }
.rejilla { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 860px) { .rejilla.dos { grid-template-columns: 1fr 1fr; } .rejilla { grid-template-columns: 1fr 1fr; } }

.tarjeta { background: var(--superficie); border-radius: var(--radio); padding: 1rem 1.1rem; box-shadow: var(--sombra); }
.separador { margin-top: 1.2rem; }

.formulario { display: flex; flex-direction: column; gap: .7rem; }
.formulario label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; color: var(--suave); font-weight: 600; }
.formulario input, .formulario select, .formulario textarea {
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--texto);
  padding: .55rem .65rem; border-radius: 10px; border: 1px solid var(--borde); background: #fff;
}
.formulario textarea { resize: vertical; }
.nota { font-size: .82rem; color: var(--suave); margin: .7rem 0 0; }
.texto { font-size: .9rem; color: var(--suave); }
.pasos { margin: .2rem 0 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .45rem; font-size: .92rem; line-height: 1.45; }
.pasos li::marker { font-weight: 700; color: var(--acento); }
.pasos .seleccionable { font-weight: 700; color: var(--texto); -webkit-user-select: text; user-select: text; }
.opcion { margin: 1.1rem 0 .35rem; font-size: .95rem; color: var(--acento); letter-spacing: .01em; }
.peligro {
  background: #fff; color: #b3261e; border: 1.5px solid #e5b4b1;
  border-radius: var(--radio-chico, 10px); padding: .6rem 1rem;
  font: inherit; font-weight: 600; cursor: pointer;
}
.peligro:hover { background: #fdf1f0; border-color: #b3261e; }

.lista { display: flex; flex-direction: column; gap: .55rem; }
.item {
  border: 1px solid var(--borde); border-radius: 12px; padding: .6rem .7rem;
  display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start;
}
.item .cuerpo { min-width: 0; }
.item .t { font-weight: 650; font-size: .95rem; }
.item .d { font-size: .82rem; color: var(--suave); }
.item .acciones { display: flex; gap: .35rem; flex-shrink: 0; }

.etiqueta { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; }
.etiqueta.tomada { background: #d9f2e1; color: var(--verde); }
.etiqueta.pendiente { background: #fff1cc; color: #6b4b00; }
.etiqueta.omitida { background: #ffe0dc; color: var(--rojo); }
.etiqueta.sos { background: var(--rojo); color: #fff; }
.etiqueta.sistema { background: #e7eefb; color: var(--acento); }
.etiqueta.recordatorio_sin_confirmar, .etiqueta.toma_omitida { background: #fff1cc; color: #6b4b00; }

.vacio { color: var(--suave); font-size: .88rem; padding: .4rem 0; }

.fila-check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.fila-check input { width: auto; }

/* ---------------- Fase 3: lista, actividad y avisos al móvil ---------------- */
.lista.compacta { margin-top: .6rem; gap: .4rem; }
.estado-push {
  margin: .4rem 0 .2rem;
  font-weight: 600;
  color: var(--acento);
}
#tab-ajustes .fila-botones { flex-wrap: wrap; gap: .5rem; }
#telegram-chat { max-width: 190px; }

/* la casilla va a la izquierda de su texto, no encima */
#tab-ajustes .fila-check { flex-direction: row; align-items: center; justify-content: flex-start; gap: .6rem; }
#tab-ajustes .fila-check input { flex: 0 0 auto; }
