:root {
  --marca: #ff6600;
  --marca-oscuro: #d95600;
  --tinta: #1f2733;
}
body { background: #f5f6f8; color: var(--tinta); }
body.embed { background: #fff; }
.bg-marca { background: linear-gradient(90deg, #1f2733 0%, #2c3646 100%); border-bottom: 3px solid var(--marca); }
.btn-marca { background: var(--marca); border-color: var(--marca); color: #fff; }
.btn-marca:hover, .btn-marca:focus { background: var(--marca-oscuro); border-color: var(--marca-oscuro); color: #fff; }
.text-marca { color: var(--marca) !important; }
.login-bg { background: radial-gradient(circle at 20% 10%, #fff3eb 0, #f5f6f8 45%) fixed; min-height: 100vh; }
.logo-circle { width: 64px; height: 64px; border-radius: 50%; background: var(--marca); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.card { border-radius: .75rem; }
.card-header { background: #fff; font-weight: 600; }
.kpi { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.kpi-sub { font-size: .8rem; color: #6c757d; }
.badge.cod { font-weight: 500; min-width: 70px; }
.table-sm td, .table-sm th { vertical-align: middle; }
.tabla-scroll { overflow: auto; max-height: 72vh; }
.tabla-scroll thead th { position: sticky; top: 0; z-index: 2; background: #fff; }

/* Alerta LFT */
tr.alerta-excede > td { background: #f8d7da !important; }
tr.alerta-proxima > td { background: #fff0f0 !important; }
.barra-lft { height: 8px; background: #e9ecef; border-radius: 4px; overflow: hidden; min-width: 90px; }
.barra-lft > div { height: 100%; }
.pulso { animation: pulso 1.4s infinite; }
@keyframes pulso { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* App de campo */
.campo-reloj { font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.campo-fecha { color: #6c757d; }
.btn-tipo { padding: .9rem .5rem; font-weight: 600; border-width: 2px; }
.btn-tipo.sugerido { box-shadow: 0 0 0 .2rem rgba(255,102,0,.35); }
.paso { border-left: 3px solid #dee2e6; padding-left: .9rem; margin-bottom: 1rem; }
.paso.ok { border-color: #198754; }
.paso.error { border-color: #dc3545; }
#video, #foto { width: 100%; max-height: 300px; object-fit: cover; border-radius: .5rem; background: #000; transform: scaleX(-1); }
#foto { transform: none; }

/* Firma */
.firma-canvas { width: 100%; max-width: 600px; aspect-ratio: 3 / 1; border: 2px dashed #adb5bd; border-radius: .5rem; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.firma-canvas.con-trazo { border-style: solid; border-color: var(--marca); }
.firma-img { max-width: 240px; max-height: 80px; border-bottom: 1px solid #333; }

/* Reporte Incidencias (réplica del Excel) */
.inc-wrap { overflow: auto; max-height: calc(100vh - 210px); border: 1px solid #dee2e6; background: #fff; }
table.inc { border-collapse: separate; border-spacing: 0; font-size: 12px; white-space: nowrap; }
table.inc th, table.inc td { border-right: 1px solid #e3e3e3; border-bottom: 1px solid #e3e3e3; padding: 3px 6px; }
table.inc thead th { position: sticky; background: #ff6600; color: #fff; z-index: 3; text-align: center; font-weight: 600; }
table.inc thead tr.r1 th { top: 0; background: #fce4d6; color: #333; }
table.inc thead tr.r2 th { top: 25px; }
table.inc .fijo { position: sticky; background: #fff; z-index: 2; }
table.inc thead .fijo { z-index: 4; background: #ff6600; color: #fff; }
table.inc thead tr.r1 .fijo { background: #fce4d6; }
table.inc .f1 { left: 0; min-width: 52px; } table.inc .f2 { left: 52px; min-width: 52px; } table.inc .f3 { left: 104px; min-width: 230px; }
table.inc td.dia { text-align: center; cursor: pointer; }
table.inc td.dia:hover { outline: 2px solid var(--marca); outline-offset: -2px; }
table.inc td.ajustado { box-shadow: inset 0 -3px 0 #6f42c1; }
table.inc td.ret { color: #c00000; font-weight: 700; }
table.inc td.tot { text-align: center; font-weight: 700; background: #fafafa; }
table.inc td.sep { border-left: 2px solid #ffb27f; }
table.inc input.form-control-sm { min-width: 90px; font-size: 12px; padding: 1px 4px; }

@media print {
  .no-print, nav, .btn, .alert-dismissible .btn-close { display: none !important; }
  body { background: #fff; font-size: 11px; }
  main { padding: 0 !important; max-width: 100% !important; }
  .card { border: 0; box-shadow: none !important; }
  .page-break { page-break-before: always; }
  table { font-size: 10px; }
  a { color: inherit; text-decoration: none; }
}
