/* Liga 16 - hoja de estilos moderna */

:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #0f1b2d;
  --muted: #5b6b82;
  --border: #e2e7f0;
  --brand: #0b2a55;
  --brand-2: #16427f;
  --accent: #c6ef3a;
  --accent-ink: #1d2a00;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --ok: #1b7f4b;
  --ok-bg: #e7f6ee;
  --gold: #e9b824;
  --silver: #a7b1c2;
  --bronze: #c98a4b;
  --fila-alterna: #f4f7fc;
  --fila-hover: #e6eefb;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 6px 20px rgba(15, 27, 45, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c121e;
    --surface: #141c2c;
    --surface-2: #192336;
    --text: #e6ebf4;
    --muted: #97a5bc;
    --border: #253048;
    --danger-bg: #3a1c1c;
    --ok-bg: #15301f;
    --danger: #ff8a7a;
    --ok: #6fd69b;
    --fila-alterna: #18223a;
    --fila-hover: #22304d;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sin esto, una tabla ancha estira <main> (hijo flex) y la pagina se sale de la pantalla en moviles */
main { flex: 1 0 auto; min-width: 0; width: 100%; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) { a { color: #8fb6ff; } }

img { max-width: 100%; }

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}

.bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }

.ball {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .12);
  flex: none;
}
.ball::before, .ball::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 12px;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
}
.ball::before { left: -7px; border-left-color: transparent; border-top-color: transparent; border-bottom-color: transparent; }
.ball::after { right: -7px; border-right-color: transparent; border-top-color: transparent; border-bottom-color: transparent; }

.bar-right { display: flex; align-items: center; gap: 14px; }

.user {
  font-size: 13px;
  color: rgba(255, 255, 255, .8);
  white-space: nowrap;
}

.sponsor {
  display: flex;
  align-items: center;
}
.sponsor img { height: 30px; width: auto; display: block; }

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px 10px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  color: rgba(255, 255, 255, .82);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.nav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.nav a.salir { margin-left: auto; }

@media (max-width: 640px) {
  .sponsor, .user { display: none; }
  .nav a.salir { margin-left: 0; }
}

/* ---------- Pie ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}
.site-footer .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
.site-footer a { color: var(--muted); }

/* ---------- Estructura ---------- */

.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}
.page.narrow { max-width: 760px; }
.page.wide { max-width: none; }

