/* =====================================================================
   CARBÓN SPORTS · Sports Programming & Events
   Carbón de fondo, superficies grafito, acento dorado y colores por marca.
   La pieza distintiva: la "ficha de partido" con las franjas de color de
   cada marca en el borde y la hora en numerales tabulares.
   ===================================================================== */

:root {
  --bg: #131416;
  --surface-1: #1A1C1F;
  --surface-2: #212429;
  --surface-3: #2A2D33;
  --line: #2C3036;
  --line-strong: #3A3F46;
  --text: #ECEAE4;
  --text-2: #ABA79E;
  --text-3: #7B7871;
  --gold: #C9A54C;
  --gold-2: #E0BF6D;
  --gold-soft: rgba(201, 165, 76, 0.14);
  --gold-ink: #17140C;
  --ok: #4FB37F;
  --warn: #E3A63B;
  --danger: #D9625B;
  --info: #6AA6E0;
  --radius-card: 12px;
  --radius-ctrl: 8px;
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.35);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 236px;
  --topbar-h: 64px;
  /* Tokens que cambian con el tema */
  --gold-hover: #E0BF6D;
  --topbar-bg: rgba(19, 20, 22, 0.92);
  --danger-text: #F2948E;
  --danger-line: #5B302D;
  --danger-bg: #2A1A19;
  --danger-bg-2: #3A2120;
  --error-bg: #231716;
  --error-text: #F2C3BF;
  --pill-ink: #ffffff;
  --crest-glow: drop-shadow(0 0 .6px rgba(255, 255, 255, .55)) drop-shadow(0 0 1.5px rgba(255, 255, 255, .12));
  --weekend-bg: rgba(255, 255, 255, 0.012);
  --out-bg: rgba(0, 0, 0, 0.18);
  --overlay-bg: rgba(6, 7, 8, 0.62);
  --logo-bg: #F7F5F0;
  /* Medalla de escudos y placa de logotipos */
  --crest-plate: radial-gradient(circle at 50% 35%, #FFFFFF 0%, #EFEBE2 70%, #E2DDD1 100%);
  --crest-ring: rgba(255, 255, 255, 0.14);
  --crest-shadow: rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

/* ---------- Tema claro ----------
   Se activa con <html data-theme="light">; lo decide assets/js/theme.js
   antes de pintar (preferencia guardada, ?tema= en la URL o el sistema). */
:root[data-theme="light"] {
  --bg: #F3F1EC;
  --surface-1: #FFFFFF;
  --surface-2: #F5F3EF;
  --surface-3: #EAE6DF;
  --line: #E2DED6;
  --line-strong: #CFC9BE;
  --text: #1C1B19;
  --text-2: #55524C;
  --text-3: #76726B;
  --gold: #B8913A;
  --gold-2: #8A6716;
  --gold-soft: rgba(184, 145, 58, 0.15);
  --gold-ink: #17140C;
  --gold-hover: #C9A54C;
  --ok: #2E8A5B;
  --warn: #B4761A;
  --danger: #C4463E;
  --info: #2F74B5;
  --shadow-pop: 0 18px 50px rgba(40, 32, 18, 0.18), 0 2px 8px rgba(40, 32, 18, 0.10);
  --topbar-bg: rgba(243, 241, 236, 0.92);
  --danger-text: #A8352D;
  --danger-line: #E5B7B1;
  --danger-bg: #FCEEEC;
  --danger-bg-2: #F8DFDB;
  --error-bg: #FDF2F0;
  --error-text: #6E2620;
  --pill-ink: #000000;
  --crest-glow: drop-shadow(0 0 .5px rgba(0, 0, 0, .28));
  --weekend-bg: rgba(0, 0, 0, 0.018);
  --out-bg: rgba(0, 0, 0, 0.035);
  --overlay-bg: rgba(28, 24, 16, 0.38);
  --logo-bg: #FFFFFF;
  --crest-plate: radial-gradient(circle at 50% 35%, #FFFFFF 0%, #F7F5F0 70%, #ECE8DF 100%);
  --crest-ring: rgba(40, 32, 18, 0.12);
  --crest-shadow: rgba(40, 32, 18, 0.16);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.nowrap { white-space: nowrap; }

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

/* ---------- Arranque ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 14px; justify-items: center; color: var(--text-2); }
.boot__mark { width: 34px; height: 34px; border-radius: 9px; background: var(--gold); position: relative; animation: pulse 1.4s ease-in-out infinite; }
.boot__mark::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 3px solid var(--gold-ink); }
@keyframes pulse { 50% { opacity: .55; transform: scale(.94); } }
.noscript { padding: 24px; }

/* ---------- Marca ---------- */
.brandmark { display: flex; align-items: center; gap: 11px; }
.brandmark__logo { width: 32px; height: 32px; flex: none; }
.brandmark__name { font-weight: 800; font-size: 15px; letter-spacing: .06em; line-height: 1.1; }
.brandmark__desc { font-size: 10.5px; color: var(--text-3); font-weight: 600; letter-spacing: .01em; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface-1); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
}
.sidebar .brandmark { padding: 2px 8px 20px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__group { font-size: 11px; color: var(--text-3); font-weight: 600; padding: 14px 10px 6px; }
.nav__item {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px;
  border-radius: var(--radius-ctrl); color: var(--text-2); font-weight: 600; font-size: 13.5px;
  position: relative; text-decoration: none !important;
}
.nav__item svg { width: 18px; height: 18px; flex: none; }
.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.nav__item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn); color: #1d1404; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sidebar__foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--gold-2); flex: none; }
.sidebar__user { min-width: 0; flex: 1; }
.sidebar__user strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user span { font-size: 11.5px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar__title { min-width: 0; flex: 1; }
.topbar__title h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__title p { margin: 0; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .topbar__menu { display: none; }
.syncchip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); font-size: 12.5px; font-weight: 600; background: var(--surface-1);
  cursor: pointer;
}
.syncchip:hover { border-color: var(--line-strong); color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot--ok { background: var(--ok); }
.dot--warn { background: var(--warn); }
.dot--danger { background: var(--danger); }
.dot--run { background: var(--info); animation: pulse 1s infinite; }
.content { padding: 22px 24px 48px; min-width: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-ctrl);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s, color .12s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn--primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { color: var(--danger-text); border-color: var(--danger-line); background: var(--danger-bg); }
.btn--danger:hover { background: var(--danger-bg-2); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 30px; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--text-2) transparent var(--text-2) transparent; animation: spin .7s linear infinite; }
.btn--primary.is-busy::after { border-color: var(--gold-ink) transparent var(--gold-ink) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-ctrl); overflow: hidden; background: var(--surface-1); }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button svg { width: 15px; height: 15px; flex: none; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--gold); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field small { font-size: 11.5px; color: var(--text-3); }
.field .err { color: var(--danger-text); font-size: 12px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-ctrl);
  border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text); font-size: 13.5px;
}
.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ABA79E' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .55; }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--danger); }
.input[type="color"] { padding: 3px; width: 52px; }
.input[type="date"], .input[type="time"], .input[type="datetime-local"] { color-scheme: dark; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--gold); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
.form-section > h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 34px; }

