
    * { box-sizing: border-box; }

    :root{
      --azul-1:#2563eb;
      --azul-2:#1d4ed8;
      --azul-3:#0f172a;
      --borde:#2b3a55;
      --texto-suave:#94a3b8;
      --fondo:#f5f7fb;
      --panel:#ffffff;
      --danger:#dc2626;
      --warning:#f59e0b;
      --success:#16a34a;
    }

    body {
      margin: 0;
      font-family: Arial, sans-serif;
      background: var(--fondo);
      color: #111111;
    }

    .oculto {
      display: none !important;
    }

    .login-screen {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background:
        linear-gradient(rgba(2,6,23,0.45), rgba(2,6,23,0.65)),
        linear-gradient(135deg,#0f172a,#1e3a5f);
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      padding: 24px;
    }

    .login-box {
      width: 100%;
      max-width: 500px;
      background: rgba(15, 23, 42, 0.72);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 24px;
      padding: 38px;
      box-shadow: 0 24px 70px rgba(0,0,0,0.55);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      color: white;
    }

    .login-box h1 {
      margin: 0 0 8px 0;
      font-size: 32px;
      color: #ffffff;
      text-align: center;
    }

    .login-box p {
      margin: 0 0 28px 0;
      color: #cbd5e1;
      text-align: center;
      font-size: 16px;
    }

    .login-box input {
      width: 100%;
      margin-bottom: 14px;
      padding: 15px 16px;
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 14px;
      font-size: 15px;
      background: rgba(15,23,42,0.72);
      color: white;
      outline: none;
    }

    .login-box input::placeholder {
      color: #94a3b8;
    }

    .login-box input:focus {
      border-color: #3b82f6;
      box-shadow: 0 0 0 3px rgba(59,130,246,0.22);
    }
    .login-box .btn-primary {
      width: 100%;
      padding: 15px;
      border-radius: 14px;
      background: linear-gradient(90deg, #2563eb, #3b82f6);
      font-size: 16px;
      font-weight: 700;
      box-shadow: 0 10px 24px rgba(37,99,235,0.35);
    }

    .login-box .btn-secondary {
      width: 100%;
      padding: 13px;
      border-radius: 14px;
      background: rgba(255,255,255,0.08);
      color: #e5e7eb;
    }

    .login-actions {
      display: flex;
      gap: 10px;
      margin-top: 8px;
      flex-wrap: wrap;
    }

    .login-msg {
      margin-top: 12px;
      font-weight: bold;
      color: #991b1b;
      min-height: 20px;
    }
    /* Estados legibles sobre el fondo oscuro del acceso, sin cambiar el componente. */
    #loginMsg.cargando, #loginMsg.info { color: #93c5fd; }
    #loginMsg.error { color: #fecaca; }

    .section {
      display: none;
    }

    .section.active {
      display: block;
    }

    .section-title {
      margin: 0 0 18px 0;
      font-size: 28px;
      color: var(--azul-3);
    }

    .cards {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 16px;
      margin-bottom: 24px;
      align-items: stretch;
    }

    .card {
      background: var(--panel);
      border-radius: 16px;
      padding: 18px;
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
      border-top: 5px solid var(--azul-1);
    }

    .card h3 {
      margin: 0 0 10px 0;
      font-size: 14px;
      color: #475569;
    }

    .card .value {
      font-size: 30px;
      font-weight: bold;
      color: #111827;
      line-height: 1.2;
      word-break: break-word;
    }

    .toolbar {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
      margin-bottom: 18px;
    }

    input,
    select,
    button,
    textarea {
      padding: 10px 12px;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      font-size: 14px;
      background: white;
    }

    input,
    select {
      min-width: 180px;
    }

    textarea {
      width: 100%;
      min-height: 90px;
      resize: vertical;
    }

    .btn-primary {
      background: var(--azul-1);
      color: white;
      border: none;
      cursor: pointer;
    }

    .btn-secondary {
      background: #111827;
      color: white;
      border: none;
      cursor: pointer;
    }

    .btn-success {
      background: var(--success);
      color: white;
      border: none;
      cursor: pointer;
    }

    .btn-danger {
      background: var(--danger);
      color: white;
      border: none;
      cursor: pointer;
    }

    .btn-print {
      background: var(--azul-3);
      color: white;
      border: none;
      cursor: pointer;
    }
    /* =========================================================
      UX GENERAL / BOTONES EN PROCESO
      Evita doble clic mientras se ejecutan acciones críticas
    ========================================================= */
    .btn-loading,
    button:disabled {
      opacity: 0.65;
      cursor: not-allowed !important;
      transform: none !important;
    }

    .btn-loading::after {
      content: "";
      display: inline-block;
      width: 13px;
      height: 13px;
      margin-left: 8px;
      border: 2px solid currentColor;
      border-right-color: transparent;
      border-radius: 50%;
      vertical-align: -2px;
      animation: ux-estado-giro 0.8s linear infinite;
    }

    .estado-contenedor {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      min-height: 46px;
      color: #475569;
      font-weight: 700;
      text-align: center;
    }

    .estado-contenedor.cargando::before {
      content: "";
      width: 17px;
      height: 17px;
      flex: 0 0 17px;
      border: 2px solid #93c5fd;
      border-right-color: #2563eb;
      border-radius: 50%;
      animation: ux-estado-giro 0.8s linear infinite;
    }

    .estado-contenedor.vacio {
      color: #64748b;
      font-weight: 600;
    }

    .estado-contenedor.error {
      color: #991b1b;
    }

    .fila-estado-contenedor td {
      background: #f8fafc;
    }

    /* Lecturas: el estado ocupa el ancho visible, no el ancho desplazable de 12 columnas. */
    .lecturas-consulta-wrap { container-type: inline-size; }
    .lecturas-consulta-wrap .fila-estado-contenedor td { padding: 0; }
    .lecturas-consulta-wrap .fila-estado-contenedor .estado-contenedor {
      position: sticky;
      left: 0;
      width: 100cqi;
      box-sizing: border-box;
      padding: 12px;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    @keyframes ux-estado-giro {
      to { transform: rotate(360deg); }
    }

    @media (prefers-reduced-motion: reduce) {
      .btn-loading::after,
      .estado-contenedor.cargando::before {
        animation-duration: 1.8s;
      }
    }
    /* ===================== FIN UX GENERAL / BOTONES EN PROCESO ===================== */

    .panel {
      background: white;
      border-radius: 16px;
      padding: 18px;
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
      margin-bottom: 20px;
      border-left: 5px solid var(--azul-1);
    }

    .panel h3 {
      margin-top: 0;
      margin-bottom: 14px;
      font-size: 20px;
      color: var(--azul-3);
    }

    .panel-acceso {
      border-left-color: var(--danger);
      background: #fff5f5;
    }

    .table-wrap {
      width: 100%;
      max-height: 620px;
      overflow-x: auto;
      overflow-y: auto;
      background: white;
      border-radius: 16px;
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    }

    table {
      width: 100%;
      min-width: 1350px;
      border-collapse: collapse;
      background: white;
    }

    th,
    td {
      padding: 12px;
      border-bottom: 1px solid #e5e7eb;
      text-align: left;
      font-size: 14px;
      white-space: nowrap;
      vertical-align: top;
    }

    th {
      background: #0f172a;
      color: white;
      position: sticky;
      top: 0;
    }

    tr:hover td {
      background: #eff6ff;
    }

    .estado {
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: bold;
      display: inline-block;
    }
    .estado.verde {
      background: #e6f9ec;
      color: #0f8a3d;
      border: 1px solid #0f8a3d;
    }

    .estado.amarillo {
      background: #fff7e6;
      color: #b7791f;
      border: 1px solid #b7791f;
    }

    .estado.rojo {
      background: #fde8e8;
      color: #c53030;
      border: 1px solid #c53030;
    }

    .aldia {
      background: #dcfce7;
      color: #166534;
    }

    .proxima {
      background: #fef3c7;
      color: #92400e;
    }

    .vencida {
      background: #fee2e2;
      color: #991b1b;
    }

    .faltan {
      background: #e5e7eb;
      color: #374151;
    }

    .alerta {
      border-left: 6px solid #94a3b8;
      padding: 14px;
      border-radius: 12px;
      background: #f8fafc;
      margin-bottom: 12px;
    }

    .alerta.alta {
      border-left-color: var(--danger);
      background: #fef2f2;
    }

    .alerta.media {
      border-left-color: var(--warning);
      background: #fffbeb;
    }

    .alerta .titulo {
      font-weight: bold;
      margin-bottom: 4px;
      color: var(--azul-3);
    }

    .grid-2 {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 18px;
      align-items: start;
    }

    .grid-3 {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 18px;
      align-items: start;
    }
    .grid-form {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 12px;
    }

    .campo-completo {
      grid-column: 1 / -1;
    }

    .mensaje {
      margin-top: 12px;
      font-weight: bold;
    }

    .mensaje.ok {
      color: #1d4ed8;
    }

    .mensaje.error {
      color: #991b1b;
    }

    /* =========================================================
      UX GENERAL / MENSAJES DE ESTADO
      Mensajes claros para carga, éxito y error
    ========================================================= */
    .mensaje.cargando {
      color: #1d4ed8;
    }

    .mensaje.cargando::before {
      content: "⏳ ";
    }

    .mensaje.ok::before {
      content: "✅ ";
    }

    .mensaje.error::before {
      content: "⚠️ ";
    }

    .fila-cargando td {
      color: #475569;
      font-weight: 700;
      background: #f8fafc;
    }
    /* ===================== FIN UX GENERAL / MENSAJES DE ESTADO ===================== */

    /* =========================================================
      MANTENCIÓN / REGISTRO OT MÚLTIPLES TRABAJOS
      Aviso, tabla temporal y validaciones visuales
    ========================================================= */
    .aviso-ot-multiple {
      background: #fff7ed;
      border: 1px solid #fdba74;
      border-left: 6px solid #f97316;
      color: #7c2d12;
      border-radius: 14px;
      padding: 14px;
      margin: 14px 0;
      line-height: 1.45;
    }

    .aviso-ot-multiple strong {
      display: block;
      margin-bottom: 4px;
      color: #9a3412;
    }

    .tabla-trabajos-ot {
      width: 100%;
      min-width: 850px;
    }

    .contador-trabajos-ot {
      font-weight: 700;
      color: #334155;
      margin-bottom: 8px;
    }

    .campo-error {
      border-color: #dc2626 !important;
      box-shadow: 0 0 0 3px rgba(220,38,38,0.14) !important;
    }
    /* ===================== FIN MANTENCIÓN / REGISTRO OT MÚLTIPLES TRABAJOS ===================== */

    .contador {
      margin-bottom: 10px;
      color: #334155;
      font-size: 14px;
    }

    .ot-box {
      background: white;
      padding: 20px;
      border-radius: 16px;
      border-top: 5px solid var(--azul-1);
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    }

    .ot-header {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
      border-bottom: 2px solid #0f172a;
      margin-bottom: 15px;
      padding-bottom: 10px;
    }

    .ot-title {
      font-size: 24px;
      font-weight: bold;
      color: #0f172a;
    }

    .ot-sub {
      color: #475569;
      font-size: 14px;
    }

    .ot-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }

    .ot-item {
      border: 1px solid #dbeafe;
      background: #f8fbff;
      border-radius: 12px;
      padding: 12px;
    }

    .ot-item strong {
      display: block;
      color: #0f172a;
      margin-bottom: 4px;
    }

    .ot-observacion {
      margin-top: 10px;
      padding: 14px;
      border-radius: 12px;
      background: #f8fafc;
      border: 1px solid #cbd5e1;
      white-space: pre-wrap;
    }
    /* =========================================================
      MANTENCIÓN / OT IMPRESA - TABLA DE TRABAJOS
    ========================================================= */
    #otTablaTrabajos td,
    #otTablaTrabajos th {
      white-space: normal;
      word-break: break-word;
    }

    #printOT .table-wrap {
      overflow: visible;
    }

    #printOT table {
      width: 100%;
      border-collapse: collapse;
      background: white;
    }

    #printOT th {
      background: #0f172a;
      color: white;
    }

    #printOT th,
    #printOT td {
      border: 1px solid #d1d5db;
      padding: 8px;
      font-size: 12px;
    }
    /* ===================== FIN MANTENCIÓN / OT IMPRESA - TABLA DE TRABAJOS ===================== */
    .firmas {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 30px;
      margin-top: 28px;
    }

    .firma-box {
      text-align: center;
      padding-top: 32px;
    }

    .firma-linea {
      border-top: 1px solid #111827;
      margin-bottom: 8px;
    }

    .ficha-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 12px;
      margin-top: 14px;
    }

    .ficha-item {
      background: #f8fbff;
      border: 1px solid #dbeafe;
      border-radius: 12px;
      padding: 12px;
    }

    .ficha-item strong {
      display: block;
      margin-bottom: 4px;
      color: #0f172a;
    }

    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.45);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      padding: 20px;
    }

    .modal-overlay.activo {
      display: flex;
    }

    .modal-box {
      width: 95vw;
      max-width: 1100px;
      max-height: 90vh;
      overflow-y: auto;
      background: white;
      border-radius: 18px;
      padding: 18px;
      box-shadow: 0 10px 26px rgba(0,0,0,0.25);
    }
    .modal-box h3 {
      margin-top: 0;
      color: #0f172a;
    }

    .visor-documento-overlay { position:fixed; inset:0; z-index:100000; padding:clamp(10px,2.5vw,28px); box-sizing:border-box; display:flex; align-items:center; justify-content:center; background:rgba(15,23,42,.78); backdrop-filter:blur(2px); }
    .visor-documento-tarjeta { width:94vw; height:90vh; height:90dvh; max-width:1400px; max-height:900px; min-height:320px; display:flex; flex-direction:column; overflow:hidden; background:#f8fafc; border:1px solid rgba(148,163,184,.55); border-radius:18px; box-shadow:0 28px 80px rgba(2,6,23,.48); }
    .visor-documento-cabecera { display:flex; gap:14px; align-items:center; justify-content:space-between; flex-wrap:wrap; padding:14px clamp(14px,2vw,22px); background:#fff; border-bottom:1px solid #e2e8f0; }
    .visor-documento-identidad { min-width:0; flex:1; display:flex; align-items:center; gap:12px; }
    .visor-documento-icono { width:42px; height:42px; flex:0 0 42px; display:flex; align-items:center; justify-content:center; border-radius:12px; background:#e0e7ff; color:#3730a3; font-size:12px; font-weight:900; letter-spacing:.04em; }
    .visor-documento-textos { min-width:0; }
    .visor-documento-titulo { display:block; color:#0f172a; font-size:16px; line-height:1.25; }
    .visor-documento-nombre { display:block; max-width:min(58vw,760px); overflow:hidden; color:#64748b; font-size:13px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
    .visor-documento-acciones,.visor-pdf-controles,.visor-pdf-grupo { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .visor-documento-btn { min-height:38px; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:8px 13px; border:1px solid #cbd5e1; border-radius:10px; background:#fff; color:#1e293b; font:inherit; font-size:13px; font-weight:750; line-height:1; text-decoration:none; cursor:pointer; transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease; }
    .visor-documento-btn:hover:not(:disabled) { background:#f1f5f9; border-color:#94a3b8; transform:translateY(-1px); }
    .visor-documento-btn:focus-visible { outline:0; box-shadow:0 0 0 3px rgba(37,99,235,.24); border-color:#2563eb; }
    .visor-documento-btn:disabled { opacity:.48; cursor:not-allowed; transform:none; }
    .visor-documento-descargar { background:#1d4ed8; border-color:#1d4ed8; color:#fff; box-shadow:0 5px 14px rgba(29,78,216,.22); }
    .visor-documento-descargar:hover { background:#1e40af!important; border-color:#1e40af!important; color:#fff; }
    .visor-pdf-controles { justify-content:space-between; padding:9px clamp(12px,2vw,20px); background:#f8fafc; border-bottom:1px solid #dbe3ee; }
    .visor-pdf-indicador { min-width:82px; color:#334155; font-size:13px; font-weight:800; text-align:center; }
    .visor-pdf-zoom { min-width:52px; color:#475569; font-size:13px; font-weight:800; text-align:center; }
    .visor-documento-area { position:relative; min-height:0; flex:1; margin:clamp(10px,1.5vw,18px); overflow:auto; display:flex; align-items:center; justify-content:center; background:#dfe5ec; border:1px solid #cbd5e1; border-radius:14px; }
    .visor-documento-imagen { display:block; width:auto; height:auto; max-width:100%; max-height:100%; margin:auto; object-fit:contain; background:#fff; }
    .visor-pdf-canvas { display:block; margin:auto; background:#fff; box-shadow:0 8px 26px rgba(15,23,42,.2); }
    .visor-pdf-estado { margin:auto; padding:26px; color:#334155; line-height:1.55; text-align:center; }
    @media (max-width:700px) {
      .visor-documento-overlay { padding:7px; }
      .visor-documento-tarjeta { width:calc(100vw - 14px); height:calc(100vh - 14px); height:calc(100dvh - 14px); min-height:0; border-radius:14px; }
      .visor-documento-cabecera { align-items:flex-start; padding:11px; }
      .visor-documento-nombre { max-width:calc(100vw - 96px); }
      .visor-documento-acciones { width:100%; justify-content:flex-end; }
      .visor-pdf-controles { align-items:flex-start; padding:8px; }
      .visor-pdf-grupo { gap:5px; }
      .visor-documento-btn { min-height:36px; padding:7px 10px; }
      .visor-documento-area { margin:7px; }
    }

    /* =========================================================
      ABASTECIMIENTO / FICHA PRODUCTO
      Modal grande con pestañas e indicadores por producto
    ========================================================= */
    .modal-box.modal-ficha-producto {
      width: min(1180px, 96vw);
      max-height: 92vh;
      overflow-y: auto;
    }

    .ficha-producto-header {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: flex-start;
      margin-bottom: 14px;
    }

    .ficha-producto-titulo h3 {
      margin: 0;
      font-size: 22px;
    }

    .ficha-producto-titulo p {
      margin: 4px 0 0;
      color: #64748b;
      font-size: 14px;
    }

    .ficha-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin: 14px 0;
      border-bottom: 1px solid #e2e8f0;
      padding-bottom: 8px;
    }

    .ficha-tab-btn {
      border: 1px solid #cbd5e1;
      background: #f8fafc;
      color: #0f172a;
      border-radius: 999px;
      padding: 8px 14px;
      cursor: pointer;
      font-weight: 700;
      font-size: 13px;
    }

    .ficha-tab-btn.active {
      background: #0f172a;
      color: #ffffff;
      border-color: #0f172a;
    }

    .ficha-tab-panel {
      display: none;
    }

    .ficha-tab-panel.active {
      display: block;
    }

    .ficha-grid-datos {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 12px;
    }

    .ficha-dato {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      padding: 12px;
    }

    .ficha-dato span {
      display: block;
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
      margin-bottom: 5px;
    }

    .ficha-dato strong {
      color: #0f172a;
      font-size: 15px;
    }

    .ficha-indicadores {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 12px;
    }

    .ficha-indicador {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      padding: 14px;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    }

    .ficha-indicador span {
      display: block;
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
    }

    .ficha-indicador strong {
      display: block;
      margin-top: 6px;
      color: #0f172a;
      font-size: 22px;
    }

    @media (max-width: 900px) {
      .ficha-grid-datos,
      .ficha-indicadores {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
      }
    }

    @media (max-width: 560px) {
      .ficha-grid-datos,
      .ficha-indicadores {
        grid-template-columns: 1fr;
      }

      .ficha-producto-header {
        flex-direction: column;
      }
    }
    /* ===================== FIN ABASTECIMIENTO / FICHA PRODUCTO ===================== */

    .acciones-admin {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    @media print {
      body * {
        visibility: hidden;
      }

      #printOT,
      #printOT * {
        visibility: visible;
      }

      #printOT {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
      }
    }

    @media (max-width: 1400px) {
      .cards {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
      }
    }
    
    /* Historial: controlar columnas largas */
    #tablaHistorial td:nth-child(4),
    #tablaHistorial th:nth-child(4) {
      min-width: 140px;
      max-width: 180px;
      white-space: normal;
      word-break: break-word;
    }

    #tablaHistorial td:nth-child(6),
    #tablaHistorial th:nth-child(6) {
      min-width: 180px;
      max-width: 240px;
      white-space: normal;
      word-break: break-word;
      line-height: 1.3;
    }

    #tablaHistorial td:nth-child(11),
    #tablaHistorial th:nth-child(11) {
      min-width: 180px;
      max-width: 260px;
      white-space: normal;
      word-break: break-word;
      line-height: 1.3;
    }

    /* Historial: acciones fijas a la derecha */
    #historial th {
      z-index: 10;
    }

    #historial table th:last-child,
    #historial table td:last-child {
      position: sticky;
      right: 0;
      min-width: 310px;
      max-width: 310px;
      background: white;
      box-shadow: -4px 0 8px rgba(15, 23, 42, 0.10);
    }

    #historial table th:last-child {
      background: #0f172a;
      color: white;
      z-index: 20;
    }

    #historial table td:last-child {
      z-index: 5;
    }

    @media (max-width: 768px) {
      #historial table th:last-child,
      #historial table td:last-child {
        position: static;
        min-width: 0;
        max-width: none;
        box-shadow: none;
      }
    }

    #tablaHistorial .acciones-admin {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      align-items: center;
    }

    #tablaHistorial .acciones-admin select {
      grid-column: 1 / -1;
      width: 100%;
    }

    #tablaHistorial .acciones-admin button {
      width: 100%;
    }
    #modalPermisosUsuario .panel {
      padding: 12px;
      margin-bottom: 12px;
        }
    /* =========================
      MODAL PERMISOS - MEJOR USABILIDAD
    ========================= */

    #modalPermisosUsuario .modal-box {
      max-width: 96vw;
    }

    #modalPermisosUsuario .table-wrap {
      max-height: 62vh;
      overflow: auto;
      border: 1px solid #dbeafe;
      border-radius: 14px;
      position: relative;
    }

    /* Scrollbar más visible */
    #modalPermisosUsuario .table-wrap::-webkit-scrollbar {
      height: 16px;
      width: 14px;
    }

    #modalPermisosUsuario .table-wrap::-webkit-scrollbar-track {
      background: #e5e7eb;
      border-radius: 999px;
    }

    #modalPermisosUsuario .table-wrap::-webkit-scrollbar-thumb {
      background: #2563eb;
      border-radius: 999px;
      border: 3px solid #e5e7eb;
    }

    #modalPermisosUsuario .table-wrap::-webkit-scrollbar-thumb:hover {
      background: #1d4ed8;
    }

    /* R7 centraliza sticky y anchos adaptativos en .r7-permisos. */

    /* Checkboxes más cómodos */
    #modalPermisosUsuario td label {
      background: #f8fafc;
      border: 1px solid #dbeafe;
      border-radius: 999px;
      padding: 7px 10px;
      margin: 5px 8px 5px 0;
    }

    #modalPermisosUsuario td label:hover {
      background: #eff6ff;
      border-color: #2563eb;
    }

    #modalPermisosUsuario th,
    #modalPermisosUsuario td {
      padding: 8px 10px;
      font-size: 13px;
      text-align: center;
    }

    #modalPermisosUsuario th:nth-child(1),
    #modalPermisosUsuario td:nth-child(1),
    #modalPermisosUsuario th:nth-child(2),
    #modalPermisosUsuario td:nth-child(2) {
      text-align: left;
    }

    #modalPermisosUsuario input[type="checkbox"] {
      min-width: auto;
      transform: scale(1.1);
    }
    .card:nth-child(1) { border-top-color: #2563eb; }
    .card:nth-child(2) { border-top-color: #16a34a; }
    .card:nth-child(3) { border-top-color: #f59e0b; }
    .card:nth-child(4) { border-top-color: #dc2626; }

    .card:nth-child(5),
    .card:nth-child(6),
    .card:nth-child(7),
    .card:nth-child(8) {
      border-top-color: #7c3aed;
    }

    .card:nth-child(9) {
      border-top-color: #0f172a;
    }
    .panel .table-wrap {
      max-width: 100%;
    }

    .grid-2 > .panel,
    .grid-3 > .panel {
      min-width: 0;
      overflow: hidden;
    }
    .card-total {
      border-top: 4px solid #2563eb;
    }

    .card-ok {
      border-top: 4px solid #16a34a;
    }

    .card-warning {
      border-top: 4px solid #f59e0b;
    }

    .card-danger {
      border-top: 4px solid #dc2626;
    }
    .estado.VIGENTE {
      background: #e6f9ec;
      color: #0f8a3d;
    }

    .estado.PROXIMO\ A\ VENCER {
      background: #fff7e6;
      color: #b7791f;
    }

    .estado.VENCIDO {
      background: #fde8e8;
      color: #c53030;
    }
    /* Equipos y Maquinarias: dejar fijas las 2 últimas columnas */
    #equipos_admin table th:nth-last-child(2),
    #equipos_admin table td:nth-last-child(2) {
      position: sticky;
      right: 120px;
      min-width: 150px;
      max-width: 150px;
      background: white;
      z-index: 6;
      box-shadow: -4px 0 8px rgba(15, 23, 42, 0.08);
    }

    #equipos_admin table th:nth-last-child(2) {
      background: #0f172a;
      color: white;
      z-index: 21;
    }

    #equipos_admin table th:last-child,
    #equipos_admin table td:last-child {
      position: sticky;
      right: 0;
      min-width: 120px;
      max-width: 120px;
      background: white;
      z-index: 7;
      box-shadow: -4px 0 8px rgba(15, 23, 42, 0.10);
    }

    #equipos_admin table th:last-child {
      background: #0f172a;
      color: white;
      z-index: 22;
    }
