/* Ronda 3 — WE1: competencias, recintos, estructura, exportaciones e informe imprimible.
   Hoja propia del carril (los tokens y colores siguen en app.css: use var(--…)). La única excepción
   es @media print: el papel es siempre blanco con tinta negra, sin importar el tema de la pantalla. */

/* ---- página de competencias: búsqueda y filtros ---------------------------------------------- */
.meets-filters { padding: 14px 16px; }
.meets-filters-grid {
  display: grid; gap: 10px 14px; align-items: end;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}
.meets-filters-end { display: flex; align-items: end; min-height: var(--hit); }
.meets-page #meets-h { margin-bottom: 10px; }
.meets-page .meets-empty .btn { margin-top: 6px; }
@media (max-width: 720px) {
  .meets-filters-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .meets-filters-grid .meets-q { grid-column: 1 / -1; }
  .meets-filters-end { grid-column: 1 / -1; justify-content: flex-end; min-height: 0; }
  .meets-filters-end .btn[hidden] { display: none; }
}

/* ---- formulario de competencia (crear / editar) ------------------------------------------------ */
.meet-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.meet-form .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .meet-form { grid-template-columns: minmax(0, 1fr); } }
.meet-form .meet-venue-note, .meet-form .meet-city-warn, .meet-city-note { color: var(--accent-ink); }
.new-meet .program-modes { display: grid; gap: 10px; }
.new-meet .program-mode { display: grid; gap: 2px; }
.new-meet .program-mode > .field-hint { padding-left: 30px; }
.new-meet .program-mode-extra { padding: 8px 0 0 30px; }
@media (max-width: 480px) {
  .new-meet .program-mode > .field-hint, .new-meet .program-mode-extra { padding-left: 0; }
}
.venue-form .venue-lanes { max-width: 8em; }

/* ---- programa: copiar y exportar estructura ---------------------------------------------------- */
.program-clone .program-preview td, .program-clone .program-preview th { white-space: nowrap; }
.program-clone .program-preview td.import-messages { white-space: normal; min-width: 14em; }
.program-created { margin: 4px 0 0; padding-left: 1.2em; display: grid; gap: 2px; }
.structure-choices { gap: 8px; }
.structure-choice { justify-content: flex-start; text-align: left; min-height: 56px; padding: 8px 14px; white-space: normal; }
.structure-choice-text { display: grid; gap: 2px; }

/* ---- exportar competencia ------------------------------------------------------------------------ */
.meet-exports { gap: 12px; }
.export-group { display: grid; gap: 6px; }
.export-group + .export-group { border-top: 1px solid var(--line); padding-top: 12px; }
.export-report-event { display: grid; gap: 6px; margin-top: 4px; }
.export-report-event .select { flex: 1 1 12em; min-width: 0; max-width: 100%; }
.export-status:empty { display: none; }

