/* Panel de Padel Group Lo Cañas (Padelgrup). Mismo lenguaje que el panel de
   Kursox: fondo claro, barra lateral blanca, tarjetas con esquinas de 12 px,
   Inter y un solo acento, el turquesa del club, para la acción principal.
   Verde, ámbar y rojo solo marcan estados. --club es el turquesa del logo
   (solo en la marca); --brand, uno más oscuro que pasa AA con texto blanco. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("fonts/inter-tight-latin.woff2") format("woff2");
  font-weight: 300 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f6f8;
  --surface: #fff;
  --surface-2: #f8f9fb;
  --line: #e7e9ee;
  --line-strong: #d9dde4;
  --ink: #111827;
  --ink-2: #374151;
  /* Los grises de texto pasan AA (4,5:1) sobre blanco y sobre el fondo; --icon, más claro, es solo
     para íconos y puntos. */
  --muted: #5b6270;
  --faint: #6b7280;
  --icon: #9ca3af;
  --club: #03aac5;
  --brand: #00798d;
  --brand-hover: #006b7d;
  --brand-soft: #e8f6f9;
  --brand-line: #b6e0e8;
  --ok: #15803d;
  --ok-soft: #ecf8f0;
  --ok-line: #c6e9d2;
  --warn: #b45309;
  --warn-soft: #fdf4e3;
  --warn-line: #f3d9a8;
  --hot: #dc2626;
  --hot-ink: #b91c1c;
  --hot-soft: #fdeeee;
  --hot-line: #f6caca;
  --badge: #3f4654;
  --ball: #eab308;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
  --side: 232px;
  --pad: 24px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Inter Tight", var(--font);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html {
  height: 100%;
  margin: 0;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--bg);
  /* En el iPhone horizontal, el contenido no queda bajo la muesca. */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
