/* ============================================================
   estilos.css — Aspecto del panel.
   Los colores están todos aquí arriba: cambia estos valores para
   adaptar el panel a la imagen de cada centro.
   ============================================================ */
:root {
  --fondo: #f7f3f0;
  --superficie: #ffffff;
  --texto: #2b2523;
  --suave: #7a6f6b;
  --borde: #e6ddd8;
  --principal: #a8566a;       /* color de marca */
  --principal-claro: #f3e3e7;
  --peligro: #b3261e;
  --ok: #2e7d4f;
  --cerrado: #ece6e2;

  /* Simulador de WhatsApp */
  --chat-fondo: #efe7dd;
  --chat-clienta: #d9fdd3;
  --chat-asistente: #ffffff;
  --chat-boton: #027eb5;

  /* Colores por categoría de servicio */
  --cat-facial: #f6d5dd;
  --cat-corporal: #d6e8d5;
  --cat-laser: #e0d9f3;
  --cat-micro: #f3e2c7;
  --cat-otra: #e3e3e3;

  --radio: 12px;
  --sombra: 0 1px 3px rgba(60, 40, 30, .08), 0 4px 14px rgba(60, 40, 30, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); font-size: 16px; line-height: 1.4; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
[hidden] { display: none !important; }
.suave { color: var(--suave); }
.pequeno { font-size: .85rem; }
.error { color: var(--peligro); }

/* ---------- Botones y formularios ---------- */
.btn {
  font: inherit; border: 1px solid var(--borde); background: var(--superficie); color: var(--texto);
  border-radius: 999px; padding: .55rem 1rem; cursor: pointer; min-height: 42px;
}
.btn:hover { border-color: var(--principal); }
.btn-principal { background: var(--principal); border-color: var(--principal); color: #fff; }
.btn-principal:hover { filter: brightness(1.07); }
.btn-peligro { color: var(--peligro); border-color: #f0c9c6; }
.btn-texto { border: none; background: none; color: var(--principal); padding: .4rem .6rem; }
.btn-peq { min-height: 34px; padding: .3rem .75rem; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: default; }

label { display: block; font-size: .9rem; color: var(--suave); margin: .75rem 0 .25rem; }
input, select, textarea {
  font: inherit; width: 100%; padding: .6rem .7rem; border: 1px solid var(--borde);
  border-radius: 10px; background: #fff; color: var(--texto); min-height: 42px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--principal-claro); border-color: var(--principal); }
.casilla { display: flex; gap: .6rem; align-items: flex-start; color: var(--texto); font-size: .95rem; }
.casilla input { width: auto; min-height: auto; margin-top: .2rem; }
.fila { display: flex; gap: .6rem; }
.fila > * { flex: 1; min-width: 0; }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.acciones .derecha { margin-left: auto; }
.ayuda { font-size: .8rem; color: var(--suave); margin-top: .25rem; }

/* ---------- Estructura ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; background: var(--fondo); border-bottom: 1px solid var(--borde);
}
.nombre-centro { font-weight: 600; }
.aviso-demo { font-size: .72rem; color: var(--principal); font-weight: 600; letter-spacing: .03em; }
main { padding: 1rem; padding-bottom: 6rem; max-width: 1100px; margin: 0 auto; }

.menu {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex;
  background: var(--superficie); border-top: 1px solid var(--borde);
  padding-bottom: env(safe-area-inset-bottom);
}
.menu a {
  position: relative; flex: 1; text-align: center; padding: .5rem 0 .6rem; color: var(--suave); text-decoration: none; font-size: .78rem;
}
.menu a .ico { display: block; font-size: 1.3rem; }
.menu a.activa { color: var(--principal); font-weight: 600; }

.tarjeta { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1rem; }
.seccion { margin-bottom: 1.25rem; }
.titulo-seccion { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-caja { width: 100%; max-width: 360px; display: grid; gap: .75rem; text-align: center; }

/* ---------- Listas ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .8rem 1rem; border-bottom: 1px solid var(--borde); cursor: pointer;
}
.lista li:last-child { border-bottom: none; }
.lista li:hover { background: #fbf8f6; }
.lista .principal { font-weight: 500; }
.lista .secundario { font-size: .85rem; color: var(--suave); }
.etiqueta {
  display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px;
  background: var(--principal-claro); color: var(--principal); white-space: nowrap;
}
.etiqueta.gris { background: #eee; color: #666; }

/* ---------- Agenda: barra superior ---------- */
.barra-agenda { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.barra-agenda .titulo-fecha { font-weight: 600; font-size: 1.05rem; flex: 1 1 100%; }
.barra-agenda .titulo-fecha::first-letter, .dia-cabecera strong::first-letter { text-transform: uppercase; }
.selector { display: inline-flex; border: 1px solid var(--borde); border-radius: 999px; overflow: hidden; }
.selector button { font: inherit; border: none; background: #fff; padding: .45rem .9rem; cursor: pointer; min-height: 38px; }
.selector button.activo { background: var(--principal); color: #fff; }
.barra-agenda input[type=date] { width: auto; min-height: 38px; padding: .3rem .5rem; }
.boton-flotante {
  position: fixed; right: 1rem; bottom: 5.2rem; z-index: 6; border-radius: 999px; padding: .8rem 1.2rem;
  box-shadow: 0 4px 14px rgba(168, 86, 106, .35); font-weight: 600;
}

/* ---------- Agenda: vista día ---------- */
.dia-rejilla {
  position: relative; background: var(--cerrado); border-radius: var(--radio);
  margin-left: 3rem; overflow: hidden; cursor: copy;
}
.dia-contenedor { position: relative; }
.hora-linea { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(0, 0, 0, .06); pointer-events: none; }
.hora-linea.media { border-top-style: dashed; border-color: rgba(0, 0, 0, .04); }
.hora-etiqueta { position: absolute; left: 0; width: 2.7rem; text-align: right; font-size: .75rem; color: var(--suave); transform: translateY(-.5em); }
.tramo-abierto { position: absolute; left: 0; right: 0; background: #fff; pointer-events: none; }
.bloqueo {
  position: absolute; left: 0; right: 0; pointer-events: none; color: #8a6d63; font-size: .8rem; padding: .25rem .5rem;
  background: repeating-linear-gradient(45deg, #efe6e1, #efe6e1 6px, #e5d9d3 6px, #e5d9d3 12px);
}
.cita {
  position: absolute; border-radius: 8px; padding: .3rem .5rem; font-size: .82rem; overflow: hidden;
  border-left: 4px solid rgba(0, 0, 0, .18); cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.cita .hora { font-weight: 600; }
.cita.realizada { opacity: .6; }
.cita.no_asistio { opacity: .6; text-decoration: line-through; }
.cita.cancelada { opacity: .5; text-decoration: line-through; }
.cat-facial { background: var(--cat-facial); }
.cat-corporal { background: var(--cat-corporal); }
.cat-laser { background: var(--cat-laser); }
.cat-micropigmentacion { background: var(--cat-micro); }
.cat-otra { background: var(--cat-otra); }
.linea-ahora { position: absolute; left: 0; right: 0; border-top: 2px solid var(--peligro); pointer-events: none; z-index: 2; }

/* ---------- Agenda: vista semana ---------- */
.semana { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .semana { grid-template-columns: repeat(7, 1fr); gap: .5rem; } }
.dia-tarjeta { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.dia-tarjeta.hoy { outline: 2px solid var(--principal); }
.dia-tarjeta.cerrado { background: #faf7f5; }
.dia-cabecera {
  display: flex; justify-content: space-between; align-items: baseline; padding: .6rem .75rem;
  border-bottom: 1px solid var(--borde); cursor: pointer;
}
.dia-cabecera strong { font-size: .95rem; }
.mini-cita { display: block; width: 100%; text-align: left; font: inherit; font-size: .85rem; border: none; margin: .35rem .5rem; width: calc(100% - 1rem); padding: .35rem .5rem; border-radius: 6px; cursor: pointer; }
.mini-cita .hora { font-weight: 600; margin-right: .3rem; }
.mini-bloqueo { font-size: .8rem; color: #8a6d63; padding: .35rem .75rem; }
.dia-vacio { font-size: .85rem; color: var(--suave); padding: .6rem .75rem; }

/* ---------- Ventana emergente ---------- */
dialog {
  border: none; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 2rem); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); color: var(--texto);
}
dialog::backdrop { background: rgba(43, 37, 35, .45); }
.modal-cuerpo { padding: 1.25rem; }
.modal-cabecera { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cerrar { font-size: 1.5rem; line-height: 1; border: none; background: none; cursor: pointer; color: var(--suave); padding: .25rem .5rem; }
@media (max-width: 600px) {
  dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
}
.huecos { display: flex; flex-wrap: wrap; gap: .4rem; }
.huecos button { font: inherit; font-size: .9rem; border: 1px solid var(--borde); background: #fff; border-radius: 8px; padding: .4rem .6rem; cursor: pointer; }
.huecos button.elegido { background: var(--principal); border-color: var(--principal); color: #fff; }
.resultados { border: 1px solid var(--borde); border-radius: 10px; margin-top: .3rem; overflow: hidden; }
.resultados button { display: block; width: 100%; text-align: left; font: inherit; border: none; border-bottom: 1px solid var(--borde); background: #fff; padding: .55rem .7rem; cursor: pointer; }
.resultados button:last-child { border-bottom: none; }
.resultados button:hover { background: #fbf8f6; }
.ficha-dato { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--borde); }
.ficha-dato span:first-child { color: var(--suave); }
.caja-aviso { background: #fff4e5; border: 1px solid #f3d9b1; border-radius: 10px; padding: .7rem .8rem; margin-top: 1rem; font-size: .92rem; }
.caja-aviso.peligro { background: #fdecea; border-color: #f2c4bf; }

/* ---------- Horario (ajustes) ---------- */
.dia-horario { padding: .6rem 0; border-bottom: 1px solid var(--borde); }
.dia-horario:last-child { border-bottom: none; }
.dia-horario .nombre { font-weight: 500; text-transform: capitalize; display: flex; justify-content: space-between; align-items: center; }
.tramo { display: flex; gap: .4rem; align-items: center; margin-top: .4rem; }
.tramo input { width: auto; flex: 1; }

/* ---------- Avisos breves ---------- */
#avisos { position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%); z-index: 50; display: grid; gap: .5rem; width: min(420px, calc(100vw - 2rem)); }
.toast { background: #2b2523; color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--sombra); font-size: .95rem; }
.toast.error { background: var(--peligro); }
.toast.atencion { background: #8a5a00; }

/* ---------- Avisos con número (menú y pestañas) ---------- */
.insignia {
  display: inline-block; min-width: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: var(--peligro);
  color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.25rem; text-align: center;
}
.insignia.flotante { position: absolute; top: .2rem; left: calc(50% + .3rem); }
.recortado { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }

/* ---------- Simulador: "móvil" con el chat ---------- */
.movil {
  max-width: 420px; margin: 0 auto; border-radius: 22px; overflow: hidden; box-shadow: var(--sombra);
  border: 1px solid var(--borde); background: var(--chat-fondo); display: flex; flex-direction: column;
}
.movil-cabecera { background: #075e54; color: #fff; padding: .7rem 1rem; display: grid; }
.movil-cabecera span { font-size: .78rem; opacity: .85; }
.chat { height: min(58vh, 520px); overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .4rem; background: var(--chat-fondo); }
.chat-ficha { height: auto; max-height: 45vh; border-radius: 10px; margin-top: .75rem; }
.chat-nota { align-self: center; text-align: center; background: #fff8d6; color: #5c4b00; font-size: .82rem; border-radius: 8px; padding: .45rem .7rem; max-width: 90%; }
.burbuja {
  max-width: 85%; padding: .45rem .6rem .3rem; border-radius: 10px; font-size: .92rem; position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1); overflow-wrap: anywhere; min-width: 5rem;
}
.burbuja.clienta { align-self: flex-end; background: var(--chat-clienta); border-top-right-radius: 2px; }
.burbuja.asistente, .burbuja.centro { align-self: flex-start; min-width: 60%; background: var(--chat-asistente); border-top-left-radius: 2px; }
.burbuja.centro { border-left: 3px solid var(--principal); }
.burbuja-autor { font-size: .75rem; font-weight: 700; color: var(--principal); }
.burbuja-hora { display: block; text-align: right; font-size: .68rem; color: #8b8b8b; margin-top: .1rem; }
.burbuja-botones { display: grid; gap: 1px; margin: .3rem -.6rem -.3rem; border-top: 1px solid #e9e9e9; background: #e9e9e9; }
.burbuja-botones > button, .lista-opciones button {
  font: inherit; font-size: .9rem; border: none; background: #fff; color: var(--chat-boton); padding: .55rem; cursor: pointer;
}
.burbuja-botones > button:hover, .lista-opciones button:hover { background: #f5f5f5; }
.burbuja-botones > button:last-child { border-radius: 0 0 10px 10px; }
.lista-opciones { display: grid; gap: 1px; background: #e9e9e9; }
.lista-opciones button { text-align: left; color: var(--texto); display: grid; }
.lista-opciones small { color: var(--suave); font-size: .78rem; }
.burbuja-opciones-pasadas { margin-top: .4rem; font-size: .78rem; color: #8b8b8b; }
.sugerencias { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem .6rem; background: var(--chat-fondo); border-top: 1px solid rgba(0, 0, 0, .06); }
.sugerencias button {
  flex: 0 0 auto; font: inherit; font-size: .8rem; border: 1px solid #d5cbbf; background: #fff; border-radius: 999px;
  padding: .3rem .7rem; cursor: pointer; white-space: nowrap;
}
.chat-entrada { display: flex; gap: .4rem; padding: .5rem; background: #f0f0f0; }
.chat-entrada input { border-radius: 999px; }
.chat-entrada .btn { min-width: 46px; padding: .5rem; }
