:root {
  --dta-verde: #2e7d32;
  --dta-verde-claro: #e8f3e8;
  --dta-tinta: #1f2a1f;
}
body { background: #f5f7f4; color: var(--dta-tinta); }
.navbar-dta { background: var(--dta-verde); }
.navbar-dta .navbar-brand, .navbar-dta .nav-link, .navbar-dta .navbar-text { color: #fff; }
.navbar-dta .nav-link.active { font-weight: 600; text-decoration: underline; text-underline-offset: 6px; }

.panel { background: #fff; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 1.25rem; }
.paso-num { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--dta-verde); color: #fff;
  align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; margin-right: .4rem; }

/* Lector de gráficas */
.zona-imagen { border: 2px dashed #9bb59b; border-radius: .75rem; padding: 1.5rem; text-align: center; background: #fbfdfb; cursor: pointer; }
.zona-imagen.sobre { background: var(--dta-verde-claro); }
#canvas-digitalizador { max-width: 100%; border: 1px solid #ccd; border-radius: .5rem; cursor: crosshair; }
.calib-lista input { max-width: 9.5rem; }
.muestra-color { display: inline-block; width: 1.4rem; height: 1.4rem; border-radius: .3rem; border: 1px solid #999; vertical-align: middle; }
.modo-activo { box-shadow: 0 0 0 .2rem rgba(46,125,50,.45); }

/* Reportes */
.reporte { background: #fff; padding: 1.75rem; border-radius: .75rem; max-width: 1100px; margin: 0 auto; }
.reporte h1 { color: var(--dta-tinta); }
.reporte-seccion { margin-top: 1.75rem; }
.reporte-seccion h2 { font-size: 1.2rem; font-weight: 700; color: var(--dta-verde); border-bottom: 2px solid var(--dta-verde-claro); padding-bottom: .35rem; margin-bottom: .9rem; }
.kpi { border-left: 6px solid #999; background: #fafafa; border-radius: .5rem; padding: .8rem 1rem; }
.kpi-num { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.grafica-alta { position: relative; height: 420px; }
.num-momento { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid #222; font-weight: 700;
  align-items: center; justify-content: center; }
.tabla-reporte th { background: var(--dta-verde-claro); font-weight: 600; }
/* Tabla "Qué pasó y qué significa": columnas con ancho fijo y la última más amplia */
.tabla-momentos { table-layout: fixed; width: 100%; }
.tabla-momentos col.c-num { width: 3rem; }
.tabla-momentos col.c-sensor { width: 12%; }
.tabla-momentos col.c-fechas { width: 15%; }
.tabla-momentos col.c-que { width: 28%; }
.tabla-momentos col.c-significa { width: auto; }
.tabla-momentos td { vertical-align: top; overflow-wrap: anywhere; padding: .65rem .6rem; }
.tabla-momentos .td-significa { line-height: 1.5; }
.tabla-momentos .titulo-movil { display: none; }
.tabla-momentos .badge-tipo { display: inline-block; margin-bottom: .25rem; white-space: normal; }

/* En celular y tableta vertical: cada momento es una tarjeta */
@media (max-width: 767.98px) {
  .tabla-momentos, .tabla-momentos tbody, .tabla-momentos tr, .tabla-momentos td { display: block; width: 100%; }
  .tabla-momentos colgroup, .tabla-momentos thead { display: none; }
  .tabla-momentos tr { border: 1px solid #dfe6df; border-radius: .6rem; margin-bottom: .9rem; background: #fff; overflow: hidden; }
  .tabla-momentos td { border: 0; padding: .45rem .9rem; }
  .tabla-momentos td.td-num { background: var(--dta-verde-claro); display: flex; align-items: center; gap: .6rem; font-weight: 600; padding: .55rem .9rem; }
  .tabla-momentos .titulo-movil { display: inline; }
  .tabla-momentos td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .03em; color: var(--dta-verde); margin-bottom: .1rem; }
  .tabla-momentos .badge-tipo { display: none; }
  .tabla-momentos .td-significa { font-size: 1rem; padding-bottom: .8rem; }
}

.costo-total { font-size: 1.15rem; background: var(--dta-verde-claro); border-radius: .5rem; padding: .7rem 1rem; }
.mensaje-especialista { background: #fffbe8; border-left: 5px solid #f2c14e; padding: .8rem 1rem; border-radius: .4rem; }
.comentario { border-left: 4px solid #cfd8cf; padding: .4rem .8rem; margin-bottom: .6rem; background: #fbfbfb; border-radius: .3rem; }
.comentario-dta { border-left-color: var(--dta-verde); }
.reporte-pie { margin-top: 2rem; border-top: 1px solid #e5e5e5; padding-top: .6rem; }
.solo-pdf { display: none; }

/* Modo PDF: oculta controles y fija anchos */
body.modo-pdf .no-pdf { display: none !important; }
body.modo-pdf .solo-pdf { display: block !important; }
body.modo-pdf .reporte { box-shadow: none; padding: 0; max-width: 190mm; }
body.modo-pdf input.form-control { border: none; padding: 0; background: transparent; font-weight: 600; }
.avoid-break { break-inside: avoid; page-break-inside: avoid; }

/* Acceso por código */
.acceso-caja { max-width: 420px; margin: 8vh auto; }
.codigo-input { font-size: 1.6rem; letter-spacing: .3rem; text-align: center; text-transform: uppercase; font-family: ui-monospace, monospace; }

@media print {
  .no-pdf, nav, .navbar { display: none !important; }
  body { background: #fff; }
  .reporte { padding: 0; }
}