/* Sin zoom por doble toque ni destello gris al tocar: la app responde al primer toque. */
button, input, select, textarea, label, [role="button"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-soft); color: var(--ink); }
h1, h2, h3 { font-weight: 600; }
.booting { padding: 48px; color: var(--muted); }
.icon { width: 16px; height: 16px; flex: none; }
.icon path, .icon circle, .icon rect, .icon line, .icon polyline { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* cascarón: barra lateral + página */
.app { min-height: 100vh; display: flex; }
.side {
  position: sticky;
  top: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  width: var(--side);
  height: 100vh;
  padding: 16px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 6;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  background: none;
  border: 0;
  padding: 2px 10px;
  text-align: left;
}
.brand strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.brand small { display: block; font-size: 11px; color: var(--muted); }
.logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--brand);
}
.logo svg { width: 18px; height: 18px; }
.logo svg path, .logo svg circle { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* La marca del club: el cuadrado turquesa con "PG" (MARK en app.js, favicon.svg). */
.mark { display: block; flex: none; width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 88, 102, 0.18); }
.mark svg, .mark img { display: block; width: 100%; height: 100%; }
/* En el celular la barra lateral (con la marca) no está: la marca va chica al lado del título. */
.top-mark { display: none; }
@media (max-width: 720px) {
  .top-mark { display: block; flex: none; align-self: center; width: 30px; height: 30px; margin-right: -6px; border-radius: 8px; }
  .top-mark + .pagehead { margin-right: auto; }
}
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: var(--brand-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
  color: var(--brand);
}
.nav small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; overflow-y: auto; }
.nav small { padding: 12px 10px 6px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  color: var(--ink-2);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav button .icon { color: var(--muted); }
.nav button.on { background: #eceef3; color: var(--ink); }
.nav button.on .icon { color: var(--ink); }
.nav .label { flex: 1; }
.nav .l-short { display: none; }
.count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--badge);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  color: #fff;
}
.nav button.on .count { background: var(--brand); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.side-foot .navlink {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
}
.page { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--pad);
  background: rgba(245, 246, 248, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.pagehead { min-width: 0; }
.pagehead small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pagehead h1 { margin: 2px 0 0; font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.machine, .sound {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 7px 11px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.sound .icon { width: 15px; height: 15px; }
.sound.on { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; flex: none; }
.machine[data-state="wait"] { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.machine[data-state="wait"] .dot { background: #f59e0b; }
.machine.demo .dot { background: var(--faint); }
.machine .short { display: none; }
.machine.saving .dot { background: var(--brand); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.main { padding: 20px var(--pad) 48px; display: flex; flex-direction: column; gap: 16px; }

/* tarjetas */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.panel h3, .drawer h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.panel h3 + .muted { margin: 0 0 10px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kpi .k-top { padding: 12px 14px 10px; }
.kpi .k-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.kpi .k-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.kpi.k-live .k-label i { background: var(--brand); }
.kpi.k-owe .k-label i { background: #f59e0b; }
.kpi.k-paid .k-label i { background: #22c55e; }
.kpi b {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.kpi .k-foot { margin-top: auto; padding: 8px 14px; background: var(--surface-2); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }

/* alertas */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert {
  --tone: var(--line-strong);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 11px 12px 11px 14px;
}
.alert.warn { --tone: #f59e0b; }
.alert.hot { --tone: var(--hot); background: #fffafa; }
.alert.caja { --tone: #f59e0b; }
.alert strong { flex: 1; font-weight: 500; color: var(--ink); }
.alert span {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}

/* en vivo */
.live { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.live-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.courts { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
/* Tarjeta de cancha, como las de Enfermería en Kursox: nombre y tipo con el estado a la derecha,
   filas cortas con ícono y una franja abajo con las acciones. El borde izquierdo se pinta solo en
   las canchas con gente o que piden atención. */
.court {
  --phase: var(--line);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--phase);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* En el panel de la cancha, lo mismo que la tarjeta, en un recuadro con el borde de su estado. */
.court-panel { --phase: var(--line); margin: 14px 0 6px; padding: 14px 14px 6px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--phase); border-radius: var(--radius); }
.court-hit { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 14px 16px 14px 14px; text-align: left; cursor: pointer; }
.court-hit:focus-visible { outline-offset: -3px; border-radius: 10px 10px 0 0; }
.kicker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.phase-live { --phase: var(--brand); }
.phase-soon, .phase-ending, .phase-noshow, .phase-waiting { --phase: #f59e0b; }
.phase-extra { --phase: var(--hot); background: #fffafa; }
.phase-mantenimiento { --phase: var(--line-strong); border-style: dashed; border-left-style: solid; }
.pill.t-live { color: var(--brand); background: var(--brand-soft); border-color: var(--brand-line); }
.pill.t-warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.pill.t-hot { color: var(--hot); background: var(--hot-soft); border-color: var(--hot-line); }
.pill.t-ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.court-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.court-head > div { min-width: 0; }
.court h2 { margin: 0; font-size: 15px; line-height: 1.3; letter-spacing: -0.005em; white-space: nowrap; color: var(--ink); }
.court-head small { display: block; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
/* La cancha flota a la derecha: lo que está a su lado se angosta y las filas que quedan debajo
   usan todo el ancho (en una tarjeta angosta, "Después: …" no se parte). */
.court-body { display: flow-root; }
.court-body::after { content: ""; display: table; clear: both; }
.court-body .court-art { float: right; width: clamp(52px, 22%, 72px); margin: 0 0 8px 14px; }
.court-info > * + * { margin-top: 8px; }
.court-body .who { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.clock { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; }
.court-body .timer { font-family: var(--font); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.clock small { color: var(--muted); font-size: 12px; }
.clock.over small { color: var(--hot); }
.track { display: block; height: 4px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.track i { display: block; height: 100%; border-radius: inherit; background: var(--phase); }
.facts { margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.facts li { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.facts li + li { margin-top: 6px; }
.court-info > * + .facts { margin-top: 10px; }
.facts li > span { min-width: 0; overflow-wrap: anywhere; text-wrap: pretty; }
.facts .icon { width: 14px; height: 14px; margin-top: 1px; color: var(--faint); }
.facts b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.facts .warn { color: var(--warn); font-weight: 600; }
.facts .warn .icon { color: currentColor; }
.court-foot { display: flex; justify-content: flex-end; padding: 10px 16px 10px 14px; background: var(--surface-2); border-top: 1px solid var(--line); }
.court-foot .card-actions { justify-content: flex-end; }
.who { font-size: 13.5px; font-weight: 500; color: var(--ink-2); overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 12.5px; }
.timer {
  font-family: var(--display);
  font-size: 46px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.phase-extra .timer, .timer.over, .clock.over .timer { color: var(--hot); }
.phase-soon .timer, .phase-ending .timer { color: var(--warn); }
.card-actions, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* La cancha vista desde arriba (courtArt en app.js): el SVG no cambia y, con gente jugando, el
   punto va en un canvas encima, del mismo tamaño. */
.court-art { position: relative; display: block; }
.court-art svg { display: block; width: 100%; height: auto; }
.court-art .rally { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.court-art .floor { fill: #e7f4f6; }
.court-art.is-live .floor { fill: #cfeaef; }
.court-art .lines { fill: none; stroke: #fff; stroke-width: 1.3; }
.court-art .mesh { fill: none; stroke: #b5d7dd; stroke-width: 1.2; stroke-dasharray: 2.5 2; }
.court-art .glass { fill: none; stroke: #86c4cf; stroke-width: 2.4; stroke-linejoin: round; }
.court-art .net { fill: none; stroke: #2b7d8f; stroke-width: 1.6; stroke-linecap: round; }
.phase-mantenimiento .court-art { opacity: 0.45; }

/* botones */
.solid, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-2);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.12s var(--ease);
}
.solid { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(0, 121, 141, 0.25); }
.solid.hot { background: var(--hot); border-color: var(--hot); box-shadow: 0 1px 2px rgba(220, 38, 38, 0.25); }
.ghost { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.solid:active, .ghost:active { transform: scale(0.98); }
.ghost.tiny, .solid.tiny { padding: 7px 11px; font-size: 12.5px; }
.linkish { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
/* Un enlace dentro de un texto ("Ver en Estadísticas") se distingue del texto: turquesa y subrayado. */
.settings .panel p .linkish { color: var(--brand); text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 2px; }
.wide-btn { width: 100%; }

/* columna derecha */
.rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.queue { display: flex; flex-direction: column; }
.queue > button, .account {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 2px;
  transition: background 0.15s var(--ease);
}
.queue > :first-child { border-top: 0; }
.queue b, .account b { display: block; font-weight: 600; font-size: 13px; color: var(--ink); }
.queue span, .account span, .muted { color: var(--muted); font-size: 12.5px; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed p { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.feed time { display: block; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 8px 0; margin: 0; font-size: 12.5px; }
.emptystate { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; text-align: center; }
.emptystate .logo { width: 44px; height: 44px; border-radius: 12px; color: var(--muted); }
.emptystate b { font-size: 13.5px; color: var(--ink); }
.emptystate p { margin: 0; max-width: 34ch; color: var(--muted); font-size: 12.5px; }

/* agenda */
.agenda-view { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.daynav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.daynav b { min-width: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.daynav .d-short { display: none; }
.daynav .ghost.tiny { min-width: 36px; font-size: 16px; line-height: 1; }
.toolbar p { margin: 0; max-width: 64ch; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; color: var(--ink-2); font-size: 12px; align-items: center; }
.legend span { display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.swatch.en_juego { background: var(--brand); }
.swatch.reservada { background: #94a3b8; }
.swatch.por_cobrar { background: #f59e0b; }
.swatch.pagada { background: #22c55e; }
.swatch.oferta { border-radius: 2px; background: repeating-linear-gradient(135deg, rgba(0, 121, 141, 0.25) 0 2px, rgba(0, 121, 141, 0.55) 2px 4px); }
.agenda-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.agenda { --label: 132px; min-width: 980px; position: relative; }
.hours, .lane { display: grid; grid-template-columns: var(--label) 1fr; }
.court-name, .hours > span:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.hours span { color: var(--muted); font-size: 11px; padding: 10px 0 8px; font-variant-numeric: tabular-nums; }
.hours { background: var(--surface-2); }
/* Las horas y sus líneas salen del horario del club: --hour es el ancho de una hora (lo pone app.js). */
.hourline { position: relative; height: 34px; }
.hourline span { position: absolute; top: 0; white-space: nowrap; }
.lane-track {
  position: relative;
  height: 62px;
  background-image: linear-gradient(90deg, #eef0f3 1px, transparent 1px);
  background-size: var(--hour, calc(100% / 15)) 100%;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.offerband { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(0, 121, 141, 0.05) 0 6px, rgba(0, 121, 141, 0.11) 6px 12px); pointer-events: none; }
.court-name { padding: 11px 14px; color: var(--ink-2); font-size: 12.5px; font-weight: 500; border-top: 1px solid var(--line); line-height: 1.35; }
.block {
  position: absolute;
  top: 7px;
  bottom: 7px;
  border: 1px solid var(--line);
  border-left: 3px solid #94a3b8;
  border-radius: 7px;
  padding: 5px 8px;
  text-align: left;
  overflow: hidden;
  font-size: 12.5px;
  background: #f4f6f9;
  color: var(--ink);
  /* Encima de la línea de "ahora": la línea no tacha el nombre de los que están jugando. */
  z-index: 2;
}
.block b { display: block; overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.block small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; }
.block.reservada { background: #f4f6f9; }
.block.por_cobrar { background: var(--warn-soft); border-color: var(--warn-line); border-left-color: #f59e0b; }
.block.pagada { background: var(--ok-soft); border-color: var(--ok-line); border-left-color: #22c55e; color: var(--ink-2); }
.block.en_juego { background: var(--brand-soft); border-color: var(--brand-line); border-left-color: var(--brand); }
.nowline { position: absolute; top: 34px; bottom: 0; width: 2px; background: var(--hot); pointer-events: none; z-index: 1; }
.nowline::before { content: ""; position: absolute; top: -4px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--hot); }
.later { margin: 0; color: var(--muted); font-size: 13px; }

/* caja */
.cajagrid { display: grid; grid-template-columns: 250px minmax(300px, 1fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.queue .account { padding: 10px 12px; border-radius: var(--radius-sm); }
.panel .list-sep { margin-top: 16px; }
.queue b, .facts { font-variant-numeric: tabular-nums; }
.queue .account.on { border-top-color: transparent; background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.queue .account.on + .account { border-top-color: transparent; }
.ticket {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}
.ticket header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ticket h2 { margin: 2px 0; font-size: 22px; letter-spacing: -0.01em; }
.ticket .code { color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.lines { margin: 14px 0; }
.line, .payrow {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed var(--line-strong);
  font-size: 13.5px;
}
.line b, .payrow b { font-weight: 600; font-variant-numeric: tabular-nums; }
.payrow { color: var(--ok); }
.iconbtn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  padding: 0;
}
.virtual { color: var(--muted); }
.totals { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: 6px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.due {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.due.zero { color: var(--ok); }
.products { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.products button, .chip {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.person {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.person.on { border-color: var(--brand-line); background: var(--brand-soft); }
.person .who { min-width: 0; }
.person b, .person .muted { display: block; }
.person > b { font-weight: 600; font-variant-numeric: tabular-nums; }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eceef3;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.person.on .avatar { background: var(--brand); color: #fff; }
.bar { display: block; height: 4px; border-radius: 4px; background: #eceef3; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.paybox { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.paybox p { margin: 0; color: var(--muted); }
.paybox p b { color: var(--ink); font-weight: 600; }
.methods, .quicks, .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.method, .seg button {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.method.on, .seg button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.amount {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.amount::placeholder { font-family: var(--font); font-size: 13.5px; color: var(--faint); letter-spacing: 0; }
.names { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.names input, .field input, .field select, .rategrid input, .prod input, .pass input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.names input:focus, .field input:focus, .field select:focus, .rategrid input:focus, .prod input:focus, .pass input:focus, .amount:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 121, 141, 0.14);
}
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin-bottom: 10px; }
.panel-head h3 { margin: 0; white-space: nowrap; }
.cierre-view .panel-head { align-items: baseline; }
.split { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.split .seg { flex-wrap: nowrap; }
.split .seg button { min-width: 34px; padding: 5px 0; }
.subhead { margin: 16px 0 0; font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* whatsapp */
/* WhatsApp en proceso */
.soonview { max-width: 640px; }
.soonview .panel { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.soonview h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); }
.soonview p { margin: 0; }
.soon {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid var(--warn-line);
  border-radius: 999px;
  background: var(--warn-soft);
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  color: var(--warn);
}

/* panel lateral y modal */
.drawer-back, .modal-back {
  position: fixed;
  inset: 0;
  z-index: 20;
  border: 0;
  background: rgba(17, 24, 39, 0.36);
}
.drawer, .modal {
  position: fixed;
  z-index: 21;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.drawer {
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  padding: calc(22px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) 22px;
  overflow: auto;
  overscroll-behavior: contain;
  border-width: 0 0 0 1px;
}
/* "Cerrar" del panel de la cancha queda a la vista aunque el panel sea largo. */
.drawer > .kicker { position: sticky; top: 0; z-index: 2; padding-bottom: 8px; background: var(--surface); box-shadow: 0 -40px 0 var(--surface); }
.quote .per-week { font-size: 12.5px; color: var(--muted); }
.drawer > p { color: var(--muted); }
.drawer > p b { color: var(--ink); font-weight: 600; }
.drawer h3 { margin-top: 22px; }
.drawer .queue { margin-top: 8px; }
.drawer .queue .account { padding: 10px 2px; border-radius: 0; }
.drawer .upcoming { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer .upcoming > div:first-child { min-width: 0; }
.drawer .upcoming .row-actions { flex: none; margin: 0; }
.drawer .upcoming.on { padding-left: 10px; padding-right: 10px; border-radius: var(--radius-sm); background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.drawer h2, .modal h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); }
.drawer-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.drawer-title h2 { margin: 0; }
.modal { left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: hidden; border-radius: 16px; }
/* Los campos se desplazan; el precio y el botón quedan siempre a la vista abajo. */
.modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 22px 22px 0; }
.modal-foot { flex: none; padding: 14px 22px 22px; border-top: 1px solid var(--line); }
.modal-body .fields { margin-bottom: 18px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field > span:first-child { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.quote { background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; color: var(--ink-2); }
.quote.bad { background: var(--warn-soft); border-color: var(--warn-line); }
.field input:disabled { background: var(--surface-2); color: var(--muted); }
.quote b { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.quote-error { margin: 0; color: var(--warn); font-weight: 600; }
/* Los avisos solo informan: un toque los atraviesa (en el celular tapan la agenda y la barra de abajo). */
.toasts { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 30; width: max-content; max-width: calc(100% - 24px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 10px; padding: 11px 16px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); }

/* pantalla del club */
/* Una sola columna que se puede achicar: sin ella, el encabezado (nombre largo, "Sin conexión") fija el
   ancho y la Pantalla se sale por la derecha; con ella, el nombre se corta con "…". */
.tv { min-height: 100vh; padding: 22px var(--pad) 18px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 16px; }
.tv-top, .tv-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
/* La pantalla se lee de lejos: en un TV grande, letras y cancha crecen con el ancho. */
.tv-top .brand strong { font-size: clamp(18px, 1.3vw, 26px); }
.tv-clock { font-family: var(--display); font-size: clamp(36px, 3vw, 64px); font-weight: 400; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.tv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tv-court {
  /* El reloj y la cancha se miden con el ancho de la tarjeta (cqi): así caben en 3 columnas de una
     tablet horizontal y crecen en un TV. Sin soporte, se usa la medida de la pantalla de antes. */
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: clamp(18px, 1.5vw, 30px) clamp(22px, 1.8vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--phase, var(--line));
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.tv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tv-head b { font-size: clamp(18px, 1.4vw, 30px); font-weight: 600; color: var(--ink); }
.tv-head .pill { padding: 0.25em 0.8em; font-size: clamp(13px, 0.95vw, 18px); }
.tv-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) clamp(56px, min(9vw, 12vh), 180px); grid-template-columns: minmax(0, 1fr) clamp(48px, min(28cqi, 12vh), 180px); gap: 18px; align-items: center; min-height: 0; }
.tv-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tv-court .timer { font-size: clamp(44px, 5.4vw, 120px); font-size: clamp(32px, 15cqi, 120px); line-height: 0.95; white-space: nowrap; }
.tv-court.phase-libre .timer, .tv-court.phase-mantenimiento .timer { font-size: clamp(36px, 4.2vw, 88px); font-size: clamp(28px, 11cqi, 88px); color: var(--ok); }
.tv-court.phase-mantenimiento .timer { color: var(--muted); }
.tv-court .who { font-size: clamp(18px, 1.4vw, 30px); font-weight: 600; color: var(--ink); text-wrap: balance; }
.tv-court .meta { font-size: clamp(14px, 1.05vw, 20px); }
.tv-actions { display: flex; gap: 12px; align-items: center; }
.tv-foot { color: var(--muted); font-size: clamp(14px, 1vw, 18px); }

/* estadísticas */
.stats-view { display: flex; flex-direction: column; gap: 16px; }
.statbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.statgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.statgrid > .emptystate { justify-content: center; }
.notice { margin: 0; padding: 10px 12px; border: 1px solid var(--warn-line); border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 500; }
.readout { min-height: 1.5em; margin: 10px 0 0; font-variant-numeric: tabular-nums; }
/* Barras: escala fija de 0 a 100%, líneas finas cada 25%. La barra no pasa de 24 px de ancho. */
.daybars { --bars: 150px; position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-top: 8px; padding-left: 34px; }
.daybars::before {
  content: "";
  position: absolute;
  left: 34px;
  right: 0;
  top: 20px;
  height: var(--bars);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
  border-bottom: 1px solid var(--line-strong);
  pointer-events: none;
}
.dtick { position: absolute; left: 0; color: var(--faint); font-size: 10.5px; font-variant-numeric: tabular-nums; line-height: 1; }
.dtick.t100 { top: 15px; }
.dtick.t50 { top: calc(15px + var(--bars) / 2); }
.dcol { position: relative; display: grid; grid-template-rows: var(--bars) auto auto; justify-items: center; padding-top: 20px; border-radius: var(--radius-sm); outline: none; cursor: default; }
.dcol:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.dtrack { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: var(--bars); }
.dtrack i { position: relative; display: block; width: min(24px, 70%); border-radius: 4px 4px 0 0; background: #2b9db0; }
.dtrack em { position: absolute; bottom: 100%; left: 50%; padding-bottom: 4px; transform: translateX(-50%); font-size: 12px; font-style: normal; font-weight: 600; white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
.dcol.top .dtrack i { background: var(--brand); }
.dname { padding-top: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.dmark { min-height: 14px; font-size: 10.5px; line-height: 1.3; color: var(--muted); text-align: center; }
.tableview { margin-top: 10px; font-size: 12.5px; }
.tableview summary { color: var(--muted); cursor: pointer; }
.tableview table { width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tableview th, .tableview td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: right; font-weight: 400; }
.tableview th:first-child { text-align: left; font-weight: 500; color: var(--ink-2); }
.tableview thead th { border-top: 0; color: var(--muted); font-size: 11.5px; font-weight: 500; }
/* Mapa de calor: un turquesa de claro a oscuro (0, <20, <40, <60, <80, hasta 100%), con 2 px entre horas. */
.heat { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 2px; margin-top: 8px; }
.heat .hd { padding-bottom: 4px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); text-align: center; }
.heat .hh { align-self: center; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.hc { display: grid; place-items: center; height: 22px; padding: 0; border: 0; border-radius: 4px; background: #f1f3f8; font-size: 11px; font-weight: 700; line-height: 1; color: var(--ink); }
.hc.b1, .heatkey .b1 { background: #dcf1f4; }
.hc.b2, .heatkey .b2 { background: #b2e0e8; }
.hc.b3, .heatkey .b3 { background: #7cc8d5; }
.hc.b4, .heatkey .b4 { background: #007f94; color: #fff; }
.hc.b5, .heatkey .b5 { background: #005866; color: #fff; }
.hc.bna { background: #f7f8fa; }
.hc.on { box-shadow: inset 0 0 0 2px var(--ink); }
.heat.off .hc.on { box-shadow: inset 0 0 0 2px var(--faint); color: var(--muted); }
.hc.b4.on, .hc.b5.on { box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--ink); }
.hc:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--ink); outline-offset: 1px; }
.hc.b4:focus-visible, .hc.b5:focus-visible { box-shadow: inset 0 0 0 2px #fff; }
.heatkey { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.heatkey i { width: 14px; height: 10px; border-radius: 2px; background: #f1f3f8; }
.heatkey span:first-child { margin-right: 2px; }
.heatkey span + i { margin-left: 0; }
.heatkey .offkey { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; color: var(--ink-2); }
.heatkey .offkey b { display: grid; place-items: center; width: 16px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--ink); font-size: 10px; color: var(--ink); }
/* ofertas */
.offerpanel { display: flex; flex-direction: column; gap: 12px; }
.offerpanel > p, .offerpanel .offerhead p { margin: 0; }
.offerhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.offerhead h3 { margin-bottom: 4px; }
.offerctl { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.offerlist { display: flex; flex-wrap: wrap; gap: 6px; }
.offerlist .chip { font-variant-numeric: tabular-nums; }
.promo { padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.promo small { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.promo p { margin: 0; color: var(--ink); font-size: 13.5px; }
.switch { display: inline-flex; flex: none; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.switch i { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #d5d9e1; transition: background 0.15s var(--ease); }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2); transition: transform 0.15s var(--ease); }
.switch.on { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand); }
.switch.on i { background: var(--brand); }
.switch.on i::after { transform: translateX(14px); }
.was { margin-left: 8px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ajustes */
.settings { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; align-items: start; }
.settings .panel > p { margin: 0 0 12px; }
.settings .panel h3:not(:first-child) { margin-top: 20px; }
.rategrid { display: grid; grid-template-columns: 130px minmax(0, 170px) minmax(0, 170px); gap: 8px; align-items: center; margin-top: 12px; }
.rategrid b { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rategrid > span { font-weight: 500; color: var(--ink-2); }
.prod { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.prod label { min-width: 0; color: var(--ink-2); }
.prod small { display: block; font-size: 11.5px; color: var(--warn); }
.prod.zero input { border-color: var(--warn-line); background: var(--warn-soft); }
.prod-in { display: flex; flex: none; align-items: center; gap: 6px; }
.prod input { max-width: 140px; text-align: right; font-variant-numeric: tabular-nums; }
.prod.add > input { flex: 1; max-width: none; text-align: left; }
.prod.add .prod-in input { max-width: 110px; }
.settings .panel > .solid { margin-top: 16px; }
.settings .panel > .ghost + p { margin-top: 14px; }

/* entrar al club */
.login { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.login .field > span:first-child { font-size: 12px; }
.pass { position: relative; display: flex; align-items: center; }
.pass input { padding-right: 44px; letter-spacing: 0.06em; }
.pass input::placeholder { letter-spacing: 0; }
.eye {
  position: absolute;
  right: 4px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.eye .icon { width: 17px; height: 17px; }
.login .solid { padding: 12px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 16px rgba(0, 121, 141, 0.28); }
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 121, 141, 0.32) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    linear-gradient(180deg, #f6f7f9, #f2f3f0);
  background-attachment: fixed;
}
.gate::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #f5f6f8 0%, #f5f6f8 46%, rgba(245, 246, 248, 0.55) 70%, rgba(245, 246, 248, 0) 100%);
}
.gate-card { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: min(340px, 100%); }
.gate-card .mark { align-self: center; width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 88, 102, 0.18); }
.gate-card .wordmark { align-self: center; display: block; width: 128px; height: auto; }
.gate-card h1 { margin: 14px 0 0; font-size: 22px; letter-spacing: -0.01em; text-align: center; color: var(--ink); text-wrap: balance; }
.gate-card > p { margin: 0; text-align: center; }
.gate-card .login { margin: 8px 0 0; }
.gate-card .secured { margin: 4px 0 0; text-align: center; font-size: 11px; color: var(--muted); }
.gate-card .linkish { align-self: center; margin-top: 4px; }
.gate-card > .solid { padding: 12px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 16px rgba(0, 121, 141, 0.28); }

@media (hover: hover) and (pointer: fine) {
  .dcol:hover .dtrack i, .hc:hover { filter: brightness(0.94); }
  .nav button:hover { background: #f1f3f6; color: var(--ink); }
  .nav button.on:hover { background: #eceef3; }
  .side-foot .navlink:hover, .linkish:hover { color: var(--ink); }
  .solid:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
  .solid.hot:hover { background: #c81e1e; border-color: #c81e1e; }
  .ghost:hover { background: #d7eff3; color: var(--brand-hover); }
  .sound:hover, .machine:hover, .chip:hover, .method:hover, .seg button:hover, .products button:hover { border-color: var(--line-strong); background: var(--surface-2); }
  .method.on:hover, .seg button.on:hover { background: var(--brand-hover); }
  .queue > button:hover, .account:hover, .person:hover { background: var(--surface-2); }
  .account.on:hover, .person.on:hover { background: var(--brand-soft); }
  .alert:hover { border-color: var(--line-strong); }
  .court-hit:hover h2 { color: var(--brand); }
  .lane-track:hover { background-color: #fbfcfe; }
  .eye:hover { color: var(--ink); background: var(--surface-2); }
}

@media (max-width: 1380px) {
  .live { grid-template-columns: minmax(0, 1fr); }
  .rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
}
@media (min-width: 1180px) and (max-width: 1399px) {
  .cajagrid { grid-template-columns: 240px minmax(0, 1fr); }
  .cajagrid > .panel:first-child { grid-row: span 2; }
  .cajagrid > .panel:last-child { grid-column: 2; }
}
@media (max-width: 1179px) {
  .cajagrid, .settings, .statgrid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* La pantalla en una tablet vertical: dos columnas y tres filas. Horizontal, tres columnas. */
@media (max-width: 1179px) and (orientation: portrait) {
  .tv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .app { flex-direction: column; }
  .side {
    width: auto;
    height: auto;
    padding: 10px 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav small, .side-foot { display: none; }
  .nav {
    flex-direction: row;
    gap: 4px;
    margin: 8px -14px 0;
    padding: 0 14px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { position: relative; flex: none; width: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
  .nav button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
  .nav button.on .icon { color: #fff; }
  .nav button.on .count { background: #fff; color: var(--brand); }
  /* En la fila de pestañas, "En proceso" es un punto ámbar: el texto empujaba Ajustes fuera de la fila. */
  .nav .soon { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; margin: 0; padding: 0; border: 2px solid var(--surface); border-radius: 50%; background: #f59e0b; font-size: 0; line-height: 0; }
  .topbar { position: static; }
}
@media (min-width: 721px) and (max-width: 860px) {
  .nav button { padding: 8px 10px; }
  .nav .l-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav .l-short { display: inline; }
}
/* Tablet angosta: las siete pestañas entran sin íconos, solo con su nombre. */
@media (min-width: 721px) and (max-width: 800px) {
  .nav button .icon { display: none; }
}
/* Horizontal en un celular o una tablet chica: lo de arriba no se queda pegado y deja la altura al contenido. */
@media (min-width: 721px) and (max-width: 1023px) and (max-height: 520px) {
  .side { position: static; }
}
@media (max-height: 520px) {
  /* Poca altura: el precio va en una línea y deja espacio a los campos. */
  .modal-foot { padding-top: 10px; padding-bottom: 12px; }
  .modal-foot .quote { padding: 8px 12px; margin-bottom: 10px; }
  /* Lo que avisa algo (semanas sin cupo, quién viene después, la oferta) se queda. */
  .modal-foot .quote br, .modal-foot .quote .muted:not(.keep) { display: none; }
  .modal-foot .quote b { margin-left: 8px; font-size: 18px; }
}
@media (max-width: 720px) {
  :root { --pad: 14px; }
  /* Celular: las vistas en una barra abajo, al alcance del pulgar, como una app. Arriba queda
     solo el encabezado de la vista, pegado. */
  .side {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    padding: 4px max(6px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .side .brand, .nav [data-vista="pantalla"] { display: none; }
  .nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; margin: 0; padding: 0; overflow: visible; }
  .nav button {
    position: relative;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    width: auto;
    min-height: 54px;
    padding: 5px 0 4px;
    border: 0;
    border-radius: 10px;
    background: none;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    color: var(--muted);
  }
  .nav button .icon { width: 52px; height: 28px; padding: 3px 15px; border-radius: 999px; color: inherit; transition: background 0.15s var(--ease); }
  .nav button.on { background: none; border: 0; color: var(--brand); font-weight: 600; }
  .nav button.on .icon { background: var(--brand-soft); color: var(--brand); }
  .nav .label { flex: none; white-space: nowrap; }
  .nav .l-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav .l-short { display: inline; }
  .nav .count { position: absolute; top: 2px; left: calc(50% + 7px); min-width: 17px; padding: 0 4px; border-radius: 9px; font-size: 10px; line-height: 17px; }
  .nav button.on .count { background: var(--brand); color: #fff; }
  .nav .soon { position: absolute; top: 4px; left: calc(50% + 8px); width: 10px; height: 10px; margin: 0; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #f59e0b; font-size: 0; line-height: 0; }
  .topbar { position: sticky; top: 0; z-index: 10; padding: calc(10px + env(safe-area-inset-top)) var(--pad) 10px; }
  .pagehead h1 { font-size: 17px; }
  /* El estado de la nube se ve solo cuando importa: demo, sin conexión o guardando. */
  .machine { padding: 6px 10px; font-size: 12px; }
  .machine .long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .machine .short { display: inline; }
  .machine:not(.demo):not([data-state="wait"]):not(.saving) { display: none; }
  .sound .label { display: none; }
  .main { padding: 14px var(--pad) calc(86px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .kpis { gap: 8px; }
  .kpi .k-top { padding: 10px 12px 8px; }
  .kpi b { font-size: 18px; }
  .kpi .k-foot { padding: 7px 12px; }
  .courts, .tv-grid, .fields { grid-template-columns: minmax(0, 1fr); }
  /* En el celular la cancha va más grande: el punto se ve bien sin acercarse. */
  .court-body .court-art { width: clamp(64px, 27%, 100px); }
  .rail { grid-template-columns: minmax(0, 1fr); }
  .tv { padding: 14px var(--pad); }
  .tv-top { flex-wrap: wrap; }
  /* Los cuatro medios de pago en dos filas parejas (Transferencia no queda sola abajo). */
  .methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-clock { font-size: 28px; }
  .agenda { --label: 92px; }
  .modal {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 92svh;
    transform: none;
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }
  .modal-body { padding: 18px var(--pad) 0; }
  .modal-foot { padding: 12px var(--pad) calc(14px + env(safe-area-inset-bottom)); }
  .drawer { padding: calc(18px + env(safe-area-inset-top)) var(--pad) calc(18px + env(safe-area-inset-bottom)); }
  .rategrid { grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr); }
  .offerhead { flex-direction: column; }
  .prod.add { flex-wrap: wrap; }
  .prod.add > input { flex-basis: 100%; }
  .prod.add .prod-in { flex: 1; }
  .prod.add .prod-in input { max-width: none; }
}
@media (max-width: 720px) and (max-height: 520px) {
  .topbar { position: static; }
}
@media (pointer: coarse) {
  .brand, .sound, .machine, .nav button, .navlink, .solid, .ghost, .chip, .method, .seg button,
  .products button, .linkish, .queue > button, .account, .alert, .eye, .switch { min-height: 44px; }
  /* Siete días por fila no dan 44 px de ancho en un celular de 360: alto de 40 px y 2 px entre horas. */
  .hc { height: 40px; }
  .ghost.tiny, .solid.tiny { padding: 10px 14px; font-size: 14px; }
  .seg button, .sound, .eye, .split .seg button { min-width: 44px; }
  .iconbtn { width: 44px; height: 44px; font-size: 20px; }
  input, select,
  .names input, .field input, .field select, .rategrid input, .prod input, .pass input { min-height: 44px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  /* Sin movimiento (el punto de la cancha también queda quieto: lo resuelve app.js). */
  .machine.saving .dot { animation: none; }
  .solid, .ghost { transition: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: #374151; --faint: #4b5563; --icon: #6b7280; --line: #c3c8d1; }
}
@media print { body { display: none; } }

/* L1-caja */
/* Correcciones de caja: anular un pago, condonar un saldo o anular una cuenta abierta por error.
   Son acciones secundarias: texto gris y subrayado, en rojo al pasar el mouse. */
.payrow .linkish, .fixes .linkish { color: var(--muted); font-size: 12.5px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.payrow.voided { color: var(--muted); }
.payrow.voided small { display: block; margin-top: 2px; font-size: 12px; }
.line.adjust { color: var(--muted); }
.fixes { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; }
@media (hover: hover) and (pointer: fine) {
  .payrow .linkish:hover, .fixes .linkish:hover { color: var(--hot); text-decoration-color: currentColor; }
}
/* En un notebook (1180–1439 px) la boleta y el cobro van lado a lado, con la lista de cuentas más
   angosta: los botones de cobro quedan a la vista sin bajar. */
@media (min-width: 1180px) and (max-width: 1439px) {
  .cajagrid { grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1.12fr); gap: 12px; }
  .cajagrid > .panel:first-child { grid-row: auto; }
  .cajagrid > .panel:last-child { grid-column: auto; }
  .cajagrid .method { padding-inline: 10px; }
}
@media (min-width: 1180px) and (max-width: 1279px) {
  .cajagrid { grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.2fr); }
}
/* L2-club */
/* Ajustes en escritorio: dos columnas parejas (app.js las arma): a la izquierda las tarifas y este
   equipo; a la derecha el club, los días cerrados y los datos personales. En la tablet y el celular, una
   sola columna en el orden de siempre: tarifas, club, días cerrados, este equipo y datos personales (en
   la demo, entrar con la clave va primero). Es la única regla que ubica los paneles: uno nuevo va aquí. */
.s-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1179px) {
  .settings > .s-col { display: contents; }
  .settings .p-rates { order: 1; }
  .settings .p-club { order: 2; }
  .settings .p-closures { order: 3; }
  .settings .p-device { order: 4; }
  .settings .p-privacy { order: 5; }
  .settings.demo .p-device { order: 0; }
}
.settings .field > .switch { align-self: flex-start; }
.p-club > .field { margin: 12px 0 4px; }
.courtrow, .peakrow { display: flex; align-items: center; gap: 8px; }
.courtrow { padding: 6px 0; border-top: 1px solid var(--line); }
.courtrow input, .courtrow select, .peakrow input {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.courtrow input:focus, .courtrow select:focus, .peakrow input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 121, 141, 0.14);
}
.courtrow input { flex: 1; min-width: 0; }
.courtrow select { flex: none; width: 136px; }
.courtrow .iconbtn, .courtrow .ghost, .peakrow .iconbtn { flex: none; }
.courtrow .iconbtn:disabled { opacity: 0.4; }
.peakgroup { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; }
.peakgroup .subhead { margin: 0; }
.peakgroup > .muted { margin: 0; }
.peakrow input { width: 124px; font-variant-numeric: tabular-nums; }
.peakrow > span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 720px) {
  .courtrow select { width: 118px; }
  .courtrow { flex-wrap: wrap; }
  .courtrow input { flex-basis: 100%; }
  .courtrow select { flex: 1; width: auto; }
  .peakrow { align-self: stretch; }
  .peakrow input { flex: 1; width: auto; min-width: 0; }
}
@media (pointer: coarse) {
  .courtrow input, .courtrow select, .peakrow input { min-height: 44px; font-size: 16px; }
}
/* La Pantalla con más de 6 canchas sigue entrando entera: cuatro columnas y tarjetas más justas;
   con 9 o más (tres filas), la cancha dibujada más chica. Con 6 o menos no cambia nada. */
.tv-grid:has(> .tv-court:nth-child(7)) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tv-grid:has(> .tv-court:nth-child(7)) .tv-court { gap: 6px; padding: clamp(10px, 1vw, 22px) clamp(14px, 1.2vw, 28px); }
.tv-grid:has(> .tv-court:nth-child(7)) .tv-body { grid-template-columns: minmax(0, 1fr) clamp(36px, min(22cqi, 8.5vh), 140px); gap: 10px; }
.tv-grid:has(> .tv-court:nth-child(9)) .tv-court { padding-block: clamp(8px, 0.8vw, 20px); }
.tv-grid:has(> .tv-court:nth-child(9)) .tv-body { grid-template-columns: minmax(0, 1fr) clamp(32px, min(20cqi, 7vh), 120px); }
@media (max-width: 1179px) and (orientation: portrait) {
  .tv-grid:has(> .tv-court:nth-child(7)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tv-grid:has(> .tv-court:nth-child(7)) { grid-template-columns: minmax(0, 1fr); }
}
/* L3b-pantalla: la Pantalla en un TV grande, sin conexión y sin botones a la vista; grises con
   contraste, toques de 44 px y el celular angosto. */

/* Íconos y puntos siguen en el gris claro: el texto gris (--muted, --faint) se oscureció. */
.machine.demo .dot, .kpi .k-label i { background: var(--icon); }
.facts .icon { color: var(--icon); }
.heat.off .hc.on { box-shadow: inset 0 0 0 2px var(--icon); }
.pill.t-hot { color: var(--hot-ink); }

/* Pantalla: el club arriba (con el aviso de sin conexión) y el nombre de la cancha en una línea. */
.tv-top .brand { min-width: 0; padding-left: 0; }
.tv-top .brand strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* En la tablet y el celular, sin conexión, el aviso baja bajo el nombre del club en vez de cortarlo a
   "Padel…"; el nombre sigue al lado del logo (nunca baja solo) y, si no cabe, se corta con "…". */
@media (max-width: 1179px) {
  .tv-top .brand { flex-wrap: wrap; row-gap: 6px; }
  .tv-top .brand strong { max-width: calc(100% - max(32px, 2.2vh) - 10px); }
}
.tv-net { flex: none; padding: 0.25em 0.8em; font-size: clamp(13px, 0.95vw, 18px); }
/* Sin conexión, solo los dibujos se apagan: los textos se siguen leyendo desde lejos y la píldora de
   arriba dice de qué hora son los datos. */
.tv.stale .court-art { opacity: 0.4; }
/* Si no caben juntos, el estado baja a otra línea: el nombre nunca se parte ("Cancha" / "3"). */
.tv-head { flex-wrap: wrap; row-gap: 4px; }
.tv-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-head .pill { flex: none; }
.tv-head .pill::before, .tv-net::before { width: 0.34em; height: 0.34em; }
/* Con el TV quieto, los botones y el cursor se esconden (calmTv en app.js); al mover, vuelven. */
.tv-actions { transition: opacity 0.3s var(--ease); }
.tv-calm .tv-actions { opacity: 0; pointer-events: none; }
.tv-calm .tv { cursor: none; }

/* Un TV 4K a 100 % (3840 px de ancho): todo sigue creciendo, con el alto de la pantalla como tope, en
   vez de quedarse en el tamaño de un 1080p. Hasta 1080p las medidas son las de siempre. */
@media (min-width: 721px) {
  .tv { padding: clamp(22px, 2.04vh, 56px) clamp(24px, 1.25vw, 64px) clamp(18px, 1.67vh, 48px); gap: clamp(16px, 1.48vh, 40px); }
  .tv-top .brand { gap: clamp(10px, 0.9vh, 20px); }
  .tv-top .mark { width: clamp(32px, 2.8vh, 64px); height: clamp(32px, 2.8vh, 64px); border-radius: 22%; }
  .tv-top .brand strong { font-size: clamp(20px, min(1.3vw, 2.4vh), 46px); }
  .tv-clock { font-size: clamp(36px, min(3vw, 5.4vh), 120px); }
  .tv-actions .ghost.tiny, .tv-actions .linkish { font-size: clamp(12.5px, 1.2vh, 24px); }
  .tv-net, .tv-head .pill { font-size: clamp(15px, min(0.95vw, 1.75vh), 34px); }
  .tv-grid { gap: clamp(14px, 1.3vh, 36px); }
  .tv-court { gap: clamp(12px, 1.1vh, 28px); padding: clamp(18px, min(1.5vw, 2.8vh), 56px) clamp(22px, min(1.8vw, 3.4vh), 68px); }
  .tv-head b { font-size: clamp(18px, min(1.4vw, 2.6vh), 54px); }
  .tv-body { grid-template-columns: minmax(0, 1fr) clamp(48px, min(28cqi, 12vh), 300px); gap: clamp(18px, 1.7vh, 40px); }
  .tv-info { gap: clamp(6px, 0.6vh, 16px); }
  .tv-court .timer { font-size: clamp(32px, min(15cqi, 11vh), 200px); }
  .tv-court.phase-libre .timer, .tv-court.phase-mantenimiento .timer { font-size: clamp(28px, min(11cqi, 8vh), 150px); }
  .tv-court .who { font-size: clamp(18px, min(1.4vw, 2.6vh), 54px); }
  .tv-court .meta { font-size: clamp(16px, min(1.05vw, 2vh), 38px); }
  .tv-foot { font-size: clamp(16px, min(1vw, 1.85vh), 34px); }
  /* Con 7 o más canchas, la cancha dibujada, el relleno y el espacio también siguen creciendo en 4K
     (hasta 1080p quedan igual que arriba): si no, la cancha queda chica al lado del reloj. */
  .tv-grid:has(> .tv-court:nth-child(7)) { gap: clamp(10px, 0.93vh, 26px); }
  .tv-grid:has(> .tv-court:nth-child(7)) .tv-court { padding: clamp(10px, min(1vw, 1.85vh), 44px) clamp(14px, min(1.2vw, 2.2vh), 56px); }
  .tv-grid:has(> .tv-court:nth-child(7)) .tv-body { grid-template-columns: minmax(0, 1fr) clamp(36px, min(22cqi, 8.5vh), 280px); gap: clamp(10px, 0.93vh, 26px); }
  .tv-grid:has(> .tv-court:nth-child(9)) .tv-court { padding-block: clamp(8px, min(0.8vw, 1.5vh), 40px); }
  .tv-grid:has(> .tv-court:nth-child(9)) .tv-body { grid-template-columns: minmax(0, 1fr) clamp(32px, min(20cqi, 7vh), 240px); }
}

/* La fecha corta del encabezado en el celular (al lado va la marca del club): "Lun 5 ene · 19:00". */
.pagehead .d-short { display: none; }
@media (max-width: 480px) {
  .pagehead .d-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pagehead .d-short { display: inline; }
}
/* "hora de la demo" no se parte; en el celular va "Mié 14 oct · 19:20 · demo", en una línea de 320 a
   430 px (el texto entero sigue para lectores de pantalla y en el title). */
.demo-hour { white-space: nowrap; }
.pagehead .h-short { display: none; }
@media (max-width: 480px) {
  .pagehead .with-demo .d-long, .pagehead .with-demo .h-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pagehead .with-demo .d-short, .pagehead .with-demo .h-short { display: inline; }
}
/* En 320 a 340 px, "Mié 30 sept · 19:20 · demo" no entra junto al chip "Demo": queda el chip. */
@media (max-width: 340px) {
  .pagehead .demo-tag { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* 320 px: "WhatsApp" y su ícono entran en su celda de la barra de abajo. */
@media (max-width: 340px) {
  .nav .label { font-size: 10px; }
  .nav button .icon { width: 44px; padding: 3px 11px; }
}
/* Agenda en el celular: unos 88 px por hora (--hours lo pone app.js), así un turno de 90 min muestra
   el nombre. La agenda se desplaza de lado y abre en la hora de ahora. */
@media (max-width: 720px) {
  .agenda { min-width: calc(var(--label) + var(--hours, 15) * 88px); }
}
/* Toques de al menos 44 px de ancho también en las flechas del día, "Cerrar" y "Ver como tabla". */
@media (pointer: coarse) {
  .daynav .ghost.tiny, .linkish { min-width: 44px; }
  .tableview summary { min-height: 44px; padding: 12px 0; line-height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .tv-actions { transition: none; }
}
/* L5-equipo */
/* El nombre de este equipo en Ajustes, y en caja junto a cada cobro, anulación o saldo condonado. */
.p-device .device-name { margin: 16px 0 6px; }
.p-device .device-name + .muted { margin: 0 0 12px; }
.p-device .device-name + .muted:last-child { margin-bottom: 0; }
.p-device > .notice { margin: 12px 0 0; }
.p-device > .ghost[data-action="reset"] { margin-top: 4px; }
.pay-by { color: var(--muted); font-size: 12px; font-weight: 400; }
/* fin L5-equipo */

/* L6-recados */
/* Recados para recepción: el botón de arriba (en el celular reemplaza a la vista, que no cabe en la
   barra de abajo), la línea en En vivo y la vista con la lista y "Anotar recado". Ámbar = sin leer. */
.inbox-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 7px 11px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.inbox-btn .icon { width: 15px; height: 15px; }
.inbox-btn.has { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.inbox-btn .count { display: none; }
.alert.recado { --tone: #f59e0b; }
@media (min-width: 721px) {
  .inbox-btn:not(.has) { display: none; }
}
/* Con Recados, las ocho pestañas de la tablet entran sin íconos hasta 980 px (con ícono, desde ahí). */
@media (min-width: 801px) and (max-width: 979px) {
  .nav button .icon { display: none; }
}
/* En el celular Recados va en la barra de abajo, con su contador: el botón de arriba no hace falta. */
@media (max-width: 720px) {
  .inbox-btn { display: none; }
}
.inboxgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: "open new" "done new";
  gap: 16px;
  align-items: start;
}
.inbox-open { grid-area: open; }
.inbox-new { grid-area: new; }
.inbox-done { grid-area: done; }
@media (max-width: 1179px) {
  .inboxgrid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "open" "new" "done"; }
}
.recados { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.recado {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius);
  background: var(--surface);
}
.recado.done { border-left-color: var(--line-strong); background: var(--surface-2); }
.recado header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.recado header b { min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.recado time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.r-meta a { font-weight: 500; color: var(--brand); text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 2px; font-variant-numeric: tabular-nums; }
.r-warn { font-weight: 600; color: var(--warn); }
/* Escapado en app.js; los saltos de línea del recado se ven tal cual. */
.r-text { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.recado.done .r-text { color: var(--ink-2); }
.r-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.recado.done .r-foot .linkish { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.inbox-new .fields { margin: 12px 0; }
.field textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 121, 141, 0.14); }
.inbox-done summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .inbox-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
  .inbox-btn.has:hover { border-color: #f59e0b; background: var(--warn-soft); }
  .r-meta a:hover { text-decoration: underline; }
}
@media (pointer: coarse) {
  .inbox-btn { min-width: 44px; min-height: 44px; justify-content: center; }
  .field textarea { font-size: 16px; }
  .inbox-done summary { display: flex; align-items: center; min-height: 44px; }
  .r-meta a { display: inline-flex; align-items: center; min-height: 40px; }
}
/* fin L6-recados */
/* L2-agenda */
/* Buscar una reserva: el campo va a la derecha del día en la Agenda (debajo, en el celular) y los
   resultados en una tarjeta, antes de las cifras. Lo demás de la Agenda sigue a todo el ancho. */
.agenda-view { flex-flow: row wrap; align-items: center; }
.agenda-view > * { flex: 1 1 100%; min-width: 0; }
/* La cabecera de la Agenda: el día, Buscar (crece) e "Imprimir el día", en una fila; en el celular,
   el día con el ícono de imprimir arriba y Buscar abajo, a todo el ancho. */
.agenda-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.agenda-head > .daynav { flex: 0 1 auto; }
.agenda-head > .search-field { flex: 1 1 260px; max-width: 460px; margin-left: auto; }
/* Los resultados van en su propia fila, a todo el ancho: el buscador y "Imprimir el día" no se mueven. */
.agenda-head > .search-results { flex: 1 0 100%; order: 10; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field > .icon { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search-field input {
  width: 100%;
  min-width: 0;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search-field input::placeholder { color: var(--faint); }
.search-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 121, 141, 0.14); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.search-results { padding: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.search-results:empty { display: none; }
.search-results > p { margin: 0; padding: 8px 6px; }
.found-list { display: flex; flex-direction: column; }
.found {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  padding: 9px 6px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  transition: background 0.15s var(--ease);
}
.found-list > .found:first-child { border-top-color: transparent; }
.found > span { min-width: 0; }
.found b { display: block; overflow: hidden; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.found small { display: block; overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.found.off .f-who b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.found:focus-visible { outline-offset: -2px; }
/* La reserva elegida en el panel de su cancha: con Mover y, si es de un turno fijo, anular las siguientes. */
.drawer .upcoming { flex-wrap: wrap; }
.drawer .upcoming > .fixes { flex: 1 1 100%; margin-top: 2px; }
/* Mover y turno fijo, en el formulario de reservar. */
.move-from { margin: 4px 0 0; }
.move-keep { margin: -6px 0 16px; }
.field.repeat { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.field.repeat select { width: auto; min-width: 140px; }
.repeat-note { margin-top: 4px; }
.found-ticket header .pill { flex: none; }
.found-note { margin: 12px 0 0; color: var(--ink-2); font-size: 13px; }
@media (hover: hover) and (pointer: fine) {
  .found:hover { background: var(--surface-2); }
}
@media (max-width: 720px) {
  .agenda-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .agenda-head > .search-field { grid-column: 1 / -1; grid-row: 2; max-width: none; margin-left: 0; }
  .agenda-head > .print-day { grid-column: 2; grid-row: 1; min-width: 44px; padding-inline: 10px; }
  .agenda-head > .print-day span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* ‹ día › siempre en la misma fila y en el mismo lugar; "Volver a hoy" abajo, y los resultados de
     Buscar a lo ancho, como el campo. */
  .daynav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 8px; }
  .daynav b { overflow: hidden; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
  .daynav .d-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .daynav .d-short { display: inline; }
  .daynav .linkish { grid-column: 1 / -1; justify-self: start; }
  .agenda-head > .search-results { grid-column: 1 / -1; }
  .found { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 2px 10px; }
}
@media (pointer: coarse) {
  .found { min-height: 52px; }
  .search-field input { min-height: 44px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .found, .search-field input { transition: none; }
}
/* fin L2-agenda */
/* L4-datos */
/* Un enlace con aspecto de .linkish (el aviso de privacidad en la entrada y en Ajustes). */
a.linkish { display: inline-flex; align-items: center; text-decoration: none; }
.gate-card a.linkish { margin-top: -4px; font-size: 12px; }
@media (hover: hover) and (pointer: fine) {
  a.linkish:hover { text-decoration: underline; }
}
/* Datos personales en Ajustes: en escritorio, a la derecha, al final (la regla de L2-club); en la
   tablet y el celular, al final. */
.privacy-search { display: flex; align-items: flex-end; gap: 8px; margin: 0 0 4px; }
.privacy-search .field { flex: 1; min-width: 0; }
/* El botón tan alto como el campo, en su misma línea. */
.privacy-search > .ghost { flex: none; align-self: stretch; margin-top: 24px; }
.privacy-result { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin: 14px 0 16px; }
.privacy-result:empty { display: none; }
.settings .privacy-result > p { margin: 0; }
.privacy-found { color: var(--ink-2); font-size: 13px; }
.privacy-found b { color: var(--ink); }
.privacy-found:focus { outline: none; }
.privacy-found:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.privacy-list { margin: 0; padding: 0; list-style: none; }
.privacy-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.privacy-list li:first-child { border-top: 0; padding-top: 0; }
.privacy-list li > div { min-width: 0; }
.privacy-list b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.privacy-list li > div > span { color: var(--muted); font-size: 12.5px; }
.privacy-list .pill { flex: none; }
.p-privacy > .muted:last-of-type { margin-top: 16px; }

/* Aviso de privacidad (privacidad.html): una página para leer, con el fondo, el tipo y las tarjetas
   del panel. */
.doc-head, .doc, .doc-foot { width: 100%; max-width: 760px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 20px; padding-bottom: 8px; }
.doc-head .brand { padding-left: 0; color: inherit; text-decoration: none; }
.doc { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; padding-bottom: 12px; }
.doc .panel { padding: 20px 22px; }
.doc h1 { margin: 0 0 10px; font-family: var(--display); font-size: clamp(28px, 6vw, 36px); font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.doc h2 { margin: 0 0 8px; font-size: 16px; color: var(--ink); }
.doc-intro h2 { margin-top: 18px; }
.doc p, .doc li { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.doc p { margin: 0 0 10px; }
.doc p:last-child { margin-bottom: 0; }
.doc .muted { font-size: 13px; }
.doc ul { margin: 0; padding-left: 20px; }
.doc li + li { margin-top: 6px; }
.doc p + ul, .doc ul + p { margin-top: 10px; }
.doc b { color: var(--ink); font-weight: 600; }
.doc a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.doc code { font-size: 13px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); overflow-wrap: anywhere; }
.doc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding-top: 8px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12.5px; }
.doc-foot span a { color: var(--brand); }
@media (max-width: 720px) {
  .doc .panel { padding: 16px; }
  .doc p, .doc li { font-size: 15px; }
}
@media print {
  .doc-page { display: block; background: #fff; }
  .doc-head .linkish, .doc-foot .linkish { display: none; }
  .doc .panel { box-shadow: none; break-inside: avoid; }
}
/* fin L4-datos */
/* L3-cierres */
/* Días cerrados y bloqueos. Una cancha bloqueada se ve como en mantenimiento (borde punteado, la
   cancha dibujada tenue); en la agenda, una franja gris rayada con el motivo; en Ajustes, la lista de
   los próximos y el formulario. Gris: es un estado, no una acción. */
.phase-bloqueada { --phase: var(--line-strong); border-style: dashed; border-left-style: solid; }
.phase-bloqueada .court-art { opacity: 0.45; }
.tv-court.phase-bloqueada .timer { font-size: clamp(36px, 4.2vw, 88px); font-size: clamp(28px, 11cqi, 88px); color: var(--muted); }
@media (min-width: 721px) {
  .tv-court.phase-bloqueada .timer { font-size: clamp(28px, min(11cqi, 8vh), 150px); }
}
/* Encima de las ofertas y debajo de las reservas y de la línea de "ahora". Un toque pasa a la fila
   (el motivo sale en un aviso); al pasar el mouse, el horario sale en el title. */
.closeband {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  border-inline: 1px solid var(--line-strong);
  background: repeating-linear-gradient(135deg, #eef0f3 0 6px, #e2e5ea 6px 12px);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.3;
  cursor: not-allowed;
}
.closeband b, .closeband small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.closeband b { font-weight: 600; }
.closeband small { color: var(--muted); font-size: 11px; }
/* Una franja angosta (media hora en el celular) no muestra restos de texto: queda el rayado y el
   motivo sale al tocarla. Un navegador sin consultas de contenedor la corta con puntos, como antes. */
.closeband { container-type: inline-size; }
@container (max-width: 64px) {
  .closeband b, .closeband small { display: none; }
}
.swatch.cierre { border-radius: 2px; background: repeating-linear-gradient(135deg, #c3c8d1 0 2px, #e2e5ea 2px 4px); }
.closed-note { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: repeating-linear-gradient(135deg, var(--surface) 0 8px, var(--surface-2) 8px 16px); color: var(--ink-2); font-size: 13px; }
.closed-note .icon { width: 18px; height: 18px; color: var(--muted); }
.closed-note b { color: var(--ink); font-weight: 600; }
.closures { margin: 4px 0 0; padding: 0; list-style: none; }
.closures li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.closures li > div { min-width: 0; }
.closures b { display: block; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.closures span { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.closures .iconbtn { flex: none; }
.p-closures .subhead { display: block; margin-top: 18px; }
.p-closures .fields { margin: 10px 0 0; }
/* En escritorio, el panel va en la columna del club, debajo de él (la regla de L2-club). */
/* fin L3-cierres */

/* L1-cierre */
/* Caja: Cuentas | Cierre del día, como el período de Estadísticas. En el escritorio va en el
   encabezado, al lado de "Caja" (la caja no baja); más angosto, arriba de la vista. El cierre: el día
   con sus flechas y lo que se descarga o imprime, cifras, medios de pago, correcciones y cada pago. */
.cajatabs { align-self: flex-start; }
.cajatabs.in-head { display: none; }
@media (min-width: 1180px) {
  .cajatabs.in-head { display: flex; flex-wrap: nowrap; align-self: center; margin-right: auto; }
  .cajatabs.in-main { display: none; }
}
.cierre-view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cierre-view > p { margin: 0; }
.cierre-view .toolbar .row-actions { gap: 6px; }
.cierregrid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.cierre-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cierre-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cierre-table th, .cierre-table td { padding: 8px 2px; border-top: 1px solid var(--line); text-align: right; font-weight: 400; color: var(--ink-2); }
.cierre-table th:first-child { text-align: left; font-weight: 500; }
.cierre-table thead th { padding-top: 0; border-top: 0; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.cierre-table tfoot th, .cierre-table tfoot td { border-top-color: var(--line-strong); font-weight: 600; color: var(--ink); }
.cierre-table + .muted { margin: 10px 0 0; }
.cierre-view .panel h3 + .subhead { margin-top: 8px; }
.cfix { margin: 4px 0 0; padding: 0; list-style: none; }
.cfix li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-top: 1px dashed var(--line-strong); font-size: 13px; color: var(--ink-2); }
.cfix li:first-child { border-top: 0; }
.cfix li > span { min-width: 0; overflow-wrap: anywhere; }
.cfix li > span b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cfix small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.cfix-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.cpays { margin: 0; padding: 0; list-style: none; }
.cpays li + li .cpay { border-top: 1px solid var(--line); }
.cpay { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; width: 100%; padding: 10px 2px; border: 0; border-radius: 0; background: none; text-align: left; font-size: 13px; color: var(--ink-2); transition: background 0.15s var(--ease); }
.cpay time { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cp-who { min-width: 0; }
.cp-who b { display: block; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.cp-who small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.cp-amt { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.cpay.voided time, .cpay.voided .cp-who b, .cpay.voided .cp-amt { color: var(--muted); }
/* "Imprimir el día" a la derecha de las flechas de la agenda, con la letra de un botón (no la de ‹ ›). */
.print-day { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; line-height: 1.2; }
.print-day .icon { width: 16px; height: 16px; flex: none; }
@media (hover: hover) and (pointer: fine) {
  button.cpay:hover { background: var(--surface-2); }
}
@media (pointer: coarse) {
  .print-day { font-size: 14px; }
}
@media (max-width: 1179px) {
  .cierregrid { grid-template-columns: minmax(0, 1fr); }
}
/* En el celular, imprimir y descargar ocupan el ancho: dos arriba y "Descargar el mes" abajo. */
@media (max-width: 720px) {
  .cierre-view .toolbar .row-actions { width: 100%; }
  .cierre-view .toolbar .row-actions > * { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .cpay { transition: none; }
}
/* Hojas impresas (el cierre y la hoja del día): fuera de #app y solo al imprimir. En blanco y negro,
   en A4 o carta; el resto del panel no sale. */
.print-sheet { display: none; }
@media print {
  @page { margin: 10mm 12mm; }
  body.printing { display: block; min-height: 0; padding: 0; background: #fff; }
  body.printing > :not(.print-sheet) { display: none; }
  body.printing > .print-sheet { display: block; }
  .print-sheet { color: #000; font: 9pt/1.25 var(--font); }
  .print-sheet h1 { margin: 0; font-size: 15pt; font-weight: 600; }
  .print-sheet h2 { margin: 12pt 0 4pt; font-size: 11pt; font-weight: 600; break-after: avoid; page-break-after: avoid; }
  .print-sheet p { margin: 2pt 0; }
  .print-sheet b { font-weight: 600; }
  .ps-head { margin-bottom: 8pt; padding-bottom: 6pt; border-bottom: 1pt solid #000; }
  .ps-muted { color: #333; }
  .ps-note { padding: 4pt 6pt; border: 1pt solid #000; }
  .print-sheet table { width: 100%; margin: 4pt 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
  .print-sheet th, .print-sheet td { padding: 1.4pt 4pt; border-bottom: 0.5pt solid #999; text-align: left; vertical-align: top; font-weight: 400; }
  .print-sheet thead th { border-bottom: 1pt solid #000; font-size: 9pt; font-weight: 600; }
  .print-sheet tfoot th { border-top: 1pt solid #000; border-bottom: 0; font-weight: 600; }
  .print-sheet .r { text-align: right; white-space: nowrap; }
  .print-sheet tr { break-inside: avoid; page-break-inside: avoid; }
  .print-sheet .ps-sum { width: auto; min-width: 55%; }
  .ps-cash { margin-top: 4pt; font-size: 11pt; }
  .ps-void td { color: #333; }
  .ps-group th { padding-top: 5pt; border-bottom: 1pt solid #000; font-size: 9.5pt; font-weight: 600; }
  .ps-time { white-space: nowrap; }
  .ps-closed td { font-style: italic; }
  .ps-closed-club { margin: 0 0 6pt; padding: 4pt 6pt; border: 1pt solid #000; }
  /* El comprobante: angosto, para una impresora de 80 mm (en una hoja carta sale arriba, al centro). */
  @page receipt { size: 80mm auto; margin: 4mm; }
  .ps-receipt { page: receipt; max-width: 72mm; margin: 0 auto; font-size: 9.5pt; line-height: 1.45; }
  .ps-receipt h1 { font-size: 12pt; }
  .ps-receipt hr { margin: 6pt 0; border: 0; border-top: 0.75pt dashed #555; }
  .ps-receipt td { border-bottom: 0; padding: 1pt 0; }
  .ps-receipt .ps-total td { padding-top: 3pt; border-top: 1pt solid #000; font-weight: 600; }
  /* Las notas no se parten entre dos páginas: el bloque entero pasa a la siguiente. */
  .ps-notes { break-inside: avoid; page-break-inside: avoid; }
  .ps-lines i { display: block; height: 7mm; border-bottom: 0.5pt solid #000; }
  .ps-sign { display: flex; gap: 14pt; margin-top: 8pt; break-inside: avoid; }
  .ps-sign span { flex: 1; margin-top: 28pt; padding-top: 3pt; border-top: 0.5pt solid #000; font-size: 9pt; }
}
/* fin L1-cierre */

/* Sin conexión (sinred.js): una franja arriba de cada vista, ámbar porque es un estado, y lo hecho sin
   conexión que no se pudo guardar al volver la red, en rojo hasta que alguien lo lee. */
.offline-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--warn-line); border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.offline-note b { font-weight: 600; color: var(--warn); }
.unsent { margin: 0 0 16px; border-color: var(--hot-line); }
.unsent > h3 { margin: 0 0 6px; white-space: normal; color: var(--hot-ink); }
.unsent > .muted { margin: 0; font-size: 12.5px; }
/* Primero se lee (el motivo de cada uno) y después "Entendido". */
.unsent > .row-actions { margin-top: 12px; }
.unsent ul { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.unsent li { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--hot-soft); font-size: 13px; overflow-wrap: anywhere; }
.unsent li b { font-weight: 600; color: var(--ink); }
.unsent li span { font-size: 12.5px; color: var(--ink-2); }
/* Un cobro que no quedó en ninguna cuenta (plata sin anotar) resalta; lo que se subió distinto, no. */
.unsent li.money { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); }
.unsent li.nota { background: var(--surface-2); }

/* El celular: el encabezado queda en una línea aunque el título sea largo o diga "Sin conexión". */
@media (max-width: 720px) {
  .pagehead small, .pagehead h1 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .head-actions, .machine { flex: none; white-space: nowrap; }
}
/* La tablet: la agenda con unos 88 px por hora, como en el celular (con 57 px se cortaban los nombres);
   se desplaza de lado. */
@media (min-width: 721px) and (max-width: 1179px) {
  .agenda { min-width: max(980px, calc(var(--label) + var(--hours, 15) * 88px)); }
}
/* La "×" del buscador, en el turquesa del club (la del navegador es azul). */
.search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  cursor: pointer;
  background: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
/* "Ver cierres" deja el título del panel a la vista, bajo el encabezado fijo. */
.p-closures { scroll-margin-top: 96px; }
/* El teléfono de un recado se toca fácil (44 px de alto) sin agrandar la línea. */
.recado a[href^="tel:"] { display: inline-block; padding: 12px 4px; margin: -12px -4px; }

/* ── Para vender: menos tarjetas sueltas, estados sin franjas de color ── */

/* Las cifras de arriba, en una sola banda con divisiones finas (no cuatro tarjetas sueltas). */
.kpis { gap: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi { background: none; border: 0; border-radius: 0; box-shadow: none; }
.kpi + .kpi { box-shadow: inset 1px 0 0 var(--line); }
.kpi .k-top { padding: 14px 18px 2px; }
.kpi b { margin-top: 6px; font-family: var(--display); font-size: 26px; letter-spacing: -0.02em; }
.kpi .k-foot { margin-top: 0; padding: 2px 18px 14px; background: none; border-top: 0; }
@media (max-width: 1179px) {
  .kpi + .kpi { box-shadow: none; }
  .kpi:nth-child(2n) { box-shadow: inset 1px 0 0 var(--line); }
  .kpi:nth-child(n + 3) { box-shadow: inset 0 1px 0 var(--line); }
  .kpi:nth-child(2n):nth-child(n + 3) { box-shadow: inset 1px 0 0 var(--line), inset 0 1px 0 var(--line); }
}
@media (max-width: 720px) {
  .kpis { gap: 0; }
  .kpi .k-top { padding: 11px 13px 1px; }
  .kpi b { font-size: 20px; }
  .kpi .k-foot { padding: 1px 13px 11px; }
}

/* Lo que pide atención: una lista, con un punto del color del estado y "Ver" como enlace. */
.alerts { gap: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.alert { position: relative; padding: 11px 14px 11px 30px; background: none; border: 0; border-radius: 0; box-shadow: none; }
.alert + .alert { border-top: 1px solid var(--line); }
.alert::before { content: ""; position: absolute; left: 14px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.alert.hot { background: #fffafa; }
.alert span { padding: 4px 2px; border: 0; background: none; color: var(--brand); }
.alert span::after { content: " ›"; }
@media (hover: hover) {
  .alert:hover { border-color: var(--line); background: var(--surface-2); }
  .alert:hover span { text-decoration: underline; text-underline-offset: 3px; }
}

/* Canchas: el estado lo dicen la etiqueta, el reloj y la barra; el borde solo cambia de color cuando
   piden atención (por terminar, esperando, tiempo extra). Sin franjas laterales. */
.court, .court-panel, .tv-court { border-left-width: 1px; border-left-color: var(--line); }
.court.phase-soon, .court.phase-ending, .court.phase-waiting, .court.phase-noshow,
.court-panel.phase-soon, .court-panel.phase-ending, .court-panel.phase-waiting, .court-panel.phase-noshow { border-color: var(--warn-line); }
.court.phase-extra, .court-panel.phase-extra { border-color: var(--hot-line); }
.court.phase-mantenimiento, .court.phase-bloqueada { border-left-style: dashed; }

/* Recados: sin leer, un punto ámbar junto al nombre; resueltos, en gris. */
.recado { border-left-width: 1px; border-left-color: var(--line); }
.recado:not(.done) header b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 1px 0; border-radius: 50%; background: #f59e0b; vertical-align: middle; }

/* Estadísticas en el escritorio: el gráfico por día tan alto como el mapa de demanda de al lado (sin
   un hueco bajo las barras). */
@media (min-width: 1180px) {
  .daybars { --bars: 290px; }
}

/* WhatsApp en proceso: los tres pasos de cómo va a funcionar. */
.steps { display: grid; gap: 10px; width: 100%; margin: 4px 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 50px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 12px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 600; }
.steps b { font-size: 14px; font-weight: 600; color: var(--ink); }
.steps span { font-size: 13px; color: var(--muted); }

/* La Pantalla, en oscuro: un TV del club se lee mejor de lejos y no encandila en la noche. La cancha
   dibujada queda clara, como vista desde arriba. */
.tv {
  --tv-bg: #0d1c20;
  --tv-card: #13272c;
  --tv-line: rgba(255, 255, 255, 0.09);
  --tv-ink: #f1f7f8;
  --tv-muted: #9db3b8;
  background: var(--tv-bg);
  color: var(--tv-ink);
}
.tv .brand strong, .tv-clock, .tv-head b, .tv-court .who { color: var(--tv-ink); }
.tv .muted, .tv-court .meta, .tv-foot { color: var(--tv-muted); }
.tv-court { background: var(--tv-card); border-color: var(--tv-line); box-shadow: none; }
.tv-court.phase-live { border-color: rgba(3, 170, 197, 0.45); }
.tv-court.phase-soon, .tv-court.phase-ending, .tv-court.phase-waiting, .tv-court.phase-noshow { border-color: rgba(245, 158, 11, 0.5); }
.tv-court.phase-extra { border-color: rgba(248, 113, 113, 0.6); background: #2a1d20; }
.tv-court .timer { color: var(--tv-ink); }
.tv-court.phase-soon .timer, .tv-court.phase-ending .timer { color: #fbbf24; }
.tv-court.phase-extra .timer { color: #f87171; }
.tv-court.phase-libre .timer { color: #4ade80; }
.tv-court.phase-mantenimiento .timer { color: var(--tv-muted); }
.tv .pill { border-color: var(--tv-line); background: rgba(255, 255, 255, 0.06); color: var(--tv-ink); }
.tv .pill.t-live { border-color: rgba(3, 170, 197, 0.4); background: rgba(3, 170, 197, 0.14); color: #7fdcec; }
.tv .pill.t-warn { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.tv .pill.t-hot { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.14); color: #fca5a5; }
.tv .pill.t-ok { border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.12); color: #86efac; }
.tv .ghost, .tv .linkish { color: var(--tv-muted); }
.tv .ghost { border-color: var(--tv-line); background: rgba(255, 255, 255, 0.04); }

/* Recados: lo sin leer arriba y los resueltos justo debajo; el alto del formulario no los separa. */
.inboxgrid { grid-template-rows: auto 1fr; }
/* "Continuar" sin el halo de color. */
.login .solid { box-shadow: var(--shadow); }
/* Títulos de página con la letra de las cifras (Inter Tight): más carácter, misma familia. */
.pagehead h1 { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
@media (max-width: 720px) {
  .pagehead h1 { font-size: 18px; }
}

/* ── Revisión 10/10 ── */

/* Confirmar o pedir un motivo: el cuadro del panel (ask() en app.js), no el del navegador. */
.ask { position: fixed; inset: 0; z-index: 40; }
.ask-back { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.42); }
.ask-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.ask-card h2 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; color: var(--ink); }
.ask-card p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.ask-card .field { margin-top: 16px; }
.ask-card .field input { width: 100%; }
.ask-card .ask-error { margin: 6px 0 0; color: var(--hot-ink); font-size: 13px; font-weight: 500; }
.ask-card input[aria-invalid="true"], .login input[aria-invalid="true"] { border-color: var(--hot); box-shadow: 0 0 0 3px var(--hot-soft); }
.ask-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.ask-actions button { min-height: 40px; padding: 9px 16px; }
.solid.danger { background: var(--hot-ink); border-color: var(--hot-ink); box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .solid.danger:hover { background: #991b1b; border-color: #991b1b; }
}
@media (max-width: 720px) {
  .ask-card { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); }
  .ask-actions button { flex: 1; min-height: 44px; }
}

/* Error del ingreso junto al campo. */
.field-error { margin: 2px 0 0; color: var(--hot-ink); font-size: 13px; font-weight: 500; }

/* Agenda en un notebook: una hora mide al menos 64 px (un turno de 90 min muestra "Nombre A." y su
   horario); más angosto se desplaza de lado y abre en la hora de ahora. */
@media (min-width: 1180px) {
  .agenda { min-width: max(980px, calc(var(--label) + var(--hours, 15) * 64px)); }
}

/* Sin franjas laterales de color: el estado va en el fondo y en un borde parejo. */
.block { border: 1px solid #d3d9e2; }
.block.por_cobrar { border-color: #efc778; }
.block.pagada { border-color: var(--ok-line); }
.block.en_juego { border-color: var(--brand); }
.queue .account.on { box-shadow: inset 0 0 0 1px var(--brand-line); }
.drawer .upcoming.on { box-shadow: inset 0 0 0 1px var(--brand-line); }
.unsent li.money { box-shadow: inset 0 0 0 1px var(--warn-line); }

/* Lo elegido en un selector (medio de pago, duración, semanas, %) va en suave: el turquesa lleno queda
   para la acción principal. */
.method.on, .seg button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-hover); box-shadow: inset 0 0 0 1px var(--brand); }
@media (hover: hover) and (pointer: fine) {
  .method.on:hover, .seg button.on:hover { background: #d7eff3; border-color: var(--brand-hover); }
}
/* "Cobrar este monto" es secundario hasta que se escribe un monto. */
#pay-amount:placeholder-shown ~ .wide-btn[data-mode="custom"] { background: var(--surface); border-color: var(--brand-line); color: var(--brand-hover); box-shadow: none; }

/* Contadores de la barra: el mismo gris siempre; el de En vivo (tiempo extra) en rojo. */
.nav button.on .count { background: var(--badge); color: #fff; }
.nav button .count.hot, .nav button.on .count.hot { background: var(--hot-ink); color: #fff; }

/* "Cobradas hoy" se pliega; su título hace de botón. */
.paid-list > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; }
.paid-list > summary::-webkit-details-marker { display: none; }
.paid-list > summary::after { content: ""; width: 7px; height: 7px; margin: 16px 4px 0 0; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
.paid-list[open] > summary::after { transform: rotate(45deg); }
@media (pointer: coarse) {
  .paid-list > summary { min-height: 44px; }
}

/* Las reservas de "Después" en el panel de la cancha: texto a la izquierda, botones a la derecha, siempre igual. */
.drawer .upcoming { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.drawer .upcoming > :not(:first-child):not(.row-actions) { grid-column: 1 / -1; }

/* La Pantalla: el reloj al centro de verdad y la próxima llegada legible desde la cancha. */
@media (min-width: 721px) {
  .tv-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .tv-top > :last-child { justify-self: end; }
}
.tv-foot { font-size: clamp(16px, 1.3vw, 26px); }

/* Los avisos, al centro de la columna principal cuando la barra lateral está al lado. */
@media (min-width: 1024px) {
  .app .toasts { left: calc(50% + var(--side) / 2); }
}

/* "Resueltos" y "Ver como tabla": el mismo indicador que "Cobradas hoy", no el triángulo del navegador. */
.inbox-done > summary, .tableview > summary { list-style: none; }
.inbox-done > summary::-webkit-details-marker, .tableview > summary::-webkit-details-marker { display: none; }
.inbox-done > summary::after, .tableview > summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 10px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.15s; }
.inbox-done[open] > summary::after, .tableview[open] > summary::after { transform: translateY(1px) rotate(-135deg); }

/* Celular: la barra de abajo con En vivo, Agenda, Caja, Recados y Más; lo demás (Estadísticas, WhatsApp,
   Pantalla y Ajustes) está en Más. En la tablet y el escritorio, "Más" no aparece. */
.nav .more { display: none; }
@media (max-width: 720px) {
  .nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .nav [data-vista="whatsapp"], .nav [data-vista="estadisticas"], .nav [data-vista="ajustes"] { display: none; }
  .nav .more { display: flex; }
  .nav [data-vista="recados"] .count { background: var(--warn); color: #fff; }
}
.more-list { padding: 4px 0; }
.more-list ul { margin: 0; padding: 0; list-style: none; }
.more-list li + li { border-top: 1px solid var(--line); }
.more-list button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.more-list button > .icon:first-child { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.more-list .more-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.more-list .more-text b { font-size: 15px; font-weight: 600; }
.more-list .more-text small { color: var(--muted); font-size: 13px; }
.more-list button > .icon:last-child { flex: none; width: 18px; height: 18px; color: var(--muted); }
.more-list .soon { flex: none; }
@media (hover: hover) and (pointer: fine) {
  .more-list button:hover { background: var(--surface-2); }
}