/* =========================================================
   SIDEBAR / LAYOUT FINAL CONSOLIDADO
========================================================= */

.layout {
  display:flex;
  min-height:100vh;
  background:#f5f7fb;
}

.sidebar {
  width:330px;
  min-width:330px;
  max-width:330px;
  height:100vh;
  position:sticky;
  top:0;
  z-index:2;
  padding:20px 14px;
  overflow-y:auto;
  color:#ffffff;
  background:linear-gradient(180deg,#050b1d 0%,#07122a 52%,#234fe8 100%);
  border-right:1px solid rgba(255,255,255,0.08);
  box-shadow:12px 0 36px rgba(2,6,23,0.35);
}

.sidebar::-webkit-scrollbar {
  width:8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background:rgba(255,255,255,0.28);
  border-radius:999px;
}

.sidebar-header {
  text-align:center;
  padding:4px 8px 18px 8px;
  margin-bottom:12px;
  border-bottom:1px solid rgba(255,255,255,0.12);
}

.sidebar-title {
  font-size:20px;
  font-weight:800;
  color:#ffffff;
  margin:0 0 8px 0;
}

.sidebar-area {
  font-size:12px;
  color:#d7ddf3;
  font-weight:600;
}

.sidebar-scroll {
  padding:22px 16px 10px 16px;
}

.menu-group {
  margin:20px 0 9px 6px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.8px;
  text-transform:uppercase;
  color:#9aa8c7;
}

.menu-btn {
  width:100%;
  min-height:50px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:11px 12px;
  margin-bottom:9px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.12);
  background:linear-gradient(180deg,rgba(18,27,48,0.92),rgba(13,21,39,0.88));
  color:#ffffff;
  font-size:14px;
  font-weight:700;
  text-align:left;
  cursor:pointer;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.02),0 6px 14px rgba(0,0,0,0.14);
  transition:.18s ease;
}

.menu-btn:hover {
  transform:translateY(-1px);
  border-color:rgba(96,165,250,0.55);
  background:linear-gradient(180deg,rgba(25,38,67,0.96),rgba(17,29,54,0.92));
  box-shadow:inset 0 0 0 1px rgba(99,102,241,0.22),0 12px 26px rgba(0,0,0,0.25);
}

