/* NEXO MI TEAM - estilos. Mobile primero, rail lateral desde 960px. */
:root {
  --ink: #0e1b3d;
  --ink-soft: #49577a;
  --line: #d9e0ee;
  --bg: #f1f4fa;
  --surface: #ffffff;
  --surface-2: #f6f8fd;
  --brand: #1456f0;
  --brand-deep: #0b3fb5;
  --brand-soft: #e5edff;
  --on-brand: #ffffff;
  --ok: #12794f;
  --ok-soft: #ddf3e8;
  --warn: #8f5400;
  --warn-soft: #ffefc7;
  --bad: #b42e2e;
  --bad-soft: #fbe3e3;
  --focus: #ffb400;
  --shadow: 0 1px 2px rgba(14, 27, 61, 0.06), 0 6px 18px rgba(14, 27, 61, 0.06);
  --r-card: 14px;
  --r-ctl: 10px;
  --font-body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Archivo', 'Arial Narrow', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #e8edfa;
    --ink-soft: #9fadcb;
    --line: #26324f;
    --bg: #0b1224;
    --surface: #131c33;
    --surface-2: #182340;
    --brand: #6c97ff;
    --brand-deep: #9db9ff;
    --brand-soft: #1b2a55;
    --on-brand: #0b1224;
    --ok: #5fd39b;
    --ok-soft: #12342a;
    --warn: #ffc05c;
    --warn-soft: #3a2c10;
    --bad: #ff8d8d;
    --bad-soft: #3b1a1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.grow { flex: 1 1 auto; min-width: 0; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.gap-s { gap: 6px; } .gap-l { gap: 16px; }
.stack > * + * { margin-top: 12px; }
.stack-s > * + * { margin-top: 6px; }
.right { margin-left: auto; }
.hide { display: none !important; }

/* ---------- marca ---------- */
.brand-logo { display: inline-block; width: 112px; max-width: 100%; height: auto; vertical-align: middle; flex: none; }
.brand-logo.lg { width: 184px; }
.auth .brand-logo { margin: 6px 0 22px; }
@media (max-width: 480px) { .topbar .brand-logo { width: 96px; } }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo svg { width: 38px; height: 42px; flex: none; }
.lt { display: flex; flex-direction: column; line-height: 1; }
.lt b { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; }
.lt span { font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.32em; margin-top: 5px; color: var(--ink-soft); }
.logo.lg svg { width: 54px; height: 60px; }
.logo.lg .lt b { font-size: 38px; }
.logo.lg .lt span { font-size: 17px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: 3px solid var(--brand);
  display: flex; align-items: center; gap: 12px; padding: 8px 16px;
}
.topbar .logo svg { width: 28px; height: 31px; }
.topbar .lt b { font-size: 20px; }
.topbar .lt span { font-size: 10px; margin-top: 3px; }
.club-switch { margin-left: auto; text-align: right; min-width: 0; }
.club-switch .name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; display: block; }
.club-switch .role { font-size: 12.5px; color: var(--ink-soft); }
.icon-btn { border: 0; background: transparent; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--brand-soft); }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.s { width: 18px; height: 18px; }

.main { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: 16px 16px 96px; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface);
  border-top: 1px solid var(--line); display: flex; padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
}
.nav a, .nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; min-height: 56px;
  color: var(--ink-soft); text-decoration: none; font-size: 12px; font-weight: 700; border: 0; background: transparent; border-radius: 12px; cursor: pointer;
}
.nav a[aria-current='page'] { color: var(--brand); background: var(--brand-soft); }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .nav { position: sticky; top: 63px; align-self: start; height: calc(100vh - 63px); flex-direction: column; justify-content: flex-start; gap: 2px; padding: 14px 10px; border-top: 0; border-right: 1px solid var(--line); }
  .nav a, .nav button { flex: none; flex-direction: row; gap: 12px; font-size: 15px; padding: 11px 14px; min-height: 44px; }
  .main { max-width: 900px; padding-bottom: 40px; }
  .club-switch .name { max-width: 300px; }
}

