/* Sistema de diseño del backoffice (Claude Design → CSS).
   El acento (--accent) lo inyecta el layout desde gimnasio.color_primario: los neutros son
   fijos y sólo el acento cambia por gimnasio. Ver docs/44-brief-diseno-visual.md. */

:root {
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Acento índigo soft por defecto; el layout lo pisa con el color del gimnasio (white-label). */
  --accent: #4f46e5;
  --accent-fg: #ffffff;

  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef0f4;
  --border: #ecedf1;
  --border-strong: #e3e5ea;
  --fg: #111726;
  --fg-muted: #525a6b;
  --fg-subtle: #98a0b0;

  --success: #0a7a44;
  --warning: #b45309;
  --danger: #c92a2a;
  --info: #2f5bd0;

  color-scheme: light;

  --rad: 10px;
  --rad-md: 12px;
  --rad-lg: 16px;

  /* Altura de la franja superior: la comparten el header (.bo-topbar) y la marca del sidebar
     (.bo-marca) para que sus bordes inferiores queden en la misma línea (#22). */
  --bo-top-alto: 66px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  /* Sombras suaves y esparcidas: la firma del look soft (profundidad por sombra, no por líneas). */
  --shadow-sm: 0 1px 2px rgba(17, 23, 38, .05), 0 1px 3px rgba(17, 23, 38, .05);
  --shadow-md: 0 1px 2px rgba(17, 23, 38, .04), 0 14px 30px -12px rgba(17, 23, 38, .14);
  --shadow-lg: 0 1px 2px rgba(17, 23, 38, .04), 0 30px 60px -20px rgba(17, 23, 38, .22);
}

/* Claro es el default y vive en :root. El oscuro cuelga de data-tema, que decide el usuario.
   La opción "sistema" se resuelve a claro/oscuro en el <head> antes del primer pintado, así
   los tokens oscuros viven en un solo lugar. */
[data-tema="oscuro"] {
  /* Los controles nativos (calendario, scrollbars, desplegables) siguen al tema. */
  color-scheme: dark;

  --bg: #0e1014;
  --surface: #181b21;
  --surface-2: #14161b;
  --surface-3: #121419;
  --border: #252932;
  --border-strong: #2e333d;
  --fg: #e7e9ee;
  --fg-muted: #a5adbd;
  --fg-subtle: #6b7382;
  --success: #57cd90;
  --warning: #e6b45f;
  --danger: #f0918f;
  --info: #8fabf0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 34px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, .3), 0 34px 64px -20px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

body.bo {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  /* Derivadas del acento que el layout fija por gimnasio en el <body>: en :root quedaban
     congeladas al default y rompían el hover/tinte para gimnasios de otro color. */
  --accent-press: color-mix(in srgb, var(--accent) 80%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --accent-ink: var(--accent-press);
}

.bo a { color: var(--accent); text-decoration: none; }
/* Excluye los botones-link (`<a class="btn…">`): si no, en hover el texto tomaba el color del
   fondo (--accent-press) y desaparecía. El color del texto de cada botón lo fija su propia regla. */
.bo a:not([class*="btn"]):hover { color: var(--accent-press); }

/* ============================ SHELL ============================ */

/* Capado al viewport (#71): el shell NO crece con el contenido, así el sidebar y el topbar
   quedan fijos y sólo scrollea el contenido (.bo-nav y .bo-contenido ya tienen overflow-y).
   100dvh (no vh) para no cortar bajo la barra de URL de iOS; overflow:hidden para que el shell
   nunca scrollee por su cuenta. */
.bo-shell { display: flex; height: 100dvh; overflow: hidden; }

.bo-sidebar {
  width: 250px; flex: 0 0 250px;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
}

.bo-marca {
  display: flex; align-items: center; gap: 11px;
  min-height: var(--bo-top-alto); padding: 0 18px; border-bottom: 1px solid var(--border);
}
.bo-marca__sigla {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px;
  background: var(--accent); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; letter-spacing: -.02em;
}
.bo-marca__nombre {
  font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bo-marca__sub { font-size: 11px; font-weight: 500; color: var(--fg-muted); letter-spacing: .02em; }
/* Acento detrás del logo horizontal: un logo blanco/claro sobre el sidebar claro sería
   invisible (mismo caso que el header de la PWA). El ícono (.bo-marca__sigla) ya lo tiene. */
.bo-marca__logo {
  max-width: 100%; max-height: 40px; object-fit: contain;
  background: var(--accent); border-radius: 10px; padding: 6px 10px;
}

.bo-nav { flex: 1 1 auto; overflow-y: auto; padding: 12px 12px 20px; }
/* `.bo-nav .bo-nav__grupo` (dos clases) a propósito: el header ahora es un <button>, y
   ".bo button" (el botón primario, fondo sólido de acento) tiene más especificidad que una sola
   clase — sin este refuerzo, el fondo/color/sombra del botón primario le ganaban a todo lo de
   acá abajo aunque estuviera declarado después. */
.bo-nav .bo-nav__grupo {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  font: inherit; font-size: 14px; font-weight: 600; letter-spacing: .01em;
  padding: 9px 12px; margin-bottom: 2px; border-radius: var(--rad);
  border: 0; box-shadow: none; cursor: pointer;
  color: var(--fg-muted);
  /* Notoriamente más oscuro que el fondo del ítem seleccionado (--accent-soft, 12% de acento):
     el header tiene que leerse como contenedor propio, no confundirse con "is-activo". */
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}
.bo-nav .bo-nav__grupo:hover {
  color: var(--fg); background: color-mix(in srgb, var(--accent) 40%, var(--surface));
}
.bo-nav .bo-nav__grupo svg {
  flex: 0 0 auto; transform: rotate(-90deg); transition: transform .2s var(--ease);
}
.bo-nav__grupo-wrap.is-abierto .bo-nav__grupo svg { transform: rotate(0deg); }

/* Colapso sin animar height/margin (#105): el track de grid pasa de 0fr a 1fr, así el propio
   layout de grid resuelve la altura sin que la anime literalmente ninguna propiedad de layout.
   visibility (no sólo opacity) saca los links del grupo cerrado del tab order y del árbol de
   accesibilidad — sin esto, un lector de pantalla o un tab de teclado llega a links que
   aria-expanded="false" dice que están ocultos. El delay hace que visibility cambie recién
   cuando termina la transición de abrir (o de entrada, al cerrar). */
.bo-nav__items-outer {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s var(--ease);
}
.bo-nav__grupo-wrap.is-abierto .bo-nav__items-outer { grid-template-rows: 1fr; }
.bo-nav__items-inner {
  overflow: hidden; min-height: 0; opacity: 0; visibility: hidden;
  transition: opacity .15s var(--ease), visibility 0s linear .2s;
}
.bo-nav__grupo-wrap.is-abierto .bo-nav__items-inner {
  opacity: 1; visibility: visible; transition: opacity .15s var(--ease) .05s, visibility 0s;
}
.bo-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px; border-radius: var(--rad);
  font-size: 13px; font-weight: 500; color: var(--fg-muted);
}
.bo-nav a:hover { background: var(--surface-3); color: var(--fg); }
.bo-nav a.is-activo {
  font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.bo-nav svg { flex: 0 0 18px; }

.bo-sidebar__pie {
  padding: 12px 16px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--fg-muted);
}

.bo-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

.bo-topbar {
  flex: 0 0 auto; min-height: var(--bo-top-alto);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.bo-topbar__titulo { font-size: 16px; font-weight: 600; color: var(--fg); line-height: 1.2; margin: 0; }
.bo-topbar__sub { font-size: 12px; color: var(--fg-muted); margin: 2px 0 0; }
.bo-topbar__derecha { display: flex; align-items: center; gap: 14px; }
.bo-usuario { display: flex; align-items: center; gap: 10px; }
.bo-usuario__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-3); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12.5px;
}
.bo-usuario__nombre { font-size: 13px; font-weight: 600; color: var(--fg); line-height: 1.2; }
.bo-usuario__rol { font-size: 11px; color: var(--fg-muted); }

/* Hamburguesa + backdrop del cajón mobile: ocultos en desktop, se activan en el @media 860. */
.bo .bo-menu-btn {
  display: none; flex: 0 0 auto; width: 40px; height: 40px; margin-left: -6px;
  align-items: center; justify-content: center;
  border: 0; background: none; box-shadow: none; color: var(--fg-muted); border-radius: var(--rad); cursor: pointer;
}
/* El SVG es flex-item del botón: sin fijar el shrink, el flex lo aplasta a ~4px de ancho (se veía como una rayita). */
.bo .bo-menu-btn svg { flex: 0 0 auto; }
.bo .bo-menu-btn:hover { background: var(--surface-3); color: var(--fg); }
.bo-topbar__titulo-wrap { min-width: 0; flex: 1 1 auto; }
.bo-topbar__derecha { flex: 0 0 auto; }
.bo-backdrop { display: none; }

.bo-contenido { flex: 1 1 auto; overflow-y: auto; padding: 26px 28px 34px; }

/* Sub-navegación por tabs de la sección (#35): destino colapsado detrás de tabs dentro de la
   página. Se dibuja sólo con ≥2 tabs visibles para el rol. */
/* Pegajosa arriba del contenido (#71): al scrollear una página larga la subnav queda fija bajo
   el topbar. `background` opaco (= fondo del contenido) para que el contenido pase por debajo sin
   transparentarse; `top: 0` la pina en el borde superior del área scrolleable (.bo-contenido).
   `box-shadow` sólido hacia arriba: `.bo-contenido` tiene padding-top, así que al pinarse queda una
   franja entre el topbar y la subnav donde el contenido se filtraba por encima; el shadow (mismo
   fondo, sin blur) la tapa sin mover el layout. */
.bo-subnav {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  box-shadow: 0 -30px 0 var(--bg);
  display: flex; flex-wrap: wrap; gap: 2px;
  margin: 0 0 24px; padding-top: 4px; border-bottom: 1px solid var(--border);
}
.bo-subnav a {
  padding: 9px 15px; margin-bottom: -1px;
  font-size: 13px; font-weight: 500; color: var(--fg-muted);
  border-bottom: 2px solid transparent;
}
.bo-subnav a:hover { color: var(--fg); }
.bo-subnav a.is-activo { color: var(--accent-ink); font-weight: 600; border-bottom-color: var(--accent); }

.bo-seccion {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--fg-muted); margin: 0 0 12px;
}
.bo-contenido h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 18px; }
.bo-contenido h2 { font-size: 16px; font-weight: 600; margin: 28px 0 12px; }
.bo-contenido h3 { font-size: 14px; font-weight: 600; margin: 20px 0 10px; }