.menu-btn.active {
  background:linear-gradient(90deg,#2563eb 0%,#3b82f6 100%);
  border-color:rgba(255,255,255,0.28);
  box-shadow:0 8px 18px rgba(37,99,235,0.35);
}

.menu-icon {
  width:22px;
  height:22px;
  min-width:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#c7d2fe;
  opacity:.95;
  transition:.18s ease;
}

.menu-icon svg {
  width:20px;
  height:20px;
  stroke-width:2.2;
}

.menu-btn.active .menu-icon {
  color:#ffffff;
  transform:scale(1.05);
}

.menu-text {
  flex:1;
  min-width:0;
  white-space:normal;
  line-height:1.2;
}

.menu-arrow {
  color:#cbd5e1;
  font-size:22px;
  line-height:1;
}

.menu-btn.active .menu-arrow {
  color:#ffffff;
}

.menu-btn.oculto-menu {
  display:none !important;
}

.menu-btn.logout-btn {
  margin-top:16px;
  background:linear-gradient(180deg,rgba(255,255,255,0.10),rgba(255,255,255,0.05));
}

.content {
  flex:1;
  min-width:0;
  padding:24px;
  overflow:auto;
  background:#f5f7fb;
}

/* =========================================================
   TABLET / CELULAR
   Una sola regla para reemplazar los fixes superpuestos.
========================================================= */

@media(max-width:1100px) {
  html,
  body {
    width:100%;
    overflow-x:hidden;
  }

  .layout {
    display:flex;
    flex-direction:column;
    width:100%;
    min-height:100vh;
  }

  .sidebar {
    width:100%;
    min-width:100%;
    max-width:100%;
    height:auto;
    max-height:40vh;
    position:relative;
    top:auto;
    padding:14px;
    overflow-y:auto;
    box-shadow:none;
  }

  .content {
    width:100%;
    min-width:100%;
    max-width:100%;
    min-height:60vh;
    padding:14px;
    overflow-x:hidden;
    overflow-y:visible;
    background:#f5f7fb;
  }

  .section {
    display:none;
    width:100%;
  }

  .section.active {
    display:block;
  }

  .cards {
    grid-template-columns:1fr;
  }

  .grid-2,
  .grid-3,
  .firmas {
    grid-template-columns:1fr;
  }

  .table-wrap {
    max-width:100%;
    overflow-x:auto;
  }

  table {
    min-width:900px;
  }
}

@media(max-width:820px) {
  html,
  body {
    min-height:100%;
  }

  .layout {
    background:#f5f7fb;
  }

  .sidebar-header {
    padding:4px 8px 10px 8px;
    margin-bottom:8px;
  }

  .sidebar-title {
    font-size:18px;
  }

  .sidebar-area {
    font-size:11px;
  }

  .menu-group {
    margin:14px 0 8px 6px;
  }

  .menu-btn {
    min-height:46px;
    padding:10px 12px;
    margin-bottom:8px;
    font-size:13px;
  }

  .menu-icon {
    width:20px;
    height:20px;
    min-width:20px;
  }

  .menu-icon svg {
    width:18px;
    height:18px;
  }

  .content {
    display:block;
  }

  .section.active {
    visibility:visible;
    opacity:1;
  }

  .section-title {
    font-size:22px;
    margin-bottom:14px;
  }
}

/* ===================== FIN SIDEBAR / LAYOUT FINAL CONSOLIDADO ===================== */
  /* Permiso: ocultar costos */
  body.sin-costos .col-costo {
    display: none !important;
  }
  /* =========================================================
    COMBUSTIBLES / TABLA HISTORIAL
    Evita que report y links desordenen visualmente la tabla
  ========================================================= */
  #tablaCombustibles td,
  #tablaCombustibles th {
    vertical-align: top;
  }

  #tablaCombustibles td:nth-child(2),
  #tablaCombustibles th:nth-child(2) {
    min-width: 150px;
    max-width: 180px;
    white-space: normal;
    word-break: break-word;
  }

  #tablaCombustibles td:nth-child(3),
  #tablaCombustibles th:nth-child(3) {
    min-width: 140px;
    max-width: 180px;
    white-space: normal;
    word-break: break-word;
  }

  #tablaCombustibles td:nth-child(4),
  #tablaCombustibles th:nth-child(4) {
    min-width: 230px;
    max-width: 280px;
    white-space: normal;
    word-break: break-word;
  }

  #tablaCombustibles .btn-secondary {
    white-space: nowrap;
  }
  /* ===================== FIN COMBUSTIBLES / TABLA HISTORIAL ===================== */
  /* =========================================================
    COMBUSTIBLES / MEJORAS VISUALES
    Pestañas, resumen filtros y badges de report
  ========================================================= */
  .cmb-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 16px 0;
    padding: 8px;
    background: #eef2ff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
  }

  .cmb-tab-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.18s ease;
  }

  .cmb-tab-btn:hover {
    transform: translateY(-1px);
    border-color: #2563eb;
    background: #eff6ff;
  }

  .cmb-tab-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 8px 18px rgba(37,99,235,0.25);
  }

  .cmb-resumen-filtros {
    display: none;
    margin: 10px 0 14px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #dbeafe;
    color: #334155;
    font-size: 13px;
    line-height: 1.45;
  }

  .cmb-resumen-filtros.activo {
    display: block;
  }

  .cmb-resumen-filtros strong {
    color: #0f172a;
  }

  .cmb-badge-report {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    margin-top: 5px;
  }

  .cmb-badge-ok {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
  }

  .cmb-badge-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #facc15;
  }

  .cmb-badge-neutral {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #cbd5e1;
  }

  .cmb-panel-title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
  }

  .cmb-panel-title-row h3 {
    margin-bottom: 0;
  }
  /* ===================== FIN COMBUSTIBLES / MEJORAS VISUALES ===================== */
  /* =========================================================
    COMBUSTIBLES / ACCESOS RÁPIDOS
  ========================================================= */
  .cmb-accesos-rapidos {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 18px 0;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-left: 5px solid #2563eb;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  }

  .cmb-acceso-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 800;
    cursor: pointer;
    background: #eff6ff;
    color: #1d4ed8;
    transition: 0.18s ease;
  }

  .cmb-acceso-btn:hover {
    background: #2563eb;
    color: #ffffff;
    transform: translateY(-1px);
  }

  .cmb-ancla-destino {
    scroll-margin-top: 18px;
  }
  /* ===================== FIN COMBUSTIBLES / ACCESOS RÁPIDOS ===================== */

/* =========================================================
  COMBUSTIBLES / FORMULARIO - LABELS VISIBLES
========================================================= */

.campo-combustible-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.campo-combustible-label label {
  font-size: 11px;
  font-weight: 900;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.campo-combustible-label input,
.campo-combustible-label select {
  width: 100%;
  min-width: 0;
}

/* ===================== FIN COMBUSTIBLES / FORMULARIO - LABELS VISIBLES ===================== */
/* =========================================================
  COMBUSTIBLES / MODAL EDITAR CARGA - LABELS VISIBLES
========================================================= */

.campo-edicion-combustible-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.campo-edicion-combustible-label label {
  font-size: 11px;
  font-weight: 900;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.campo-edicion-combustible-label input,
.campo-edicion-combustible-label select {
  width: 100%;
  min-width: 0;
}

#modalEditarCombustible {
  z-index: 10050;
}

#modalEditarCombustible .modal-box {
  max-width: 1180px;
}

/* ===================== FIN COMBUSTIBLES / MODAL EDITAR CARGA - LABELS VISIBLES ===================== */
/* =========================================================
  COMBUSTIBLES / ALERTAS - FLUJO ACTUAL
  La lista de alertas es la bandeja principal de revisión.
========================================================= */

#wrapAlertasCombustibleRevision .cmb-alertas-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

#contenedorAlertasCombustibleRevision.cmb-alertas-lista {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(390px, 1fr));
  gap: 14px;
  max-height: none;
  overflow: visible;
}

.cmb-alerta-card {
  cursor: default;
}

.cmb-alerta-card .btn-mini {
  margin-top: 10px;
  border-radius: 999px;
  font-weight: 800;
}

.cmb-alerta-card .btn-secondary {
  margin-left: 6px;
}