/* ---------- Barra de filtros ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar__spacer { flex: 1; }
.toolbar .search { width: 260px; max-width: 100%; }
.toolbar .select { width: auto; min-width: 150px; }
.toolbar .input[type="date"] { width: 150px; }
.range-title { font-size: 16px; font-weight: 700; margin: 0 6px; white-space: nowrap; }

/* chips de marca seleccionables */
.brandpick { display: flex; flex-wrap: wrap; gap: 6px; }
.brandpick button, .chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 6px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-1);
  font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.brandpick button .sw, .chip .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--gold)); }
.brandpick button[aria-pressed="true"] { color: var(--text); border-color: var(--c, var(--gold)); background: color-mix(in srgb, var(--c, var(--gold)) 16%, var(--surface-1)); }
.chip { cursor: default; height: 24px; padding: 0 9px 0 7px; font-size: 11.5px; }
.chip--brand { height: 34px; padding: 0 12px 0 4px; font-size: 12.5px; }

/* ---------- Píldoras de estado ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: color-mix(in srgb, var(--c, #9AA3AE) 14%, transparent);
  color: color-mix(in srgb, var(--c, #9AA3AE) 70%, var(--pill-ink)); border: 1px solid color-mix(in srgb, var(--c, #9AA3AE) 30%, transparent);
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #9AA3AE); }
.pill--plain::before { display: none; }
.pill svg { width: 13px; height: 13px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-card); }
.card__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card__head h2, .card__head h3 { margin: 0; font-size: 14.5px; font-weight: 700; flex: 1; }
.card__body { padding: 14px 16px; }
.card__foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Escudos ----------
   Cada escudo es una medalla: la imagen sobre un disco claro, con aro y sombra,
   para que cualquier escudo (oscuro, claro o transparente) se lea igual de bien
   en tema claro y oscuro. Sin imagen: iniciales sobre el color del equipo. */
