/* ===================================================================
   Reservame · tokens y componentes compartidos
   Azul club · naranja pelota · verde cancha · grafito
   =================================================================== */
:root {
  --ground: #F5F6F3;
  --surface: #FFFFFF;
  --surface-2: #EDEFEA;
  --ink: #17201B;
  --ink-2: #4E5A53;
  --ink-3: #84908A;
  --line: #DCE0D9;
  --court: #1D3F78;
  --court-ink: #FFFFFF;
  --court-soft: #E5EBF5;
  --court-line: rgba(255,255,255,.8);
  --ball: #F29F05;
  --ball-ink: #241400;
  --turf: #1D8A4B;
  --turf-soft: #DFF1E5;
  --warn: #B25E00;
  --warn-soft: #FCEFD9;
  --bad: #C2272F;
  --bad-soft: #FAE3E2;
  --led: #151A22;
  --led-ink: #F5F6F3;
  --shadow: 0 1px 2px rgba(23,32,27,.07), 0 6px 18px -10px rgba(23,32,27,.2);
  --radius: 10px;
  --radius-sm: 6px;
  --font-display: "Oswald", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0F1412; --surface: #171D1A; --surface-2: #202823; --ink: #ECEFEA; --ink-2: #AAB4AE; --ink-3: #7A857F;
    --line: #2C3530; --court: #7FA3E3; --court-ink: #0B1628; --court-soft: #1C2A40; --court-line: rgba(255,255,255,.7);
    --ball: #F7B330; --turf: #3CBF74; --turf-soft: #133222; --warn: #F0A64A; --warn-soft: #3A2710; --bad: #F06A6F; --bad-soft: #3D1A1B;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0F1412; --surface: #171D1A; --surface-2: #202823; --ink: #ECEFEA; --ink-2: #AAB4AE; --ink-3: #7A857F;
  --line: #2C3530; --court: #7FA3E3; --court-ink: #0B1628; --court-soft: #1C2A40; --court-line: rgba(255,255,255,.7);
  --ball: #F7B330; --turf: #3CBF74; --turf-soft: #133222; --warn: #F0A64A; --warn-soft: #3A2710; --bad: #F06A6F; --bad-soft: #3D1A1B;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 15.5px/1.5 var(--font-body); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--court); }
h1, h2, h3, h4 { margin: 0; line-height: 1.05; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--court); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.display { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font: 600 12px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: 8px; border: 1px solid transparent; background: var(--surface-2); color: var(--ink); font-weight: 600;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--court); color: var(--court-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--court) 88%, #000); }
.btn-ball { background: var(--ball); color: var(--ball-ink); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-ok { background: var(--turf); color: #fff; }
.btn-bad { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 17px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  display: inline-grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); transition: border-color .15s; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--court); box-shadow: 0 0 0 3px var(--court-soft); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--court); width: 16px; height: 16px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 40px; height: 24px; border-radius: 12px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .track { background: var(--turf); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--court); outline-offset: 2px; }

/* ---------- Chips y badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; background: var(--surface-2);
  font-size: 13px; font-weight: 600; color: var(--ink-2); border: 1px solid transparent; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.st-PENDIENTE_PAGO { background: var(--warn-soft); color: var(--warn); }
.st-POR_VERIFICAR { background: var(--court-soft); color: var(--court); }
.st-RESERVADO { background: var(--turf-soft); color: var(--turf); }
.st-COMPLETADO { background: var(--surface-2); color: var(--ink-2); }
.st-RECHAZADO, .st-CANCELADO, .st-NO_SHOW { background: var(--bad-soft); color: var(--bad); }
.st-EXPIRADO { background: var(--surface-2); color: var(--ink-3); }

/* ---------- Superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Tablero LED de publicidad ---------- */
.led { position: relative; display: flex; align-items: center; gap: 16px; background: var(--led); color: var(--led-ink); border-radius: 10px;
  padding: 10px 14px 10px 12px; overflow: hidden; text-decoration: none; isolation: isolate; }
.led::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.22) 1px, transparent 1.2px); background-size: 4px 4px; }
.led-tag { font: 700 9.5px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: rgba(244,247,255,.55);
  writing-mode: vertical-rl; transform: rotate(180deg); flex: none; }
.led-body { flex: 1; min-width: 0; }
.led-title { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; font-size: 18px; line-height: 1; color: var(--led-accent, var(--ball)); }
.led-desc { font-size: 13px; color: rgba(244,247,255,.8); margin-top: 3px; }
.led-cta { flex: none; font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 6px; background: var(--led-accent, var(--ball)); color: #151A22; }
.led-by { font-size: 11px; color: rgba(244,247,255,.45); margin-top: 2px; }

/* ---------- Modal, drawer, toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8,14,30,.55); display: grid; place-items: center; padding: 16px; z-index: 60;
  animation: fade .15s ease; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 12px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); animation: pop .18s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; font-size: 20px; }
.modal-body { padding: 18px 20px; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.drawer-wrap { place-items: stretch end; padding: 0; }
.drawer { width: min(520px, 100%); height: 100%; overflow: auto; background: var(--surface); animation: slide .2s ease; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 90; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--ground); padding: 12px 16px; border-radius: 8px; font-weight: 600; font-size: 14.5px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); animation: pop .18s ease; display: flex; gap: 10px; align-items: flex-start; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--turf); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--court); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }
.demo-flag { position: fixed; right: 12px; bottom: 12px; z-index: 50; background: var(--ball); color: var(--ball-ink); font-weight: 700; font-size: 12px;
  padding: 6px 10px; border-radius: 6px; box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