/* ============================ BOTONES ============================ */

.bo button, .bo input[type="submit"], .bo .btn {
  padding: 9px 18px; border-radius: var(--rad);
  border: 1px solid transparent; background: var(--accent); color: var(--accent-fg);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.bo button:hover, .bo input[type="submit"]:hover, .bo .btn:hover { background: var(--accent-press); color: var(--accent-fg); }

.bo .btn--secundario, .bo button.btn--secundario {
  background: var(--surface); color: var(--fg); border-color: var(--border-strong); box-shadow: none;
}
.bo .btn--secundario:hover { background: var(--surface-3); color: var(--fg); }

.bo .btn--destructivo, .bo button.btn--destructivo {
  background: var(--danger); color: #fff; border-color: transparent;
}
.bo .btn--destructivo:hover { background: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; }

.bo .btn--terciario {
  padding: 7px 14px; font-size: 13px;
  background: transparent; color: var(--fg-muted); border-color: var(--border-strong); box-shadow: none;
}
.bo .btn--terciario:hover { background: var(--surface-3); color: var(--fg); }

/* Red de seguridad (#77): un <a> con un modificador btn--* pero SIN la base .btn igual recibe la
   ESTRUCTURA del botón (padding/tipografía/radio/borde), sin tocar el relleno/color/sombra que
   ya trae el modificador (.btn--secundario/etc.) — así un link con sólo el modificador no queda
   sin estilo. No incluye background/color/border-color a propósito: pisarían al modificador por
   especificidad (el `a` sube la especificidad sobre `.btn--x`). */
.bo a[class*="btn--"]:not(.btn) {
  padding: 9px 18px; border-radius: var(--rad);
  border-width: 1px; border-style: solid;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}

.bo button:disabled, .bo input[type="submit"]:disabled { opacity: .45; cursor: not-allowed; }
.bo button:disabled:hover { background: var(--accent); }

/* Acciones por fila: quietas por defecto (el acento se reserva para la acción clave de la
   pantalla, en el encabezado). Sólo botones/links "pelados" — los modificadores
   (--secundario, --peligro, --destructivo, --con-icono) conservan su estilo. */
.bo .tabla button, .bo .tabla .btn,
.bo td button:not([class*="--"]), .bo td .btn:not([class*="--"]) {
  padding: 6px 12px; border-radius: var(--rad); font-size: 12.5px; font-weight: 600;
  background: none; color: var(--fg-muted); border: 1px solid var(--border-strong); box-shadow: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.bo .tabla button:hover, .bo .tabla .btn:hover,
.bo td button:not([class*="--"]):hover, .bo td .btn:not([class*="--"]):hover {
  border-color: var(--accent); color: var(--accent); background: none;
}

/* ============================ FORMULARIOS ============================ */

.bo label { display: block; font-size: 13px; font-weight: 600; color: var(--fg); margin-bottom: 6px; }
.bo input[type="text"], .bo input[type="email"], .bo input[type="password"],
.bo input[type="number"], .bo input[type="date"], .bo input[type="datetime-local"],
.bo input[type="time"], .bo input[type="search"],
.bo input[type="file"], .bo select, .bo textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--rad);
  background: var(--surface); color: var(--fg);
  font-family: inherit; font-size: 14px;
}
.bo input:focus, .bo select:focus, .bo textarea:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
/* Foco de teclado con la marca para links, botones y controles (sobre el default del navegador). */
.bo a:focus-visible, .bo button:focus-visible, .bo [role="button"]:focus-visible,
.bo summary:focus-visible, .bo [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.bo input:disabled, .bo select:disabled, .bo textarea:disabled {
  border-color: var(--border); background: var(--surface-3); color: var(--fg-subtle); cursor: not-allowed;
}
.bo textarea { min-height: 42px; resize: vertical; }
.bo input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* Flecha custom del <select> (la nativa la pinta el navegador pegada al borde y varía entre
   navegadores). Queda igual en todos lados y a 12px del borde, simétrica con el padding izq.
   Sigue siendo <select> nativo: sólo estiliza la cajita cerrada. */
.bo select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='14'%20height='14'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%238b91a0'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M6%209l6%206%206-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.bo input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.bo label > input[type="checkbox"] { margin-right: 9px; vertical-align: middle; }

.bo .campo { margin-bottom: 16px; }
.bo .hint { font-size: 12px; color: var(--fg-muted); margin-top: 6px; }
.bo .campo--error input, .bo .campo--error select, .bo .campo--error textarea { border-color: var(--danger); }
.bo .campo--error .hint { color: var(--danger); }

/* Resumen de errores de validación */
.bo .errores {
  list-style: none; margin: 0 0 18px; padding: 16px 20px;
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--surface));
  border-radius: var(--rad-lg); color: var(--fg); font-size: 13px;
}
.bo .errores li { margin: 4px 0; }
.bo .errores__titulo {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--danger); margin-bottom: 10px;
}
.bo .errores ul { list-style: disc; margin: 0; padding-left: 18px; }
.bo .errores ul li { color: var(--fg); }
.bo .errores strong { font-weight: 600; }

.bo .advertencia { font-size: 12px; color: var(--warning); margin-top: 6px; }

/* ============================ BADGES ============================ */

.bo .badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--fg-muted);
  background: color-mix(in srgb, var(--fg-muted) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--fg-muted) 22%, var(--surface));
}
.bo .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bo .badge--ok      { color: var(--success); background: color-mix(in srgb, var(--success) 13%, var(--surface)); border-color: color-mix(in srgb, var(--success) 26%, var(--surface)); }
.bo .badge--info    { color: var(--info);    background: color-mix(in srgb, var(--info) 12%, var(--surface));    border-color: color-mix(in srgb, var(--info) 26%, var(--surface)); }
.bo .badge--aviso   { color: var(--warning); background: color-mix(in srgb, var(--warning) 13%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 26%, var(--surface)); }
.bo .badge--peligro { color: var(--danger);  background: color-mix(in srgb, var(--danger) 12%, var(--surface));  border-color: color-mix(in srgb, var(--danger) 26%, var(--surface)); }

/* ============================ FLASHES ============================ */

.bo .flash {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--rad-lg); margin-bottom: 18px;
  font-size: 13.5px; font-weight: 600; color: var(--fg);
}
.bo .flash.notice {
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--success) 34%, var(--surface));
}
.bo .flash.alert {
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--surface));
}
.bo .flash svg { flex: 0 0 20px; margin-top: 1px; }
.bo .flash.notice svg { color: var(--success); }
.bo .flash.alert svg { color: var(--danger); }

/* ============================ TABLAS ============================ */

.bo table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--rad-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.bo thead tr { background: var(--surface-2); }
.bo th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fg-muted); padding: 11px 20px; border-bottom: 1px solid var(--border);
}
.bo td { padding: 12px 20px; border-bottom: 1px solid var(--surface-3); color: var(--fg); }
.bo tbody tr:last-child td { border-bottom: 0; }
.bo tbody tr:hover { background: var(--surface-2); }
.bo .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bo .num--pos { color: var(--success); }
.bo .num--neg { color: var(--danger); }