.crest {
  width: var(--s, 28px); height: var(--s, 28px); flex: none; border-radius: 50%;
  display: inline-grid; place-items: center; overflow: hidden; position: relative;
  box-shadow: 0 0 0 1px var(--crest-ring), 0 calc(var(--s, 28px) * .06) calc(var(--s, 28px) * .2) var(--crest-shadow);
}
.crest--img { background: var(--crest-plate); padding: calc(var(--s, 28px) * .13); }
.crest--img img { width: 100%; height: 100%; object-fit: contain; display: block; image-rendering: auto; }
.crest--initials {
  background: var(--surface-3); color: var(--text-2);
  font-size: calc(var(--s, 28px) * .34); font-weight: 800; letter-spacing: .03em; line-height: 1;
}
.crest--team {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 62%), var(--c);
  color: var(--ci, #FFFFFF); text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  box-shadow: 0 0 0 1px var(--crest-ring), inset 0 0 0 calc(var(--s, 28px) * .045) rgba(255, 255, 255, .22), 0 calc(var(--s, 28px) * .06) calc(var(--s, 28px) * .2) var(--crest-shadow);
}
.crest--long { font-size: calc(var(--s, 28px) * .27); }
.crest--sm { box-shadow: 0 0 0 1px var(--crest-ring), 0 1px 3px var(--crest-shadow); }
.crest--sm.crest--img { padding: calc(var(--s, 28px) * .1); }
.crest--sm.crest--team { font-size: calc(var(--s, 28px) * .5); letter-spacing: 0; }
.crest--initials svg { width: 54%; height: 54%; }
/* Logotipo de la liga o competición: placa clara con aro y sombra (como los escudos,
   pero cuadrada para distinguirla), para que se lea igual en tema claro y oscuro. */
.complogo {
  width: var(--s, 22px); height: var(--s, 22px); flex: none; display: inline-grid; place-items: center;
  border-radius: calc(var(--s, 22px) * .26); overflow: hidden; color: var(--gold-2);
  box-shadow: 0 0 0 1px var(--crest-ring), 0 calc(var(--s, 22px) * .05) calc(var(--s, 22px) * .18) var(--crest-shadow);
}
.complogo--img { background: var(--crest-plate); padding: calc(var(--s, 22px) * .12); }
.complogo--img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.complogo--icon { background: var(--surface-3); }
.complogo.complogo--icon svg { width: 58%; height: 58%; display: block; }
.kv svg, .card__head svg { width: 16px; height: 16px; }