.cmb-modal-registros-alerta {
  max-height: 320px;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.cmb-modal-registros-alerta table {
  min-width: 1200px;
}

.cmb-modal-registros-alerta td,
.cmb-modal-registros-alerta th {
  vertical-align: top;
}

.cmb-modal-registro-mitter {
  white-space: normal;
  line-height: 1.35;
  min-width: 170px;
}

.cmb-modal-registro-obs {
  white-space: normal;
  line-height: 1.35;
  min-width: 220px;
  max-width: 320px;
}

.cmb-modal-registro-acciones {
  min-width: 120px;
}

/* ===================== FIN COMBUSTIBLES / ALERTAS - FLUJO FUSIONADO ===================== */
/* =========================================================
  COMBUSTIBLES / AUDITORÍA RÁPIDA ALERTAS - CONSOLIDADO
========================================================= */

.cmb-audit-panel {
  border-left-color: #7c3aed;
  background: #ffffff;
  margin-bottom: 16px;
}

.cmb-audit-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.cmb-audit-card {
  border: 1px solid #e2e8f0;
  border-top: 4px solid #64748b;
  border-radius: 14px;
  padding: 10px;
  background: #f8fafc;
}

.cmb-audit-card span {
  display: block;
  font-size: 10px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.cmb-audit-card strong {
  display: block;
  font-size: 22px;
  color: #0f172a;
  line-height: 1;
}

.cmb-audit-card.total { border-top-color: #2563eb; }
.cmb-audit-card.pendiente { border-top-color: #64748b; }
.cmb-audit-card.revision { border-top-color: #f59e0b; }
.cmb-audit-card.cerrada { border-top-color: #16a34a; }
.cmb-audit-card.correo { border-top-color: #0ea5e9; }
.cmb-audit-card.ultimos,
.cmb-audit-card.cambios { border-top-color: #7c3aed; }
.cmb-audit-card.usuarios { border-top-color: #0f172a; }

.cmb-audit-mini-wrap {
  max-height: 230px;
  box-shadow: none;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.cmb-audit-mini-table {
  min-width: 980px;
}

.cmb-audit-mini-table th,
.cmb-audit-mini-table td {
  font-size: 12px;
  padding: 9px;
  vertical-align: top;
}

.cmb-audit-mini-detalle {
  white-space: normal;
  line-height: 1.3;
  max-width: 300px;
}

/* El modal de editar carga debe quedar por encima del modal de revisión */
#modalEditarRevisionAlertaCombustible {
  z-index: 9999;
}

#modalEditarCombustible {
  z-index: 10050;
}

#modalEditarCombustible .modal-box {
  max-width: 1180px;
}

/* ===================== FIN COMBUSTIBLES / AUDITORÍA RÁPIDA ALERTAS - CONSOLIDADO ===================== */
  /* =========================================================
    MANTENCIÓN / REGISTRO - RESUMEN EQUIPO
  ========================================================= */
  .registro-equipo-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-left: 5px solid #2563eb;
    margin: 6px 0 8px 0;
  }

  .registro-equipo-resumen div {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
  }

  .registro-equipo-resumen span {
    display: block;
    font-size: 11px;
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 5px;
  }

  .registro-equipo-resumen strong {
    color: #0f172a;
    font-size: 14px;
  }
  /* ===================== FIN MANTENCIÓN / REGISTRO - RESUMEN EQUIPO ===================== */
  /* =========================================================
    MANTENCIÓN / REGISTRO - AVISO PLAN
  ========================================================= */
  .aviso-trabajo-plan {
    border-radius: 14px;
    padding: 12px 14px;
    margin: 4px 0 8px 0;
    font-size: 13px;
    line-height: 1.4;
    border-left: 5px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
  }

  .aviso-trabajo-plan.ok {
    border-left-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
  }

  .aviso-trabajo-plan.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
  }
  /* =========================================================
    MANTENCIÓN / FICHA - RESUMEN SUPERIOR EQUIPO
  ========================================================= */
  .ficha-resumen-superior {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(320px, 2fr);
    gap: 14px;
    align-items: stretch;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 18px;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  }

  .ficha-resumen-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .ficha-resumen-codigo {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0.4px;
    line-height: 1.1;
  }

  .ficha-resumen-equipo {
    margin-top: 8px;
    font-size: 17px;
    font-weight: 700;
    color: #e0ecff;
  }

  .ficha-resumen-sub {
    margin-top: 6px;
    font-size: 13px;
    color: #cbd5e1;
  }

  .ficha-resumen-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
  }

  .ficha-resumen-kpi {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 12px;
    backdrop-filter: blur(8px);
  }

  .ficha-resumen-kpi span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    color: #bfdbfe;
    margin-bottom: 6px;
  }

  .ficha-resumen-kpi strong {
    display: block;
    font-size: 16px;
    color: #ffffff;
    word-break: break-word;
  }

  @media (max-width: 1000px) {
    .ficha-resumen-superior {
      grid-template-columns: 1fr;
    }

    .ficha-resumen-kpis {
      grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
  }

  @media (max-width: 560px) {
    .ficha-resumen-kpis {
      grid-template-columns: 1fr;
    }

    .ficha-resumen-codigo {
      font-size: 23px;
    }
  }
  /* ===================== FIN MANTENCIÓN / FICHA - RESUMEN SUPERIOR EQUIPO ===================== */
  /* =========================================================
    MANTENCIÓN / REGISTRO - RESULTADO OT
  ========================================================= */
  .resultado-ot-box {
    margin-top: 12px;
    border-radius: 16px;
    padding: 14px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-left: 6px solid #16a34a;
    color: #14532d;
  }

  .resultado-ot-titulo {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 6px;
  }

  .resultado-ot-msg {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
  }

  .resultado-ot-numero {
    margin: 8px 0;
    font-size: 14px;
  }

  .resultado-ot-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin: 10px 0;
  }

  .resultado-ot-kpis div {
    background: #ffffff;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 10px;
  }

  .resultado-ot-kpis span {
    display: block;
    font-size: 11px;
    color: #166534;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .resultado-ot-kpis strong {
    font-size: 20px;
    color: #052e16;
  }

  .resultado-ot-detalle {
    margin-top: 10px;
    font-size: 13px;
  }

  .resultado-ot-detalle ul {
    margin: 8px 0 0 0;
    padding-left: 18px;
  }

  .resultado-ot-detalle li {
    margin-bottom: 8px;
  }

  .resultado-ot-detalle li.ok {
    color: #166534;
  }

  .resultado-ot-detalle li.warning {
    color: #92400e;
  }

  .resultado-ot-detalle small {
    color: #64748b;
  }
  /* ===================== FIN MANTENCIÓN / REGISTRO - RESULTADO OT ===================== */
  /* =========================================================
    FORMULARIOS / CAMPOS CON LABEL
    Evita depender solo del placeholder
  ========================================================= */
  .campo-con-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .campo-con-label label {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .campo-con-label input,
  .campo-con-label select {
    width: 100%;
    min-width: 0;
  }

  .campo-con-label small {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
  }

  .campo-con-label.principal {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 8px;
  }

  .campo-con-label.principal label {
    color: #1d4ed8;
  }
/* ===================== FIN FORMULARIOS / CAMPOS CON LABEL ===================== */
  /* =========================================================
    MANTENCIÓN / HISTORIAL - MODAL EDITAR OT COMPLETA
  ========================================================= */
  .modal-ot-multiple {
    max-width: 1180px;
    width: min(1180px, 96vw);
    padding: 20px;
  }

  .modal-ot-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
  }

  .modal-ot-header h3 {
    margin: 0;
    font-size: 22px;
    color: #0f172a;
  }

  .modal-ot-header p {
    margin: 5px 0 0 0;
    color: #64748b;
    font-size: 13px;
  }

  .ot-edit-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: white;
  }

  .ot-edit-resumen div {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 10px;
  }

  .ot-edit-resumen span {
    display: block;
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 5px;
  }

  .ot-edit-resumen strong {
    display: block;
    color: #ffffff;
    font-size: 15px;
    word-break: break-word;
  }

  .panel-edicion-ot {
    border-left-color: #2563eb;
    margin-bottom: 14px;
  }

  .aviso-edicion-plan {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 12px;
  }

  .aviso-edicion-plan label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 800;
    color: #0f172a;
  }

  .aviso-edicion-plan input[type="checkbox"] {
    min-width: auto;
    margin-top: 3px;
  }

  .aviso-edicion-plan small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 400;
    line-height: 1.35;
  }

  .titulo-tabla-trabajos-ot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .titulo-tabla-trabajos-ot h3 {
    margin-bottom: 2px;
  }

  .titulo-tabla-trabajos-ot p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
  }

  .tabla-editar-ot-wrap {
    max-height: 360px;
  }

  .tabla-editar-ot {
    min-width: 960px;
  }

  .tabla-editar-ot th:nth-child(1),
  .tabla-editar-ot td:nth-child(1) {
    width: 50px;
    text-align: center;
  }

  .tabla-editar-ot th:nth-child(2),
  .tabla-editar-ot td:nth-child(2) {
    min-width: 220px;
  }

  .tabla-editar-ot th:nth-child(3),
  .tabla-editar-ot td:nth-child(3) {
    min-width: 160px;
  }

  .tabla-editar-ot th:nth-child(4),
  .tabla-editar-ot td:nth-child(4) {
    min-width: 130px;
  }

  .tabla-editar-ot th:nth-child(5),
  .tabla-editar-ot td:nth-child(5) {
    min-width: 260px;
  }

  .tabla-editar-ot input,
  .tabla-editar-ot select,
  .tabla-editar-ot textarea {
    width: 100%;
    min-width: 0;
  }

  .tabla-editar-ot textarea {
    min-height: 54px;
    max-height: 90px;
  }

  .toolbar-modal-ot {
    justify-content: flex-start;
    margin-top: 8px;
  }

  @media (max-width: 700px) {
    .modal-ot-header {
      flex-direction: column;
    }

    .modal-ot-multiple {
      width: 96vw;
      padding: 14px;
    }
  }
  /* ===================== FIN MANTENCIÓN / HISTORIAL - MODAL EDITAR OT COMPLETA ===================== */
  /* =========================================================
    MANTENCIÓN / LECTURAS - CONTROL VISUAL
  ========================================================= */
  #tablaControlLecturas td:nth-child(7),
  #tablaControlLecturas td:nth-child(8),
  #tablaControlLecturas td:nth-child(9) {
    white-space: normal;
    min-width: 160px;
    line-height: 1.25;
  }

  #tablaControlLecturas td:nth-child(7) small,
  #tablaControlLecturas td:nth-child(8) small,
  #tablaControlLecturas td:nth-child(9) small {
    color: #64748b;
    font-size: 11px;
  }

  .badge-origen-lectura {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    border: 1px solid transparent;
  }

  .origen-manual {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
  }

  .origen-ot {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
  }

  .origen-edicion {
    background: #fef3c7;
    color: #92400e;
    border-color: #facc15;
  }
  .origen-combustible {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
  }
  .origen-sin {
    background: #e5e7eb;
    color: #374151;
    border-color: #cbd5e1;
  }
  /* ===================== FIN MANTENCIÓN / LECTURAS - CONTROL VISUAL ===================== */
  /* =========================================================
    EQUIPOS / ESTADO OPERATIVO
  ========================================================= */
  .badge-estado-operativo {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    border: 1px solid transparent;
    white-space: nowrap;
  }

  .badge-op-activo {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
  }

  .badge-op-inactivo {
    background: #e5e7eb;
    color: #374151;
    border-color: #cbd5e1;
  }

  .badge-op-fuera {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
  }

  /* ===================== FIN EQUIPOS / ESTADO OPERATIVO ===================== */
  /* =========================================================
    MANTENCIÓN / ÓRDENES DE TRABAJO - LISTADO
  ========================================================= */
  .panel-listado-ordenes {
    border-left-color: #0f172a;
  }

  .tabla-ordenes-trabajo {
    min-width: 1200px;
  }

  .tabla-ordenes-trabajo td:nth-child(6),
  .tabla-ordenes-trabajo th:nth-child(6) {
    min-width: 260px;
    max-width: 360px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
  }

  .ordenes-trabajos {
    color: #0f172a;
    font-weight: 600;
  }

  .acciones-ordenes-listado {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .acciones-ordenes-listado button {
    white-space: nowrap;
  }
  .ordenes-cambiar-estado {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 250px;
  }

  .ordenes-cambiar-estado select {
    min-width: 135px;
  }

  .ordenes-cambiar-estado button {
    white-space: nowrap;
  }
  /* ===================== FIN MANTENCIÓN / ÓRDENES DE TRABAJO - LISTADO ===================== */
  /* =========================================================
    DASHBOARD MANTENCIÓN / VISUAL COMPACTA EJECUTIVA
  ========================================================= */
  .dash-compact-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 22px;
    border-radius: 24px;
    margin-bottom: 18px;
    background:
      radial-gradient(circle at top left, rgba(59,130,246,0.30), transparent 35%),
      linear-gradient(135deg, #020617 0%, #0f172a 48%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 16px 36px rgba(15,23,42,0.22);
  }

  .dash-compact-hero h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
  }

  .dash-compact-hero p {
    margin: 8px 0 0 0;
    color: #cbd5e1;
    font-size: 14px;
    max-width: 760px;
  }

  .dash-compact-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .dash-compact-actions button {
    border-radius: 999px;
    font-weight: 800;
  }

  .dash-exec-grid {
    display: grid;
    grid-template-columns: 1.35fr repeat(4, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }

  .dash-exec-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: 5px solid #2563eb;
    border-radius: 20px;
    padding: 16px;
    min-height: 132px;
    box-shadow: 0 8px 22px rgba(15,23,42,0.08);
  }

  .dash-exec-card span {
    display: block;
    font-size: 11px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 9px;
  }

  .dash-exec-card strong {
    display: block;
    font-size: 32px;
    color: #0f172a;
    line-height: 1.05;
  }

  .dash-exec-card small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
  }

  .dash-exec-status {
    background:
      radial-gradient(circle at top right, rgba(37,99,235,0.16), transparent 40%),
      #ffffff;
    border-top-color: #0f172a;
  }

  .dash-exec-card.danger {
    border-top-color: #dc2626;
  }

  .dash-exec-card.warning {
    border-top-color: #f97316;
  }

  .dash-exec-card.success {
    border-top-color: #16a34a;
  }

  .dash-compact-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
  }

  .dash-compact-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #2563eb;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 22px rgba(15,23,42,0.08);
  }

  .panel-preventivo {
    border-left-color: #2563eb;
  }

  .panel-ot {
    border-left-color: #7c3aed;
  }

  .panel-parque {
    border-left-color: #0f172a;
  }

  .panel-cumplimiento {
    border-left-color: #16a34a;
    margin-bottom: 16px;
  }

  .dash-compact-panel-header {
    margin-bottom: 12px;
  }

  .dash-compact-panel-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
  }

  .dash-compact-panel-header p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 12px;
  }

  .dash-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .dash-mini-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
  }

  .dash-mini-item span {
    display: block;
    font-size: 10px;
    color: #64748b;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 6px;
  }

  .dash-mini-item strong {
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
  }

  .dash-mini-item.ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
  }

  .dash-mini-item.warning {
    background: #fffbeb;
    border-color: #fde68a;
  }

  .dash-mini-item.danger {
    background: #fef2f2;
    border-color: #fecaca;
  }

  .dash-mini-item.neutral {
    background: #f8fafc;
    border-color: #cbd5e1;
  }

  .dash-mini-item.blue {
    background: #eff6ff;
    border-color: #bfdbfe;
  }

  .dash-mini-item.purple {
    background: #f5f3ff;
    border-color: #ddd6fe;
  }

  .dash-mini-item.dark {
    background: #f8fafc;
    border-color: #94a3b8;
  }

  .dash-cumplimiento-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .dash-cumplimiento-inline div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
  }

  .dash-cumplimiento-inline span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 5px;
  }

  .dash-cumplimiento-inline strong {
    display: block;
    color: #0f172a;
    font-size: 26px;
  }

  .dash-grid-main {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
    gap: 16px;
    align-items: start;
    margin-top: 16px;
  }

  .dash-grid-prioridades {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .dash-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #2563eb;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 22px rgba(15,23,42,0.08);
    margin-bottom: 16px;
  }

  .dash-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .dash-panel-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
  }

  .dash-panel-header p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 12px;
  }

  .dash-panel-header button {
    border-radius: 999px;
    font-weight: 800;
  }

  .dash-panel-semaforo {
    border-left-color: #0f172a;
  }

  .dash-panel-alertas {
    border-left-color: #f59e0b;
  }

  .dash-panel-ot-faena {
    border-left-color: #7c3aed;
  }

  .dash-panel-prioridad {
    border-left-color: #dc2626;
  }

  .dash-panel-prioridad-ot {
    border-left-color: #f97316;
  }

  .dash-semaforo-box {
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid #dbeafe;
  }

  .dash-semaforo-valor {
    font-size: 28px;
    font-weight: 900;
    color: #0f172a;
  }

  .dash-semaforo-detalle {
    margin-top: 8px;
    color: #475569;
    line-height: 1.45;
  }

  .dash-table-wrap {
    box-shadow: none;
    border: 1px solid #e2e8f0;
    max-height: 430px;
  }

  .dash-table-wrap table {
    min-width: 850px;
  }

  .tabla-dashboard-ot-faena {
    min-width: 900px;
  }

  .tabla-dashboard-ot-faena td,
  .tabla-dashboard-ot-faena th {
    white-space: normal;
  }

  .tabla-dashboard-ot-faena td:nth-child(1),
  .tabla-dashboard-ot-faena th:nth-child(1) {
    min-width: 190px;
  }

  .dash-prioridades-lista {
    display: grid;
    gap: 10px;
  }

  .dash-prioridad-card {
    border: 1px solid #e2e8f0;
    border-left: 5px solid #64748b;
    border-radius: 16px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15,23,42,0.06);
  }

  .dash-prioridad-card.prioridad-alta {
    border-left-color: #dc2626;
    background: #fef2f2;
  }

  .dash-prioridad-card.prioridad-media {
    border-left-color: #f59e0b;
    background: #fffbeb;
  }

  .dash-prioridad-card.prioridad-baja {
    border-left-color: #64748b;
    background: #f8fafc;
  }

  .dash-prioridad-card.prioridad-ot {
    border-left-color: #f97316;
    background: #fff7ed;
  }

  .dash-prioridad-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 7px;
  }

  .dash-prioridad-main {
    color: #0f172a;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 5px;
  }

  .dash-prioridad-sub {
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
  }

  .dash-prioridad-vacia {
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-weight: 700;
  }

  .dash-prioridad-btn {
    margin-top: 10px;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
  }

  @media (max-width: 1450px) {
    .dash-exec-grid {
      grid-template-columns: repeat(3, minmax(180px, 1fr));
    }

    .dash-exec-status {
      grid-column: 1 / -1;
    }

    .dash-compact-grid-3 {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 1050px) {
    .dash-compact-hero,
    .dash-grid-main,
    .dash-grid-prioridades {
      grid-template-columns: 1fr;
    }

    .dash-compact-hero {
      flex-direction: column;
    }

    .dash-exec-grid {
      grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .dash-exec-status {
      grid-column: 1 / -1;
    }
  }

  @media (max-width: 620px) {
    .dash-exec-grid,
    .dash-mini-grid,
    .dash-cumplimiento-inline {
      grid-template-columns: 1fr;
    }

    .dash-compact-hero h1 {
      font-size: 26px;
    }

    .dash-exec-card strong {
      font-size: 28px;
    }
  }
  /* ===================== FIN DASHBOARD MANTENCIÓN / VISUAL COMPACTA EJECUTIVA ===================== */
  /* =========================================================
    MANTENCIÓN / PROGRAMACIÓN PREVENTIVA - VISUAL PREMIUM
  ========================================================= */
  .prog-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 24px;
    border-radius: 26px;
    margin-bottom: 20px;
    background:
      radial-gradient(circle at top left, rgba(249,115,22,0.30), transparent 35%),
      linear-gradient(135deg, #020617 0%, #0f172a 45%, #ea580c 100%);
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(15,23,42,0.24);
  }

  .prog-hero h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.1;
  }

  .prog-hero p {
    margin: 10px 0 0 0;
    color: #fed7aa;
    max-width: 780px;
    font-size: 15px;
  }

  .prog-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .prog-hero-actions button {
    border-radius: 999px;
    font-weight: 800;
  }

  .prog-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }

  .prog-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px;
    min-height: 126px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
    position: relative;
    overflow: hidden;
  }

  .prog-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: #0f172a;
  }

  .prog-kpi-card span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    margin-bottom: 10px;
  }

  .prog-kpi-card strong {
    display: block;
    font-size: 34px;
    color: #0f172a;
    line-height: 1.05;
  }

  .prog-kpi-card small {
    display: block;
    margin-top: 9px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
  }

  .prog-red::before { background: #dc2626; }
  .prog-orange::before { background: #f97316; }
  .prog-yellow::before { background: #f59e0b; }
  .prog-dark::before { background: #0f172a; }

  .prog-toolbar-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #f97316;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
  }

  .prog-toolbar-panel .toolbar {
    margin-bottom: 8px;
  }

  .prog-grid-principal {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
  }

  .prog-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #64748b;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
    min-width: 0;
  }

  .prog-panel-rojo { border-left-color: #dc2626; }
  .prog-panel-naranja { border-left-color: #f97316; }
  .prog-panel-amarillo { border-left-color: #f59e0b; }

  .prog-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .prog-panel-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
  }

  .prog-panel-header p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 12px;
  }

  .prog-badge {
    display: inline-block;
    min-width: 34px;
    text-align: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
  }

  .prog-badge.rojo {
    background: #fee2e2;
    color: #991b1b;
  }

  .prog-badge.naranja {
    background: #ffedd5;
    color: #9a3412;
  }

  .prog-badge.amarillo {
    background: #fef3c7;
    color: #92400e;
  }

  .prog-lista {
    display: grid;
    gap: 12px;
    max-height: 640px;
    overflow-y: auto;
    padding-right: 4px;
  }

  .prog-lista::-webkit-scrollbar {
    width: 8px;
  }

  .prog-lista::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
  }

  .prog-card-item {
    border: 1px solid #e2e8f0;
    border-left: 5px solid #64748b;
    border-radius: 18px;
    padding: 14px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15,23,42,0.06);
  }

  .prog-card-vencida {
    border-left-color: #dc2626;
    background: #fef2f2;
  }

  .prog-card-10 {
    border-left-color: #f97316;
    background: #fff7ed;
  }

  .prog-card-20 {
    border-left-color: #f59e0b;
    background: #fffbeb;
  }

  .prog-card-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .prog-card-top strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
  }

  .prog-card-top small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    line-height: 1.3;
  }

  .prog-card-mantencion {
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 10px;
  }

  .prog-card-meta {
    display: grid;
    gap: 5px;
    color: #475569;
    font-size: 12px;
    margin-bottom: 10px;
  }

  .prog-card-lecturas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  .prog-card-lecturas div {
    background: rgba(255,255,255,0.75);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
  }

  .prog-card-lecturas span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .prog-card-lecturas strong {
    color: #0f172a;
    font-size: 14px;
  }

  .prog-barra-wrap {
    margin-top: 8px;
  }

  .prog-barra-info {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
  }

  .prog-barra {
    height: 9px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
  }

  .prog-barra div {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #f59e0b, #dc2626);
    border-radius: 999px;
  }

  .prog-empty {
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-weight: 700;
  }

  @media (max-width: 1400px) {
    .prog-grid-principal {
      grid-template-columns: 1fr;
    }

    .prog-lista {
      max-height: none;
    }
  }

  @media (max-width: 900px) {
    .prog-hero {
      flex-direction: column;
    }

    .prog-kpi-grid {
      grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
  }

  @media (max-width: 560px) {
    .prog-kpi-grid {
      grid-template-columns: 1fr;
    }

    .prog-card-lecturas {
      grid-template-columns: 1fr;
    }

    .prog-hero h1 {
      font-size: 26px;
    }
  }
  /* ===================== FIN MANTENCIÓN / PROGRAMACIÓN PREVENTIVA - VISUAL PREMIUM ===================== */
  /* =========================================================
    MANTENCIÓN / PLAN DE MANTENCIÓN - VISUAL PREMIUM
  ========================================================= */
  .plan-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 24px;
    border-radius: 26px;
    margin-bottom: 20px;
    background:
      radial-gradient(circle at top left, rgba(37,99,235,0.32), transparent 35%),
      linear-gradient(135deg, #020617 0%, #0f172a 45%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(15,23,42,0.24);
  }

  .plan-hero h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.1;
  }

  .plan-hero p {
    margin: 10px 0 0 0;
    color: #bfdbfe;
    max-width: 780px;
    font-size: 15px;
  }

  .plan-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .plan-hero-actions button {
    border-radius: 999px;
    font-weight: 800;
  }

  .plan-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }

  .plan-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px;
    min-height: 126px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
    position: relative;
    overflow: hidden;
  }

  .plan-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: #2563eb;
  }

  .plan-kpi-card span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    margin-bottom: 10px;
  }

  .plan-kpi-card strong {
    display: block;
    font-size: 34px;
    color: #0f172a;
    line-height: 1.05;
  }

  .plan-kpi-card small {
    display: block;
    margin-top: 9px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
  }

  .plan-blue::before { background: #2563eb; }
  .plan-green::before { background: #16a34a; }
  .plan-yellow::before { background: #f59e0b; }
  .plan-red::before { background: #dc2626; }
  .plan-gray::before { background: #64748b; }

  .plan-toolbar-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #2563eb;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
  }

  .plan-toolbar-panel .toolbar {
    margin-bottom: 8px;
  }

  .plan-lista {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 16px;
  }

  .plan-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #64748b;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
  }

  .plan-card-ok {
    border-left-color: #16a34a;
  }

  .plan-card-proxima {
    border-left-color: #f59e0b;
    background: #fffbeb;
  }

  .plan-card-vencida {
    border-left-color: #dc2626;
    background: #fef2f2;
  }

  .plan-card-faltan {
    border-left-color: #64748b;
    background: #f8fafc;
  }

  .plan-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .plan-card-header strong {
    display: block;
    color: #0f172a;
    font-size: 16px;
  }

  .plan-card-header small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    line-height: 1.3;
  }

  .plan-card-mantencion {
    color: #0f172a;
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 12px;
  }

  .plan-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    color: #475569;
    font-size: 12px;
    margin-bottom: 12px;
  }

  .plan-card-lecturas {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  .plan-card-lecturas div,
  .plan-card-footer div {
    background: rgba(255,255,255,0.78);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 9px;
  }

  .plan-card-lecturas span,
  .plan-card-footer span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .plan-card-lecturas strong,
  .plan-card-footer strong {
    color: #0f172a;
    font-size: 14px;
  }

  .plan-card-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  .plan-barra-info {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
  }

  .plan-barra {
    height: 9px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
  }

  .plan-barra div {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #f59e0b, #dc2626);
    border-radius: 999px;
  }

  @media (max-width: 1100px) {
    .plan-kpi-grid {
      grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .plan-lista {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 620px) {
    .plan-hero {
      flex-direction: column;
    }

    .plan-hero h1 {
      font-size: 26px;
    }

    .plan-kpi-grid {
      grid-template-columns: 1fr;
    }

    .plan-card-meta,
    .plan-card-lecturas,
    .plan-card-footer {
      grid-template-columns: 1fr;
    }
  }
  /* ===================== FIN MANTENCIÓN / PLAN DE MANTENCIÓN - VISUAL PREMIUM ===================== */
  /* =========================================================
    MANTENCIÓN / ALERTAS - VISUAL PREMIUM
  ========================================================= */
  .alertas-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 24px;
    border-radius: 26px;
    margin-bottom: 20px;
    background:
      radial-gradient(circle at top left, rgba(220,38,38,0.30), transparent 35%),
      linear-gradient(135deg, #020617 0%, #0f172a 45%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(15,23,42,0.24);
  }

  .alertas-hero h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.1;
  }

  .alertas-hero p {
    margin: 10px 0 0 0;
    color: #fecaca;
    max-width: 780px;
    font-size: 15px;
  }

  .alertas-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .alertas-hero-actions button {
    border-radius: 999px;
    font-weight: 800;
  }

  .alertas-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }

  .alertas-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px;
    min-height: 126px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
    position: relative;
    overflow: hidden;
  }

  .alertas-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: #0f172a;
  }

  .alertas-kpi-card span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    margin-bottom: 10px;
  }

  .alertas-kpi-card strong {
    display: block;
    font-size: 34px;
    color: #0f172a;
    line-height: 1.05;
  }

  .alertas-kpi-card small {
    display: block;
    margin-top: 9px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
  }

  .alertas-kpi-dark::before { background: #0f172a; }
  .alertas-kpi-red::before { background: #dc2626; }
  .alertas-kpi-yellow::before { background: #f59e0b; }
  .alertas-kpi-blue::before { background: #2563eb; }

  .alertas-toolbar-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #dc2626;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
  }

  .alertas-toolbar-panel .toolbar {
    margin-bottom: 8px;
  }

  .alertas-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
    gap: 18px;
    align-items: start;
  }

  .alertas-panel-principal,
  .alertas-panel-info {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #dc2626;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
  }

  .alertas-panel-info {
    border-left-color: #0f172a;
  }

  .alertas-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .alertas-panel-header h3,
  .alertas-panel-info h3 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
  }

  .alertas-panel-header p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 13px;
  }

  .alertas-lista {
    display: grid;
    gap: 12px;
  }

  .alertas-card {
    border: 1px solid #e2e8f0;
    border-left: 6px solid #64748b;
    border-radius: 18px;
    padding: 14px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15,23,42,0.06);
  }

  .alertas-card-alta {
    border-left-color: #dc2626;
    background: #fef2f2;
  }

  .alertas-card-media {
    border-left-color: #f59e0b;
    background: #fffbeb;
  }

  .alertas-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .alertas-card-top strong {
    display: block;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.25;
  }

  .alertas-tipo {
    display: inline-block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  .alertas-prioridad {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
  }

  .alertas-prioridad.alta {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
  }

  .alertas-prioridad.media {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #facc15;
  }

  .alertas-card-detalle {
    color: #334155;
    line-height: 1.45;
    margin-bottom: 12px;
  }

  .alertas-card-footer {
    background: rgba(255,255,255,0.72);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
  }

  .alertas-card-footer span {
    display: block;
    font-size: 10px;
    color: #64748b;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .alertas-card-footer strong {
    color: #0f172a;
    font-size: 13px;
  }

  .alertas-info-card {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-top: 12px;
  }

  .alertas-info-card strong {
    color: #0f172a;
  }

  .alertas-info-card p {
    margin: 6px 0 0 0;
    color: #64748b;
    line-height: 1.4;
    font-size: 13px;
  }

  .alertas-info-card.alta {
    background: #fef2f2;
    border-left: 5px solid #dc2626;
  }

  .alertas-info-card.media {
    background: #fffbeb;
    border-left: 5px solid #f59e0b;
  }

  .alertas-info-card.neutra {
    background: #f8fafc;
    border-left: 5px solid #0f172a;
  }

  .alertas-empty {
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-weight: 700;
  }

  .alertas-empty.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
  }

  @media (max-width: 1100px) {
    .alertas-layout {
      grid-template-columns: 1fr;
    }

    .alertas-kpi-grid {
      grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
  }

  @media (max-width: 620px) {
    .alertas-hero {
      flex-direction: column;
    }

    .alertas-hero h1 {
      font-size: 26px;
    }

    .alertas-kpi-grid {
      grid-template-columns: 1fr;
    }
  }
  /* ===================== FIN MANTENCIÓN / ALERTAS - VISUAL PREMIUM ===================== */
  /* =========================================================
    MANTENCIÓN / TRAZABILIDAD - VISUAL PREMIUM
  ========================================================= */
  .trz-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 24px;
    border-radius: 26px;
    margin-bottom: 20px;
    background:
      radial-gradient(circle at top left, rgba(14,165,233,0.30), transparent 35%),
      linear-gradient(135deg, #020617 0%, #0f172a 45%, #0369a1 100%);
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(15,23,42,0.24);
  }

  .trz-hero h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.1;
  }

  .trz-hero p {
    margin: 10px 0 0 0;
    color: #bae6fd;
    max-width: 780px;
    font-size: 15px;
  }

  .trz-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .trz-hero-actions button {
    border-radius: 999px;
    font-weight: 800;
  }

  .trz-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }

  .trz-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px;
    min-height: 126px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
    position: relative;
    overflow: hidden;
  }

  .trz-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: #0369a1;
  }

  .trz-kpi-card span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    margin-bottom: 10px;
  }

  .trz-kpi-card strong {
    display: block;
    font-size: 32px;
    color: #0f172a;
    line-height: 1.05;
    word-break: break-word;
  }

  .trz-kpi-card small {
    display: block;
    margin-top: 9px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
  }

  .trz-blue::before { background: #2563eb; }
  .trz-green::before { background: #16a34a; }
  .trz-orange::before { background: #f97316; }
  .trz-purple::before { background: #7c3aed; }
  .trz-dark::before { background: #0f172a; }

  .trz-toolbar-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #0369a1;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
  }

  .trz-toolbar-panel .toolbar {
    margin-bottom: 8px;
  }

  .trz-grid-principal {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
    gap: 18px;
    align-items: start;
  }

  .trz-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #0369a1;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
    margin-bottom: 18px;
  }

  .trz-panel-info {
    border-left-color: #0f172a;
  }

  .trz-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }

  .trz-panel-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
  }

  .trz-panel-header p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 13px;
  }

  .trz-table-wrap {
    box-shadow: none;
    border: 1px solid #e2e8f0;
    max-height: 520px;
  }

  .trz-table {
    min-width: 760px;
  }

  .trz-pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
  }

  .trz-pill-green {
    background: #dcfce7;
    color: #166534;
  }

  .trz-pill-orange {
    background: #ffedd5;
    color: #9a3412;
  }

  .trz-pill-purple {
    background: #f5f3ff;
    color: #6d28d9;
  }

  .trz-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .trz-info-grid div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
  }

  .trz-info-grid strong {
    display: block;
    color: #0f172a;
    margin-bottom: 6px;
  }

  .trz-info-grid span {
    display: block;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
  }

  @media (max-width: 1200px) {
    .trz-kpi-grid {
      grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .trz-grid-principal,
    .trz-info-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 620px) {
    .trz-hero {
      flex-direction: column;
    }

    .trz-hero h1 {
      font-size: 26px;
    }

    .trz-kpi-grid {
      grid-template-columns: 1fr;
    }
  }
  /* ===================== FIN MANTENCIÓN / TRAZABILIDAD - VISUAL PREMIUM ===================== */
  /* =========================================================
    COMBUSTIBLES / ALERTAS - REVISIÓN
  ========================================================= */
  .cmb-alertas-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.4fr);
    gap: 16px;
    align-items: start;
  }

  .cmb-alertas-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #f97316;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 22px rgba(15,23,42,0.08);
  }

  .cmb-alertas-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .cmb-alertas-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
  }

  .cmb-alertas-header p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 13px;
  }

  .cmb-alertas-lista {
    display: grid;
    gap: 12px;
    max-height: 660px;
    overflow-y: auto;
    padding-right: 4px;
  }

  .cmb-alerta-card {
    border: 1px solid #e2e8f0;
    border-left: 6px solid #f59e0b;
    border-radius: 18px;
    padding: 14px;
    background: #fffbeb;
    box-shadow: 0 6px 16px rgba(15,23,42,0.06);
  }

  .cmb-alerta-card.alta {
    border-left-color: #dc2626;
    background: #fef2f2;
  }

  .cmb-alerta-card.media {
    border-left-color: #f59e0b;
    background: #fffbeb;
  }

  .cmb-alerta-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .cmb-alerta-top strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.3;
  }

  .cmb-alerta-top span {
    display: block;
    margin-top: 5px;
    color: #475569;
    font-size: 12px;
    line-height: 1.35;
  }

  .cmb-alerta-top em {
    font-style: normal;
    padding: 6px 9px;
    border-radius: 999px;
    background: #0f172a;
    color: white;
    font-size: 11px;
    font-weight: 900;
  }

  .cmb-alerta-meta {
    display: grid;
    gap: 5px;
    margin-bottom: 10px;
    color: #475569;
    font-size: 12px;
  }

  .cmb-alerta-meta strong {
    color: #0f172a;
  }

  .cmb-alerta-vacia {
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-weight: 700;
  }

  .btn-mini {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 999px;
    margin-left: 8px;
  }

  @media (max-width: 1100px) {
    .cmb-alertas-layout {
      grid-template-columns: 1fr;
    }

    .cmb-alertas-lista {
      max-height: none;
    }
  }
  /* ===================== FIN COMBUSTIBLES / ALERTAS - REVISIÓN ===================== */
  /* =========================================================
    SISTEMA / AVISO SINCRONIZACIÓN MULTIUSUARIO
  ========================================================= */
  .aviso-sync-sistema {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 12000;
    width: min(520px, calc(100vw - 32px));
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-left: 6px solid #2563eb;
    box-shadow: 0 16px 36px rgba(15,23,42,0.20);
  }

  .aviso-sync-texto {
    flex: 1;
    min-width: 220px;
    color: #334155;
    font-size: 13px;
    line-height: 1.4;
  }

  .aviso-sync-texto strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
    margin-bottom: 3px;
  }

  .aviso-sync-sistema button {
    white-space: nowrap;
  }
  /* ===================== FIN SISTEMA / AVISO SINCRONIZACIÓN ===================== */
  /* =========================================================
    AUDITORÍA VISUAL GLOBAL / CAPA CONSOLIDADA
  ========================================================= */
  body {
    font-size: 14px;
    line-height: 1.45;
  }

  .section-title {
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0;
  }

  .panel,
  .card,
  .ot-box,
  .trz-panel,
  .dash-compact-panel,
  .cmb-alertas-panel {
    border: 1px solid #e2e8f0;
  }

  .panel {
    border-left: 5px solid var(--azul-1);
  }

  .card,
  .dash-exec-card {
    min-width: 0;
  }

  .toolbar {
    align-items: flex-end;
  }

  .campo-con-label,
  .ux-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
  }

  .toolbar .campo-con-label,
  .toolbar .ux-field {
    flex: 1 1 180px;
    margin-bottom: 0;
  }

  .campo-con-label label,
  .ux-field label {
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
  }

  .login-box .ux-field label {
    color: #e2e8f0;
  }

  .campo-con-label label.obligatorio,
  .ux-field label.obligatorio {
    color: #0f172a;
  }

  .login-box .ux-field label.obligatorio {
    color: #ffffff;
  }

  input,
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    color: #0f172a;
    border-color: #cbd5e1;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: auto;
    min-width: auto;
  }

  td input,
  td select,
  td textarea {
    width: auto;
    max-width: 100%;
    min-width: 120px;
  }

  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  button:focus-visible {
    outline: 3px solid rgba(37,99,235,0.22);
    outline-offset: 2px;
    border-color: #2563eb;
  }

  button,
  .btn-primary,
  .btn-secondary,
  .btn-success,
  .btn-danger,
  .btn-print {
    min-height: 38px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0;
  }

  .btn-secondary {
    background: #334155;
  }

  .btn-danger {
    background: #b91c1c;
  }

  .btn-success {
    background: #15803d;
  }

  .acciones-admin {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }

  .acciones-admin button,
  .acciones-admin select {
    min-width: auto;
    width: auto;
    padding: 8px 10px;
  }

  .table-wrap {
    border: 1px solid #e2e8f0;
  }

  th {
    z-index: 10;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
  }

  td {
    color: #1f2937;
    line-height: 1.35;
  }

  .estado {
    border: 1px solid transparent;
    line-height: 1.1;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .estado.aldia,
  .estado.verde {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
  }

  .estado.proxima,
  .estado.amarillo {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
  }

  .estado.vencida,
  .estado.rojo {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
  }

  .estado.faltan {
    background: #e5e7eb;
    color: #374151;
    border-color: #cbd5e1;
  }

  .mensaje {
    min-height: 20px;
    line-height: 1.35;
  }

  .mensaje.ok,
  .mensaje.error,
  .mensaje.cargando,
  .fila-cargando td,
  .alerta {
    border-radius: 12px;
  }

  .modal-overlay.activo {
    align-items: flex-start;
    overflow-y: auto;
  }

  .modal-box {
    margin: 20px auto;
    border: 1px solid #e2e8f0;
  }

  .modal-box h3 {
    line-height: 1.2;
  }

  .operaciones-placeholder {
    max-width: 920px;
    border-left-color: #64748b;
  }

  .operaciones-placeholder h3 {
    margin-bottom: 8px;
  }

  .operaciones-placeholder p {
    margin: 0;
    color: #475569;
  }

  .operaciones-estado {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    font-size: 12px;
    font-weight: 800;
  }

  @media (max-width: 1366px) {
    .content {
      padding: 18px;
    }

    .section-title {
      font-size: 24px;
    }

    .panel,
    .card {
      padding: 16px;
    }

    th,
    td {
      padding: 10px;
    }
  }

  @media (max-width: 1024px) {
    .toolbar .campo-con-label,
    .toolbar .ux-field {
      min-width: 160px;
    }

    .table-wrap {
      max-height: 70vh;
    }

    .modal-box {
      width: 96vw;
      padding: 16px;
    }
  }

  @media (max-width: 640px) {
    .content {
      padding: 12px;
    }

    .toolbar {
      gap: 10px;
    }

    .toolbar button {
      flex: 1 1 auto;
    }

    .login-box {
      padding: 24px;
    }
  }

  /* R6-C: scanner HID y gestión acotada de códigos de producto. */
  .barra-acciones-inventario {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
  }

  .barra-acciones-inventario button { font-weight: 700; }

  .consola-inventario-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, .85fr);
    gap: 16px;
    align-items: start;
  }

  .panel-codigo-barra-inventario,
  .contexto-asociacion-codigo,
  .ficha-codigos-producto,
  .confirmacion-duplicados-producto {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
  }

  .panel-codigo-barra-inventario {
    border-left-color: var(--success);
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  }

  .cabecera-codigo-barra-inventario {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
  }

  .cabecera-codigo-barra-inventario p {
    margin: -6px 0 0;
    color: #64748b;
    font-size: 14px;
  }

  .captura-codigo-barra-inventario { min-width: min(100%, 480px); }
  .captura-codigo-barra-inventario label { display:block; color:#334155; font-size:13px; font-weight:800; margin-bottom:6px; }

  .controles-codigo-barra-inventario,
  .acciones-resultado-codigo-barra,
  .acciones-fila-codigo {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }

  .controles-codigo-barra-inventario input {
    flex: 1 1 320px;
    border: 2px solid #16a34a;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .02em;
  }

  .resultado-codigo-barra-inventario {
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    background: #ffffff;
  }

  .resultado-codigo-barra-inventario.encontrado { border-color: #16a34a; background: #f0fdf4; }
  .resultado-codigo-barra-inventario.advertencia { border-color: #d97706; background: #fffbeb; }
  .resultado-codigo-barra-inventario.error { border-color: #dc2626; background: #fef2f2; }
  .resultado-codigo-barra-inventario.cargando { border-color: #2563eb; background: #eff6ff; }

  .cabecera-resultado-codigo-barra,
  .resumen-asociacion-codigo {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }

  .titulo-resultado-codigo-barra { font-size:18px; font-weight:900; }

  .estado-stock-operativo { padding:6px 10px; border-radius:999px; font-size:12px; font-weight:900; white-space:nowrap; }
  .estado-stock-operativo.ok { background:#dcfce7; color:#166534; }
  .estado-stock-operativo.bajo { background:#fef3c7; color:#92400e; }
  .estado-stock-operativo.cero { background:#fee2e2; color:#991b1b; }

  .datos-resultado-codigo-barra,
  .campos-asociacion-codigo,
  .fila-codigo-producto-editor {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin: 12px 0;
  }

  .dato-resultado-codigo-barra,
  .codigo-producto-item {
    padding: 9px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
  }

  .dato-resultado-codigo-barra span,
  .codigo-producto-item small,
  .tabla-gestion-codigos small {
    display: block;
    color: #64748b;
  }

  .dato-resultado-codigo-barra.stock-destacado strong { font-size:28px; line-height:1; }
  .dato-resultado-codigo-barra.stock-bajo { border-color:#f59e0b; background:#fffbeb; }
  .dato-resultado-codigo-barra.stock-cero { border-color:#ef4444; background:#fef2f2; }

  .panel-actividad-inventario { border-left-color:#64748b; }
  .cabecera-actividad-inventario { display:flex; justify-content:space-between; gap:8px; align-items:center; margin-bottom:10px; }
  .cabecera-actividad-inventario h3 { margin:0; font-size:17px; }
  .lista-actividad-inventario { display:grid; gap:8px; }
  .movimiento-reciente-inventario { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:8px; align-items:center; padding:9px; border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; font-size:12px; }
  .movimiento-reciente-inventario strong,.movimiento-reciente-inventario small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .movimiento-reciente-inventario small { margin-top:2px; color:#64748b; }
  .cantidad-movimiento-reciente { color:#0f172a; font-size:14px; font-weight:900; white-space:nowrap; }

  .codigo-producto-automatico {
    border-color:#93c5fd;
    background:#eff6ff;
    color:#1e3a8a;
    font-weight:800;
  }

  .modal-box.modal-producto-inventario { width:min(1180px,96vw); padding:0; overflow:hidden; }
  .cabecera-modal-producto-inventario { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; padding:18px 20px 14px; border-bottom:1px solid #e2e8f0; }
  .cabecera-modal-producto-inventario h3 { margin:0; }
  .cabecera-modal-producto-inventario p { margin:4px 0 0; color:#64748b; font-size:13px; }
  .cuerpo-modal-producto-inventario { max-height:calc(90vh - 138px); overflow-y:auto; padding:0 20px 18px; }
  .seccion-form-producto { padding:17px 0; border-bottom:1px solid #e2e8f0; }
  .seccion-form-producto:last-of-type { border-bottom:0; }
  .seccion-form-producto h4 { margin:0 0 12px; color:#0f172a; font-size:15px; }
  .seccion-form-producto .grid-form { grid-template-columns:repeat(3,minmax(180px,1fr)); }
  .acciones-codigos-producto { display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin-top:10px; }
  .opcion-generar-codigo-interno { display:flex; align-items:center; gap:7px; font-weight:700; color:#334155; }
  .opcion-generar-codigo-interno input { min-width:auto; width:auto; }
  .codigos-producto-edicion { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:8px; }
  .pie-modal-producto-inventario { position:sticky; bottom:0; display:flex; gap:8px; align-items:center; padding:12px 20px; border-top:1px solid #e2e8f0; background:#fff; }
  .pie-modal-producto-inventario .mensaje { flex:1; margin:0; }

  .control-deteccion-tipo-codigo { min-width:0; display:grid; align-content:end; gap:4px; }
  .indicador-tipo-codigo { min-height:38px; padding:7px 9px; border:1px solid #bbf7d0; border-radius:7px; background:#f0fdf4; color:#166534; font-size:12px; line-height:1.25; }
  .indicador-tipo-codigo strong,.indicador-tipo-codigo span { display:block; overflow-wrap:anywhere; }
  .indicador-tipo-codigo.revisar { border-color:#fcd34d; background:#fffbeb; color:#92400e; }
  .indicador-tipo-codigo.vacio { border-color:#cbd5e1; background:#f8fafc; color:#64748b; }
  .accion-tipo-manual { justify-self:start; padding:0; border:0; background:transparent; color:#1d4ed8; font-size:11px; font-weight:700; cursor:pointer; }
  .selector-tipo-manual select { width:100%; min-width:0; }
  .aviso-codigo-interno { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:10px 0; padding:9px 11px; border-left:4px solid #f59e0b; background:#fffbeb; color:#78350f; font-size:13px; }
  .posible-duplicado-producto { padding:10px; border:1px solid #fcd34d; border-radius:8px; background:#fff; }
  .posible-duplicado-producto strong,.posible-duplicado-producto small { display:block; }
  .posible-duplicado-producto small { margin-top:3px; color:#64748b; }

  .lista-codigos-producto-editor,
  .lista-posibles-duplicados {
    display: grid;
    gap: 10px;
    margin-top: 10px;
  }

  .observacion-codigo-producto { grid-column: 1 / -1; }
  .control-principal-codigo { align-self: center; }

  .tabla-gestion-codigos { width: 100%; }
  .tabla-gestion-codigos td small { margin-top: 4px; }
  .estado-gestion-codigo { display: inline-block; margin: 2px; padding: 3px 7px; border-radius: 999px; background: #e2e8f0; font-size: 11px; font-weight: 800; }
  .estado-gestion-codigo.activo,
  .estado-gestion-codigo.principal { background: #dcfce7; color: #166534; }
  .estado-gestion-codigo.inactivo { background: #fee2e2; color: #991b1b; }

  .editor-gestion-codigos {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
  }

  @media (max-width: 640px) {
    .controles-codigo-barra-inventario > * { flex: 1 1 100%; }
    .datos-resultado-codigo-barra,
    .campos-asociacion-codigo,
    .fila-codigo-producto-editor { grid-template-columns: 1fr; }
    .cabecera-modal-producto-inventario,.pie-modal-producto-inventario { padding-left:14px; padding-right:14px; }
    .cuerpo-modal-producto-inventario { padding-left:14px; padding-right:14px; }
    .seccion-form-producto .grid-form { grid-template-columns:1fr; }
    .pie-modal-producto-inventario { flex-wrap:wrap; }
    .pie-modal-producto-inventario .mensaje { flex-basis:100%; order:-1; }
  }

  @media (max-width: 900px) {
    .consola-inventario-grid { grid-template-columns:1fr; }
    .cabecera-codigo-barra-inventario { align-items:stretch; flex-direction:column; }
    .seccion-form-producto .grid-form { grid-template-columns:repeat(2,minmax(160px,1fr)); }
  }

  /* =========================================================
     R6-C3 / COMPOSICIÓN LOCAL DE INVENTARIO
     No depende del responsive ni de los modales globales R7.
  ========================================================= */
  .form-asociacion-codigo-inventario { width:100%; }
  .cabecera-asociacion-codigo { margin-bottom:14px; }
  .cabecera-asociacion-codigo h4 { margin:0; color:#0f172a; font-size:18px; }
  .cabecera-asociacion-codigo p { margin:4px 0 0; color:#64748b; font-size:13px; }
  .resumen-asociacion-codigo {
    display:grid;
    grid-template-columns:minmax(220px,.8fr) minmax(360px,1.7fr);
    gap:12px;
    margin-bottom:14px;
  }
  .tarjeta-asociacion-codigo {
    min-width:0;
    padding:14px;
    border:1px solid #bfdbfe;
    border-radius:12px;
    background:#fff;
  }
  .tarjeta-asociacion-codigo > small {
    display:block;
    margin-bottom:8px;
    color:#475569;
    font-size:11px;
    font-weight:900;
    letter-spacing:.06em;
  }
  .valor-codigo-capturado {
    display:block;
    overflow-wrap:anywhere;
    color:#0f172a;
    font-size:20px;
    line-height:1.2;
  }
  .tipo-codigo-capturado { margin:8px 0 0; color:#475569; font-size:12px; }
  .producto-destino-cabecera {
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
    margin-bottom:10px;
  }
  .producto-destino-cabecera strong { display:block; color:#0f172a; font-size:16px; }
  .producto-destino-cabecera span { display:block; margin-top:3px; color:#475569; }
  .datos-producto-destino {
    display:grid;
    grid-template-columns:repeat(4,minmax(90px,1fr));
    gap:8px;
  }
  .dato-producto-destino { padding:8px; border-radius:8px; background:#f8fafc; }
  .dato-producto-destino span { display:block; color:#64748b; font-size:11px; font-weight:700; }
  .dato-producto-destino strong { display:block; margin-top:3px; overflow-wrap:anywhere; color:#0f172a; font-size:13px; }
  .configuracion-asociacion-codigo {
    padding:14px;
    border:1px solid #e2e8f0;
    border-radius:12px;
    background:#f8fafc;
  }
  .configuracion-asociacion-codigo h5 { margin:0 0 10px; color:#0f172a; font-size:14px; }
  .configuracion-asociacion-codigo .campos-asociacion-codigo {
    grid-template-columns:minmax(210px,1.1fr) minmax(160px,.8fr) minmax(150px,.65fr) minmax(220px,1.2fr);
    align-items:end;
    margin:0;
  }
  .control-principal-asociacion {
    display:flex;
    min-height:42px;
    align-items:center;
    gap:8px;
    padding:8px 10px;
    border:1px solid #cbd5e1;
    border-radius:8px;
    background:#fff;
    color:#334155;
    font-weight:800;
  }
  .control-principal-asociacion input { width:auto; min-width:auto; }
  .acciones-asociacion-codigo {
    display:flex;
    justify-content:flex-end;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
    margin-top:12px;
  }
  .acciones-asociacion-codigo button { width:auto; min-width:132px; }

  .seccion-form-producto > .descripcion-seccion-producto {
    margin:-6px 0 12px;
    color:#64748b;
    font-size:12px;
  }
  .ficha-codigos-producto .tabla-gestion-codigos th { white-space:nowrap; }

  button.ayuda-contextual-inventario {
    box-sizing:border-box !important;
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    width:15px !important;
    min-width:15px !important;
    max-width:15px !important;
    height:15px !important;
    min-height:15px !important;
    max-height:15px !important;
    margin:0 0 0 4px !important;
    padding:0 !important;
    border:1px solid #94a3b8 !important;
    border-radius:50% !important;
    background:#fff !important;
    color:#475569;
    font-size:10px !important;
    font-weight:800;
    line-height:1 !important;
    vertical-align:middle;
    cursor:help;
  }
  .ayuda-contextual-inventario:hover,
  .ayuda-contextual-inventario:focus,
  .ayuda-contextual-inventario[aria-expanded="true"] { border-color:#2563eb; color:#1d4ed8; outline:none; box-shadow:0 0 0 2px #dbeafe; }
  .tooltip-ayuda-inventario {
    position:fixed;
    z-index:20000;
    width:min(280px,calc(100vw - 24px));
    padding:9px 11px;
    border:1px solid #cbd5e1;
    border-radius:9px;
    background:#0f172a;
    color:#fff;
    box-shadow:0 10px 28px rgba(15,23,42,.24);
    font-size:12px;
    line-height:1.4;
    pointer-events:none;
  }

  @media (max-width: 900px) {
    .resumen-asociacion-codigo { grid-template-columns:1fr; }
    .configuracion-asociacion-codigo .campos-asociacion-codigo { grid-template-columns:repeat(2,minmax(180px,1fr)); }
  }

  @media (max-width: 560px) {
    .datos-producto-destino,
    .configuracion-asociacion-codigo .campos-asociacion-codigo,
    .ficha-seccion-producto .ficha-grid-datos,
    .seccion-form-producto .grid-form { grid-template-columns:1fr; }
    .producto-destino-cabecera { flex-direction:column; }
    .acciones-asociacion-codigo { justify-content:stretch; }
    .acciones-asociacion-codigo button { flex:1 1 100%; }
    .ficha-dato.nombre-producto,
    .ficha-dato.observacion-producto { grid-column:auto; }
  }
  /* ===================== FIN AUDITORÍA VISUAL GLOBAL ===================== */
    .modal-box.modal-etiqueta-inventario { width:min(960px,96vw); padding:0; overflow:hidden; }
    .cabecera-modal-etiqueta { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:16px 18px; border-bottom:1px solid #e2e8f0; }
    .cabecera-modal-etiqueta h3 { margin:0; }
    .cabecera-modal-etiqueta p { margin:4px 0 0; color:#64748b; font-size:13px; }
    .cuerpo-modal-etiqueta { display:grid; grid-template-columns:minmax(230px,300px) minmax(0,1fr); gap:18px; padding:18px; max-height:calc(90vh - 135px); overflow-y:auto; }
    .configuracion-etiqueta { display:grid; align-content:start; gap:12px; }
    .configuracion-etiqueta label { display:grid; gap:5px; margin:0; font-weight:700; color:#334155; }
    .configuracion-etiqueta select,.configuracion-etiqueta input { width:100%; box-sizing:border-box; }
    .resumen-etiquetas-a4 { padding:9px 10px; background:#f8fafc; border:1px solid #cbd5e1; color:#334155; font-size:12px; line-height:1.4; }
    .visor-etiqueta-inventario { min-width:0; padding:16px; background:#e2e8f0; overflow:auto; display:grid; place-items:start center; }
    #hojasImpresionEtiquetaInventario { display:grid; gap:12px; justify-items:center; }
    .hoja-preview-a4 { width:210mm; height:297mm; padding:5mm; box-sizing:border-box; overflow:hidden; background:#fff; border:1px solid #94a3b8; box-shadow:0 8px 22px rgba(15,23,42,.18); }
    .pagina-a4-etiquetas { width:200mm; height:287mm; display:grid; grid-template-columns:repeat(var(--a4-columnas),var(--etiqueta-ancho)); grid-auto-rows:var(--etiqueta-alto); gap:1.5mm; align-content:start; justify-content:center; overflow:hidden; }
    .hoja-preview-etiqueta { width:var(--etiqueta-ancho); height:var(--etiqueta-alto); position:relative; flex:none; overflow:hidden; box-sizing:border-box; background:#fff; color:#000; border:.2mm solid #cbd5e1; }
    #hojasImpresionEtiquetaInventario > .hoja-preview-etiqueta { border:1px solid #94a3b8; box-shadow:0 8px 22px rgba(15,23,42,.18); }
    .etiqueta-inventario { width:100%; height:100%; box-sizing:border-box; padding:1.2mm; overflow:hidden; background:#fff; color:#000; font-family:Arial,sans-serif; display:grid; grid-template-rows:auto auto 1fr auto; gap:.35mm; }
    .etiqueta-marca { font-size:1.9mm; font-weight:900; letter-spacing:0; line-height:1; }
    .etiqueta-producto { min-width:0; }
    .etiqueta-producto strong { display:block; font-size:2.1mm; line-height:1.05; max-height:4.4mm; overflow:hidden; overflow-wrap:anywhere; }
    .etiqueta-producto small { display:block; margin-top:.2mm; font-size:1.45mm; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .etiqueta-barcode { min-height:0; display:grid; align-content:center; }
    .etiqueta-barcode svg { display:block; width:100%; height:7mm; shape-rendering:crispEdges; }
    .etiqueta-valor { margin-top:.2mm; text-align:center; font:700 1.7mm/1 monospace; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .etiqueta-pie { min-width:0; font-size:1.4mm; line-height:1.1; display:grid; grid-template-columns:1fr 1fr; gap:.8mm; }
    .etiqueta-pie span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .pie-modal-etiqueta { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:12px 18px; border-top:1px solid #e2e8f0; }
    .formato-45x25 .etiqueta-inventario { padding:1.3mm; gap:.4mm; }
    .formato-45x25 .etiqueta-marca { font-size:2.1mm; }
    .formato-45x25 .etiqueta-producto strong { font-size:2.3mm; max-height:4.8mm; }
    .formato-45x25 .etiqueta-producto small { font-size:1.6mm; }
    .formato-45x25 .etiqueta-barcode svg { height:8.2mm; }
    .formato-45x25 .etiqueta-valor { font-size:1.7mm; }
    .formato-45x25 .etiqueta-pie { grid-template-columns:1fr; font-size:1.5mm; }
    .formato-50x30 .etiqueta-inventario { padding:1.4mm; gap:.5mm; }
    .formato-50x30 .etiqueta-marca { font-size:2.3mm; }
    .formato-50x30 .etiqueta-producto strong { font-size:2.5mm; max-height:5.2mm; }
    .formato-50x30 .etiqueta-producto small { font-size:1.8mm; }
    .formato-50x30 .etiqueta-barcode svg { height:9mm; }
    .formato-50x30 .etiqueta-valor { font-size:1.9mm; }
    .formato-50x30 .etiqueta-pie { font-size:1.7mm; }
    .formato-70x40 .etiqueta-inventario,.formato-100x50 .etiqueta-inventario { padding:1.8mm; gap:.7mm; }
    .formato-70x40 .etiqueta-marca,.formato-100x50 .etiqueta-marca { font-size:2.8mm; }
    .formato-70x40 .etiqueta-producto strong,.formato-100x50 .etiqueta-producto strong { font-size:3.1mm; max-height:6.6mm; }
    .formato-70x40 .etiqueta-producto small,.formato-100x50 .etiqueta-producto small { font-size:2.2mm; }
    .formato-70x40 .etiqueta-barcode svg,.formato-100x50 .etiqueta-barcode svg { height:11mm; }
    .formato-70x40 .etiqueta-valor,.formato-100x50 .etiqueta-valor { font-size:2.3mm; }
    .formato-70x40 .etiqueta-pie,.formato-100x50 .etiqueta-pie { font-size:2mm; }
    .espacio-etiqueta-vacio { width:var(--etiqueta-ancho); height:var(--etiqueta-alto); box-sizing:border-box; }
    .modal-box.modal-centro-impresion-inventario { width:min(1380px,97vw); max-width:1380px; height:min(94vh,900px); max-height:94vh; padding:0; overflow:hidden; display:flex; flex-direction:column; }
    .cabecera-centro-impresion { display:flex; flex:none; align-items:flex-start; justify-content:space-between; gap:14px; padding:16px 18px; border-bottom:1px solid #cbd5e1; background:#f8fafc; }
    .cabecera-centro-impresion h3,.resumen-centro-impresion h4 { margin:0; color:#0f172a; }
    .cabecera-centro-impresion p { margin:4px 0 0; color:#64748b; font-size:13px; }
    .cuerpo-centro-impresion { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(300px,.75fr); flex:1; min-height:0; overflow:hidden; }
    .seleccion-centro-impresion { min-width:0; min-height:0; padding:16px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; background:#f8fafc; }
    .herramientas-centro-impresion { position:sticky; top:-16px; z-index:2; margin:-16px -16px 14px; padding:14px 16px; border-bottom:1px solid #cbd5e1; background:#fff; }
    .herramientas-centro-impresion label { display:block; margin:0 0 6px; color:#334155; font-weight:700; }
    .herramientas-centro-impresion > div { display:flex; gap:8px; }
    .herramientas-centro-impresion input { min-width:0; flex:1; }
    .lista-centro-impresion { display:grid; gap:10px; }
    .producto-centro-impresion { display:grid; grid-template-columns:auto minmax(180px,1fr) minmax(220px,.9fr) 110px; align-items:center; gap:12px; padding:13px; border:1px solid #cbd5e1; border-radius:10px; background:#fff; box-shadow:0 1px 2px rgba(15,23,42,.05); }
    .producto-centro-impresion.seleccionado { border-color:#2563eb; box-shadow:0 0 0 1px rgba(37,99,235,.18); }
    .producto-centro-impresion.no-imprimible { background:#f8fafc; color:#64748b; }
    .producto-centro-impresion input[type="checkbox"] { width:18px; height:18px; margin:0; }
    .identidad-producto-centro { min-width:0; }
    .identidad-producto-centro strong,.identidad-producto-centro span,.identidad-producto-centro small { display:block; overflow-wrap:anywhere; }
    .identidad-producto-centro strong { color:#0f172a; }
    .identidad-producto-centro span { margin-top:3px; color:#334155; }
    .identidad-producto-centro small { margin-top:3px; color:#64748b; }
    .campo-producto-centro { display:grid; gap:4px; min-width:0; margin:0; color:#475569; font-size:12px; font-weight:700; }
    .campo-producto-centro select,.campo-producto-centro input { min-width:0; width:100%; box-sizing:border-box; }
    .estado-producto-centro { display:inline-block; width:max-content; max-width:100%; margin-top:5px; padding:3px 7px; border-radius:999px; background:#dcfce7; color:#166534; font-size:11px; font-style:normal; font-weight:800; }
    .estado-producto-centro.sin-codigo { background:#e2e8f0; color:#475569; }
    .configuracion-centro-impresion { min-width:0; min-height:0; padding:16px; border-left:1px solid #cbd5e1; overflow-x:hidden; overflow-y:auto; background:#fff; display:grid; align-content:start; gap:14px; }
    .configuracion-centro-impresion > label { display:grid; gap:5px; margin:0; color:#334155; font-weight:700; }
    .configuracion-centro-impresion select,.configuracion-centro-impresion input { width:100%; box-sizing:border-box; }
    .configuracion-centro-impresion small { color:#64748b; font-weight:400; }
    .resumen-centro-impresion { padding:13px; border:1px solid #bfdbfe; border-radius:10px; background:#eff6ff; }
    .metricas-centro-impresion { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:10px; }
    .metricas-centro-impresion span { padding:8px; border-radius:7px; background:#fff; color:#475569; font-size:12px; }
    .metricas-centro-impresion strong { display:block; color:#0f172a; font-size:18px; }
    .acciones-centro-impresion { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
    .preview-centro-impresion { min-height:180px; padding:12px; border:1px dashed #94a3b8; border-radius:10px; background:#f8fafc; overflow:auto; }
    .cabecera-preview-centro { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; color:#334155; font-size:12px; }
    .minihoja-centro-impresion { display:grid; grid-template-columns:repeat(var(--mini-columnas),minmax(0,1fr)); grid-template-rows:repeat(var(--mini-filas),minmax(0,1fr)); gap:2px; aspect-ratio:210/297; padding:4px; border:1px solid #94a3b8; background:#fff; box-shadow:0 3px 8px rgba(15,23,42,.12); overflow:hidden; }
    .mini-etiqueta-centro,.mini-espacio-centro { min-width:0; overflow:hidden; border:1px solid #cbd5e1; background:#fff; color:#0f172a; font-size:7px; line-height:1.05; padding:2px; }
    .mini-espacio-centro { border-style:dashed; background:#f1f5f9; }
    .mini-espacio-centro.disponible { background:#fff; border-color:#e2e8f0; }
    .mini-etiqueta-centro strong,.mini-etiqueta-centro span { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
    .detalle-preview-centro { margin-top:10px; color:#475569; font-size:12px; line-height:1.45; }
    .detalle-preview-centro ul { margin:6px 0 0; padding-left:18px; }
    .documento-centro-impresion { display:none; }
    @media (max-width:700px) {
      .campos-editor-gestion-codigos { grid-template-columns:1fr; }
      .tabla-gestion-codigos thead { display:none; }
      .tabla-gestion-codigos,.tabla-gestion-codigos tbody,.tabla-gestion-codigos tr,.tabla-gestion-codigos td { display:block; width:100%; box-sizing:border-box; }
      .tabla-gestion-codigos tr { padding:10px 0; border-bottom:1px solid #cbd5e1; }
      .tabla-gestion-codigos td { border:0; padding:5px 0; }
      .tabla-gestion-codigos td::before { content:attr(data-label); display:block; color:#64748b; font-size:11px; font-weight:700; margin-bottom:3px; }
      .acciones-gestion-codigos { width:100%; justify-content:flex-start; }
      .cuerpo-modal-etiqueta { grid-template-columns:1fr; }
      .visor-etiqueta-inventario { min-height:260px; }
    }
    @media (max-width:900px) {
      .modal-box.modal-centro-impresion-inventario { width:100%; max-width:none; height:calc(100vh - 40px); height:calc(100dvh - 40px); max-height:calc(100vh - 40px); max-height:calc(100dvh - 40px); margin:0; border-radius:0; }
      .cuerpo-centro-impresion { grid-template-columns:1fr; min-height:0; overflow-x:hidden; overflow-y:auto; }
      .seleccion-centro-impresion,.configuracion-centro-impresion { overflow:visible; }
      .configuracion-centro-impresion { border-left:0; border-top:1px solid #cbd5e1; }
      .producto-centro-impresion { grid-template-columns:auto minmax(0,1fr); }
      .producto-centro-impresion .campo-producto-centro { grid-column:2; }
      .herramientas-centro-impresion > div { flex-direction:column; }
    }

    @media print {
      body.impresion-etiquetas-activa * { visibility:hidden!important; }
      body.impresion-etiquetas-activa #modalEtiquetaInventario,
      body.impresion-etiquetas-activa #modalEtiquetaInventario * { visibility:visible!important; }
      body.impresion-etiquetas-activa #modalEtiquetaInventario { display:block!important; position:absolute; inset:0; padding:0; background:#fff; overflow:visible; }
      body.impresion-etiquetas-activa .modal-etiqueta-inventario { width:auto; max-width:none; max-height:none; padding:0; overflow:visible; box-shadow:none; border:0; }
      body.impresion-etiquetas-activa .cabecera-modal-etiqueta,
      body.impresion-etiquetas-activa .configuracion-etiqueta,
      body.impresion-etiquetas-activa .pie-modal-etiqueta { display:none!important; }
      body.impresion-etiquetas-activa .cuerpo-modal-etiqueta,
      body.impresion-etiquetas-activa .visor-etiqueta-inventario,
      body.impresion-etiquetas-activa #hojasImpresionEtiquetaInventario { display:block!important; margin:0; padding:0; background:#fff; overflow:visible; }
      body.impresion-etiquetas-activa .hoja-preview-etiqueta { border:0; box-shadow:none; margin:0; }
      body.impresion-etiquetas-activa .etiqueta-inventario { margin:0; }
      body.impresion-etiquetas-activa .hoja-preview-a4,
      body.impresion-etiquetas-activa .hoja-preview-etiqueta { page-break-inside:avoid; break-inside:avoid; }
      body.impresion-etiquetas-activa.modo-impresion-a4 .hoja-preview-a4 { width:200mm; height:287mm; padding:0; border:0; box-shadow:none; margin:0; page-break-after:always; break-after:page; }
      body.impresion-etiquetas-activa.modo-impresion-a4 .hoja-preview-a4:last-child { page-break-after:auto; break-after:auto; }
      body.impresion-etiquetas-activa.modo-impresion-a4 .pagina-a4-etiquetas { width:200mm; height:287mm; }
      body.impresion-etiquetas-activa.modo-impresion-individual #hojasImpresionEtiquetaInventario > .hoja-preview-etiqueta { page-break-after:always; break-after:page; }
      body.impresion-etiquetas-activa.modo-impresion-individual #hojasImpresionEtiquetaInventario > .hoja-preview-etiqueta:last-child { page-break-after:auto; break-after:auto; }
      body.impresion-centro-etiquetas-activa * { visibility:hidden!important; }
      body.impresion-centro-etiquetas-activa #modalCentroImpresionInventario,
      body.impresion-centro-etiquetas-activa #modalCentroImpresionInventario *,
      body.impresion-centro-etiquetas-activa #documentoImpresionCentroInventario,
      body.impresion-centro-etiquetas-activa #documentoImpresionCentroInventario * { visibility:visible!important; }
      body.impresion-centro-etiquetas-activa #modalCentroImpresionInventario { display:block!important; position:absolute; inset:0; padding:0; background:#fff; overflow:visible; }
      body.impresion-centro-etiquetas-activa .modal-centro-impresion-inventario { width:auto; max-width:none; max-height:none; padding:0; overflow:visible; box-shadow:none; border:0; }
      body.impresion-centro-etiquetas-activa .cabecera-centro-impresion,
      body.impresion-centro-etiquetas-activa .cuerpo-centro-impresion { display:none!important; }
      body.impresion-centro-etiquetas-activa #documentoImpresionCentroInventario { display:block!important; position:absolute; inset:0; margin:0; padding:0; background:#fff; overflow:visible; }
      body.impresion-centro-etiquetas-activa .hoja-preview-a4 { width:200mm; height:287mm; padding:0; border:0; box-shadow:none; margin:0; page-break-after:always; break-after:page; page-break-inside:avoid; break-inside:avoid; }
      body.impresion-centro-etiquetas-activa .hoja-preview-a4:last-child { page-break-after:auto; break-after:auto; }
      body.impresion-centro-etiquetas-activa .pagina-a4-etiquetas { width:200mm; height:287mm; }
      body.impresion-centro-etiquetas-activa .hoja-preview-etiqueta { border:0; box-shadow:none; margin:0; }
    }
    #documentoImpresionCentroInventario .hoja-preview-a4 { width:var(--papel-ancho,210mm); height:var(--papel-alto,297mm); }
    @media print {
      body.impresion-centro-etiquetas-activa #documentoImpresionCentroInventario .hoja-preview-a4 { width:var(--util-ancho,200mm); height:var(--util-alto,287mm); padding:0; }
    }
/* C4E — lenguaje local de Abastecimiento; no modifica otros módulos. */
.abast-modal .abast-modal-header,.abast-section-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;}
.abast-modal .abast-modal-header{border-bottom:2px solid #dbeafe;padding-bottom:12px;}
.abast-modal-header h3,.abast-section-header h4{margin:0;color:#0f2d52;}
.abast-modal{max-width:680px;max-height:85vh;overflow:auto;}
.abast-modal-body{display:grid;gap:14px;}
.abast-form-label,.abast-modal label,#modalFichaProductoInventario label,#modalProductoInventario label,#movimientosInventario label,#solicitudesAbastecimiento label,#modalProveedorAbastecimiento label{font-weight:600;color:#142f50;}
.abast-field{display:grid;gap:6px;min-width:0;}
.abast-field[hidden],.abast-modal [hidden],.abast-combo [hidden]{display:none!important;}
.abast-field input,.abast-field select,.abast-field textarea{width:100%;box-sizing:border-box;}
.abast-actions,#modalFichaProductoInventario .acciones-fila-codigo{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.abast-movimientos-c4n .abast-importe-c4n{min-width:100px;white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums;}
.abast-movimientos-c4n .abast-producto-c4n{min-width:170px;max-width:260px;white-space:normal;overflow-wrap:anywhere;}
.abast-movimientos-c4n td{vertical-align:top;}
.abast-movimientos-c4n .abast-table-actions{min-width:340px;max-width:380px;}
.abast-movimientos-c4n .abast-table-actions button{font-size:12px;padding:6px 10px;}
.abast-modal .ficha-dato strong{overflow-wrap:anywhere;}
#tabFichaPrecios table{min-width:0;width:100%;}
#tabFichaPrecios th,#tabFichaPrecios td{white-space:normal;overflow-wrap:anywhere;}
#tabFichaPrecios .abast-ficha-section:first-child{margin-top:0;padding-top:0;border-top:0;}
#movimientosInventario .abast-movimientos-c4n td:nth-child(5),#movimientosInventario .abast-movimientos-c4n td:nth-child(6),#tabFichaMovimientos .abast-movimientos-c4n td:nth-child(3),#tabFichaMovimientos .abast-movimientos-c4n td:nth-child(4){min-width:65px;white-space:nowrap;}
#inventario .acciones-admin,#proveedoresAbastecimiento .acciones-admin,#solicitudesAbastecimiento .acciones-admin,#modalFichaProductoInventario .acciones-admin{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.abast-actions button,.abast-modal button{width:auto;margin:0;flex:none;}
.abast-table-actions{min-width:180px;}
.abast-modal-footer{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;border-top:1px solid #dbe5f0;padding-top:14px;margin-top:6px;}
.abast-meta{font-size:12px;font-weight:400;color:#526680;line-height:1.5;}
.abast-empty{color:#526680;padding:12px 0;font-size:13px;}
.abast-combo{position:relative;min-width:0;}
.abast-combo-input{width:100%;box-sizing:border-box;}
.abast-combo-resultados{position:absolute;top:100%;left:0;box-sizing:border-box;width:100%;max-height:220px;overflow:auto;z-index:2100;background:#fff;color:#172033;border:1px solid #bdcde0;border-radius:8px;box-shadow:0 5px 14px #0f2d521a;padding:4px;}
.abast-combo .abast-combo-opcion{display:block;width:100%;margin:0;padding:7px 9px;border:0;border-radius:4px;box-shadow:none;background:white;color:#172033;text-align:left;font-size:13px;font-weight:500;line-height:1.35;white-space:normal;}
.abast-combo-opcion small{display:block;color:#526680;font-weight:400;font-size:11px;}
.abast-combo .abast-combo-opcion:hover,.abast-combo .abast-combo-opcion:focus{background:#e8f1ff;color:#103c70;outline:2px solid #93b9e8;outline-offset:-2px;transform:none;}
.abast-ficha-section{border-top:1px solid #dbe5f0;padding-top:18px;margin-top:18px;}
.abast-list-row{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 0;border-bottom:1px solid #e5edf5;font-size:13px;}
.abast-eventos summary{cursor:pointer;font-weight:600;color:#0f2d52;padding:10px 0;}
.abast-eventos p{font-size:12px;margin:8px 0;color:#526680;}
.producto-centro-impresion.abast-centro-producto{display:block;padding:12px 14px;box-shadow:none;}
.abast-centro-producto .identidad-producto-centro{margin-bottom:8px;}
.abast-centro-codigo{display:grid;grid-template-columns:minmax(0,1fr) 76px 30px;align-items:center;gap:12px;padding:7px 0;border-top:1px solid #e5edf5;font-size:13px;}
.abast-centro-codigo input[type=number]{width:76px;min-width:0;margin:0;padding:6px 8px;box-sizing:border-box;}
.abast-centro-codigo input[type=checkbox]{width:18px;height:18px;margin:0;accent-color:#175ca2;}
.abast-centro-codigo.seleccionado{background:#eef6ff;}
  /* R9: composición nueva sobre tokens, botones, tabs, combobox y Loading Golden existentes. */
#centroCostos{min-width:0;max-width:100%}.r9-filtros{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:16px 0}.r9-filtros label{display:flex;flex-direction:column;gap:6px;min-width:0;font-size:12px}.r9-filtros input,.r9-filtros select{width:100%;min-width:0}.r9-acciones{display:flex;gap:8px;flex-wrap:wrap;align-items:end}.r9-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:16px 0}.r9-kpi{background:#fff;border:1px solid #dbe4f0;border-radius:14px;padding:16px;min-width:0}.r9-kpi strong{display:block;font-size:22px;color:#0f172a;overflow-wrap:anywhere}.r9-aviso{padding:12px;border-left:4px solid #f59e0b;background:#fffbeb;border-radius:10px;line-height:1.5;margin:14px 0}.r9-equipo{border:1px solid #dbe4f0;background:#fff;border-radius:14px;margin:10px 0;padding:12px;min-width:0}.r9-equipo summary{cursor:pointer;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;color:#0f172a}.r9-tabla{overflow-x:auto;max-width:100%;min-width:0}.r9-tabla table{width:100%;border-collapse:collapse;white-space:nowrap}.r9-tabla td,.r9-tabla th{padding:10px;border-bottom:1px solid #e2e8f0;text-align:left}.r9-tabla .numero{text-align:right}.r9-ref{font-size:12px;line-height:1.6;overflow-wrap:anywhere}.r9-resumen-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;min-width:0}.r9-resumen-grid>div{min-width:0}#ccTabsR9 button[aria-selected=true]{background:#2563eb;color:white}@media(max-width:768px){.r9-resumen-grid{grid-template-columns:1fr}.r9-filtros{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:420px){.r9-filtros{grid-template-columns:minmax(0,1fr)}.r9-acciones{align-items:center}}

