/* ANIMO Web — mismos colores de marca que el programa de escritorio. */
:root {
  --vino: #5e123d;
  --vino-oscuro: #2b0015;
  --vino-suave: #7a1a52;
  --dorado: #8a6508;
  --dorado-claro: #b8860b;
  --fondo: #f7f1f4;
  --superficie: #ffffff;
  --borde: #e3d5dc;
  --texto: #2b1a23;
  --texto-suave: #6d5a64;
  --ok: #1e7d46;
  --ok-fondo: #e6f5ec;
  --error: #a62a1c;
  --error-fondo: #fdecea;
  --radio: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

a { color: var(--vino); }
a:hover { color: var(--vino-suave); }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
p { margin: 0 0 .75rem; }

.suave { color: var(--texto-suave); font-size: .9rem; }

:focus-visible { outline: 3px solid var(--dorado-claro); outline-offset: 2px; }

/* ── Barra superior ───────────────────────────────────────────────────────── */
.barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
  padding: .6rem 16px;
  background: var(--vino);
  color: #fff;
}
.barra a { color: #fff; text-decoration: none; }
.marca { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.marca img { border-radius: 50%; background: #fff; }
.menu { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; min-width: 0; }
.menu a { padding: .4rem .8rem; border-radius: 999px; }
.menu a:hover { background: var(--vino-suave); color: #fff; }
.menu a.activo { background: #fff; color: var(--vino); font-weight: 600; }
.sesion { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
.sesion form { margin: 0; }
.barra .enlace { color: #fff; }

/* ── Estructura ───────────────────────────────────────────────────────────── */
.contenido { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
.centrado { min-height: 100vh; display: grid; place-items: center; padding: 16px; }

.encabezado {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.encabezado p { margin: 0; }

.tarjeta {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.tarjeta-angosta { max-width: 620px; }
.tarjeta-login { width: 100%; max-width: 380px; text-align: center; padding: 1.75rem 1.5rem; }
.tarjeta-login .formulario { text-align: left; margin: 1rem 0; }
.logo-login { border-radius: 50%; }

/* ── Indicadores ──────────────────────────────────────────────────────────── */
.indicadores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.indicador {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: .8rem 1rem;
}
.indicador span { display: block; color: var(--texto-suave); font-size: .85rem; }
.indicador strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.positivo { color: var(--ok); }
.negativo { color: var(--error); }

/* ── Formularios ──────────────────────────────────────────────────────────── */
.formulario { display: grid; gap: .9rem; }
.formulario label { display: block; font-weight: 600; font-size: .92rem; }
.formulario label input, .formulario label select, .formulario label textarea { display: block; margin-top: .3rem; }
.formulario .suave { font-weight: 400; }
.formulario .boton { justify-self: start; }
.tarjeta-login .formulario .boton { justify-self: stretch; }
.fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .9rem; }

input, select, textarea {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid #bfa9b4;
  border-radius: 8px;
  background: #fff;
  color: var(--texto);
  font: inherit;
  font-weight: 400;
}
textarea { resize: vertical; }

.boton {
  display: inline-block;
  padding: .6rem 1.1rem;
  border: 1px solid var(--vino);
  border-radius: 8px;
  background: var(--vino);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.boton:hover { background: var(--vino-suave); color: #fff; }
.boton-secundario { background: #fff; color: var(--vino); font-weight: 500; padding: .35rem .8rem; }
.boton-secundario:hover { background: var(--fondo); color: var(--vino); }

.enlace {
  border: 0;
  background: none;
  padding: 0;
  color: var(--vino);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.buscador { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.buscador input { flex: 1; min-width: 200px; }

/* ── Avisos ───────────────────────────────────────────────────────────────── */
.aviso { padding: .65rem .9rem; border-radius: 8px; border: 1px solid transparent; }
.aviso-ok { background: var(--ok-fondo); color: var(--ok); border-color: #bfe3cc; }
.aviso-error { background: var(--error-fondo); color: var(--error); border-color: #f3c4bd; }
.vacio { color: var(--texto-suave); padding: .5rem 0; }

/* ── Citas ────────────────────────────────────────────────────────────────── */
.lista-citas { list-style: none; margin: 0 0 .75rem; padding: 0; }
.cita {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: .65rem 0 .65rem .8rem;
  border-left: 4px solid var(--borde);
  border-bottom: 1px solid var(--borde);
}
.cita:last-child { border-bottom: 0; }
.cita form { margin: 0; }
.cita-hora { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.2rem; }
.cita-cuerpo { flex: 1; min-width: 180px; display: grid; }
.estado-agendada { border-left-color: var(--dorado-claro); }
.estado-completada { border-left-color: var(--ok); }
.estado-cancelada, .estado-no-presentado { border-left-color: #b9aab1; color: var(--texto-suave); }
.estado-cancelada .cita-hora { text-decoration: line-through; }
.alerta-alergia { color: var(--error); font-size: .9rem; font-weight: 600; }

.etiqueta {
  display: inline-block;
  padding: .1rem .55rem;
  border-radius: 999px;
  background: var(--fondo);
  border: 1px solid var(--borde);
  font-size: .8rem;
  white-space: nowrap;
}
.etiqueta-alerta { background: var(--error-fondo); color: var(--error); border-color: #f3c4bd; }
.contador { color: var(--texto-suave); font-weight: 400; font-size: .9rem; }

.filtros { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.filtros a {
  padding: .35rem .8rem;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
  font-size: .92rem;
}
.filtros a.activo { background: var(--vino); border-color: var(--vino); color: #fff; }
.separador { flex: 1; }

/* ── Tablas ───────────────────────────────────────────────────────────────── */
.tabla-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { font-size: .82rem; color: var(--texto-suave); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.datos { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: .4rem 1rem; margin: 0; }
.datos dt { color: var(--texto-suave); }
.datos dd { margin: 0; }

.notas { list-style: none; margin: 1rem 0 0; padding: 0; }
.notas li { display: grid; gap: .1rem; padding: .55rem 0; border-top: 1px solid var(--borde); white-space: pre-line; }

@media (max-width: 560px) {
  .menu { order: 3; flex-basis: 100%; }
  .sesion { margin-left: auto; }
  .datos { grid-template-columns: 1fr; gap: 0; }
  .datos dd { margin-bottom: .5rem; }
}

/* ── Reservas en línea y portal de clientas ───────────────────────────────── */
.estado-por-confirmar { border-left-color: #d98b00; background: #fff8e6; }
.tarjeta-pendientes { border-color: #e8c877; }
.etiqueta-pendiente { background: #fff1cc; color: #7a4b00; border-color: #e8c877; }
.etiqueta-ok { background: var(--ok-fondo); color: var(--ok); border-color: #bfe3cc; }
.aviso-pendiente { background: #fff8e6; color: #7a4b00; border-color: #e8c877; }
.boton-chico { padding: .35rem .8rem; }
.copiar { display: flex; flex-wrap: wrap; gap: .5rem; }
.copiar input { flex: 1; min-width: 0; font-size: .9rem; }
.tarjeta form.acciones, .acciones form { margin: 0; }
.barra-portal .menu { justify-content: flex-start; }
.pie-portal { max-width: 960px; margin: 0 auto; padding: 0 16px 32px; color: var(--texto-suave); font-size: .82rem; }
.pie-portal summary { cursor: pointer; }
.pie-centrado { text-align: center; max-width: 380px; margin: 1rem auto 0; }
.cita .boton { text-align: center; }

/* ── Facturas ─────────────────────────────────────────────────────────────── */
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0; }
.datos + .acciones { margin-top: 1rem; }
.datos + .aviso { margin: 1rem 0; }
.boton-peligro { background: var(--error); border-color: var(--error); color: #fff; }
.boton-peligro:hover { background: #8a2217; color: #fff; }
.boton-secundario.boton-peligro { background: #fff; color: var(--error); }
.boton-secundario.boton-peligro:hover { background: var(--error-fondo); color: var(--error); }
.fila-anulada td { color: var(--texto-suave); }
.fila-anulada .num { text-decoration: line-through; }
tfoot td { border-bottom: 0; padding-top: .3rem; padding-bottom: .3rem; }
tfoot .total td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--borde); }

.items { margin: 0; padding: .8rem; border: 1px solid var(--borde); border-radius: var(--radio); min-width: 0; }
.items legend { font-weight: 600; font-size: .92rem; padding: 0 .4rem; }
.item-fila {
  display: grid;
  grid-template-columns: minmax(0, 3fr) repeat(3, minmax(0, 1fr));
  gap: .6rem;
  padding-bottom: .7rem;
  margin-bottom: .7rem;
  border-bottom: 1px solid var(--borde);
}
.items .suave { margin: .6rem 0 0; }

@media (max-width: 560px) {
  .item-fila { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-nombre { grid-column: 1 / -1; }
  .acciones .boton { flex: 1 1 100%; text-align: center; }
}

/* ── Abono de reserva ─────────────────────────────────────────────────────── */
.opciones { margin: 0; padding: .8rem; border: 1px solid var(--borde); border-radius: var(--radio); display: grid; gap: .6rem; min-width: 0; }
.opciones legend { font-weight: 600; font-size: .92rem; padding: 0 .4rem; }
.formulario label.opcion { font-weight: 400; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.formulario label.opcion input { display: inline; margin: 0; width: auto; }
.datos-pago { white-space: pre-line; overflow-wrap: anywhere; padding: .6rem .8rem; border: 1px dashed var(--borde); border-radius: 8px; background: #fff; }
.cuentas { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .5rem; }
.cuenta { display: grid; gap: .25rem; padding: .6rem .8rem; border: 1px dashed var(--borde); border-radius: 8px; background: #fff; overflow-wrap: anywhere; }
.cuenta-numero { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: 1.05rem; letter-spacing: .02em; }
.motivo { display: block; font-size: .85rem; }
.cuenta-titular { font-weight: 600; }
.aviso p { margin: 0 0 .5rem; }
.aviso p:last-child { margin-bottom: 0; }
tfoot .saldo td { font-weight: 700; }

/* ── Menú desplegable (details/summary; barra horizontal desde 900 px) ───── */
.menu-desp { order: 3; flex-basis: 100%; min-width: 0; }
.menu-boton { list-style: none; display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 1rem; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; cursor: pointer; color: #fff; font-weight: 600; user-select: none; }
.menu-boton::-webkit-details-marker { display: none; }
.menu-boton:hover { background: var(--vino-suave); }
.hamb { display: block; position: relative; width: 18px; height: 2px; margin: 6px 0; background: #fff; border-radius: 2px; }
.hamb::before, .hamb::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: #fff; border-radius: 2px; }
.hamb::before { top: -6px; }
.hamb::after { top: 6px; }
.menu-desp .menu { flex-direction: column; flex-wrap: nowrap; gap: .25rem; padding: .5rem 0; }
.menu-desp .menu a { display: flex; align-items: center; min-height: 44px; }
.sesion a, .sesion .enlace { display: inline-flex; align-items: center; min-height: 44px; }
.sesion { margin-left: auto; }
@media (min-width: 900px) {
  .menu-desp { order: 0; flex: 1; flex-basis: auto; }
  .menu-boton { display: none; }
  .menu-desp::details-content { content-visibility: visible; display: block; }
  .menu-desp .menu { flex-direction: row; flex-wrap: wrap; padding: 0; }
  .menu-desp .menu a { min-height: 40px; }
  .sesion { margin-left: 0; }
}

/* ── Buscador de cliente escribiendo ──────────────────────────────────────── */
.buscar-cliente { position: relative; }
.buscar-cliente input[type="search"] { min-height: 44px; width: 100%; }
.buscar-lista { list-style: none; margin: .25rem 0 0; padding: 0; max-height: 40vh; overflow-y: auto; border: 1px solid var(--borde); border-radius: 8px; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.buscar-lista[hidden] { display: none; }
.buscar-lista li { margin: 0; }
.buscar-lista button { display: block; width: 100%; min-height: 44px; padding: .5rem .8rem; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--borde); font: inherit; color: inherit; cursor: pointer; overflow-wrap: anywhere; }
.buscar-lista button:hover, .buscar-lista button:focus-visible { background: #f6ecee; }
.buscar-vacio { padding: .6rem .8rem; color: var(--texto-suave); }
.buscar-elegido { margin: .25rem 0 0; font-size: .9rem; color: var(--ok); }

.buscar-cliente select[hidden] { display: none !important; }

/* Portal: casilla de consentimiento y política de privacidad */
.tarjeta-login label.casilla { display: flex; flex-direction: row; align-items: flex-start; gap: .5rem; margin: .8rem 0; font-weight: 400; text-align: left; }
.tarjeta-login label.casilla input { width: auto; min-height: 0; margin: .3rem 0 0; flex: none; }
.politica h2 { font-size: 1.05rem; margin-top: 1.4rem; }
.politica li { margin-bottom: .35rem; }