.page-head { margin-bottom: 22px; }
.page-head h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.page-head p { margin: 6px 0 0; color: var(--muted); }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 6px;
}
@media (prefers-color-scheme: dark) { .eyebrow { color: var(--accent); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}
.card h2, .section-title {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: -.01em;
}
.section-title { margin-top: 34px; scroll-margin-top: 130px; }
.card > :last-child { margin-bottom: 0; }

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.muted { color: var(--muted); }

/* ---------- Pastillas / anclas ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.chips a {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.chips a:hover { border-color: var(--brand-2); text-decoration: none; }
.chips a.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- ABM ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0 18px;
}
.form-grid .wide { grid-column: 1 / -1; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field .readonly {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 600;
}
.check { display: flex; align-items: center; gap: 8px; padding: 10px 0; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 280px; max-width: 640px; }
.toolbar form .input[type=search] { flex: 1 1 180px; width: auto; }
.toolbar .tam-pagina { flex: none; }
.toolbar .tam-pagina .input { width: auto; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pager .pages { display: flex; flex-wrap: wrap; gap: 4px; }
.pager .pages a {
  min-width: 34px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  color: var(--text);
}
.pager .pages a:hover { border-color: var(--brand-2); text-decoration: none; }
.tbl td.acciones { white-space: nowrap; text-align: right; }
.tbl td.acciones form { display: inline; }

/* ABM: letra mas compacta para ver mas datos */
.abm { font-size: 13px; }
.abm .page-head h1 { font-size: clamp(20px, 3vw, 26px); }
.abm .page-head p { font-size: 13px; }
.abm .chips a { font-size: 12px; padding: 5px 12px; }
.abm .tbl { font-size: 12px; line-height: 1.35; }
/* Una linea por registro: la tabla se desplaza y Acciones queda fija */
.abm .tbl th, .abm .tbl td { padding: 6px 9px; white-space: nowrap; }
.abm .tbl thead th { font-size: 10.5px; letter-spacing: .03em; }
.abm .tbl td.acciones .btn-sm { font-size: 11px; padding: 3px 8px; }
.abm .card h2 { font-size: 16px; }
.abm .field label { font-size: 12px; margin-bottom: 4px; }
.abm .input, .abm .field .readonly { font-size: 13px; padding: 8px 10px; }
.abm .btn { font-size: 13px; padding: 8px 14px; }
.abm .btn-sm { font-size: 12px; padding: 5px 10px; }
.abm .alert { font-size: 13px; }
/* Columna de acciones fija a la derecha: Editar/Borrar siempre visibles
   aunque la tabla sea mas ancha que la pantalla y se desplace */
.abm .tbl td.acciones, .abm .tbl th.acciones {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: -8px 0 8px -8px rgba(15, 27, 45, .25), -1px 0 0 var(--border);
}
.abm .tbl thead th.acciones { background: var(--surface-2); z-index: 2; }
/* Filas alternadas para seguir mejor cada registro */
.abm .tbl tbody tr:nth-child(even) td { background: var(--fila-alterna); }
.abm .tbl tbody tr:hover td { background: var(--fila-hover); }

/* ---------- Tablas ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th, .tbl td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl thead th, .tbl tr.sub th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: center; font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 600; }

.tbl tr.grp th {
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 10px 14px;
}
.tbl tr.grp.alt th { background: var(--brand-2); }
.tbl tr.grp.gold th { background: var(--accent); color: var(--accent-ink); }
.tbl tr.grp.final th { background: var(--gold); color: #2b1d00; }

.tbl-cal td:first-child, .tbl-cal td:nth-child(2) { font-weight: 600; }
.tbl-cal td { white-space: nowrap; }
.tbl-cal tr.libre td { color: var(--muted); }
.tbl-cal tr.libre em { font-style: normal; font-weight: 600; color: var(--brand-2); }

/* Fila de parejas (Participantes) */
.tbl tr.par-a td { background: rgba(22, 66, 127, .05); }
.tbl tr.par-b td { background: transparent; }

/* ---------- Matriz de posiciones ---------- */

.matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.matrix th, .matrix td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}
.matrix thead th {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 12px;
  min-width: 128px;
  position: sticky;
  top: 0;
}
.matrix .team {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  text-align: left;
  font-weight: 700;
  min-width: 130px;
  box-shadow: 1px 0 0 var(--border);
}
.matrix thead .team { z-index: 2; background: var(--surface-2); }
.matrix td.diag {
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 6px, var(--border) 6px, var(--border) 7px);
}
.matrix td.pts, .matrix th.pts {
  background: rgba(198, 239, 58, .18);
  font-size: 16px;
  font-weight: 800;
  min-width: 80px;
}
.matrix td.pos, .matrix th.pos { font-size: 16px; font-weight: 800; min-width: 80px; }

.mres { display: grid; gap: 2px; }
.mres .row {
  display: grid;
  grid-template-columns: 26px repeat(3, 1fr);
  gap: 2px;
}
.mres span {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 2px 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mres span.p { background: transparent; color: var(--muted); font-weight: 700; }

/* ---------- Formularios ---------- */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.input, select.input, textarea.input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
.input:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(22, 66, 127, .18);
}
textarea.input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { flex: 1 1 220px; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .05s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(.96); border-color: var(--accent); color: var(--accent-ink); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-block { width: 100%; }

.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 14px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(192, 57, 43, .25);
}
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(27, 127, 75, .25); }
.alert pre { margin: 0; white-space: pre-wrap; font-size: 13px; }

/* ---------- Carga de resultados ---------- */

