/* =====================================================================
   Orbyta Canchas · sistema de diseño
   Pensado para un mostrador: rapidez, legibilidad bajo presión, celular
   en la mano. Tema oscuro por defecto (identidad Orbyta) y tema claro.
   Los colores se nombran por lo que SON (panel, borde, texto), no por
   cómo se ven, así el mismo nombre sirve en los dos temas.
   ===================================================================== */

:root {
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --bg: #0b0f14;
    --bg-2: #0e141c;
    --panel: #121a24;
    --panel-2: #0f1620;
    --panel-3: #18222e;
    --border: #1f2b3a;
    --border-2: #2a3849;
    --text: #e8eef7;
    --text-2: #c3cedb;
    --muted: #8b9bb0;

    --accent: #3b82f6;
    --accent-hover: #2f6fe0;
    --accent-soft: rgba(59, 130, 246, .16);
    --accent-2: #7c3aed;
    --halo: rgba(59, 130, 246, .22);
    --on-accent: #ffffff;

    --ok: #22c55e;       --ok-soft: rgba(34, 197, 94, .16);    --ok-text: #86efac;
    --warn: #f59e0b;     --warn-soft: rgba(245, 158, 11, .16); --warn-text: #fcd34d;
    --danger: #ef4444;   --danger-soft: rgba(239, 68, 68, .16); --danger-text: #fca5a5;
    --info: #38bdf8;     --info-soft: rgba(56, 189, 248, .16); --info-text: #7dd3fc;

    --capa: 255 255 255;   /* base de las capas translúcidas: blanco en oscuro, negro en claro */

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
    --focus: 0 0 0 3px rgba(59, 130, 246, .45);

    --nav-h: 56px;
    --sidebar-w: 240px;
    --bottom-h: 60px;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f3f5f9;
    --bg-2: #eef2f7;
    --panel: #ffffff;
    --panel-2: #f6f8fb;
    --panel-3: #eef2f7;
    --border: #e3e8ef;
    --border-2: #d3dbe6;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --accent-soft: rgba(59, 130, 246, .12);
    --halo: rgba(59, 130, 246, .16);
    --ok-text: #15803d;
    --warn-text: #b45309;
    --danger-text: #b91c1c;
    --info-text: #0369a1;
    --capa: 15 23 42;
    --shadow: 0 8px 24px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .16);
    color-scheme: light;
}

/* Terracota: cálido, arcilla y arena. Mismos roles, otros colores. */
:root[data-theme="terracota"] {
    --bg: #f5ede3;
    --bg-2: #efe4d6;
    --panel: #fffaf3;
    --panel-2: #f8f0e5;
    --panel-3: #f0e4d5;
    --border: #e6d6c3;
    --border-2: #d5bfa6;
    --text: #2c1d15;
    --text-2: #4b3628;
    --muted: #8b7060;
    --accent: #b7410e;
    --accent-hover: #9a3412;
    --accent-soft: rgba(183, 65, 14, .13);
    --accent-2: #d97706;
    --halo: rgba(183, 65, 14, .18);
    --on-accent: #ffffff;
    --ok-text: #166534;
    --warn-text: #92400e;
    --danger-text: #991b1b;
    --info-text: #075985;
    --capa: 44 29 21;
    --shadow: 0 8px 24px rgba(70, 40, 20, .10);
    --shadow-lg: 0 24px 60px rgba(70, 40, 20, .18);
    --focus: 0 0 0 3px rgba(183, 65, 14, .35);
    color-scheme: light;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: var(--accent); }
