/* ===================================================================
   Reservame · tokens y componentes compartidos
   Cancha azul · pelota amarilla · césped verde · tinta azul marino
   =================================================================== */
:root {
  --ground: #F2F5FA;
  --surface: #FFFFFF;
  --surface-2: #E9EEF6;
  --ink: #0F1B33;
  --ink-2: #4B5A78;
  --ink-3: #7B88A1;
  --line: #D7DFEB;
  --court: #2155CD;
  --court-ink: #FFFFFF;
  --court-soft: #E3EBFC;
  --court-line: rgba(255,255,255,.85);
  --ball: #D8F23D;
  --ball-ink: #1B2A05;
  --turf: #12925A;
  --turf-soft: #DDF3E8;
  --warn: #C77A00;
  --warn-soft: #FFF1D6;
  --bad: #CF2F47;
  --bad-soft: #FDE4E8;
  --led: #0B1020;
  --led-ink: #F4F7FF;
  --shadow: 0 1px 2px rgba(15,27,51,.06), 0 8px 24px -12px rgba(15,27,51,.18);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Big Shoulders Display", "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Chivo Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0A1120; --surface: #111B30; --surface-2: #17233C; --ink: #E9EFF9; --ink-2: #A3B1C9; --ink-3: #74829C;
    --line: #243351; --court: #4F83F7; --court-ink: #06122E; --court-soft: #16264A; --court-line: rgba(255,255,255,.7);
    --turf: #2DC47D; --turf-soft: #0F3325; --warn: #F2B43C; --warn-soft: #3A2A0B; --bad: #FF6078; --bad-soft: #3D1520;
    --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: #0A1120; --surface: #111B30; --surface-2: #17233C; --ink: #E9EFF9; --ink-2: #A3B1C9; --ink-3: #74829C;
  --line: #243351; --court: #4F83F7; --court-ink: #06122E; --court-soft: #16264A; --court-line: rgba(255,255,255,.7);
  --turf: #2DC47D; --turf-soft: #0F3325; --warn: #F2B43C; --warn-soft: #3A2A0B; --bad: #FF6078; --bad-soft: #3D1520;
  --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 15px/1.55 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: 800; text-transform: uppercase; letter-spacing: .01em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font: 700 11px/1 var(--font-body); letter-spacing: .12em; 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: 999px; border: 1.5px solid transparent; background: var(--surface-2); color: var(--ink); font-weight: 650;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--court); color: var(--court-ink); box-shadow: 0 6px 18px -8px var(--court); }
.btn-ball { background: var(--ball); color: var(--ball-ink); box-shadow: 0 6px 16px -8px rgba(120,150,0,.8); }
.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: 10px; 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: 1.5px 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)); }
.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: 999px; 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 11px; border-radius: 999px; 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 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.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: 800; text-transform: uppercase; font-size: 22px; 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: 999px; background: var(--led-accent, var(--ball)); color: #0B1020; }
.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: 18px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); 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); text-transform: uppercase; font-size: 24px; }
.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: 12px; font-weight: 600; font-size: 14px;
  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: 999px; 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: 11.5px; letter-spacing: .08em; 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); }