/* ---------- componentes ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { flex: 1 1 auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.card h2 { margin-bottom: 8px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; background: transparent; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; min-height: 56px; }
.item:last-child { border-bottom: 0; }
a.item:hover, button.item:hover { background: var(--surface-2); }
.item .t { font-weight: 700; }
.item .s { color: var(--ink-soft); font-size: 14px; }
.player-list-item { display: grid; grid-template-columns: 44px 46px minmax(0, 1fr); gap: 10px 12px; }
.player-list-identity { min-width: 0; overflow-wrap: anywhere; }
.player-list-status { grid-column: 1 / -1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.player-list-status:empty { display: none; }
.player-list-status .badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.private-profile-data { margin:0;display:grid;grid-template-columns:minmax(0,auto) minmax(0,1fr);gap:6px 16px; }
.private-profile-data dd { margin:0;font-weight:700;min-width:0;overflow-wrap:anywhere; }
@media(max-width:600px){.private-profile-data{grid-template-columns:minmax(0,1fr);gap:3px}.private-profile-data dd{margin-bottom:9px}}
@media (min-width: 900px) {
  .player-list-item { grid-template-columns: 44px 46px minmax(180px, 1fr) minmax(0, 1.8fr); }
  .player-list-status { grid-column: auto; justify-content: flex-end; }
}
.section-title { font-family: var(--font-display); font-weight: 800; font-size: 15px; margin: 20px 2px 8px; color: var(--ink-soft); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--brand-soft); color: var(--brand-deep); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.neutral, .badge.plain { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; gap: 8px; }
.chips .chip[aria-pressed='true'] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chips .chip .n { font-size: 12.5px; opacity: 0.8; font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: var(--r-ctl); border: 1.5px solid transparent; font-weight: 700; font-size: 16px; cursor: pointer; background: var(--brand); color: var(--on-brand); text-decoration: none; }
.btn:hover { background: var(--brand-deep); }
.btn.ghost { background: transparent; color: var(--brand-deep); border-color: var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--brand-deep); font-weight: 700; cursor: pointer; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; }

.field { display: block; margin-bottom: 12px; }
.field > label, .field > .lbl { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.field .hint, .hint { display: block; color: var(--ink-soft); margin-top: 3px; font-size: 13px; }
.field input, .field select, .field textarea, .in { width: 100%; min-height: 46px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); }
.field input[type='checkbox'], .check input { width: 22px; height: 22px; min-height: 0; padding: 0; }
.field input:focus, .field select:focus, .field textarea:focus, .in:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
.field textarea, textarea.in { min-height: 84px; resize: vertical; }
.form-error { color: var(--bad); background: var(--bad-soft); border-radius: var(--r-ctl); padding: 10px 12px; font-weight: 700; font-size: 14.5px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.err { color: var(--bad); font-weight: 700; font-size: 14.5px; margin: 6px 0 0; }
.notice { border-radius: var(--r-ctl); padding: 10px 12px; background: var(--warn-soft); color: var(--warn); font-size: 14.5px; font-weight: 700; }
.notice.info { background: var(--brand-soft); color: var(--brand-deep); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

/* dorsal: el número es la identidad del jugador en cancha */
.dorsal { width: 46px; height: 46px; flex: none; border-radius: 11px; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.dorsal.none { background: transparent; border: 2px dashed var(--line); color: var(--ink-soft); font-size: 18px; }
.dorsal.lg { width: 64px; height: 64px; font-size: 32px; border-radius: 14px; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; }
.kpi b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi span { font-size: 13.5px; color: var(--ink-soft); font-weight: 700; }
.kpi.alert b { color: var(--bad); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: 11px 14px; font-weight: 700; color: var(--ink-soft); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; min-height: 46px; }
.tabs button[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--brand); }