/* Estado vacío */
.bo .vacio {
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--rad-lg);
  padding: 44px 24px; text-align: center;
}
.bo .vacio__titulo { font-size: 15px; font-weight: 600; color: var(--fg); margin-bottom: 5px; }
.bo .vacio p { font-size: 13px; color: var(--fg-muted); max-width: 340px; margin: 0 auto 16px; }

/* ============================ TARJETAS / STAT TILES ============================ */

.bo .tarjetas {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.bo .tarjeta {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg);
  box-shadow: var(--shadow-sm); padding: 18px;
}
.bo .tarjeta__label {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-muted);
}
.bo .tarjeta .valor {
  font-size: 30px; font-weight: 700; color: var(--fg); margin-top: 8px;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.bo .tarjeta .valor small { font-size: 15px; font-weight: 600; color: var(--fg-muted); margin-left: 5px; }
.bo .tarjeta span, .bo .tarjeta__sub { font-size: 12px; color: var(--fg-muted); margin-top: 6px; display: block; }

/* Modificador BEM (no `.aviso` a secas: esa clase es el callout `.bo .aviso`, que es
   display:flex y le rompía el layout a la tile). */
.bo .tarjeta--aviso {
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--warning) 38%, var(--surface));
}
.bo .tarjeta--aviso .tarjeta__label, .bo .tarjeta--aviso .valor { color: var(--warning); }
.bo .tarjeta__pill {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, var(--surface));
  padding: 3px 7px; border-radius: 999px;
}
.bo .tarjeta__encabezado { display: flex; align-items: center; justify-content: space-between; }

/* Barra de progreso (adopción) */
.bo .barra { height: 6px; border-radius: 999px; background: var(--surface-3); margin-top: 12px; overflow: hidden; }
.bo .barra > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* ============================ ACCESOS RÁPIDOS ============================ */

.bo .accesos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.bo .acceso {
  display: flex; align-items: center; gap: 13px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg);
  box-shadow: var(--shadow-sm); color: var(--fg);
}
.bo .acceso:hover { border-color: var(--accent); box-shadow: var(--shadow-md); color: var(--fg); }
.bo .acceso__icono {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.bo .acceso__titulo { font-size: 14px; font-weight: 600; color: var(--fg); }
.bo .acceso__sub { font-size: 12px; color: var(--fg-muted); }

/* ============================ PANEL / FICHA ============================ */

.bo .panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg);
  box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 16px;
}
.bo dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
.bo dt { color: var(--fg-muted); font-size: 13px; }
.bo dd { margin: 0; color: var(--fg); }

/* ============================ ENCABEZADO DE PÁGINA ============================ */

.bo-encabezado {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px;
}
.bo-encabezado h1 { margin: 0 0 3px; }
.bo-encabezado__sub { font-size: 13px; color: var(--fg-muted); }
.bo-encabezado__acciones { display: flex; align-items: center; gap: 10px; }
.bo-encabezado__acciones form { margin: 0; }
.bo .btn--con-icono { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; }

/* ============================ FILTROS ============================ */

.bo-filtros { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bo-filtros form { display: contents; }
.bo-buscador { position: relative; flex: 1 1 320px; max-width: 400px; }
.bo-buscador svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-subtle); }
/* El `.bo` extra sube la especificidad a (0,0,2,1) para ganarle a la regla base
   `.bo input[type="text"]` (mismo peso, definida antes), cuyo `padding` shorthand si no
   pisa este padding-left y la lupa (left: 12px) queda encimada con el texto. */
.bo .bo-buscador input { padding-left: 36px; }
.bo-filtros__conteo { margin-left: auto; font-size: 13px; color: var(--fg-muted); }

/* ============================ CELDAS ============================ */

.celda-socio { display: flex; align-items: center; gap: 11px; }
.celda-socio__avatar {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  background: var(--surface-3); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11.5px;
}
.celda-socio__nombre { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.celda-socio__email { font-size: 12px; color: var(--fg-muted); }
.bo .mono { font-family: var(--mono); font-size: 13px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.bo .sub-celda { display: block; font-size: 11.5px; color: var(--fg-muted); margin-top: 3px; }
/* En un título el mismo span es un contador al lado, no un subtexto en bloque (si no, queda huérfano abajo). */
.bo h2 .sub-celda { display: inline; margin-top: 0; font-size: 13px; font-weight: 500; }

/* ============================ PAGINACIÓN ============================ */

.bo-paginacion {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; flex-wrap: wrap;
}
.bo-paginacion__resumen { font-size: 13px; color: var(--fg-muted); }
.bo-paginacion__resumen strong { color: var(--fg); font-weight: 600; }
.bo-paginacion__paginas { display: flex; align-items: center; gap: 6px; }
.bo-paginacion__paginas a, .bo-paginacion__paginas span {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--rad);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.bo-paginacion__paginas a:hover { background: var(--surface-3); color: var(--fg); }
.bo-paginacion__paginas .is-actual {
  background: var(--accent); color: var(--accent-fg); border-color: transparent;
}
.bo-paginacion__paginas .is-inerte { border: 0; background: none; color: var(--fg-muted); font-weight: 400; }

/* Estado vacío grande (centrado en el área de contenido) */
.vacio__icono {
  width: 56px; height: 56px; border-radius: 14px; background: var(--surface-3);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; color: var(--fg-subtle);
}
.vacio__titulo--grande { font-size: 17px; font-weight: 700; }
.vacio__acciones { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.vacio__acciones form { margin: 0; }

/* ============================ FICHA (detalle) ============================ */

.bo-migas { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bo-migas a { color: var(--fg-muted); font-weight: 500; }
.bo-migas a:hover { color: var(--fg); }
.bo-migas span { color: var(--fg-muted); }
.bo-migas strong { color: var(--fg); font-weight: 600; }

.ficha-cabecera {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.ficha-cabecera__identidad { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ficha-cabecera__avatar {
  width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%;
  background: var(--surface-3); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 19px;
}
.ficha-cabecera h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 8px; }
.ficha-cabecera__badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ficha-cabecera__acciones { display: flex; align-items: center; gap: 10px; }
.ficha-cabecera__acciones form { margin: 0; }

.bo .btn--peligro-suave {
  background: var(--surface); color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--surface)); box-shadow: none;
}
.bo .btn--peligro-suave:hover { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); }

.ficha-columnas { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
@media (max-width: 1040px) { .ficha-columnas { grid-template-columns: 1fr; } }

.panel__titulo {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--fg);
}
.panel--plano { padding: 0; }

.datos { margin: 0; padding: 8px 22px; display: block; }
.datos > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--surface-3);
}
.datos > div:last-child { border-bottom: 0; }
.datos dt { font-size: 13px; color: var(--fg-muted); }
.datos dd {
  margin: 0; min-width: 0; overflow-wrap: anywhere; text-align: right;
  font-size: 13.5px; color: var(--fg);
}

.saldo__label {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-muted);
}
.saldo__valor {
  font-size: 42px; font-weight: 700; color: var(--fg); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 6px;
}
.saldo__valor small { font-size: 18px; font-weight: 600; color: var(--fg-muted); margin-left: 6px; }
.saldo__detalle {
  display: flex; gap: 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--surface-3);
}
.saldo__detalle dt { font-size: 11px; color: var(--fg-muted); margin-bottom: 3px; }
.saldo__detalle dd { margin: 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.saldo__retenido { color: var(--warning); }

.ajuste__hint { font-size: 12px; color: var(--fg-muted); margin: 4px 0 16px; }
.ajuste__aviso {
  display: none; align-items: center; gap: 6px;
  font-size: 12px; color: var(--danger); margin-top: 7px;
}
.ajuste__aviso.is-visible { display: flex; }
.ajuste input[type="number"] { font-family: var(--mono); }
.ajuste__enviar { width: 100%; }
.ajuste__enviar.is-retiro {
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
  color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--surface));
}
.ajuste__enviar.is-retiro:hover { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); }
.ajuste .obligatorio { color: var(--danger); font-weight: 500; }

/* ============================ DIÁLOGO ============================ */