.score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, 58px);
  gap: 10px;
  align-items: center;
}
.score .h {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: center;
}
.score .h:first-child { text-align: left; }
.score .team small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.score .set {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  padding: 8px 0;
  font-variant-numeric: tabular-nums;
}
.score .placeholder {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.score .divider { grid-column: 1 / -1; height: 1px; background: var(--border); }

@media (max-width: 480px) {
  .score { grid-template-columns: minmax(0, 1fr) repeat(3, 44px); gap: 8px; }
  .score .set { font-size: 17px; }
}

/* ---------- Contenido de texto (reglamento) ---------- */

.prose h2 {
  font-size: 17px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.prose h2::before {
  content: "";
  width: 6px;
  height: 18px;
  border-radius: 3px;
  background: var(--accent);
  flex: none;
}
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose section { scroll-margin-top: 130px; }

.highlight {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 10px 0 14px;
}
.highlight code, .mono { font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: .02em; }

.layout-toc {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
}
.toc strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.toc a { display: block; color: var(--text); padding: 5px 8px; border-radius: 6px; }
.toc a:hover { background: var(--surface-2); text-decoration: none; }

@media (max-width: 860px) {
  .layout-toc { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .toc strong { width: 100%; }
  .toc a { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
}

/* ---------- Noticias / podio ---------- */

.podium { list-style: none; margin: 0 0 14px; padding: 0; }
.podium li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.podium li:last-child { border-bottom: 0; }
.medal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #1b1b1b;
  flex: none;
}
.m1 { background: var(--gold); }
.m2 { background: var(--silver); }
.m3 { background: var(--bronze); }

/* ---------- Noticias ---------- */

.news { display: grid; gap: 18px; margin-bottom: 8px; }
.news-item {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
}
.news-item:not(:has(.news-foto)) { grid-template-columns: minmax(0, 1fr); }
.news-item.destacada { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.news-foto {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}
.news-body h2 { margin: 4px 0 10px; font-size: 20px; line-height: 1.3; }
.news-body .prose p { margin: 0 0 10px; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.news-edit { margin-left: auto; font-weight: 600; }
.tag {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 999px;
}
@media (max-width: 640px) {
  .news-item { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Fotos ---------- */

.gallery {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.gallery a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.gallery a:hover img { transform: scale(1.05); }

.g-item { position: relative; margin: 0; transition: opacity .2s; }
.g-item.borrando { opacity: .4; pointer-events: none; }
.g-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 30, 91, .78);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.g-item:hover .g-del, .g-del:focus-visible { opacity: 1; }
.g-del:hover { background: var(--danger); }
@media (hover: none) { .g-del { opacity: 1; } }

/* ---------- Subida de fotos ---------- */

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}
.checklist li.ok::before { content: "\2713"; background: var(--ok-bg); color: var(--ok); }
.checklist li.ko::before { content: "\2715"; background: var(--danger-bg); color: var(--danger); }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 36px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand-2); background: rgba(22, 66, 127, .06); }

.upl-list { margin-top: 14px; }
.upl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 4px 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.upl-row:last-child { border-bottom: 0; }
.upl-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl-msg { grid-column: 1 / -1; font-size: 12px; }
.upl-msg.ok { color: var(--ok); font-weight: 600; }
.upl-msg.ko { color: var(--danger); font-weight: 600; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upl-row.error .progress span { background: var(--danger); }

/* ---------- Acceso (login) ---------- */

.auth {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(198, 239, 58, .25), transparent 60%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 18px;
  padding: 30px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.auth-card .brand { color: var(--text); justify-content: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-card .sponsor-block {
  text-align: center;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.auth-card .sponsor-block img { display: block; margin: 10px auto 0; width: 100%; max-width: 320px; height: auto; }
@media (prefers-color-scheme: dark) { .auth-card .sponsor-block img { content: url("logo-blanco.svg"); } }
.auth-card .help { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; }

/* ---------- Moviles ---------- */

/* iOS hace zoom al enfocar campos con letra menor a 16px */
@media (max-width: 640px) {
  .input, select.input, textarea.input,
  .abm .input, .abm .field .readonly { font-size: 16px; }
  .card { padding: 16px; }
  .page { padding-top: 20px; }
  .news-item { padding: 14px; gap: 14px; }
  .actions .btn { flex: 1 1 auto; }
}

/* Pantallas tactiles: botones y enlaces con area de toque comoda */
@media (pointer: coarse) {
  .btn-sm, .abm .btn-sm, .abm .tbl td.acciones .btn-sm { min-height: 40px; padding: 8px 14px; }
  .pager .pages a { min-height: 40px; padding: 9px 12px; }
  .btn, .abm .btn { min-height: 44px; }
  .nav a { padding: 10px 14px; }
  .chips a, .abm .chips a { padding: 9px 14px; }
  .toc a { padding: 8px 12px; }
  .g-del { width: 44px; height: 44px; }
  .check input { width: 22px; height: 22px; }
}

/* Ocultar enlace de administracion hasta pasar el cursor */
.oculto2 { opacity: 0; transition: .3s; }
.oculto2:hover { opacity: 1; }

/* Ordenar tablas por columna */
.tbl th a.orden { color: inherit; text-decoration: none; white-space: nowrap; }
.tbl th a.orden:hover { text-decoration: underline; }
.tbl th a.orden.activo { font-weight: 800; }
.tbl th.ordenable { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl th.ordenable:hover { text-decoration: underline; }
.tbl th[data-orden="asc"]::after { content: " \25B2"; font-size: .8em; }
.tbl th[data-orden="desc"]::after { content: " \25BC"; font-size: .8em; }