/* ---------- Ficha de partido (fixture) ---------- */
.fixture {
  position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); cursor: pointer; background: transparent;
  width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; color: inherit;
}
.fixture:last-child { border-bottom: 0; }
.fixture:hover { background: var(--surface-2); }
.lanes { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; display: flex; flex-direction: column; }
.lanes span { flex: 1; background: var(--c); }
.lanes:empty { background: repeating-linear-gradient(180deg, var(--line-strong) 0 4px, transparent 4px 8px); width: 3px; }
.fixture__time { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1; }
.fixture__day { font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-top: 4px; }
.fixture__main { min-width: 0; }
.fixture__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); font-weight: 600; min-width: 0; }
.fixture__meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixture__meta .sep { width: 1px; height: 12px; background: var(--line-strong); flex: none; }
.fixture__meta svg { width: 14px; height: 14px; flex: none; }
.matchup { display: flex; align-items: center; gap: 9px; margin-top: 5px; min-width: 0; }
.matchup__name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matchup__vs { color: var(--text-3); font-size: 12px; font-weight: 600; }
.matchup--single .matchup__name { white-space: normal; }
.fixture__note { margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--warn); }
.fixture__side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.fixture.is-draft .fixture__time { color: var(--text-2); }
.fixture.is-cancelled .matchup__name, .fixture.is-cancelled .fixture__time { text-decoration: line-through; text-decoration-color: var(--danger); color: var(--text-3); }
.flag-change { display: inline-flex; align-items: center; gap: 5px; color: var(--warn); font-size: 12px; font-weight: 700; }
.flag-change svg { width: 15px; height: 15px; }
.brandtags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.brandtag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: color-mix(in srgb, var(--c) 20%, transparent); color: color-mix(in srgb, var(--c) 55%, var(--pill-ink)); }
.brandtag.has-logo { padding-left: 2px; }
.brandtag img { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; background: var(--logo-bg); padding: 1px; flex: none; box-shadow: 0 0 0 1px var(--crest-ring); }
/* Etiquetas grandes: tarjetas del tablero y de la vista pública. */
.brandtags--lg { gap: 6px; }
.brandtags--lg .brandtag { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 7px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.brandtags--lg .brandtag.has-logo { padding-left: 3px; }
.brandtags--lg .brandtag img { width: 24px; height: 24px; border-radius: 6px; padding: 2px; }
/* Logotipo de marca (o su color si no tiene): filtros, ficha, tablero, dashboard, difusión y vista pública. */
.bmark {
  width: var(--s, 16px); height: var(--s, 16px); border-radius: calc(var(--s, 16px) * .24); object-fit: contain;
  background: var(--logo-bg); padding: calc(var(--s, 16px) * .07); flex: none; display: inline-block;
  box-shadow: 0 0 0 1px var(--crest-ring), 0 calc(var(--s, 16px) * .05) calc(var(--s, 16px) * .18) var(--crest-shadow);
}
.bmark--color { width: calc(var(--s, 16px) * .62); height: calc(var(--s, 16px) * .62); border-radius: 3px; background: var(--c); padding: 0; box-shadow: none; margin: 0 calc(var(--s, 16px) * .19); }

/* ---------- Tablero ---------- */
.board-group { margin-bottom: 26px; }
.board-group__head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.board-group__head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.board-group__head .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); align-self: center; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ecard {
  position: relative; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 14px 14px 12px 20px; display: flex; flex-direction: column; gap: 10px; overflow: hidden;
}
.ecard.is-draft { border-style: dashed; border-color: var(--line-strong); }
.ecard.is-cancelled { opacity: .72; }
.ecard.is-cancelled .ecard__teams strong { text-decoration: line-through; text-decoration-color: var(--danger); }
.ecard.has-change { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.ecard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ecard__when .fixture__time { font-size: 26px; }
.ecard__comp { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); font-weight: 700; text-align: right; line-height: 1.25; }
.ecard__teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; padding: 8px 0 4px; }
.ecard__teams .matchup__vs { align-self: center; margin-top: -18px; font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.ecard__team { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; min-width: 0; }
.ecard__team strong { font-size: 14.5px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.ecard__single { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.ecard__single strong { font-size: 15px; }
.ecard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; }
.ecard__actions { display: flex; gap: 6px; }

/* ---------- Calendario ---------- */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; background: var(--surface-1); }
.cal-col { border-right: 1px solid var(--line); min-height: 420px; display: flex; flex-direction: column; min-width: 0; }
.cal-col:last-child { border-right: 0; }
.cal-col__head { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 6px; }
.cal-col__head strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cal-col__head span { font-size: 12px; color: var(--text-2); font-weight: 600; text-transform: capitalize; }
.cal-col.is-today .cal-col__head { box-shadow: inset 0 3px 0 var(--gold); }
.cal-col.is-today .cal-col__head strong { color: var(--gold-2); }
.cal-col.is-weekend { background: var(--weekend-bg); }
.cal-col__body { padding: 6px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.cal-empty { color: var(--text-3); font-size: 12px; padding: 6px 4px; }
.cchip {
  position: relative; display: block; width: 100%; text-align: left; padding: 6px 7px 6px 11px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; overflow: hidden; color: inherit;
}
.cchip:hover { border-color: var(--line-strong); background: var(--surface-3); }
.cchip .lanes { width: 4px; }
.cchip__row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.cchip__time { font-weight: 800; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cchip__title { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.cchip__sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cchip__row .crest { margin-left: -2px; }
.cchip__icons { margin-left: auto; display: flex; gap: 3px; color: var(--warn); }
.cchip__icons svg { width: 13px; height: 13px; }
.cchip.is-draft { background: transparent; border-style: dashed; }
.cchip.is-cancelled .cchip__title { text-decoration: line-through; text-decoration-color: var(--danger); color: var(--text-3); }
.cchip.has-change { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }

.cal-month { border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; background: var(--surface-1); }
.cal-month__dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cal-month__dow span { padding: 8px 10px; font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: capitalize; }
.cal-month__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mcell { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell__day { font-size: 12.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; padding: 0 3px 2px; }
.mcell.is-out { background: var(--out-bg); }
.mcell.is-out .mcell__day { color: var(--text-3); }
.mcell.is-today .mcell__day { color: var(--gold-ink); background: var(--gold); border-radius: 5px; align-self: flex-start; padding: 0 6px; }
.mline {
  position: relative; display: flex; align-items: center; gap: 5px; width: 100%; border: 0; background: var(--surface-2);
  border-radius: 5px; padding: 2px 6px 2px 9px; font-size: 11.5px; font-weight: 600; cursor: pointer; text-align: left; overflow: hidden; color: inherit;
}
.mline:hover { background: var(--surface-3); }
.mline .lanes { width: 3px; }
.mline b { font-weight: 800; font-variant-numeric: tabular-nums; }
.mline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mline.is-draft { background: transparent; outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.mline.is-cancelled span { text-decoration: line-through; color: var(--text-3); }
.mmore { font-size: 11.5px; color: var(--gold-2); background: none; border: 0; text-align: left; padding: 1px 6px; cursor: pointer; font-weight: 600; }

.agenda-day { margin-bottom: 16px; }
.agenda-day h3 { font-size: 13.5px; margin: 0 0 8px; color: var(--text-2); }
.agenda-day.is-today h3 { color: var(--gold-2); }

/* ---------- Dashboard ---------- */
.scoreboard {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border: 1px solid var(--line);
  border-radius: var(--radius-card); background: var(--surface-1); overflow: hidden; margin-bottom: 18px;
}
.score { padding: 14px 16px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; min-width: 0; }
.score button { all: unset; cursor: pointer; display: block; }
.score__n { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; }
.score__l { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-top: 4px; }
.score__h { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.score--warn .score__n { color: var(--warn); }
.score--ok .score__n { color: var(--ok); }
.score--gold .score__n { color: var(--gold-2); }
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 42px; gap: 10px; align-items: center; font-size: 13px; }
.bar__name { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; }
.bar__name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; display: flex; }
.bar__fill { height: 100%; background: var(--c); }
.bar__fill--soft { opacity: .45; }
.bar__n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; align-items: end; height: 92px; }
.days__col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.days__bar { width: 100%; max-width: 30px; background: var(--gold); border-radius: 4px 4px 0 0; min-height: 2px; }
.days__bar.is-zero { background: var(--surface-3); }
.days__lab { font-size: 10.5px; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.days__n { font-size: 11px; font-weight: 700; color: var(--text-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-2); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }
.statusline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.issue { border-left: 3px solid var(--warn); padding: 6px 10px; background: rgba(227, 166, 59, 0.07); border-radius: 0 6px 6px 0; font-size: 12.5px; margin-top: 8px; }
.issue strong { display: block; }

/* ---------- Listas tipo tabla ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-1); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-1); position: sticky; top: 0; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-clickable:hover td { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table .select, .table .input { height: 32px; font-size: 12.5px; }

/* ---------- Eventos ESPN ---------- */
.day-block { margin-bottom: 20px; }
.day-block > h2 { font-size: 14px; font-weight: 700; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.day-block > h2 small { color: var(--text-3); font-weight: 600; font-size: 12px; }
.srow { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow__time { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.srow__time small { display: block; font-size: 11px; color: var(--warn); font-weight: 700; }
.srow__side { display: flex; align-items: center; gap: 8px; }
.quick { position: absolute; z-index: 40; width: 320px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); padding: 14px; }
.quick h4 { margin: 0 0 4px; font-size: 14px; }
.quick p { margin: 0 0 12px; font-size: 12px; color: var(--text-2); }
.quick__foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Difusión ---------- */
.dgroup { margin-bottom: 14px; }
.dgroup__head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dgroup__head .fixture__time { font-size: 18px; }
.dgroup__title { font-weight: 700; flex: 1; min-width: 180px; }
.drow {
  display: grid; gap: 8px 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line);
  grid-template-columns: 140px 92px minmax(0, 1fr) minmax(0, 1fr) 146px minmax(0, 1fr) 196px;
  grid-template-areas: "brand req dis resp lim red pub" "brand link link link obs obs save";
}
.drow:last-child { border-bottom: 0; }
.da-brand { grid-area: brand; align-self: start; padding-top: 8px; } .da-req { grid-area: req; } .da-dis { grid-area: dis; } .da-resp { grid-area: resp; }
.da-lim { grid-area: lim; } .da-red { grid-area: red; } .da-pub { grid-area: pub; } .da-obs { grid-area: obs; } .da-save { grid-area: save; text-align: right; }
.da-link { grid-area: link; display: flex; gap: 6px; align-items: center; min-width: 0; }
.drow__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13px; }
.drow .field > span { display: none; }
.drow.is-dirty { background: rgba(201, 165, 76, 0.05); }
.drow--head { grid-template-areas: "brand req dis resp lim red pub"; padding-top: 8px; padding-bottom: 6px; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.drow--head .da-brand { padding-top: 0; }
.overdue { color: var(--danger-text); font-weight: 700; }

/* ---------- Catálogos ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { height: 40px; padding: 0 14px; border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.bcard { padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.bcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.bcard__top { display: flex; align-items: center; gap: 12px; }
.bcard__logo { width: 76px; height: 76px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; border: 1px solid var(--line); }
.bcard__logo img { width: 100%; height: 100%; object-fit: contain; }
.bcard__logo.has-img { background: var(--logo-bg); padding: 6px; border-color: transparent; box-shadow: 0 0 0 1px var(--crest-ring), 0 4px 14px var(--crest-shadow); }
.bcard__logo span { font-weight: 800; color: var(--c); font-size: 22px; }
.bcard h3 { margin: 0 0 2px; font-size: 17px; }
.matrix-msg { font-size: 12px; color: var(--text-2); min-width: 260px; max-width: 420px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.switch input:checked + span { background: color-mix(in srgb, var(--gold) 35%, var(--surface-3)); border-color: var(--gold); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--gold-2); }
.switch input:disabled + span { opacity: .45; }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gold); transition: width .2s; }
.code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

/* ---------- Historial ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.tl-icon svg { width: 13px; height: 13px; }
.tl-icon--sync { background: rgba(106, 166, 224, 0.15); color: var(--info); }
.tl-icon--alert { background: rgba(227, 166, 59, 0.15); color: var(--warn); }
.tl-text { font-size: 13px; }
.tl-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.changes { margin: 6px 0 0; padding: 8px 10px; background: var(--surface-2); border-radius: 7px; font-size: 12px; display: grid; gap: 3px; }
.changes div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; }
.changes del { color: var(--text-3); }
.changes svg { width: 12px; height: 12px; margin: 0 4px; vertical-align: -1px; color: var(--text-3); }
.changes ins { text-decoration: none; color: var(--text); }

/* ---------- Panel lateral (detalle) y modales ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: var(--overlay-bg); display: flex; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  margin-left: auto; width: min(560px, 100%); height: 100%; background: var(--surface-1); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; animation: slide .18s ease-out; box-shadow: var(--shadow-pop);
}
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer__head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { margin: 0; font-size: 16px; flex: 1; }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer__foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; background: var(--surface-1); }
.modal {
  margin: auto; width: min(720px, calc(100% - 24px)); max-height: calc(100% - 32px); background: var(--surface-1); border: 1px solid var(--line-strong);
  border-radius: 14px; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: rise .16s ease-out;
}
.modal--sm { width: min(440px, calc(100% - 24px)); }
@keyframes rise { from { transform: translateY(10px); opacity: .5; } }
.modal__head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-size: 16px; flex: 1; }
.modal__body { padding: 18px; overflow-y: auto; }
.modal__foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal__foot .left { margin-right: auto; }

.detail-hero { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.detail-hero__comp { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--text-2); font-weight: 700; flex-wrap: wrap; }
.detail-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 16px 0 10px; }
.detail-teams .ecard__team strong { font-size: 16px; }
.detail-when { display: flex; align-items: baseline; gap: 12px; justify-content: center; }
.detail-when .fixture__time { font-size: 34px; }
.detail-when span { color: var(--text-2); font-weight: 600; }
.alertbox { border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--line)); background: rgba(227, 166, 59, 0.08); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.alertbox h3 { margin: 0 0 6px; font-size: 13.5px; color: var(--warn); display: flex; gap: 7px; align-items: center; }
.alertbox h3 svg { width: 16px; height: 16px; }
.alertbox ul { margin: 0 0 10px; padding-left: 18px; font-size: 13px; }
.alertbox--info { border-color: color-mix(in srgb, var(--info) 45%, var(--line)); background: rgba(106, 166, 224, 0.07); }
.alertbox--info h3 { color: var(--info); }
.note { font-size: 12px; color: var(--text-3); margin: 4px 0 0; }
.section-title { font-size: 13px; font-weight: 700; margin: 20px 0 10px; color: var(--text-2); }
.picklist { border: 1px solid var(--line); border-radius: var(--radius-ctrl); max-height: 260px; overflow-y: auto; margin-top: 8px; }
.picklist button { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 9px 11px; cursor: pointer; color: inherit; }
.picklist button:hover, .picklist button[aria-selected="true"] { background: var(--surface-2); }
.picklist button:last-child { border-bottom: 0; }
.selected-event { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--gold); border-radius: var(--radius-ctrl); background: var(--gold-soft); }
.typeahead { position: relative; }
.typeahead__list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-ctrl); box-shadow: var(--shadow-pop); max-height: 220px; overflow-y: auto; }
.typeahead__list button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 8px 10px; text-align: left; cursor: pointer; color: inherit; font-size: 13px; }
.typeahead__list button:hover, .typeahead__list button.is-active { background: var(--surface-3); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100% - 36px)); }
.toast { background: var(--surface-3); border: 1px solid var(--line-strong); border-left: 3px solid var(--ok); border-radius: 9px; padding: 11px 14px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-pop); animation: rise .16s ease-out; }
.toast--error { border-left-color: var(--danger); }
.toast--warn { border-left-color: var(--warn); }

/* ---------- Estados vacíos y carga ---------- */
.empty { text-align: center; padding: 42px 20px; color: var(--text-2); }
.empty__icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--gold); }
.empty__icon svg { width: 22px; height: 22px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 15px; }
.empty p { margin: 0 auto 14px; max-width: 420px; font-size: 13px; }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-rows { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.loading-rows .skeleton { height: 46px; }
.errorbox { border: 1px solid var(--danger-line); background: var(--error-bg); border-radius: var(--radius-card); padding: 16px; color: var(--error-text); }
.errorbox strong { display: block; margin-bottom: 4px; color: var(--danger-text); }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--text-2); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 50% -10%, rgba(201, 165, 76, 0.09), transparent 60%), var(--bg); }
.login__panel { width: min(400px, 100%); }
.login__panel .brandmark { justify-content: center; margin-bottom: 26px; }
.login__panel .brandmark__logo { width: 40px; height: 40px; }
.login__panel .brandmark__name { font-size: 19px; }
.login .card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0; font-size: 18px; }
.login .btn { height: 40px; }
.login__foot { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 16px; }

/* ---------- Vista pública (/publico) ---------- */
.pub { min-height: 100vh; display: flex; flex-direction: column; }
.pub__head {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.pub__title { flex: 1; min-width: 180px; }
.pub__brandlogo { display: inline-flex; }
.pub__brandlogo[hidden] { display: none; }
.pub--tv .pub__brandlogo .bmark { --s: 80px !important; }
.pub__title h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.005em; }
.pub__title p { margin: 0; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.pub__tools { display: flex; align-items: center; gap: 8px; }
.pub__stamp { font-size: 12px; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.pub__body { width: 100%; max-width: 1560px; margin: 0 auto; padding: 18px 24px 40px; flex: 1; }
.pub__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pub__foot { text-align: center; color: var(--text-3); font-size: 12px; padding: 0 16px 22px; }
.chipbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text-2); font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.chipbtn:hover { color: var(--text); border-color: var(--text-3); }
.chipbtn[aria-pressed="true"] { background: var(--surface-3); color: var(--text); border-color: var(--gold); }
.chipbtn .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.pcard__channel { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); min-width: 0; }
.pcard__channel svg { width: 15px; height: 15px; flex: none; }
.pcard.is-live { border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); }
.pcard.is-done { opacity: .62; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ok); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.2s ease-in-out infinite; }
.pub--tv .pub__filters, .pub--tv [data-theme-toggle] { display: none; }
.pub--tv .pub__body { max-width: none; }
.pub--tv .board-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; }
.pub--tv .ecard__when .fixture__time { font-size: 34px; }
.pub--tv .ecard__team strong { font-size: 18px; }
.pub--tv .ecard__team .crest { --s: 104px !important; }
.pub--tv .ecard__single .crest { --s: 72px !important; }
.pub--tv .ecard__comp .complogo { --s: 56px !important; }
.pub--tv .ecard__comp { font-size: 15px; gap: 12px; }
.pub--tv .brandtags--lg .brandtag { height: 36px; font-size: 14px; }
.pub--tv .brandtags--lg .brandtag img { width: 30px; height: 30px; }
.pub--tv .board-group__head h2 { font-size: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .drow { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "brand brand brand" "req dis resp" "lim red pub" "link link link" "obs obs save"; }
  .drow .field > span { display: block; }
  .da-brand { padding-top: 0; }
  .drow--head { display: none; }
}
@media (max-width: 920px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: var(--shadow-pop); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 65; }
  .topbar .topbar__menu { display: inline-flex; }
  .cal-week { grid-template-columns: minmax(0, 1fr); }
  .cal-col { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .cal-col:last-child { border-bottom: 0; }
  .cal-col__body [data-add] { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .btn--primary span { display: none; }
  .topbar .btn--primary { width: 36px; padding: 0; }
  .syncchip span.label { display: none; }
  .content { padding: 16px 16px 40px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .fixture { grid-template-columns: 58px minmax(0, 1fr); padding-left: 16px; }
  .fixture__side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .fixture__time { font-size: 19px; }
  .srow { grid-template-columns: 54px minmax(0, 1fr); }
  .srow__side { grid-column: 1 / -1; justify-content: flex-end; }
  .toolbar .search, .toolbar .select, .toolbar .input[type="date"] { width: 100%; min-width: 0; }
  .toolbar > .seg { width: 100%; }
  .toolbar > .seg button { flex: 1; }
  .drow { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "brand brand" "req dis" "resp lim" "red pub" "link link" "obs obs" "save save"; }
  .mcell { min-height: 74px; }
  .mline span { display: none; }
  .board-grid { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 100%; }
  .bar { grid-template-columns: 92px minmax(0, 1fr) 34px; }
  .scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick { position: fixed; left: 12px !important; right: 12px; width: auto; top: auto !important; bottom: 12px; }
  .pub__head { padding: 10px 16px; gap: 10px; }
  .pub__body { padding: 14px 16px 32px; }
  .pub__stamp { display: none; }
}