h1, h2, h3 { letter-spacing: -.02em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.oculto-md { }

/* ---- estructura: barra superior + menú lateral + contenido ---- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.topbar-izq, .topbar-der { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marca { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; min-width: 0; }
.marca .logo {
    width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 12px; letter-spacing: 0;
}
.marca img.logo-img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; }
.marca .nombre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca small { color: var(--muted); font-weight: 600; }
.pill-complejo {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px;
    background: var(--accent-soft); color: var(--text); font-weight: 700; font-size: 12.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
.avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
    background: var(--accent-soft); color: var(--accent);
    display: grid; place-items: center; font-weight: 800; font-size: 12.5px;
}
.usuario-nombre { font-weight: 600; font-size: 13px; color: var(--text-2); }
.btn.btn-icono { width: 36px; height: 36px; padding: 0; border-radius: 10px; flex: 0 0 auto; }
.btn.btn-icono svg { width: 18px; height: 18px; }
.nav-burger { display: none; }

.cuerpo { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--nav-h)); }
.sidebar {
    position: sticky; top: var(--nav-h);
    height: calc(100vh - var(--nav-h)); overflow: auto;
    padding: 12px 12px 20px;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
}
.nav-seccion { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 14px 10px 6px; font-weight: 700; }
.nav-seccion:first-child { margin-top: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 10px;
    color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13.5px;
    transition: background .12s, color .12s;
}
.nav-link:hover { background: rgb(var(--capa) / .06); color: var(--text); }
.nav-link.activo { background: var(--accent-soft); color: var(--text); }
.nav-link.activo svg { color: var(--accent); }
.nav-link svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-link .badge { margin-left: auto; }
.sidebar-overlay { display: none; position: fixed; inset: var(--nav-h) 0 0 0; background: rgba(2, 6, 23, .55); z-index: 39; }
.sidebar-overlay.abierto { display: block; }
.selector-complejo { margin: 18px 6px 0; padding-top: 12px; border-top: 1px solid var(--border); }
.selector-complejo form { margin: 0 0 4px; }

.contenido { padding: 18px 22px 48px; width: 100%; max-width: 1500px; min-width: 0; }

/* barra inferior (celular) */
.bottom-nav {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; height: var(--bottom-h); z-index: 35;
    background: var(--panel); border-top: 1px solid var(--border);
    justify-content: space-around; align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; min-width: 64px; }
.bottom-nav a.activo { color: var(--accent); }
.bottom-nav svg { width: 22px; height: 22px; }

/* ---- encabezado de página ---- */
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.encabezado h1 { margin: 0; font-size: 22px; font-weight: 800; }
.sub { color: var(--muted); font-size: 13px; margin-top: 3px; max-width: 780px; }
.acciones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- tarjetas ---- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { margin: 0 0 10px; font-size: 16px; font-weight: 800; }
.dos-columnas { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 14px; align-items: start; }

/* ---- botones ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--border-2); background: var(--panel-3); color: var(--text);
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .12s, border-color .12s, transform .05s, filter .12s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgb(var(--capa) / .06); }
.btn-ok { background: var(--ok-soft); border-color: rgba(34, 197, 94, .45); color: var(--ok-text); }
.btn-warn { background: var(--warn-soft); border-color: rgba(245, 158, 11, .45); color: var(--warn-text); }
.btn-danger { background: var(--danger-soft); border-color: rgba(239, 68, 68, .45); color: var(--danger-text); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- formularios ---- */
.input {
    width: 100%; height: 40px; padding: 0 12px;
    border-radius: 10px; border: 1px solid var(--border-2);
    background: var(--panel-2); color: var(--text); font: inherit;
    transition: border-color .12s, box-shadow .12s;
}
.input:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.input::placeholder { color: var(--muted); opacity: .8; }
select.input { appearance: auto; }
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
input[type="date"].input, input[type="time"].input { font-variant-numeric: tabular-nums; }
.campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo label, .campo > .etiqueta { font-size: 12px; font-weight: 600; color: var(--muted); }
.campo .ayuda { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-grid .ancho { grid-column: 1 / -1; }
.form-grid .doble { grid-column: span 2; }
@media (max-width: 600px) { .form-grid .doble { grid-column: auto; } }
.check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-pie { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.seccion { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 16px 0 8px; }
.seccion:first-child { margin-top: 0; }
.atajos { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- tablas ---- */
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabla th {
    position: sticky; top: 0; z-index: 1; background: var(--panel);
    text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700;
    padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.tabla td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover td { background: rgb(var(--capa) / .03); }
.tabla tr.inactiva td { opacity: .5; }
.tabla td b { font-weight: 700; }

/* ---- indicadores (kpi) ---- */
.resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dato { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.dato small { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; margin-bottom: 4px; }
.dato b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; word-break: break-word; }

/* ---- etiquetas ---- */
.badge, .chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
    background: rgb(var(--capa) / .08); color: var(--text-2); white-space: nowrap;
}
.badge-ok, .chip-ok { background: var(--ok-soft); color: var(--ok-text); }
.badge-warn, .chip-warn { background: var(--warn-soft); color: var(--warn-text); }
.badge-danger, .chip-danger { background: var(--danger-soft); color: var(--danger-text); }
.badge-info, .chip-info { background: var(--info-soft); color: var(--info-text); }

/* ---- avisos ---- */
.alert { padding: 11px 13px; border-radius: 10px; margin: 0 0 12px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); background: var(--panel-2); }
.alert-error { border-color: rgba(239, 68, 68, .45); background: var(--danger-soft); color: var(--danger-text); }
.alert-ok { border-color: rgba(34, 197, 94, .45); background: var(--ok-soft); color: var(--ok-text); }
.flash { margin-bottom: 12px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(440px, calc(100vw - 32px)); }
.toast {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 12px 12px 14px; border-radius: 12px;
    background: var(--panel); border: 1px solid var(--border); border-left-width: 4px;
    box-shadow: var(--shadow-lg); animation: toast-in .2s ease; font-weight: 500;
}
.toast-ok { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--danger); }
.toast svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.toast-ok svg { color: var(--ok); }
.toast-error svg { color: var(--danger); }
.toast .cerrar { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.vacio { padding: 32px 16px; text-align: center; color: var(--muted); }
.vacio a { color: var(--accent); font-weight: 600; }

/* ---- modales ---- */
.modal {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(2, 6, 23, .62); backdrop-filter: blur(3px);
    display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal.abierto { display: flex; }
.modal-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
    width: min(620px, 100%); max-height: 92vh; overflow: auto;
    box-shadow: var(--shadow-lg); animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head {
    position: sticky; top: 0; z-index: 1;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-body { padding: 16px 18px; }
.modal-pie {
    position: sticky; bottom: 0;
    display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
    padding: 12px 18px; border-top: 1px solid var(--border); background: var(--panel);
}
.modal-pie .izq { margin-right: auto; }
.resumen-modal { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.resumen-modal .dato { padding: 8px 10px; box-shadow: none; }
.resumen-modal .dato b { font-size: 14px; }
.progreso { height: 8px; border-radius: 999px; background: rgb(var(--capa) / .1); overflow: hidden; margin: 8px 0 4px; }
.progreso > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }

/* ---- grilla del día ---- */
.fecha-nav { display: flex; align-items: center; gap: 6px; }
.fecha-nav .input { width: auto; height: 36px; }
.grilla-wrap {
    overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
    max-height: calc(100vh - var(--nav-h) - 168px); box-shadow: var(--shadow);
}
.grilla { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.grilla th {
    position: sticky; top: 0; z-index: 3; background: var(--panel);
    padding: 10px 10px; border-bottom: 1px solid var(--border); text-align: left; min-width: 176px;
}
.grilla th .cancha-nombre { font-weight: 800; font-size: 13px; }
.grilla th small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; margin-top: 1px; }
.grilla th.hora, .grilla td.hora {
    position: sticky; left: 0; z-index: 2; background: var(--panel);
    width: 60px; min-width: 60px; text-align: right; padding-right: 8px;
    font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; vertical-align: top; padding-top: 6px;
}
.grilla th.hora { z-index: 4; }
.grilla td { border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); height: 42px; padding: 0; vertical-align: top; }
.grilla tr.media td { border-bottom-style: dashed; }
.grilla tr.media td.hora { color: transparent; }
.grilla tr.ahora td { border-top: 2px solid var(--accent); }
.grilla tr.ahora td.hora { color: var(--accent); font-weight: 800; }
.celda-libre {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    width: 100%; height: 42px; padding: 0 9px;
    background: transparent; border: 0; cursor: pointer; color: transparent; font: inherit; font-size: 12px;
}
.celda-libre .mas { font-weight: 800; }
.celda-libre .precio { font-weight: 600; }
.celda-libre:hover, .celda-libre:focus-visible { background: var(--accent-soft); color: var(--text); }
.celda-libre:hover .precio { color: var(--muted); }
.celda-libre.pasada { background: repeating-linear-gradient(45deg, transparent 0 6px, rgb(var(--capa) / .035) 6px 12px); }
.celda-libre.pasada:hover { color: var(--muted); }
.celda-reserva {
    display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
    margin: 3px; padding: 6px 9px; border-radius: 9px;
    height: calc(100% - 6px); width: calc(100% - 6px);
    text-align: left; border: 1px solid transparent; border-left-width: 4px;
    cursor: pointer; font: inherit; color: var(--text); background: var(--panel-3);
    transition: filter .12s;
}
.celda-reserva:hover { filter: brightness(1.12); }
.celda-reserva .nombre { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.celda-reserva .nombre span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.celda-reserva .detalle { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.estado-RESERVADA { border-left-color: var(--warn); background: var(--warn-soft); }
.estado-CONFIRMADA { border-left-color: var(--ok); background: var(--ok-soft); }
.estado-COMPLETADA { border-left-color: var(--info); background: var(--info-soft); }
.estado-AUSENTE { border-left-color: var(--danger); background: var(--danger-soft); }
.estado-CANCELADA { border-left-color: var(--muted); }
.estado-PENDIENTE_DE_PAGO { border-left-color: var(--muted); border-style: dashed; background: rgb(var(--capa) / .04); }
.celda-bloqueo {
    margin: 3px; padding: 6px 9px; border-radius: 9px; height: calc(100% - 6px);
    background: repeating-linear-gradient(135deg, rgb(var(--capa) / .05) 0 8px, rgb(var(--capa) / .1) 8px 16px);
    border: 1px dashed rgb(var(--capa) / .28); color: var(--muted);
}
.celda-bloqueo .nombre { font-weight: 700; font-size: 12.5px; color: var(--text-2); }
.celda-bloqueo .detalle { font-size: 11px; }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; align-items: center; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---- pantallas de acceso ---- */
.auth-shell {
    min-height: 100vh; display: grid; place-items: center; padding: 16px;
    background: radial-gradient(900px 500px at 15% -10%, var(--halo), transparent 60%), var(--bg);
}
.auth-card { width: min(440px, 100%); padding: 26px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card .sub { margin: 0 0 16px; }
.auth-card .campo { margin-bottom: 12px; }
.auth-links { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 13px; }
.auth-links a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ---- pie ---- */
.pie { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---- celular / tablet ---- */
@media (max-width: 900px) {
    .nav-burger { display: inline-flex; }
    .usuario-nombre, .pill-complejo, .marca small { display: none; }
    .cuerpo { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: -110%; top: var(--nav-h); width: min(300px, 86vw);
        height: calc(100vh - var(--nav-h)); z-index: 40; background: var(--panel);
        transition: left .2s ease; box-shadow: var(--shadow-lg);
    }
    .sidebar.abierto { left: 0; }
    .contenido { padding: 12px 12px calc(var(--bottom-h) + 20px); }
    .bottom-nav { display: flex; }
    .dos-columnas { grid-template-columns: 1fr !important; }
    .grilla-wrap { max-height: calc(100vh - var(--nav-h) - var(--bottom-h) - 140px); }
    .grilla th { min-width: 150px; }
    .modal { padding: 0; align-items: flex-end; }
    .modal-card { width: 100%; max-height: 96vh; border-radius: 16px 16px 0 0; }
    .toasts { right: 12px; left: 12px; bottom: calc(var(--bottom-h) + 12px); max-width: none; }
    .encabezado h1 { font-size: 19px; }
}

/* ---- piezas de las pantallas de gestión (caja, ventas, stock, configuración) ---- */
.encabezado h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-tabla { padding: 0; overflow: auto; }
.card-titulo { padding: 12px 14px 8px; font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card.angosta { max-width: 460px; }
.columna { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.der { text-align: right; }
.nowrap { white-space: nowrap; }
.mini { font-size: 12px; color: var(--muted); margin-top: 2px; }
.positivo { color: var(--ok-text); }
.negativo { color: var(--danger-text); }
.form-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.form-inline .input { height: 32px; width: 130px; }
td.acciones-fila { text-align: right; white-space: nowrap; }
td.acciones-fila form { display: inline-flex; margin: 0; vertical-align: middle; }
.campo-check { display: flex; align-items: flex-end; min-height: 62px; }
.dato.destacado { border-color: var(--accent); background: var(--accent-soft); }
.dato.destacado b { font-size: 20px; }
.dias { display: inline-flex; gap: 3px; }
.dia { width: 26px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; background: rgb(var(--capa) / .06); color: var(--muted); }
.dia.on { background: var(--accent-soft); color: var(--text); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.stepper button { width: 32px; height: 34px; border: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; }
.stepper button:hover { background: rgb(var(--capa) / .08); }
.stepper input { width: 44px; height: 34px; border: 0; background: transparent; color: var(--text); text-align: center; font: inherit; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; box-shadow: none; }
.tabla tr.elegida td { background: var(--accent-soft); }
.total-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.total-barra .total { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.total-barra small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
/* "Anular" en dos pasos sin JS: el botón abre el motivo */
details.anular { display: inline-block; }
details.anular summary { list-style: none; cursor: pointer; }
details.anular summary::-webkit-details-marker { display: none; }
details.anular[open] summary { display: none; }

/* ---- Mi complejo ---- */
.url-slug { display: flex; align-items: center; }
.url-slug span { padding: 0 10px; height: 40px; display: flex; align-items: center; border: 1px solid var(--border-2); border-right: 0; border-radius: 10px 0 0 10px; background: var(--panel-3); color: var(--muted); font-size: 12px; white-space: nowrap; }
.url-slug .input { border-radius: 0 10px 10px 0; }
.logo-actual { display: flex; align-items: center; justify-content: center; height: 140px; border: 1px dashed var(--border-2); border-radius: 12px; margin-bottom: 12px; background: var(--panel-2); }
.logo-actual img { max-height: 120px; max-width: 100%; border-radius: 10px; }
.logo-vacio { color: var(--muted); }
input[type="file"].input { padding: 7px 12px; }

/* ---- página pública del complejo ---- */
.pub-shell { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.pub-top { position: sticky; top: 0; z-index: 10; background: var(--panel); border-bottom: 1px solid var(--border); }
.pub-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.pub-marca { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.pub-marca img, .pub-marca .logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.pub-marca .logo { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 900; font-size: 16px; }
.pub-marca b { display: block; font-size: 15px; line-height: 1.2; }
.pub-marca small { color: var(--muted); }
.pub-contacto { display: flex; gap: 6px; flex-wrap: wrap; }
.pub-main { padding-top: 18px; padding-bottom: 40px; }
.pub-hero { padding: 22px; margin-bottom: 18px; background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--panel); }
.pub-hero h1 { margin: 0 0 6px; font-size: 26px; }
.pub-desc { color: var(--text-2); margin: 0 0 12px; max-width: 720px; white-space: pre-line; }
.pub-datos { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.pub-datos svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.pub-datos a { color: var(--text); }
.pub-seccion-h h2 { margin: 0 0 4px; font-size: 19px; }
.pub-seccion-h .sub { margin-bottom: 12px; }
.dias-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 12px; scrollbar-width: thin; }
.chip-dia { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--text-2); text-decoration: none; line-height: 1.15; }
.chip-dia small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chip-dia b { font-size: 18px; }
.chip-dia.activo { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-dia.activo small { color: rgba(255, 255, 255, .85); }
.pub-canchas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pub-cancha h3 { margin: 0; font-size: 16px; }
.pub-cancha-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.pub-cancha-p small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.turnos { display: flex; flex-wrap: wrap; gap: 6px; }
.turnos .vacio { padding: 12px 0; width: 100%; text-align: left; }
.turno { display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; line-height: 1.15; }
.turno b { font-size: 14px; }
.turno small { color: var(--muted); font-size: 11px; }
.turno:hover { border-color: var(--accent); background: var(--accent-soft); }
.sena-aviso { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
.pub-pie { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px 30px; }
.comprobante { max-width: 560px; margin: 10px auto; padding: 26px; text-align: center; }
.comprobante h1 { margin: 10px 0 4px; font-size: 24px; }
.comp-icono { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; }
.comp-icono svg { width: 34px; height: 34px; }
.comp-icono.ok { background: var(--ok-soft); color: var(--ok); }
.comp-icono.warn { background: var(--warn-soft); color: var(--warn); }
.comp-icono.danger { background: var(--danger-soft); color: var(--danger); }
.comp-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 18px 0; text-align: left; }
.comp-acciones { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.comp-acciones form { margin: 0; }
.monto-grande { font-size: 30px; font-weight: 800; margin: 10px 0; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
    .pub-hero { padding: 16px; }
    .pub-hero h1 { font-size: 22px; }
}

/* ---- plataforma y suscripción ---- */
.alert-warn { border-color: rgba(245, 158, 11, .45); background: var(--warn-soft); color: var(--warn-text); }
.alert-info { border-color: rgba(56, 189, 248, .45); background: var(--info-soft); color: var(--info-text); }
.alert-danger { border-color: rgba(239, 68, 68, .45); background: var(--danger-soft); color: var(--danger-text); }
.tabs { display: flex; gap: 4px; margin-left: 14px; }
.tabs a { padding: 7px 12px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.tabs a:hover { background: rgb(var(--capa) / .06); color: var(--text); }
.tabs a.activo { background: var(--accent-soft); color: var(--text); }
.contenido.plataforma { max-width: 1400px; margin: 0 auto; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 12px 12px; }
.timeline li::before { content: ""; position: absolute; left: -19px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.plan-card { text-align: center; padding: 16px; box-shadow: none; }
.plan-card.elegido { border-color: var(--accent); }
.precio-grande { font-size: 26px; font-weight: 800; margin: 4px 0; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .tabs { display: none; } }

/* ---- ayuda: videos y manual ---- */
.videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.video-card { padding: 0; overflow: hidden; }
.video-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-card h3 { margin: 10px 14px 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.video-card p { margin: 0 14px 6px; }
.video-card > a { display: block; margin: 0 14px 12px; color: var(--accent); font-weight: 600; text-decoration: none; }
.manual { padding: 8px 26px 26px; max-width: 900px; line-height: 1.55; }
.manual h2 { font-size: 20px; margin: 30px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); scroll-margin-top: 70px; }
.manual h3 { font-size: 16px; margin: 20px 0 6px; scroll-margin-top: 70px; }
.manual p { margin: 8px 0; color: var(--text-2); }
.manual li { margin: 4px 0; color: var(--text-2); }
.manual table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.manual th, .manual td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
.manual th { background: var(--panel-2); }
.manual code { background: var(--panel-3); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.manual hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.manual a { color: var(--accent); }
