/* ============================================================
   SmashApp — estilos compartidos (App Jugador, Panel Club, cuenta).

   Estética "tarjetas suaves" (propuesta B): fondo gris verdoso, tarjetas
   blancas con sombra suave, verde pastel para las acciones y rosa pastel
   para lo que pide atención. De noche: negro, tarjetas grafito y los
   pasteles como acentos.

   El modo lo decide theme.js: sigue al dispositivo hasta que se elige
   día o noche con el sol / la luna (data-theme en <html>).

   Tokens: los nombres viejos (--accent, --panel, --border…) se mantienen
   porque el HTML que arman las apps los usa en estilos inline.
   --accent es el verde para texto e íconos (legible); --primary es el
   verde pastel de fondo de los botones.
   ============================================================ */
:root {
  --bg: #f1f6f3;
  --panel: #ffffff;
  --panel2: #eef3f0;
  --text: #1c1c1e;
  --muted: #66716b;
  --border: rgba(31, 107, 71, .14);
  --accent: #2f8a63;
  --accent2: #2f8a63;
  --primary: #bfe9d4;
  --on-primary: #134a32;
  --pink: #f7c6d5;
  --on-pink: #8a2448;
  --pink-strong: #e7739a;
  --green-soft: #d6f3e4;
  --on-green: #1f6b47;
  --gray-soft: #e4ebe7;
  --on-gray: #48524d;
  --warn: #9a6200;
  --warn-soft: #fcedd0;
  --danger: #c0352b;
  --danger-soft: #fde4e1;
  --blue: #2f5fb3;
  --blue-soft: #e0eafb;
  --seg: #e3ece7;
  --seg-on: #ffffff;
  --bar: rgba(241, 246, 243, .86);
  --shadow: 0 1px 2px rgba(31, 107, 71, .06), 0 6px 18px rgba(31, 107, 71, .08);
  --shadow-float: 0 2px 6px rgba(31, 107, 71, .08), 0 12px 32px rgba(31, 107, 71, .14);
  --overlay: rgba(28, 28, 30, .32);
  --line: var(--border);
  --card: var(--panel);
  --radius: 20px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --panel: #1c1c1e; --panel2: #2c2c2e; --text: #f2f2f7; --muted: #98989f;
    --border: rgba(255, 255, 255, .09); --accent: #a8e6c9; --accent2: #a8e6c9;
    --primary: #a8e6c9; --on-primary: #0f3d2a;
    --pink: #4a2633; --on-pink: #f7b9cc; --pink-strong: #f08cab;
    --green-soft: #1d3a2d; --on-green: #a8e6c9; --gray-soft: #2c2c2e; --on-gray: #c7c7cc;
    --warn: #ffcf7a; --warn-soft: #3a2e14; --danger: #ff8a80; --danger-soft: #3b1d1b;
    --blue: #9cbcf5; --blue-soft: #1c2a42; --seg: #1c1c1e; --seg-on: #3a3a3c;
    --bar: rgba(0, 0, 0, .82);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .06);
    --shadow-float: 0 0 0 1px rgba(255, 255, 255, .08), 0 12px 32px rgba(0, 0, 0, .6);
    --overlay: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --panel: #1c1c1e; --panel2: #2c2c2e; --text: #f2f2f7; --muted: #98989f;
  --border: rgba(255, 255, 255, .09); --accent: #a8e6c9; --accent2: #a8e6c9;
  --primary: #a8e6c9; --on-primary: #0f3d2a;
  --pink: #4a2633; --on-pink: #f7b9cc; --pink-strong: #f08cab;
  --green-soft: #1d3a2d; --on-green: #a8e6c9; --gray-soft: #2c2c2e; --on-gray: #c7c7cc;
  --warn: #ffcf7a; --warn-soft: #3a2e14; --danger: #ff8a80; --danger-soft: #3b1d1b;
  --blue: #9cbcf5; --blue-soft: #1c2a42; --seg: #1c1c1e; --seg-on: #3a3a3c;
  --bar: rgba(0, 0, 0, .82);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .06);
  --shadow-float: 0 0 0 1px rgba(255, 255, 255, .08), 0 12px 32px rgba(0, 0, 0, .6);
  --overlay: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- barra superior (compu) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 10px max(20px, env(safe-area-inset-left, 0px));
  background: var(--bar); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand small { color: var(--muted); font-weight: 500; font-size: 13px; letter-spacing: 0; }
.brand a { text-decoration: none; color: inherit; }