/* ---- informe imprimible (pantalla) ---------------------------------------------------------------- */
.report-controls-grid { display: grid; gap: 10px 16px; align-items: end; grid-template-columns: minmax(0, 1fr) auto auto; }
.report-controls-grid .select { max-width: 100%; }
.report-actions { justify-content: flex-end; }
@media (max-width: 720px) {
  .report-controls-grid { grid-template-columns: minmax(0, 1fr); }
  .report-actions { justify-content: flex-start; }
}
.report { display: grid; gap: 22px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(14px, 3vw, 28px); }
.report > *, .report-body > *, .report-event > * { min-width: 0; }
.report-head { display: grid; gap: 4px; border-bottom: 2px solid var(--line-strong); padding-bottom: 12px; }
.report-kicker { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.report-head h1 { font-size: clamp(1.25rem, 3.2vw, 1.7rem); }
.report-edition { color: var(--muted); font-weight: 500; }
.report-meet-meta { color: var(--ink); }
.report-body { display: grid; gap: 26px; }
.report-event { display: grid; gap: 12px; }
.report-event-head { display: grid; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.report-event-head h2 { font-size: 1.12rem; }
.report-event-sub { color: var(--muted); font-weight: 500; }
.report-meta { color: var(--muted); font-size: .86rem; }
.report-official { color: var(--live-ink); }
.report-unofficial { color: var(--accent-ink); }
.report-warning { display: flex; gap: 8px; align-items: flex-start; }
.report-heat { display: grid; gap: 6px; }
.report-heat-title { font-size: .98rem; }
.report-wind { font-weight: 500; color: var(--muted); }
.report-table td, .report-table th { padding: 6px 9px; }
.report-table .report-athlete { min-width: 12em; }
.report-table .report-mark { font: 700 .95rem var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-table .report-precise { font-weight: 500; color: var(--muted); font-size: .82rem; }
.report-table .report-attempt { font-family: var(--font-mono); white-space: nowrap; }
.report-table .report-attempt.is-retired { font-weight: 700; color: var(--danger-ink); }
.report-table .report-att-wind { display: block; font-size: .72rem; color: var(--muted); }
.report-table .report-bar { font-family: var(--font-mono); }
.report-table .report-codes { white-space: nowrap; }
.report-code { display: inline-block; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 4px; font: 700 .76rem var(--font-mono); line-height: 1.5; }
.report-table tr.is-pending td { color: var(--muted); }
.report-legend { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.report-legend h2 { font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.report-legend dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 0; font-size: .84rem; }
.report-legend dt { font: 700 .82rem var(--font-mono); }
.report-legend dd { margin: 0; color: var(--muted); }

/* ---- informe imprimible (papel) ------------------------------------------------------------------- */
@media print {
  @page { margin: 12mm 10mm; }
  .report-noprint, .skip-link, #skip-link { display: none !important; }
  .report-page { display: block; }
  .report { display: block; border: 0; padding: 0; background: #fff; color: #000; font-size: 9.5pt; box-shadow: none; }
  .report-head { border-bottom: 1.5pt solid #000; margin-bottom: 10pt; }
  .report-head h1 { font-size: 15pt; color: #000; }
  .report-kicker, .report-edition, .report-meta, .report-event-sub, .report-wind, .report-legend h2, .report-legend dd,
  .report .muted, .report .field-hint, .report .cell-sub, .report-table .report-precise, .report-table .report-att-wind { color: #333 !important; }
  /* the screen tokens of the dark theme are light: every text of the paper is set here */
  .report-meet-meta, .report .cell-name, .report-official, .report-unofficial, .report-table .report-attempt.is-retired { color: #000 !important; }
  .report-body { display: block; }
  .report-event { display: block; margin: 0 0 14pt; break-inside: auto; }
  .report-event-head { border-bottom: .75pt solid #000; margin-bottom: 4pt; break-after: avoid; break-inside: avoid; }
  .report-event-head h2 { font-size: 11.5pt; color: #000; }
  .report-heat { display: block; margin: 0 0 8pt; break-inside: avoid; }
  .report-heat-title { font-size: 10pt; color: #000; margin: 4pt 0 2pt; break-after: avoid; }
  .report .table-wrap { overflow: visible; border-radius: 0; }
  .report table.data { font-size: 8.8pt; border-collapse: collapse; }
  .report table.data th, .report table.data td { color: #000; background: #fff !important; border: .5pt solid #999; padding: 2pt 4pt; }
  .report table.data thead th { position: static; background: #eee !important; color: #000; font-size: 7.5pt; }
  .report table.data thead { display: table-header-group; }
  .report table.data tr { break-inside: avoid; }
  .report table.data tbody tr:last-child td { border-bottom: .5pt solid #999; }
  .report-code { border-color: #666; color: #000; }
  .report-warning { border: .75pt solid #000; background: #fff !important; color: #000; }
  .report-warning .icon { display: none; }
  .report-legend { border-top: .75pt solid #000; break-inside: avoid; }
  .report-legend dt { color: #000; }
}