.bo dialog {
  width: 100%; max-width: 420px; padding: 24px;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--rad-lg); box-shadow: var(--shadow-lg);
}
.bo dialog::backdrop { background: color-mix(in srgb, #0f172a 55%, transparent); }
.dialogo__cuerpo { display: flex; gap: 14px; }
.dialogo__icono {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  background: color-mix(in srgb, var(--danger) 13%, var(--surface)); color: var(--danger);
  display: flex; align-items: center; justify-content: center;
}
.dialogo__titulo { font-size: 16px; font-weight: 600; color: var(--fg); }
.dialogo__texto { font-size: 13.5px; color: var(--fg-muted); line-height: 1.55; margin-top: 6px; }
.dialogo__texto strong { color: var(--fg); font-weight: 600; }
.dialogo__acciones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.dialogo__acciones form { margin: 0; }


/* Selector de tema, en la barra superior */
.bo .bo-tema { display: flex; gap: 2px; padding: 3px; border-radius: var(--rad); background: var(--surface-3); }
.bo .bo-tema__opcion { margin: 0; }
.bo .bo-tema button {
  display: flex; align-items: center; justify-content: center; padding: 6px 9px;
  border: 0; border-radius: 6px; background: transparent; color: var(--fg-subtle); cursor: pointer;
}
.bo .bo-tema button:hover { color: var(--fg); }
.bo .bo-tema button.is-actual { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }

/* ============================ AVISOS (callouts) ============================ */

.bo .aviso {
  display: flex; gap: 11px; padding: 13px 15px; border-radius: var(--rad-lg);
  font-size: 13px; line-height: 1.55; color: var(--fg-muted); margin-bottom: 18px;
  background: color-mix(in srgb, var(--info) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--info) 28%, var(--surface));
}
.bo .aviso > svg { flex: 0 0 18px; margin-top: 1px; color: var(--info); }
.bo .aviso strong { color: var(--fg); font-weight: 600; }
.bo .aviso__cuerpo { flex: 1; min-width: 0; }
.bo .aviso__titulo { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.bo .aviso__titulo + p { margin: 2px 0 0; }
.bo .aviso p { margin: 0; }
.bo .aviso a { font-size: 12.5px; font-weight: 600; white-space: nowrap; align-self: center; }

.bo .aviso--alerta {
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--warning) 34%, var(--surface));
}
.bo .aviso--alerta > svg { color: var(--warning); }

/* ============================ SUBIDA DE ARCHIVO ============================ */

.bo .dropzone {
  position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--rad-lg);
  background: var(--surface-2); padding: 26px; text-align: center; margin-bottom: 20px;
}
/* El input cubre la zona: el click y el drop nativos funcionan sin JS. */
.bo .dropzone input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.bo .dropzone:hover, .bo .dropzone:focus-within {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
}
.bo .dropzone__icono {
  width: 44px; height: 44px; border-radius: 11px; background: var(--surface-3); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.bo .dropzone__texto { font-size: 13.5px; color: var(--fg-muted); margin-bottom: 12px; }
.bo .dropzone__falso {
  display: inline-block; padding: 8px 16px; border-radius: var(--rad); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--fg); font-size: 13px; font-weight: 600;
}
.bo .dropzone__nombre { font-family: var(--mono); font-size: 12.5px; color: var(--fg); margin-top: 12px; }

/* Fila de vinculación manual dentro de una tabla */
.bo .fila-vincular { display: flex; align-items: center; gap: 8px; max-width: 380px; }
.bo .fila-vincular input[type="text"] { padding: 7px 10px; font-size: 13px; }
.bo .fila-vincular button { white-space: nowrap; }

/* ============================ PIE DE ACCIONES ============================ */

.bo .pie-acciones {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border);
}
.bo .pie-acciones__nota { font-size: 13px; color: var(--fg-muted); }
.bo .pie-acciones__nota strong { color: var(--fg); font-weight: 600; }
.bo .pie-acciones__botones { display: flex; align-items: center; gap: 10px; }
.bo .pie-acciones__opcion { flex-basis: 100%; display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ============================ PROCESANDO ============================ */

.bo .procesando { text-align: center; max-width: 380px; margin: 64px auto; }
.bo .procesando__rueda {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 18px;
  border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: girar .8s linear infinite;
}
.bo .procesando__titulo { font-size: 17px; font-weight: 600; color: var(--fg); margin-bottom: 6px; }
.bo .procesando p { font-size: 13.5px; line-height: 1.55; color: var(--fg-muted); margin: 0; }
.bo .procesando__archivo { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); margin-top: 14px; }
@keyframes girar { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .bo .procesando__rueda { animation-duration: 3s; }
}

/* ============================ REJILLAS DE CAMPOS ============================ */

.bo .grilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bo .campo__hint {
  display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--fg-muted); margin-top: 7px;
}
.bo .campo__hint svg { flex: 0 0 auto; margin-top: 1px; }
.bo .panel--angosto { max-width: 680px; }

@media (max-width: 720px) {
  .bo .grilla-2 { grid-template-columns: 1fr; }
}

/* ============================ MOSTRADOR (kiosco) ============================ */

/* Pantalla dedicada, sin shell: se deja puesta en una pantalla PÚBLICA del mostrador, así que
   va SIEMPRE oscura (committed-dark, no theme-aware) — se ve como un display dedicado. El acento
   sigue siendo el color del gimnasio (--accent); el QR va siempre sobre blanco para el lector. */