/* asistencia: botones grandes para usar con una mano en cancha */
.att { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.att:last-child { border-bottom: 0; }
.att .seg { grid-column: 1 / -1; }
.att.health-not-fit { border-left: 4px solid var(--bad); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg button { min-height: 46px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed='true'][data-s='presente'] { background: var(--ok); color: #fff; border-color: var(--ok); }
.seg button[aria-pressed='true'][data-s='tarde'] { background: var(--warn); color: #fff; border-color: var(--warn); }
.seg button[aria-pressed='true'][data-s='justificado'] { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg button[aria-pressed='true'][data-s='ausente'] { background: var(--bad); color: #fff; border-color: var(--bad); }
.seg[disabled] button { cursor: default; opacity: 0.85; }
@media (min-width: 700px) { .att { grid-template-columns: auto 1fr 340px; } .att .seg { grid-column: auto; } }

.hero { background: var(--ink); color: var(--surface); border-radius: var(--r-card); padding: 16px; }
.hero .k { font-size: 13.5px; opacity: 0.8; font-weight: 700; }
.hero .big { font-family: var(--font-display); font-weight: 800; font-size: 24px; margin: 2px 0 8px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14.5px; opacity: 0.92; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }

.empty { text-align: center; padding: 28px 16px; color: var(--ink-soft); }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.spin { text-align: center; padding: 40px; color: var(--ink-soft); }

/* sheet / modal (<dialog>) */
dialog.sheet { border: 0; padding: 0; background: var(--surface); color: var(--ink); width: min(560px, 100vw); max-width: 100vw; max-height: 92vh; margin: auto auto 0; border-radius: 18px 18px 0 0; box-shadow: var(--shadow); overflow: auto; }
dialog.sheet::backdrop { background: rgba(8, 15, 35, 0.55); }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 0 16px; }
.sheet-head h2 { flex: 1; }
.sheet-body { padding: 12px 16px 16px; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 18px; } }
.toast-host { position: fixed; left: 0; right: 0; bottom: 84px; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow); max-width: 440px; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@media (min-width: 960px) { .toast-host { bottom: 24px; } }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: start center; padding: 28px 16px 40px; }
.auth { width: 100%; max-width: 440px; }
.auth .logo { margin: 6px 0 22px; }
.auth .tabs { margin-top: 0; }
.auth-sep { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 14px; margin: 16px 0 4px; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.demo-box { margin-top: 18px; border: 1.5px dashed var(--line); border-radius: var(--r-card); padding: 12px 14px; }
.demo-box .item { padding: 8px 4px; min-height: 48px; }

/* impresión: planillas de asistencia y listas de dorsales */
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .topbar, .nav, .no-print, .toast-host, dialog { display: none !important; }
  .print-only { display: block; }
  .main { max-width: none; padding: 0; }
  .card, .list { box-shadow: none; border-color: #999; }
  .shell { display: block; }
  table.sheet-table { width: 100%; border-collapse: collapse; }
  table.sheet-table th, table.sheet-table td { border: 1px solid #555; padding: 6px 8px; text-align: left; }
}
table.sheet-table { width: 100%; border-collapse: collapse; }
table.sheet-table th, table.sheet-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: rise 0.18s ease-out; }
}
@keyframes rise { from { transform: translateY(24px); opacity: 0.4; } }
.hidden { display: none !important; }

/* nav: en móvil los ítems extra van en "Más" */
.nav .extra { display: none; }
.nav .more-btn { display: flex; }
@media (min-width: 960px) {
  .nav .extra { display: flex; }
  .nav .more-btn { display: none; }
}
.nav a span, .nav button span { white-space: nowrap; }
.logo-link { display: inline-flex; }

/* Tamaño base de los iconos (los dibujos SVG no traen tamaño propio) */
:where(svg[aria-hidden='true']) { width: 22px; height: 22px; flex: none; }
.btn svg { width: 18px; height: 18px; }
.btn.small svg { width: 16px; height: 16px; }
.nav svg { width: 24px; height: 24px; }
.item > svg { width: 20px; height: 20px; color: var(--ink-soft); }
.empty svg { width: 32px; height: 32px; }

/* Contrato y firma */
.sigpad { display: block; width: 100%; max-width: 420px; aspect-ratio: 12 / 5; border: 1px dashed var(--ink-soft); border-radius: var(--r-ctl); background: #fff; touch-action: none; cursor: crosshair; }
.contract-text, .rulebook-text { white-space: pre-wrap; font-size: 15px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 14px; max-height: 40vh; overflow: auto; }
.sig-img { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; max-width: 260px; width: 100%; }

/* Reglamento interno y cronograma por edad */
.rb-details { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 12px; background: var(--surface-2); }
.rb-details > summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.rb-body { white-space: pre-wrap; margin: 6px 0 0; line-height: 1.55; font-size: 15px; }
mark.todo { background: var(--warn-soft); color: var(--warn); font-weight: 700; padding: 0 3px; border-radius: 4px; }
.phase { padding: 8px 10px; border-left: 3px solid var(--brand-soft); background: var(--surface-2); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.item.month.now { background: var(--brand-soft); }

/* Fotos y archivos (foto del alumno, cédulas, comprobantes) */
.filebox { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; background: var(--surface-2); display: grid; gap: 8px; }
.file-thumb { width: 64px; height: 64px; flex: none; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; color: var(--ink-soft); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb svg { width: 26px; height: 26px; }
/* El campo de archivo vive dentro de la etiqueta-botón: se oculta sin quitarlo del teclado ni de los lectores de pantalla. */
.file-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
label.btn { position: relative; cursor: pointer; }
label.btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.file-full { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: var(--r-ctl); border: 1px solid var(--line); background: #fff; }

/* Carnet del alumno */
.carnet { display: grid; justify-items: center; gap: 10px; text-align: center; }
.carnet-photo { width: 120px; height: 150px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-deep); display: grid; place-items: center; overflow: hidden; border: 2px solid var(--line); font-family: var(--font-display); font-weight: 800; font-size: 40px; }
.carnet-photo img { width: 100%; height: 100%; object-fit: cover; }
.carnet-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.carnet-data { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; width: 100%; max-width: 380px; text-align: left; font-size: 15px; }
.carnet-data dt { color: var(--ink-soft); font-weight: 700; }
.carnet-data dd { margin: 0; overflow-wrap: anywhere; }

/* Firma paso a paso */
.wiz-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.wiz-fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.2s ease; }
@media (prefers-reduced-motion: reduce) { .wiz-fill { transition: none; } }
.next { background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; }
[hidden] { display: none !important; }

/* ---- Imágenes: foto del alumno, escudo del club y banners ---- */
.avatar, .crest { --hue: 215; position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 50%; width: 44px; height: 44px; color: #fff; font-weight: 800; background: linear-gradient(135deg, hsl(var(--hue) 62% 42%), hsl(calc(var(--hue) + 40) 62% 30%)); }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.crest { border-radius: 14px; width: 56px; height: 56px; font-size: 18px; border: 2px solid rgba(255,255,255,.7); }
.crest.sm { width: 36px; height: 36px; font-size: 13px; border-radius: 10px; }
.crest.lg { width: 84px; height: 84px; font-size: 26px; border-radius: 18px; }
.avatar img, .crest img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.has-img .ini, .crest.has-img .ini { visibility: hidden; }
.banner { --hue: 215; position: relative; overflow: hidden; border-radius: var(--r-card); min-height: 120px; display: flex; align-items: flex-end; color: #fff; background: linear-gradient(120deg, hsl(var(--hue) 60% 38%), hsl(calc(var(--hue) + 50) 62% 26%)); }
.banner.sm { min-height: 84px; }
.banner.lg { min-height: 180px; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,0) 62%); }
.banner-text { position: relative; z-index: 1; display: flex; gap: 12px; align-items: flex-end; padding: 14px 16px; width: 100%; }
.banner-title { font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.15; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.banner-sub { font-size: 14px; font-weight: 600; opacity: .95; text-shadow: 0 1px 4px rgba(0,0,0,.35); }

/* ---- Pasar lista rápido ---- */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; text-align: center; min-height: 138px; font: inherit; color: inherit; position: relative; }
.tile:focus-visible { outline: 3px solid var(--brand, #1250f0); outline-offset: 2px; }
.tile .avatar { width: 56px; height: 56px; font-size: 18px; }
.tile .nm { font-weight: 800; font-size: 14.5px; line-height: 1.15; }
.tile .st { font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--ink-soft); }
.tile[data-s=presente] { border-color: #1f9d55; background: #eaf8f0; } .tile[data-s=presente] .st { background: #1f9d55; color: #fff; }
.tile[data-s=ausente] { border-color: #d64545; background: #fdeeee; } .tile[data-s=ausente] .st { background: #d64545; color: #fff; }
.tile[data-s=tarde] { border-color: #d98a00; background: #fff6e0; } .tile[data-s=tarde] .st { background: #d98a00; color: #fff; }
.tile[data-s=justificado] { border-color: #2a6fdb; background: #eaf1fd; } .tile[data-s=justificado] .st { background: #2a6fdb; color: #fff; }
.tile .more { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; cursor: pointer; }
.tile .jersey { position: absolute; top: 8px; left: 10px; font-weight: 800; font-size: 13px; color: var(--ink-soft); }
.today-card { display: grid; gap: 10px; }
.quickbar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 0; background: linear-gradient(to top, var(--bg, #fff) 70%, transparent); }
@media (prefers-color-scheme: dark) {
  .tile[data-s=presente] { background: #12301f; } .tile[data-s=ausente] { background: #3a1a1a; } .tile[data-s=tarde] { background: #3a2c0a; } .tile[data-s=justificado] { background: #14264a; }
}
@media print { .banner, .quickbar { display: none; } }
.club-switch { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.club-switch .club-text { min-width: 0; display: block; text-align: right; }
.cat-strip::-webkit-scrollbar { height: 6px; }

/* Cámara dentro de la app (computador) */
.cam-video { width: 100%; max-height: 60vh; aspect-ratio: 4 / 3; background: #0b1220; border-radius: var(--r-ctl); object-fit: cover; display: block; }

/* Secciones dentro de un formulario largo (Alumno / Apoderado) */
.form-section { display: grid; gap: 4px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); }
.form-section h3 { margin: 0; font-size: 1.05rem; }
.form-grid > .form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* Historial de asistencia: planilla por alumno */
.att-matrix-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 6px 6px 10px; }
.att-matrix { border-collapse: separate; border-spacing: 2px; font-variant-numeric: tabular-nums; font-size: 13px; width: max-content; min-width: 100%; }
.att-matrix th, .att-matrix td { text-align: center; padding: 6px 7px; border-radius: 6px; min-width: 34px; }
.att-matrix thead th { color: var(--ink-soft); font-weight: 700; font-size: 12px; }
.att-matrix th.name { text-align: left; position: sticky; left: 0; background: var(--surface); min-width: 150px; z-index: 1; font-weight: 700; }
.att-matrix th.name a { color: var(--ink); text-decoration: none; }
.att-matrix td.st { font-weight: 800; background: var(--surface-2); color: var(--ink-soft); }
.att-matrix td.st.presente { background: var(--ok-soft); color: var(--ok); }
.att-matrix td.st.tarde { background: var(--warn-soft); color: var(--warn); }
.att-matrix td.st.justificado { background: var(--brand-soft); color: var(--brand-deep); }
.att-matrix td.st.ausente { background: var(--bad-soft); color: var(--bad); }
.att-matrix td.pct { font-weight: 800; }
.chips a.chip { text-decoration: none; }

/* NEXO IA: botón fijo en todas las pantallas. En el teléfono queda arriba de la barra inferior. */
.assistant-fab {
  position: fixed; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 16px 0 14px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; font-family: inherit; font-weight: 800; font-size: 15px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}
.assistant-fab:hover { filter: brightness(1.08); }
.assistant-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--brand); }
.assistant-fab .icon { width: 22px; height: 22px; }
.main { padding-bottom: 150px; }
@media (min-width: 960px) {
  .assistant-fab { right: 24px; bottom: 24px; }
  .main { padding-bottom: 40px; }
}
@media print { .assistant-fab { display: none !important; } }

/* Requisito de identificación del contrayente, visible sobre el contenido. */
.club-incomplete-banner { margin-bottom: 18px; border: 2px solid #b76a00; padding: 16px; }
.club-incomplete-banner b { font-size: 17px; }

/* Identidad de la sesión en la cabecera: rol destacado + cuenta (correo). Apoderado y alumno en otro color para no confundirlos con la dirección. */
.role-badge { display: inline-block; font-size: 11.5px; font-weight: 700; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); vertical-align: 1px; white-space: nowrap; }
.role-badge.role-apoderado, .role-badge.role-alumno { background: var(--warn-soft); color: var(--warn); }
.club-switch .account { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 12px; color: var(--ink-soft); max-width: 42vw; margin-top: 3px; min-width: 0; }
.club-switch .account .role-badge { flex: none; }
.club-switch .account .email { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 899px) {
  .club-switch .name, .club-switch .account { max-width: calc(100vw - 210px); }
  /* En el teléfono el correo va en su propia línea, completo, bajo el rol. */
  .club-switch .account { flex-wrap: wrap; row-gap: 3px; }
  .club-switch .account .email { flex-basis: 100%; text-align: right; font-size: 11.5px; }
}
.list .item[aria-current="true"] { background: var(--brand-soft); }
@media (min-width: 900px) { .club-switch .name { max-width: 460px; } .club-switch .account { max-width: 460px; } }

/* Eliminar club: tarjeta de advertencia al final de «Club». */
.danger-zone { border: 1px solid var(--bad); }
.danger-zone h2 { color: var(--bad); }

/* ---- Mi familia: ficha del alumno arriba, con foto y resumen; pendientes en una franja corta ---- */
.family-hero { --hue: 215; position: relative; overflow: hidden; color: #fff; border: 0;
  background: linear-gradient(135deg, hsl(var(--hue) 62% 38%), hsl(calc(var(--hue) + 40) 58% 24%)); }
.family-hero-top { display: flex; align-items: center; gap: 16px; }
.avatar.xl { width: 96px; height: 96px; font-size: 30px; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.family-club { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .9; font-weight: 600; }
.family-club .crest.sm { width: 22px; height: 22px; font-size: 10px; }
.family-name { color: #fff; margin: 4px 0 6px; font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; }
.family-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.family-tag { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.family-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
@media (min-width: 560px) { .family-stats { grid-template-columns: repeat(4, 1fr); } }
.family-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; color: #fff; font: inherit;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.family-stat:hover { background: rgba(255,255,255,.22); }
.family-stat b { font-size: 20px; line-height: 1.1; }
.family-stat span { font-size: 12px; opacity: .9; }
.family-todo { display: flex; flex-direction: column; gap: 8px; background: var(--warn-soft); color: var(--warn); border-radius: var(--r-card); padding: 12px 14px; }
.family-todo .btn { background: var(--surface); }
.family-date { --hue: 215; flex: none; display: grid; place-items: center; width: 48px; height: 52px; border-radius: 12px; color: #fff; line-height: 1;
  background: linear-gradient(160deg, hsl(var(--hue) 62% 42%), hsl(calc(var(--hue) + 40) 62% 30%)); }
.family-date b { font-size: 20px; }
.family-date span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.family-att-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.family-att-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.family-quote { margin: 0; padding: 10px 14px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 12px 12px 0; }
.family-quote p { margin: 0; font-style: italic; }
@media (max-width: 480px) { .avatar.xl { width: 72px; height: 72px; font-size: 24px; } .family-name { font-size: 20px; } }

/* Indicaciones de la citación */
.callup-logistics { border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; margin: 0; }
.callup-logistics legend { font-weight: 800; padding: 0 6px; }
.callup-info { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 13.5px; }
.callup-info dt { font-weight: 700; color: var(--ink-soft); }
.callup-info dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .callup-info { grid-template-columns: 1fr; } .callup-info dd { margin-bottom: 4px; } }

.family-callups { border: 2px solid var(--brand); }
.family-callup { border-top: 1px solid var(--line); padding-top: 10px; }
.family-callup:first-of-type { border-top: 0; padding-top: 0; }

/* ---- Centro de partidos (Inicio y Mi familia): estilo marcador, con escudos ---- */
.match-center .mc-next { --hue: 220; border-radius: 16px; padding: 16px; color: #fff; display: flex; flex-direction: column; gap: 12px;
  background: radial-gradient(120% 140% at 50% 0%, #1d2b55 0%, #0b1330 70%); box-shadow: 0 10px 28px rgba(9, 18, 48, .35); }
.mc-next-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mc-chip { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); }
.mc-chip.ghost { background: transparent; }
.mc-chip.live { background: #19c37d; border-color: #19c37d; color: #04261a; }
.mc-when { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mc-when b { font-size: 15px; text-transform: capitalize; }
.mc-when strong { font-family: var(--font-display); font-size: 30px; color: #6ff0b4; line-height: 1; }
.mc-versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.mc-team { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.mc-team b { font-family: var(--font-display); font-size: 14px; text-transform: uppercase; line-height: 1.15; overflow-wrap: anywhere; }
.mc-team span { font-size: 11px; opacity: .8; text-transform: uppercase; }
.crest.xl { width: 72px; height: 72px; font-size: 22px; background-color: #fff; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.mc-vs { font-family: var(--font-display); font-weight: 800; font-size: 18px; opacity: .85; }
.mc-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; opacity: .9; border-top: 1px solid rgba(255,255,255,.15); padding-top: 10px; }
.mc-meta span { display: flex; align-items: center; gap: 6px; }
.mc-meta .icon { width: 16px; height: 16px; }
.mc-actions .btn { background: #fff; color: #0b1330; }
.mc-block-title { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.mc-people { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.mc-person { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 58px; text-decoration: none; color: inherit; font-size: 12px; font-weight: 700; }
.mc-dorsal { position: absolute; top: 28px; right: 2px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 1px 6px; border: 2px solid var(--surface); }
.mc-results { display: grid; gap: 10px; }
@media (min-width: 720px) { .mc-results { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.mc-result { border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.mc-result.win { border-left-color: var(--ok); } .mc-result.draw { border-left-color: #d99a00; } .mc-result.loss { border-left-color: var(--bad); }
.mc-result-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-soft); text-transform: capitalize; }
.mc-result-tag { font-weight: 800; text-transform: uppercase; }
.mc-result.win .mc-result-tag { color: var(--ok); } .mc-result.draw .mc-result-tag { color: #a66f00; } .mc-result.loss .mc-result-tag { color: var(--bad); }
.mc-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.mc-side { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.mc-side span { font-size: 11px; font-weight: 700; text-transform: uppercase; line-height: 1.15; overflow-wrap: anywhere; }
.mc-goals { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.mc-round { font-size: 12px; color: var(--ink-soft); text-align: center; }
.mc-feature { align-self: center; }
.mc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 560px) { .mc-stats { grid-template-columns: repeat(6, 1fr); } }
.mc-stat { border-radius: 12px; padding: 8px; text-align: center; background: var(--brand-soft); }
.mc-stat b { display: block; font-family: var(--font-display); font-size: 22px; }
.mc-stat span { font-size: 11px; color: var(--ink-soft); }
.mc-stat.win { background: var(--ok-soft); } .mc-stat.draw { background: var(--warn-soft); } .mc-stat.loss { background: #fde3e3; } .mc-stat.pts { background: #0b1330; color: #fff; } .mc-stat.pts span { color: rgba(255,255,255,.8); }
.mc-scorers { display: flex; flex-direction: column; gap: 6px; }
.mc-scorer { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 6px 8px; border-radius: 12px; background: var(--brand-soft); }
.mc-scorer b { display: block; font-size: 14px; } .mc-scorer span span { font-size: 12px; color: var(--ink-soft); }
.mc-rank { font-family: var(--font-display); font-weight: 800; font-size: 18px; width: 22px; text-align: center; }
.mc-goal-count { font-weight: 800; }

/* RC3.30.13 · Estadística por torneo (maqueta aprobada 13-11) */
.ts-wrap { display: flex; flex-direction: column; gap: 8px; }
.ts-band { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-card); background: var(--brand-deep); color: #fff; }
.ts-band b { display: block; font-size: 14px; } .ts-band span { font-size: 12px; opacity: .85; }
.ts-band .crest { border-color: rgba(255,255,255,.6); }
.ts-sponsors { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ts-sponsors img { height: 24px; max-width: 64px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; }
.ts-sponsors em { font-style: normal; font-size: 11px; background: #fff; color: var(--brand-deep); padding: 2px 6px; border-radius: 6px; }
.ts-card { display: flex; flex-direction: column; gap: 12px; }
.ts-card + .ts-card { margin-top: 0; }
.ts-head { display: flex; align-items: center; gap: 12px; }
.ts-head h2 { margin: 0; font-size: 18px; }
.ts-cup { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); overflow: hidden; }
.ts-cup svg { width: 22px; height: 22px; } .ts-cup img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ts-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .ts-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ts-kpi { background: var(--surface-2); border-radius: var(--r-ctl); padding: 10px 12px; }
.ts-kpi span { display: block; font-size: 12px; color: var(--ink-soft); }
.ts-kpi b { font-family: var(--font-display); font-size: 22px; }
.ts-streak { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }
.ts-sum { text-align: right; }
.ts-form { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; }
.ts-G { background: var(--ok-soft); color: var(--ok); } .ts-E { background: var(--surface-2); color: var(--ink-soft); } .ts-P { background: var(--bad-soft); color: var(--bad); }
.ts-cols { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .ts-cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.ts-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.ts-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.ts-table th { color: var(--ink-soft); font-weight: 700; text-align: right; padding: 4px; }
.ts-table th:nth-child(1), .ts-table td:nth-child(1) { width: 26px; text-align: left; }
.ts-table th:nth-child(2), .ts-table td:nth-child(2) { width: auto; text-align: left; }
.ts-table th:nth-child(n+3), .ts-table td:nth-child(n+3) { width: 38px; text-align: right; }
.ts-table td { padding: 5px 4px; border-top: 1px solid var(--line); }
.ts-table tr.mine td { background: var(--brand-soft); color: var(--brand-deep); font-weight: 800; border-top-color: transparent; }
.ts-team { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ts-team > span:last-child, .ts-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crest.xs { width: 22px; height: 22px; font-size: 9px; border-radius: 50%; border-width: 1px; }
.ts-list { display: flex; flex-direction: column; }
.ts-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; min-width: 0; }
.ts-row + .ts-row { border-top: 1px solid var(--line); }
.ts-ini { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.ts-score { padding: 1px 8px; border-radius: 6px; font-weight: 800; white-space: nowrap; }
.ts-next { border: 1px solid var(--brand); border-radius: var(--r-ctl); padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.ts-next span { color: var(--ink-soft); display: flex; align-items: center; gap: 4px; } .ts-next svg { width: 14px; height: 14px; }