.switcher { display: inline-flex; background: var(--seg); border-radius: 11px; padding: 3px; gap: 2px; }
.switcher a, .switcher button {
  border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.switcher a.active, .switcher button.active { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

.user-pill {
  display: flex; align-items: center; gap: 8px; background: var(--panel); border-radius: 999px;
  padding: 4px 12px 4px 4px; font-size: 13px; box-shadow: var(--shadow);
}
.user-pill select { background: transparent; border: 0; font-size: 13px; font-weight: 600; max-width: 190px; }
.user-pill .avatar { width: 26px; height: 26px; font-size: 10px; margin: 0; border: 0; }
.user-name { font-size: 13px; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Indicador de conexión en vivo */
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; transition: background .25s ease; }
.conn-dot.live { background: var(--accent); }
.conn-dot.polling { background: var(--warn); }

/* Sol / luna: dos íconos de línea, fondo transparente. El modo activo va
   con el trazo en el color del texto; el otro, tenue. */
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; }
.theme-toggle button {
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
  background: transparent; border: 0; border-radius: 50%; cursor: pointer; color: var(--muted); opacity: .55;
  transition: opacity .2s ease, color .2s ease;
}
.theme-toggle button svg { width: 21px; height: 21px; }
.theme-toggle button:hover { opacity: .85; }
.theme-toggle button.on { color: var(--text); opacity: 1; }

/* ---------- App Jugador: layout ----------
   Celular (y app nativa): contenido a lo ancho y barra de pestañas flotante
   abajo. Compu: columna central y las mismas pestañas como control
   segmentado arriba. */
.app-shell { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.screen-content {
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom, 0px));
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
body.logged-out .screen-content { padding-bottom: 40px; }
.app-shell .topbar { display: none; }

.bottom-nav {
  position: fixed; z-index: 40;
  left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 4px; border-radius: 22px;
  background: var(--panel); box-shadow: var(--shadow-float);
}
.nav-item {
  display: grid; justify-items: center; gap: 2px; position: relative;
  font-size: 10.5px; font-weight: 500; color: var(--muted); cursor: pointer; user-select: none;
  padding: 2px 0; border-radius: 12px;
}
.nav-item svg { width: 24px; height: 24px; }
.nav-item.active { color: var(--accent); }
.nav-item .dot-badge {
  position: absolute; top: 0; right: calc(50% - 17px); width: 9px; height: 9px; border-radius: 50%;
  background: var(--pink-strong); border: 2px solid var(--panel);
}
body.logged-out .bottom-nav { display: none; }

/* En la compu (y no en la app nativa): sin barra flotante, pestañas arriba. */
@media (min-width: 900px) {
  body:not(.native) .screen-content { padding-top: 8px; padding-bottom: 64px; }
  body:not(.native) .bottom-nav {
    position: sticky; top: 64px; left: auto; right: auto; bottom: auto;
    width: fit-content; margin: 8px auto 4px; display: flex; gap: 2px;
    padding: 3px; border-radius: 12px; background: var(--seg); box-shadow: none;
  }
  body:not(.native) .nav-item {
    display: flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 9px;
    font-size: 13.5px; font-weight: 600;
  }
  body:not(.native) .nav-item svg { width: 17px; height: 17px; }
  body:not(.native) .nav-item.active { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
  body:not(.native) .nav-item .dot-badge { position: static; border: 0; width: 7px; height: 7px; }
}
/* En el celular y en la app el topbar no va: la pantalla arranca con el título grande. */
@media (max-width: 899px) {
  body:has(.bottom-nav) .topbar { display: none; }
}
body.native .topbar { display: none; }

/* Aviso que cae desde arriba */
.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top, 0px)); width: min(440px, calc(100% - 20px));
  background: var(--panel); border-radius: 16px; padding: 12px 16px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-float); display: none;
}
.toast.show { display: block; animation: drop .25s ease-out; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 900px) { body:not(.native) .toast { top: 74px; } }

/* ---------- tipografía de pantalla ---------- */
.app-header { padding: 4px 2px 16px; }
.app-header h1 { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -.022em; line-height: 1.1; margin: 0 0 4px; text-wrap: balance; }
.app-header p { margin: 0; color: var(--muted); font-size: 15px; }
.loading { color: var(--muted); font-size: 14px; text-align: center; padding: 48px 0; }
.section-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); margin: 22px 6px 8px;
}
.section-title.collapsible { cursor: pointer; user-select: none; }
.section-title.collapsible:hover { color: var(--text); }
.backbtn {
  background: none; border: 0; color: var(--accent); font-size: 16px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; margin: 0 0 8px; padding: 4px 0;
}

