@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --bg:#F6F7F9;
  --surface:#FFFFFF;
  --surface-alt:#EEF1F5;
  --ink:#1B2430;
  --ink-muted:#5B6472;
  --accent:#2C5CE0;
  --accent-ink:#1E3FA8;
  --accent-soft:#E4EAFC;
  --border:#E1E4EA;
  --ok:#1E8E5A; --ok-soft:#E3F5EC;
  --warn:#966016; --warn-soft:#FBF0DD;
  --risk:#B3382A; --risk-soft:#FBE4E1;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:"IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size:15px;
  line-height:1.5;
}
.mono, code{ font-family:"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

.barra-superior{
  position:sticky; top:0; z-index:10;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  padding:14px 22px;
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px;
}
.barra-titulo{ display:flex; align-items:baseline; gap:10px; }
.marca{ font-weight:700; font-size:16px; }
.equipo-nombre{
  font-family:"IBM Plex Mono", monospace; font-size:12.5px;
  color:var(--accent-ink); background:var(--accent-soft);
  padding:2px 8px; border-radius:5px;
}
.barra-controles{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.barra-controles label{ font-size:13px; color:var(--ink-muted); margin-right:6px; }
.barra-controles input[type="date"]{
  font-family:inherit; font-size:14px; padding:6px 8px;
  border:1px solid var(--border); border-radius:6px; background:var(--surface);
  color:var(--ink);
}
.leyenda{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--ink-muted); }

.contenido{ max-width:1180px; margin:0 auto; padding:20px 22px 80px; }
.ayuda{ color:var(--ink-muted); font-size:13.5px; margin:4px 0 16px; }
.cargando{ color:var(--ink-muted); padding:24px 0; }

.badge-pred{
  display:inline-block; font-family:"IBM Plex Mono", monospace; font-size:10px;
  background:var(--accent-soft); color:var(--accent-ink); border-radius:4px;
  padding:0 4px; margin-left:5px; cursor:default; vertical-align:super;
}

table{ border-collapse:collapse; width:100%; background:var(--surface); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
thead th{
  text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em;
  color:var(--ink-muted); background:var(--surface-alt); padding:10px 14px; border-bottom:1px solid var(--border);
}
tbody td{ padding:8px 14px; border-bottom:1px solid var(--border); font-size:14px; vertical-align:middle; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr.fila-agrupadora{ background:var(--surface-alt); font-weight:600; }
tbody tr.editable{ background:#FBFCFF; }

.celda-nombre{ display:flex; align-items:center; gap:6px; }
.toggle{
  background:none; border:1px solid var(--border); border-radius:4px; width:20px; height:20px;
  cursor:pointer; font-size:11px; color:var(--ink-muted); line-height:1; flex:0 0 auto;
}
.toggle-spacer{ display:inline-block; width:20px; flex:0 0 auto; }

.col-num{ text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.input-pct{
  width:64px; text-align:right; font-variant-numeric:tabular-nums;
  padding:4px 6px; border:1px solid var(--border); border-radius:5px;
  font-family:inherit; font-size:14px; background:var(--surface);
}
.input-pct:focus{ outline:2px solid var(--accent); outline-offset:1px; }

.chip{ display:inline-block; width:10px; height:10px; border-radius:50%; vertical-align:middle; margin-right:4px; }
.chip-ok{ background:var(--ok); }
.chip-warn{ background:var(--warn); }
.chip-risk{ background:var(--risk); }
tr.semaforo-ok .chip-fila{ background:var(--ok-soft); }

.aviso{
  position:fixed; bottom:22px; left:50%; transform:translateX(-50%);
  background:var(--ink); color:#fff; padding:10px 18px; border-radius:8px; font-size:13.5px;
  box-shadow:0 8px 24px rgba(0,0,0,.2);
}
.aviso.error{ background:var(--risk); }

.pantalla-error{ display:flex; align-items:center; justify-content:center; min-height:100vh; padding:24px; }
.card-error{ max-width:420px; text-align:center; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:32px; }
.card-error h1{ font-size:20px; margin:0 0 10px; }
.card-error p{ color:var(--ink-muted); margin:0; }

@media (max-width:640px){
  table, thead, tbody, tr, td{ display:block; }
  thead{ display:none; }
  tbody tr{ border-bottom:6px solid var(--bg); padding:8px 0; }
  tbody td{ border-bottom:none; display:flex; justify-content:space-between; gap:10px; }
  tbody td::before{ content: attr(data-label); color:var(--ink-muted); font-size:12px; }
}