.bo .mostrador {
  min-height: 100vh; background: #0d0f13; color: #f4f6fb; color-scheme: dark;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 40px 24px; text-align: center;
}
.bo .mostrador__marca { display: flex; align-items: center; gap: 10px; }
.bo .mostrador__sigla {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.bo .mostrador__gimnasio { font-size: 15px; font-weight: 600; color: #9aa3b2; }
.bo .mostrador__logo { max-width: 300px; max-height: 76px; object-fit: contain; }
.bo .mostrador__sede {
  font-size: clamp(28px, 4.4vw, 44px); font-weight: 700; letter-spacing: -.02em;
  color: #f4f6fb; margin: 0 0 8px;
}

.bo .mostrador__qr {
  background: #ffffff; border-radius: 20px; padding: 22px; margin: 0 auto;
  width: min(42vh, 380px); box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.bo .mostrador__qr svg { display: block; width: 100%; height: auto; }
.bo .mostrador__cargando {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  color: #9aa3b2; font-size: 14px;
}

.bo .mostrador__codigo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 20px; }
.bo .mostrador__codigo-valor {
  font-family: var(--mono); font-size: clamp(28px, 5vw, 44px); font-weight: 700;
  letter-spacing: .06em; color: #f4f6fb; font-variant-numeric: tabular-nums;
}
.bo .mostrador__codigo-valor:empty::before { content: "…"; color: #9aa3b2; }
.bo .mostrador__codigo-ayuda { font-size: 14px; color: #9aa3b2; }

.bo .mostrador__instruccion {
  font-size: clamp(19px, 2.6vw, 26px); font-weight: 600; color: #f4f6fb;
  max-width: 560px; margin: 30px auto 0; text-wrap: balance;
}

.bo .mostrador__pie { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 34px; }
.bo .mostrador__renovacion {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #9aa3b2;
}
.bo .mostrador__punto {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: latir 2s ease-in-out infinite;
}
.bo .mostrador__progreso {
  width: 200px; height: 3px; border-radius: 999px; background: #242a33; overflow: hidden;
}
.bo .mostrador__progreso > span {
  display: block; height: 100%; background: var(--accent); transform-origin: left;
  animation: agotar var(--ciclo, 15s) linear;
}
@keyframes agotar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes latir { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
  .bo .mostrador__punto { animation: none; }
  .bo .mostrador__progreso > span { animation: none; transform: scaleX(1); }
}

/* ============================ VALIDAR COMPROBANTE ============================ */

/* Pantalla de mostrador: columna angosta, objetivos grandes, se opera de pie. */
.bo .validar { max-width: 420px; margin: 0 auto; }

.bo .visor {
  position: relative; aspect-ratio: 1; border-radius: var(--rad-lg); overflow: hidden;
  background: repeating-linear-gradient(135deg, #0f172a, #0f172a 12px, #131f37 12px, #131f37 24px);
  display: flex; align-items: center; justify-content: center;
}
.bo .visor video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bo .visor__linea {
  position: absolute; left: 8%; right: 8%; height: 2px; background: var(--accent);
  box-shadow: 0 0 12px var(--accent); animation: barrer 2.6s ease-in-out infinite;
}
.bo .visor__esquina { position: absolute; width: 34px; height: 34px; }
.bo .visor__esquina--si { left: 8%; top: 14%; border-left: 3px solid #fff; border-top: 3px solid #fff; border-top-left-radius: 6px; }
.bo .visor__esquina--sd { right: 8%; top: 14%; border-right: 3px solid #fff; border-top: 3px solid #fff; border-top-right-radius: 6px; }
.bo .visor__esquina--ii { left: 8%; bottom: 14%; border-left: 3px solid #fff; border-bottom: 3px solid #fff; border-bottom-left-radius: 6px; }
.bo .visor__esquina--id { right: 8%; bottom: 14%; border-right: 3px solid #fff; border-bottom: 3px solid #fff; border-bottom-right-radius: 6px; }
.bo .visor__pista {
  position: relative; font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .75);
  background: rgba(0, 0, 0, .35); padding: 5px 10px; border-radius: 999px;
}
@keyframes barrer { 0% { top: 14%; } 50% { top: 82%; } 100% { top: 14%; } }
@media (prefers-reduced-motion: reduce) { .bo .visor__linea { animation: none; top: 48%; } }

.bo .separador { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; }
.bo .separador::before, .bo .separador::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.bo .separador span { font-size: 12px; font-weight: 600; color: var(--fg-muted); }

.bo input.codigo {
  height: 56px; padding: 0 16px; font-family: var(--mono); font-size: 22px; font-weight: 600;
  letter-spacing: .12em; text-align: center; text-transform: uppercase;
}
.bo .btn--grande { width: 100%; height: 56px; justify-content: center; font-size: 17px; }
.bo .btn--gigante { width: 100%; height: 58px; justify-content: center; font-size: 18px; font-weight: 700; }

/* Tarjeta del comprobante */
.bo .comprobante {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.bo .comprobante__premio {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--surface-3);
}
.bo .comprobante__icono {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  display: flex; align-items: center; justify-content: center;
}
.bo .comprobante__rotulo {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-muted);
}
.bo .comprobante__nombre { font-size: 17px; font-weight: 600; color: var(--fg); margin-top: 2px; }

.bo .comprobante__socio {
  padding: 20px; text-align: center; border-bottom: 1px solid var(--surface-3);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.bo .comprobante__persona {
  font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--fg); line-height: 1.1; margin-top: 8px;
}
.bo .comprobante__documento { font-family: var(--mono); font-size: 13px; color: var(--fg-muted); margin-top: 6px; }

.bo .comprobante__cifras { display: flex; }
.bo .comprobante__cifra { flex: 1; padding: 16px 20px; }
.bo .comprobante__cifra + .comprobante__cifra { border-left: 1px solid var(--surface-3); }
.bo .comprobante__cifra .valor { font-size: 20px; font-weight: 700; color: var(--fg); margin-top: 4px; font-variant-numeric: tabular-nums; }
.bo .comprobante__cifra .valor small { font-size: 13px; font-weight: 600; color: var(--fg-muted); margin-left: 4px; }
.bo .comprobante__cifra .fecha { font-size: 15px; font-weight: 600; color: var(--fg); margin-top: 6px; }

.bo .comprobante__sello { padding: 20px; text-align: center; border-bottom: 1px solid var(--surface-3); }
.bo .comprobante__tilde {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px; color: var(--success);
  background: color-mix(in srgb, var(--success) 13%, var(--surface));
  display: flex; align-items: center; justify-content: center;
}
.bo .comprobante dl { display: block; margin: 0; padding: 6px 20px; }
.bo .comprobante dl > div {
  display: flex; justify-content: space-between; gap: 16px; padding: 11px 0;
  border-bottom: 1px solid var(--surface-3);
}
.bo .comprobante dl > div:last-child { border-bottom: 0; }
.bo .comprobante dd { font-size: 13.5px; font-weight: 600; }

.bo .validar__estado { display: flex; justify-content: center; margin-top: 14px; }
.bo .validar__acciones { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }

/* Anular un comprobante desde el mostrador: sección plegable, acción sensible */
.bo .anular { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.bo .anular summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--danger); }
.bo .anular summary::-webkit-details-marker { display: none; }
.bo .anular .hint { margin: 10px 0 12px; }
.bo .anular__form { display: flex; gap: 8px; align-items: center; }
.bo .anular__form input { flex: 1; }

/* Encabezado en negrita dentro de un panel con padding (≠ panel__titulo, que es barra con borde) */
.bo .panel__encabezado { font-size: 14px; font-weight: 600; color: var(--fg); }

/* ============================ PASOS Y OPCIONES ============================ */


/* Tarjetas de opción (radio grande). El estado marcado sale del propio radio. */
.bo .opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 26px; }
.bo .opcion {
  position: relative; display: block; padding: 16px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--rad-lg); background: var(--surface);
}
.bo .opcion:hover { border-color: var(--accent); }
.bo .opcion input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.bo .opcion:has(input:checked) {
  border: 2px solid var(--accent); padding: 15px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.bo .opcion:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.bo .opcion__tilde {
  position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center;
}
.bo .opcion:has(input:checked) .opcion__tilde { display: flex; }
.bo .opcion__icono {
  width: 38px; height: 38px; border-radius: 10px; margin-bottom: 10px;
  background: var(--surface-3); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center;
}
.bo .opcion:has(input:checked) .opcion__icono {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent);
}
.bo .opcion__nombre { font-size: 14px; font-weight: 600; color: var(--fg); }
.bo .opcion__detalle { font-size: 12.5px; color: var(--fg-muted); margin-top: 3px; line-height: 1.45; }

.bo .opcion--bloqueada {
  border: 1px dashed var(--border-strong); background: var(--surface-2); cursor: not-allowed;
}
.bo .opcion--bloqueada:hover { border-color: var(--border-strong); }
.bo .opcion--bloqueada .opcion__nombre { color: var(--fg-muted); }
.bo .opcion__candado { position: absolute; top: 14px; right: 14px; color: var(--fg-subtle); }
.bo .opcion__motivo {
  font-size: 12px; color: var(--fg-muted); margin-top: 6px; line-height: 1.45;
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--surface));
  border-radius: 8px; padding: 8px 10px;
}

/* Pastillas de audiencia (radio en línea) */
.bo .pastillas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bo .pastilla {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--rad);
  font-size: 13.5px; font-weight: 400; color: var(--fg); margin-bottom: 0;
}
.bo .pastilla:hover { border-color: var(--accent); }
.bo .pastilla input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.bo .pastilla__marca {
  width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 2px solid var(--border-strong);
}
.bo .pastilla:has(input:checked) {
  border: 2px solid var(--accent); padding: 11px 13px; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.bo .pastilla:has(input:checked) .pastilla__marca { border: 5px solid var(--accent); }

/* Selector de modo de destinatarios (elegidos a mano / por filtros): tarjetas que se pintan.
   Compartido por Mensajes e Impulsos (partial backoffice/shared/_selector_modo). */
.bo .selector-modo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 560px; }
.bo .selector-modo__opcion {
  position: relative; display: flex; align-items: center; gap: 11px; cursor: pointer; padding: 10px 13px;
  border: 1.5px solid var(--border-strong); border-radius: var(--rad-md); background: var(--surface);
  transition: border-color .12s var(--ease), background-color .12s var(--ease);
}
.bo .selector-modo__opcion:hover { border-color: var(--accent); }
.bo .selector-modo__opcion input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.bo .selector-modo__emoji { flex: none; font-size: 19px; line-height: 1; }
.bo .selector-modo__nombre { display: block; font-size: 13.5px; font-weight: 600; color: var(--fg); }
.bo .selector-modo__sub { display: block; font-size: 12px; color: var(--fg-muted); margin-top: 1px; }
.bo .selector-modo__opcion:has(input:checked) {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.bo .selector-modo__opcion:has(input:checked) .selector-modo__nombre { color: var(--accent); }
/* Foco de teclado (los radios están visualmente ocultos): resaltar la tarjeta activa. */
.bo .selector-modo__opcion:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sección de un formulario largo */
.bo .bloque {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg);
  box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 16px;
}
.bo .bloque__titulo { font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.bo .bloque__sub { font-size: 12.5px; color: var(--fg-muted); margin-bottom: 18px; }
.bo .bloque__sub strong { color: var(--fg); font-weight: 600; }
.bo .bloque__extra { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--surface-3); }

.bo .grilla-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.bo .campo--angosto { max-width: 300px; }

/* Constructor de audiencia (mensajes/new): conteo grande + filtros como filas removibles. */
.bo .audiencia__cuenta { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.bo .audiencia__n { font-family: var(--mono, "IBM Plex Mono", ui-monospace, monospace); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; }
.bo .audiencia__lbl { font-size: 14px; color: var(--fg-muted); }
.bo .audiencia__nota { font-size: 12.5px; color: var(--fg-muted); margin: 3px 0 16px; }
.bo .audiencia__filtros { display: flex; flex-direction: column; gap: 10px; }
.bo .filtro { border: 1px solid var(--surface-3); border-radius: var(--rad); padding: 11px 13px; background: var(--surface); }
.bo .filtro__cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.bo .filtro__nombre { font-size: 13px; font-weight: 600; color: var(--fg); }
.bo .filtro__quitar { width: 24px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; box-shadow: none; color: var(--fg-subtle); font-size: 19px; line-height: 1; border-radius: 6px; cursor: pointer; }
.bo .filtro__quitar:hover { background: var(--surface-3); color: var(--danger); }
.bo .filtro__cuerpo { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bo .filtro__cuerpo input[type="number"] { width: 84px; }
.bo .filtro__cuerpo select { width: auto; }
.bo .filtro__unidad { font-size: 13px; color: var(--fg-muted); }
.bo .filtro__hint { font-size: 12px; color: var(--fg-muted); margin: 8px 0 0; }
.bo .filtro__hint:empty { display: none; }
.bo .pastillas--chip { display: flex; flex-wrap: wrap; gap: 8px; grid-template-columns: none; }
.bo .pastillas--chip .pastilla { width: auto; padding: 6px 12px; border-radius: 999px; justify-content: flex-start; }
.bo .pastillas--chip .pastilla input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.bo .pastillas--chip .pastilla:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.bo .audiencia__agregar { margin-top: 12px; }
.bo .audiencia__agregar select { width: auto; }
.bo .campo--sufijo { position: relative; }
.bo .campo--sufijo input { padding-right: 42px; }
.bo .campo--sufijo .sufijo {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--fg-muted); pointer-events: none;
}
.bo .campo__error { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--danger); margin-top: 6px; }

@media (max-width: 900px) {
  .bo .grilla-3 { grid-template-columns: 1fr; }
  .bo .opciones, .bo .pastillas { grid-template-columns: 1fr; }
}

/* ============================ TARJETA CON SECCIONES ============================ */

.bo .seccion {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 16px;
}
.bo .seccion__cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
}
.bo .seccion__nombre { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--fg); }
.bo .seccion__meta { font-size: 12.5px; color: var(--fg-muted); }
.bo .seccion__sub { font-size: 12.5px; color: var(--fg-muted); margin-top: 2px; }
.bo .seccion__cuerpo { padding: 22px; }
.bo .seccion__pie {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 14px 22px; background: var(--surface-2); border-top: 1px solid var(--border);
}

