/* Dashboard CCTV con la línea gráfica del informe Galilea (rojo #EA0A2A, carbón #393738) */
.cc-acciones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.cc-acciones select { width: auto; max-width: 100%; }
.cc-alertas { display: grid; gap: 8px; margin-bottom: 14px; }
.cc-alerta { padding: 10px 14px; border-radius: 10px; font-size: 14px; background: var(--blue-soft); color: var(--blue); }
.cc-alerta.mal { background: var(--red-soft); color: var(--red); }
.cc-alerta.bien { background: var(--green-soft); color: var(--green); }
.cc-previa { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cc-previa div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.cc-previa b { display: block; font-size: 18px; }
.cc-previa span { font-size: 11px; color: var(--muted); }
.cc-previa .rojo-txt b { color: var(--red); }
@media screen and (max-width: 560px) { .cc-previa { grid-template-columns: repeat(3, 1fr); } }

/* Las "hojas" se ven siempre claras, como el PDF que recibe el cliente */
.cc-hoja { --r: #ea0a2a; --c: #393738; --g: #525252; --l: #d9d9d9;
  font-family: Lato, "Plus Jakarta Sans", system-ui, sans-serif; color: var(--c); background: #fff;
  border-radius: 16px; box-shadow: var(--shadow); padding: 30px 32px 32px; margin-bottom: 20px; }
.cc-hoja, .cc-hoja * { box-sizing: border-box; }
.cc-cab { display: flex; align-items: center; gap: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--l); position: relative; margin-bottom: 18px; }
.cc-cab::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 140px; height: 3px; background: var(--r); }
.cc-logo { height: 66px; width: auto; flex: none; }
.cc-titulos { flex: 1; min-width: 0; }
.cc-titulos h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .01em; color: var(--c); }
.cc-titulos p { margin: 6px 0 0; color: #7a7a7a; font-size: 13px; }
.cc-fecha { background: var(--r); color: #fff; font-weight: 800; font-size: 17px; padding: 9px 30px; border-radius: 999px; white-space: nowrap; }
.cc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.cc-kpis-3 { grid-template-columns: 1fr 1fr 2fr; }
.cc-card { border: 1px solid var(--l); border-top: 5px solid var(--r); padding: 16px 18px; background: #fff; min-width: 0; }
.cc-tit { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--c); letter-spacing: .02em; }
.cc-num { font-size: 42px; font-weight: 800; line-height: 1.1; margin: 8px 0 6px; color: var(--c); font-variant-numeric: tabular-nums; }
.cc-num.cc-rojo { color: var(--r); }
.cc-sub { font-size: 12px; color: #6b6b6b; overflow: hidden; text-overflow: ellipsis; }
.cc-barra { height: 9px; background: #eee; margin-top: 12px; }
.cc-barra i { display: block; height: 100%; background: var(--r); }
.cc-chart { margin-bottom: 16px; }
.cc-chart-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.cc-ley { display: flex; gap: 22px; font-size: 12px; color: var(--g); }
.cc-ley i { display: inline-block; width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px; }
.cc-ley .gr { background: #a6a6a6; } .cc-ley .rj { background: var(--r); }
.cc-scroll { overflow-x: auto; }
.cc-grafico { display: block; width: 100%; min-width: 900px; height: auto; font-family: inherit; }
.cc-grafico .g { stroke: #ececec; stroke-width: 1; }
.cc-grafico .base { stroke: #bdbdbd; stroke-width: 1; }
.cc-grafico .ej { font-size: 11px; fill: #8a8a8a; text-anchor: end; }
.cc-grafico .b { fill: #a6a6a6; }
.cc-grafico .o { fill: var(--r); }
.cc-grafico .v { font-size: 12px; font-weight: 800; fill: var(--c); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.cc-grafico .po { fill: var(--r); }
.cc-grafico .vo { font-size: 11px; font-weight: 800; fill: #fff; text-anchor: middle; }
.cc-grafico .et { font-size: 11px; fill: var(--g); text-anchor: end; }
.cc-obs ul { margin: 10px 0 0; padding: 0; list-style: none; }
.cc-obs li { position: relative; padding-left: 20px; margin-bottom: 6px; font-size: 15px; }
.cc-obs li::before { content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; background: var(--r); }
.cc-tabla table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.cc-tabla th { text-align: left; background: none; text-transform: none; letter-spacing: 0; color: var(--c); font-size: 12px; font-weight: 800; border-bottom: 2px solid var(--r); padding: 8px 10px; }
.cc-tabla td { font-size: 12.5px; padding: 7px 10px; border-bottom: none; color: var(--c); }
.cc-tabla tbody tr:nth-child(even) td { background: #f4f4f4; }
.cc-tabla tfoot td { border-top: 2px solid var(--r); font-weight: 800; padding-top: 12px; }
.cc-tabla .n { text-align: right; width: 70px; }
.cc-ok { color: #1a7f37; font-weight: 700; margin: 14px 0 4px; }
@media screen and (max-width: 820px) {
  .cc-hoja { padding: 18px 14px; border-radius: 12px; }
  .cc-kpis, .cc-kpis-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cc-kpis-3 .cc-obs { grid-column: 1 / -1; }
  .cc-cab { flex-wrap: wrap; gap: 12px; }
  .cc-logo { height: 48px; }
  .cc-titulos h1 { font-size: 16px; }
  .cc-fecha { font-size: 14px; padding: 6px 18px; }
  .cc-num { font-size: 32px; }
  .cc-tabla { overflow-x: auto; }
}

/* Impresión / PDF para el cliente: dos hojas apaisadas con el tamaño del informe original */
@media print {
  @page { size: 14in 8.6in; margin: 0; }
  html, body { background: #fff !important; }
  header, .tabbar, .no-print, #aviso { display: none !important; }
  main { max-width: none; padding: 0 !important; margin: 0; }
  .cc-hoja { box-shadow: none; border-radius: 0; margin: 0; padding: .24in .45in .2in; height: 8.6in; overflow: hidden; break-after: page;
             -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cc-hoja:last-of-type { break-after: auto; }
  .cc-hoja:last-of-type { height: auto; min-height: 8.6in; overflow: visible; }  /* el detalle puede ocupar varias hojas */
  .cc-hoja .cc-kpis { margin-bottom: 12px; } .cc-hoja .cc-chart { margin-bottom: 12px; } .cc-cab { margin-bottom: 14px; }
  .cc-grafico { min-width: 0; }
  .cc-tabla tr { break-inside: avoid; }
  .cc-tabla tfoot { display: table-row-group; }  /* el total va solo al final, no al pie de cada hoja */
  .cc-kpis { grid-template-columns: repeat(4, 1fr) !important; }
  .cc-kpis-3 { grid-template-columns: 1fr 1fr 2fr !important; }
}