/* ---------- tarjetas ---------- */
.card {
  background: var(--panel); border: 0; border-radius: var(--radius); padding: 16px;
  margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { box-shadow: var(--shadow-float); }
.card:active { transform: scale(.995); }
.card.static { cursor: default; }
.card.static:hover { box-shadow: var(--shadow); }
.card-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card h3 { margin: 0 0 3px; font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
.card .meta { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.detail-hero {
  background: linear-gradient(140deg, var(--green-soft), var(--panel) 60%);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.detail-hero h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 22px; letter-spacing: -.015em; }
.detail-hero .meta { color: var(--muted); font-size: 14px; }

.searchbar {
  display: flex; gap: 8px; align-items: center; background: var(--panel); border-radius: 14px;
  padding: 11px 14px; margin-bottom: 16px; color: var(--muted); font-size: 14px; box-shadow: var(--shadow);
}

/* ---------- badges y estados ---------- */
.badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-open { background: var(--pink); color: var(--on-pink); }
.badge-full { background: var(--green-soft); color: var(--on-green); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-wait { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--gray-soft); color: var(--on-gray); }
.badge-bad { background: var(--danger-soft); color: var(--danger); }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-confirmed { background: var(--green-soft); color: var(--on-green); }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-free { background: var(--blue-soft); color: var(--blue); }

/* ---------- avatares ---------- */
.avatars { display: flex; margin-top: 10px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--pink); color: var(--on-pink);
  border: 2px solid var(--panel); display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; margin-left: -8px;
}
.avatar:first-child { margin-left: 0; }
.avatar:nth-child(3n+2) { background: var(--green-soft); color: var(--on-green); }
.avatar:nth-child(3n+3) { background: var(--gray-soft); color: var(--on-gray); }
.avatar.empty { border: 2px dashed var(--border); background: transparent; color: var(--muted); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 600; font-size: 15px;
  cursor: pointer; width: 100%; transition: filter .15s ease, transform .1s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(.97); }
.btn-outline { background: var(--gray-soft); color: var(--text); }
.btn-outline:hover { filter: brightness(.97); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; border-radius: 11px; }
.btn-row { display: flex; gap: 8px; }
.btn + .btn { margin-top: 8px; }
.btn-row .btn + .btn, .modal-actions .btn + .btn, .dash-header .btn + .btn { margin-top: 0; }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn {
  background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 14px; font-weight: 500;
  padding: 10px; display: block; margin: 0 auto;
}
.linkbtn:hover { text-decoration: underline; }

/* ---------- opciones y selección ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--green-soft); color: var(--on-green); border: 0;
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip.active { background: var(--primary); color: var(--on-primary); }
.chip b { cursor: pointer; opacity: .7; font-weight: 700; }
.chip b:hover { opacity: 1; }

.option-card {
  background: var(--panel); border: 2px solid transparent; border-radius: 16px; padding: 14px 16px;
  margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow);
}
.option-card.selected { border-color: var(--accent); background: var(--green-soft); }
.option-card.disabled { opacity: .45; cursor: default; }
.option-card h4 { margin: 0 0 3px; font-size: 15px; font-weight: 600; }
.option-card p { margin: 0; color: var(--muted); font-size: 13px; }
.option-card.selected p { color: var(--on-green); }

.cat-select { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.cat-pill {
  background: var(--panel); border-radius: 12px; padding: 9px 10px; font-size: 13px; font-weight: 600;
  text-align: center; cursor: pointer; flex: 1; min-width: 50px; box-shadow: var(--shadow);
}
.cat-pill.on { background: var(--primary); color: var(--on-primary); }

.toggle-invite {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.toggle-invite.on { background: var(--accent); border-color: var(--accent); color: var(--panel); }

.radio-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: var(--panel2); cursor: pointer; font-size: 15px;
}
.radio-row:has(input:checked) { background: var(--green-soft); color: var(--on-green); }
.radio-row input { accent-color: var(--accent); }

/* ---------- jugadores ---------- */
.player-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.player-row:last-child { border-bottom: 0; }
.player-row.status-confirmed { background: transparent; color: inherit; }
.player-row.status-declined { opacity: .6; }
.player-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-info .avatar { margin-left: 0; width: 36px; height: 36px; font-size: 12px; border: 0; }
.player-name { font-size: 15px; font-weight: 600; }
.player-sub { font-size: 13px; color: var(--muted); }

/* ---------- avisos ---------- */
.notif-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread .notif-title { font-weight: 700; }
.notif-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 17px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.notif-sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.notif-new { color: var(--pink-strong); font-size: 20px; line-height: 0; vertical-align: middle; }

.alert-card { background: var(--warn-soft); border-radius: 16px; padding: 13px 15px; margin-bottom: 12px; font-size: 14px; color: var(--warn); }
.error-card { background: var(--danger-soft); border-radius: 16px; padding: 13px 15px; margin-bottom: 12px; font-size: 14px; color: var(--danger); }

.confirm-check {
  width: 72px; height: 72px; border-radius: 50%; background: var(--green-soft); color: var(--on-green);
  display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 24px auto 14px;
}

/* ---------- formularios ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin: 0 4px 6px; font-weight: 600; }
.field select, .field input, textarea {
  width: 100%; background: var(--panel2); border: 1.5px solid transparent; border-radius: 12px;
  padding: 12px 14px; color: var(--text); font-size: 16px; /* 16px: iOS no hace zoom al enfocar */
}
.field input:focus, .field select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.field input:disabled { color: var(--muted); }
textarea { resize: vertical; }

/* ---------- torneos ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
table.standings { background: var(--panel); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
table.standings th, table.standings td { padding: 9px 8px; text-align: center; white-space: nowrap; }
table.standings td:nth-child(2) { text-align: left; font-weight: 600; }
table.standings tr.podium td { background: var(--green-soft); color: var(--on-green); }

.set-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.set-row:last-of-type { border-bottom: 0; }
.set-label { font-size: 13px; color: var(--muted); width: 48px; flex: 0 0 auto; }
.set-sep { color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; background: var(--panel2); border: 0; font-size: 17px; line-height: 1; }
.stepper button:hover { background: var(--green-soft); color: var(--on-green); }
.stepper b { min-width: 22px; text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------- bandejas simuladas (desarrollo) ---------- */
.mail-frame { width: 100%; min-height: 360px; border: 0; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.mail-text {
  white-space: pre-wrap; word-break: break-word; font-size: 13px; color: var(--muted);
  background: var(--panel); border-radius: 16px; padding: 14px; line-height: 1.5; box-shadow: var(--shadow);
}

/* ---------- cuenta ---------- */
.auth-header { text-align: center; padding-top: 8px; }
.auth-logo { display: block; width: 84px; height: 84px; margin: 28px auto 4px; border-radius: 19px; box-shadow: var(--shadow-float); }
.auth-form { display: grid; gap: 4px; margin-bottom: 12px; padding: 18px; }
.auth-form .error-card { margin: 0 0 8px; }
.auth-panel { max-width: 420px; margin: 32px auto; display: grid; gap: 12px; }
.auth-legal { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.auth-legal a { color: inherit; }
.auth-theme { display: flex; justify-content: center; margin-top: 8px; }
.appearance-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.appearance-row .player-sub { margin: 0; }

/* ---------- Panel Club ---------- */
.stage { display: flex; justify-content: center; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); }
.dash-wrap { width: 100%; max-width: 1180px; }
.dash-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; min-height: 640px; }
.dash-side { padding: 8px 0; display: grid; align-content: start; gap: 2px; }
.dash-logo { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 4px 12px 18px; display: flex; align-items: center; gap: 8px; }
.dash-nav-item { padding: 9px 12px; border-radius: 11px; font-size: 14px; color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.dash-nav-item:hover { background: var(--panel2); }
.dash-nav-item.active { background: var(--green-soft); color: var(--on-green); font-weight: 600; }
.dash-main { background: var(--panel); border-radius: 24px; padding: 26px 30px; box-shadow: var(--shadow); min-width: 0; }
.dash-main .card { box-shadow: none; background: var(--panel2); }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.dash-header h2 { margin: 0; font-family: var(--font-display); font-size: 24px; letter-spacing: -.015em; }
.dash-header p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.kpi { background: var(--panel2); border-radius: 16px; padding: 14px 16px; }
.kpi .num { font-family: var(--font-display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.court-tag { background: var(--gray-soft); color: var(--on-gray); padding: 3px 9px; border-radius: 8px; font-size: 12px; }
.grid-slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 10px; }
.slot { border-radius: 12px; padding: 10px 8px; text-align: center; font-size: 13px; background: var(--panel2); cursor: pointer; transition: transform .15s ease; }
.slot:hover { transform: translateY(-1px); }
.slot.busy { background: var(--green-soft); color: var(--on-green); font-weight: 600; }
.slot.matching { background: var(--pink); color: var(--on-pink); font-weight: 600; }
.slot.free { color: var(--muted); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel2); }
.club-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.club-user .linkbtn { display: inline; padding: 0; margin: 0; }

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .dash-logo { display: none; }
  .dash-nav-item { white-space: nowrap; }
  .dash-main { padding: 20px 16px; border-radius: 20px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid-slots { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- modal y aviso del panel ---------- */
.modal-overlay { position: fixed; inset: 0; background: var(--overlay); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-overlay.show { display: flex; }
.modal { background: var(--panel); border-radius: 22px; padding: 24px; width: 440px; max-width: 100%; box-shadow: var(--shadow-float); }
.modal h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 19px; }
.modal .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.page-toast {
  position: fixed; top: calc(76px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px);
  background: var(--panel); border-radius: 16px; padding: 12px 20px; font-size: 14px; font-weight: 500;
  z-index: 110; display: none; box-shadow: var(--shadow-float);
}
.page-toast.show { display: block; animation: drop .25s ease-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