/* Fila de cifras dentro de una tarjeta */
.bo .resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 22px; }
.bo .resumen > div + div { border-left: 1px solid var(--surface-3); padding-left: 20px; }
.bo .resumen__label {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-muted);
}
.bo .resumen__valor {
  font-size: 28px; font-weight: 700; color: var(--fg); margin-top: 6px;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.bo .resumen__valor small { font-size: 14px; font-weight: 600; color: var(--fg-muted); margin-left: 4px; }

/* Simulador: se distingue del resto porque no guarda nada */
.bo .seccion--simulador { border: 1.5px solid color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.bo .seccion--simulador .seccion__nombre svg { color: var(--accent); }
.bo .resultado {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-radius: var(--rad-lg); padding: 20px 22px;
}
.bo .resultado__label {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.bo .resultado p { font-size: 18px; line-height: 1.6; color: var(--fg); font-weight: 500; margin: 0; }
.bo .resultado strong { font-weight: 700; }
.bo .resultado .destacado { color: var(--accent); }
.bo .resultado__nota { font-size: 12.5px; color: var(--fg-muted); margin-top: 10px; }

@media (max-width: 900px) {
  .bo .resumen { grid-template-columns: 1fr; }
  .bo .resumen > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--surface-3); padding-top: 16px; }
}

/* ============================ AJUSTES (fila etiqueta + control) ============================ */

.bo .ajuste-fila { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
.bo .ajuste-fila + .ajuste-fila { margin-top: 22px; }
.bo .ajuste-fila__titulo { font-size: 13.5px; font-weight: 600; color: var(--fg); margin-bottom: 0; }
.bo .ajuste-fila__ayuda { font-size: 12.5px; color: var(--fg-muted); margin-top: 3px; line-height: 1.45; }
.bo .ajuste-fila__control { min-width: 0; }
.bo .divisor { height: 1px; background: var(--surface-3); margin: 22px 0; }

/* Campo con unidad al lado ("30 días", "5 por semana") */
.bo .con-unidad { display: flex; align-items: center; gap: 10px; }
.bo .con-unidad input { width: 120px; }
.bo .con-unidad span { font-size: 13px; color: var(--fg-muted); }

/* Interruptor */
.bo .interruptor { display: flex; align-items: center; gap: 12px; }
.bo .interruptor input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 44px; width: 44px; height: 26px; margin: 0;
  border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer;
  transition: background .15s ease;
}
.bo .interruptor input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .15s ease;
}
.bo .interruptor input[type="checkbox"]:checked { background: var(--accent); }
.bo .interruptor input[type="checkbox"]:checked::after { left: 21px; }
.bo .interruptor input[type="checkbox"]:focus-visible {
  outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.bo .interruptor__estado { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.bo .interruptor + .campo__hint { max-width: 440px; margin-top: 10px; }

/* Color: selector + hex + muestras + vista previa */
.bo .color { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bo .color input[type="color"] {
  width: 46px; height: 38px; padding: 2px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--rad); background: var(--surface);
}
.bo .color input[type="text"] { width: 130px; font-family: var(--mono); text-transform: uppercase; }
.bo .muestras { display: flex; gap: 6px; }
.bo .muestra {
  width: 24px; height: 24px; border-radius: 6px; padding: 0; cursor: pointer;
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong);
}
.bo .muestra:hover { box-shadow: 0 0 0 2px var(--fg-subtle); }

.bo .vista-previa {
  border: 1px solid var(--border); border-radius: var(--rad-lg); background: var(--surface-2); padding: 16px;
}
.bo .vista-previa__label {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 12px;
}
.bo .vista-previa__piezas { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bo .vista-previa__barra { flex: 1; min-width: 120px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bo .vista-previa__barra > span { display: block; width: 64%; height: 100%; border-radius: 999px; background: var(--accent); }

/* Archivo de marca: miniatura + botón que tapa el input nativo */
.bo .archivos { display: flex; gap: 24px; flex-wrap: wrap; }
.bo .archivo__rotulo { font-size: 12px; font-weight: 600; color: var(--fg-muted); margin-bottom: 8px; }
.bo .archivo__fila { display: flex; align-items: center; gap: 12px; }
.bo .archivo__vacio {
  width: 150px; height: 56px; border-radius: var(--rad); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10.5px; color: var(--fg-muted);
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 7px, var(--surface-3) 7px, var(--surface-3) 14px);
}
.bo .archivo__logo { max-width: 150px; max-height: 56px; border-radius: var(--rad); }
.bo .archivo__icono {
  width: 56px; height: 56px; border-radius: 13px; object-fit: cover;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px; letter-spacing: -.02em;
}
.bo .archivo__cambiar { position: relative; overflow: hidden; }
.bo .archivo__cambiar input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0;
}
.bo .archivo__nombre { font-family: var(--mono); font-size: 11.5px; color: var(--fg-muted); }

@media (max-width: 780px) {
  .bo .ajuste-fila { grid-template-columns: 1fr; gap: 10px; }
}

/* ============================ REPORTES ============================ */

.bo .rango { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo .rango__presets { display: flex; gap: 2px; background: var(--surface-3); border-radius: var(--rad); padding: 3px; }
.bo .rango__presets a {
  padding: 6px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--fg-muted);
}
.bo .rango__presets a:hover { color: var(--fg); }
.bo .rango__presets a.is-actual { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.bo .rango__fechas { display: flex; align-items: center; gap: 8px; }
.bo .rango__fechas input[type="date"] { width: auto; padding: 8px 10px; font-size: 13px; }
.bo .rango__fechas span { color: var(--fg-muted); font-size: 13px; }

.bo .rotulo-seccion {
  display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--fg);
  margin: 0 0 12px;
}
.bo .rotulo-seccion__pill {
  font-size: 11px; font-weight: 600; color: var(--accent); padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

/* Cifra grande dentro de un panel de reporte */
.bo .cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.bo .cifras > div + div { border-left: 1px solid var(--surface-3); padding-left: 20px; }
.bo .cifra__label {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-muted);
}
.bo .cifra__valor {
  font-size: 32px; font-weight: 700; color: var(--fg); margin-top: 8px;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.bo .cifra__nota { font-size: 12px; color: var(--fg-muted); margin-top: 6px; }
.bo .cifra--aviso .cifra__valor { color: var(--warning); }
.bo .cifra--acento .cifra__label, .bo .cifra--acento .cifra__valor { color: var(--accent); }

/* Progreso con encabezado (adopción) */
.bo .progreso + .progreso { margin-top: 20px; }
.bo .progreso__encabezado {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px;
  font-size: 13px; color: var(--fg-muted);
}
.bo .progreso__encabezado strong { font-weight: 600; color: var(--fg); }
.bo .progreso__valor {
  font-size: 28px; font-weight: 700; color: var(--fg); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin-bottom: 10px;
}
.bo .progreso__valor small { font-size: 15px; font-weight: 600; color: var(--fg-muted); }
.bo .progreso__barra { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bo .progreso__barra > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* Barra partida (activos vs inactivos) */
.bo .partida { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-3); margin-bottom: 12px; }
.bo .partida > span { display: block; }
.bo .partida__a { background: var(--accent); }
.bo .partida__b { background: color-mix(in srgb, var(--fg-subtle) 55%, var(--surface)); }
.bo .leyenda { display: flex; gap: 20px; flex-wrap: wrap; }
.bo .leyenda > div { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--fg-muted); }
.bo .leyenda__punto { width: 9px; height: 9px; border-radius: 2px; }
.bo .leyenda strong { font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; }

/* Ranking horizontal */
.bo .ranking { display: flex; flex-direction: column; gap: 14px; }
.bo .ranking__fila { display: flex; align-items: center; gap: 12px; }
.bo .ranking__nombre { width: 150px; flex: 0 0 150px; font-size: 13px; color: var(--fg); }
.bo .ranking__barra { flex: 1; height: 20px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.bo .ranking__barra > span { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.bo .ranking__total {
  width: 44px; text-align: right; font-size: 13px; font-weight: 700; color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* Lista simple nombre → valor */
.bo .lista-valores > div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--surface-3);
}
.bo .lista-valores > div:last-child { border-bottom: 0; }
.bo .lista-valores__nombre { font-size: 13.5px; color: var(--fg); }
.bo .lista-valores__valor {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums;
}
.bo .lista-valores__valor.is-aviso { color: var(--warning); }
.bo .lista-valores__valor.is-inerte { color: var(--fg-muted); }

.bo .columnas-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bo .columnas-2--ancha-izq { grid-template-columns: 1.3fr 1fr; }

@media (max-width: 900px) {
  .bo .cifras { grid-template-columns: 1fr 1fr; }
  .bo .cifras > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .bo .columnas-2, .bo .columnas-2--ancha-izq { grid-template-columns: 1fr; }
  .bo .ranking__nombre { width: 110px; flex: 0 0 110px; }
}

/* Resolución en dos vías dentro de una celda (aprobar / rechazar con motivo) */
.bo .resolucion { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bo .resolucion > form { margin: 0; }

/* Interruptores del staff: chips que alternan al hacer clic */
.bo .interruptores-celda { display: flex; flex-wrap: wrap; gap: 6px; }
.bo .interruptor-mini { margin: 0; }
.bo .chip {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg-muted);
}
.bo .chip:hover { border-color: var(--accent); color: var(--fg); }
.bo .chip--on {
  color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, var(--surface));
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
}

/* ============================ CATÁLOGO DE PREMIOS ============================ */

/* El catálogo va en grilla y no en tabla: un premio es un objeto con stock, se lee mejor
   como ficha que como fila. */
.bo .catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.bo .premio {
  display: flex; flex-direction: column; gap: 10px; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg);
  box-shadow: var(--shadow-sm);
}
.bo .premio__encabezado { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bo .premio__nombre { font-size: 15px; font-weight: 600; color: var(--fg); }
.bo .premio__descripcion { font-size: 12.5px; color: var(--fg-muted); line-height: 1.45; }
.bo .premio__costo {
  font-size: 24px; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; margin-top: auto;
}
.bo .premio__costo small { font-size: 13px; font-weight: 600; color: var(--fg-muted); margin-left: 4px; }
.bo .premio__pie {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--surface-3);
}
.bo .premio__stock { font-size: 12.5px; color: var(--fg-muted); }
.bo .premio__stock strong { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.bo .premio.is-inactivo { background: var(--surface-2); }
.bo .premio.is-inactivo .premio__nombre, .bo .premio.is-inactivo .premio__costo { color: var(--fg-muted); }

/* ============================ SELECCIÓN DE SOCIOS ============================ */

/* Lista larga y acotada: con 1.100 socios una lista suelta de casillas es inusable. */
.bo .seleccion { border: 1px solid var(--border-strong); border-radius: var(--rad); overflow: hidden; }
.bo .seleccion__barra {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.bo .seleccion__barra input[type="search"] { max-width: 260px; padding: 7px 10px; font-size: 13px; }
.bo .seleccion__conteo { font-size: 12.5px; color: var(--fg-muted); white-space: nowrap; }
.bo .seleccion__conteo strong { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.bo .seleccion__lista { max-height: 300px; overflow-y: auto; }
.bo .seleccion__item {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; margin: 0; cursor: pointer;
  font-size: 13.5px; font-weight: 400; color: var(--fg); border-bottom: 1px solid var(--surface-3);
}
.bo .seleccion__item:last-child { border-bottom: 0; }
.bo .seleccion__item:hover { background: var(--surface-2); }
/* El atributo `hidden` tiene que ganar SIEMPRE, aun sobre un `display` de autor (p. ej. el
   controller `condicional` oculta bloques `.grilla-2 { display: grid }` — sin este !important
   el grid le gana al `[hidden]` del navegador y el campo queda visible). Espejo de `.pwa [hidden]`. */
.bo [hidden] { display: none !important; }

/* Sistema de íconos (#101): un set de formas (32×32, roles .mn/.dt/.bg/.ck), dos modos de render.
   Tokens derivados del acento; viven en .bo (donde el layout inyecta --accent) para que color-mix
   resuelva con ESE color. Mismo contrato que en pwa.css. */
.bo { --ico-deep: color-mix(in srgb, var(--accent) 78%, #0a0714); --ico-lite: color-mix(in srgb, var(--accent) 42%, #ffffff); --ico-ink: #15161d; }
/* En oscuro la superficie es oscura: el bitono se arma al revés que en claro — rellenos hacia el
   BLANCO y contorno CLARO (mismo acento, más claro) en vez de tinta casi negra. Sin esto un acento
   oscuro se fundía con el fondo. Deep saturado (90%) para no lavar los acentos vivos. */
[data-tema="oscuro"] .bo {
  --ico-deep: color-mix(in srgb, var(--accent) 90%, #ffffff);
  --ico-lite: color-mix(in srgb, var(--accent) 50%, #ffffff);
  --ico-ink: color-mix(in srgb, var(--accent) 32%, #ffffff);
}
.ico { display: inline-block; vertical-align: middle; flex: none; }
.ico .bg { fill: var(--surface); }
.ico .ck { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
/* Mono = contorno de una tinta (currentColor): línea, no silueta rellena, para no perder trazos. */
.ico--mono .mn, .ico--mono .dt { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ico--mono .bg { fill: none; }
.ico--mono .ck { stroke: currentColor; }
.ico--bitono .mn { fill: var(--ico-deep); }
.ico--bitono .dt { fill: var(--ico-lite); }
.ico--bitono .mn, .ico--bitono .dt { stroke: var(--ico-ink); stroke-width: 1.3; paint-order: stroke; }
.ico--bitono .ck { stroke: #ffffff; }
.bo .seleccion__doc { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--fg-muted); }
button.seleccion__item { width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--surface-3); font: inherit; }

/* Chips de socios elegidos a mano (buscador_socios_controller): cada chip lleva su propia × */
.bo .buscador-socios__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bo .buscador-socios__chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.bo .buscador-socios__chips .chip button {
  background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1;
  color: inherit; padding: 0;
}

/* ============================ PREVISUALIZACIÓN DE MENSAJE ============================ */

/* Lo que le llega al socio, con la forma que tiene en su bandeja. */
.bo .previa-mensaje {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--rad-lg); padding: 20px;
}
.bo .previa-mensaje__label {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 12px;
}
.bo .previa-mensaje__tarjeta {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg);
  box-shadow: var(--shadow-sm); padding: 16px; max-width: 360px;
}
.bo .previa-mensaje__marca {
  display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  color: var(--fg-muted); margin-bottom: 10px;
}
.bo .previa-mensaje__sigla {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
}
.bo .previa-mensaje__titulo { font-size: 15px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.bo .previa-mensaje__cuerpo { font-size: 13.5px; line-height: 1.5; color: var(--fg-muted); white-space: pre-wrap; }
.bo .previa-mensaje__vacio { color: var(--fg-muted); font-style: italic; }

/* ============================ LOGIN ============================ */

.bo-login {
  min-height: 100vh; padding: 24px;
  display: flex; align-items: center; justify-content: center;
}
.bo-login__caja { width: 100%; max-width: 412px; }
.bo-login__marca {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 26px;
}
.bo-login__sigla {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px;
  background: var(--accent); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; letter-spacing: -.02em;
}
.bo-login__nombre { font-size: 17px; font-weight: 600; color: var(--fg); letter-spacing: -.01em; }
.bo-login__logo {
  max-width: 210px; max-height: 54px; object-fit: contain;
  background: var(--accent); border-radius: 12px; padding: 8px 14px;
}

/* Marca del gimnasio: el ícono subido llena el cuadradito de sigla (hereda su forma). */
.bo .marca-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.bo-login__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg);
  box-shadow: var(--shadow-lg); padding: clamp(24px, 6vw, 34px);
}
.bo-login__card h1 {
  font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--fg);
  margin: 0 0 6px; text-wrap: balance;
}
.bo-login__intro { font-size: 14px; line-height: 1.5; color: var(--fg-muted); margin: 0 0 22px; }
.bo-login__campos { display: flex; flex-direction: column; gap: 16px; }
.bo-login__campos input[type="email"],
.bo-login__campos input[type="password"] { padding: 11px 12px; }
.bo-login__password { position: relative; }
.bo-login__password input { padding-right: 42px; }
/* `.bo .bo-login__ojo` (0,2,0) para ganarle a la regla base `.bo button` (0,1,1): si no,
   el ojo hereda fondo/padding/sombra del botón primario y se ve como un botón lleno. */
.bo .bo-login__ojo {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; box-shadow: none; padding: 6px; line-height: 0;
  color: var(--fg-subtle); cursor: pointer;
}
.bo .bo-login__ojo:hover { background: none; color: var(--fg-muted); transform: translateY(-50%); }
.bo-login__enviar { width: 100%; padding: 13px 18px; font-size: 15px; margin-top: 4px; }
.bo-login__enviar:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.bo-login__enviar:active { transform: translateY(0); }
.bo-login__pie { text-align: center; font-size: 12.5px; color: var(--fg-muted); margin: 22px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .bo button, .bo input[type="submit"], .bo .btn { transition: none; }
  .bo-login__enviar:hover { transform: none; }
  .bo-nav__grupo svg, .bo-nav__items-outer, .bo-nav__items-inner { transition: none; }
}
.bo-login .flash { flex-direction: row; }
.bo-login .flash__sub { font-size: 12.5px; font-weight: 400; color: var(--fg-muted); margin-top: 2px; }

/* ============================ RESPONSIVE (mostrador) ============================ */

@media (max-width: 860px) {
  /* El sidebar pasa a cajón (drawer) off-canvas; el hamburguesa lo abre. Se conserva la nav
     AGRUPADA completa (no el muro de links suelto que había antes). */
  .bo-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: 274px; max-width: 84vw;
    transform: translateX(-100%); transition: transform .26s var(--ease);
    border-right: 1px solid var(--border); box-shadow: var(--shadow-lg);
  }
  .bo-shell.is-menu-open .bo-sidebar { transform: translateX(0); }

  .bo-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 12, 18, .45);
    opacity: 0; visibility: hidden; transition: opacity .26s;
  }
  .bo-shell.is-menu-open .bo-backdrop { opacity: 1; visibility: visible; }

  .bo-main { width: 100%; min-width: 0; }
  .bo .bo-menu-btn { display: inline-flex; }
  .bo-topbar { padding: 10px 14px; gap: 10px; min-height: 58px; }
  .bo-topbar__derecha { gap: 8px; }
  .bo-usuario__texto { display: none; }   /* en mobile, sólo el avatar */
  .bo-salir-texto { display: none; }      /* Salir icon-only */
  .bo-contenido { padding: 18px 16px 28px; }

  /* Tablas anchas: scroll horizontal propio en vez de desbordar la pantalla. */
  .bo-contenido table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
}

/* Checkbox de "invitar a los socios nuevos" en el confirm del padrón (#6). */
.check-invitar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }

/* ============================ PANEL DE OPERADOR (#3 / #25) ============================ */
.plat-shell { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.plat-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.plat-topbar__marca { font-weight: 700; color: var(--fg); }
.plat-topbar__acciones { display: flex; align-items: center; gap: 12px; }
.plat-topbar__quien { font-size: 13px; color: var(--fg-muted); }
.plat-main { padding: 24px 0 60px; }
.plat-encabezado { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.plat-encabezado h1 { margin: 0; font-size: 22px; }
.plat-encabezado__sub, .plat-sub { font-size: 13px; color: var(--fg-muted); }
.plat-migas { font-size: 13px; color: var(--fg-muted); margin-bottom: 8px; }
.plat-migas a { color: var(--accent); }
.plat-tabla-wrap { overflow-x: auto; }
.plat-tabla { width: 100%; border-collapse: collapse; }
.plat-tabla th, .plat-tabla td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.plat-tabla th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-muted); }
.plat-enlace { color: var(--accent); font-weight: 600; }
.plat-vacio { padding: 40px; text-align: center; color: var(--fg-muted); }
.plat-ficha { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.plat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad); padding: 16px; }
.plat-card h2 { margin: 0 0 12px; font-size: 14px; }
.plat-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.plat-dl dt { color: var(--fg-muted); }
.plat-dl dd { margin: 0; word-break: break-word; }
.plat-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* Calendario de la grilla (#36): día × hora, bloques por minuto, carriles para solapadas.
   Desktop = cuadrícula; mobile (≤720px) = lista por día. */
.cal-sede select { height: 36px; }
.bo .cal-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bo .cal-filtros select { width: auto; }
.bo .cal-filtros__limpiar { font-size: 13px; color: var(--fg-muted); }
.bo .cal-filtros__limpiar:hover { color: var(--fg); }
.cal { border: 1px solid var(--border); border-radius: var(--rad); overflow: hidden; background: var(--surface); }
.cal__head, .cal__body { display: grid; grid-template-columns: 52px repeat(7, 1fr); }
/* Aire arriba del cuerpo: la etiqueta de la primera hora se monta en el borde superior
   (top:-7px) y sin este padding sobresale por encima del calendario (#36/#37). */
.cal__body { padding-top: 10px; }
.cal__head { border-bottom: 1px solid var(--border); }
.cal__head-dia, .cal__head-gut { padding: 9px 4px; text-align: center; font-size: 12px; font-weight: 600; color: var(--fg-muted); border-left: 1px solid var(--border); }
.cal__head-gut { border-left: 0; }
.cal__gut { position: relative; }
.cal__hr { height: var(--pxh); position: relative; }
.cal__hr span { position: absolute; top: -7px; right: 6px; font-size: 11px; color: var(--fg-muted); }
.cal__col { position: relative; border-left: 1px solid var(--border); }
.cal__line { display: block; height: var(--pxh); border-top: 1px solid var(--border); }
.cal__line:first-child { border-top: 0; }
.cal__line:hover { background: var(--accent-soft); }
.cal-blk { position: absolute; box-sizing: border-box; border-radius: 6px; border-left: 3px solid var(--accent); padding: 3px 6px; overflow: hidden; line-height: 1.2; }
.cal-blk__t { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-blk__h { display: block; font-size: 10.5px; opacity: .9; }
.cal-blk__m { display: block; font-size: 10.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-blk--off { background: repeating-linear-gradient(45deg, var(--surface-3), var(--surface-3) 4px, transparent 4px, transparent 8px); color: var(--fg-muted); border-left: 3px dashed var(--border); }
.cal-lista { display: none; }
.cal-lista__dia { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-muted); margin: 16px 0 6px; }
.cal-lista__item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--rad); margin-bottom: 6px; }
.cal-lista__hora { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg); flex: 0 0 auto; }
.cal-lista__cuerpo { display: flex; flex-direction: column; min-width: 0; }
.cal-lista__act { font-weight: 600; color: var(--fg); }
.cal-lista__sub { font-size: 12px; color: var(--fg-muted); }
.cal-lista__item--off { opacity: .55; }

