/*
 * Estilos de la agenda. Sin frameworks externos: todo está en este archivo.
 *
 * - :root define la paleta (variables --primario, --ok, etc.). Cambiando esos
 *   valores se adapta el sistema a los colores del emprendimiento.
 * - Secciones: cabecera, paneles/botones, métricas, tablas, estados, formularios,
 *   agenda diaria (grilla con bloques posicionados), agenda semanal, login.
 */
:root {
  --fondo: #f5f6fa;
  --panel: #ffffff;
  --texto: #1f2430;
  --suave: #6b7280;
  --borde: #e3e6ee;
  --primario: #3b5bdb;
  --primario-claro: #e7ecff;
  --ok: #2f9e44;
  --alerta: #e8590c;
  --peligro: #c92a2a;
  --radio: 10px;
  /* superficies secundarias (todas cambian en el tema oscuro) */
  --hundido: #eef0f5;      /* fondos de pistas, selectores segmentados */
  --hundido-2: #e9ecf3;
  --hover: #f0f2f7;
  --fondo-suave: #fafbfd;  /* celdas fuera de horario, filas al pasar el mouse */
  --linea-grafico: #e9ecf2;
  --enlace: var(--primario);
  --sombra: rgb(16 24 40 / 6%);
  --resalte: #fff9db;
  --resalte-borde: #ffe066;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* que "hidden" gane aunque la clase tenga display */
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  font-size: 15px;
}
a { color: var(--enlace); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }

/* cabecera */
.cabecera {
  background: #1f2430; color: #fff;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: .6rem 1.25rem;
}
.cabecera .marca { font-weight: 700; font-size: 1.05rem; color: #fff; }
.cabecera nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.cabecera nav a {
  color: #cfd4e0; padding: .45rem .75rem; border-radius: 8px; display: inline-flex; align-items: center; gap: .45rem;
  transition: background .15s, color .15s;
}
.cabecera nav a:hover, .cabecera nav a.activo { background: #343b4d; color: #fff; text-decoration: none; }
.cabecera nav.secciones a { font-weight: 500; font-size: .92rem; }
.cabecera nav.secciones a .icono-svg { opacity: .75; }
.cabecera nav.secciones a.activo { background: color-mix(in srgb, var(--primario) 32%, #1f2430); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primario) 55%, transparent); }
.cabecera nav.secciones a.activo .icono-svg { opacity: 1; }

/* segunda barra: nombre de la sección actual y sus subsecciones como pestañas tipo "píldora" */
.subbarra {
  background: var(--panel); border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 5;
  box-shadow: 0 2px 10px rgb(16 24 40 / 4%);
}
.subbarra-interior {
  max-width: 1400px; margin: 0 auto; padding: .55rem 1.25rem; display: flex; align-items: center; gap: 1rem;
}
.subbarra-titulo {
  display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .95rem; color: var(--texto);
  padding-right: 1rem; border-right: 1px solid var(--borde); white-space: nowrap;
}
.subbarra-titulo .icono-svg { color: var(--enlace); }
.subsecciones { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; padding: .1rem; }
.subsecciones::-webkit-scrollbar { display: none; }
.subsecciones a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 999px;
  color: var(--suave); font-size: .88rem; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.subsecciones a:hover { color: var(--texto); background: var(--fondo); text-decoration: none; }
.subsecciones a.activa {
  color: var(--enlace); background: color-mix(in srgb, var(--primario) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--primario) 28%, var(--panel)); font-weight: 600;
}
@media (max-width: 640px) {
  .subbarra-titulo { display: none; }
  .subbarra-interior { padding: .5rem .75rem; }
}
.selector { display: flex; align-items: center; gap: .5rem; }
.selector label { color: #cfd4e0; font-size: .85rem; }
.selector select { background: #343b4d; color: #fff; border: 1px solid #4a5268; padding: .4rem .6rem; border-radius: 6px; }

.contenido { max-width: 1400px; margin: 0 auto; padding: 1.25rem; }
.barra { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.barra .grupo { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.subtitulo { color: var(--suave); font-size: .9rem; margin-top: .2rem; }

/* paneles y botones */
.panel { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.1rem; margin-bottom: 1rem; }
.btn {
  display: inline-block; border: 1px solid var(--borde); background: var(--panel); color: var(--texto);
  padding: .45rem .85rem; border-radius: 7px; cursor: pointer; font-size: .9rem; font-family: inherit;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn-primario { background: var(--primario); border-color: var(--primario); color: #fff; }
.btn-primario:hover { background: #2f4bc4; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-peligro { color: var(--peligro); border-color: #f1c0c0; }
.btn-chico { padding: .25rem .55rem; font-size: .8rem; }
form.inline { display: inline; }

/* mensajes */
.mensajes { list-style: none; padding: 0; margin: 0 0 1rem; }
.mensajes li { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .5rem; background: var(--primario-claro); }
.mensajes .success { background: #e6f6ea; color: #1e6b31; }
.mensajes .error { background: #fde8e8; color: #8a1c1c; }

/* tarjetas de métricas */
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.metrica { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: .9rem 1rem; }
.metrica .etiqueta { color: var(--suave); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.metrica .valor { font-size: 1.45rem; font-weight: 700; margin-top: .25rem; }
.metrica .detalle { color: var(--suave); font-size: .8rem; margin-top: .2rem; }
.valor.ok { color: var(--ok); }
.valor.alerta { color: var(--alerta); }

/* tablas */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--borde); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; color: var(--suave); letter-spacing: .03em; font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.tabla-scroll { overflow-x: auto; }
.vacio { color: var(--suave); padding: 1rem 0; text-align: center; }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }

/* estados */
.estado { display: inline-block; padding: .12rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.estado-pendiente { background: #fff4e0; color: #9c5b00; }
.estado-confirmado { background: var(--primario-claro); color: var(--enlace); }
.estado-atendido { background: #e6f6ea; color: #1e6b31; }
.estado-ausente { background: #fde8e8; color: #8a1c1c; }
.estado-cancelado { background: var(--hundido); color: var(--suave); text-decoration: line-through; }
.pago { font-size: .75rem; font-weight: 600; color: var(--ok); }
.pago.no { color: var(--alerta); }

/* formularios */
.formulario { max-width: 760px; }
.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem 1rem; }
.campo label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.campo.ancho { grid-column: 1 / -1; }
.campo input:not([type=checkbox]):not([type=radio]):not([type=color]), .campo select, .campo textarea, .filtros input, .filtros select {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--borde); border-radius: 7px; font: inherit; background: var(--panel);
}
.campo input[type=color] { width: 60px; height: 36px; border: 1px solid var(--borde); border-radius: 7px; padding: 2px; }
.campo .ayuda { color: var(--suave); font-size: .78rem; margin-top: .25rem; }
.campo .errorlist, .errorlist { color: var(--peligro); font-size: .82rem; margin: .3rem 0 0; padding: 0; list-style: none; }
.campo ul:not(.errorlist) { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.acciones { margin-top: 1.25rem; display: flex; gap: .5rem; }
.filtros { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; }
.filtros > div { min-width: 140px; }
.filtros label { display: block; font-size: .78rem; color: var(--suave); margin-bottom: .2rem; }
.separador { grid-column: 1 / -1; border-top: 1px dashed var(--borde); margin: .25rem 0; }

/* agenda diaria */
.agenda { display: flex; background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); overflow-x: auto; }
.agenda .horas { flex: 0 0 60px; border-right: 1px solid var(--borde); }
.agenda .col { flex: 1 0 200px; border-right: 1px solid var(--borde); }
.agenda .col:last-child { border-right: none; }
.agenda .encabezado {
  height: 52px; padding: .45rem .6rem; border-bottom: 1px solid var(--borde);
  position: sticky; top: 0; background: var(--panel); z-index: 2; font-weight: 600;
}
.agenda .encabezado small { display: block; color: var(--suave); font-weight: 400; font-size: .75rem; }
.agenda .grilla { position: relative; }
.agenda .hora { font-size: .75rem; color: var(--suave); padding: 2px 6px; border-bottom: 1px solid var(--borde); text-align: right; }
.agenda .celda { display: block; border-bottom: 1px solid var(--borde); background: var(--fondo-suave); }
.agenda .celda.laboral { background: var(--panel); }
.agenda .celda:hover { background: var(--primario-claro); text-decoration: none; }
.agenda .celda:hover::after { content: "+ reservar"; font-size: .72rem; color: var(--enlace); padding: 4px 8px; display: block; }
.bloque {
  position: absolute; left: 4px; right: 4px; border-radius: 7px; padding: 4px 8px; overflow: hidden;
  font-size: .8rem; color: var(--texto); border-left: 4px solid; box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
  line-height: 1.3; z-index: 1;
}
.bloque:hover { text-decoration: none; filter: brightness(.97); z-index: 3; overflow: visible; min-height: fit-content; }
.bloque strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloque .linea { color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloque.estado-ausente-b { opacity: .55; }

/* agenda semanal */
.semana { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: .5rem; overflow-x: auto; }
.dia { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); min-height: 260px; display: flex; flex-direction: column; }
.dia.hoy { border-color: var(--primario); box-shadow: 0 0 0 1px var(--primario); }
.dia .encabezado { padding: .55rem .7rem; border-bottom: 1px solid var(--borde); display: flex; justify-content: space-between; align-items: baseline; }
.dia .encabezado a { font-weight: 600; color: var(--texto); text-transform: capitalize; }
.dia .encabezado small { color: var(--suave); }
.dia .lista { padding: .45rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.tarjeta { display: block; border-left: 4px solid; border-radius: 6px; padding: .35rem .5rem; font-size: .8rem; color: var(--texto); }
.tarjeta:hover { text-decoration: none; filter: brightness(.96); }
.tarjeta .linea { color: var(--suave); }
.dia .pie { padding: .4rem .7rem; border-top: 1px solid var(--borde); font-size: .78rem; color: var(--suave); display: flex; justify-content: space-between; }

/* barras */
.barra-h { background: var(--hundido); border-radius: 99px; height: 8px; min-width: 80px; }
.barra-h span { display: block; height: 100%; border-radius: 99px; background: var(--primario); }

.dos-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 1rem; }
.ficha dt { color: var(--suave); font-size: .8rem; margin-top: .6rem; }
.ficha dd { margin: .1rem 0 0; font-weight: 500; }

@media (max-width: 700px) {
  .contenido { padding: .75rem; }
  .cabecera { gap: .6rem; }
  .dos-col { grid-template-columns: 1fr; }
}

/* usuario logueado */
.usuario { display: flex; align-items: center; gap: .8rem; font-size: .85rem; }
.usuario span { display: flex; flex-direction: column; line-height: 1.15; color: #fff; }
.usuario small { color: #9aa3b5; font-size: .72rem; }
.usuario a, .usuario .enlace { color: #cfd4e0; }
.enlace { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.enlace:hover { text-decoration: underline; }

/* opciones de radio */
.campo div[id^="id_"] > div { margin-bottom: .35rem; }
.campo div[id^="id_"] > div > label { font-weight: 400; display: flex; gap: .45rem; align-items: flex-start; }

/* pantalla de ingreso */
.ingreso { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.ingreso .panel { width: 100%; max-width: 380px; padding: 1.75rem; }
.ingreso h1 { margin-bottom: .25rem; }
.ingreso .campo { margin-top: .9rem; }
.ingreso .btn { width: 100%; margin-top: 1.25rem; padding: .6rem; }

/* tareas pendientes (Inicio) */
.tareas { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.tareas .panel { margin-bottom: 1rem; }
.tareas-titulo { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.tareas-titulo h2 { margin: 0; flex: 1; display: flex; align-items: center; gap: .5rem; }
.tareas-titulo a { font-size: .85rem; }
.contador { background: var(--alerta); color: #fff; border-radius: 99px; font-size: .75rem; padding: .1rem .5rem; }
.contador.cero { background: var(--ok); }
.tarea { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--borde); }
.tarea-datos { flex: 1; min-width: 0; color: var(--texto); display: flex; flex-direction: column; }
.tarea-datos:hover { text-decoration: none; color: var(--enlace); }
.tarea-datos strong, .tarea-datos span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tarea-datos span { color: var(--suave); font-size: .8rem; }
.tarea-acciones { display: flex; gap: .35rem; align-items: center; flex-shrink: 0; }
.tarea-acciones select { padding: .25rem .35rem; border: 1px solid var(--borde); border-radius: 6px; font: inherit; font-size: .8rem; max-width: 130px; }
.tareas .vacio { padding: .6rem 0; color: var(--ok); }

/* disponibilidad: bloqueos (vacaciones, bloqueado, ocupado) */
.mensajes .warning { background: #fff4e0; color: #8a4b00; }
.subtitulo-seccion { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--suave); margin: 0 0 .4rem; }
.semana-horarios td { padding: .3rem .4rem; }
.semana-horarios td:first-child { width: 110px; color: var(--suave); }
.tipo-bloqueo { font-size: .72rem; font-weight: 600; padding: .1rem .45rem; border-radius: 99px; margin-right: .3rem; }
.tipo-vacaciones { --c-bloqueo: #7048e8; }
.tipo-bloqueado  { --c-bloqueo: #495057; }
.tipo-ocupado    { --c-bloqueo: #e8590c; }
.tipo-bloqueo { background: color-mix(in srgb, var(--c-bloqueo) 14%, var(--panel)); color: var(--c-bloqueo); }
.bloqueo-grilla {
  position: absolute; left: 4px; right: 4px; z-index: 1; border-radius: 7px; padding: 4px 8px;
  font-size: .78rem; overflow: hidden; color: var(--c-bloqueo); border: 1px dashed var(--c-bloqueo);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c-bloqueo) 10%, var(--panel)) 0 8px,
                                                color-mix(in srgb, var(--c-bloqueo) 18%, var(--panel)) 8px 16px);
}
a.bloqueo-grilla:hover { text-decoration: none; filter: brightness(.97); }
.bloqueo-grilla .linea { color: inherit; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloqueo-tarjeta { border-left-color: var(--c-bloqueo) !important; color: var(--c-bloqueo);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c-bloqueo) 8%, var(--panel)) 0 6px,
                                                color-mix(in srgb, var(--c-bloqueo) 14%, var(--panel)) 6px 12px); }
.bloqueo-tarjeta .linea { color: inherit; opacity: .85; }

/* formulario de horarios semanales */
.horarios th, .horarios td { padding: .45rem .5rem; }
.horarios input[type=time] { padding: .35rem .45rem; border: 1px solid var(--borde); border-radius: 6px; font: inherit; }
.horarios tr.apagado td { opacity: .5; }

/* clientes: etiquetas (chips) y pestañas */
.chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.chip {
  display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .72rem; font-weight: 600;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--panel)); border: 1px solid color-mix(in srgb, var(--c) 35%, var(--panel));
  white-space: nowrap;
}
.chip-auto { border-style: dashed; }
.deuda { color: var(--peligro); }
.pestanas { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: .75rem; border-bottom: 1px solid var(--borde); }
.pestanas a { padding: .5rem .85rem; color: var(--suave); border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: .35rem; }
.pestanas a:hover { color: var(--texto); text-decoration: none; }
.pestanas a.activa { color: var(--enlace); border-bottom-color: var(--primario); font-weight: 600; }

/* servicios en tarjetas (agrupados por categoría) */
.grupo-servicios { margin-bottom: 1.75rem; }
.grupo-servicios-cabecera { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.grupo-servicios-cabecera h2 { margin: 0; font-size: 1rem; }
.grupo-servicios-cabecera .separa { flex: 1; }
.grupo-servicios-cabecera form { display: inline; }
.pill { background: var(--hundido-2); color: var(--suave); border-radius: 99px; font-size: .75rem; font-weight: 700; padding: .05rem .5rem; }
.icono { background: none; border: none; color: var(--suave); cursor: pointer; padding: .3rem; border-radius: 6px; display: inline-flex; }
.icono:hover { background: var(--hundido-2); color: var(--texto); }
.tarjetas-servicio { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: .9rem 1.1rem; }
.tarjeta-servicio {
  display: flex; align-items: center; gap: .9rem; background: var(--panel); border-radius: 14px; padding: .7rem .6rem .7rem .7rem;
  box-shadow: 0 1px 2px rgb(16 24 40 / 5%), 0 4px 14px rgb(16 24 40 / 6%); position: relative;
}
.tarjeta-servicio.inactivo { opacity: .6; }
.foto-servicio {
  flex: 0 0 64px; height: 64px; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, hsl(var(--tono) 70% 80%), hsl(calc(var(--tono) + 40) 65% 62%));
  color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: .03em; text-shadow: 0 1px 2px rgb(0 0 0 / 25%);
}
.foto-servicio:hover { text-decoration: none; }
.foto-servicio img { width: 100%; height: 100%; object-fit: cover; }
.info-servicio { flex: 1; min-width: 0; }
.info-servicio h3 { margin: 0 0 .25rem; font-size: .98rem; font-weight: 600; line-height: 1.25; }
.info-servicio h3 a { color: var(--texto); }
.duracion { display: flex; align-items: center; gap: .3rem; color: var(--suave); font-size: .8rem; }
.quienes { display: flex; flex-wrap: wrap; gap: .15rem .6rem; margin-top: .2rem; font-size: .72rem; color: var(--suave); }
.quienes .punto { width: 7px; height: 7px; margin-right: .25rem; }
.precio-servicio { text-align: right; display: flex; flex-direction: column; padding-left: .5rem; }
.precio-servicio strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.precio-servicio small { color: var(--suave); font-size: .72rem; }
.menu-acciones { position: relative; }
.menu-acciones summary { list-style: none; cursor: pointer; padding: .2rem .55rem; border-radius: 6px; color: var(--suave); font-weight: 700; font-size: 1.1rem; }
.menu-acciones summary::-webkit-details-marker { display: none; }
.menu-acciones summary:hover, .menu-acciones[open] summary { background: var(--hundido); color: var(--texto); }
.menu-lista {
  position: absolute; right: 0; top: 2rem; z-index: 10; background: var(--panel); border: 1px solid var(--borde); border-radius: 9px;
  box-shadow: 0 8px 24px rgb(16 24 40 / 14%); min-width: 150px; padding: .3rem; display: flex; flex-direction: column;
}
.menu-lista a, .menu-lista button {
  display: block; width: 100%; text-align: left; padding: .45rem .6rem; border-radius: 6px; border: none; background: none;
  font: inherit; font-size: .88rem; color: var(--texto); cursor: pointer;
}
.menu-lista a:hover, .menu-lista button:hover { background: var(--hover); text-decoration: none; }
.menu-lista .peligro { color: var(--peligro); }
@media (max-width: 560px) { .tarjetas-servicio { grid-template-columns: 1fr; } }

/* recaudación: selector de periodo */
.periodo-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.periodo-form label { display: block; font-size: .75rem; color: var(--suave); margin-bottom: .2rem; }
.periodo-form input, .periodo-form select { padding: .45rem .55rem; border: 1px solid var(--borde); border-radius: 7px; font: inherit; background: var(--panel); }
.segmentado { display: inline-flex; background: var(--hundido); border-radius: 9px; padding: 3px; align-self: end; }
.segmentado label { margin: 0; padding: .35rem .85rem; border-radius: 7px; cursor: pointer; font-size: .88rem; color: var(--suave); }
.segmentado label.activo { background: var(--panel); color: var(--texto); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
.segmentado input { display: none; }

/* tarjetas de métricas (KPIs) */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; padding: .85rem 1rem; position: relative; overflow: hidden; }
.kpi-principal { background: linear-gradient(135deg, var(--primario), color-mix(in srgb, var(--primario) 70%, white)); color: #fff; border: none; }
.kpi-principal .kpi-titulo, .kpi-principal .vs { color: rgb(255 255 255 / 80%); }
.kpi-titulo { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); }
.kpi-valor { font-size: 1.5rem; font-weight: 700; margin: .25rem 0; font-variant-numeric: tabular-nums; }
.kpi-pie { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .78rem; }
.vs { color: var(--suave); }
.var { font-weight: 700; font-size: .75rem; padding: .08rem .45rem; border-radius: 99px; white-space: nowrap; }
.var.buena { background: #e6f6ea; color: #1e6b31; }
.var.mala { background: #fde8e8; color: #a61e1e; }
.var.neutra { background: var(--hundido); color: var(--suave); }
.kpi-principal .var.buena { background: rgb(255 255 255 / 22%); color: #fff; }
.kpi-principal .var.mala { background: #ffe3e3; color: #a61e1e; }
.sparkline { display: block; width: 100%; height: 30px; margin-top: .45rem; color: #fff; opacity: .9; }
.kpis-chicos .kpi-valor { font-size: 1.25rem; }

/* grilla de gráficos */
.graficos-grilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.graficos-grilla .panel { margin-bottom: 0; }
.ancho-2 { grid-column: span 2; }
.ancho-3 { grid-column: 1 / -1; }
.grafico-cabecera { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.grafico-cabecera h2 { margin: 0; flex: 1; }
.grafico-cabecera a { font-size: .85rem; }
.grafico { width: 100%; height: auto; display: block; overflow: visible; }
.grilla-linea { stroke: var(--linea-grafico); stroke-width: 1; }
.eje-texto { font-size: 11px; fill: #8a92a3; font-family: inherit; }
.valor-barra { font-size: 10.5px; fill: #4b5263; font-weight: 600; }
.barra-grafico:hover { filter: brightness(1.12); }
.punto-grafico { opacity: 0; transition: opacity .1s; }
.punto-grafico:hover { opacity: 1; }
.leyenda { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .8rem; color: var(--suave); margin-top: .4rem; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

/* dona */
.dona { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.dona svg { flex-shrink: 0; max-width: 100%; height: auto; }
.dona-total { font-size: 15px; font-weight: 700; fill: var(--texto); }
.dona-leyenda { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: .35rem; }
.dona-leyenda li { display: grid; grid-template-columns: 12px 1fr auto; gap: 0 .5rem; align-items: center; font-size: .85rem; }
.dona-leyenda i { width: 10px; height: 10px; border-radius: 3px; }
.dona-leyenda small { grid-column: 2 / -1; color: var(--suave); font-size: .75rem; }

/* ranking con barras horizontales y marca de comparación */
.ranking { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.ranking-fila { display: flex; align-items: center; gap: .5rem; }
.ranking-nombre { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-barra { position: relative; height: 10px; background: var(--hundido); border-radius: 99px; margin: .3rem 0 .15rem; }
.ranking-barra span { display: block; height: 100%; border-radius: 99px; background: var(--primario); }
.ranking-barra em { position: absolute; top: -3px; width: 3px; height: 16px; background: #6b7280; border-radius: 2px; margin-left: -1px; }

.estados-barra { list-style: none; padding: 0; margin: .25rem 0 .75rem; display: flex; flex-direction: column; gap: .6rem; }
.estados-barra li { display: grid; grid-template-columns: 90px 1fr 44px; align-items: center; gap: .6rem; font-size: .88rem; }
.estados-barra strong { text-align: right; }

.balance-anual { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: space-between;
  background: linear-gradient(120deg, var(--resalte), var(--panel)); border-color: var(--resalte-borde); }
.balance-anual h2 { margin: .1rem 0; font-size: 1.25rem; }
.balance-anual p { margin: 0; }
.etiqueta-mini { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #b08900; font-weight: 700; }

.barra-doble { position: relative; height: 14px; }
.barra-doble span { position: absolute; left: 0; height: 6px; border-radius: 99px; }
.barra-doble .b-anterior { top: 0; background: #ced4da; }
.barra-doble .b-actual { top: 8px; background: var(--primario); }
tr.futuro td { color: #adb5bd; }
tfoot th { border-top: 2px solid var(--borde); color: var(--texto); font-size: .9rem; text-transform: none; }

@media (max-width: 900px) {
  .graficos-grilla { grid-template-columns: 1fr; }
  .ancho-2, .ancho-3 { grid-column: auto; }
}

/* multi-empresa: logo del negocio, franja del administrador y panel de plataforma */
.cabecera .marca { display: flex; align-items: center; gap: .55rem; }
.cabecera .marca img { height: 32px; max-width: 120px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px; }
.franja-plataforma { background: #fff3bf; color: #5c4400; padding: .45rem 1.25rem; font-size: .88rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.franja-plataforma .enlace { color: #5c4400; font-weight: 600; text-decoration: underline; }
.logo-actual { max-height: 72px; max-width: 220px; object-fit: contain; margin-bottom: 1rem; border: 1px solid var(--borde); border-radius: 8px; padding: 4px; background: #fff; }
.acciones-fila { white-space: nowrap; }
.acciones-fila form { display: inline; }

/* página de reservas: personalización (dueños) */
.enlace-publico { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.enlace-publico input { flex: 1; min-width: 220px; padding: .5rem .6rem; border: 1px solid var(--borde); border-radius: 7px; font: inherit; background: var(--fondo); }
.estado-pagina { font-weight: 600; color: var(--suave); font-size: .9rem; }
.estado-pagina.publicada { color: var(--ok); }
.panel.aviso { background: #fff9db; border-color: #ffe066; font-size: .9rem; }
.personalizar { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1.2rem; align-items: start; }
.personalizar h2 { margin-top: 0; }
@media (max-width: 1050px) { .personalizar { grid-template-columns: 1fr; } }
.opcion-titulo { font-size: .85rem; font-weight: 600; margin: 1.1rem 0 .5rem; }
.opcion-titulo:first-of-type { margin-top: .2rem; }
.muestras { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.muestra, .pastilla { cursor: pointer; position: relative; }
.muestra input, .pastilla input { position: absolute; opacity: 0; pointer-events: none; }
.muestra { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; text-align: center; }
.muestra-colores { display: flex; gap: 4px; padding: 10px; border: 2px solid; border-radius: 10px; justify-content: center; transition: box-shadow .15s; }
.muestra-colores i { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.muestra input:checked + .muestra-colores { box-shadow: 0 0 0 3px var(--primario); }
.muestra input:focus-visible + .muestra-colores, .pastilla input:focus-visible + span { outline: 2px solid var(--primario); outline-offset: 2px; }
.pastillas { display: flex; flex-wrap: wrap; gap: .5rem; }
.pastilla span { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border: 1.5px solid var(--borde); border-radius: 999px; font-size: .9rem; background: var(--panel); }
.pastilla input:checked + span { border-color: var(--primario); background: color-mix(in srgb, var(--primario) 10%, var(--panel)); color: var(--enlace); font-weight: 600; }
.forma-ejemplo { display: inline-block; width: 26px; height: 14px; background: currentColor; opacity: .55; }
.fila-color { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; font-size: .9rem; }
.fila-color input[type=color] { width: 48px; height: 32px; border: 1px solid var(--borde); border-radius: 7px; padding: 2px; }
.portada-actual { display: flex; gap: .8rem; align-items: center; margin-bottom: .5rem; font-size: .85rem; }
.portada-actual img { width: 140px; height: 70px; object-fit: cover; border-radius: 8px; }
.interruptores { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem 1rem; margin-top: 1rem; }
.interruptor { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.interruptor input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--primario); flex-shrink: 0; }
.interruptor span { display: flex; flex-direction: column; }
.interruptor small { color: var(--suave); font-size: .8rem; }
.guardar-fijo { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--fondo) 35%); padding: 1rem 0 .6rem; margin-top: 0; }
.vista-previa { position: sticky; top: 1rem; }
.vista-previa-titulo { font-weight: 600; margin-bottom: .5rem; display: flex; flex-direction: column; }
.vista-previa-titulo small { color: var(--suave); font-weight: 400; font-size: .8rem; }
.telefono { max-width: 420px; margin: 0 auto; border: 10px solid #1f2430; border-radius: 34px; overflow: hidden; height: 740px; max-height: 80vh; background: #1f2430; box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.telefono iframe { width: 100%; height: 100%; border: 0; border-radius: 24px; background: #fff; display: block; }
.chip-online { display: inline-block; font-size: .7rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; background: #e7f5ff; color: #1971c2; vertical-align: middle; }

/* utilidades de color y filas */
.texto-alerta { color: var(--alerta); }
.texto-ok { color: var(--ok); }
tr.fila-alerta td { background: #fff4e6; }
tr.fila-elegida td { background: var(--primario-claro); }
tr.fila-anulada td { opacity: .55; }
.check-filtro { display: flex; align-items: center; gap: .4rem; font-size: .9rem; padding-bottom: .45rem; }
.lista-simple { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-direction: column; gap: .4rem; }

/* productos, stock y ventas */
.stock { font-size: .82rem; color: var(--ok); font-weight: 600; }
.stock.bajo { color: var(--alerta); }
.fila-ranking { display: flex; align-items: center; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--borde); }
.fila-ranking:first-of-type { border-top: 0; }
.fila-ranking span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.renglones { margin-bottom: .6rem; }
.renglones td { padding: .35rem .4rem; }
.renglones select, .renglones input { width: 100%; padding: .45rem .5rem; border: 1px solid var(--borde); border-radius: 7px; font: inherit; background: var(--panel); }
.renglones input[type=number] { max-width: 130px; text-align: right; }
.renglones .subtotal { white-space: nowrap; font-variant-numeric: tabular-nums; }
.total-venta { font-size: 1.2rem; margin-top: 1rem; text-align: right; }
.total-venta strong { font-size: 1.5rem; }

/* capacitaciones */
.tarjetas-curso { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.tarjeta-curso {
  background: var(--panel); border-radius: 14px; overflow: hidden; color: var(--texto); display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgb(16 24 40 / 5%), 0 4px 14px rgb(16 24 40 / 6%); transition: transform .15s, box-shadow .15s;
}
.tarjeta-curso:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 26px rgb(16 24 40 / 10%); }
.curso-foto {
  position: relative; aspect-ratio: 16 / 7; display: grid; place-items: center; font-size: 2.2rem;
  background: linear-gradient(135deg, hsl(var(--tono) 70% 82%), hsl(calc(var(--tono) + 40) 65% 66%));
}
.curso-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.curso-fecha { position: absolute; left: .7rem; bottom: .6rem; background: #fff; color: #1f2430; font-size: .8rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px; text-transform: capitalize; }
.curso-info { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .45rem; }
.curso-info h3 { margin: 0; font-size: 1.02rem; }
.cupo { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--suave); }
.cupo-barra { height: 6px; background: var(--borde); border-radius: 99px; overflow: hidden; }
.cupo-barra i { display: block; height: 100%; background: var(--primario); border-radius: 99px; max-width: 100%; }
.curso-pie { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .82rem; color: var(--suave); }
.curso-pie strong { font-size: 1.05rem; color: var(--texto); }
.pago-rapido { display: flex; gap: .3rem; align-items: center; }
.pago-rapido input { width: 100px; padding: .3rem .4rem; border: 1px solid var(--borde); border-radius: 6px; font: inherit; font-size: .85rem; }
.pago-rapido select { padding: .3rem; border: 1px solid var(--borde); border-radius: 6px; font: inherit; font-size: .8rem; max-width: 120px; }
.kpi-valor small { font-size: .9rem; color: var(--suave); font-weight: 500; }
.aviso-extras { background: #ebfbee; border-color: #b2f2bb; font-size: .9rem; }

/* --- piezas visuales compartidas (Ventas, Capacitaciones) ------------------------------ */
.btn-icono {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--borde);
  background: var(--panel); color: var(--texto); font-size: 1.3rem; line-height: 1;
}
.btn-icono:hover { background: var(--fondo); text-decoration: none; }
.btn-icono.deshabilitado { opacity: .35; }
.selector-mes { display: inline-flex; align-items: center; gap: .35rem; }
.selector-mes form { margin: 0; }
.mes-actual {
  position: relative; display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .9rem;
  border: 1px solid var(--borde); border-radius: 9px; background: var(--panel); font-weight: 600; font-size: .9rem; cursor: pointer;
}
.mes-actual .icono-svg { color: var(--enlace); }
.mes-actual input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.kpi-icono { display: flex; gap: .8rem; align-items: flex-start; }
.kpi-ico {
  flex: 0 0 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--panel));
}
.top-item { display: flex; gap: .75rem; align-items: center; padding: .55rem 0; }
.top-item + .top-item { border-top: 1px dashed var(--borde); }
.puesto {
  flex: 0 0 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .78rem; font-weight: 700;
  background: var(--fondo); color: var(--suave);
}
.top-item:first-of-type .puesto { background: color-mix(in srgb, var(--primario) 14%, var(--panel)); color: var(--enlace); }
.punto-metodo { flex: 0 0 12px; height: 12px; border-radius: 50%; margin: 0 7px; }
.top-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.top-linea { display: flex; justify-content: space-between; gap: .75rem; font-size: .9rem; }
.top-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-cuerpo small { color: var(--suave); font-size: .75rem; }
.pista { height: 6px; background: var(--hundido); border-radius: 99px; overflow: hidden; }
.pista i { display: block; height: 100%; max-width: 100%; border-radius: 99px; background: var(--primario); }
.pista.verde i { background: var(--ok); }
.pista.mini { height: 4px; margin-top: .3rem; min-width: 70px; }
.vacio-suave { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.5rem 1rem; color: var(--suave); text-align: center; }
.vacio-suave .icono-svg { opacity: .45; }
.vacio-grande { grid-column: 1 / -1; padding: 3rem 1rem; }
.tabla-linda th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); font-weight: 600; }
.tabla-linda td { vertical-align: middle; padding-top: .65rem; padding-bottom: .65rem; }
.tabla-linda tbody tr { transition: background .12s; }
.tabla-linda tbody tr[onclick] { cursor: pointer; }
.tabla-linda tbody tr:hover td { background: var(--fondo-suave); }
.id-venta { font-weight: 700; }
.chip-producto { display: inline-flex; gap: .25rem; font-size: .78rem; padding: .15rem .55rem; border-radius: 99px; background: var(--fondo); border: 1px solid var(--borde); white-space: nowrap; }
.chip-producto b { color: var(--enlace); }
.chip-metodo { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; white-space: nowrap; }
.chip-metodo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #868e96); }
.chip-suave { font-size: .72rem; padding: .12rem .5rem; border-radius: 99px; background: var(--fondo); color: var(--suave); font-weight: 600; }
.avatar-mini {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: .72rem;
  font-weight: 700; margin-right: .4rem; vertical-align: middle; flex-shrink: 0;
}
.persona { display: flex; align-items: center; gap: .2rem; }
.filtro-pildoras { display: inline-flex; background: var(--hundido); border-radius: 10px; padding: 3px; }
.filtro-pildoras a { padding: .4rem .85rem; border-radius: 8px; font-size: .86rem; color: var(--suave); font-weight: 500; }
.filtro-pildoras a:hover { color: var(--texto); text-decoration: none; }
.filtro-pildoras a.activa { background: var(--panel); color: var(--texto); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / 10%); }

/* tarjetas de capacitación */
.tarjetas-curso { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.curso-foto { aspect-ratio: 16 / 7.5; }
.curso-emblema { color: rgb(255 255 255 / 85%); filter: drop-shadow(0 2px 6px rgb(0 0 0 / 15%)); display: grid; }
.bloque-fecha {
  position: absolute; left: .8rem; top: .8rem; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 48px; height: 52px; border-radius: 12px; background: var(--panel); box-shadow: 0 4px 14px rgb(0 0 0 / 14%); line-height: 1;
}
.bloque-fecha strong { font-size: 1.3rem; color: var(--texto); }
.bloque-fecha small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--enlace); font-weight: 700; margin-top: .15rem; }
.bloque-fecha.grande { position: static; width: 64px; height: 70px; flex-shrink: 0; }
.bloque-fecha.grande strong { font-size: 1.8rem; }
.curso-estado {
  position: absolute; right: .8rem; top: .8rem; font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 99px;
  background: rgb(255 255 255 / 92%); color: var(--texto);
}
.curso-estado.estatico { position: static; display: inline-block; margin-bottom: .4rem; }
.curso-info { gap: .6rem; padding: .9rem 1.05rem 1.05rem; }
.curso-info h3 { font-size: 1.05rem; line-height: 1.3; }
.curso-datos-linea { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .8rem; color: var(--suave); }
.curso-datos-linea span { display: inline-flex; align-items: center; gap: .3rem; }
.curso-datos-linea.claro { color: rgb(255 255 255 / 90%); font-size: .88rem; }
.barra-dato { display: flex; flex-direction: column; gap: .3rem; }
.barra-dato-texto { display: flex; justify-content: space-between; font-size: .78rem; color: var(--suave); }
.barra-dato-texto span:last-child { color: var(--texto); font-weight: 600; }
.barra-dato-texto em { font-style: normal; font-weight: 500; }
.curso-pie { padding-top: .6rem; border-top: 1px solid var(--borde); align-items: center; }
.curso-pie .chips { display: flex; gap: .3rem; }

/* cabecera grande de la ficha de capacitación */
.volver-link { display: inline-block; font-size: .88rem; color: var(--suave); margin-bottom: .6rem; }
.curso-hero {
  position: relative; overflow: hidden; border-radius: 16px; margin-bottom: 1rem; color: #fff; min-height: 150px;
  background: linear-gradient(120deg, hsl(var(--tono) 55% 42%), hsl(calc(var(--tono) + 50) 60% 55%));
  display: flex; align-items: flex-end;
}
.curso-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.curso-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 5%), rgb(0 0 0 / 45%)); }
.curso-hero-contenido { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 1rem; padding: 1.4rem 1.5rem; width: 100%; }
.curso-hero-contenido > div { flex: 1; min-width: 0; }
.curso-hero h1 { font-size: 1.7rem; margin-bottom: .35rem; }
.curso-hero .btn { flex-shrink: 0; }

/* tabla de inscriptos */
.persona-datos { display: flex; flex-direction: column; line-height: 1.3; }
.persona-datos a { white-space: nowrap; font-weight: 600; }
.persona-datos .subtitulo { white-space: nowrap; font-size: .78rem; }
.nota-insc { white-space: normal !important; font-style: italic; max-width: 240px; }
.celda-pagos { min-width: 190px; }
.pagos-linea { display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; font-size: .88rem; }
.pagos-linea .falta { color: var(--alerta); font-size: .78rem; font-weight: 600; }
.pagos-linea .pagado-ok { color: var(--ok); font-size: .78rem; font-weight: 600; }
.pagos-detalle { font-size: .76rem; color: var(--suave); margin-top: .3rem; }
.pagos-detalle summary { cursor: pointer; color: var(--enlace); }
.pagos-detalle div { white-space: nowrap; padding-top: .15rem; }
.acciones-insc { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }

/* accesos extra de un profesional (Usuarios → Editar) */
.accesos { border: 1px solid var(--borde); border-radius: 12px; padding: 1rem 1.1rem; margin: 1.2rem 0 0; }
.accesos legend { font-weight: 700; padding: 0 .4rem; }
.accesos-grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; margin-top: .6rem; }
.acceso {
  display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1.5px solid var(--borde);
  border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s;
}
.acceso:hover { border-color: color-mix(in srgb, var(--primario) 40%, var(--borde)); }
.acceso:has(input:checked) { border-color: var(--primario); background: color-mix(in srgb, var(--primario) 7%, var(--panel)); }
.acceso input { margin-top: .2rem; width: 17px; height: 17px; accent-color: var(--primario); flex-shrink: 0; }
.acceso span { display: flex; flex-direction: column; gap: .15rem; }
.acceso small { color: var(--suave); font-size: .78rem; line-height: 1.35; }

/* login: link para recuperar la contraseña y pantallas de recupero */
.olvide { display: block; text-align: center; margin-top: .9rem; font-size: .88rem; }
.ingreso .panel p { color: var(--suave); line-height: 1.5; }

/* páginas legales */
.legal { max-width: 780px; margin: 0 auto; line-height: 1.6; }
.legal h1 { margin-bottom: .2rem; }
.legal h2 { margin: 1.4rem 0 .4rem; font-size: 1.05rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .35rem; }
.nota-legal { font-size: .85rem; color: var(--suave); border-left: 3px solid var(--borde); padding-left: .8rem; }
.pie-legal { text-align: center; margin-top: .6rem; font-size: .78rem; color: var(--suave); }
.pie-legal a { color: var(--suave); }

/* --- celular: cabecera con botón "Menú" y ajustes de pantallas internas ----------------- */
.cabecera-menu { display: contents; }  /* en la computadora, sus elementos van en la misma fila */
.boton-menu { display: none; }
@media (max-width: 760px) {
  .cabecera { padding: .55rem .9rem; gap: .5rem; position: relative; }
  .cabecera .marca { flex: 1; min-width: 0; }
  .cabecera .marca span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .boton-menu {
    display: inline-flex; align-items: center; gap: .5rem; background: #343b4d; color: #fff; border: 0;
    border-radius: 8px; padding: .5rem .8rem; font: inherit; font-size: .9rem; cursor: pointer;
  }
  .boton-menu-icono, .boton-menu-icono::before, .boton-menu-icono::after {
    display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
  }
  .boton-menu-icono::before, .boton-menu-icono::after { content: ""; position: absolute; left: 0; }
  .boton-menu-icono::before { top: -5px; }
  .boton-menu-icono::after { top: 5px; }
  .cabecera-menu { display: none; }
  .cabecera.abierto .cabecera-menu {
    display: flex; flex-direction: column; gap: .8rem; width: 100%; padding: .6rem 0 .3rem;
    border-top: 1px solid #343b4d; margin-top: .3rem;
  }
  .cabecera.abierto nav.secciones { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
  .cabecera.abierto nav.secciones a { padding: .6rem .7rem; }
  .cabecera .selector { flex-wrap: wrap; }
  .cabecera .selector select { flex: 1; }
  .cabecera .usuario { justify-content: space-between; }

  /* pantallas internas */
  h1 { font-size: 1.3rem; }
  .barra { margin-bottom: .8rem; }
  .barra .grupo { width: 100%; }
  .metricas, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .metrica, .kpi { padding: .7rem .8rem; }
  .metrica .valor, .kpi-valor { font-size: 1.15rem; }
  .kpi-icono { gap: .55rem; }
  .kpi-ico { flex-basis: 32px; height: 32px; border-radius: 9px; }
  .kpi-ico .icono-svg { width: 16px; height: 16px; }
  .tareas { grid-template-columns: 1fr; }
  .tarea { flex-wrap: wrap; }
  .tarea-acciones { width: 100%; justify-content: flex-end; }
  .graficos-grilla { grid-template-columns: 1fr; }
  .graficos-grilla .ancho-2 { grid-column: auto; }
  .tarjetas-curso { grid-template-columns: 1fr; }
  .curso-hero h1 { font-size: 1.3rem; }
  .curso-hero-contenido { flex-wrap: wrap; padding: 1rem; }
  .filtro-pildoras { width: 100%; }
  .filtro-pildoras a { flex: 1; text-align: center; }
  .selector-mes { flex: 1; }
  .pestanas { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .pestanas a { white-space: nowrap; }
  .periodo-form { gap: .5rem; }
  table { font-size: .88rem; }
  .total-venta { text-align: left; }
  .renglones input[type=number] { max-width: 80px; }
}

/* columnas de grilla: que puedan achicarse por debajo del ancho de su contenido (evita desbordes en celular) */
.dos-col > *, .graficos-grilla > *, .tareas > *, .kpis > *, .metricas > * { min-width: 0; }
@media (max-width: 760px) { .dos-col { grid-template-columns: minmax(0, 1fr); } }


/* =====================================================================================
 * Accesibilidad (Configuración → Accesibilidad). base.html pone en <html>:
 *   data-tema="auto|claro|oscuro"   data-letra="normal|grande|enorme"
 *   data-contraste="normal|alto"    data-lectura="normal|comoda"
 * El tema oscuro sólo redefine las variables de :root; por eso los colores de este archivo
 * van siempre con var(--...). Los avisos y estados de colores pastel (con su propio color de
 * texto) se ven bien sobre los dos fondos; los que heredan el color del texto se ajustan abajo.
 * ===================================================================================== */
:root[data-tema="oscuro"] {
  --fondo: #11141b;
  --panel: #1a1e27;
  --texto: #e4e7ee;
  --suave: #9ba3b4;
  --borde: #2d3341;
  --primario-claro: color-mix(in srgb, var(--primario) 26%, #1a1e27);
  --hundido: #252a36;
  --hundido-2: #2a303d;
  --hover: #232835;
  --fondo-suave: #161920;
  --linea-grafico: #2a303c;
  --enlace: color-mix(in srgb, var(--primario) 55%, #ffffff);
  --sombra: rgb(0 0 0 / 35%);
  --resalte: #3a3115;
  --resalte-borde: #6b5a1e;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-tema="auto"] {
    --fondo: #11141b;
    --panel: #1a1e27;
    --texto: #e4e7ee;
    --suave: #9ba3b4;
    --borde: #2d3341;
    --primario-claro: color-mix(in srgb, var(--primario) 26%, #1a1e27);
    --hundido: #252a36;
    --hundido-2: #2a303d;
    --hover: #232835;
    --fondo-suave: #161920;
    --linea-grafico: #2a303c;
    --enlace: color-mix(in srgb, var(--primario) 55%, #ffffff);
    --sombra: rgb(0 0 0 / 35%);
    --resalte: #3a3115;
    --resalte-borde: #6b5a1e;
    color-scheme: dark;
  }
}
:root[data-tema="oscuro"] .panel.aviso, :root[data-tema="oscuro"] .aviso-extras,
:root[data-tema="oscuro"] tr.fila-alerta td, :root[data-tema="oscuro"] .franja-plataforma {
  background: #3a3115; border-color: #6b5a1e; color: #f3e3a6;
}
:root[data-tema="oscuro"] .aviso-extras { background: #18321f; border-color: #2b5a37; color: #c3ecce; }
:root[data-tema="oscuro"] .mensajes li { color: var(--texto); }
:root[data-tema="oscuro"] .mensajes .success { background: #18321f; color: #b9eac6; }
:root[data-tema="oscuro"] .mensajes .error { background: #3b1a1a; color: #ffc9c9; }
:root[data-tema="oscuro"] .mensajes .warning { background: #3a2a10; color: #ffd8a8; }
:root[data-tema="oscuro"] .franja-plataforma .enlace { color: #ffe08a; text-decoration: underline; }
:root[data-tema="oscuro"] .cabecera { background: #0b0d12; }
:root[data-tema="oscuro"] .subbarra { box-shadow: 0 2px 10px var(--sombra); }
:root[data-tema="oscuro"] img { opacity: .92; }
@media (prefers-color-scheme: dark) {
  :root[data-tema="auto"] .panel.aviso, :root[data-tema="auto"] .aviso-extras,
  :root[data-tema="auto"] tr.fila-alerta td, :root[data-tema="auto"] .franja-plataforma {
    background: #3a3115; border-color: #6b5a1e; color: #f3e3a6;
  }
  :root[data-tema="auto"] .aviso-extras { background: #18321f; border-color: #2b5a37; color: #c3ecce; }
  :root[data-tema="auto"] .mensajes li { color: var(--texto); }
  :root[data-tema="auto"] .mensajes .success { background: #18321f; color: #b9eac6; }
  :root[data-tema="auto"] .mensajes .error { background: #3b1a1a; color: #ffc9c9; }
  :root[data-tema="auto"] .mensajes .warning { background: #3a2a10; color: #ffd8a8; }
  :root[data-tema="auto"] .franja-plataforma .enlace { color: #ffe08a; text-decoration: underline; }
  :root[data-tema="auto"] .cabecera { background: #0b0d12; }
  :root[data-tema="auto"] img { opacity: .92; }
}

/* tamaño de letra: agranda todo el sistema por igual (como el zoom del navegador) */
:root[data-letra="grande"] body { zoom: 1.13; }
:root[data-letra="enorme"] body { zoom: 1.28; }
.pastilla.letra-grande span { font-size: 1.02rem; }
.pastilla.letra-enorme span { font-size: 1.15rem; }

/* alto contraste: textos secundarios y bordes más marcados, links siempre subrayados */
:root[data-contraste="alto"] { --suave: #3b414d; --borde: #8a92a3; --enlace: color-mix(in srgb, var(--primario) 80%, #000000); }
:root[data-contraste="alto"][data-tema="oscuro"] { --suave: #cfd4de; --borde: #6d7689; --enlace: color-mix(in srgb, var(--primario) 35%, #ffffff); --texto: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root[data-contraste="alto"][data-tema="auto"] { --suave: #cfd4de; --borde: #6d7689; --enlace: color-mix(in srgb, var(--primario) 35%, #ffffff); --texto: #ffffff; }
}
:root[data-contraste="alto"] .contenido a:not(.btn):not(.bloque):not(.tarjeta) { text-decoration: underline; }
:root[data-contraste="alto"] .panel, :root[data-contraste="alto"] .btn { border-width: 2px; }

/* lectura más cómoda: más aire entre líneas, letras y palabras, y una letra de formas más claras */
:root[data-lectura="comoda"] body, :root[data-lectura="comoda"] input, :root[data-lectura="comoda"] select,
:root[data-lectura="comoda"] textarea, :root[data-lectura="comoda"] button {
  font-family: Verdana, Tahoma, "Segoe UI", system-ui, sans-serif;
}
:root[data-lectura="comoda"] body { line-height: 1.6; letter-spacing: .02em; word-spacing: .08em; }
:root[data-lectura="comoda"] p, :root[data-lectura="comoda"] .ayuda, :root[data-lectura="comoda"] small { line-height: 1.7; }
.ejemplo-lectura strong { font-family: Verdana, Tahoma, sans-serif; letter-spacing: .02em; word-spacing: .08em; }

/* si el dispositivo pide "reducir movimiento", se quitan los efectos (son pocos y cortos) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* foco visible con el teclado y link para saltar el menú */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primario) 70%, var(--texto)); outline-offset: 2px; }
.saltar {
  position: absolute; left: .5rem; top: -3rem; z-index: 100; background: var(--panel); color: var(--texto);
  padding: .5rem .9rem; border-radius: 8px; box-shadow: 0 2px 10px var(--sombra); font-weight: 600;
}
.saltar:focus { top: .5rem; }
.contenido:focus { outline: none; }


/* Página de reservas: grupos de temas y "Con mis colores" */
.subtitulo-temas { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); margin: .9rem 0 .45rem; }
.muestra-propia { background: var(--panel); border-color: var(--borde); }
.muestra-propia i { box-shadow: 0 0 0 1px rgb(0 0 0 / 15%); }
.colores-propios { margin-top: .9rem; border: 1px dashed var(--borde); border-radius: 12px; padding: .8rem 1rem; }
.colores-propios .ayuda { margin: 0 0 .7rem; }
.grilla-colores { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; }
.grilla-colores label { display: flex; align-items: center; gap: .55rem; font-size: .88rem; cursor: pointer; }
.grilla-colores input[type=color] { width: 44px; height: 34px; border: 1px solid var(--borde); border-radius: 8px; padding: 2px; background: var(--panel); flex-shrink: 0; }
.aviso-contraste { margin: .7rem 0 0; font-size: .85rem; font-weight: 600; color: var(--alerta); }

/* --- pantalla de ingreso: presentación de la plataforma + formulario --------------------- */
.ingreso-portada {
  min-height: calc(100vh - 2.5rem); max-width: 1040px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.5rem; align-items: center;
}
.presentacion {
  position: relative; overflow: hidden; border-radius: 20px; padding: 2.4rem 2.2rem; color: #fff;
  background: linear-gradient(140deg, var(--primario), color-mix(in srgb, var(--primario) 55%, #1f2430));
  box-shadow: 0 18px 40px color-mix(in srgb, var(--primario) 28%, transparent);
}
.presentacion::after {  /* círculos decorativos */
  content: ""; position: absolute; right: -90px; top: -90px; width: 260px; height: 260px; border-radius: 50%;
  background: rgb(255 255 255 / 9%); box-shadow: -60px 330px 0 30px rgb(255 255 255 / 6%); pointer-events: none;
}
.presentacion-marca { display: flex; align-items: center; gap: .75rem; }
.presentacion-logo {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: rgb(255 255 255 / 18%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 25%);
}
.presentacion h1 { font-size: 2.1rem; letter-spacing: -.02em; color: #fff; }
.presentacion-lema { font-size: 1.15rem; font-weight: 600; margin: 1rem 0 .4rem; }
.presentacion-texto { margin: 0; line-height: 1.55; opacity: .9; max-width: 34rem; }
.presentacion-lista { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; gap: .7rem; }
.presentacion-lista li { display: flex; gap: .65rem; align-items: flex-start; line-height: 1.4; font-size: .93rem; }
.presentacion-lista .icono-svg { flex-shrink: 0; margin-top: .1rem; opacity: .9; }
.presentacion-contacto { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  border-top: 1px solid rgb(255 255 255 / 22%); padding-top: 1.2rem; }
.presentacion-contacto p { margin: 0; font-weight: 600; width: 100%; }
.presentacion-contacto small { opacity: .9; font-size: .85rem; }
.presentacion-contacto small a { color: #fff; text-decoration: underline; }
.btn-contacto {
  display: inline-flex; align-items: center; gap: .5rem; background: #fff; color: #1f2430; border: 0;
  font-weight: 700; padding: .65rem 1.3rem; border-radius: 999px; box-shadow: 0 4px 14px rgb(0 0 0 / 18%);
}
.btn-contacto:hover { background: #f1f3f8; color: #1f2430; }
.btn-contacto.deshabilitado { opacity: .6; cursor: not-allowed; }
.nota-config { width: 100%; }
.nota-config code { background: rgb(0 0 0 / 20%); padding: 0 .3rem; border-radius: 4px; }
.ingreso-form { padding: 1.9rem; }
.ingreso-form h2 { font-size: 1.4rem; margin: 0 0 .2rem; }
.ingreso-form .campo { margin-top: .9rem; }
.ingreso-form .btn-primario { width: 100%; margin-top: 1.25rem; padding: .65rem; }
@media (max-width: 820px) {
  .ingreso-portada { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 1rem; }
  .presentacion { padding: 1.5rem 1.3rem; border-radius: 16px; }
  .presentacion h1 { font-size: 1.6rem; }
  .presentacion-lista { display: none; }  /* en el celular, lo esencial: nombre, qué es y el contacto */
  .ingreso-form { padding: 1.4rem; }
}

/* --- promociones: códigos de descuento y gift cards ------------------------------------ */
.codigo-promo { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 700; letter-spacing: .04em; }
.codigo-promo.grande { font-size: 1.4rem; }
.estado-promo { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 700; vertical-align: middle; }
.estado-vigente { background: #e6f6ea; color: #1e6b31; }
.estado-programado { background: #e7f5ff; color: #1864ab; }
.estado-agotado, .estado-usada { background: var(--hundido); color: var(--suave); }
.estado-vencido, .estado-vencida { background: #fff4e0; color: #8a4b00; }
.estado-pausado, .estado-anulada { background: #fde8e8; color: #8a1c1c; }
.form-promo h2 { margin: 1.4rem 0 .6rem; font-size: 1rem; }
.form-promo h2:first-of-type { margin-top: .2rem; }
.elegir-items { margin-top: .7rem; padding: .7rem .9rem; border: 1px dashed var(--borde); border-radius: 10px; }
.elegir-items .ayuda { margin: 0 0 .5rem; }
.lista-items > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35rem .9rem; }
.lista-items label { display: flex; gap: .45rem; align-items: center; font-size: .9rem; }
.cupon {
  display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; padding: 1.2rem;
  border: 2px dashed var(--primario); border-radius: 14px; background: color-mix(in srgb, var(--primario) 6%, var(--panel));
}
.cupon-valor { font-size: 1.8rem; font-weight: 800; color: var(--enlace); }
.cupon strong { font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; letter-spacing: .08em; margin-top: .2rem; }
.cupon small { color: var(--suave); }
.tarjeta-regalo {
  position: relative; overflow: hidden; max-width: 440px; margin: 0 auto; aspect-ratio: 1.6; padding: 1.3rem 1.4rem;
  border-radius: 18px; color: #fff; display: flex; flex-direction: column; gap: .15rem;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #1f2430));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--c) 30%, transparent);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.tarjeta-regalo::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgb(255 255 255 / 10%); }
.tr-cabecera { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.tr-cabecera img { height: 30px; max-width: 90px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.tr-titulo { margin-top: auto; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; opacity: .85; }
.tr-monto { font-size: 2.2rem; font-weight: 800; line-height: 1.1; }
.tr-dato { font-size: .9rem; }
.tr-mensaje { margin: .3rem 0 0; font-style: italic; font-size: .88rem; opacity: .95; }
.tr-pie { display: flex; flex-direction: column; margin-top: auto; padding-top: .6rem; border-top: 1px solid rgb(255 255 255 / 30%); }
.tr-codigo { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; font-weight: 700; letter-spacing: .1em; }
.tr-pie small { opacity: .85; }
.saldo-gift { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .5rem; }
.saldo-gift strong { font-size: 1.8rem; }
.saldo-gift span { color: var(--suave); }
.campo-gift-card[hidden] { display: none !important; }
:root[data-tema="oscuro"] .estado-vigente { background: #18321f; color: #b9eac6; }
@media print {
  .cabecera, .subbarra, .franja-plataforma, .no-imprimir, .mensajes, .saltar { display: none !important; }
  body { background: #fff; }
  .contenido { padding: 0; }
  .panel { border: 0; box-shadow: none; }
  .dos-col { display: block; }
}


/* WhatsApp automático: estado de cada mensaje */
.tabla-whatsapp td { vertical-align: top; }
.estado-whatsapp { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.estado-wa-enviado { background: #e6f6ea; color: #1e6b31; }
.estado-wa-error { background: #fde8e8; color: #8a1c1c; cursor: help; }
.estado-wa-simulado { background: var(--hundido); color: var(--suave); }


/* pedir cuenta (registro.py) */
.pedir-cuenta { text-align: center; font-size: .85rem; color: var(--suave); margin: .7rem 0 0; }
.ingreso .registro { max-width: 440px; }
.ingreso .registro .ayuda { font-size: .78rem; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.codigo-equipo .enlace-publico { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.codigo-equipo .enlace-publico input { flex: 1; min-width: 220px; }
