/* =========================================================
   CD DÁNAE — Panel de gestión (demo)
   Usa los tokens y componentes base de ../assets/css/style.css
   ========================================================= */

body.panel { background: var(--sand); }
body.panel main { min-width: 0; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--black); color: var(--on-dark);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 18px 14px; gap: 4px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; color: var(--white); }
.side__brand img { width: 40px; height: auto; }
.side__brand .brand__name { font-size: 22px; }
.side__brand .brand__tag { color: var(--on-dark-muted); font-size: 10px; }
.side__group { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-dark-muted); padding: 14px 16px 6px; }
.si {
  display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 44px; border-radius: 8px;
  color: var(--on-dark); font-size: 15px; font-weight: 500; transition: background-color 150ms, color 150ms;
}
.si:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.si.on { background: var(--gold); color: var(--black); font-weight: 700; }
.si svg { width: 20px; height: 20px; flex-shrink: 0; }
.si .badge { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(255,255,255,0.12); padding: 3px 7px; border-radius: 999px; }
.si.on .badge { background: rgba(0,0,0,0.15); }
.si .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--red); color: var(--white); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.side__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 4px; }

.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 clamp(16px, 3vw, 32px);
  background: var(--white); border-bottom: 1px solid var(--line);
}
.topbar__title { font-family: var(--font-display); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.topbar__search { margin-left: auto; width: min(320px, 40vw); min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; font: 14px var(--font-body); background: var(--sand); }
.topbar__user { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--black); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.topbar__user div { display: flex; flex-direction: column; line-height: 1.2; }
.topbar__user strong { font-size: 14px; }
.topbar__user span { font-size: 12px; color: var(--muted); }
.side-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.side-toggle svg { width: 24px; height: 24px; margin: auto; }

.content { padding: clamp(18px, 3vw, 32px); display: flex; flex-direction: column; gap: 20px; }
.page-title { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title .display { font-size: clamp(28px, 3.5vw, 40px); }
.page-title .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.page-title .sub { color: var(--muted); font-size: 14px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi__value { font-family: var(--font-display); font-size: 44px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi__note { font-size: 13px; font-weight: 600; }
.kpi--alert { border-left: 4px solid var(--red); }
.kpi--gold { border-left: 4px solid var(--gold); }
.kpi--teal { border-left: 4px solid var(--teal); }

.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.card__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.card__head .display { font-size: 22px; }
.card__head .more { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--teal-dark); }

/* ---------- Filas ---------- */
.row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row__time { font-family: var(--font-display); font-size: 22px; font-weight: 700; min-width: 60px; font-variant-numeric: tabular-nums; }
.row__bar { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-grow: 1; }
.row__body strong { font-size: 15px; line-height: 1.25; }
.row__body span:not(.tag) { font-size: 13px; color: var(--muted); }
.date-chip { display: flex; flex-direction: column; align-items: center; min-width: 48px; padding: 5px 0; background: var(--sand); border: 1px solid var(--line); border-radius: 8px; }
.date-chip .num { font-size: 22px; line-height: 1; }
.date-chip span:last-child { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

/* ---------- Colores por tipo ---------- */
.c-entrenamiento { background: var(--teal); }
.c-partido { background: var(--black); }
.c-torneo, .c-copa, .c-campeonato { background: var(--gold); }
.c-actividad { background: #C48A00; }
.c-reunion { background: var(--muted); }
.c-viaje { background: #8A5A00; }

/* ---------- Toolbar / filtros ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 6px; }
.toolbar label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 4px; }
.chip { border: 1px solid var(--line); background: var(--white); color: var(--black); border-radius: 999px; padding: 0 14px; min-height: 40px; font: 600 13px var(--font-body); cursor: pointer; }
.chip:hover { border-color: var(--black); }
.chip.on { background: var(--black); color: var(--white); border-color: var(--black); }
.seg { display: inline-flex; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 0 14px; min-height: 36px; border-radius: 8px; font: 600 13px var(--font-body); cursor: pointer; }
.seg button.on { background: var(--black); color: var(--white); }
.iconbtn { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--white); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.iconbtn svg { width: 18px; height: 18px; }
.select { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font: 14px var(--font-body); background: var(--white); }

/* ---------- Agenda semanal ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; }
.week__head { padding: 12px; display: flex; align-items: baseline; gap: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #FAF9F5; }
.week__head:nth-child(7) { border-right: 0; }
.week__head .num { font-size: 24px; }
.week__head span:not(.num) { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.week__col { border-right: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 420px; }
.week__col:last-child { border-right: 0; }
.week__col.today, .week__head.today { background: var(--gold-soft); }
.evc { border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; border-left: 4px solid var(--teal); background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,0.08); cursor: pointer; font-size: 13px; }
.evc:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.evc strong { font-weight: 600; line-height: 1.2; }
.evc small { color: var(--muted); font-size: 12px; }
.evc time { font-weight: 700; font-size: 12px; }
.evc--partido { border-color: var(--black); background: var(--black); color: var(--white); }
.evc--partido small { color: var(--on-dark-muted); }
.evc--torneo, .evc--copa, .evc--campeonato { border-color: var(--gold); }
.evc--actividad { border-color: #C48A00; }
.evc--reunion { border-color: var(--muted); }
.evc--viaje { border-color: #8A5A00; }
.vis { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 999px; align-self: flex-start; margin-top: 2px; }
.vis--publico { background: var(--teal-soft); color: var(--teal-dark); }
.vis--interno { background: var(--sand-2); color: var(--black); }
.vis--privado { background: #E4E2DC; color: var(--muted); }
.evc--partido .vis--interno { background: rgba(255,255,255,0.15); color: var(--white); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FAF9F5; white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #FBF9F4; }
.tbl .name { display: flex; align-items: center; gap: 10px; }
.tbl .name strong { display: block; }
.tbl .name small { color: var(--muted); font-size: 12px; }
.tbl .dorsal { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.tbl__foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #FAF9F5; font-size: 13px; color: var(--muted); }
.st { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.st--activo, .st--ok, .st--confirmado { background: var(--teal-soft); color: var(--teal-dark); }
.st--inactivo, .st--pendiente { background: var(--gold-soft); color: #7A5A00; }
.st--baja, .st--caducada, .st--nodisp { background: #FBE3E6; color: #9E0C24; }
.st--archivado { background: #E4E2DC; color: var(--muted); }

/* ---------- Partidos ---------- */
.match-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; }
.match-card .teams { font-family: var(--font-display); font-size: 22px; font-weight: 700; text-transform: uppercase; line-height: 1.05; }
.match-card .teams em { font-style: normal; color: var(--teal-dark); }
.match-card .meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.match-card .mc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.match-card .score { font-family: var(--font-display); font-size: 28px; font-weight: 800; background: var(--black); color: var(--white); padding: 4px 12px; border-radius: 6px; line-height: 1; font-variant-numeric: tabular-nums; }
.match-card .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Retransmisiones ---------- */
.steps { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 20px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--black); color: var(--gold); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.step--hot { color: var(--teal-dark); }
.step--hot .n { background: var(--teal-dark); color: var(--white); }
.arrow { color: var(--line); }
.live-card { border: 2px solid var(--red); }
.live-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px rgba(216,16,42,0.18); animation: pulse 1.4s ease-in-out infinite; }
.check-list { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: #FAF9F5; border-radius: 10px; font-size: 14px; font-weight: 500; }
.check-list span { display: flex; align-items: center; gap: 8px; }
.check-list svg { width: 16px; height: 16px; color: var(--teal-dark); }
.preview { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--black-2); }
.preview .card { padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.chk { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 500; }
.chk input { width: 20px; height: 20px; accent-color: var(--teal-dark); }

/* ---------- Equipos ---------- */
.team-card { overflow: hidden; display: flex; flex-direction: column; }
.team-card .logo { background: radial-gradient(ellipse at 50% 60%, #2A2A31, var(--black-2) 70%); height: 220px; display: flex; align-items: center; justify-content: center; padding: 18px; }
.team-card .logo img { height: 100%; width: auto; max-width: 80%; object-fit: contain; }
.team-card .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.team-card .body .display { font-size: 24px; }
.team-card .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.team-card .facts strong { color: var(--ink); display: block; font-size: 15px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(14,14,16,0.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--white); border-radius: 14px; width: min(640px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.35); }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal__head .display { font-size: 24px; }
.modal__close { margin-left: auto; width: 40px; height: 40px; border: 0; background: var(--sand); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.modal__close svg { width: 18px; height: 18px; }
.modal__body { padding: 22px; display: grid; gap: 16px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line); background: #FAF9F5; border-radius: 0 0 14px 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { min-height: 44px; width: 100%; min-width: 0; }
.modal__body { overflow-x: hidden; }
.hint { font-size: 13px; color: var(--muted); }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; min-height: 40px; cursor: pointer; font-size: 14px; font-weight: 600; }
.radio-row input { accent-color: var(--teal-dark); }
.radio-row label:has(input:checked) { border-color: var(--black); background: var(--black); color: var(--white); }
.score-inputs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; }
.score-inputs input { font-family: var(--font-display); font-size: 36px; font-weight: 800; text-align: center; min-height: 64px; }
.score-inputs .vs { font-family: var(--font-display); font-size: 22px; font-weight: 800; padding-bottom: 16px; color: var(--muted); }
.conv-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.conv-row:first-child { border-top: 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--black); color: var(--white); padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 32px rgba(0,0,0,0.3); opacity: 0; transition: opacity 200ms, transform 200ms; z-index: 200; display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px)); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast a { color: var(--gold); text-decoration: underline; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--black-2); position: relative; overflow: hidden; padding: 16px; }
.login::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 14px); }
.login__crest { position: absolute; right: -6%; bottom: -10%; width: min(60vw, 560px); opacity: 0.08; }
.login__card { position: relative; width: min(440px, 100%); padding: 32px; display: grid; gap: 18px; }
.login__brand { display: flex; align-items: center; gap: 12px; }
.login__brand img { width: 52px; }

/* ---------- Empty / Fase 2 ---------- */
.empty { padding: clamp(32px, 6vw, 72px); text-align: center; display: grid; gap: 12px; justify-items: center; }
.empty svg { width: 56px; height: 56px; color: var(--muted); }
.empty p { max-width: 520px; color: var(--muted); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform 250ms var(--ease); }
  .side.open { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,0.4); }
  .side-toggle { display: grid; place-items: center; }
  .week { grid-template-columns: 1fr; }
  .week__head { display: none; }
  .week__col { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .week__col::before { content: attr(data-day); font-family: var(--font-display); font-size: 18px; font-weight: 700; text-transform: uppercase; }
  .match-card { grid-template-columns: auto 1fr; }
  .match-card .mc-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar__search { display: none; }
}
@media (max-width: 600px) { .kpis { grid-template-columns: 1fr; } .topbar__user div { display: none; } }
@media (prefers-reduced-motion: reduce) { .side { transition: none; } .live-dot { animation: none; } }