@media (max-width: 720px) {
  .cal { display: none; }
  .cal-lista { display: block; }
}

/* Calendario de Sesiones (#37): reusa .cal; suma navegación de semana, resaltado de hoy y llena. */
/* Control segmentado de semana (‹ | Hoy | ›): un solo bloque unido, no botones sueltos. */
.cal-nav { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--rad); overflow: hidden; box-shadow: var(--shadow-sm); }
.bo .cal-nav__btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; font-size: 14px; font-weight: 600; color: var(--fg); background: var(--surface); border: 0; border-radius: 0; box-shadow: none; }
.bo .cal-nav__btn + .cal-nav__btn { border-left: 1px solid var(--border); }
.bo .cal-nav__btn:hover { background: var(--surface-3); color: var(--fg); }
.cal-nav__flecha { min-width: 40px; padding: 0; font-size: 18px; line-height: 1; }
.cal__head-num { font-weight: 600; color: var(--fg); }
.cal__head-dia.hoy { color: var(--accent-ink); }
.cal__head-dia.hoy .cal__head-num { color: var(--accent-ink); }
.cal__col.hoy { background: var(--accent-soft); }
.cal-blk__cupo { font-weight: 600; }
.cal-blk--llena .cal-blk__cupo { color: var(--peligro-ink); }
.cal-lista__dia.hoy { color: var(--accent-ink); }
