        :root {
            /* Escala de letras: usar estos 7 tamaños (de más chico a más grande) en vez de inventar uno nuevo */
            --fs-xs: 0.78rem; --fs-sm: 0.85rem; --fs-md: 0.9rem;
            --fs-lg: 1rem; --fs-xl: 1.15rem; --fs-2xl: 1.35rem;
            /* Estaciones: prioridad, posible falla, viajes y fallas confirmadas por el sistema */
            --em-alta: #ef4444; --em-media: #f97316; --em-baja: #eab308; --em-muy-baja: #3b82f6; --em-ok: #22c55e;
            --em-posible: #c084fc; --em-viaje: #38bdf8; --em-sistema: #c084fc; --em-tiempo: #60a5fa; --em-plan: #a78bfa;
            --bg-body: #0b1215;
            --bg-sidebar: #0e171a;
            --bg-surface: #121d21;
            --bg-surface-elevated: #182529;
            --bg-card: rgba(24, 37, 41, 0.7);
            --border-subtle: rgba(255, 255, 255, 0.06);
            --border-hover: rgba(255, 255, 255, 0.14);
            --border-focus: #00ad9a;
            --primary: #00ad9a;
            --on-primary: #04241f;     /* letra sobre el color principal (oscura: blanco sobre este verde no se lee) */
            --primary-glow: rgba(0, 173, 154, 0.22);
            --success: #22c55e;
            --success-glow: rgba(34, 197, 94, 0.2);
            --warning: #f59e0b;
            --warning-glow: rgba(245, 158, 11, 0.2);
            --danger: #f43f5e;
            --danger-glow: rgba(244, 63, 94, 0.2);
            --text-title: #ffffff;
            --text-body: #d3dde0;
            --text-muted: #8a9ca2;
            --text-faint: #7f9197;   /* gris de ayuda: legible (5:1) sobre los fondos oscuros */
            --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;   /* la letra de cada equipo: no se baja de internet */
            --font-mono: 'JetBrains Mono', monospace;
            /* Tema: el oscuro es este; el claro (más abajo) redefine las mismas variables. Para un color nuevo, usar estas variables y no un color fijo */
            color-scheme: dark;
            --tinte: 255, 255, 255;              /* bordes y fondos suaves: rgba(var(--tinte), 0.05) */
            --bg-header: rgba(14, 23, 26, 0.6);
            --bg-panel-fin: #0f181b;
            --velo: rgba(0, 0, 0, 0.8);          /* detrás de las ventanas */
            --velo-login: rgba(0, 0, 0, 0.92);
            /* colores que no cambian con el tema (antes iban escritos en cada regla) */
            --c-ambar: #f59e0b; --c-rojo: #f43f5e; --c-verde: #22c55e; --c-violeta: #a855f7; --c-violeta-osc: #8b5cf6; --c-lila: #a78bfa;
            --c-turquesa: #00ad9a; --c-turquesa-osc: #00796b; --c-tinta: #0b1416; --c-blanco: #fff; --c-negro: #000;
            --sombra: 1;                         /* fuerza de las sombras negras (en claro, más suaves) */
            /* letras de color: el nombre es el tono del tema oscuro; en el claro pasan al tono oscuro de la misma familia */
            --tx-2dd4bf: #2dd4bf; --tx-2fc7b3: #2fc7b3; --tx-34d399: #34d399; --tx-38bdf8: #38bdf8; --tx-4ade80: #4ade80; --tx-5eead4: #5eead4; --tx-60a5fa: #60a5fa; --tx-6fdccd: #6fdccd; --tx-7dd3fc: #7dd3fc; --tx-86efac: #86efac; --tx-93c5fd: #93c5fd; --tx-9aa7b2: #9aa7b2; --tx-a5b4fc: #a5b4fc; --tx-a78bfa: #a78bfa; --tx-a7f3e8: #a7f3e8; --tx-bbf7d0: #bbf7d0; --tx-bfdbfe: #bfdbfe; --tx-c4b5fd: #c4b5fd; --tx-c7d2fe: #c7d2fe; --tx-cbd5e1: #cbd5e1; --tx-d2f5f0: #d2f5f0; --tx-d8b4fe: #d8b4fe; --tx-ddd6fe: #ddd6fe; --tx-e5e7eb: #e5e7eb; --tx-e9d5ff: #e9d5ff; --tx-f59e0b: #f59e0b; --tx-f9a8d4: #f9a8d4; --tx-fb7185: #fb7185; --tx-fb923c: #fb923c; --tx-fbbf24: #fbbf24; --tx-fca5a5: #fca5a5; --tx-fcd34d: #fcd34d; --tx-fda4af: #fda4af; --tx-fdba74: #fdba74; --tx-fde047: #fde047; --tx-fde68a: #fde68a; --tx-fecaca: #fecaca; --tx-fecdd3: #fecdd3; --tx-fef3c7: #fef3c7;
        }
        /* Tema claro: lo pone el script del <head> según lo elegido en «Apariencia» (o el modo del equipo) */
        :root[data-tema="claro"] {
            color-scheme: light;
            --tinte: 11, 18, 21;
            --bg-body: #eef2f2;
            --bg-sidebar: #ffffff;
            --bg-surface: #ffffff;
            --bg-surface-elevated: #f4f7f7;
            --bg-card: #ffffff;
            --bg-header: rgba(255, 255, 255, 0.8);
            --bg-panel-fin: #f8fafa;
            --velo: rgba(11, 18, 21, 0.45);
            --velo-login: #eef2f2;
            --sombra: 0.3;
            --border-subtle: rgba(11, 18, 21, 0.1);
            --border-hover: rgba(11, 18, 21, 0.2);
            --border-focus: #0a6b60;
            --primary: #0a6b60;
            --on-primary: #ffffff;
            --primary-glow: rgba(10, 107, 96, 0.13);
            --success: #12733a;
            --success-glow: rgba(21, 128, 61, 0.12);
            --warning: #b45309;
            --warning-glow: rgba(180, 83, 9, 0.12);
            --danger: #be123c;
            --danger-glow: rgba(190, 18, 60, 0.11);
            --text-title: #0b1215;
            --text-body: #26363b;
            --text-muted: #56676c;
            --text-faint: #5f7075;
            --borde-campo: rgba(11, 18, 21, 0.2);   /* en claro el borde del campo tiene que notarse */
            --tx-2dd4bf: #0a5f55; --tx-2fc7b3: #0a5f55; --tx-34d399: #065f46; --tx-38bdf8: #075985; --tx-4ade80: #166534; --tx-5eead4: #0a5f55; --tx-60a5fa: #1e40af; --tx-6fdccd: #0a5f55; --tx-7dd3fc: #075985; --tx-86efac: #166534; --tx-93c5fd: #1e40af; --tx-9aa7b2: #334155; --tx-a5b4fc: #3730a3; --tx-a78bfa: #5b21b6; --tx-a7f3e8: #0a5f55; --tx-bbf7d0: #166534; --tx-bfdbfe: #1e40af; --tx-c4b5fd: #5b21b6; --tx-c7d2fe: #3730a3; --tx-cbd5e1: #334155; --tx-d2f5f0: #0a5f55; --tx-d8b4fe: #6b21a8; --tx-ddd6fe: #5b21b6; --tx-e5e7eb: #334155; --tx-e9d5ff: #6b21a8; --tx-f59e0b: #92400e; --tx-f9a8d4: #9d174d; --tx-fb7185: #9f1239; --tx-fb923c: #9a3412; --tx-fbbf24: #92400e; --tx-fca5a5: #991b1b; --tx-fcd34d: #92400e; --tx-fda4af: #9f1239; --tx-fdba74: #9a3412; --tx-fde047: #854d0e; --tx-fde68a: #92400e; --tx-fecaca: #991b1b; --tx-fecdd3: #9f1239; --tx-fef3c7: #92400e;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-sans); }
        :where(.view) h3 { font-size: 1em; }   /* los títulos de cada pantalla son h3 (debajo del h2 de arriba) con el tamaño que tenían de h4 */
        body { display: flex; height: 100vh; background-color: var(--bg-body); color: var(--text-body); overflow: hidden; -webkit-font-smoothing: antialiased; }

        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: rgba(var(--tinte), 0.12); border-radius: 4px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(var(--tinte), 0.2); }

        #toast-container { position: fixed; top: 20px; right: 24px; z-index: 10030; display: flex; flex-direction: column; gap: 10px; }
        .toast {
            min-width: 300px; max-width: 460px; padding: 14px 20px; border-radius: 10px; font-size: var(--fs-md); font-weight: 500;
            backdrop-filter: blur(12px); border: 1px solid var(--border-hover);
            box-shadow: 0 16px 36px rgba(0, 0, 0, calc(0.7 * var(--sombra))); display: flex; align-items: center; justify-content: space-between;
            animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }
        .toast-success { background: rgba(20, 83, 45, 0.9); color: #bbf7d0; border-left: 3px solid var(--success); }
        .toast-error { background: rgba(127, 29, 29, 0.9); color: #fecaca; border-left: 3px solid var(--danger); }
        @keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
        .toast.saliendo { animation: toastSale 0.2s ease forwards; }
        @keyframes toastSale { to { opacity: 0; transform: translateX(16px); } }

        aside {
            width: 250px; min-width: 250px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-subtle);
            display: flex; flex-direction: column; padding: 20px 12px; justify-content: space-between; overflow-y: auto;
        }
        .brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 12px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 10px; }
        .brand-icon { width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 0 10px rgba(0, 173, 154, 0.22)); }
        .brand-marca { width: 120px; height: auto; display: block; }
        .brand-text { font-size: 1.62rem; font-weight: 800; color: var(--c-blanco); letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
        .brand-text span { color: var(--tx-6fdccd); }
        .marca { display: inline-block; }
        .brand-tag { font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-cbd5e1); margin-top: 5px; line-height: 1; white-space: nowrap; }
        .login-logo { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 22px; }
        .login-logo .login-marca { width: 300px; max-width: 100%; height: auto; filter: drop-shadow(0 0 18px rgba(0, 173, 154, 0.15)); }
        .login-logo .brand-text { font-size: 2.3rem; }
        .login-logo .brand-tag { font-size: var(--fs-xs); margin-top: 8px; }
        .creditos { font-size: var(--fs-xs); color: var(--text-muted); text-align: center; letter-spacing: 0.02em; }
        .creditos b { color: var(--text-body); font-weight: 600; }

        .nav-list { display: flex; flex-direction: column; gap: 4px; }
        .nav-sep { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); padding: 12px 12px 4px; font-weight: 600; }
        .nav-btn {
            background: transparent; border: 1px solid transparent; color: var(--text-muted); text-align: left;
            padding: 0.5625rem 0.75rem; border-radius: 8px; font-size: var(--fs-md); font-weight: 500;
            cursor: pointer; display: flex; align-items: center; gap: 0.625rem; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s, filter 0.15s, opacity 0.15s;
        }
        /* Íconos de línea (mismo estilo que el menú): toman el color del texto donde están */
        .ico { width: 1.1em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
               vertical-align: -0.2em; flex-shrink: 0; display: inline-block; }
        .btn .ico, .tab .ico { width: 1.05em; height: 1.05em; }
        /* campo de contraseña con botón para verla */
        .campo-clave { position: relative; display: block; }
        .campo-clave input { width: 100%; padding-right: 2.5rem; }
        .btn-ojo { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px;
                   display: flex; align-items: center; justify-content: center; border: none; background: transparent;
                   color: var(--text-muted); cursor: pointer; border-radius: 6px; padding: 0; }
        .btn-ojo:hover { color: var(--text-title); background: rgba(127,127,127,0.12); }
        .btn-ojo .ico { width: 18px; height: 18px; }
        .badge .ico { width: 1em; height: 1em; vertical-align: -0.15em; margin-right: 1px; }
        .ficha-seccion .ico, h4 .ico, h3 .ico { color: var(--primary); }
        .kpi-icon-wrap .ico { width: 22px; height: 22px; }
        .notif-vacio .ico { width: 34px; height: 34px; color: var(--success); }
        .sin-foto b .ico { width: 2.4rem; height: 2.4rem; stroke-width: 1.5; }
        .nav-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
        .nav-btn:hover { background: var(--bg-surface); color: var(--text-title); border-color: var(--border-subtle); }
        .nav-btn.active { background: rgba(0, 173, 154, 0.12); color: var(--tx-6fdccd); font-weight: 600; border-color: rgba(0, 173, 154, 0.28); box-shadow: inset 0 0 12px rgba(0, 173, 154, 0.08); }
        .nav-btn.active svg { stroke: var(--tx-2fc7b3); }
        .oculto { display: none !important; }

        .sidebar-footer { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 14px; }
        .user-badge-panel { display: flex; flex-direction: column; gap: 10px; padding: 4px 4px; }
        .user-fila { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 6px; margin: -6px; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
        .user-fila:hover, .user-fila:focus-visible { background: var(--bg-surface); outline: none; }
        .user-fila:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }   /* con el teclado se ve dónde está el foco */
        .user-avatar.con-foto, .perfil-foto.con-foto { background: var(--bg-surface); padding: 0; overflow: hidden; }
        .user-avatar img, .perfil-foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
        /* versión y novedades */
        .link-version { background: none; border: none; padding: 0; margin-top: -6px; font: inherit; font-size: var(--fs-xs); color: var(--text-faint);
                        cursor: pointer; text-align: center; }
        .link-version:hover { color: var(--tx-6fdccd); }
        .nov-lista { display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow-y: auto; }
        .nov-version { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 12px 14px; }
        .nov-cabeza { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 6px; }
        .nov-cabeza b { color: var(--text-title); font-size: var(--fs-md); }
        .nov-cabeza span { color: var(--text-faint); font-size: var(--fs-xs); white-space: nowrap; }
        .nov-version ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
        .nov-version li { font-size: var(--fs-sm); line-height: 1.45; color: var(--text-body); }
        .nov-version li b { color: var(--text-title); }
        /* ventana Mi perfil */
        .perfil-foto-fila { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
        .perfil-foto { width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
                       background: linear-gradient(135deg, #0b7d70, #075a50); box-shadow: 0 0 0 4px rgba(0, 173, 154, 0.18);
                       color: var(--c-blanco); font-weight: 700; font-size: 1.6rem; }
        .perfil-foto-botones { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
        .user-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .btn-usuario {
            display: flex; align-items: center; justify-content: center; gap: 0.375rem; height: 34px; padding: 0 0.5rem;
            background: transparent; border: 1px solid var(--border-subtle); border-radius: 8px; color: var(--text-muted);
            font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s, filter 0.15s, opacity 0.15s; white-space: nowrap;
        }
        .btn-usuario .ico { width: 15px; height: 15px; }
        .btn-usuario:hover { color: var(--text-title); border-color: var(--border-hover); background: var(--bg-surface); }
        .btn-usuario.salir:hover { color: var(--tx-fda4af); border-color: rgba(244, 63, 94, 0.4); background: var(--danger-glow); }
        .user-avatar {
            width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
            background: linear-gradient(135deg, #0b7d70, #075a50); box-shadow: 0 0 0 3px rgba(0, 173, 154, 0.18);
            display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--c-blanco); font-size: var(--fs-sm); letter-spacing: 0.02em;
        }
        .user-details { flex: 1; min-width: 0; }
        .user-name { font-size: var(--fs-md); font-weight: 600; color: var(--text-title); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .user-role-tag { margin-top: 2px; font-size: var(--fs-xs); font-weight: 500; color: var(--tx-6fdccd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

        main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; background-color: var(--bg-body); }
        main > header {   /* solo la barra de arriba (no los encabezados del visor de Word) */
            padding: 16px 36px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-header);
            backdrop-filter: blur(12px); display: flex; justify-content: space-between; align-items: center;
            position: sticky; top: 0; z-index: 100;
        }
        .header-title h2 { font-size: var(--fs-2xl); font-weight: 700; color: var(--text-title); letter-spacing: -0.02em; }
        .header-title p { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
        .header-title h2 .t-corto { display: none; }
        .header-actions { display: flex; align-items: center; gap: 12px; }

        .content-area { padding: 28px 36px; flex: 1; }
        .view { display: none; }
        .view.active { display: block; animation: fadeIn 0.15s ease forwards; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

        .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
        .kpi-card {
            background: linear-gradient(180deg, var(--bg-surface-elevated) 0%, var(--bg-surface) 100%);
            border: 1px solid var(--border-subtle); border-radius: 12px; padding: 1.25rem;
            position: relative; overflow: hidden; transition: border-color 0.2s, transform 0.2s;
        }
        .kpi-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--tinte), 0.15), transparent); }
        @media (hover: hover) { .kpi-card:hover { border-color: var(--border-hover); } }   /* sin «salto»: en una herramienta de trabajo distrae (y en el celular quedaba pegado) */
        .kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
        .kpi-label { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
        @media (max-width: 360px) { .kpi-top .kpi-icon-wrap { display: none; } .kpi-label { letter-spacing: 0.03em; } }   /* celulares angostos: sin el ícono, así el rótulo («MANTENIMIENTOS») entra entero */
        .kpi-icon-wrap { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: var(--fs-lg); border: 1px solid rgba(var(--tinte), 0.05); }
        .kpi-value { font-size: 1.8rem; font-weight: 700; color: var(--text-title); font-family: var(--font-mono); letter-spacing: -0.03em; }
        .kpi-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 6px; }


        .toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
        .search-container { position: relative; flex: 1; }
        .search-container input {
            width: 100%; background: var(--bg-surface); border: 1px solid var(--borde-campo, var(--border-subtle));
            border-radius: 10px; padding: 0.8125rem 1.125rem 0.8125rem 2.75rem; color: var(--text-title);
            font-size: var(--fs-md); outline: none; transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s, filter 0.2s, opacity 0.2s;
        }
        .search-container:not(:has(.search-icon)) input { padding-left: 0.875rem; }   /* sin lupa no queda el hueco a la izquierda */
        .search-container input:focus { border-color: var(--primary); background: var(--bg-surface-elevated); box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px var(--primary-glow); }
        .search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text-muted); fill: none; stroke-width: 2; pointer-events: none; }

        .panel-card { background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-panel-fin) 100%); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 1.5rem; margin-bottom: 24px; }
        .panel-card :is(h3, h4) { font-size: var(--fs-lg); font-weight: 600; color: var(--text-title); margin-bottom: 16px; }
        /* Configuración: menú de secciones fijo a la izquierda y, a la derecha, el encabezado de la sección y sus recuadros
           (todos del mismo ancho y en orden con style="order:N") */
        :is(#view-config, #view-emconf).active { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 24px; align-items: start; max-width: 1180px; }
        :is(#view-config, #view-emconf) .cfg-pestanas { order: -2; grid-column: 1; grid-row: 1 / span 30; position: sticky; top: 96px; align-self: start;   /* 96px: debajo del encabezado fijo de la página */
                                     display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px;
                                     background: var(--bg-surface); border: 1px solid var(--border-subtle); }
        :is(#view-config, #view-emconf) .cfg-pestanas button { display: flex; align-items: center; gap: 0.625rem; width: 100%; text-align: left; padding: 0.625rem 0.75rem;
                                            border: none; border-radius: 8px; background: transparent; color: var(--text-muted);
                                            font: inherit; font-size: var(--fs-md); font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
        :is(#view-config, #view-emconf) .cfg-pestanas button:hover { background: var(--bg-surface-elevated); color: var(--text-title); }
        :is(#view-config, #view-emconf) .cfg-pestanas button.activo { background: var(--primary-glow); color: var(--tx-2dd4bf); box-shadow: inset 3px 0 0 var(--primary); }   /* turquesa claro: el oscuro no llegaba al contraste mínimo sobre su fondo */
        :is(#view-config, #view-emconf) .cfg-pestanas .ico { width: 18px; height: 18px; flex-shrink: 0; }
        :is(#view-config, #view-emconf) .cfg-intro { grid-column: 2; order: -1; display: flex; align-items: center; gap: 14px; margin: 2px 0 18px; }
        :is(#view-config, #view-emconf) .cfg-intro-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
                                      background: var(--primary-glow); color: var(--primary); flex-shrink: 0; }
        :is(#view-config, #view-emconf) .cfg-intro-ico .ico { width: 24px; height: 24px; }
        :is(#view-config, #view-emconf) .cfg-intro-tit { font-size: var(--fs-2xl); font-weight: 700; color: var(--text-title); line-height: 1.2; }
        :is(#view-config, #view-emconf) > .panel-card { grid-column: 2; width: 100%; max-width: none !important; margin-bottom: 18px; }
        @media (max-width: 1000px) {   /* ventana angosta: el menú pasa arriba, en fila */
            :is(#view-config, #view-emconf).active { grid-template-columns: minmax(0, 1fr); }
            :is(#view-config, #view-emconf) .cfg-pestanas { grid-column: 1; grid-row: auto; position: static; flex-direction: row; flex-wrap: wrap; margin-bottom: 14px; }
            :is(#view-config, #view-emconf) .cfg-pestanas button { width: auto; }
            :is(#view-config, #view-emconf) .cfg-intro, :is(#view-config, #view-emconf) > .panel-card { grid-column: 1; }
        }
        :is(#view-config, #view-emconf) > .panel-card > :is(h3, h4) { display: flex; align-items: center; gap: 0.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-subtle); }
        :is(#view-config, #view-emconf) > .panel-card.cfg-fuera { display: none; }
        /* la fila de módulos (General / Ingeniería / Servicio Técnico / Estaciones): arriba de todo, a lo ancho; las secciones empiezan debajo */
        :is(#view-config, #view-emconf) > .cfg-modulos { grid-column: 1 / -1; grid-row: 1; order: -3; margin-bottom: 16px !important; }
        :is(#view-config, #view-emconf):has(> .cfg-modulos:not(.oculto)) .cfg-pestanas { grid-row: 2 / span 30; }
        /* una pestaña con una sola sección no muestra el menú de la izquierda: el contenido usa todo el ancho */
        :is(#view-config, #view-emconf).active:has(> .cfg-pestanas.oculto) { grid-template-columns: minmax(0, 1fr); }
        :is(#view-config, #view-emconf):has(> .cfg-pestanas.oculto) :is(.cfg-intro, .panel-card) { grid-column: 1; }
        /* Formularios de Configuración: etiquetas de un renglón (así las cajas quedan alineadas) y la explicación abajo, en chico */
        #view-config .cfg-campos { align-items: start; }
        #view-config .cfg-campos .form-group > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .campo-ayuda { display: block; font-size: var(--fs-xs); line-height: 1.35; color: var(--text-muted); margin-top: -1px; }
        .campo-ayuda:empty { display: none; }
        #view-config .cfg-campos textarea { resize: vertical; }
        .cfg-subcaja { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
        .cfg-subcaja-tit { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
        .cfg-prueba-fila { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
        .cfg-prueba-fila > * { width: 100%; justify-content: center; }
        @media (max-width: 1000px) { #view-config .form-grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } #view-config .form-grid.grid-4 > * { grid-column: auto !important; } #view-config .form-grid.grid-4 > [style*="span 3"] { grid-column: 1 / -1 !important; } }
        .hint { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.45; }

        .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
        /* Ítems de la OC: renglón 1 = material, cantidad, fecha, precio e IVA · renglón 2 = destino (stock / proyecto), aviso y Agregar.
           Con columnas fijas, mostrar el campo "Proyecto" no corre el precio ni el IVA. */
        @media (min-width: 1000px) {
            .oc-item-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
            .oc-item-grid .oc-item-destino { grid-column: 1 / 3; }
            .oc-item-grid .oc-item-proy { grid-column: 3 / 5; }
            .oc-item-grid .oc-item-aviso { grid-column: 5 / 6; }
            .oc-item-grid .oc-item-agregar { grid-column: 6 / 7; }
            .oc-item-grid .oc-item-agregar .btn { width: 100%; justify-content: center; }
        }
        .form-grid.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        @media (max-width: 1000px) { .form-grid.grid-4 { grid-template-columns: 1fr 1fr; } .form-grid.grid-4 > * { grid-column: 1 / -1 !important; } }
        .form-group { display: flex; flex-direction: column; gap: 6px; }
        .form-group label { font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }

        input, select, textarea {
            background: var(--bg-surface-elevated); border: 1px solid var(--borde-campo, var(--border-subtle)); border-radius: 8px;
            padding: 0.625rem 0.75rem; color: var(--text-title); font-size: var(--fs-md); outline: none; transition: border-color 0.15s;
        }
        textarea { font-family: inherit; resize: vertical; min-height: 4.375rem; line-height: 1.4; }
        /* foco bien visible: el borde más un segundo trazo del mismo color (2px sólidos) */
        textarea:focus, input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px var(--primary-glow); }
        input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; padding: 0; }

        /* Campos numéricos: sin las flechitas del navegador; botones − / + propios a los costados */
        input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        input[type=number] { -moz-appearance: textfield; appearance: textfield; }
        .num-ctrl { display: inline-flex; align-items: stretch; gap: 4px; vertical-align: middle; }
        .num-ctrl.ancho { display: flex; width: 100%; }
        .num-ctrl.ancho > input { flex: 1; min-width: 0; width: auto; }
        .num-btn {
            flex-shrink: 0; width: 36px; border-radius: 8px; cursor: pointer; padding: 0;
            display: flex; align-items: center; justify-content: center; user-select: none; touch-action: manipulation;
            background: var(--bg-surface-elevated); border: 1px solid var(--borde-campo, var(--border-subtle)); color: var(--text-muted);
            transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.08s;
        }
        .num-btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; fill: none; }
        .num-btn:hover { color: var(--c-blanco); border-color: rgba(0, 173, 154, 0.55); background: rgba(0, 173, 154, 0.16); }
        .num-btn:active { transform: scale(0.92); }
        .num-btn:disabled { opacity: 0.35; cursor: not-allowed; }
        .num-ctrl.chico .num-btn { width: 26px; border-radius: 6px; }
        .tabla-compacta th, .tabla-compacta td { padding-left: 0.5625rem; padding-right: 0.5625rem; }
        .num-ctrl.chico .num-btn svg { width: 12px; height: 12px; }
        @media (max-width: 760px) { .num-ctrl .num-btn, .num-ctrl.chico .num-btn { width: 44px; min-height: 2.75rem; } .num-ctrl.chico .num-btn svg { width: 14px; height: 14px; } }   /* − y + del ancho de un dedo */
        input[type=checkbox]:disabled { cursor: not-allowed; opacity: 0.6; }
        .input-sm { padding: 0.375rem 0.5rem; width: 120px; font-family: var(--font-mono); text-align: right; }

        .btn {
            background: var(--primary); color: var(--on-primary); border: 1px solid rgba(var(--tinte), 0.1); border-radius: 8px;
            padding: 0.5625rem 1rem; font-size: var(--fs-md); font-weight: 600; cursor: pointer; display: inline-flex;
            align-items: center; justify-content: center; gap: 0.5rem; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s, filter 0.15s, opacity 0.15s; white-space: nowrap;
        }
        @media (hover: hover) { .btn:hover { filter: brightness(1.1); box-shadow: 0 4px 12px var(--primary-glow); } }   /* sirve para el color de cada stock; sin «salto» */
        /* Acciones principales con el verde azulado de la marca (el verde de "correcto" queda para estados) */
        .btn-success { background: var(--primary); }
        .btn-success:hover { box-shadow: 0 4px 12px var(--primary-glow); }
        /* rojo: solo para borrar, anular o revertir */
        .btn-danger { background: #e11d48; color: var(--c-blanco); }
        .btn-danger:hover { box-shadow: 0 4px 12px var(--danger-glow); }
        .btn-warning { background: var(--warning); color: #1a1a1a; }
        .btn-warning:hover { box-shadow: 0 4px 12px var(--warning-glow); }
        .btn-outline { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-body); }
        /* Ficha del cliente */
        .fcli-sec { border-top: 1px solid var(--border-subtle); padding: 14px 0 6px; }
        .fcli-sec-tit { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px;
                        font-weight: 700; color: var(--text-title); font-size: var(--fs-md); }
        .fcli-sec-tit .ico { color: var(--primary); }
        .fcli-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; }
        @media (max-width: 760px) { .fcli-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        .fcli-dato small { display: block; font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 2px; }
        .fcli-dato div { overflow-wrap: anywhere; }
        .fcli-nota { white-space: pre-wrap; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: 10px; padding: 10px 12px; }
        .rubros-cfg { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
        @media (max-width: 760px) { .rubros-cfg { grid-template-columns: 1fr; } }
        .rubro-fila { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
        .rubro-uso { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; min-width: 48px; text-align: right; }
        .btn-nota-con { background: rgba(245, 158, 11, 0.16); border: 1px solid rgba(245, 158, 11, 0.55); color: var(--tx-fbbf24); }   /* proveedor con comentario */
        .btn-nota-con:hover { background: rgba(245, 158, 11, 0.26); }
        .btn-outline:hover { background: var(--bg-surface-elevated); border-color: var(--border-hover); color: var(--text-title); }
        .btn-sm { padding: 0.375rem 0.625rem; font-size: var(--fs-xs); border-radius: 6px; }

        .table-wrap { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, calc(0.4 * var(--sombra))); }
        .table-scroll { max-height: 62vh; overflow-y: auto; }
        /* Tablas grandes: se desplaza solo la tabla (el encabezado de columnas y la barra de título quedan fijos).
           El programa envuelve sola cada tabla en .table-scroll y marca el recuadro con .con-scroll (ver envolverTablas en app.js). */
        .table-wrap.con-scroll { display: flex; flex-direction: column; max-height: calc(100vh - 130px); }
        .table-wrap.con-scroll > * { flex: none; }
        .table-wrap.con-scroll > .table-scroll { flex: 0 1 auto; min-height: 0; max-height: none; overflow: auto; }
        .modal-card .table-wrap.con-scroll { max-height: 62vh; }
        /* ficha del vehículo: sus tablas (costo por km, historial…) se ven enteras; baja la ventana, no cada tabla */
        .vh-versiones { margin-top: 12px; }
        .vh-versiones tr.vh-version-sel td { color: var(--text-title); font-weight: 600; }
        .vhc-recalc { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 10px; cursor: pointer; }
        .vhc-recalc input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
        #modal-vehic .table-wrap.con-scroll { display: block; max-height: none; }
        .table-scroll > table > thead th { box-shadow: inset 0 -1px 0 var(--border-subtle); }
        .table-header-bar { padding: 14px 18px; background: var(--bg-surface-elevated); border-bottom: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
        .table-header-bar :is(h3, h4) { font-size: var(--fs-md); font-weight: 600; color: var(--text-title); }
        table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--fs-md); }
        th {
            background: var(--bg-surface-elevated); padding: 0.75rem 1rem; color: var(--text-muted);
            font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
            border-bottom: 1px solid var(--border-subtle); user-select: none; position: sticky; top: 0; z-index: 1;
        }
        th.sortable { cursor: pointer; transition: color 0.15s, background 0.15s; }
        th.sortable:hover { color: var(--text-title); }
        th.sortable .sort-arrow { display: inline-block; margin-left: 6px; font-size: var(--fs-xs); color: var(--primary); }
        td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle); color: var(--text-body); vertical-align: middle; }
        tr:last-child td { border-bottom: none; }
        tbody tr { transition: background 0.15s ease; }
        tbody tr:hover { background: rgba(var(--tinte), 0.035); }
        .num { text-align: right; font-family: var(--font-mono); }

        .stock-meter { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
        .stock-meter-labels { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); font-family: var(--font-mono); color: var(--text-muted); }
        .stock-track { width: 100%; height: 5px; background: rgba(var(--tinte), 0.08); border-radius: 99px; overflow: hidden; }
        .stock-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
        .fill-ok { background: linear-gradient(90deg, var(--c-verde), #4ade80); }
        .fill-low { background: linear-gradient(90deg, var(--c-rojo), #fb7185); box-shadow: 0 0 8px var(--danger-glow); }
        .fill-mid { background: linear-gradient(90deg, var(--c-ambar), #fbbf24); }
        .fill-over { background: linear-gradient(90deg, var(--c-violeta-osc), var(--c-lila)); box-shadow: 0 0 8px rgba(139, 92, 246, 0.35); }
        .badge-sobre { background: rgba(139, 92, 246, 0.16); color: var(--tx-c4b5fd); border: 1px solid rgba(139, 92, 246, 0.35); }

        .badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 3px 0.5rem; border-radius: 6px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
        .badge-brand { background: rgba(var(--tinte), 0.05); color: var(--tx-e5e7eb); border: 1px solid rgba(var(--tinte), 0.1); }
        .badge-prov { background: rgba(99, 102, 241, 0.12); color: var(--tx-c7d2fe); border: 1px solid rgba(99, 102, 241, 0.25); }
        /* Datos como texto (sin recuadro): los recuadros quedan solo para estados (Egreso, Atrasada, Cerrado...) */
        .txt-prov { color: var(--tx-a5b4fc); font-weight: 600; font-size: var(--fs-sm); }                /* proveedor */
        .txt-sec { color: var(--text-muted); font-weight: 500; font-size: var(--fs-sm); }
        textarea.desc-larga { resize: vertical; min-height: 0; max-height: calc(12 * 1.45em + 18px); overflow-y: auto; line-height: 1.45; tab-size: 4; font: inherit; }
        /* compra sin OC (y, dentro de ella, Mercado Libre): campos propios; se esconden los de la OC */
        #panel-nueva-oc:not(.modo-sinoc) .solo-sinoc, #panel-nueva-oc.modo-sinoc .no-sinoc, #panel-nueva-oc:not(.modo-ml) .solo-ml, #panel-nueva-oc.modo-ml .no-ml { display: none; }
        .rep-fotos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
        .rep-foto { position: relative; width: 76px; height: 76px; border-radius: 8px; border: 1px solid var(--border-subtle); background: rgba(var(--tinte), .04); }
        .rep-foto-ver { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; border-radius: 8px; overflow: hidden; }
        .rep-foto-ver img { width: 100%; height: 100%; object-fit: cover; display: block; }
        .rep-foto-ver:focus-visible, .rep-foto-x:focus-visible, .rep-foto-mas:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
        .rep-foto-x { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-subtle);
                      background: var(--bg-surface); color: var(--text-body); font-size: 12px; line-height: 1; cursor: pointer; }
        .rep-foto-mas { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-style: dashed; color: var(--text-muted);
                        font: inherit; font-size: var(--fs-xs); line-height: 1.2; text-align: center; cursor: pointer; }
        .rep-fotos-chicas .rep-foto { width: 56px; height: 56px; }
        .vh-sube { color: var(--warning) !important; font-weight: 600; }
        @media (max-width: 760px) { .vh-costo :is(th, td):is(:nth-child(3), :nth-child(4)) { display: none; } }   /* en el celular: año, km, total y $ por km */
        .vh-baja { color: var(--success) !important; font-weight: 600; }
        .emv-ubic { display: flex; gap: 10px; align-items: flex-start; border: 1px solid color-mix(in srgb, var(--em-viaje) 45%, transparent);
                    background: color-mix(in srgb, var(--em-viaje) 8%, transparent); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: var(--fs-sm); }
        .emv-ubic .ico { flex: none; margin-top: 2px; color: var(--em-viaje); }
        .emv-ubic.alerta { border-color: color-mix(in srgb, var(--warning) 50%, transparent); background: color-mix(in srgb, var(--warning) 8%, transparent); }
        .emv-ubic.alerta .ico { color: var(--warning); }
        .emv-recorrido-mapa { height: 280px; border-radius: 10px; margin-top: 8px; overflow: hidden; }
        .emv-lejos { color: var(--warning); font-weight: 600; }
        .emv-iniciar { border: 1px solid var(--success); color: var(--success); background: none; border-radius: 8px; padding: 6px 12px; font: inherit;
                       font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; cursor: pointer; min-height: 34px; }
        .emv-iniciar:focus-visible, .emv-op:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
        .emv-opciones .modal-card { max-width: 420px; padding: 18px; }
        .emv-op { display: block; width: 100%; text-align: left; background: none; border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px;
                  margin-top: 8px; color: var(--text-body); font: inherit; cursor: pointer; }
        .emv-op b { display: block; color: var(--text-title); }
        .emv-op span { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
        .emv-op.pri { border-color: var(--success); background: rgba(34, 197, 94, .08); }
        .emv-op-cancelar { width: 100%; margin-top: 12px; justify-content: center; }
        @media (max-width: 760px) { .emv-opciones { align-items: flex-end; } .emv-opciones .modal-card { width: 100%; } }
        .txt-renglones { white-space: pre-wrap; tab-size: 4; overflow-wrap: anywhere; }
        .hint kbd { background: rgba(var(--tinte), .1); border-radius: 4px; padding: 0 5px; font-size: var(--fs-xs); font-family: inherit; }        /* usuario, marca, rubro, destino Stock */
        .txt-dest { color: var(--tx-6fdccd); font-weight: 600; font-size: var(--fs-sm); }                /* destino: → proyecto */
        /* Contadores al lado del título de cada tabla ("Últimos 8", "2 proyecto(s)"): texto gris, sin recuadro */
        .table-header-bar .badge.badge-brand { background: none; border: none; padding: 0; color: var(--text-muted); font-weight: 500; font-size: var(--fs-xs); }
        .badge-ok { background: var(--success-glow); color: var(--tx-86efac); border: 1px solid rgba(34, 197, 94, 0.25); }
        .badge-low { background: var(--danger-glow); color: var(--tx-fda4af); border: 1px solid rgba(244, 63, 94, 0.3); }
        .badge-retiro { background: var(--danger-glow); color: var(--tx-fda4af); }
        .badge-ingreso { background: var(--success-glow); color: var(--tx-86efac); }
        .badge-devolucion { background: rgba(0, 173, 154, 0.15); color: var(--tx-6fdccd); }
        .badge-ajuste { background: var(--warning-glow); color: var(--tx-fcd34d); }
        .badge-admin { background: rgba(239, 68, 68, 0.15); color: var(--tx-fca5a5); border: 1px solid rgba(239, 68, 68, 0.3); }
        .badge-panol { background: rgba(0, 173, 154, 0.15); color: var(--tx-6fdccd); border: 1px solid rgba(0, 173, 154, 0.3); }
        .badge-op { background: rgba(34, 197, 94, 0.15); color: var(--tx-86efac); border: 1px solid rgba(34, 197, 94, 0.3); }
        .badge-aud { background: rgba(245, 158, 11, 0.15); color: var(--tx-fcd34d); border: 1px solid rgba(245, 158, 11, 0.3); }

        .perm-table th, .perm-table td { text-align: center; }
        .perm-table th:first-child, .perm-table td:first-child { text-align: left; }
        .perm-table td.alerta-sin-permiso { opacity: 0.35; }
        .perm-grupo td { background: rgba(var(--tinte), 0.025); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.07em; color: var(--primary); font-weight: 700; padding: 0.5625rem 1rem; }

        .estado-box { background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 14px 16px; font-size: var(--fs-sm); line-height: 1.7; }
        .estado-box b { color: var(--text-title); }
        .check-row { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); color: var(--text-title); cursor: pointer; }

        .tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 5px; width: fit-content; }
        .tab { background: transparent; border: none; color: var(--text-muted); padding: 9px 16px; border-radius: 7px; font-size: var(--fs-md); font-weight: 600; cursor: pointer; }
        .tab:hover { color: var(--text-title); }
        .tab.active { background: rgba(0, 173, 154, 0.15); color: var(--tx-6fdccd); }
        .subtitulo { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.07em; color: var(--primary); font-weight: 700; margin: 6px 0 12px; }
        .progreso { width: 90px; height: 6px; background: rgba(var(--tinte),0.08); border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
        .progreso div { height: 100%; background: linear-gradient(90deg, var(--c-turquesa), var(--c-verde)); }
        .fila-click { cursor: pointer; }
        /* Ingreso · pendiente de llegar: el renglón de cada orden, tenue; sus materiales, con sangría */
        #tb-pendientes tr.pend-oc td { background: var(--primary-glow); }
        #tb-pendientes tr.pend-it td:first-child { padding-left: 26px; }
        /* las fechas toman el color-scheme del tema (en :root) */
        html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* iPhone: no agranda las letras solo al girar el teléfono */
        button, a, summary, label, [onclick] { -webkit-tap-highlight-color: transparent; }   /* Android: sin el recuadro azul al tocar (los botones ya cambian solos) */
        @media (max-width: 760px) {
            /* fechas y horas: en iPhone no se achican a su casillero (se salían y se encimaban con el de al lado), vienen centradas y vacías pierden el alto */
            input[type=date], input[type=time], input[type=datetime-local], input[type=month] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; min-height: 2.75rem; }
            input::-webkit-date-and-time-value { text-align: left; }
        }
        .input-fecha { padding: 0.3125rem 0.5rem; font-size: var(--fs-sm); }
        .totales-oc { margin: 14px 0 0 auto; width: 320px; max-width: 100%; font-family: var(--font-mono); font-size: var(--fs-sm); }
        .totales-oc div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 2px; color: var(--text-muted); border-bottom: 1px dashed var(--border-subtle); }
        .totales-oc div span:last-child { color: var(--text-title); }
        .totales-oc div.total { border-bottom: none; border-top: 1px solid var(--border-hover); margin-top: 4px; padding-top: 8px; font-size: var(--fs-lg); font-weight: 700; }
        .totales-oc div.total span { color: var(--text-title); }
        .datos-oc { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 14px; }
        .datos-oc b { color: var(--text-title); font-weight: 600; }
        /* OC nueva: rojo = falta completar; amarillo = valor puesto automáticamente (se puede cambiar) */
        /* Las opciones de las listas desplegables siempre con fondo oscuro y letra clara
           (en Windows toman el color del recuadro y con los resaltados no se leían) */
        select option, select optgroup { background-color: var(--bg-surface-elevated) !important; color: #e8eef0 !important; }
        select option:checked { background-color: var(--c-turquesa-osc) !important; color: var(--c-blanco) !important; }
        select option:disabled { color: var(--text-muted) !important; }
        .req-ast { color: var(--danger); font-weight: 700; }
        #view-prov .campo-falta, #modal-edit-prov .campo-falta, #view-cli .campo-falta, #modal-edit-cli .campo-falta { border-color: rgba(244, 63, 94, 0.85) !important; background-color: rgba(244, 63, 94, 0.09) !important; }
        #panel-nueva-oc.validando .campo-falta, #panel-nueva-oc .campo-falta.tocado { border-color: rgba(244, 63, 94, 0.85) !important; background-color: rgba(244, 63, 94, 0.09) !important; }
        #panel-nueva-oc .campo-defecto { border-color: rgba(245, 158, 11, 0.7) !important; background-color: rgba(245, 158, 11, 0.08) !important; }
        .leyenda-campos { display: flex; gap: 16px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-muted); margin: -6px 0 16px; }
        .leyenda-campos span::before { content: ''; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
        .leyenda-campos .ley-falta::before { border: 1.5px solid rgba(244, 63, 94, 0.85); background: rgba(244, 63, 94, 0.15); }
        .leyenda-campos .ley-defecto::before { border: 1.5px solid rgba(245, 158, 11, 0.7); background: rgba(245, 158, 11, 0.15); }
        table.sin-tipo .col-tipo-oc { display: none; }
        #tabla-oc .progreso { width: 60px; }
        tr.fila-atrasada td { background: rgba(244, 63, 94, 0.13); }
        tr.fila-atrasada:hover td { background: rgba(244, 63, 94, 0.2); }
        tr.fila-atrasada td:first-child { box-shadow: inset 3px 0 0 var(--c-rojo); }
        tr.fila-hoy td { background: rgba(245, 158, 11, 0.12); }
        tr.fila-hoy:hover td { background: rgba(245, 158, 11, 0.19); }
        tr.fila-hoy td:first-child { box-shadow: inset 3px 0 0 var(--c-ambar); }
        /* Ficha de material */
        .fm-grid { display: grid; grid-template-columns: 280px 1fr; gap: 22px; }
        @media (max-width: 1000px) { .fm-grid { grid-template-columns: 1fr; } }
        .fm-foto { width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface-elevated);
                   display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
        .fm-foto img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; background: var(--c-blanco); }
        .fm-foto .sin-foto { color: var(--text-muted); font-size: var(--fs-sm); text-align: center; padding: 20px; line-height: 1.5; }
        .fm-foto .sin-foto b { display: block; font-size: 2.4rem; margin-bottom: 6px; opacity: 0.6; }
        .fm-foto.arrastrando { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
        @media (max-width: 760px) { .fm-foto { max-height: 260px; } .fm-foto:has(> .sin-foto) { aspect-ratio: auto; height: 120px; } }   /* celular: la foto no ocupa toda la pantalla, y sin foto queda un recuadro chico */
        .fm-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
        @media (max-width: 600px) { .fm-datos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        #fm-kpis .va { font-size: var(--fs-xl); white-space: nowrap; }
        #fm-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
        .fm-dato .et { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
        .fm-dato .va { font-size: var(--fs-lg); color: var(--text-title); font-weight: 600; margin-top: 3px; overflow-wrap: anywhere; }
        .foto-grande { position: fixed; inset: 0; z-index: 20050; background: rgba(0, 0, 0, 0.88); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
        .foto-grande img { max-width: 94vw; max-height: 92vh; border-radius: 8px; background: var(--c-blanco); }
        #tb-stock-master tr { cursor: pointer; }
        .cod-corto { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; color: var(--primary); background: var(--primary-glow);
                     border: 1px solid rgba(0, 173, 154, 0.35); border-radius: 5px; padding: 0 6px; }
        .desc-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); flex-wrap: wrap; }
        /* Listado de stock compacto: renglones bajos para ver más materiales por pantalla */
        #tb-stock-master td { padding-top: 0.375rem; padding-bottom: 0.375rem; }
        .celda-sku { min-width: 110px; max-width: 260px; line-height: 1.5; }
        .celda-sku .sku-txt { font-family: var(--font-mono); font-weight: 600; color: var(--primary); overflow-wrap: anywhere; margin-right: 8px; }
        #tb-stock-master td:nth-child(3) { min-width: 13.75rem; }
        /* Código corto: debajo del SKU, chico y en gris, sin recuadro */
        .cod-corto-sku { display: block; white-space: nowrap; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; color: var(--tx-9aa7b2); line-height: 1.3; }
        #tb-stock-master .badge { padding: 1px 0.375rem; font-size: var(--fs-xs); }
        #tb-stock-master .desc-sub { margin-top: 1px; }
        #tb-stock-master .btn-sm { padding: 0.25rem 0.5625rem; font-size: var(--fs-xs); }
        #tb-stock-master .stock-meter { gap: 3px; min-width: 120px; }
        #tb-stock-master .stock-meter-labels { flex-wrap: wrap; row-gap: 0; line-height: 1.35; }
        #tb-stock-master .nota-prestado { margin-top: 2px; }
        #modal-material .cant { text-align: center; font-family: var(--font-mono); white-space: nowrap; }
        #alta-pasillo::placeholder { text-transform: none; }
        .alta-foto { display: flex; align-items: center; gap: 12px; }
        .alta-foto-caja { width: 84px; height: 84px; border-radius: 10px; border: 1px dashed var(--border-hover); background: var(--bg-surface-elevated);
                          display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text-muted); flex-shrink: 0; }
        .alta-foto-caja .ico { width: 28px; height: 28px; stroke-width: 1.5; }
        .alta-foto-caja img { width: 100%; height: 100%; object-fit: contain; background: var(--c-blanco); cursor: zoom-in; }
        .alta-foto-caja.arrastrando { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
        .aviso-revisar { margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: rgba(168, 85, 247, 0.1); border: 1px solid rgba(168, 85, 247, 0.35); color: var(--tx-e9d5ff); font-size: var(--fs-sm); }
        .aviso-revisar .ico { color: var(--tx-d8b4fe); margin-right: 4px; }
        .nota-revisar { font-size: var(--fs-xs); color: var(--tx-d8b4fe); font-style: italic; }   /* corta en renglones: en una sola línea ensanchaba toda la columna */
        .fila-revisar td:first-child { box-shadow: inset 3px 0 0 var(--c-violeta); }
        .fila-revisar { background: rgba(168, 85, 247, 0.06); }
        .badge-dep-st { background: rgba(245, 158, 11, 0.14); color: var(--tx-fcd34d); border: 1px solid rgba(245, 158, 11, 0.35); font-size: var(--fs-xs); }
        /* repuestos del viaje (planificador, ventana del viaje y planilla) */
        .emv-rep-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--border-hover);
                       background: transparent; color: var(--text-muted); font: 500 var(--fs-xs) var(--font-sans); cursor: pointer; white-space: nowrap; }
        .emv-rep-btn.con { border-style: solid; color: var(--em-viaje); border-color: color-mix(in srgb, var(--em-viaje) 45%, transparent); }
        .emv-rep-btn .ico { width: 13px; height: 13px; }
        .emv-acc .emv-rep-btn { width: auto; height: auto; min-height: 24px; border-radius: 999px; margin-right: auto; }   /* no toma el tamaño fijo de los botones de flecha */
        .emrep-fila { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
        .emrep-nom { flex: 1 1 240px; min-width: 0; }
        .emrep-fila .input-sm { width: 80px; }
        .emrep-usado { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
        .emrep-serie { width: 160px; min-width: 140px; text-transform: uppercase; }
        .emrep-series { display: flex; flex-wrap: wrap; gap: 6px; }
        .emrep-series:empty { display: none; }
        .emrep-agregar { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
        .emrep-agregar > input:first-child { flex: 1 1 220px; min-width: 0; }
        .emv-rep-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border-subtle); }
        .emv-rep-panel :is(h3, h4) { display: flex; align-items: center; gap: 6px; margin-bottom: 8px !important; flex-wrap: wrap; }
        .emv-rep-est { border: 1px solid var(--border-subtle); border-radius: 10px; margin-top: 8px; overflow: hidden; }
        .emv-rep-est.actual { border-color: var(--em-viaje); }
        .emv-rep-est.actual .emv-num { background: var(--em-viaje); color: var(--c-tinta); }
        .emv-rep-est.hecha { opacity: .75; }
        .emv-rep-cab { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(var(--tinte), .03); font-weight: 600; }
        .emv-rep-cuenta { margin-left: auto; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; white-space: nowrap; }
        .emv-rep-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
        .emv-rep-que { flex: 1; min-width: 0; }
        .emv-rep-que small { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
        .emv-rep-vacio { padding: 7px 10px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-xs); color: var(--text-muted); }
        .emv-llevas { border: 1px solid color-mix(in srgb, var(--em-viaje) 45%, transparent); background: color-mix(in srgb, var(--em-viaje) 8%, transparent);
                      border-radius: 10px; padding: 10px 12px; margin: 10px 0; text-align: left; font-size: var(--fs-sm); }
        .emv-llevas > b { display: block; margin-bottom: 4px; }
        .emv-llevas ul { margin: 0; padding-left: 18px; }
        .emv-llevas li { margin: 3px 0; }
        .emv-rep-falla { color: var(--tx-fda4af); font-size: var(--fs-xs); font-weight: 600; margin-left: 4px; }
        @media (max-width: 760px) { .emv-acc .emv-rep-btn { min-height: 40px; } .emv-nodo > .emv-acc { flex-wrap: wrap; row-gap: 6px; }
            .emv-nodo > .emv-acc .emv-rep-btn { order: 2; flex: 1 1 100%; justify-content: center; margin-right: 0; }   /* renglón propio, debajo de la hora y las flechas */ .emrep-fila .input-sm { width: 72px; } .emrep-agregar .btn { flex: 1 1 auto; justify-content: center; } }
        /* pedidos de materiales (Estaciones) */
        .emp-card { border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-card); padding: 1rem 1.125rem; margin-bottom: 14px; }
        .emp-card.sin-enviar { border-color: color-mix(in srgb, var(--em-media) 55%, transparent); }
        .emp-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
        .emp-cab :is(h3, h4) { margin: 0 0 2px; font-size: var(--fs-lg); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
        summary.emp-cab { cursor: pointer; list-style: none; }
        summary.emp-cab::-webkit-details-marker { display: none; }
        .emp-flecha { width: 16px; height: 16px; flex: none; transform: rotate(-90deg); transition: transform .15s; color: var(--text-muted); }
        details.emp-card[open] .emp-flecha { transform: none; }
        .emp-cuantos { font-weight: 400; }
        @media (prefers-reduced-motion: reduce) { .emp-flecha { transition: none; } }
        .emp-acc { display: flex; gap: 8px; flex-wrap: wrap; }
        .emp-grupo { margin-top: 12px; }
        .emp-total { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--em-viaje) 8%, transparent); }
        .emp-total .emp-fila { border-top: none; padding: 4px 0; }
        .emp-total-tit { font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 2px; }
        .emp-grupo h5 { margin: 0 0 4px; font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
        .emp-fila { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border-subtle); }
        .emp-fila > span:first-child { flex: 1 1 220px; min-width: 0; }
        .emp-rj { font-family: var(--font-mono); font-size: var(--fs-sm); white-space: nowrap; }
        .emp-rj.sin { color: var(--danger, #e5484d); font-family: var(--font-sans); font-weight: 600; }
        .emp-vacio { text-align: center; padding: 40px 16px; }
        .emc-fw { display: grid; grid-template-columns: minmax(0, 1fr) 140px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
        .emc-fw-cab { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
        @media (max-width: 760px) { .emp-card { padding: 0.875rem; } .emp-acc { width: 100%; } .emp-acc .btn { flex: 1 1 auto; justify-content: center; }
                                     .emc-fw { grid-template-columns: minmax(0, 1fr) 96px 40px; } }
        .badge-dep-em { background: rgba(56, 189, 248, 0.14); color: var(--tx-7dd3fc); border: 1px solid rgba(56, 189, 248, 0.35); font-size: var(--fs-xs); }
        .u-link { color: var(--primary); font-size: var(--fs-xs); }
        .badge-dep-ing { background: rgba(0, 173, 154, 0.12); color: var(--tx-5eead4); border: 1px solid rgba(0, 173, 154, 0.35); font-size: var(--fs-xs); }
        /* ===== Stock actual: etiqueta arriba y color de todo el programa ===== */
        .dep-wrap { position: relative; }
        .dep-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font: inherit; font-size: var(--fs-sm); font-weight: 700;
                    cursor: pointer; white-space: nowrap; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
        .dep-pill:disabled { cursor: default; }
        .dep-pill.dep-ing { color: var(--tx-5eead4); background: rgba(0, 173, 154, 0.13); border: 1px solid rgba(0, 173, 154, 0.45); }
        .dep-pill.dep-st { color: var(--tx-fcd34d); background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.5); }
        .dep-pill:not(:disabled):hover, .dep-pill.abierto { filter: brightness(1.2); }
        .dep-pill .dep-flecha { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; transition: transform 0.15s; }
        .dep-pill.abierto .dep-flecha { transform: rotate(180deg); }
        .dep-punto { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
        .dep-punto.dep-ing { color: var(--tx-2dd4bf); } .dep-punto.dep-st { color: var(--tx-fbbf24); }
        .dep-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 9500; background: var(--bg-surface-elevated);
                    border: 1px solid var(--border-hover); border-radius: 12px; padding: 6px; box-shadow: 0 16px 36px rgba(0, 0, 0, calc(0.6 * var(--sombra))); }
        .dep-menu button { display: flex; align-items: center; gap: 0.625rem; width: 100%; border: 0; background: transparent; color: var(--text-body); font: inherit;
                           font-size: var(--fs-md); font-weight: 600; padding: 0.625rem 0.75rem; border-radius: 8px; cursor: pointer; text-align: left; }
        .dep-menu button:hover { background: rgba(var(--tinte), 0.05); color: var(--text-title); }
        .dep-menu button.activo { color: var(--text-title); }
        @media (max-width: 760px) { .dep-pill { padding: 7px 11px; font-size: var(--fs-xs); } .dep-pill .dep-txt { max-width: 92px; overflow: hidden; text-overflow: ellipsis; } }
        /* Estaciones meteorológicas: tercera opción del selector (usa los datos de Servicio técnico) */
        .dep-pill.dep-em { color: var(--tx-7dd3fc); background: rgba(56, 189, 248, 0.13); border: 1px solid rgba(56, 189, 248, 0.45); }
        .dep-punto.dep-em { color: var(--tx-38bdf8); }
        /* Administración: cuarta opción del selector (solo en la PC) */
        .dep-pill.dep-adm { color: var(--tx-c4b5fd); background: rgba(167, 139, 250, 0.13); border: 1px solid rgba(167, 139, 250, 0.45); }
        .dep-punto.dep-adm { color: var(--tx-a78bfa); }
        .prov-pagos-tit { margin: 6px 0 -4px; padding-top: 12px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-xs); font-weight: 700;
                          letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
        body[data-deposito="ADM"] .nav-sep { display: none; }
        body[data-deposito="ADM"] .nav-sep.nav-sep-adm { display: block; }   /* el título «Cuentas a pagar» del menú */
        body[data-deposito="ADM"] .tab.active, body[data-deposito="ADM"] .segmentado button.activo { background: rgba(167, 139, 250, 0.15); color: var(--tx-c4b5fd); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.35); }
        /* Administración · Cuentas a pagar */
        .form-grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        #adm-kpis .kpi-value { white-space: nowrap; font-size: var(--fs-2xl); }   /* montos largos: en un renglón */
        .form-grid .u-ancho-2 { grid-column: span 2; }
        .admf-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; margin: 10px 0 4px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
        .admf-total span { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
        .admf-total b { font-size: var(--fs-2xl); color: var(--text-title); }
        .admf-ocs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
        .admf-ocs span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 14px; background: var(--bg-surface-elevated); border: 1px solid var(--border-hover); font-size: var(--fs-xs); }
        .admf-ocs button { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: var(--fs-md); padding: 0 2px; }
        .admf-aviso { margin: 8px 0; padding: 10px 12px; border-radius: 8px; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.4); color: var(--tx-fcd34d); font-size: var(--fs-sm); }
        .btn-adm { background: var(--c-lila); color: #1f1a33; border: 1px solid var(--c-lila); }
        .btn-adm:hover { background: #c4b5fd; }
        .badge-op { background: rgba(167, 139, 250, 0.16); color: var(--tx-ddd6fe); border: 1px solid rgba(167, 139, 250, 0.35); }
        .adm-grupo-tit { margin: 18px 0 8px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
        .adm-venc-fila { display: grid; grid-template-columns: 28px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; align-items: center;
                         padding: 10px 14px; margin-bottom: 6px; border-radius: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
        .adm-venc-fila b { color: var(--text-title); } .adm-venc-fila .hint { display: block; }
        .adm-vencida { color: var(--danger); font-weight: 700; } .adm-semana { color: var(--warning); font-weight: 700; }
        .adm-pago-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
        body[data-deposito="EM"] .nav-sep { display: none; }
        .nav-sep-em { display: none; }
        .emc-origen { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.3fr) 40px; gap: 10px; align-items: center; margin-bottom: 8px; }
        /* Combustible: consumo a la izquierda y los precios de la nafta como línea de tiempo */
        .emc-comb { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
        .emc-comb-box { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 14px; background: var(--bg-surface); }
        .emc-consumo-campo { width: 100%; margin-top: 6px; }
        .emc-tl { position: relative; padding-left: 18px; }
        .emc-tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border-subtle); }
        .emc-nafta { position: relative; display: grid; grid-template-columns: 145px minmax(0, 1fr) 40px; gap: 10px; align-items: center; padding: 5px 0; }
        .emc-nafta::before { content: ''; position: absolute; left: -17px; top: 50%; margin-top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-hover); }
        .emc-nafta.vig::before { background: var(--em-ok); }
        .emc-nafta .emv-campo { width: 150px; flex: none; }
        .emc-n-medio { display: flex; align-items: center; gap: 10px; min-width: 0; }
        .emc-vig { display: none; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; background: rgba(34, 197, 94, 0.12); color: var(--em-ok); }
        .emc-nafta.vig .emc-vig { display: inline-block; }
        @media (max-width: 760px) { .emc-comb { grid-template-columns: 1fr; } .emc-nafta { grid-template-columns: 1fr 40px; } .emc-n-medio { grid-column: 1; } }
        /* gastos del viaje, como un recibo: concepto a la izquierda, importe a la derecha */
        .emv-recibo { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
        .emv-recibo > div { padding: 11px 0; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; justify-content: center; }
        .emv-recibo .der { text-align: right; align-items: flex-end; font-family: var(--font-mono); padding-left: 12px; }
        .emv-recibo .total { font-weight: 700; font-size: var(--fs-lg); border-bottom: 0; padding-top: 14px; }
        .emv-recibo .der.total { color: var(--em-ok); }
        .emv-campo { display: inline-flex; align-items: center; width: 160px; border: 1px solid var(--borde-campo, var(--border-subtle)); border-radius: 10px; background: var(--bg-surface); overflow: hidden; }
        .emv-campo input { border: 0 !important; background: transparent !important; box-shadow: none !important; flex: 1; min-width: 0; padding: 0.5rem 0.625rem; text-align: right; font-family: var(--font-mono); }
        .emv-campo span { padding: 0 10px; color: var(--text-muted); font-size: var(--fs-sm); }
        .emc-origen-cab span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
        .emc-origen input[type=radio] { justify-self: center; width: 18px; height: 18px; }
        body[data-deposito="EM"] .nav-sep.nav-sep-em { display: block; }   /* títulos propios de Estaciones */
        body[data-deposito="EM"] .nav-sep.nav-sep-em.oculto { display: none; }
        /* Estaciones: el menú en su orden (tablero, trabajo de campo, repuestos, gestión) sin duplicar los botones de stock */
        body[data-deposito="EM"] #nav-emdash { order: 1; } body[data-deposito="EM"] #nav-estac { order: 2; }
        body[data-deposito="EM"] #sep-em-campo { order: 3; } body[data-deposito="EM"] #nav-emmant { order: 4; }
        body[data-deposito="EM"] #nav-emact { order: 5; } body[data-deposito="EM"] #nav-emviajes, body[data-deposito="EM"] #nav-vehic { order: 6; }   /* Vehículos, junto a Viajes */
        body[data-deposito="EM"] #nav-empedidos { order: 8; }   /* Pedidos de repuestos, después de Stock (va después en el HTML) */
        body[data-deposito="EM"] #sep-em-rep { order: 7; } body[data-deposito="EM"] #nav-stock { order: 8; }
        body[data-deposito="EM"] #nav-ing { order: 9; } body[data-deposito="EM"] #nav-ret { order: 10; }
        body[data-deposito="EM"] #nav-ajuste { order: 11; } body[data-deposito="EM"] #nav-alta { order: 12; }
        body[data-deposito="EM"] #sep-em-ges { order: 14; }
        body[data-deposito="EM"] #nav-emaud { order: 15; } body[data-deposito="EM"] #nav-emconf { order: 16; }
        body[data-deposito="EM"] #nav-personas { order: 17; } body[data-deposito="EM"] #nav-config, body[data-deposito="EM"] #nav-estado { order: 18; }
        body[data-deposito="EM"] #tab-ing-oc, body[data-deposito="EM"] #tab-ing-dev { display: none; }   /* repuestos: sin OC ni devoluciones */
        .em-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
        .em-mapa { height: 440px; border-radius: 10px; overflow: hidden; background: var(--bg-surface); }
        .emv-mapa { height: 380px; margin-top: 14px; }
        .emv-est { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; cursor: pointer; }   /* abre la ficha; el subrayado aparece al pasar el mouse */
        .emv-est:hover { color: var(--primary); border-bottom-color: var(--primary); }
        .emv-barra { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; }
        /* lista de viajes: una tarjeta por viaje */
        .emv-tarjeta { border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-card); margin-bottom: 12px; overflow: hidden; }
        .emv-tarjeta-cab { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
        .emv-tarjeta-fecha { font-size: var(--fs-lg); font-family: var(--font-mono); }
        .emv-tec { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600;
                   color: var(--text-title); background: var(--bg-surface); border: 1px solid var(--border-subtle); white-space: nowrap; }
        .emv-tec .ico { width: 15px; height: 15px; color: var(--primary); }
        .emv-tec.vacio { color: var(--text-muted); border-style: dashed; font-weight: 500; }
        /* administradores: la etiqueta lleva adentro la lista para cambiar el técnico */
        .emv-tec-edit { padding-right: 6px; cursor: pointer; }
        .emv-tec-edit:hover, .emv-tec-edit:focus-within { border-color: var(--primary); }
        .emv-tec-edit .sel-boton { padding: 0; border: 0; background: none; font: inherit; color: inherit; gap: 6px; min-height: 0; }
        .emv-tec-edit .sel-boton:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
        @media (max-width: 760px) { .emv-tec-edit .sel-boton { min-height: 36px; } }   /* celular: la lista del técnico, del alto de un dedo */
        .emv-tarjeta-cab .emv-acc2 { margin-left: auto; }
        .emv-pasos { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 12px 16px; }
        .emv-paso { display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 4px; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
        .emv-paso i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 700; background: var(--border-subtle); }
        .emv-paso.ok i { background: var(--em-ok); color: var(--c-tinta); }
        .emv-paso.actual { border-color: var(--em-viaje); color: var(--em-viaje); font-weight: 600; }
        .emv-paso.actual i { background: var(--em-viaje); color: var(--c-tinta); }
        .emv-flecha { color: var(--text-muted); }
        .emv-paso.fact { border-style: dashed; border-color: var(--em-plan); }
        .emv-paso.fact i { background: var(--em-plan); color: var(--c-tinta); }
        .emv-paso small { font-size: var(--fs-xs); color: var(--em-plan); text-transform: uppercase; letter-spacing: 0.04em; }
        .emv-tarjeta-pie { display: flex; gap: 24px; flex-wrap: wrap; padding: 10px 16px; background: var(--bg-surface); font-size: var(--fs-md); }
        .emv-tarjeta-pie span { display: block; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
        /* dashboard: últimos viajes */
        .emv-acc2 { display: flex; gap: 6px; justify-content: flex-end; }
        .emv-panel { padding: 16px; }
        .emv-kp { grid-template-columns: 1fr 1fr !important; margin-top: 12px; }
        .emv-grande { width: 100%; justify-content: center; padding: 16px; font-size: var(--fs-lg); margin-top: 12px; }
        .emv-maps { width: 100%; justify-content: center; padding: 12px; margin-top: 12px; text-decoration: none; }
        .emv-reloj { font-family: var(--font-mono); font-size: 2.8rem; font-weight: 700; margin: 6px 0; }
        .emv-dif { margin: 10px 0 0; font-size: var(--fs-sm); }
        .emv-acc-viaje { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 12px; }
        .emv-pausar { width: 100%; justify-content: center; }
        .emv-ajeno { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.08); font-size: var(--fs-md); }
        .ema-revertido td { opacity: 0.55; }
        .emv-terminar { border: 0; background: none; padding: 10px 14px; font: inherit; font-size: var(--fs-sm); color: var(--tx-fda4af); text-decoration: underline;
                        text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
        .emv-terminar:hover { color: var(--tx-fb7185); }
        .emv-acc button .ico { width: 16px; height: 16px; }
        .emv-arriba { transform: rotate(180deg); }
        .emv-motivo { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(249, 115, 22, 0.4); background: rgba(249, 115, 22, 0.08); font-size: var(--fs-md); }
        .emv-lin { padding: 4px 14px; }
        .emv-lin-fila { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 9px 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-md); }
        .emv-lin-fila .emv-inc { margin-left: 8px; }
        .emv-falta { flex: none; font: 600 0.75rem var(--font-sans); padding: 3px 10px; border-radius: 999px; cursor: pointer;
                     color: var(--em-media); background: color-mix(in srgb, var(--em-media) 14%, transparent); border: 1px solid color-mix(in srgb, var(--em-media) 45%, transparent); }
        span.emv-falta { cursor: default; }
        .emv-falta.ok { color: var(--em-ok); border-color: color-mix(in srgb, var(--em-ok) 45%, transparent); background: color-mix(in srgb, var(--em-ok) 10%, transparent); }
        /* mantenimientos: los que faltan cargar de un viaje, arriba y en naranja */
        tr.emm-pend td { background: color-mix(in srgb, var(--em-media) 9%, transparent); border-bottom-color: color-mix(in srgb, var(--em-media) 30%, var(--border-subtle)); }
        tr.emm-pend.fila-click:hover td { background: color-mix(in srgb, var(--em-media) 15%, transparent); }
        .emm-pend-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; color: var(--em-media);
                         background: color-mix(in srgb, var(--em-media) 16%, transparent); border: 1px solid color-mix(in srgb, var(--em-media) 45%, transparent); }
        .emm-pend-btn { margin-left: 8px; }
        /* planeados en un viaje (todavía sin hacer): celeste; en viaje o en la estación: verde */
        tr.emm-plan td { background: color-mix(in srgb, var(--em-viaje) 7%, transparent); border-bottom-color: color-mix(in srgb, var(--em-viaje) 25%, var(--border-subtle)); }
        tr.emm-plan.fila-click:hover td { background: color-mix(in srgb, var(--em-viaje) 13%, transparent); }
        .emm-plan-chip { color: var(--em-viaje); background: color-mix(in srgb, var(--em-viaje) 14%, transparent); border-color: color-mix(in srgb, var(--em-viaje) 45%, transparent); }
        .emm-plan-chip.curso { color: var(--em-ok); background: color-mix(in srgb, var(--em-ok) 14%, transparent); border-color: color-mix(in srgb, var(--em-ok) 45%, transparent); }
        tr.emm-grupo td { padding: 0.5rem 0.75rem 0.375rem; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted);
                          background: var(--bg-body); border-bottom: 1px solid var(--border-subtle); }
        .emm-cal { display: none; }   /* el día en cuadradito: solo en el celular */
        .emm-num { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; color: var(--primary); white-space: nowrap; }
        .emm-pend-badge { color: var(--em-media); background: color-mix(in srgb, var(--em-media) 14%, transparent); border: 1px solid color-mix(in srgb, var(--em-media) 40%, transparent); }
        .emv-falta-aviso { border-color: color-mix(in srgb, var(--em-media) 50%, transparent); background: color-mix(in srgb, var(--em-media) 9%, transparent); }
        .emv-lin-fila:last-child { border-bottom: 0; }
        .emv-falta-aviso { display: block; }   /* texto corrido: en flex, el nombre en negrita quedaba como una columna aparte */
        .emv-falta-aviso > .ico { vertical-align: -0.2em; margin-right: 6px; }
        .em-oblig { color: var(--danger); }
        .em-falla { --c: var(--em-media); --c-txt: var(--tx-fdba74); --c-on: #1f0d00; display: flex; gap: 12px; padding: 12px 14px; margin-top: 8px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
                    border-radius: 10px; background: color-mix(in srgb, var(--c) 6%, var(--bg-card)); }
        .em-falla-media { --c: var(--em-posible); --c-txt: var(--tx-e9d5ff); --c-on: #1a0b2e; }
        .em-falla-baja { --c: var(--em-tiempo); --c-txt: var(--tx-bfdbfe); --c-on: var(--c-tinta); }
        .em-falla-sis { --c: var(--em-alta); --c-txt: var(--tx-fecaca); --c-on: #2a0707; }   /* confirmada: ya es una falla (rojo); el violeta queda para lo que detectó el sistema */
        .em-falla-ic { width: 34px; height: 34px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
                       background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
        .em-falla-cuerpo { flex: 1; min-width: 0; }
        .em-falla-tit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .em-falla-tit b { color: var(--text-title); font-size: var(--fs-lg); }
        .em-falla-chip { font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c-txt); }
        .em-falla-txt { margin-top: 4px; font-size: var(--fs-md); line-height: 1.5; color: var(--text-body); }
        .em-falla-txt b { color: var(--text-title); font-weight: 600; }
        .em-falla-lista { margin: 0; padding-left: 18px; }
        .em-falla-lista li + li { margin-top: 3px; }
        .em-falla-acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
        .em-falla-marcar { background: var(--c); color: var(--c-on); border: 1px solid var(--c); }
        .em-falla-marcar:hover { filter: brightness(1.1); }
        .ruedita { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar 0.8s linear infinite; vertical-align: -2px; }
        @keyframes girar { to { transform: rotate(360deg); } }
        @media (prefers-reduced-motion: reduce) { .ruedita { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }   /* le gana a la regla general de abajo, que frena todo */ }
        .emc-firma { min-height: 70px; padding: 10px; border: 1px dashed var(--border-subtle); border-radius: 10px; background: var(--c-blanco); display: flex; align-items: center; }
        .emc-firma img { max-width: 100%; max-height: 180px; display: block; }
        .emc-firma .hint { color: #6b7280; }
        #emm-cuerpo.emf-intento .em-oblig-in.vacio { border-color: rgba(239, 68, 68, 0.6) !important; }   /* rojo recién al intentar anotar con algo vacío */
        .emv-inc { flex: none; font: 600 0.75rem var(--font-mono); padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(56, 189, 248, 0.4);
                   background: rgba(56, 189, 248, 0.1); color: var(--em-viaje); cursor: pointer; }
        span.emv-inc { cursor: default; }
        .emv-inc.vacia { background: transparent; border-style: dashed; color: var(--text-muted); font-family: inherit; font-weight: 500; }
        .emv-num { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 700;
                   background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border-subtle); }
        .emv-lin-fila.hecha .emv-num { background: var(--em-ok); color: var(--c-tinta); }
        .emv-lin-fila.actual { color: var(--em-viaje); font-weight: 600; }
        .emv-lin-fila.actual .emv-num { background: var(--em-viaje); color: var(--c-tinta); }
        @media (max-width: 600px) { .emv-tarjeta-pie { gap: 12px 18px; } .emv-tarjeta-cab .emv-acc2 { margin-left: 0; } }
        .emv-hora.tarde { color: var(--warning); font-weight: 700; }
        .emv-pin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--c-blanco); color: var(--c-tinta); font: 700 12px/22px var(--font-sans, sans-serif); text-align: center; box-shadow: 0 1px 4px rgba(0, 0, 0, calc(.5 * var(--sombra))); }
        /* armado del viaje: una línea con la salida (se cambia a mano), la vuelta, la duración y los km */
        .emv-linea { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin: 0 0 12px; }
        .emv-linea:empty { display: none; }
        .emv-dato { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border-subtle);
                    background: var(--bg-surface); font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; }
        .emv-dato b { color: var(--text-title); font-family: var(--font-mono); font-weight: 600; }
        .emv-dato.sal { border-color: color-mix(in srgb, var(--primary) 55%, transparent); padding: 2px 6px 2px 12px; }
        .emv-dato.sal input { width: 92px; height: 28px; padding: 0 0.375rem; font: 600 var(--fs-sm) var(--font-mono); }
        .emv-dato-auto { background: none; border: none; color: var(--primary); font-size: var(--fs-xs); cursor: pointer; padding: 0 4px; }
        .emv-linea-det { font-size: var(--fs-xs); color: var(--text-muted); }
        /* resumen del viaje (popup para la captura): encabezado con la fecha, datos, barra del día, recorrido y mapa con nombres */
        .modal-overlay > .modal-card.emres-card { max-width: 1040px; width: calc(100% - 32px); padding: 1.25rem 1.375rem; }
        .emres-en-viaje { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
        .emres-fila .emv-inc { margin-top: 6px; }
        .emres-cab { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
        .emres-cal { width: 56px; flex: none; border: 1px solid var(--border-hover); border-radius: 10px; overflow: hidden; text-align: center; }
        .emres-cal .m { background: var(--primary); color: #04222e; font: 700 11px/1.6 var(--font-sans); letter-spacing: 0.08em; }
        .emres-cal .d { font: 700 22px/1.25 var(--font-sans); color: var(--text-title); }
        .emres-cal .s { font-size: 11px; color: var(--text-muted); padding-bottom: 3px; }
        .emres-tit { flex: 1; min-width: 0; }
        .emres-tit h3 { font-size: var(--fs-lg); }
        .emres-tit .hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px !important; }
        .emres-ini { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 9px var(--font-sans);
                     background: color-mix(in srgb, var(--em-ok) 22%, transparent); color: var(--em-ok); }
        .emres-acc { display: flex; align-items: center; gap: 8px; align-self: flex-start; }
        .emres-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
        .emres-kpi { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 8px 12px; }
        .emres-kpi.hi { border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
        .emres-kpi .et { font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
        .emres-kpi .va { font: 600 1.2rem var(--font-mono); color: var(--text-title); white-space: nowrap; }
        .emres-barra { margin-bottom: 14px; }
        .emres-linea { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--bg-surface); }
        .emres-linea span { height: 100%; }
        .emres-linea .man { background: color-mix(in srgb, var(--primary) 45%, var(--bg-surface)); }
        .emres-esc { position: relative; height: 16px; margin-top: 3px; font: 600 10.5px var(--font-mono); color: var(--text-muted); }
        .emres-esc span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
        .emres-esc span:first-child { transform: none; } .emres-esc span:last-child { transform: translateX(-100%); }
        .emres-ley { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
        .emres-ley i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
        .emres-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: stretch; }
        .emres-fila { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; padding: 4px 10px; }
        .emres-fila.est { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 8px 10px; }
        .emres-fila .emv-pin { width: 24px; height: 24px; font-size: 11px; line-height: 20px; box-shadow: none; }
        .emres-nom { color: var(--text-title); font-weight: 600; line-height: 1.3; }
        .emres-det { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
        .emres-hora { text-align: right; font: 600 var(--fs-md) var(--font-mono); color: var(--text-title); line-height: 1.3; }
        .emres-hora small { display: block; font: 400 10.5px var(--font-sans); color: var(--text-muted); }
        .emres-tramo { margin: 4px 0 4px 21px; padding: 4px 0 4px 16px; border-left: 2px dashed var(--border-hover); font-size: var(--fs-xs); color: var(--text-muted); }
        /* isolation: las capas del mapa (que van muy arriba) quedan adentro del recuadro y no tapan el título fijo de la ventana */
        .emres-mapa { min-height: 360px; border-radius: 12px; overflow: hidden; background: var(--bg-surface); position: relative; z-index: 0; isolation: isolate; }
        .emres-mapa .leaflet-tooltip.emres-etq { background: #0f1a1d; color: var(--c-blanco); border: 1px solid #2a3a3f; border-radius: 6px; font: 600 11px var(--font-sans); padding: 2px 7px; box-shadow: none; }
        .emres-mapa .leaflet-tooltip.emres-etq::before { display: none; }
        .emres-pie { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--border-subtle);
                     font-size: var(--fs-xs); color: var(--text-muted); }
        @media (max-width: 760px) { .emres-kpis { grid-template-columns: 1fr 1fr; } .emres-cuerpo { grid-template-columns: 1fr; } .emres-mapa { min-height: 260px; order: -1; }
                                    .emres-cab { flex-wrap: wrap; } }
        .emv-pin-base { background: var(--c-tinta); color: var(--c-blanco); font-size: 14px; }
        .em-punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; flex-shrink: 0; }
        .em-ley { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: var(--fs-xs); color: var(--text-muted); }
        .em-viaje-fila { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-subtle); cursor: pointer; }
        .em-viaje-fila:hover b { color: var(--primary); }
        .em-sensores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
        .em-sensor { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); padding: 4px 0; }
        .em-sensor .hint { margin-left: auto; font-family: var(--font-mono); }
        .em-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); font-weight: 600; flex-wrap: wrap; }
        .em-banner a { color: var(--primary); }
        .em-seccion { margin-top: 16px; }
        .em-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
                   border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); }
        .pq-dato .em-chip { display: inline-flex; font-size: var(--fs-xs); color: var(--text-title); text-transform: none; letter-spacing: 0; }
        .pq-dato .em-chip .em-punto { display: inline-block; margin-right: 6px; }
        .em-seccion a, .em-banner a { color: var(--primary); }
        .pq-dato.em-ubic { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
        .pq-dato .em-obs { white-space: pre-line; color: var(--text-body); margin-top: 2px; }   /* observaciones de la estación, debajo de la ubicación */
        .em-ubic-fila { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-top: 2px; }
        .em-ubic-fila .ico { color: var(--primary); }
        .em-ubic-fila b { font-family: var(--font-mono); }
        .em-ubic-fila a { color: var(--primary); }
        .em-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; }
        .em-stp { display: flex; flex-direction: column; gap: 4px; }
        .em-stp-fila { display: grid; grid-template-columns: 26px minmax(0, 1fr) 150px minmax(0, 0.8fr); gap: 6px; align-items: center; font-size: var(--fs-sm); }
        .em-unid { position: relative; display: block; min-width: 0; }
        .em-res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
        .em-res button { min-height: 2.375rem; border-radius: 8px; border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-muted);
                         font: 600 0.8rem var(--font-mono); cursor: pointer; }
        .em-res button:hover { color: var(--text-title); border-color: var(--border-hover); }
        .em-res button[aria-pressed="true"] { color: var(--text-title); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 18%, var(--bg-card)); }
        .em-res button[data-res="NO"][aria-pressed="true"] { border-color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 16%, var(--bg-card)); }
        .em-res button[data-res="FALLA"][aria-pressed="true"] { border-color: var(--em-media); background: color-mix(in srgb, var(--em-media) 18%, var(--bg-card)); }
        .em-res-2 { grid-template-columns: 52px 72px; flex: none; }
        .em-sensor:has(> .em-res) { justify-content: space-between; flex-wrap: nowrap !important; }
        .em-sensor:has(> .em-res) .em-sensor-nom { flex-basis: auto !important; }
        @media (max-width: 760px) { .em-res button { min-height: 2.75rem; } }
        .em-unid input { width: 100%; padding-right: 2.75rem; text-align: right; font-family: var(--font-mono); }
        .em-unid span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font: 600 0.8rem var(--font-mono); pointer-events: none; }
        .em-stp-n { color: var(--text-muted); font-family: var(--font-mono); text-align: right; }
        .em-fotos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
        .em-foto { position: relative; }
        .em-foto img { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; }
        .em-foto button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.65); color: var(--c-blanco); cursor: pointer; line-height: 1; }
        /* celular: el texto del ítem usa todo el renglón; abajo, la observación (o la medida) y OK / SI / NO. El número del ítem no se muestra */
        @media (max-width: 760px) {
            .em-stp-fila { grid-template-columns: minmax(0, 1fr) 132px; }
            .em-stp-fila > .em-stp-n { display: none; }
            .em-stp-fila > .em-stp-d { grid-column: 1 / -1; }
            .em-stp-fila > .em-res { grid-column: 2; grid-row: 2; }
            .em-stp-fila > .em-stp-o, .em-stp-fila > .em-unid.o { grid-column: 1; grid-row: 2; }
            .em-stp-fila:has(> .emf-campo) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .em-stp-fila > .emf-campo { grid-row: 2; }
        }
        @media (max-width: 360px) { .em-stp-fila { grid-template-columns: minmax(0, 1fr) 120px; } }   /* celulares chicos: más lugar para la observación */
        .em-rc-header { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
        #em-rc-fechas { font-size: var(--fs-xs); color: var(--text-muted); margin: 2px 0 0; }
        .em-franja { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin: 12px 0 0; padding: 10px 14px;
                     background: color-mix(in srgb, var(--c) 7%, var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 12px; }
        .em-franja b { font-size: var(--fs-xl); color: var(--c); margin-right: 4px; }
        .em-franja .em-franja-rc { margin-left: auto; font-size: var(--fs-xs); color: var(--text-muted); }
        .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
        .em-ley .em-punto-alta { width: 13px; height: 13px; }
        .em-franja-por { flex-basis: 100%; font-size: var(--fs-sm); color: var(--text-body); }
        .em-falla-ayuda { margin: 0 0 4px; }
        .em-btn-sub { color: var(--text-muted); font-weight: 400; }
        .em-sub { font-weight: 400; color: var(--text-muted); }
        .em-sens-chips { display: flex; flex-wrap: wrap; gap: 6px; }
        .em-sens-edit { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr); gap: 6px 14px; align-items: center; font-size: var(--fs-md); }
        .em-sens-edit > span { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
        .em-sens-edit input[type=checkbox] { justify-self: center; width: 16px; height: 16px; }
        .em-sens-edit .em-serie-in { font-family: var(--font-mono, monospace); padding: 5px 8px; }
        .em-sens-edit.em-sens-mal { grid-template-columns: minmax(0, 1fr) auto; max-width: 360px; }
        .em-series-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 14px; }
        .em-series-edit .form-group { margin: 0; }
        .em-series-edit .em-serie-in { font-family: var(--font-mono, monospace); text-transform: uppercase; }
        .em-sens-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-subtle); font-size: var(--fs-sm); color: var(--text-body); }
        .em-sens-chip.mal { border-color: var(--em-media); color: var(--em-media); font-weight: 600; }
        .em-serie { display: inline; font-family: var(--font-mono, monospace); font-size: var(--fs-xs); color: var(--text-muted); font-weight: 400; }
        .em-sin-serie .em-serie { display: none; }   /* los N° de serie se ven de entrada; el botón los oculta */
        /* grilla de sensores de la ficha: verde sin fallas, violeta posible falla, rojo no funciona, gris sin datos */
        .em-sens-grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
        .em-sens { --c: var(--em-ok); display: flex; align-items: center; flex-wrap: wrap; gap: 2px 7px; padding: 6px 10px; border-radius: 8px; font-size: var(--fs-sm);
                   background: var(--bg-card); border: 1px solid var(--border-subtle); color: var(--text-body); min-width: 0; }
        .em-sens .em-punto, .em-sens-ley .em-punto { width: 8px; height: 8px; margin: 0; border-radius: 50%; flex: none; background: var(--c); }
        .em-sens-nom { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .em-sens-est { font-size: var(--fs-xs); color: var(--c-txt); white-space: nowrap; }
        .em-sens .em-serie { flex-basis: 100%; padding-left: 15px; }
        .em-sens-posible { --c: var(--em-posible); --c-txt: var(--tx-e9d5ff); }
        .em-sens-mal { --c: var(--c-rojo); --c-txt: var(--tx-fda4af); }
        .em-sens-sin { --c: #4b5d63; --c-txt: var(--text-muted); }
        .em-sens.em-sens-posible, .em-sens.em-sens-mal { background: color-mix(in srgb, var(--c) 8%, transparent); border-color: color-mix(in srgb, var(--c) 45%, transparent); color: var(--text-title); }
        .em-sens.em-sens-sin { background: transparent; border-style: dashed; color: var(--text-muted); }
        .em-sens-ley { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: var(--fs-xs); color: var(--text-muted); }
        .em-sens-ley > span { display: inline-flex; align-items: center; gap: 5px; }
        .em-sens-ley .em-sens-ok { --c: var(--em-ok); }
        .em-ver-serie-btn { margin-left: 8px; border: 0; background: none; color: var(--primary); font-size: var(--fs-xs); cursor: pointer; text-transform: none; letter-spacing: 0; padding: 0; }
        .em-seccion:not(.em-sin-serie) .em-ver-serie-btn { color: var(--text-muted); }
        @media (max-width: 760px) { .em-ver-serie-btn { padding: 10px 6px; margin: -10px 0 -10px 4px; } }   /* celular: más fácil de tocar, sin agrandar el título */
        .em-franja span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-md); color: var(--text-body); }
        .em-franja .ico { width: 15px; height: 15px; color: var(--text-muted); }
        @media (max-width: 760px) { .em-rc-header .btn { padding: 0.25rem 0.5rem; font-size: var(--fs-xs); } }
        .emv-card { padding: 1rem; margin-bottom: 16px; max-width: 1000px; }
        #emv-card { overflow: visible; }   /* la barra del total queda fija abajo (sticky no anda dentro de un overflow) */
        .emv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 14px; }
        /* con la primera estación aparece el mapa: en la PC va a la derecha y acompaña al bajar; en el celular, debajo */
        .emv-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; align-items: start; }
        @media (min-width: 1001px) {
            .emv-card:has(#emv-mapa:not(.oculto)) { max-width: none; }
            .emv-cuerpo:has(> #emv-mapa:not(.oculto)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
            .emv-cuerpo > #emv-mapa { position: sticky; top: 84px; height: min(560px, calc(100vh - 220px)); }
        }
        .emv-sec-tit { margin: 0 0 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
        .emv-nodo-base { color: var(--text-body); }
        .emv-nodo-base > .ico { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
        .emv-vacio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin-top: 8px; padding: 18px 12px;
                     border: 1px dashed var(--border-hover); border-radius: 10px; }
        .emv-vacio > .ico { width: 24px; height: 24px; color: var(--text-muted); }
        .emv-vacio b { color: var(--text-title); }
        .emv-buscar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
        .emv-buscar input { flex: 1 1 240px; min-width: 0; }
        .emv-sug-nom { flex: 1; min-width: 0; }
        .emv-sug-nom .em-chip { margin-left: 4px; vertical-align: 1px; }
        .emv-sug-hora { text-align: right; white-space: nowrap; }
        .emv-sug-add { flex: none; }
        /* barra de abajo: el total y los botones, siempre a la vista mientras se arma el viaje */
        .emv-pie { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 16px -16px -16px; padding: 12px 16px;
                   background: var(--bg-surface); border-top: 1px solid var(--border-subtle); border-radius: 0 0 12px 12px; }
        .emv-totales { flex: 1 1 260px; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
        .emv-total { font-size: var(--fs-xl); color: var(--text-title); white-space: nowrap; }
        .emv-total-det { font-size: var(--fs-sm); color: var(--text-muted); }
        .emv-pie-btns { display: flex; gap: 8px; flex-wrap: wrap; }
        .emv-pie-btns .btn:disabled { opacity: 0.45; cursor: default; }
        .emv-nodo { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); padding: 4px 0; }
        .emv-tramo { margin-left: 4px; padding: 4px 0 4px 18px; border-left: 2px dashed var(--border-hover); font-size: var(--fs-xs); color: var(--text-muted); }
        .emv-acc { margin-left: auto; display: flex; gap: 4px; }
        .emv-acc button { border: 1px solid var(--border-subtle); background: transparent; color: var(--text-body); border-radius: 6px; width: 26px; height: 24px; cursor: pointer; }
        .emv-acc button:disabled { opacity: 0.3; cursor: default; }
        .emv-dur { width: 58px; height: 24px; padding: 0 6px; font-size: var(--fs-xs); font-family: var(--font-mono); text-align: center; }
        .emv-dur.cambiada { border-color: var(--primary); color: var(--primary); }
        .emv-hora { margin-left: 8px; font-size: var(--fs-xs); font-family: var(--font-mono); color: var(--primary); white-space: nowrap; }
        .emv-txt { flex: 1; min-width: 0; }
        .emv-txt .emv-hora { display: block; margin: 2px 0 0; }
        .emv-sugeridos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
        .emv-sugerido { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px; font-size: var(--fs-sm); }
        .emv-sugerido ol { margin: 6px 0 0; padding-left: 18px; }
        .emv-grupo { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 10px 0 2px; }
        .emv-sug { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
        .emv-viaje { padding: 10px 0; border-top: 1px solid var(--border-subtle); }
        .emv-paradas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
        .emv-parada { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; border: 1px solid var(--border-subtle); font-size: var(--fs-xs); }
        .emv-parada.hecha { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); padding-right: 10px; }
        @media (max-width: 1000px) { .emv-grid { grid-template-columns: 1fr; } }
        /* Dashboard de estaciones (opción B): mapa a todo el ancho y tres listas en columnas */
        #view-emdash .em-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }   /* mapa | últimos viajes */
        /* dashboard de estaciones (opción B1): mapa con filtros, al costado «Para revisar» y el próximo viaje */
        .emd-b1 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
        .emd-der { display: grid; gap: 20px; align-content: start; min-width: 0; }
        .emd-abajo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
        #view-emdash .table-wrap { margin: 0; }
        #view-emdash .em-mapa { height: 440px; border-radius: 0; }
        #view-emdash .em-ley { padding: 10px 16px; margin: 0; }
        .emd-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); }
        .emd-chip { min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border-subtle); background: none; font: inherit; font-size: var(--fs-xs);
                    color: var(--text-muted); cursor: pointer; }
        .emd-chip b { font-family: var(--font-mono); margin-left: 6px; }
        .emd-chip:hover { color: var(--text-title); border-color: var(--border-hover); }
        .emd-chip.activo { color: var(--text-title); border-color: var(--primary); background: var(--primary-glow); }
        .emd-barra { height: 6px; border-radius: 99px; background: var(--border-subtle); margin-top: 10px; overflow: hidden; }
        .emd-barra i { display: block; height: 100%; background: var(--success); }
        .emd-prox { padding: 6px 0; font-size: var(--fs-sm); }
        .emd-prox > p { padding: 8px 18px; }
        .emd-prox-item { display: grid; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; }
        .emd-prox-item:last-child { border-bottom: none; }
        /* «Para revisar» y «Próximos viajes»: tamaño fijo e igual (la mitad del alto del mapa cada una); lo que no entra se desplaza adentro */
        .emd-der > .table-wrap { min-height: 0; height: 300px; display: flex; flex-direction: column; overflow: hidden; }
        .emd-der #em-l-fallas, .emd-der #em-l-posibles, .emd-der #em-l-tiempo { flex: 1 1 0; min-height: 0; overflow-y: auto; }
        .emd-abajo .emd-prox { max-height: 300px; overflow-y: auto; }   /* muchos viajes: se desplaza adentro, la tarjeta no crece */
        @media (min-width: 1001px) {
            .emd-der { contain: size; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); align-content: stretch; }   /* el alto lo pone la tarjeta del mapa */
            .emd-der > .table-wrap { height: auto; }
        }
        .emd-prox-l { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-body); }
        .emd-prox-ruta { color: var(--text-title); line-height: 1.4; }
        .emd-mono { font-family: var(--font-mono); white-space: nowrap; }
        .emd-tabla td, .emd-tabla th { padding: 0.5625rem 0.875rem; font-size: var(--fs-sm); }
        .emd-est { color: var(--text-title); }
        @media (max-width: 1000px) { .emd-b1, .emd-abajo { grid-template-columns: 1fr; } #view-emdash .em-mapa { height: 340px; } }
        .emd-pestanas { justify-content: flex-start; flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
        .emd-pest { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid transparent;
                    background: none; font: inherit; font-size: var(--fs-md); font-weight: 600; color: var(--text-muted); cursor: pointer; }
        .emd-pest .ico { color: var(--c); }
        /* análisis de costos de los viajes: compacto, sin desplazar */
        .anv-periodos { padding: 0 0 6px; }
        .anv-filtro { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
        .anv-filtro input { min-width: 170px; }
        .anv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
        .anv-kpi { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px; min-width: 0; }
        .anv-kpi span { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
        .anv-kpi b { display: block; font-size: var(--fs-xl); font-family: var(--font-mono); color: var(--text-title); margin-top: 2px; overflow-wrap: anywhere; }
        .anv-kpi.grande { border-color: var(--primary); }
        .anv-kpi.doble { grid-column: span 2; }
        .anv-compo { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; margin-top: 12px; font-size: var(--fs-sm); }
        .anv-compo .der { text-align: right; font-family: var(--font-mono); }
        .anv-compo .total { font-weight: 700; border-top: 1px solid var(--border-subtle); padding-top: 4px; }
        .anv-kpis.anv-kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .anv-grafico { margin-top: 14px; }
        .anv-barras { display: flex; align-items: stretch; gap: 4px; height: 110px; margin-top: 4px; }
        .anv-barras > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
        .anv-barras i { display: block; background: var(--primary); border-radius: 3px 3px 0 0; opacity: 0.85; }
        .anv-barras span { font-size: var(--fs-xs); color: var(--text-muted); text-align: center; white-space: nowrap; overflow: hidden; border-top: 1px solid var(--border-subtle); padding-top: 2px; }
        .anv-aviso { margin-top: 12px; font-size: var(--fs-xs); color: var(--warning); border: 1px solid var(--warning); border-radius: 8px; padding: 6px 10px; }
        @media (max-width: 600px) { .anv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .anv-kpi b { font-size: var(--fs-lg); } }
        .emd-pest .em-lista-n { font-size: var(--fs-lg); }
        .emd-pest:hover { color: var(--text-title); }
        .emd-pest.activo { color: var(--text-title); background: color-mix(in srgb, var(--c) 10%, transparent); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
        .em-listas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; min-width: 0; }
        .em-lista { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
        .em-lista > div:last-child { flex: 1; display: flex; flex-direction: column; }   /* «Ver las N» siempre abajo de la tarjeta */
        .em-lista-tit { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
        .em-lista-tit :is(h3, h4) { margin: 0; font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
        .em-lista-tit :is(h3, h4) .ico { color: var(--c); }
        .em-lista-n { font-size: 1.5rem; font-weight: 700; font-family: var(--font-mono); color: var(--c); line-height: 1; }
        .em-fila { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-sm); cursor: pointer; }
        .em-fila:hover { background: rgba(var(--tinte), 0.03); }
        .em-fila-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-title); font-weight: 600; }
        .em-fila-dato { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
        .em-prio { padding: 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; font-family: var(--font-sans); }
        .em-prio-ALTA { background: var(--danger-glow); color: var(--danger); }
        .em-prio-MEDIA { background: var(--warning-glow); color: var(--warning); }
        .em-prio-BAJA { background: rgba(234, 179, 8, 0.15); color: var(--em-baja); }
        .em-prio-MUY-BAJA { background: rgba(96, 165, 250, 0.15); color: var(--em-tiempo); }
        .em-alerta-alta { background: rgba(249, 115, 22, 0.18); color: var(--tx-fb923c); }   /* posible falla: el rojo queda para lo confirmado */
        .em-alerta-media { background: var(--warning-glow); color: var(--warning); }
        .em-alerta-baja { background: rgba(96, 165, 250, 0.15); color: var(--em-tiempo); }
        .em-sistema { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; font-family: var(--font-sans);
                      background: rgba(192, 132, 252, 0.15); color: var(--em-sistema); white-space: nowrap; }
        .em-alerta { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); flex-wrap: wrap; }
        .em-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
        .em-tab { text-align: left; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px 14px; cursor: pointer; font: inherit; color: var(--text-muted); transition: 0.15s; }
        .em-tab span { display: block; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
        .em-tab b { display: block; font-size: var(--fs-2xl); font-family: var(--font-mono); color: var(--text-title); margin-top: 2px; }
        .em-tab:hover { border-color: var(--border-hover); }
        .em-tab.activo { border-color: var(--c); box-shadow: inset 0 -3px 0 var(--c); color: var(--c); }
        .em-tab.activo b { color: var(--c); }
        .em-filas { display: flex; flex-direction: column; }
        .em-fila2 { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--border-subtle); }
        .em-fila2:hover { background: rgba(var(--tinte), 0.03); }
        .em-fila2-txt { flex: 1; min-width: 0; }
        .em-fila2-txt b { color: var(--text-title); }
        .em-fila2-motivo { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
        .em-fila2-motivo b { color: var(--text-body); font-weight: 600; }
        .em-fila2-dias { font-size: var(--fs-xs); font-family: var(--font-mono); color: var(--text-muted); white-space: nowrap; }
        .em-fila2-chip { white-space: nowrap; }
        @media (max-width: 760px) { .em-fila2 { flex-wrap: wrap; } .em-fila2-dias { margin-left: 22px; } }
        .em-informe { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-surface); }
        .em-informe-nom { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; margin-right: 2px; }
        .em-borrar-mant { color: var(--tx-fb7185); border-color: rgba(239, 68, 68, 0.4); margin-left: auto; }
        .emm-datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px 14px; }
        .emm-datos span { display: block; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
        .emm-datos b { font-size: var(--fs-md); }
        .emm-datos .emt-chip { display: inline-block; margin-top: 2px; }
        .emm-sec-ayuda { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
        .emm-sec { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; margin: 16px 0 6px; }
        .emm-fila { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border-subtle); }
        .emm-fila:last-of-type { border-bottom: 0; }
        .emm-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(56, 189, 248, 0.12); color: var(--em-viaje); }
        .emm-ic .ico { width: 20px; height: 20px; }
        .emm-fila-txt { flex: 1; min-width: 0; }
        .emm-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border-subtle); padding-top: 14px; margin-top: 14px; }
        @media (max-width: 600px) {
            .emm-datos { grid-template-columns: 1fr 1fr; }
            /* informes: el nombre usa todo el renglón; Ver y Word abajo, mitad y mitad */
            .emm-fila { flex-wrap: wrap; gap: 10px 12px; }
            .emm-fila .emm-fila-txt { flex: 1 1 calc(100% - 50px); }
            .emm-fila > .btn { flex: 1; justify-content: center; min-height: 2.75rem; }
            /* Corregir y Ver la ficha en un renglón; Borrar abajo, de todo el ancho */
            .emm-pie > div { flex: 1 1 100%; }
            .emm-pie .btn { flex: 1 1 auto; justify-content: center; min-height: 2.75rem; }
            .emm-pie .em-borrar-mant { margin-left: 0; flex-basis: 100%; }
            /* reemplazos: el nombre arriba; el N° de serie anterior → nuevo abajo, alineado con el nombre */
            .emt-reemp .emt-nom { flex-basis: calc(100% - 28px); min-width: 0; }
            .emt-vieja, .emt-reemp > .hint { margin-left: 28px; }
            .emt-vieja, .emt-nueva { overflow-wrap: anywhere; }
        }
        .word-cuerpo { flex: 1; overflow: auto; border-radius: 10px; background: #525659; }
        .word-cuerpo .docx-wrapper { background: #525659; padding: 16px; }
        .word-cuerpo .docx-wrapper > section.docx { box-shadow: 0 2px 10px rgba(0, 0, 0, calc(.4 * var(--sombra))); margin-bottom: 16px; }
        .em-ver-todas { display: block; padding: 9px 14px; font-size: var(--fs-xs); color: var(--primary); margin-top: auto; }
        @media (max-width: 1000px) { .em-listas { grid-template-columns: 1fr; } }
        .em-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
        .em-modo { font-size: var(--fs-xs); font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
        .em-mant-form { padding: 12px 14px; border-radius: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); margin-bottom: 10px; }
        .em-mant { padding: 8px 0; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
        /* mantenimientos de la ficha: una tarjeta por mantenimiento */
        /* formulario de mantenimiento en pasos (pensado también para el celular, en la estación) */
        .emf-paso { border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-card); margin-top: 10px; }
        .emf-paso > summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; min-height: 52px; }
        .emf-paso > summary::-webkit-details-marker { display: none; }
        .emf-num { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
                   font: 700 0.85rem var(--font-mono); background: rgba(56, 189, 248, 0.14); color: var(--em-viaje); }
        .emf-tit { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
        .emf-tit b { color: var(--text-title); font-size: var(--fs-lg); }
        .emf-tit span { color: var(--text-muted); font-size: var(--fs-sm); }
        .emf-flecha { width: 18px; height: 18px; color: var(--text-muted); transition: transform 0.2s ease-out; flex: none; }
        .emf-paso[open] > summary .emf-flecha { transform: rotate(180deg); }
        .emf-paso[open] > summary { border-bottom: 1px solid var(--border-subtle); }
        .emf-cuerpo { padding: 14px; }
        .emf-sub { margin: 14px 0 8px; font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
        .emf-cuerpo > .emf-sub:first-child { margin-top: 0; }
        .emf-ayuda { margin: 0 0 8px; }
        .emf-nota { margin-top: 12px; }
        .emf-pie { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
        .em-sensor-nom { min-width: 150px; }
        /* secciones con resumen: número verde cuando está completa, texto naranja cuando falta algo */
        .emf-paso { scroll-margin-top: 76px; }
        .emf-paso.emf-ok .emf-num { background: color-mix(in srgb, var(--em-ok) 18%, transparent); color: var(--em-ok); }
        .emf-paso.emf-falta:not([open]) .emf-tit span { color: var(--warning); font-weight: 600; }
        /* sensores cambiados: etiquetas para tocar; solo se ve el casillero de los elegidos */
        .emf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
        .emf-chip { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-hover); background: transparent; color: var(--text-body);
                    font: 500 0.85rem var(--font-sans); cursor: pointer; }
        .emf-chip[aria-pressed="true"] { background: rgba(56, 189, 248, 0.14); border-color: var(--em-viaje); color: var(--em-viaje); }
        .emf-cambiados .em-sensor:not(.on) { display: none; }
        /* planilla simple del celular: una columna, controles del tamaño de un dedo, nada encimado (iPhone y Android) */
        .emcp-form { display: flex; flex-direction: column; gap: 18px; }
        .emcp-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
        .emcp-rot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-sm); font-weight: 600; color: var(--text-title); margin: 0; }
        .emcp-campo input, .emcp-campo textarea { width: 100%; min-width: 0; box-sizing: border-box; min-height: 2.75rem; font-size: 16px; }
        .emcp-dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }   /* si un rótulo ocupa 2 renglones, los campos quedan parejos */
        .emcp-hora { display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 46px; box-sizing: border-box; padding: 0 2px 0 12px;
                     border: 1px solid var(--border-hover); border-radius: 10px; background: var(--bg-body); }
        .emcp-hora b { flex: 1; min-width: 0; font: 600 1.15rem var(--font-mono); color: var(--text-title); }
        .emcp-campo .emcp-hora input { flex: 1; min-width: 0; min-height: 2.625rem; border: none; background: transparent; padding: 0; margin: 0;
                                       -webkit-appearance: none; appearance: none; font: 600 1.05rem var(--font-mono); color: var(--text-title); text-align: left; }
        .emcp-hora input::-webkit-date-and-time-value { text-align: left; }
        .emcp-hora input::-webkit-calendar-picker-indicator { display: none; }   /* el reloj de Chrome comía el lugar de la hora; al tocar, el celular abre el selector igual */
        .emcp-hora button { flex: none; width: 38px; height: 42px; border: none; border-radius: 8px; background: transparent; color: var(--text-body);
                            display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
        .emcp-tag { font: 600 0.66rem var(--font-sans); padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
        .emcp-tag.auto { color: var(--em-ok); background: color-mix(in srgb, var(--em-ok) 14%, transparent); }
        .emcp-tag.mano { color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, transparent); }
        .emcp-form .emf-chips { margin: 0; gap: 8px; }
        .emcp-form .emf-chip { min-height: 44px; font-size: 0.9rem; }
        .emcp-form .hint { margin: 0; }
        .emcp-error .emcp-rot { color: var(--danger); }
        .emcp-wa { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 10px 12px;
                   border: 1px dashed var(--border-hover); border-radius: 10px; font-size: var(--fs-sm); color: var(--text-body); }
        .emcp-wa > span { flex: 1 1 180px; min-width: 0; }
        .emcp-wa .ico { color: var(--em-ok); vertical-align: -0.15em; }
        .emcp-wa .btn { min-height: 2.5rem; }
        .emcp-error .emf-chips .emf-chip, .emcp-error input { border-color: var(--danger); }
        /* «Guardar» siempre a mano abajo (como en la planilla de la PC); el deslizamiento queda dentro de la ventana (en iPhone si no, se iba a la página de atrás) */
        #modal-emcampo .emcp-card { max-width: 560px; max-height: 94vh; overflow-y: auto; overscroll-behavior: contain; }
        /* en el celular, pantalla completa y se desliza la pantalla entera (no una ventana con su propio scroll adentro:
           en iPhone eso no deslizaba). Sin el desenfoque del fondo, que en Safari también traba el deslizamiento. */
        @media (max-width: 760px) {
            #modal-emcampo { align-items: stretch; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
                             backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg-surface); }
            /* en bloque (no flex): si no, la tarjeta quedaba del alto de la pantalla y el contenido seguía por fuera, sin fondo */
            #modal-emcampo.active { display: block; }
            #modal-emcampo .modal-card > .modal-header:first-child { top: 0; }   /* el título fijo arriba, entero */
            #modal-emcampo > .modal-card.emcp-card { max-height: none; min-height: 100%; height: auto; overflow: visible; border-radius: 0; border: 0;
                                                                         padding-top: 1.125rem; padding-bottom: 0; }
        }
        .emcp-pie { position: sticky; bottom: 0; z-index: 2; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--bg-surface);
                    border-top: 1px solid var(--border-subtle); }
        .emcp-pie .btn { width: 100%; min-height: 3rem; justify-content: center; }
        /* en la PC: lo que vino del celular, arriba de la planilla */
        .emcp-del { border: 1px solid color-mix(in srgb, var(--em-viaje) 45%, transparent); background: color-mix(in srgb, var(--em-viaje) 8%, transparent);
                    border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
        .emcp-del-datos { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; font-size: var(--fs-sm); }
        .emcp-del-datos span { color: var(--text-muted); }
        /* cada muestra: hora, señal y batería en un renglón */
        .emf-muestra { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px; align-items: end; padding: 8px 0; border-top: 1px solid var(--border-subtle); }
        .emf-muestra-tit { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--text-body); }
        .emf-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
        .emf-campo > label:first-child { font-size: var(--fs-xs); color: var(--text-muted); }
        .emf-campo input { width: 100%; min-width: 0; }
        .emf-muestra .em-unid input { padding-right: 1.625rem; }   /* columna angosta: la «V» no tapa el número */
        .emf-muestra .em-unid span { right: 8px; }
        .em-sensor .em-nuevo { flex: 1; min-width: 0; }
        @media (prefers-reduced-motion: reduce) { .emf-flecha { transition: none; } }
        @media (max-width: 760px) {
            /* en el celular: controles del tamaño de un dedo, sin zoom al tocar (16px) y los botones siempre a mano abajo */
            #emm-cuerpo input, #emm-cuerpo select, #emm-cuerpo textarea { min-height: 2.75rem; font-size: 16px; }
            .em-sensor { flex-wrap: wrap; }
            .em-sensor-nom { min-width: 0; flex-basis: 100%; }
            .emf-cuerpo { padding: 12px; }
            .emf-chip { min-height: 44px; }
            #emm-form > .table-wrap { overflow: visible; }   /* sin esto, «Anotar mantenimiento» no queda fijo abajo (sticky no anda dentro de un overflow) */
            /* Llegada: fecha sola; ingreso y salida juntos; ticket, localidad y técnico solos; km y tiempo juntos */
            .emf-llegada { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .emf-llegada > :nth-child(1), .emf-llegada > :nth-child(4), .emf-llegada > :nth-child(5), .emf-llegada > :nth-child(6) { grid-column: 1 / -1; }
            .emf-mediciones .em-stp-o:not(.em-oblig-in) { display: none; }   /* en las muestras, la observación casi no se usa: no ocupa lugar */
            /* sin la tarjeta de afuera: las secciones ya son tarjetas, y así los casilleros ganan ancho */
            #emm-form > .table-wrap { padding: 0 !important; border: 0; background: none; box-shadow: none; }
            /* muestras: la señal son 3 números (angosta); la hora sin el relojito (al tocarla se abre igual) y sin ancho mínimo (iPhone) */
            .emf-muestra { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); }
            .emf-muestra input[type=time] { -webkit-appearance: none; appearance: none; padding: 0 0.625rem; text-align: left; }
            .emf-muestra input[type=time]::-webkit-calendar-picker-indicator { display: none; }
            .emf-muestra input[inputmode=numeric] { text-align: center; padding: 0 0.375rem; }
            .emf-campo .em-unid input, .em-stp-fila .em-unid input { padding-left: 0.625rem; }
            /* batería nueva: el N° de serie y cuál es, uno abajo del otro */
            .emf-cambiados .em-sensor select, .emf-cambiados .em-sensor .sel-boton { flex: 1 1 100%; }
            .emf-pie { position: sticky; bottom: 0; z-index: 2; margin: 14px -12px 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
                       background: var(--bg-surface); border-top: 1px solid var(--border-subtle); }
            .emf-pie .btn { flex: 1; justify-content: center; min-height: 2.875rem; min-width: 0; padding: 0 0.75rem; white-space: normal; line-height: 1.15; }   /* en pantallas angostas el texto baja de renglón en vez de salirse */
            .emf-pie .btn-success { flex: 2; }
            /* viaje: «+ Incidencia» y las flechas del planificador, fáciles de tocar */
            .emv-inc { padding: 8px 12px; font-size: var(--fs-sm); }
            .emv-lin-fila { min-height: 56px; }
            /* viaje en el celular: la acción principal queda fija abajo, a mano del pulgar */
            #emv-curso .emv-grande { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; margin: 0; z-index: 40;
                                     box-shadow: 0 10px 28px rgba(0, 0, 0, calc(0.5 * var(--sombra))); }
            #emv-curso:has(.emv-grande) { padding-bottom: 88px; }
            .emv-acc button { width: 40px; height: 40px; }
        }
        .emt-grupo { display: grid; gap: 10px; }
        /* planificador: cerrar arriba, las reglas como datos y lo secundario en «Más» */
        .emv-card { position: relative; }
        .emv-cab { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
        .emv-cab-tit { flex: 1 1 260px; min-width: 0; align-self: center; }
        .emv-cerrar { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-subtle);
                      background: transparent; color: var(--text-body); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1; }
        .emv-cerrar:hover { color: var(--text-title); border-color: var(--border-hover); }
        .emv-reglas { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-body); }
        .emv-como summary { color: var(--primary); cursor: pointer; font-size: var(--fs-sm); }
        .emv-como p { margin: 6px 0 0; max-width: 70ch; }
        .emv-mas { position: relative; }
        .emv-mas > summary { list-style: none; }
        .emv-mas > summary::-webkit-details-marker { display: none; }
        .emv-mas[open] > summary .ico { transform: rotate(180deg); }
        .emv-mas-menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; width: 250px; display: grid; gap: 10px; padding: 12px;
                        border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface); box-shadow: 0 10px 28px rgba(0, 0, 0, calc(0.35 * var(--sombra))); }
        .emv-vaciar { color: var(--tx-fda4af); justify-content: center; }
        .emv-cargando { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
        .emv-sin-senal { border-color: color-mix(in srgb, var(--warning) 50%, transparent); background: color-mix(in srgb, var(--warning) 9%, transparent); flex-wrap: wrap; }
        .emt { border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-card); padding: 14px 16px; }
        .emt-cab { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
        .emt-fecha { width: 58px; flex: none; text-align: center; border-radius: 10px; background: rgba(56, 189, 248, 0.12); padding: 6px 0; }
        .emt-fecha b { display: block; font-size: var(--fs-2xl); line-height: 1.1; color: var(--text-title); }
        .emt-fecha span { font-size: var(--fs-xs); color: var(--tx-7dd3fc); text-transform: uppercase; letter-spacing: 0.04em; }
        .emt-quien { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
        .emt-quien b { color: var(--text-title); font-size: var(--fs-lg); }
        .emt-quien span { color: var(--text-muted); font-size: var(--fs-sm); }
        .emt-chip { font-size: var(--fs-xs); font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(249, 115, 22, 0.18); color: var(--tx-fdba74); }
        .emt-chip.ok { background: rgba(34, 197, 94, 0.15); color: var(--tx-86efac); }
        .emt-lista { display: grid; gap: 6px; margin-top: 12px; }
        .emt-reemp { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--bg-surface); flex-wrap: wrap; }
        .emt-reemp .ico { width: 18px; height: 18px; color: var(--warning); flex: none; }
        .emt-nom { flex: 1; min-width: 120px; color: var(--text-title); font-size: var(--fs-md); }
        .emt-vieja { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-muted); text-decoration: line-through; }
        .emt-flecha { color: var(--text-muted); }
        .emt-nueva { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--tx-86efac); font-weight: 600; }
        .emt-nota { margin-top: 10px; font-size: var(--fs-sm); color: var(--text-body); white-space: pre-line; }
        .emt-acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
        .emt-inf { display: inline-flex; }
        .emt-inf .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
        .emt-inf .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; }
        .emt-mas { margin-top: 10px; }
        @media (max-width: 600px) {
            /* tarjeta del mantenimiento en el celular: la etiqueta (Preventivo / N reemplazos) baja abajo del título, así el texto no queda apretado */
            .emt { padding: 12px; }
            .emt-cab .emt-quien { flex-basis: calc(100% - 70px); }
            .emt-cab > .emt-chip { margin-left: 70px; }
            /* cada informe en su renglón; Corregir y el tacho abajo */
            .emt-acc > .emt-inf { flex: 1 1 100%; }
            .emt-inf .btn:first-child { flex: 1; }
            .emt-acc .btn { min-height: 2.75rem; }
            .emt-acc > .btn:not(.em-borrar-mant) { flex: 1; justify-content: center; }
            .emt-acc > .em-borrar-mant { min-width: 44px; justify-content: center; }
        }
        .em-mant-cab { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
        .em-mant-res { margin-top: 4px; }
        .em-mant-res > span { color: var(--text-muted); font-size: var(--fs-xs); }
        .em-mant-res ul { margin: 2px 0 0; padding-left: 18px; }
        .em-mant-res b { color: var(--text-title); font-weight: 600; }
        .em-mant-serie { font-family: var(--font-mono); font-size: var(--fs-xs); }
        .em-seccion :is(h3, h4) { margin: 0 0 8px; font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
        @media (max-width: 1000px) { .em-grid { grid-template-columns: 1fr; } .em-mapa { height: 320px; } .em-sensores { grid-template-columns: 1fr; } }
        /* franja de color arriba de todo */
        body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10040; background: var(--c-turquesa); pointer-events: none; }
        body[data-deposito="ST"]::before { background: var(--c-ambar); }
        body[data-deposito="EM"]::before { background: #38bdf8; }
        /* El color de cada módulo marca solo dónde estás (franja de arriba, menú, pestañas, selector). Los botones y las acciones usan siempre
           el verde azulado de la marca: antes en Estaciones eran del mismo celeste que «En curso» y en Servicio Técnico del ámbar de las advertencias. */
        body[data-deposito="EM"] .nav-btn.active { background: rgba(56, 189, 248, 0.12); color: var(--tx-7dd3fc); border-color: rgba(56, 189, 248, 0.32); }
        body[data-deposito="EM"] .tab.active, body[data-deposito="EM"] .segmentado button.activo { background: rgba(56, 189, 248, 0.15); color: var(--tx-7dd3fc); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35); }
        body[data-deposito="ST"] .nav-btn.active { background: rgba(245, 158, 11, 0.12); color: var(--tx-fcd34d); border-color: rgba(245, 158, 11, 0.32); box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.08); }
        body[data-deposito="ST"] .tab.active, body[data-deposito="ST"] .segmentado button.activo { background: rgba(245, 158, 11, 0.15); color: var(--tx-fcd34d); box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35); }
        body[data-deposito="ST"] .brand-icon { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.3)); }
        .perm-par { display: inline-flex; gap: 14px; justify-content: center; align-items: center; }
        .perm-par input.perm-ing, .perm-table input.perm-ing { accent-color: var(--c-turquesa); }
        .perm-par input.perm-st, .perm-table input.perm-st { accent-color: var(--c-ambar); }
        .perm-par input.perm-em, .perm-table input.perm-em { accent-color: #38bdf8; }
        .perm-par input.perm-adm, .perm-table input.perm-adm { accent-color: var(--c-lila); }
        .perm-sub { display: flex; gap: 14px; justify-content: center; margin-top: 3px; font-size: var(--fs-xs); letter-spacing: 0.06em; }
        .perm-sub .ing, .perm-leyenda.ing { color: var(--tx-2dd4bf); font-weight: 700; }
        .perm-sub .st, .perm-leyenda.st { color: var(--tx-fbbf24); font-weight: 700; }
        .perm-leyenda.em { color: var(--tx-38bdf8); font-weight: 700; }
        .badge-tec { background: rgba(139, 92, 246, 0.14); color: var(--tx-c4b5fd); border: 1px solid rgba(139, 92, 246, 0.35); font-size: var(--fs-xs); }
        .dash-rep { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px 18px; border-radius: 12px;
                    background: var(--bg-card); border: 1px solid var(--border-subtle); }
        .dash-rep-tit { font-weight: 600; color: var(--text-title); display: flex; align-items: center; gap: 8px; }
        .dash-rep-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-right: auto; }
        /* Parque de máquinas */
        .pq-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
        .pq-kpi { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px 14px; }
        .pq-kpi b { display: block; font-size: var(--fs-2xl); color: var(--text-title); font-family: var(--font-mono); }
        .pq-kpi span { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
        .badge-pq-PENDIENTE { background: rgba(245, 158, 11, 0.16); color: var(--tx-fbbf24); }
        .badge-pq-INSTALADO { background: var(--success-glow); color: var(--tx-86efac); }
        .badge-pq-ANULADO, .badge-pq-BAJA { background: rgba(148, 163, 184, 0.15); color: var(--tx-cbd5e1); }
        /* Etapas del comisionamiento: por comisionar → por entregar → entregado */
        .badge-etapa-COMISIONAR { background: rgba(245, 158, 11, 0.16); color: var(--tx-fbbf24); }
        .badge-etapa-ENTREGAR { background: rgba(56, 189, 248, 0.15); color: var(--tx-7dd3fc); }
        .badge-etapa-ENTREGADO { background: var(--success-glow); color: var(--tx-86efac); }
        .badge-etapa-BAJA, .badge-etapa-ANULADO { background: rgba(148, 163, 184, 0.15); color: var(--tx-cbd5e1); }
        .pq-pasos { display: flex; align-items: center; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
        .pq-paso { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); }
        .pq-paso > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
        .pq-paso-num { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 700;
                       border: 1.5px solid var(--border-subtle); flex-shrink: 0; }
        .pq-paso.hecho { color: var(--text-body); }
        .pq-paso.hecho .pq-paso-num { background: var(--success-glow); border-color: rgba(34, 197, 94, 0.5); color: var(--tx-86efac); }
        .pq-paso.actual { color: var(--text-title); }
        .pq-paso.actual .pq-paso-num { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
        .pq-paso-linea { flex: 1 1 24px; min-width: 16px; max-width: 80px; height: 1.5px; background: var(--border-subtle); }
        .pq-entrega { margin: 12px 0; border-color: rgba(0, 173, 154, 0.35); }
        .pq-clientes { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
        .pq-cli-lista { padding: 10px; max-height: 70vh; overflow-y: auto; }
        .pq-cli-lista input { width: 100%; margin-bottom: 8px; }
        .pq-cli-item { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: var(--fs-md); }
        .pq-cli-item:hover { background: rgba(var(--tinte), 0.04); }
        .pq-cli-item.activo { background: var(--primary-glow, rgba(245, 158, 11, 0.14)); color: var(--primary); font-weight: 700; }
        .pq-inst { border: 1px solid var(--border-subtle); background: var(--bg-card); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
        .pq-inst:hover { border-color: var(--primary); }
        .pq-inst-tit { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 600; color: var(--text-title); margin-bottom: 8px; font-size: var(--fs-md); }
        .pq-inst-eq { display: flex; gap: 8px; flex-wrap: wrap; }
        .pq-inst-eq > div { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 9px; padding: 7px 10px; min-width: 170px; font-size: var(--fs-sm); }
        .pq-datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
        .pq-dato span { display: block; font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
        .pq-dato b { font-weight: 600; color: var(--text-title); font-size: var(--fs-md); }
        .pq-aviso { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 10px; background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.35); color: var(--tx-fcd34d); font-size: var(--fs-sm); margin: 10px 0; }
        .pq-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
        .pq-checks { display: flex; flex-direction: column; gap: 5px; }
        .pq-check { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border: 1px solid var(--border-subtle); border-radius: 8px; font-size: var(--fs-sm); color: var(--text-muted); }
        .pq-check.on { color: var(--text-title); }
        @media (pointer: coarse) { input, select, textarea, .sel-boton, .combo-input { font-size: 16px !important; } }   /* iPhone acostado (más de 760 px): sin zoom al tocar un campo */
        .pq-check .x { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border-hover); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; flex: none; }
        .pq-check.on .x { background: var(--primary); border-color: var(--primary); color: #111; }
        .pq-check .hint { margin-left: auto; }
        .pq-form-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
        .pq-col { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px 14px; min-width: 0; }
        .pq-col-tit { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
        .pq-comp { padding: 7px 0; border-bottom: 1px solid var(--border-subtle); }
        .pq-comp:last-of-type { border-bottom: 0; }
        .pq-comp-mat { margin-top: 6px; }
        .pq-comp-origen { display: inline-flex; margin-top: 6px; padding: 3px; }
        .pq-comp-origen button { padding: 0.3125rem 0.6875rem; font-size: var(--fs-xs); }
        .pq-comp-nota { margin-top: 4px; font-size: var(--fs-xs); }
        .pq-ver { display: flex; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-md); }
        .pq-adic { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
        .pq-adic > div:first-child { flex: 1 1 100% !important; }
        .pq-adic > select { flex: 1; min-width: 0; }
        .cfg-pq-comp { display: flex; gap: 10px; align-items: center; }
        .cfg-pq-comp input[type=text] { flex: 1; }
        @media (max-width: 1000px) { .pq-kpis { grid-template-columns: repeat(2, 1fr); } .pq-clientes, .pq-form-cols, .pq-2col { grid-template-columns: 1fr; } .pq-datos { grid-template-columns: 1fr 1fr; } }

        .carpeta-ruta { font-family: var(--font-mono); font-size: var(--fs-sm); padding: 8px 12px; border-radius: 8px; background: rgba(var(--tinte),0.04); border: 1px solid var(--border-subtle); word-break: break-all; margin-bottom: 8px; }
        .carpeta-lista { max-height: 340px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: 10px; }
        .carpeta-lista button { display: flex; align-items: center; gap: 0.625rem; width: 100%; border: 0; border-bottom: 1px solid var(--border-subtle); background: transparent;
                                color: var(--text-body); font: inherit; font-size: var(--fs-sm); padding: 0.5625rem 0.75rem; cursor: pointer; text-align: left; }
        .carpeta-lista button:hover { background: rgba(var(--tinte),0.05); color: var(--text-title); }
        .carpeta-lista button .ico { color: var(--tx-fbbf24); flex-shrink: 0; }
        .rep-pasos { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
        .rep-pasos button { flex: 1 1 120px; border: 1px solid var(--border-subtle); background: rgba(var(--tinte),0.03); color: var(--text-muted); font: inherit;
                            font-size: var(--fs-xs); font-weight: 600; padding: 0.5625rem 0.5rem; border-radius: 8px; cursor: pointer; }
        .rep-pasos button.hecho { color: var(--text-body); border-color: var(--primary-glow); }
        .rep-pasos button.actual { background: var(--primary); color: #0b1514; border-color: var(--primary); }
        .rep-pasos button:disabled { cursor: default; }
        .rep-historial { font-size: var(--fs-sm); max-height: 200px; overflow-y: auto; }
        .rep-historial div { padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
        .rep-historial .f { color: var(--text-muted); font-family: var(--font-mono); font-size: var(--fs-xs); }
        /* Ficha de reparación por etapas: hecha (resumen), actual (abierta y resaltada), futura (apagada) */
        .rep-etapas { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
        .rep-etapa { border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface); overflow: hidden; transition: border-color 0.15s; }
        .rep-etapa-cab { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: none; border: none; color: inherit;
                         font: inherit; cursor: pointer; text-align: left; }
        .rep-etapa-cab:hover { background: rgba(var(--tinte),0.025); }
        .rep-etapa-num { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
                         font-size: var(--fs-xs); font-weight: 700; border: 1px solid var(--border-hover); color: var(--text-muted); }
        .rep-etapa-tit { font-weight: 700; color: var(--text-title); font-size: var(--fs-md); flex-shrink: 0; }
        .rep-etapa-res { flex: 1; min-width: 0; color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .rep-etapa-flecha { color: var(--text-muted); transition: transform 0.15s; flex-shrink: 0; }
        .rep-etapa-cuerpo { display: none; padding: 4px 14px 14px; border-top: 1px solid var(--border-subtle); }
        .rep-etapa.abierta .rep-etapa-cuerpo { display: block; }
        .rep-etapa.abierta .rep-etapa-flecha { transform: rotate(180deg); }
        .rep-etapa.hecha .rep-etapa-num { background: var(--success-glow); border-color: rgba(34,197,94,0.5); color: var(--success); }
        .rep-etapa.actual { border-color: var(--warning); }
        .rep-etapa.actual .rep-etapa-num { background: var(--warning); border-color: var(--warning); color: #1a1205; }
        .rep-etapa.futura:not(.abierta) { opacity: 0.55; }
        .rep-etapa .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .rep-siguiente:empty { display: none; }
        .rep-siguiente { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 10px 14px;
                         border-radius: 10px; border: 1px solid rgba(245,158,11,0.4); background: var(--warning-glow); color: var(--tx-fde68a); font-size: var(--fs-sm); }
        .rep-siguiente.listo { border-color: rgba(34,197,94,0.4); background: var(--success-glow); color: var(--tx-bbf7d0); }
        .rep-siguiente ul { margin: 4px 0 0; padding-left: 18px; }
        .rep-pie { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
        @media (max-width: 760px) { .rep-etapa .form-grid { grid-template-columns: 1fr; } .rep-etapa-res { display: none; } }
        .aviso-serie { padding: 10px 14px; border-radius: 10px; font-size: var(--fs-sm); margin-top: 8px; background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.35); color: var(--tx-bfdbfe); }
        .badge-rep-RECIBIDO { background: rgba(148, 163, 184, 0.15); color: var(--tx-cbd5e1); }
        .badge-rep-DIAGNOSTICO { background: rgba(59, 130, 246, 0.15); color: var(--tx-93c5fd); }
        .badge-rep-REPARACION { background: var(--warning-glow); color: var(--tx-fcd34d); }
        .badge-rep-LISTO { background: var(--success-glow); color: var(--tx-86efac); }
        .badge-rep-ENTREGADO { background: rgba(var(--tinte),0.05); color: var(--text-muted); }
        .check-linea { display: flex !important; align-items: center; gap: 8px; cursor: pointer; }
        input::placeholder, textarea::placeholder { text-transform: none; }
        input::placeholder, textarea::placeholder { color: var(--text-faint); opacity: 0.7; font-style: italic; }   /* que un ejemplo no se confunda con un dato cargado */   /* el texto de ayuda se lee normal aunque el casillero escriba en mayúsculas */
        #moc-titulo > span { white-space: nowrap; }   /* el N° de OC y su estado no se parten en dos renglones */
        /* Lista de números de serie: una por renglón, la serie entera y el comentario como etiqueta a la derecha */
        .ser-lista { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: 8px; }
        .ser-lista label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 0; border-bottom: 1px solid var(--border-subtle);
                           font-family: var(--font-mono); font-size: var(--fs-sm); cursor: pointer; }
        .ser-lista label:last-child { border-bottom: none; }
        .ser-lista label:hover { background: var(--bg-surface-elevated); }
        .ser-lista label:has(input:checked) { background: var(--primary-glow); color: var(--text-title); }
        .ser-lista .ser-num { white-space: nowrap; }
        .ser-lista .ser-nota { margin-left: auto; font-family: var(--font-sans, inherit); font-size: var(--fs-xs); padding: 2px 9px; border-radius: 6px; white-space: nowrap;
                               overflow: hidden; text-overflow: ellipsis; max-width: 55%; background: rgba(245, 158, 11, 0.14); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
        .ser-lista > .hint { padding: 10px 12px; }
        .ser-chip { display: inline-block; font-family: var(--font-mono); font-size: var(--fs-xs); padding: 1px 6px; border-radius: 5px; margin: 2px 3px 0 0;
                    background: rgba(var(--tinte),0.06); border: 1px solid var(--border-subtle); color: var(--text-body); }
        .badge-sn { background: rgba(var(--tinte),0.06); color: var(--text-muted); border: 1px solid var(--border-subtle); font-size: var(--fs-xs); font-family: var(--font-mono); }
        .link-nuevo-mat { font-size: var(--fs-xs); font-weight: 600; color: var(--primary); text-decoration: none; white-space: nowrap; }
        .link-nuevo-mat:hover { text-decoration: underline; }
        .badge-nuevo { background: rgba(245, 158, 11, 0.15); color: var(--tx-fcd34d); border: 1px solid rgba(245, 158, 11, 0.4); font-size: var(--fs-xs); }
        /* Depósito en 3D */
        #modal-dep3d { z-index: 10010; }   /* se abre desde la ficha del material: va por encima */
        .modal-card.dep3d-card { width: min(1200px, 97vw); max-width: none; height: min(860px, 94vh); display: flex; flex-direction: column; padding: 0.875rem; gap: 0.625rem; }
        .dep3d-barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
        .dep3d-sel { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-xs); color: var(--text-muted); }
        .dep3d-sel select { min-width: 4.625rem; }
        .dep3d-lienzo { position: relative; flex: 1; min-height: 260px; border-radius: 12px; overflow: hidden; background: #0d1719; touch-action: none; }
        .dep3d-lienzo canvas { display: block; width: 100% !important; height: 100% !important; }
        .dep3d-aviso { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); text-align: center; padding: 20px; }
        .dep3d-info { padding: 10px 14px; border-radius: 10px; background: var(--primary-glow); color: var(--text-title); font-weight: 600; }
        .dep3d-info.dep3d-error { background: var(--danger-glow); }
        .dep3d-ayuda { font-size: var(--fs-xs); }
        @media (max-width: 760px) {
            .modal-card.dep3d-card { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; padding: 0.625rem; position: relative; }
            .modal-card.dep3d-card { height: 100dvh; max-height: 100dvh; }   /* dvh: con las barras del navegador a la vista, el título y la ✕ no quedan tapados (vh queda de respaldo) */
            .dep3d-barra > div:first-child { flex: 1 1 calc(100% - 44px) !important; }   /* el título arriba, solo; los selectores debajo */
            .dep3d-barra .modal-close { position: absolute; top: 8px; right: 8px; }
            .dep3d-sel select { min-width: 3.75rem; }
        }
        .aviso-incompletos { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; padding: 14px 18px; border-radius: 12px;
                             background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.4); color: var(--tx-fde68a); }
        .aviso-incompletos > .ico { width: 22px; height: 22px; color: var(--tx-fbbf24); flex-shrink: 0; margin-top: 2px; }
        .aviso-incompletos b { color: var(--tx-fef3c7); }
        .aviso-incompletos ul { margin: 8px 0 0; padding-left: 18px; font-size: var(--fs-sm); }
        .aviso-incompletos li { margin: 3px 0; }
        .aviso-incompletos a { color: var(--tx-fcd34d); font-weight: 600; }
        .confirmar-aviso { margin: 12px 0 0; padding: 12px 14px; font-size: var(--fs-sm); }
        .confirmar-aviso, .confirmar-aviso li { color: var(--text-body); }
        .confirmar-aviso b { color: var(--tx-fcd34d); }
        .confirmar-aviso > div > b:first-child { display: block; margin-bottom: 4px; }
        .confirmar-aviso .hint { margin-top: 6px; }
        /* Stock: materiales creados desde una OC con datos por completar */
        #tb-stock-master tr.fila-incompleta { background: rgba(245, 158, 11, 0.12); box-shadow: inset 3px 0 0 var(--c-ambar); }
        #tb-stock-master tr.fila-incompleta:hover { background: rgba(245, 158, 11, 0.2); }
        .badge-revisar { background: rgba(168, 85, 247, 0.15); color: var(--tx-d8b4fe); border: 1px solid rgba(168, 85, 247, 0.35); }
        .chk-revisar { display: inline-flex; cursor: pointer; padding: 4px; }
        .chk-revisar input { display: none; }
        .chk-revisar span { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-hover); background: var(--bg-surface-elevated);
                            display: inline-flex; align-items: center; justify-content: center; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s, filter 0.15s, opacity 0.15s; }
        .chk-revisar:hover span { border-color: var(--c-violeta); }
        .chk-revisar input:checked + span { background: var(--c-violeta); border-color: var(--c-violeta); }
        .chk-revisar input:checked + span::after { content: ''; width: 5px; height: 9px; border: solid var(--c-blanco); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
        #btn-solo-revisar.activo-revisar { border-color: var(--c-violeta); color: var(--tx-d8b4fe); background: rgba(168, 85, 247, 0.12); }
        #tb-ajuste td { padding-top: 0.4375rem; padding-bottom: 0.4375rem; }
        #tb-ajuste tr.fila-contada { background: rgba(0, 173, 154, 0.07); }
        #tb-ajuste tr.fila-contada td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
        .bna-box { margin: 4px 0 18px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-surface-elevated); }
        /* Personas: formulario fijo a la izquierda y la lista al lado (en el celular, uno debajo del otro) */
        .personas-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; margin-bottom: 24px; }
        .niveles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
        @media (max-width: 1000px) { .personas-grid { grid-template-columns: minmax(0, 1fr); } }
        /* listas principales todavía vacías mientras el servidor contesta (body.cargando lo pone api()) */
        /* (en el contenedor y no en la tabla: dentro de la tabla quedaba metido en la primera columna) */
        body.cargando .table-wrap:has(:is(#tb-stock-master, #tb-oc, #tb-prestamos, #tb-solicitudes, #tb-clientes, #tb-proveedores, #tb-herr, #tb-hegr, #tb-hing, #tb-ajuste,
                          #tb-emmant, #tb-estac, #tb-comis, #tb-rep):empty)::after {
            /* renglones grises que titilan suave (con la forma de la tabla) en vez del texto; el lector de pantalla sigue diciendo «Cargando…» */
            content: ''; content: '' / 'Cargando…'; display: block;   /* el primero, para Safari anterior a 17.4 */ height: 108px; margin: 16px;
            background: linear-gradient(90deg, transparent 25%, rgba(var(--tinte), 0.07) 50%, transparent 75%) 100% 0 / 300% 100%,
                        linear-gradient(rgba(148, 163, 184, 0.13), rgba(148, 163, 184, 0.13));
            -webkit-mask: repeating-linear-gradient(to bottom, var(--c-negro) 0 14px, transparent 14px 36px); mask: repeating-linear-gradient(to bottom, var(--c-negro) 0 14px, transparent 14px 36px);
            animation: brilloCarga 1.4s ease-in-out infinite; }
        @keyframes brilloCarga { to { background-position: 0 0, 0 0; } }
        .btn-menu { display: none; }
        .menu-fondo { display: none; }
        @media (max-width: 760px) {
            body { display: block; height: auto; min-height: 100vh; overflow: auto; }
            aside { position: fixed; top: 0; left: 0; bottom: 0; z-index: 10010; width: 270px; transform: translateX(-105%); transition: transform 0.22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, calc(0.6 * var(--sombra))); }
            body.menu-abierto aside { transform: none; }
            .btn-sm { min-height: 2.75rem; }   /* que se pueda tocar con el dedo sin errarle */
            .niveles-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
            /* Encabezado: el título usa el ancho; del módulo queda el punto de color (el nombre está en el menú que abre) */
            .dep-pill .dep-txt { display: none; }
            .dep-pill { min-height: 40px; padding: 8px 11px; }
            #em-rc-header { display: none; }   /* «Consultar ahora» y «Analizar sensores» están en el listado de Estaciones */
            /* cantidad impar de tarjetas: la primera (el dato principal, ej. el capital en USD) usa el renglón entero y las demás van de a dos */
            .kpi-grid > .kpi-card:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
            .kpi-value { white-space: nowrap; }
            /* Calendario: los días sin nada quedan en un renglón chico, así lo que hay se ve sin bajar tanto */
            .cal-agenda-dia:not(.cal-hoy):has(> .cal-vacio) { display: flex; align-items: baseline; gap: 10px; padding-top: 8px; padding-bottom: 8px; opacity: 0.7; }
            .cal-agenda-dia:not(.cal-hoy):has(> .cal-vacio) > * { margin: 0; }
            .kpi-top { gap: 8px; }
            .kpi-label { min-width: 0; }

            /* ===== Estaciones en el celular ===== */
            #view-emdash .em-grid { grid-template-columns: minmax(0, 1fr); }
            .emd-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }   /* filtros del mapa: una fila que se desliza */
            .emd-chips::-webkit-scrollbar { display: none; }
            .emd-chip { flex: none; min-height: 40px; }
            /* Últimos viajes del tablero: tarjetas (fecha y estado arriba, el recorrido debajo) */
            .emd-tabla, .emd-tabla tbody { display: block; }
            .emd-tabla thead { display: none; }
            .emd-tabla tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            .emd-tabla td { padding: 0; border: 0; }
            .emd-tabla td:nth-child(2) { justify-self: end; }
            .emd-tabla td.emd-est, .emd-tabla td:nth-child(4) { grid-column: 1 / -1; }
            /* Listado de estaciones: el nombre usa todo el ancho; los días y la prioridad van abajo */
            .em-fila2-txt { flex: 1 1 calc(100% - 30px); }
            .em-fila2-chip { margin-left: auto; }
            /* Mantenimientos: tarjetas con el día a la izquierda (como en la ficha); al lado la estación, N° y técnico, y etiquetas */
            #view-emmant table, #tb-emmant { display: block; }
            #view-emmant thead { display: none; }
            #tb-emmant tr { display: grid; grid-template-columns: 48px auto minmax(0, 1fr); column-gap: 12px; row-gap: 3px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            #tb-emmant td { padding: 0; border: 0; min-width: 0; }
            #tb-emmant td[colspan="6"] { grid-column: 1 / -1; }   /* «Todavía no hay mantenimientos…» */
            #tb-emmant td.emm-fecha { grid-column: 1; grid-row: 1 / span 3; align-self: start; }
            .emm-f-larga { display: none; }
            .emm-cal { display: flex; flex-direction: column; align-items: center; padding: 5px 0; border-radius: 10px; border: 1px solid var(--border-subtle);
                       background: var(--bg-surface-elevated); font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; }
            .emm-cal b { font-size: var(--fs-xl); line-height: 1.1; color: var(--text-title); font-family: var(--font-mono); }
            #tb-emmant td:nth-child(3) { grid-column: 2 / -1; grid-row: 1; font-size: var(--fs-lg); }
            #tb-emmant td:nth-child(3) b { color: var(--text-title); }
            #tb-emmant td.emm-num { grid-column: 2; grid-row: 2; font-size: var(--fs-xs); }
            #tb-emmant td:nth-child(4) { grid-column: 3; grid-row: 2; font-size: var(--fs-sm); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
            #tb-emmant td:nth-child(4)::before { content: '· '; }
            #tb-emmant td:nth-child(6) { grid-column: 2; grid-row: 3; }
            #tb-emmant td:nth-child(5) { grid-column: 3; grid-row: 3; font-size: var(--fs-xs); color: var(--text-body); }
            #tb-emmant td:nth-child(6) .hint, #tb-emmant td:nth-child(6) .badge { display: inline-block; padding: 2px 0.5rem; border-radius: 6px; font-size: var(--fs-xs); border: 1px solid var(--border-subtle); }
            #tb-emmant tr:not(.emm-pend) td:nth-child(5):has(> span.hint:only-child) { display: none; }   /* sin cambios de sensores: no muestra «—» */
            /* Falta cargar: tarjeta naranja con el botón «Cargar» de todo el ancho */
            #tb-emmant tr.emm-pend { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 10px 10px 4px; border-radius: 12px;
                                     border: 1px solid color-mix(in srgb, var(--em-media) 45%, transparent); background: color-mix(in srgb, var(--em-media) 9%, transparent); }
            #tb-emmant tr.emm-pend td { background: none; }
            #tb-emmant tr.emm-pend td:nth-child(1), #tb-emmant tr.emm-pend td:nth-child(2), #tb-emmant tr.emm-pend td:nth-child(4) { display: none; }
            #tb-emmant tr.emm-pend td:nth-child(3) .hint { color: var(--tx-fdba74); }
            #tb-emmant tr.emm-pend td:nth-child(5) { display: flex; flex-direction: column; align-items: flex-start; gap: 0.625rem; margin-top: 4px; }
            #tb-emmant tr.emm-pend td:nth-child(5)::before { content: none; }
            #tb-emmant .emm-pend-btn { margin-left: 0; width: 100%; min-height: 44px; }
            #tb-emmant tr.emm-plan { border-color: color-mix(in srgb, var(--em-viaje) 40%, transparent); background: color-mix(in srgb, var(--em-viaje) 7%, transparent); }
            #tb-emmant tr.emm-plan td:nth-child(3) .hint { color: var(--text-muted); }
            #tb-emmant tr.emm-grupo { display: block; padding: 14px 14px 4px; border: 0; }
            #tb-emmant tr.emm-grupo td { display: block; padding: 0; background: none; border: 0; }
            /* Viaje en curso: cada estación del recorrido con el nombre entero; «Falta cargar», incidencia y hora debajo */
            .emv-lin-fila { flex-wrap: wrap; row-gap: 6px; }
            .emv-lin-fila > span:nth-child(2) { flex: 1 1 calc(100% - 40px) !important; }   /* le gana al flex:1 escrito en el JS */
            .emv-lin-fila > :nth-child(3) { margin-left: 32px; }
            .emv-lin-fila > span.hint { margin-left: auto; }
            /* Planificador: el título con la ✕ en el primer renglón; fecha, técnico y salida debajo */
            .emv-cerrar { order: 1; }
            .emv-cab-tit { flex: 1 1 calc(100% - 50px); align-self: flex-start; }   /* deja lugar a la ✕ en el mismo renglón aunque el celular sea angosto */
            .emv-cab > .form-group { order: 2; flex: 1 1 140px; }
            .emv-nodo { flex-wrap: wrap; }
            .emv-nodo > .emv-acc { flex: 1 1 100%; justify-content: flex-end; }   /* tiempo, subir, bajar y quitar: debajo del nombre */
            .emv-sug-add { min-width: 44px; min-height: 44px; }
            .emv-sug-add span { display: none; }   /* en el celular, solo el «+» (con su nombre para lectores de pantalla) */
            .emv-pie { margin: 16px -12px -12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
            .emv-pie-btns { flex: 1 1 100%; }
            .emv-pie-btns > :last-child { flex: 1; justify-content: center; }
            #modal-pdf-oc .modal-header { flex-wrap: wrap; gap: 8px; }
            #modal-pdf-oc .pdf-oc-botones { flex-wrap: wrap; }
            body.menu-abierto .menu-fondo { display: block; position: fixed; inset: 0; z-index: 10009; background: rgba(0, 0, 0, 0.55); }
            main { overflow: visible; min-height: 100vh; }
            main > header { padding: 10px 12px; gap: 10px; }
            .btn-menu { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px;
                        border: 1px solid var(--border-subtle); background: var(--bg-surface-elevated); color: var(--text-title); cursor: pointer; }
            .btn-menu svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
            .header-title { flex: 1; min-width: 0; }
            .header-title h2 { font-size: var(--fs-xl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
            .header-title h2 .t-largo { display: none; }
            .header-title h2 .t-corto { display: inline; }
            .header-title p { display: none; }
            .content-area { padding: 14px 12px 40px; }
            .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
            .kpi-card { padding: 0.875rem; }
            .kpi-value { font-size: var(--fs-2xl); }
            .kpi-icon-wrap { width: 30px; height: 30px; }
            .toolbar { flex-wrap: wrap; gap: 8px; }
            .toolbar .search-container { flex: 1 1 100%; }
            .toolbar > .btn, .toolbar > select, .toolbar .sel-boton { flex: 1 1 auto; }
            .tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
            .tabs .tab { white-space: nowrap; flex-shrink: 0; }
            .segmentado { overflow-x: auto; max-width: 100%; }
            .panel-card { padding: 1rem; }
            .form-grid { grid-template-columns: minmax(0, 1fr) !important; }   /* minmax: un selector con texto largo no ensancha la pantalla */
            .form-grid > * { grid-column: 1 / -1 !important; }
            .grid-2 { grid-template-columns: minmax(0, 1fr) !important; }   /* reparación: historial y otras reparaciones, uno abajo del otro */
            .table-wrap { overflow-x: auto; }
            input { text-overflow: ellipsis; }   /* un texto de ayuda largo termina en «…» en vez de cortarse en seco */
            /* filas de botones alineadas a la derecha (Cancelar · Guardar…): si no entran, bajan de renglón en vez de salirse por la izquierda */
            [style*="justify-content:flex-end"]:has(> .btn), [style*="justify-content: flex-end"]:has(> .btn) { flex-wrap: wrap; }
            [style*="justify-content:flex-end"] > .btn, [style*="justify-content: flex-end"] > .btn { flex: 1 1 auto; justify-content: center; }
            /* casilla con aclaración: la aclaración va abajo, alineada con el texto */
            .check-linea { flex-wrap: wrap; }
            .check-linea > .hint { flex: 1 1 100%; margin-left: 26px; margin-top: -4px; }
            .table-wrap.con-scroll, .modal-card .table-wrap.con-scroll { display: block; max-height: none; }   /* en las ventanas también: sin esto la tabla quedaba recortada sin poder bajar */
            .table-wrap.con-scroll > .table-scroll { overflow: visible; }
            .table-header-bar { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
            /* Ingreso en el celular: las 4 pestañas a la vista (2 por renglón) y el lector y los botones de la recepción, cada uno en su renglón */
            #view-ing .tabs, #view-ret .tabs { flex-wrap: wrap; overflow-x: visible; width: 100%; }
            #view-ing .tabs .tab, #view-ret .tabs .tab { flex: 1 1 calc(50% - 6px); justify-content: center; }
            #view-ret .tabs .tab { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
            #view-ing .table-header-bar > div { flex: 1 1 100% !important; max-width: none !important; flex-wrap: wrap; }
            body .modal-overlay { align-items: flex-end; }   /* body: le gana a la regla general de más abajo (si no, las ventanas cortas quedaban en el medio) */
            .modal-card { max-width: 100% !important; width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 1.125rem 0.875rem; }
            /* le gana a la regla general de .modal-card (más abajo en el archivo): sin esto el título fijo queda corrido y asoma lo de atrás */
            .modal-overlay > .modal-card:not(.dep3d-card):not(.pantalla-completa) { padding: 1.125rem 0.875rem calc(1.125rem + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; max-height: 92dvh; }   /* dvh: en iPhone la barra de Safari no tapa el final de la ventana */
            /* el título y la ✕ quedan arriba aunque se baje en la ventana */
            .modal-card > .modal-header:first-child { position: sticky; top: -1.125rem; z-index: 3; margin: -1.125rem -0.875rem 0.75rem; padding: 0.875rem 0.875rem 0.625rem;
                                                      background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); }
            body .modal-close { min-width: 2.75rem; min-height: 2.75rem; color: var(--text-body); font-size: 1.7rem; }   /* (ídem: la ✕ salía chica y gris) */
            /* confirmaciones y el ingreso: tarjeta centrada con margen, no pegada a los bordes */
            #modal-confirmar, #modal-login { align-items: center; padding: 16px; }
            #modal-confirmar .modal-card, #modal-login .modal-card { border-radius: 16px; }
            #toast-container { left: 10px; right: 10px; top: 10px; }
            .toast { min-width: 0; max-width: none; }
            /* (.notif-wrap delante para ganarle a la regla general de .notif-panel, que está más abajo en el archivo) */
            .notif-wrap .notif-panel { position: fixed; left: 8px; right: 8px; top: 62px; width: auto; max-height: calc(100vh - 76px); max-height: calc(100dvh - 76px); }
            .notif-head { padding: 12px 14px; gap: 6px; flex-wrap: wrap; }
            .notif-item { padding: 12px 14px; gap: 10px; }
            input, select, textarea, .sel-boton, .combo-input { font-size: 16px !important; }   /* evita el zoom automático del iPhone */
            .btn { min-height: 2.5rem; }

            /* Listado de stock como tarjetas */
            #view-stock thead { display: none; }
            #tb-stock-master tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "desc stock" "sku stock" "marca ubic"; gap: 4px 12px;
                                  padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            #tb-stock-master td { border: none; padding: 0 !important; }
            #tb-stock-master td:not(.tabla-estado):is(:nth-child(1), :nth-child(6), :nth-child(8), :nth-child(9)) { display: none; }   /* el mensaje de lista vacía (colspan) sí se ve */
            #tb-stock-master td:nth-child(2) { grid-area: sku; max-width: none; min-width: 0; }
            #tb-stock-master td:nth-child(3) { grid-area: desc; min-width: 0 !important; font-size: var(--fs-md); }
            #tb-stock-master td:nth-child(4) { grid-area: marca; text-align: left !important; font-size: var(--fs-xs); min-width: 0; }   /* la marca va a la izquierda, debajo del código: una marca larga no aplasta la descripción */
            #tb-stock-master td:nth-child(5) { grid-area: ubic; text-align: right !important; }
            #tb-stock-master td:nth-child(5):has(> span[style*="text-faint"]) { visibility: hidden; }
            #tb-stock-master td:nth-child(7) { grid-area: stock; align-self: center; text-align: right; }
            #tb-stock-master .stock-meter { min-width: 0; align-items: flex-end; }
            #tb-stock-master .stock-meter-labels { flex-direction: column; align-items: flex-end; gap: 0; }
            #tb-stock-master .stock-meter-labels span:first-child { font-size: var(--fs-lg) !important; }
            #tb-stock-master .stock-track { width: 80px; }
            /* «Sin movimiento»: la fecha del último egreso y la valuación abajo de la tarjeta */
            #view-stock.modo-sinmov #tb-stock-master tr { grid-template-areas: "desc stock" "sku stock" "marca ubic" "egr val"; }
            #view-stock.modo-sinmov #tb-stock-master td:nth-child(9) { display: block; grid-area: val; text-align: right; }
            #view-stock.modo-sinmov #tb-stock-master td:nth-child(10) { grid-area: egr; }
            #view-stock.modo-sinmov #tb-stock-master td:nth-child(11) { display: none; }
            #view-stock .solo-cel-txt { display: inline !important; color: var(--text-muted); }
            .sinmov-linea label { font-size: var(--fs-sm); }

            /* Próximos a llegar como tarjetas */
            #card-entregas thead { display: none; }
            #card-entregas .table-header-bar > div { flex-wrap: wrap; }
            #tb-dash-entregas tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "mat pend" "ent oc" "dest dest" "prov prov"; gap: 6px 12px;
                                   padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            #tb-dash-entregas td { border: none; padding: 0 !important; background: transparent !important; box-shadow: none !important; }
            #tb-dash-entregas tr.fila-atrasada { background: rgba(244, 63, 94, 0.13); box-shadow: inset 3px 0 0 var(--c-rojo); }
            #tb-dash-entregas tr.fila-hoy { background: rgba(245, 158, 11, 0.12); box-shadow: inset 3px 0 0 var(--c-ambar); }
            #tb-stock-master td { background: transparent !important; }
            #tb-stock-master tr.fila-revisar { background: rgba(168, 85, 247, 0.06); box-shadow: inset 3px 0 0 var(--c-violeta); }
            #tb-stock-master .nota-revisar { white-space: normal; max-width: none; }
            #tb-dash-entregas td[colspan] { grid-column: 1 / -1; }
            #tb-dash-entregas td:nth-child(1) { grid-area: ent; }
            #tb-dash-entregas td:nth-child(2) { grid-area: mat; min-width: 0; }
            #tb-dash-entregas td:nth-child(3) { grid-area: pend; }
            #tb-dash-entregas td:nth-child(4) { grid-area: dest; }
            #tb-dash-entregas td:nth-child(5) { grid-area: oc; text-align: right; }
            #tb-dash-entregas td:nth-child(6) { grid-area: prov; text-align: left; min-width: 0; }   /* el proveedor en su renglón, de todo el ancho */
            #tb-dash-entregas td:nth-child(6) .txt-prov { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

            /* Órdenes de compra como tarjetas */
            #view-oc thead { display: none; }
            #tb-oc tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "num estado" "prov prov" "prox avance"; gap: 6px 12px;
                        padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            #tb-oc td { border: none; padding: 0 !important; }
            #tb-oc td:nth-child(2), #tb-oc td:nth-child(3), #tb-oc td:nth-child(5), #tb-oc td:nth-child(9), #tb-oc td:nth-child(10) { display: none; }
            #tb-oc td:nth-child(1) { grid-area: num; }
            #tb-oc td:nth-child(4) { grid-area: prov; }
            #tb-oc td:nth-child(6) { grid-area: avance; text-align: right; }
            #tb-oc td:nth-child(7) { grid-area: prox; }
            #tb-oc td:nth-child(8) { grid-area: estado; text-align: right; }
            /* Compras sin OC como tarjetas: número y canal · proveedor y estado · fecha y total */
            #view-csoc thead { display: none; }
            #tb-csoc tr:not(.fila-estado) { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "num canal" "prov estado" "fecha total"; gap: 6px 12px;
                         padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            #tb-csoc tr:not(.fila-estado) td { border: none; padding: 0 !important; }
            #tb-csoc td:nth-child(5), #tb-csoc td:nth-child(6), #tb-csoc td:nth-child(9), #tb-csoc td:nth-child(10) { display: none; }
            #tb-csoc td:nth-child(1) { grid-area: num; }
            #tb-csoc td:nth-child(2) { grid-area: fecha; }
            #tb-csoc td:nth-child(3) { grid-area: canal; text-align: right; }
            #tb-csoc td:nth-child(4) { grid-area: prov; }
            #tb-csoc td:nth-child(7) { grid-area: estado; text-align: right; }
            #tb-csoc td:nth-child(8) { grid-area: total; text-align: right; }
            /* Ingreso · pendiente de llegar: la orden como título y cada material como tarjeta (material · entrega y pendiente · destino) */
            #tabla-pend thead { display: none; }
            #tb-pendientes tr.pend-oc td { display: block; }
            #tb-pendientes tr.pend-oc { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; padding: 10px 14px; }
            #tb-pendientes tr.pend-oc td { border: none; padding: 0 !important; background: none; }
            #tb-pendientes tr.pend-it { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "mat mat" "fecha pend" "dest dest"; gap: 4px 12px;
                         padding: 10px 14px 10px 22px; border-bottom: 1px solid var(--border-subtle); }
            #tb-pendientes tr.pend-it td { border: none; padding: 0 !important; }
            #tb-pendientes tr.pend-it td:nth-child(4), #tb-pendientes tr.pend-it td:nth-child(5) { display: none; }
            #tb-pendientes tr.pend-it td:nth-child(1) { grid-area: mat; }
            #tb-pendientes tr.pend-it td:nth-child(2) { grid-area: fecha; }
            #tb-pendientes tr.pend-it td:nth-child(3) { grid-area: dest; }
            #tb-pendientes tr.pend-it td:nth-child(6) { grid-area: pend; text-align: right; }
            /* ventana de recepción: el lector en su propio renglón, de todo el ancho */
            #modal-recepcion .table-header-bar { flex-wrap: wrap; }
            #modal-recepcion .lector-barras { flex: 1 1 100% !important; max-width: none !important; }

            /* ===== Más tablas como tarjetas (11/11/2026) ===== */
            table:has(> #tb-dash-movs) > thead, table:has(> #tb-herr) > thead, table:has(> #tb-solicitudes) > thead,
            table:has(> #tb-carrito) > thead, table:has(> #tb-moc) > thead, table:has(> #fm-entregas) > thead,
            table:has(> #fm-compras) > thead, table:has(> #fm-movimientos) > thead, table:has(> #fm-series) > thead,
            table:has(> #tb-ac-detalle) > thead, table:has(> #tb-recepcion) > thead, table:has(> #tb-ing-lista) > thead { display: none; }
            table:has(> #tb-recepcion), table:has(> #tb-ing-lista) { min-width: 0 !important; width: 100%; }
            :is(#tb-dash-movs, #tb-herr, #tb-solicitudes, #tb-carrito, #tb-moc, #fm-entregas, #fm-compras, #fm-movimientos, #fm-series, #tb-ac-detalle, #tb-recepcion, #tb-ing-lista) > tr {
                display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: center;
                padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            :is(#tb-dash-movs, #tb-herr, #tb-solicitudes, #tb-carrito, #tb-moc, #fm-entregas, #fm-compras, #fm-movimientos, #fm-series, #tb-ac-detalle, #tb-recepcion, #tb-ing-lista) > tr > td {
                border: none; padding: 0 !important; min-width: 0; text-align: left; white-space: normal; background: transparent; }
            :is(#tb-dash-movs, #tb-herr, #tb-solicitudes, #tb-carrito, #tb-moc, #fm-entregas, #fm-compras, #fm-movimientos, #fm-series, #tb-ac-detalle, #tb-recepcion, #tb-ing-lista) > tr > td[colspan] {
                grid-column: 1 / -1; text-align: center; }
            /* etiqueta chica arriba del dato (solo donde se le pone texto) */
            :is(#tb-moc, #fm-entregas, #fm-compras, #fm-movimientos, #tb-ac-detalle, #tb-recepcion) > tr > td::before {
                display: block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
            .alinear-der { justify-self: end; text-align: right !important; }

            /* Dashboard · Actividad de depósito: SKU | tipo / fecha | cantidad / proyecto | usuario */
            #tb-dash-movs td:nth-child(2) { grid-row: 1; grid-column: 1; }
            #tb-dash-movs td:nth-child(3) { grid-row: 1; grid-column: 2; justify-self: end; }
            #tb-dash-movs td:nth-child(1) { grid-row: 2; grid-column: 1; }
            #tb-dash-movs td:nth-child(4) { grid-row: 2; grid-column: 2; justify-self: end; }
            #tb-dash-movs td:nth-child(5) { grid-row: 3; grid-column: 1; }
            #tb-dash-movs td:nth-child(6) { grid-row: 3; grid-column: 2; justify-self: end; }

            /* Dashboard · Insumos críticos: material / barra de stock / proveedor, uno debajo del otro (la tabla se salía del recuadro) */
            table:has(> #tb-dash-alertas) { min-width: 0 !important; width: 100%; }
            table:has(> #tb-dash-alertas) > thead { display: none; }
            #tb-dash-alertas > tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            #tb-dash-alertas > tr > td { display: block; border: none; padding: 0 !important; min-width: 0; white-space: normal; background: transparent; overflow-wrap: anywhere; }
            #tb-dash-alertas > tr > td + td { margin-top: 8px; }
            #tb-dash-alertas > tr > td[colspan] { text-align: center; }

            /* Herramientas: descripción | stock / SKU / tipo · medida / ubicación · marca */
            #tb-herr td:nth-child(3) { grid-row: 1; grid-column: 1; }
            #tb-herr td:nth-child(7) { grid-row: 1 / span 2; grid-column: 2; justify-self: end; text-align: right; }
            #tb-herr td:nth-child(1) { grid-row: 2; grid-column: 1; }
            #tb-herr td:nth-child(2) { grid-row: 3; grid-column: 1; }
            #tb-herr td:nth-child(4) { grid-row: 3; grid-column: 2; justify-self: end; }
            #tb-herr td:nth-child(5) { grid-row: 4; grid-column: 1; justify-self: start; text-align: left !important; font-size: var(--fs-xs); min-width: 0; }   /* la marca abajo a la izquierda: una larga no aplasta la descripción */
            #tb-herr td:nth-child(6) { grid-row: 4; grid-column: 2; justify-self: end; text-align: right !important; }
            #tb-herr td:nth-child(2) { min-width: 0; }
            #tb-herr .badge-herr { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }   /* un tipo largo pasa de renglón dentro de la tarjeta */
            #tb-herr td:nth-child(8), #tb-herr td:nth-child(9) { display: none; }

            /* Solicitudes: número | estado / materiales / pedido por | prioridad (la tarjeta se toca para abrirla) */
            #tb-solicitudes td:nth-child(1) { grid-row: 1; grid-column: 1; }
            #tb-solicitudes td:nth-child(5) { grid-row: 1; grid-column: 2; justify-self: end; text-align: right; }
            #tb-solicitudes td:nth-child(3) { grid-row: 2; grid-column: 1 / -1; }
            #tb-solicitudes td:nth-child(2) { grid-row: 3; grid-column: 1; }
            #tb-solicitudes td:nth-child(4) { grid-row: 3; grid-column: 2; justify-self: end; }
            #tb-solicitudes td:nth-child(6) { display: none; }

            /* Egreso · lista a despachar: material | quitar / SKU | cantidad / (series, precio de venta) */
            #tb-carrito td:nth-child(2) { grid-row: 1; grid-column: 1; }
            #tb-carrito td:last-child:not([colspan]) { grid-row: 1; grid-column: 2; justify-self: end; }
            #tb-carrito td:nth-child(1) { grid-row: 2; grid-column: 1; }
            #tb-carrito td:nth-child(4) { grid-row: 2; grid-column: 2; justify-self: end; }
            #tb-carrito td:nth-child(3) { display: none; }
            #tb-carrito td:nth-child(n+5):not(:last-child) { grid-column: 1 / -1; }

            /* Ingreso · compra sin OC: material | quitar / SKU | cantidad / (series, costo) — igual que la lista de egreso */
            #tb-ing-lista td:nth-child(2) { grid-row: 1; grid-column: 1; }
            #tb-ing-lista td:last-child:not([colspan]) { grid-row: 1; grid-column: 2; justify-self: end; }
            #tb-ing-lista td:nth-child(1) { grid-row: 2; grid-column: 1; }
            #tb-ing-lista td:nth-child(3) { grid-row: 2; grid-column: 2; justify-self: end; }
            #tb-ing-lista td:nth-child(n+4):not(:last-child) { grid-column: 1 / -1; }

            /* Ingreso · ítems pendientes de recibir: material / entrega | destino / pedido · ya recibido · pendiente / recibo ahora */
            #tb-recepcion > tr { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
            #tb-recepcion td:nth-child(1), #tb-recepcion td:nth-child(7) { grid-column: 1 / -1; }
            #tb-recepcion td:nth-child(2) { grid-column: 1 / 3; }
            #tb-recepcion td:nth-child(3) { justify-self: end; text-align: right; }
            #tb-recepcion td:nth-child(4)::before { content: "Pedido"; }
            #tb-recepcion td:nth-child(5)::before { content: "Ya recibido"; }
            #tb-recepcion td:nth-child(6)::before { content: "Pendiente"; }
            #tb-recepcion td:nth-child(7)::before { content: "Recibo ahora"; }
            #tb-recepcion td:nth-child(7) .num-ctrl { width: 100%; }
            #tb-recepcion td:nth-child(7) input { flex: 1; }

            /* Mi actividad · mis mantenimientos: igual que en Mantenimientos (el día en cuadradito; estación, N°, informe y reemplazos al lado) */
            table:has(> #tb-emact-mant) { min-width: 0 !important; width: 100%; }
            table:has(> #tb-emact-mant) > thead { display: none; }
            #tb-emact-mant > tr { display: grid; grid-template-columns: 48px auto minmax(0, 1fr); column-gap: 12px; row-gap: 3px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            #tb-emact-mant > tr > td { border: none; padding: 0 !important; min-width: 0; white-space: normal; }
            #tb-emact-mant > tr > td[colspan="5"] { grid-column: 1 / -1; text-align: center; }
            #tb-emact-mant td.emm-fecha { grid-column: 1; grid-row: 1 / span 4; align-self: start; }
            #tb-emact-mant td:nth-child(3) { grid-column: 2 / -1; grid-row: 1; font-size: var(--fs-md); }
            #tb-emact-mant td:nth-child(3) b { color: var(--text-title); }
            #tb-emact-mant td.emm-num { grid-column: 2; grid-row: 2; font-size: var(--fs-xs); }
            #tb-emact-mant td:nth-child(4) { grid-column: 2 / -1; grid-row: 3; font-size: var(--fs-xs); color: var(--text-body); }   /* los reemplazos, con todo el ancho */
            #tb-emact-mant td:nth-child(5) { grid-column: 2 / -1; grid-row: 4; justify-self: start; }
            #tb-emact-mant td:nth-child(5) .hint, #tb-emact-mant td:nth-child(5) .badge { display: inline-block; padding: 2px 0.5rem; border-radius: 6px; font-size: var(--fs-xs); border: 1px solid var(--border-subtle); }
            /* falta cargar: tarjeta naranja con «Cargar» de todo el ancho, como en Mantenimientos */
            #tb-emact-mant tr.emm-pend { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 10px 10px 4px; border-radius: 12px;
                                         border: 1px solid color-mix(in srgb, var(--em-media) 45%, transparent); background: color-mix(in srgb, var(--em-media) 9%, transparent); }
            #tb-emact-mant tr.emm-pend td { background: none; }
            #tb-emact-mant tr.emm-pend td:nth-child(1), #tb-emact-mant tr.emm-pend td:nth-child(2) { display: none; }
            #tb-emact-mant tr.emm-pend td:nth-child(3) .hint { color: var(--tx-fdba74); }
            #tb-emact-mant tr.emm-pend td:nth-child(4) { display: flex; flex-direction: column; align-items: flex-start; gap: 0.625rem; margin-top: 4px; }
            #tb-emact-mant .emm-pend-btn { margin-left: 0; width: 100%; min-height: 44px; }
            /* Mi actividad · mis viajes: fecha y estado arriba, el recorrido entero, y abajo hechas · tiempo · km con su nombre */
            table:has(> #tb-emact-viajes) { min-width: 0 !important; width: 100%; }
            table:has(> #tb-emact-viajes) > thead { display: none; }
            #tb-emact-viajes > tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            #tb-emact-viajes > tr > td { border: none; padding: 0 !important; min-width: 0; white-space: normal; }
            #tb-emact-viajes > tr > td[colspan] { grid-column: 1 / -1; text-align: center; }
            /* fecha arriba; el estado en su propio renglón (largo, como «En curso · revisar…», tapaba la fecha); después el recorrido y los datos */
            #tb-emact-viajes td:nth-child(1) { grid-row: 1; grid-column: 1 / -1; color: var(--text-title); font-weight: 600; }
            #tb-emact-viajes td:nth-child(6) { grid-row: 2; grid-column: 1 / -1; justify-self: start; max-width: 100%; }
            #tb-emact-viajes td:nth-child(6) .em-chip { white-space: normal; text-align: left; }
            #tb-emact-viajes td:nth-child(2) { grid-row: 3; grid-column: 1 / -1; }
            #tb-emact-viajes td:nth-child(3), #tb-emact-viajes td:nth-child(4), #tb-emact-viajes td:nth-child(5) { grid-row: 4; font-size: var(--fs-sm); }
            #tb-emact-viajes td:nth-child(3)::before, #tb-emact-viajes td:nth-child(4)::before, #tb-emact-viajes td:nth-child(5)::before {
                display: block; font: 600 var(--fs-xs) var(--font-sans); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
            #tb-emact-viajes td:nth-child(3)::before { content: "Hechas"; }
            #tb-emact-viajes td:nth-child(4)::before { content: "Tiempo"; }
            #tb-emact-viajes td:nth-child(5)::before { content: "Km"; }
            #tb-emact-mant td:nth-child(4):has(> .hint:only-child) { display: none; }   /* sin reemplazos: no muestra «—» */
            /* Mi actividad · próximos viajes: fecha y estado arriba, el recorrido, y abajo cuántas estaciones y a qué hora se sale */
            table:has(> #tb-emact-prox) { min-width: 0 !important; width: 100%; }
            table:has(> #tb-emact-prox) > thead { display: none; }
            #tb-emact-prox > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            #tb-emact-prox > tr > td { border: none; padding: 0 !important; min-width: 0; white-space: normal; }
            #tb-emact-prox td:nth-child(1) { grid-row: 1; grid-column: 1; color: var(--text-title); font-weight: 600; }
            #tb-emact-prox td:nth-child(5) { grid-row: 1; grid-column: 2; justify-self: end; }
            #tb-emact-prox td:nth-child(2) { grid-row: 2; grid-column: 1 / -1; }
            #tb-emact-prox td:nth-child(3), #tb-emact-prox td:nth-child(4) { grid-row: 3; font-size: var(--fs-sm); }
            #tb-emact-prox td:nth-child(4)::before { content: "Salida "; color: var(--text-muted); }
            /* títulos largos de las tarjetas de arriba («MANTENIMIENTOS»): se cortan con guion donde se sugiere, en vez de pisar el ícono */
            .kpi-label { hyphens: manual; }   /* se cortan solo donde el texto lo sugiere (&shy;), nunca a mitad de sílaba */

            /* cualquier tabla con solo el aviso de vacía («No hay…»): sin encabezado ni ancho mínimo, así el aviso se lee entero */
            table:has(> tbody > tr:only-child > td[colspan]:only-child) { min-width: 0 !important; }
            table:has(> tbody > tr:only-child > td[colspan]:only-child) > thead { display: none; }
            table > tbody > tr:only-child > td[colspan]:only-child { white-space: normal !important; }

            /* Ficha de la OC · ítems: material / pedido · recibido · pendiente / precio · IVA / entrega / destino / botones */
            #tb-moc > tr { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
            #tb-moc td:nth-child(1) { grid-column: 1 / -1; }
            #tb-moc td:nth-child(2)::before { content: "Pedido"; }
            #tb-moc td:nth-child(3)::before { content: "Recibido"; }
            #tb-moc td:nth-child(4)::before { content: "Pendiente"; }
            #tb-moc td:nth-child(5) { grid-column: span 2; }
            #tb-moc td:nth-child(5)::before { content: "Precio unit."; }
            #tb-moc td:nth-child(6)::before { content: "IVA"; }
            #tb-moc td:nth-child(7) { grid-column: 1 / -1; }
            #tb-moc td:nth-child(7)::before { content: "Entrega"; }
            #tb-moc td:nth-child(8) { grid-column: 1 / -1; }
            #tb-moc td:nth-child(8)::before { content: "Destino"; }
            #tb-moc td:nth-child(9) { grid-column: 1 / -1; }
            #tb-moc td:nth-child(9) > div { flex-direction: row !important; flex-wrap: wrap; justify-content: flex-start; }
            #tb-moc td:nth-child(n+2) { text-align: left !important; }

            /* Ficha del material · entregas pendientes */
            #fm-entregas td:nth-child(1) { grid-row: 1; grid-column: 1; }
            #fm-entregas td:nth-child(2) { grid-row: 1; grid-column: 2; justify-self: end; }
            #fm-entregas td:nth-child(4) { grid-row: 2; grid-column: 1; }
            #fm-entregas td:nth-child(3) { grid-row: 2; grid-column: 2; justify-self: end; }
            #fm-entregas td:nth-child(5) { grid-row: 3; grid-column: 1 / -1; }
            /* Ficha del material · últimas compras */
            #fm-compras td:nth-child(2) { grid-row: 1; grid-column: 1; }
            #fm-compras td:nth-child(5) { grid-row: 1; grid-column: 2; justify-self: end; text-align: right; }
            #fm-compras td:nth-child(3) { grid-row: 2; grid-column: 1; }
            #fm-compras td:nth-child(4) { grid-row: 2; grid-column: 2; justify-self: end; }
            #fm-compras td:nth-child(1) { grid-row: 3; grid-column: 1; }
            /* Ficha del material · movimientos */
            #fm-movimientos td:nth-child(1) { grid-row: 1; grid-column: 1; }
            #fm-movimientos td:nth-child(2) { grid-row: 1; grid-column: 2; justify-self: end; }
            #fm-movimientos td:nth-child(4) { grid-row: 2; grid-column: 1; }
            #fm-movimientos td:nth-child(3) { grid-row: 2; grid-column: 2; justify-self: end; }
            #fm-movimientos td:nth-child(5) { grid-row: 3; grid-column: 1; }
            #fm-movimientos td:nth-child(6) { grid-row: 3; grid-column: 2; justify-self: end; }
            #fm-movimientos td:not([colspan]):nth-child(4)::before { content: "Proyecto"; }
            #fm-movimientos td:nth-child(5)::before { content: "Referencia"; }
            /* Ficha del material · números de serie */
            #fm-series td:nth-child(1) { grid-row: 1; grid-column: 1; }
            #fm-series td:nth-child(2) { grid-row: 1; grid-column: 2; justify-self: end; }
            #fm-series td:nth-child(3) { grid-row: 2; grid-column: 1 / -1; }
            #fm-series td:nth-child(4) { grid-row: 3; grid-column: 1; }

            /* Análisis de compras · detalle: material / OC | total / proveedor | cantidad / fecha | destino */
            #tb-ac-detalle td:nth-child(4) { grid-row: 1; grid-column: 1 / -1; }
            #tb-ac-detalle td:nth-child(2) { grid-row: 2; grid-column: 1; }
            #tb-ac-detalle td:nth-child(8) { grid-row: 2; grid-column: 2; justify-self: end; }
            #tb-ac-detalle td:nth-child(3) { grid-row: 3; grid-column: 1; }
            #tb-ac-detalle td:nth-child(6) { grid-row: 3; grid-column: 2; justify-self: end; }
            #tb-ac-detalle td:nth-child(1) { grid-row: 4; grid-column: 1; }
            #tb-ac-detalle td:nth-child(9) { grid-row: 4; grid-column: 2; justify-self: end; }
            #tb-ac-detalle td:nth-child(5), #tb-ac-detalle td:nth-child(7) { display: none; }
            /* Análisis de compras · rankings: nombre arriba, barra y valor abajo */
            div.dc-fila { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }   /* div.: más fuerte que las reglas generales que vienen después */
            .dc-fila .dc-nom { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

            /* ===== Históricos y préstamos como tarjetas ===== */
            table:has(> #tb-hing) > thead, table:has(> #tb-hegr) > thead, table:has(> #tb-prestamos) > thead,
            table:has(> #tb-prest-items) > thead, table:has(> #tb-mp) > thead { display: none; }
            :is(#tb-hing, #tb-hegr, #tb-prestamos, #tb-prest-items, #tb-mp) > tr {
                display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: center;
                padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            :is(#tb-hing, #tb-hegr, #tb-prestamos, #tb-prest-items, #tb-mp) > tr > td {
                border: none; padding: 0 !important; min-width: 0; text-align: left !important; white-space: normal; background: transparent; }
            :is(#tb-hing, #tb-hegr, #tb-prestamos, #tb-prest-items, #tb-mp) > tr > td[colspan] { grid-column: 1 / -1; text-align: center !important; }
            :is(#tb-prest-items, #tb-mp) > tr > td::before {
                display: block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }

            /* datos vacíos ("—"): en la tarjeta no ocupan lugar */
            :is(#tb-hing, #tb-hegr, #tb-prestamos) > tr > td:has(> span[style*="text-faint"]:only-child) { display: none; }
            /* filtro de fechas de los históricos: desde / hasta sin cortarse */
            div:has(> #hegr-desde), div:has(> #hing-desde) { width: 100%; flex-wrap: nowrap; }
            #hegr-desde, #hegr-hasta, #hing-desde, #hing-hasta { flex: 1 1 0; min-width: 0; width: auto; }
            /* Histórico de egresos: material | cantidad / tipo | fecha / proyecto | OC-préstamo / detalle | usuario */
            #tb-hegr td:nth-child(3) { grid-row: 1; grid-column: 1; }
            #tb-hegr td:nth-child(4) { grid-row: 1; grid-column: 2; justify-self: end; }
            #tb-hegr td:nth-child(2) { grid-row: 2; grid-column: 1; }
            #tb-hegr td:nth-child(1) { grid-row: 2; grid-column: 2; justify-self: end; }
            #tb-hegr td:nth-child(5) { grid-row: 3; grid-column: 1; }
            #tb-hegr td:nth-child(7) { grid-row: 3; grid-column: 2; justify-self: end; }
            #tb-hegr td:nth-child(6) { grid-row: 4; grid-column: 1; }
            #tb-hegr td:nth-child(8) { grid-row: 4; grid-column: 2; justify-self: end; }
            /* Histórico de ingresos: material | cantidad / origen | fecha / OC-préstamo | destino / detalle | usuario */
            #tb-hing td:nth-child(3) { grid-row: 1; grid-column: 1; }
            #tb-hing td:nth-child(4) { grid-row: 1; grid-column: 2; justify-self: end; }
            #tb-hing td:nth-child(2) { grid-row: 2; grid-column: 1; }
            #tb-hing td:nth-child(1) { grid-row: 2; grid-column: 2; justify-self: end; }
            #tb-hing td:nth-child(5) { grid-row: 3; grid-column: 1; }
            #tb-hing td:nth-child(7) { grid-row: 3; grid-column: 2; justify-self: end; }
            #tb-hing td:nth-child(6) { grid-row: 4; grid-column: 1; }
            #tb-hing td:nth-child(8) { grid-row: 4; grid-column: 2; justify-self: end; }

            /* Préstamos (lista): número | estado / prestado a / materiales / devolución prevista | ubicación / fecha */
            #tb-prestamos td:nth-child(1) { grid-row: 1; grid-column: 1; }
            #tb-prestamos td:nth-child(7) { grid-row: 1; grid-column: 2; justify-self: end; }
            #tb-prestamos td:nth-child(2) { grid-row: 2; grid-column: 1 / -1; }
            #tb-prestamos td:nth-child(5) { grid-row: 3; grid-column: 1 / -1; }
            #tb-prestamos td:nth-child(6) { grid-row: 4; grid-column: 1; }
            #tb-prestamos td:nth-child(3) { grid-row: 5; grid-column: 1 / -1; justify-self: start; min-width: 0; }
            #tb-prestamos .badge-prestamo { white-space: normal; overflow-wrap: anywhere; }   /* una ubicación larga pasa de renglón */
            #tb-prestamos td:nth-child(4) { grid-row: 6; grid-column: 1; }
            #tb-prestamos td:nth-child(8) { display: none; }
            /* Nuevo préstamo (materiales cargados): material | quitar / presta | disponible */
            #tb-prest-items td:nth-child(1) { grid-row: 1; grid-column: 1; }
            #tb-prest-items td:nth-child(4) { grid-row: 1; grid-column: 2; justify-self: end; }
            #tb-prest-items td:nth-child(2) { grid-row: 2; grid-column: 1; }
            #tb-prest-items td:nth-child(3) { grid-row: 2; grid-column: 2; justify-self: end; }
            #tb-prest-items td:not([colspan]):nth-child(2)::before { content: "Presta"; }
            #tb-prest-items td:nth-child(3)::before { content: "Disponible"; }
            /* Ficha del préstamo: material / prestado · devuelto · perdido / pendiente · devuelve ahora / no volvió */
            #tb-mp > tr { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
            #tb-mp td:nth-child(1) { grid-column: 1 / -1; }
            #tb-mp td:nth-child(2)::before { content: "Prestado"; }
            #tb-mp td:nth-child(3)::before { content: "Devuelto"; }
            #tb-mp td:nth-child(4)::before { content: "Perdido"; }
            #tb-mp td:nth-child(5)::before { content: "Pendiente"; }
            #tb-mp td:nth-child(6) { grid-column: span 2; }
            #tb-mp td:nth-child(6)::before { content: "Devuelve ahora"; }
            #tb-mp td:nth-child(7) { grid-column: 1 / -1; }

            /* ===== Solicitudes de compra: materiales del formulario y de la ficha ===== */
            table:has(> #tb-soln-items) > thead, table:has(> #tb-ms-items) > thead { display: none; }
            :is(#tb-soln-items, #tb-ms-items) > tr {
                display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: start;
                padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
            :is(#tb-soln-items, #tb-ms-items) > tr > td {
                border: none; padding: 0 !important; min-width: 0; text-align: left !important; white-space: normal; background: transparent; }
            :is(#tb-soln-items, #tb-ms-items) > tr > td[colspan] { grid-column: 1 / -1; text-align: center !important; }
            :is(#tb-soln-items, #tb-ms-items) > tr > td:has(> span[style*="text-faint"]:only-child) { display: none; }
            :is(#tb-soln-items, #tb-ms-items) > tr > td::before {
                display: block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; }
            /* formulario: material | quitar / disponible | pedir / motivo / comentario / aviso */
            #tb-soln-items td:nth-child(1) { grid-row: 1; grid-column: 1; }
            #tb-soln-items td:nth-child(7) { grid-row: 1; grid-column: 2; justify-self: end; }
            #tb-soln-items td:not([colspan]):nth-child(2) { grid-row: 2; grid-column: 1; }
            #tb-soln-items td:nth-child(2)::before { content: "Disponible / mín."; }
            #tb-soln-items td:nth-child(3) { grid-row: 2; grid-column: 2; }
            #tb-soln-items td:nth-child(3)::before { content: "Pedir"; }
            #tb-soln-items td:nth-child(3) { white-space: nowrap; }
            #tb-soln-items td:nth-child(3) input { width: 100px !important; }
            #tb-soln-items td:nth-child(4), #tb-soln-items td:nth-child(5), #tb-soln-items td:nth-child(6) { grid-column: 1 / -1; }
            #tb-soln-items td:nth-child(4)::before { content: "Motivo de compra"; }
            #tb-soln-items td:nth-child(5)::before { content: "Comentario"; }
            #tb-soln-items td:nth-child(4) select, #tb-soln-items td:nth-child(4) .sel-boton, #tb-soln-items td:nth-child(5) input { width: 100%; }
            /* ficha: material / pedido | disponible / motivo / aviso */
            #tb-ms-items td:nth-child(1) { grid-column: 1 / -1; }
            #tb-ms-items td:nth-child(2)::before { content: "Pedido"; }
            #tb-ms-items td:nth-child(3)::before { content: "Disponible hoy"; }
            #tb-ms-items td:nth-child(4), #tb-ms-items td:nth-child(5) { grid-column: 1 / -1; }
            #tb-ms-items td:nth-child(4)::before { content: "Motivo"; }

            /* Botones de filtro: en dos renglones si no entran (no cortados) */
            .segmentado { flex-wrap: wrap; overflow-x: visible; width: 100% !important; }
            .content-area .segmentado > button { flex: 1 1 auto; justify-content: center; padding: 0.5rem 0.625rem; gap: 0.3125rem; }   /* más ajustados: así suelen entrar en un renglón, y si no, quedan centrados */
            /* Importar OC históricas: solo desde la PC */
            #btn-oc-historico { display: none !important; }
        }
        .mini-foto { font-size: var(--fs-xs); margin-left: 6px; opacity: 0.75; }
        .ubic { font-size: var(--fs-xs); color: var(--text-body); background: rgba(var(--tinte), 0.05); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 2px 7px; }
        .falta-dato { color: var(--warning); font-size: var(--fs-xs); font-weight: 600; background: rgba(245, 158, 11, 0.1); border-radius: 4px; padding: 1px 6px; }
        #panel-nueva-oc:not(.modo-servicio) .solo-serv { display: none !important; }
        .modo-servicio .solo-mat { display: none !important; }
        /* Listas desplegables propias (mismo estilo que el buscador de materiales) */
        select.sel-nativo { display: none !important; }
        .sel-boton { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer;
                     background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); border-radius: 8px;
                     padding: 10px 12px; color: var(--text-title); font-size: var(--fs-md); font-family: inherit; min-width: 0; transition: border-color 0.15s; }
        .sel-boton:hover { border-color: var(--border-hover); }
        .sel-boton:focus, .sel-boton.abierto { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px var(--primary-glow); }
        .sel-boton:disabled { opacity: 0.55; cursor: not-allowed; }
        .sel-boton .sel-texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
        .sel-boton .sel-texto.vacio { color: var(--text-muted); }
        .sel-boton::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted);
                            transform: rotate(45deg) translateY(-2px); flex-shrink: 0; transition: transform 0.15s; }
        .sel-boton.abierto::after { transform: rotate(225deg) translateY(-2px); }
        .sel-boton.input-fecha { padding: 0.3125rem 0.5rem; font-size: var(--fs-sm); }
        .sel-lista { position: fixed; z-index: 20000; max-height: 320px; overflow-y: auto; background: var(--bg-surface-elevated);
                     border: 1px solid var(--border-hover); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, calc(0.5 * var(--sombra))); padding: 4px; }
        .sel-lista .sel-buscar { width: 100%; margin-bottom: 4px; padding: 7px 10px; font-size: var(--fs-sm); }
        .sel-op { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: var(--fs-sm); color: var(--text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .sel-op.activo, .sel-op:hover { background: var(--primary-glow); color: var(--text-title); }
        .sel-op.elegido { color: var(--primary); font-weight: 600; }
        .sel-op.deshabilitado { color: var(--text-faint); cursor: default; background: none; }
        .sel-op.vacio-op { color: var(--text-muted); }
        .sel-op .sug-extra { float: right; margin-left: 12px; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 400; }
        .sel-op mark { background: rgba(0, 173, 154, 0.3); color: inherit; border-radius: 2px; padding: 0 1px; }

        /* Buscador de materiales (reemplaza a una lista desplegable larga) */
        .combo { position: relative; }
        .combo-input { width: 100%; padding-right: 2.125rem; }
        .combo::after { content: '⌕'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; font-size: var(--fs-lg); }
        .combo-lista { position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 330px; overflow-y: auto; z-index: 60;
                       background: var(--bg-surface-elevated); border: 1px solid var(--border-hover); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, calc(0.45 * var(--sombra))); padding: 4px; }
        /* cada resultado en dos renglones: código + descripción arriba, los datos abajo (así entra en columnas angostas sin pisarse) */
        .combo-item { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 2px; padding: 8px 10px; border-radius: 7px;
                      cursor: pointer; font-size: var(--fs-sm); color: var(--text-body); }
        .combo-item .c-cod { font-family: var(--font-mono); color: var(--primary); font-weight: 600; font-size: var(--fs-xs); overflow-wrap: anywhere; }
        .combo-item .c-nom { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
        .combo-item .c-extra { flex: 1 1 100%; color: var(--text-muted); font-size: var(--fs-xs); overflow-wrap: anywhere; }
        .combo-item .c-extra:empty { display: none; }
        .combo-item.activo, .combo-item:hover { background: var(--primary-glow); color: var(--text-title); }
        .combo-item mark { background: rgba(0, 173, 154, 0.3); color: inherit; border-radius: 2px; padding: 0 1px; }
        .combo-vacio { padding: 12px; color: var(--text-muted); font-size: var(--fs-sm); text-align: center; }
        .logo-empresa { background: var(--c-blanco); border-radius: 8px; padding: 10px; height: 76px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-subtle); }
        .logo-empresa img { max-height: 56px; max-width: 100%; }
        .total-oc { text-align: right; font-family: var(--font-mono); font-size: var(--fs-lg); color: var(--text-title); margin-top: 12px; }

        body.sin-costos .col-costo { display: none !important; }

        .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--velo); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 10000; }
        /* Abrir y cerrar con transiciones (no animaciones fijas): si se reabre mientras se cierra, da la vuelta desde donde está.
           display «allow-discrete» la deja a la vista mientras se desvanece; @starting-style es desde dónde aparece */
        .modal-overlay { opacity: 0; transition: opacity 0.16s ease, background-color 0.2s ease, display 0.16s allow-discrete; }
        .modal-overlay:not(.active) { pointer-events: none; }
        .modal-overlay.active { display: flex; opacity: 1; transition-duration: 0.2s; }
        @starting-style { .modal-overlay.active { opacity: 0; } }
        .modal-overlay > .modal-card { transform: scale(0.98); transition: transform 0.16s ease; }
        .modal-overlay.active > .modal-card { transform: none; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
        @starting-style { .modal-overlay.active > .modal-card { transform: scale(0.97); } }
        .modal-card { background: var(--bg-surface); border: 1px solid var(--border-hover); border-radius: 14px; width: 100%; max-width: 600px; padding: 1.625rem; box-shadow: 0 24px 64px rgba(0, 0, 0, calc(0.9 * var(--sombra))); }
        .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
        .modal-close { background: none; border: none; color: var(--text-muted); font-size: var(--fs-2xl); cursor: pointer; }
        .modal-card:focus { outline: none; }   /* el foco que se le da al abrir no dibuja un borde alrededor de toda la ventana */
        .modal-close:hover { color: var(--text-title); }
        /* No lleva la clase modal-close: ESC aprieta el primer .modal-close del popup y tiene que ser la X */
        .btn-pantalla-completa { background: none; border: none; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0.25rem; border-radius: 6px; }
        .btn-pantalla-completa:hover { color: var(--text-title); background: var(--bg-surface-elevated); }
        /* Ficha en pantalla completa: ocupa toda la ventana */
        @media (min-width: 761px) {   /* deja a la vista la barra lateral (en el celular está escondida: la ficha ocupa todo el ancho) */
            body:not(.menu-plegado) .modal-overlay.ficha-completa { left: 250px; width: calc(100% - 250px); }
            body.menu-plegado .modal-overlay.ficha-completa { left: 68px; width: calc(100% - 68px); }
        }
        .modal-card.pantalla-completa { max-width: 100% !important; width: 100%; height: 100%; max-height: 100% !important; border-radius: 0; border: none; box-shadow: none; padding: 1.375rem 1.75rem; }
        #modal-login { z-index: 10005; background: var(--velo-login); }

        /* Botones de filtro (selección rápida) */
        .segmentado { display: flex; gap: 4px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 4px; flex-shrink: 0; }
        .segmentado button {
            background: transparent; border: none; color: var(--text-muted); padding: 0.5rem 0.875rem; border-radius: 7px;
            font-size: var(--fs-sm); font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 0.4375rem; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s, filter 0.15s, opacity 0.15s; white-space: nowrap;
        }
        .segmentado button:hover { color: var(--text-title); background: var(--bg-surface-elevated); }
        .segmentado button.activo { background: rgba(0, 173, 154, 0.16); color: var(--tx-6fdccd); box-shadow: inset 0 0 0 1px rgba(0, 173, 154, 0.35); }
        .seg-num { font-size: var(--fs-xs); font-family: var(--font-mono); background: rgba(var(--tinte), 0.08); color: var(--text-body); padding: 1px 7px; border-radius: 99px; }
        .segmentado button.activo .seg-num { background: rgba(0, 173, 154, 0.3); color: var(--tx-d2f5f0); }

        /* Eliminar proyecto */
        .opcion-radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s, filter 0.15s, opacity 0.15s; }
        .opcion-radio:hover { border-color: var(--border-hover); background: rgba(var(--tinte), 0.02); }
        .opcion-radio:has(input:checked) { border-color: rgba(0, 173, 154, 0.55); background: rgba(0, 173, 154, 0.08); }
        .opcion-radio input { margin-top: 2px; accent-color: var(--primary); width: 17px; height: 17px; flex-shrink: 0; }
        .opcion-radio b { display: block; color: var(--text-title); font-size: var(--fs-md); }
        .opcion-radio span { display: block; color: var(--text-muted); font-size: var(--fs-xs); margin-top: 2px; line-height: 1.4; }
        .ep-material { background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: var(--fs-sm); max-height: 150px; overflow-y: auto; }
        .ep-material div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
        .ep-material div span:last-child { font-family: var(--font-mono); font-weight: 700; color: var(--text-title); white-space: nowrap; }

        /* Proyectos */
        .campo-doble { grid-column: span 2; }
        @media (max-width: 1000px) { .campo-doble { grid-column: 1 / -1; } }
        .proy-nombre { font-weight: 600; color: var(--text-title); }
        .proy-cliente { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--tx-6fdccd); font-weight: 600; }
        .vista-previa-nombre { background: var(--bg-surface-elevated); border: 1px dashed var(--border-hover); border-radius: 8px; padding: 10px 14px; font-weight: 700; color: var(--text-title); min-height: 42px; display: flex; align-items: center; }
        .vista-previa-nombre span { color: var(--tx-6fdccd); }
        .ficha-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 4px 0 20px; }
        .ficha-kpi { background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 14px 16px; }
        .ficha-kpi .et { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
        .ficha-kpi .va { font-size: var(--fs-2xl); font-weight: 700; color: var(--text-title); font-family: var(--font-mono); margin-top: 6px; }
        .ficha-seccion { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.07em; color: var(--primary); font-weight: 700; margin: 20px 0 10px; }
        /* Ficha de alta de material */
        .alta-card { max-width: 1200px; }
        .alta-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
        .alta-card .ficha-seccion .ico { width: 1em; height: 1em; vertical-align: -0.12em; margin-right: 4px; }
        .alta-bloques { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 6px; }
        /* Nuevo repuesto (Estaciones): sin código corto, marca, unidad ni compra; con el tipo de repuesto y su modelo */
        body[data-deposito="EM"] #view-alta .no-em, body:not([data-deposito="EM"]) #view-alta .solo-em,
        body[data-deposito="EM"] #cnt-form .no-em, body:not([data-deposito="EM"]) #cnt-form .solo-em,
        body[data-deposito="EM"] #view-ing .no-em { display: none; }
        body[data-deposito="EM"] .alta-bloques { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        /* Inventario físico de repuestos: la casilla del conector a la altura de los campos, y el stock mínimo y el máximo juntos en su renglón */
        #cnt-form .cnt-em-check { align-self: end; min-height: 40px; justify-content: center; }
        #cnt-form .cnt-em-check .check-linea { margin: 0; }
        body[data-deposito="EM"] #cnt-form .cnt-cajon { grid-column: span 2; }
        body[data-deposito="EM"] #cnt-form .cnt-min { grid-column: 1; }

        .alta-bloque { background: rgba(var(--tinte), 0.025); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 2px 16px 12px; }
        .alta-bloque .ficha-seccion { margin-top: 12px; }
        .alta-bloque .form-group { margin-bottom: 12px; }
        @media (max-width: 1000px) { .alta-bloques { grid-template-columns: 1fr; } }
        .alta-pie { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
        .alta-pie > .hint { margin-right: auto; }
        .barra-presupuesto { height: 8px; background: rgba(var(--tinte),0.08); border-radius: 99px; overflow: hidden; margin-top: 8px; }
        .barra-presupuesto div { height: 100%; border-radius: 99px; }
        .ficha-datos { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--fs-sm); color: var(--text-muted); margin-top: 6px; }
        .ficha-datos b { color: var(--text-body); font-weight: 600; }

        /* Campana de notificaciones */
        .notif-wrap { position: relative; }
        .btn-campana {
            position: relative; width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-body); transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s, filter 0.15s, opacity 0.15s;
        }
        .btn-campana:hover, .btn-campana.abierta { border-color: var(--border-hover); color: var(--text-title); background: var(--bg-surface-elevated); }
        .btn-campana svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        /* Menú «Apariencia» (botón al lado de la campana) */
        .tema-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 500; min-width: 230px; padding: 6px; background: var(--bg-surface-elevated);
                     border: 1px solid var(--border-hover); border-radius: 12px; box-shadow: 0 16px 36px rgba(0, 0, 0, calc(0.6 * var(--sombra))); animation: fadeIn 0.15s ease; }
        .tema-menu-tit { padding: 6px 10px 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
        .tema-menu button { display: flex; align-items: center; gap: 0.625rem; width: 100%; min-height: 2.75rem; padding: 0.5rem 0.625rem; border: 0; border-radius: 8px;
                            background: transparent; color: var(--text-body); font-size: var(--fs-md); text-align: left; cursor: pointer; }
        .tema-menu button:hover, .tema-menu button:focus-visible { background: rgba(var(--tinte), 0.06); color: var(--text-title); }
        .tema-menu button[aria-checked="true"] { background: var(--primary-glow); color: var(--text-title); font-weight: 600; }
        .tema-menu button > span { flex: 1; }
        .tema-menu small { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); }
        .tema-menu .ico { width: 18px; height: 18px; flex: none; }
        .tema-menu .tema-tilde { color: var(--primary); visibility: hidden; }
        .tema-menu button[aria-checked="true"] .tema-tilde { visibility: visible; }
        .notif-badge {
            position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
            background: #e11d48; color: var(--c-blanco); font-size: var(--fs-xs); font-weight: 700; display: flex; align-items: center; justify-content: center;
            border: 2px solid var(--bg-body); box-shadow: 0 0 10px var(--danger-glow);
        }
        .notif-panel {
            position: absolute; top: 50px; right: 0; width: 420px; max-height: 70vh; display: flex; flex-direction: column;
            background: var(--bg-surface); border: 1px solid var(--border-hover); border-radius: 14px;
            box-shadow: 0 24px 60px rgba(0, 0, 0, calc(0.75 * var(--sombra))); z-index: 500; overflow: hidden; animation: fadeIn 0.18s ease;
        }
        .notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); }
        .notif-head b { color: var(--text-title); font-size: var(--fs-lg); }
        .notif-link { background: none; border: none; color: var(--tx-6fdccd); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
        .notif-link:hover { background: var(--primary-glow); }
        .notif-link.rojo { color: var(--tx-fda4af); }
        .notif-link.rojo:hover { background: var(--danger-glow); }
        .notif-lista { overflow-y: auto; flex: 1; }
        .notif-item { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background 0.15s; position: relative; }
        .notif-item:hover { background: rgba(var(--tinte), 0.035); }
        .notif-item.leida { opacity: 0.55; }
        .notif-punto { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
        .notif-punto svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        .notif-punto.atraso { background: var(--danger-glow); color: var(--tx-fda4af); }
        .notif-punto.minimo { background: var(--warning-glow); color: var(--tx-fcd34d); }
        .notif-punto.revisar { background: rgba(168, 85, 247, 0.15); color: var(--tx-d8b4fe); }
        .notif-punto.hoy { background: var(--primary-glow); color: var(--tx-6fdccd); }
        .notif-punto.prestamo { background: rgba(236, 72, 153, 0.16); color: var(--tx-f9a8d4); }
        .segmentado.campo-falta { outline: 1.5px solid rgba(244, 63, 94, 0.85); outline-offset: 2px; border-radius: 10px; }
        /* contactos de las fichas: una línea por contacto */
        .ctl-linea { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
        .ctl-linea:last-child { border-bottom: 0; }
        .ctl-estrella { width: 14px; flex: none; color: var(--tx-fbbf24); font-size: var(--fs-sm); }
        .ctl-quien { flex: 1 1 220px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-md); }
        .ctl-quien b { color: var(--text-title); font-weight: 600; }
        .ctl-quien span { color: var(--text-muted); }
        .ctl-tel { font-family: var(--font-mono); font-size: var(--fs-sm); white-space: nowrap; }
        .ctl-mail { font-size: var(--fs-sm); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .ct-tit { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 8px; font-weight: 600; color: var(--text-title); }
        .ct-cab, .ct-fila { display: grid; grid-template-columns: 30px minmax(0, 1.3fr) minmax(0, 1fr) 70px minmax(0, 0.9fr) minmax(0, 1.3fr) 38px; gap: 6px; align-items: center; }
        .ct-cab { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
        .ct-fila { margin-bottom: 6px; }
        .ct-fila input { min-width: 0; }
        .ct-fila .ct-car, .ct-fila .ct-num { font-family: var(--font-mono); }
        .ct-aviso { grid-column: 2 / -1; }
        .ct-aviso:empty { display: none; }
        .ct-estrella { background: none; border: none; cursor: pointer; font-size: var(--fs-xl); color: var(--text-faint); padding: 0; line-height: 1; }
        .ct-estrella.on { color: var(--warning); }
        @media (max-width: 1000px) { .ct-cab { display: none; } .ct-fila { grid-template-columns: 30px 1fr 1fr; } .ct-fila .ct-mail { grid-column: 2 / -1; }
                                    .ct-fila .ct-car { grid-column: 2; } .ct-fila .ct-num { grid-column: 3; } }   /* la característica no cae en la columna de 30 px */
        .tel-par { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; }
        .tel-par input { font-family: var(--font-mono); }
        .tel-aviso { font-size: var(--fs-xs); color: var(--warning); margin-top: 4px; min-height: 0; }
        .segmentado-chico { padding: 3px; }
        .segmentado-chico button { padding: 0.3125rem 0.6875rem; font-size: var(--fs-xs); }
        .select-chico { width: auto; padding: 0.375rem 0.625rem; font-size: var(--fs-sm); }
        .dc-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 4px 16px 12px; }
        .dc-kpi { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 14px; }
        .dc-kpi small { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
        .dc-kpi b { font-size: var(--fs-xl); color: var(--text-title); font-weight: 700; }
        .dc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 0 16px 16px; }
        .dc-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 0.75rem 0.875rem; min-width: 0; }
        .dc-ancho { grid-column: 1 / -1; }
        .dc-tit { color: var(--text-title); font-weight: 600; font-size: var(--fs-md); }
        .dc-sub { color: var(--text-muted); font-size: var(--fs-xs); margin: 2px 0 10px; }
        .dc-fila { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) 120px; gap: 10px; align-items: center; margin: 7px 0; font-size: var(--fs-sm); }
        .dc-nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .dc-nom small { color: var(--text-muted); margin-left: 6px; }
        .dc-pista { height: 9px; background: rgba(var(--tinte), 0.05); border-radius: 5px; overflow: hidden; }
        .dc-barra { height: 100%; border-radius: 5px; transition: width 0.3s; }
        .dc-val { text-align: right; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-title); white-space: nowrap; }
        .dc-vacio { color: var(--text-muted); font-size: var(--fs-sm); padding: 10px 0; }
        @media (max-width: 1100px) { .dc-grid { grid-template-columns: minmax(0, 1fr); } .dc-kpis { grid-template-columns: minmax(0, 1fr); } .dc-fila { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 100px; } }
        .dash-st { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; align-items: stretch; }
        .dash-st.sin-mapa { grid-template-columns: minmax(0, 1fr); }
        .dash-st-mapa { display: flex; flex-direction: column; margin: 0; }
        .dash-st-mapa-div { flex: 1; min-height: 440px; }
        .dash-st-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
        .dash-st-col .table-wrap { margin: 0; }
        .dash-st-scroll { max-height: 250px; overflow-y: auto; }
        @media (max-width: 1100px) { .dash-st { grid-template-columns: minmax(0, 1fr); } .dash-st-mapa-div { min-height: 320px; } }
        .pq-mapa-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; }
        .pq-mapa-div { height: 520px; border-radius: 10px; overflow: hidden; background: rgba(128,128,128,0.08); }
        .pq-mapa-lado { max-height: 520px; overflow-y: auto; }
        @media (max-width: 1000px) { .pq-mapa-grid { grid-template-columns: 1fr; } .pq-mapa-div { height: 380px; } }
        .leaflet-popup-content a { color: #0d9488; font-weight: 600; }
        .badge-prestamo { background: rgba(236, 72, 153, 0.15); color: var(--tx-f9a8d4); }
        .badge-devprestamo { background: rgba(20, 184, 166, 0.16); color: var(--tx-5eead4); }
        .nota-prestado { font-size: var(--fs-xs); color: var(--tx-f9a8d4); margin-top: 3px; font-family: var(--font-mono);
                         display: flex; align-items: center; gap: 4px; line-height: 1.35; white-space: nowrap; }
        .nota-prestado .ico { width: 12px; height: 12px; flex: none; }
        .notif-punto.sistema { background: rgba(168, 85, 247, 0.18); color: var(--tx-d8b4fe); }
        .notif-texto { flex: 1; min-width: 0; }
        .notif-modulo { display: inline-block; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
                        border: 1px solid var(--border-subtle); border-radius: 999px; padding: 0 7px; margin-bottom: 3px; }
        .notif-modulo.actual { color: var(--primary); border-color: var(--primary); }
        .notif-titulo { font-size: var(--fs-sm); font-weight: 600; color: var(--text-title); line-height: 1.3; }
        .notif-item:not(.leida) .notif-titulo::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c-turquesa); margin-right: 7px; vertical-align: middle; }
        .notif-detalle { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
        .notif-tiempo { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 4px; }
        .notif-quitar { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: var(--fs-lg); width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0; align-self: flex-start; }
        .notif-quitar:hover { color: var(--tx-fb7185); background: var(--danger-glow); }
        .notif-vacio { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: var(--fs-md); }
        .notif-vacio div { font-size: 1.8rem; margin-bottom: 8px; }

        /* Ventana de confirmación propia (reemplaza a la del navegador) */
        #modal-confirmar { z-index: 10020; }
        /* nunca más alta que la pantalla: el texto se desplaza y los botones quedan siempre a la vista */
        .confirmar-card { max-width: 460px; padding: 1.5rem; display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
        .confirmar-cuerpo { display: flex; gap: 16px; align-items: flex-start; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
        .confirmar-botones { flex-shrink: 0; }

/* Lo que falta llegar: una tarjeta por proveedor con lo pendiente y los botones para reclamar */
.faltan-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.faltan-barra select { width: auto; max-width: 240px; margin-left: auto; }
.faltan-solo { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; }
.faltan-prov { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--bg-card); }
.faltan-prov.faltan-atrasado { border-color: var(--danger); }
.faltan-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.faltan-quien { flex: 1 1 220px; min-width: 0; }
.faltan-quien .hint { overflow-wrap: anywhere; }
.faltan-nombre { font-weight: 700; color: var(--text-title); }
.faltan-botones { display: flex; flex-wrap: wrap; gap: 6px; }
.faltan-prov .table-wrap { margin: 0; }
.faltan-ultimo { margin-top: 6px; }
@media (max-width: 768px) {
    .faltan-barra select { margin-left: 0; max-width: none; flex: 1 1 100%; }
    .faltan-botones, .faltan-botones .btn { flex: 1 1 auto; }
    /* en el celular cada material es un bloque: nombre arriba; OC y cuánto falta; fecha y estado */
    .faltan-prov table, .faltan-prov tbody { display: block; width: 100%; }
    .faltan-prov thead { display: none; }
    .faltan-prov tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "mat mat" "oc falta" "fecha est"; gap: 4px 10px; padding: 10px 12px; border-top: 1px solid var(--border-subtle); }
    .faltan-prov td { padding: 0 !important; border: 0 !important; }
    .faltan-prov .f-mat { grid-area: mat; } .faltan-prov .f-oc { grid-area: oc; } .faltan-prov .f-falta { grid-area: falta; text-align: right; }
    .faltan-prov .f-fecha { grid-area: fecha; color: var(--text-muted); font-size: var(--fs-sm); } .faltan-prov .f-est { grid-area: est; text-align: right; }
}
.faltan-prov .f-rotulo { display: none; }
@media (max-width: 768px) { .faltan-prov .f-rotulo { display: inline; } }
        .confirmar-icono { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
        .confirmar-icono svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        .confirmar-icono.normal { background: var(--primary-glow); color: var(--tx-6fdccd); border: 1px solid rgba(0, 173, 154, 0.3); }
        .confirmar-icono.aviso { background: var(--warning-glow); color: var(--tx-fcd34d); border: 1px solid rgba(245, 158, 11, 0.3); }
        .confirmar-icono.peligro { background: var(--danger-glow); color: var(--tx-fda4af); border: 1px solid rgba(244, 63, 94, 0.3); }
        .confirmar-titulo { font-size: var(--fs-xl); font-weight: 700; color: var(--text-title); line-height: 1.3; }
        .confirmar-mensaje { font-size: var(--fs-md); color: var(--text-body); line-height: 1.55; margin-top: 6px; white-space: pre-line; }
        /* lista de lo que va a cambiar (o de lo que cambió, en el comprobante) */
        .confirmar-lista { list-style: none; margin: 10px 0 0; padding: 8px 10px; max-height: 38vh; overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border-subtle);
                           border-radius: 8px; font-size: var(--fs-sm); color: var(--text-title); display: grid; gap: 4px; }
        .confirmar-lista li { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
        .confirmar-botones { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
        @media (max-width: 480px) { .confirmar-botones .btn { flex: 1 1 auto; justify-content: center; } }   /* celular: si no entran en un renglón, no se cortan */
        @media (max-width: 480px) { .confirmar-botones.tres { flex-direction: column-reverse; } .confirmar-botones.tres .btn { width: 100%; } }   /* tres botones: uno debajo del otro, el principal arriba */
        .emres-esc.dos { height: 34px; } .emres-esc span.abajo { top: 17px; }   /* dos horas que se chocan: la segunda baja un renglón */

        /* ===== Solicitudes de compra ===== */
        .badge-sol-PENDIENTE { background: var(--warning-glow); color: var(--tx-fcd34d); border: 1px solid rgba(245, 158, 11, 0.3); }
        .badge-sol-APROBADA { background: var(--success-glow); color: var(--tx-86efac); border: 1px solid rgba(34, 197, 94, 0.25); }
        .badge-sol-CANCELADA { background: rgba(148, 163, 184, 0.12); color: var(--tx-cbd5e1); border: 1px solid rgba(148, 163, 184, 0.25); }
        .badge-sol-FECHA { background: rgba(59, 130, 246, 0.14); color: var(--tx-93c5fd); border: 1px solid rgba(59, 130, 246, 0.3); }
        .notif-punto.solicitud { background: var(--warning-glow); color: var(--tx-fcd34d); }
        .notif-punto.solicitud_resuelta { background: var(--success-glow); color: var(--tx-86efac); }
        .btn-xs, #tb-stock-master .btn-xs { padding: 2px 0.5rem; font-size: var(--fs-xs); border-radius: 6px; gap: 0.25rem; }
        .btn-xs .ico { width: 12px; height: 12px; }
        .btn-solicitar { margin-left: 4px; vertical-align: middle; }
        .nav-num { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--warning-glow); color: var(--tx-fcd34d); font-size: var(--fs-xs); font-weight: 700; text-align: center; }
        .sol-aprobar { margin-top: 18px; padding: 16px; border: 1px solid var(--border-hover); border-radius: 12px; background: rgba(var(--tinte), 0.02); }

        /* ===== Análisis de compras ===== */
        .ac-filtros { margin-bottom: 16px; }
        .ac-rapidos { margin-bottom: 14px; flex-wrap: wrap; }
        .ac-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
        .ac-grid .form-group { margin: 0; }
        .ac-pie { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
        .ac-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
        .ac-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: var(--fs-xs);
                   background: var(--primary-glow); color: var(--text-title); border: 1px solid var(--border-hover); }
        .ac-chip button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: var(--fs-lg); line-height: 1; padding: 0; }
        .ac-chip button:hover { color: var(--tx-fb7185); }
        .ac-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
        .ac-kpi { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px 16px; }
        .ac-kpi small { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
        .ac-kpi b { display: block; font-size: var(--fs-xl); color: var(--text-title); font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .ac-kpi i { display: block; font-style: normal; font-size: var(--fs-xs); margin-top: 3px; }
        /* Análisis de compras · Cumplimiento de proveedores (también el bloque de la ficha del proveedor) */
        .cump-bien { color: var(--tx-34d399) !important; }
        .cump-medio { color: var(--tx-fbbf24) !important; }
        .cump-mal { color: var(--tx-fb7185) !important; }
        .cump-barra { display: block; flex: 1; min-width: 80px; max-width: 220px; height: 8px; border-radius: 99px; background: rgba(var(--tinte), 0.08); overflow: hidden; }
        .cump-barra > span { display: block; height: 100%; border-radius: 99px; background: currentColor; }
        .cump-celda { display: flex; align-items: center; gap: 10px; }
        .cump-celda b { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
        #tb-cumpl tr.cump-pocos td { opacity: 0.55; }
        .cump-pie { margin-top: 10px; }
        .cump-ficha-pct { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
        .cump-ficha-pct b { font-size: var(--fs-2xl, 1.6rem); font-weight: 700; }
        .cump-ficha-datos { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 10px 0 4px; }
        .cump-ficha-sub { display: block; margin: 12px 0 4px; color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; }
        .cump-tarde { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 6px 8px; border-radius: 6px; }
        .cump-tarde span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .cump-tarde > b:first-child { color: var(--primary); font-family: var(--font-mono); }
        #fcli-cumpl .cump-barra { max-width: none; }
        /* Vehículos: tarjeta por vehículo con vencimientos y service; ficha con datos e historial */
        .vh-mal { --vh: var(--tx-fb7185); }
        .vh-medio { --vh: var(--tx-fbbf24); }
        .vh-bien { --vh: var(--tx-34d399); }
        .vh-sin { --vh: var(--text-faint); }
        .vh-toolbar { align-items: center; }
        .vh-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 18px; }
        .vh-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
        .vh-cab { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); }
        .vh-cab :is(h3, h4) { margin: 0 0 4px; font-size: var(--fs-lg); color: var(--text-title); }
        .vh-cab-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .vh-avisos { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
        /* ícono del vehículo: círculo del color del estado (al día: el del módulo) */
        .vh-ic { width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff;
                 background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #000)); box-shadow: 0 4px 12px var(--primary-glow); }
        .vh-ic svg { width: 27px; height: 27px; fill: currentColor; }
        .vh-ic.vh-mal { background: linear-gradient(145deg, #fb7185, #be123c); box-shadow: 0 4px 12px rgba(251, 113, 133, .3); }
        .vh-ic.vh-medio { background: linear-gradient(145deg, #fbbf24, #b45309); box-shadow: 0 4px 12px rgba(251, 191, 36, .3); }
        .vh-patente { display: inline-block; border: 1.5px solid #cfd8d6; border-top: 3px solid #1d4ed8; border-radius: 4px; background: #f1f5f4; color: #0b1214;
                      font: 700 11px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.1em; padding: 2px 6px; white-space: nowrap; }
        .vh-datos-c { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 20px; }
        .vh-dato-c { --vh: var(--text-title); background: rgba(var(--tinte), 0.03); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px;
                     display: flex; flex-direction: column; gap: 2px; min-width: 0; }
        .vh-dato-c small { color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 6px; }
        .vh-dato-c small svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
        .vh-dato-c > b { color: var(--vh); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
        .vh-dato-c.vh-sin > b { color: var(--text-faint); font-weight: 600; }
        .vh-dato-c > span { color: var(--text-muted); font-size: var(--fs-xs); }
        .vh-dato-ancho { grid-column: 1 / -1; }
        .vh-dato-ancho .vh-barra { margin-top: 6px; }
        .vh-serv-fila { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
        .vh-serv-fila .vh-falta { font-size: var(--fs-sm); align-self: center; }
        .vh-completar { color: var(--primary); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; align-self: flex-start; }
        .vh-completar:hover { text-decoration: underline; }
        .vh-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--border-subtle); margin-top: auto; }
        .vh-pie .hint b { color: var(--text-title); }
        #vhf-titulo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        #vhf-titulo .vh-ic { width: 38px; height: 38px; } #vhf-titulo .vh-ic svg { width: 22px; height: 22px; }
        @media (max-width: 600px) {
            .vh-cab { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; }
            .vh-avisos { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
            .vh-datos-c { grid-template-columns: 1fr; padding: 14px 16px; }
            .vh-pie { padding: 12px 16px; }
        }
        .vh-sub { margin-top: 8px; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
        .vh-falta { color: var(--vh); font-weight: 700; white-space: nowrap; }
        .vh-barra { display: block; height: 8px; border-radius: 99px; background: rgba(var(--tinte), 0.08); overflow: hidden; }
        .vh-barra > span { display: block; height: 100%; border-radius: 99px; background: var(--vh); }
        .vh-botones { display: flex; flex-wrap: wrap; gap: 8px; }
        .vh-botones-ficha { margin: 0 0 14px; }
        .vh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
        .vh-chip { padding: 2px 10px; border-radius: 99px; border: 1px solid var(--vh); color: var(--vh); font-size: var(--fs-xs); font-weight: 700; }
        .vh-chip.vh-bien { --vh: var(--tx-34d399); }
        b.vh-mal, b.vh-medio, b.vh-bien { color: var(--vh); }
        .vh-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin-bottom: 6px; }
        .vh-dato small { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
        .vh-tipo-serv { color: var(--primary); }
        .vh-tipo-arr { color: var(--tx-fbbf24); }
        .vh-hist td.vh-acc { white-space: nowrap; text-align: right; }
        .vh-hist td.vh-acc .btn { margin-left: 4px; }
        .vh-total { text-align: right; margin-top: 12px; color: var(--text-muted); }
        .vh-total b { color: var(--text-title); }
        .vh-tipo { margin-bottom: 14px; }
        .vh-form > .form-group { min-width: 0; }   /* el campo de la factura no estira la ventana en el celular */
        .vh-form input[type=file] { width: 100%; max-width: 100%; }
        .vh-botonera { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
        .vh-botonera #vhe-baja { margin-right: auto; }
        @media (max-width: 760px) {
            .vh-lista { grid-template-columns: 1fr; gap: 12px; }
            .vh-card { padding: 0.875rem 1rem; }
            .vh-venc.vh-bien { display: none; }   /* en el celular solo lo que vence o venció */
            .vh-venc { grid-template-columns: 10px 62px 1fr; }
            .vh-venc .vh-falta { display: none; }   /* la fecha alcanza y no se amontona */
            .vh-venc-ok { display: block; }
            .vh-botones .btn { flex: 1 1 140px; min-height: 2.75rem; }
            .vh-datos { grid-template-columns: 1fr; }
            .vh-form { grid-template-columns: 1fr !important; }
            .vh-form .u-span2 { grid-column: auto; }
            .vh-toolbar .btn { width: 100%; margin-left: 0 !important; }
        }
        .ac-sube { color: var(--tx-86efac); } .ac-baja { color: var(--tx-fda4af); }
        .ac-aviso { margin: -4px 0 12px; color: var(--warning); }
        .ac-card { margin-bottom: 14px; }
        /* Códigos de barras: botón de cámara (solo en el celular) y lector de las recepciones / devoluciones */
        .btn-camara { display: none; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
                      border: 1px solid var(--border-subtle); background: var(--bg-surface-elevated); color: var(--primary); }
        .btn-camara svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        body.modo-celular .btn-camara { display: inline-flex; }
        body.modo-celular .solo-pc { display: none !important; }
        /* Inicio a medida: los bloques del Dashboard se ordenan con "order"; los de media pantalla van de a dos */
        #view-dash.active { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); column-gap: 20px; align-items: start; }
        #view-dash > * { grid-column: 1 / -1; min-width: 0; }
        #view-dash > .bloque-mitad { grid-column: auto; }
        #view-dash > .bloque-apagado { display: none !important; }
        @media (max-width: 1100px) { #view-dash > .bloque-mitad { grid-column: 1 / -1; } }
        .dash-accesos { order: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
        .dash-accesos .dash-personalizar { margin-left: auto; color: var(--text-muted); }
        .dash-pendiente { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; padding: 12px 16px 14px; }
        .pend-tarjeta { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; cursor: pointer; font: inherit; font-size: var(--fs-sm);
                        color: var(--text-body); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px; }
        .pend-tarjeta:hover { border-color: var(--border-hover); color: var(--text-title); }
        .pend-tarjeta b { font-size: var(--fs-2xl); color: var(--text-title); font-variant-numeric: tabular-nums; }
        .pend-tarjeta b.pend-urgente { color: var(--tx-fda4af); }
        .dash-semana { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 4px 16px 14px; }
        .dash-sem-dia { min-width: 0; }
        .dash-sem-fecha { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 2px; }
        /* Tarjetas de "Esta semana": todas del mismo alto, 3 renglones de una línea (lo que no entra se corta con "…"; entero al pasar el mouse) */
        .sem-tarjeta { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: none; cursor: pointer; font: inherit;
                       border-left: 3px solid currentColor; border-radius: 6px; padding: 6px 9px; margin-top: 4px; }
        .sem-tarjeta:hover { filter: brightness(1.2); }
        .sem-tarjeta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
        .sem-l1 { font-size: var(--fs-xs); font-weight: 700; }
        .sem-l2 { font-size: var(--fs-xs); color: var(--text-body); }
        .sem-l3 { font-size: var(--fs-xs); color: var(--text-muted); }
        .ini-sub { font-weight: 700; color: var(--text-title); margin-bottom: 8px; font-size: var(--fs-md); }
        .ini-lista { display: grid; gap: 6px; }
        .ini-fila { display: flex; align-items: center; gap: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 8px 10px; }
        .ini-fila.arrastrando { opacity: 0.4; }
        .ini-fila label { flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-md); }
        .ini-agarre { cursor: grab; color: var(--text-faint); font-size: var(--fs-xl); user-select: none; }
        .ini-flechas { display: flex; gap: 4px; }
        .ini-flechas button { background: none; border: 1px solid var(--border-subtle); border-radius: 6px; color: var(--text-muted); cursor: pointer; width: 28px; height: 26px; font-size: var(--fs-xs); }
        .ini-flechas button:disabled { opacity: 0.3; cursor: default; }
        .ini-accesos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
        .ini-acceso { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border-subtle); border-radius: 8px; cursor: pointer; font-size: var(--fs-sm); }
        /* Comentarios en las fichas y menciones */
        .coment-caja { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
        .coment-tit { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text-title); margin-bottom: 8px; font-size: var(--fs-md); }
        .coment-lista { display: grid; gap: 2px; margin-bottom: 10px; }
        .coment { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
        .coment:last-child { border-bottom: none; }
        .coment-av { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: rgba(20, 184, 138, 0.16); color: var(--tx-5eead4);
                     display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 700; }
        .coment-cuerpo { flex: 1; min-width: 0; font-size: var(--fs-sm); }
        .coment-texto { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-body); margin-top: 2px; }
        .coment-mencion { color: var(--tx-5eead4); font-weight: 600; }
        .coment-borrar { float: right; background: none; border: none; cursor: pointer; color: var(--text-faint); font-size: var(--fs-xl); line-height: 1; }
        .coment-borrar:hover { color: var(--tx-fb7185); }
        .coment-resp { margin-left: 40px; border-left: 2px solid var(--border-subtle); padding-left: 10px; }
        .coment-responder { background: none; border: none; cursor: pointer; font: inherit; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); padding: 2px 0; margin-top: 2px; }
        .coment-responder:hover { color: var(--primary); }
        .coment-respondiendo { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 6px; }
        .coment-respondiendo button { background: none; border: none; cursor: pointer; color: var(--text-faint); font-size: var(--fs-lg); }
        .coment-nuevo { display: flex; gap: 8px; align-items: flex-end; }
        .coment-escribir { position: relative; flex: 1; }
        .coment-escribir textarea { width: 100%; resize: vertical; min-height: 2.625rem; }
        .coment-sugerencias { position: absolute; left: 0; bottom: calc(100% + 4px); min-width: 240px; z-index: 50; background: var(--bg-surface-elevated);
                              border: 1px solid var(--border-subtle); border-radius: 10px; padding: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, calc(0.4 * var(--sombra))); }
        .coment-sugerencias button { display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer; font: inherit; font-size: var(--fs-sm);
                                     color: var(--text-body); padding: 0.375rem 0.625rem; border-radius: 6px; }
        .coment-sugerencias button.activa, .coment-sugerencias button:hover { background: rgba(20, 184, 138, 0.14); }
        .men-lista { display: grid; }
        .men-fila { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border-subtle);
                    padding: 12px 16px; cursor: pointer; font: inherit; color: var(--text-body); }
        .men-fila:hover { background: var(--bg-surface-elevated); }
        .men-nueva { background: rgba(20, 184, 138, 0.06); }
        .men-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: var(--fs-md); }
        .men-punto { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }
        /* Calendario */
        .cal-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
        .cal-nav { display: flex; align-items: center; gap: 6px; }
        .cal-nav :is(h3, h4) { margin: 0 0 0 8px; font-size: var(--fs-lg); color: var(--text-title); }
        .cal-nav .btn[aria-label] { min-width: 2.5rem; justify-content: center; font-size: 1.2rem; }   /* ‹ y ›: del ancho de un dedo */
        .cal-leyenda { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
        .cal-leyenda .cal-chip { cursor: default; width: auto; }
        .cal-chip { display: block; width: 100%; text-align: left; border: none; cursor: pointer; font: inherit; font-size: var(--fs-xs); font-weight: 600; line-height: 1.35;
                    padding: 2px 6px; border-radius: 5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .cal-leyenda .cal-chip { display: inline-block; margin: 0; }
        /* la leyenda muestra solo lo que puede aparecer en el stock abierto */
        body:not([data-deposito="ST"]) .cal-leyenda [data-dep="ST"], body[data-deposito="ST"] .cal-leyenda [data-dep="ING"] { display: none; }
        .cal-chip:hover { filter: brightness(1.25); }
        .cal-oc { background: rgba(56, 189, 248, 0.16); color: var(--tx-7dd3fc); }
        .cal-sol { background: rgba(45, 212, 191, 0.15); color: var(--tx-5eead4); }
        .cal-prestamo { background: rgba(236, 72, 153, 0.15); color: var(--tx-f9a8d4); }
        .cal-proyecto { background: rgba(167, 139, 250, 0.16); color: var(--tx-c4b5fd); }
        .cal-pedido { background: rgba(251, 146, 60, 0.16); color: var(--tx-fdba74); }
        .cal-entrega { background: rgba(245, 158, 11, 0.16); color: var(--tx-fcd34d); }
        .cal-reparacion { background: rgba(129, 140, 248, 0.16); color: var(--tx-a5b4fc); }
        .cal-garantia { background: rgba(148, 163, 184, 0.16); color: var(--tx-cbd5e1); }
        .cal-atrasado { background: rgba(244, 63, 94, 0.16); color: var(--tx-fda4af); }
        .cal-chip.cal-hecho, .sem-tarjeta.cal-hecho { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); opacity: 1; }   /* lo ya hecho: gris, con tilde */
        .cal-ver-hecho { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: var(--fs-sm); color: var(--text-muted); cursor: pointer; }
        .cal-atr-caja { border: 1px solid rgba(244, 63, 94, 0.35); background: rgba(244, 63, 94, 0.06); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; color: var(--tx-fda4af); }
        .cal-atr-lista { display: grid; gap: 2px; margin-top: 6px; max-height: 180px; overflow-y: auto; }
        .cal-atr-fila { display: flex; align-items: center; gap: 10px; }
        .cal-atr-fila .hint { flex-shrink: 0; width: 78px; }
        .cal-atr-fila .cal-chip { margin: 0; min-width: 0; }
        @media (max-width: 760px) {   /* celular: la fecha arriba y el aviso entero abajo (hasta 2 renglones), sin correrse de costado */
            .cal-atr-fila { flex-direction: column; align-items: stretch; gap: 2px; padding: 4px 0; }
            .cal-atr-fila .cal-chip { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-xs); padding: 5px 8px; }
            .cal-atr-lista { max-height: 260px; }
        }
        .cal-mes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, 0.6fr)); gap: 4px; }
        .cal-cab { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; color: var(--text-muted); padding: 2px 6px; }
        .cal-dia { min-height: 96px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 4px 5px; min-width: 0; }
        .cal-fuera { opacity: 0.45; }
        .cal-finde { background: transparent; }
        .cal-hoy { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
        .cal-num { background: none; border: none; cursor: pointer; font: inherit; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); padding: 0 2px; }
        .cal-hoy .cal-num { color: var(--primary); }
        .cal-mas { background: none; border: none; cursor: pointer; font: inherit; font-size: var(--fs-xs); color: var(--text-muted); padding: 2px 4px; }
        .cal-agenda { display: grid; gap: 8px; }
        .cal-agenda-dia { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 8px 12px; }
        .cal-agenda-fecha { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 2px; }
        .cal-hoy .cal-agenda-fecha { color: var(--primary); }
        .cal-agenda .cal-chip { white-space: normal; font-size: var(--fs-sm); font-weight: 500; padding: 5px 8px; margin-top: 4px; }
        .cal-agenda .cal-chip b { font-weight: 700; }
        .cal-vacio { padding: 2px 0; font-size: var(--fs-xs); }
        /* Ancho de columnas a mano: el borde derecho del título se resalta y se arrastra */
        th.th-borde { cursor: col-resize; box-shadow: inset -2px 0 0 var(--primary); }
        body.ajustando-columna, body.ajustando-columna * { cursor: col-resize !important; user-select: none; }
        table.cols-a-mano { table-layout: fixed; min-width: 0 !important; }
        table.cols-a-mano td, table.cols-a-mano th { overflow-wrap: anywhere; }   /* el texto se acomoda en renglones al achicar la columna */
        /* Foco visible al moverse con el teclado (Tab): un anillo del color del stock en botones, enlaces y pestañas */
        button:focus-visible, a:focus-visible, [tabindex]:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
        /* Campo con error (errorCampo): borde rojo hasta que se corrige */
        .campo-error, .campo-error:focus { border-color: var(--c-rojo) !important; box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.25) !important; }
        /* Fila única de una tabla: cargando, vacía o error al cargar */
        .tabla-estado { text-align: center; color: var(--text-muted); padding: 32px 16px !important; }
        .tabla-error { color: var(--tx-fda4af); }
        .tabla-error .btn { margin-left: 10px; }
        .solo-celular { display: none; }
        body.modo-celular .solo-celular { display: block; }
        /* "Vaciar lista" a la izquierda, lejos del botón que confirma (a la derecha) */
        .lista-acciones { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
        .rec-pie { margin-top: 12px; }
        .rec-pie .btn { width: 100%; padding: 0.8125rem; }
        body.modo-celular .lista-acciones { flex-direction: column-reverse; }   /* celular: confirmar arriba (a mano), vaciar abajo y separado */
        body.modo-celular .lista-acciones .btn { width: 100%; }
        body.modo-celular .lista-acciones .btn-outline { margin-top: 10px; }
        /* Conteo de inventario en el celular */
        .cc-cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: var(--fs-sm); color: var(--text-muted); }
        .cc-num { flex-shrink: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--primary); background: rgba(20, 184, 138, 0.14); padding: 3px 10px; border-radius: 20px; }
        .cc-escanear { width: 100%; justify-content: center; padding: 13px; font-size: var(--fs-lg); margin-bottom: 10px; }
        .cc-fila { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
                   background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; color: var(--text-body); font: inherit; }
        .cc-fila-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
        .cc-fila .sku-txt { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--primary); font-weight: 600; }
        .cc-fila-nom { font-size: var(--fs-sm); font-weight: 600; color: var(--text-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .cc-dif { flex-shrink: 0; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
        .cc-ok { color: var(--success); } .cc-mas { color: var(--tx-4ade80); } .cc-menos { color: var(--danger); }
        .cc-subtitulo { margin: 16px 0 8px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
        .cc-ficha { background: var(--bg-surface-elevated); border: 1px solid var(--primary); border-radius: 14px; padding: 14px; margin-bottom: 8px; scroll-margin-top: 80px; }
        .cc-ficha-arriba { display: flex; gap: 12px; margin-bottom: 12px; }
        .cc-ficha-arriba .sku-txt { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--primary); font-weight: 600; overflow-wrap: anywhere; }
        .cc-ficha-nom { font-size: var(--fs-md); font-weight: 700; color: var(--text-title); margin-top: 3px; }
        .cc-foto { width: 60px; height: 60px; flex-shrink: 0; border-radius: 10px; background: var(--bg-surface); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text-faint); }
        .cc-foto img { width: 100%; height: 100%; object-fit: cover; }
        .cc-datos { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: var(--fs-md); color: var(--text-title); }
        .cc-et { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
        .cc-cant { display: flex; gap: 8px; align-items: stretch; }
        .cc-cant .btn { width: 52px; justify-content: center; font-size: var(--fs-2xl); padding: 0; }
        .cc-cant input { flex: 1; min-width: 0; text-align: center; font-size: 1.5rem !important; font-weight: 700; padding: 0.5rem; border: 1px solid var(--primary) !important; }
        .cc-dif-linea { text-align: center; min-height: 22px; margin: 8px 0; font-size: var(--fs-sm); color: var(--text-muted); }
        .cc-link { display: flex; align-items: center; gap: 6px; width: 100%; margin: 0 0 10px; padding: 8px 0; background: none; border: none; cursor: pointer;
                   color: var(--primary); font: inherit; font-size: var(--fs-md); font-weight: 600; }
        .cc-ubic { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; align-items: end; }   /* «Cajón / estante» ocupa dos renglones: los campos igual quedan alineados */
        .cc-ubic input { width: 100%; text-align: center; font-size: var(--fs-lg); font-weight: 600; }
        .cc-ubic .cc-et { margin-bottom: 4px; }
        #cc-prov select, #cc-prov .sel-boton { width: 100%; }
        .cc-guardar { width: 100%; justify-content: center; padding: 12px; margin-bottom: 8px; }
        .cc-botones { display: flex; gap: 8px; flex-wrap: wrap; }
        .cc-botones .btn { flex: 1; justify-content: center; }
        /* Listas como tarjetas en el celular (Reparaciones, Comisionamientos): sin encabezado de columnas */
        body.modo-celular table:has(.fila-tarjeta) thead { display: none; }
        body.modo-celular table:has(.fila-tarjeta) { min-width: 0 !important; width: 100%; }
        .fila-tarjeta td { padding: 0.75rem 0.875rem !important; white-space: normal !important; }
        .tarjeta-cel-arriba { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
        .tarjeta-cel-num { font-family: var(--font-mono); color: var(--primary); font-weight: 700; }
        /* Alta de material: aviso de códigos parecidos debajo del campo código */
        .codigos-parecidos { margin-top: 6px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.08); font-size: var(--fs-xs); }
        .codigos-parecidos-tit { color: var(--warning); font-weight: 600; margin-bottom: 4px; }
        .codigos-parecidos-item { line-height: 1.5; }
        .codigos-parecidos-item .cp-cod { font-family: var(--font-mono); color: var(--text-title); font-weight: 700; }
        .codigos-parecidos-item .cp-nom { color: var(--text-body); }
        /* Mi perfil: dispositivos con la huella activada */
        .perfil-huellas-caja { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
        .emv-wa { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; font-size: var(--fs-sm); }
        .emv-wa > span { flex: 1 1 240px; min-width: 0; line-height: 1.5; }
        .emv-wa > .btn { flex: none; }
        /* ventana del viaje: los bloques de WhatsApp, recorrido y repuestos, separados entre sí y del de arriba */
        #emv-curso > .emv-wa, #emv-curso > .emv-rep-panel, #emv-viaje-recorrido { margin-top: 14px; }
        .emv-wa .ok { color: var(--em-ok); } .emv-wa .mal { color: var(--danger); }
        .perfil-huellas-caja > label { display: block; font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); margin-bottom: 8px; }
        .perfil-huella { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: 8px; margin-bottom: 6px; }
        .tarjeta-cel-num .tarjeta-cel-nombre { font-family: var(--font-sans); color: var(--text-title); font-size: var(--fs-lg); }
        /* Contactos en la ficha de cliente / proveedor, en el celular: uno debajo del otro */
        .fcli-contactos { display: flex; flex-direction: column; gap: 8px; }
        .fcli-contacto { border: 1px solid var(--border-subtle); border-radius: 8px; padding: 8px 10px; font-size: var(--fs-md); line-height: 1.5; }
        .fcli-dato a, .fcli-contacto a, .fcli-sec a { color: var(--primary); text-decoration: none; }
        .tarjeta-cel-tit { font-weight: 600; color: var(--text-title); }
        .tarjeta-cel-det { font-size: var(--fs-sm); margin-top: 3px; }
        .tarjeta-cel-pie { margin-top: 5px; font-size: var(--fs-xs); line-height: 1.35; overflow-wrap: anywhere; }   /* un mail o un dato largo no ensancha la tarjeta */
        .con-camara { display: flex; gap: 8px; align-items: center; }
        .con-camara > .combo, .con-camara > .search-container, .con-camara > input { flex: 1; min-width: 0; }
        .lector-barras { margin: 0 0 12px; }
        .lector-barras .search-container { margin: 0; }
        .cb-codigo { font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 700; color: var(--primary); background: var(--bg-surface-elevated);
                     border: 1px dashed var(--border-hover); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; letter-spacing: 0.05em; text-align: center; }
        .barras-lista { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
        .barras-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: var(--fs-xs); padding: 3px 8px; border-radius: 6px;
                       background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); color: var(--text-title); }
        .barras-chip button { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font-size: var(--fs-lg); line-height: 1; }
        /* Cámara en vivo: video con un marco guía en el centro (la zona que se lee) */
        .escaneo-vivo-card { max-width: 520px; width: 96vw; }
        .escaneo-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--c-negro); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
        @media (max-width: 760px) { .escaneo-video { aspect-ratio: 4 / 5; } }
        .escaneo-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
        .escaneo-marco { position: absolute; left: 8%; right: 8%; top: 28%; bottom: 28%; border: 2px solid var(--primary); border-radius: 10px;
                         box-shadow: 0 0 0 9999px rgba(0, 0, 0, calc(0.35 * var(--sombra))); }
        .escaneo-marco span { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: rgba(239, 68, 68, 0.85);
                              box-shadow: 0 0 8px rgba(239, 68, 68, 0.8); animation: escaneoLinea 1.6s ease-in-out infinite; }
        @keyframes escaneoLinea { 0%, 100% { transform: translateY(-38px); } 50% { transform: translateY(38px); } }
        .escaneo-vivo-botones { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
        .escaneo-vivo-botones .btn.activo { background: rgba(250, 204, 21, 0.18); color: var(--tx-fde047); border-color: rgba(250, 204, 21, 0.5); }
        .escaneo-foto { display: block; width: 100%; max-height: 240px; object-fit: contain; border-radius: 10px; background: var(--c-negro); margin-bottom: 12px; }
        .escaneo-estado { font-weight: 600; color: var(--text-title); margin-bottom: 8px; }
        .escaneo-ayuda { margin-bottom: 10px; }
        .escaneo-acciones { display: flex; flex-direction: column; gap: 10px; }
        .flash-lector { animation: flashLector 0.9s ease; }
        @keyframes flashLector { from { box-shadow: 0 0 0 3px var(--primary); } to { box-shadow: 0 0 0 0 transparent; } }
        /* Tablero mensual y comparador de proveedores */
        /* Estado del sistema */
        .est-avisos { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
        .est-aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: var(--fs-md); line-height: 1.4;
                     border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-body); }
        .est-aviso .ico { margin-top: 2px; }
        .est-aviso.error { border-color: rgba(244, 63, 94, 0.45); background: var(--danger-glow); color: var(--tx-fecdd3); }
        .est-aviso.aviso { border-color: rgba(245, 158, 11, 0.45); background: var(--warning-glow); color: var(--tx-fde68a); }
        .est-aviso.ok { border-color: rgba(0, 173, 154, 0.45); background: var(--primary-glow); color: var(--tx-a7f3e8); }
        .est-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
        .est-card :is(h3, h4) { margin-bottom: 10px; }
        .est-fila { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
        .est-fila:last-child { border-bottom: none; }
        .est-err-sub { font-size: var(--fs-xs); font-weight: 400; margin-left: 6px; }
        .est-err-scroll { overflow-x: auto; max-height: 340px; overflow-y: auto; }   /* compacta: si hay muchos, se desplaza la tabla, no la pantalla */
        .est-errores { width: 100%; font-size: var(--fs-sm); }
        .est-errores code { font-size: var(--fs-xs); overflow-wrap: anywhere; }
        .est-err-ruta { font-size: var(--fs-xs); font-family: var(--font-mono); overflow-wrap: anywhere; }
        .est-err-rev { opacity: .6; }
        .est-fila > span { color: var(--text-muted); flex-shrink: 0; }
        .est-fila > b { font-weight: 500; color: var(--text-body); text-align: right; min-width: 0; overflow-wrap: anywhere; }
        .est-nuevas { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
        .est-nuevas ul { margin: 6px 0 8px; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
        .est-ruta { font-family: 'JetBrains Mono', monospace; font-size: var(--fs-xs); }
        .est-bien { color: var(--success); font-weight: 700; }
        .est-mal { color: var(--danger); font-weight: 700; }
        .est-barra { height: 10px; border-radius: 99px; background: var(--bg-surface-elevated); overflow: hidden; margin: 4px 0 8px; }
        .est-barra > div { height: 100%; background: var(--primary); border-radius: 99px; }
        .est-barra > div.medio { background: var(--warning); }
        .est-barra > div.mal { background: var(--danger); }
        @media (max-width: 760px) { .est-grid { grid-template-columns: 1fr; } .est-fila { flex-direction: column; gap: 2px; } .est-fila > b { text-align: left; } }
        .tab-barra { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
        .tab-leyenda { display: flex; gap: 14px; font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }
        .tab-leyenda i, .cmp-punto { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
        .tab-barra-a { fill: var(--primary); opacity: 0.85; }
        .tab-barra-b { fill: var(--tx-f59e0b); opacity: 0.85; }
        .tab-barra-s { fill: var(--tx-60a5fa); opacity: 0.85; }
        .cmp-mejor { color: var(--success) !important; }
        .cmp-tabla td, .cmp-tabla th { white-space: nowrap; }
        .ac-tit { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--text-title); font-weight: 600; font-size: var(--fs-md); margin-bottom: 10px; }
        .ac-graf { width: 100%; }
        .ac-svg { width: 100%; height: auto; display: block; overflow: visible; }
        .ac-linea { stroke: rgba(var(--tinte), 0.07); stroke-width: 1; vector-effect: non-scaling-stroke; }
        .ac-eje { fill: var(--text-muted); font-size: 12px; }
        .ac-barra { fill: var(--primary); opacity: 0.85; transition: opacity 0.15s; }
        .ac-barra-g { cursor: pointer; }
        .ac-barra-g:hover .ac-barra { opacity: 1; fill: var(--tx-34d399); }
        .ac-rankings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
        #modal-ac-grupo th, #modal-ac-grupo td.num { white-space: nowrap; }
        #modal-ac-grupo th { padding: 0.625rem 0.625rem; }
        #modal-ac-grupo td { padding: 0.5625rem 0.625rem; font-size: var(--fs-sm); }
        .ac-tit-clic { cursor: pointer; }
        .ac-tit-clic:hover > span:first-child { color: var(--primary); }
        .ac-tit-der { display: inline-flex; align-items: center; gap: 10px; }
        .ac-clic { cursor: pointer; border-radius: 6px; }
        .ac-clic:hover { background: rgba(var(--tinte), 0.04); }
        @media (max-width: 1100px) { .ac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ac-rankings { grid-template-columns: minmax(0, 1fr); } }

        /* ===== Adjuntos de la OC (cotización) ===== */
        .adj-caja { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--border-hover); border-radius: 10px; }
        .adj-caja.arrastrando, .adj-oc.arrastrando { border-color: var(--primary); background: var(--primary-glow); }
        .adj-lista { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
        .adj-lista:empty { display: none; }
        .adj-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: var(--fs-xs);
                    background: var(--bg-surface-elevated); border: 1px solid var(--border-hover); color: var(--text-title); }
        .adj-chip .ico { width: 13px; height: 13px; }
        .adj-chip button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: var(--fs-lg); line-height: 1; padding: 0; }
        .adj-chip button:hover { color: var(--tx-fb7185); }
        .adj-oc { margin-bottom: 14px; border: 1px dashed transparent; border-radius: 10px; }
        .adj-oc:empty { display: none; }
        .adj-oc-tit { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-title); font-weight: 600; font-size: var(--fs-md); margin-bottom: 6px; }
        .adj-oc-tit .ico { width: 14px; height: 14px; vertical-align: -2px; }
        .adj-fila { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; background: var(--bg-surface-elevated); margin-bottom: 6px; flex-wrap: wrap; }
        .adj-nom { color: var(--primary); font-weight: 600; cursor: pointer; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
        .adj-nom:hover { text-decoration: underline; }
        .adj-nom .ico { width: 14px; height: 14px; vertical-align: -2px; }
        .adj-acc { margin-left: auto; display: flex; gap: 6px; }

        /* ===== Contraseña inicial / blanqueo ===== */
        .aviso-clave { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: var(--fs-xs); line-height: 1.45;
                       background: var(--primary-glow); color: var(--text-title); border: 1px solid var(--border-hover); }
        .aviso-clave .ico { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--primary); }

        /* ===== Herramientas consumibles ===== */
        .badge-herr { background: rgba(249, 115, 22, 0.14); color: var(--tx-fdba74); border: 1px solid rgba(249, 115, 22, 0.35); }
        .alta-que { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
        #alta-herr { margin-bottom: 4px !important; }

        /* ===== Accesibilidad ===== */
        /* Filas y tarjetas que se abren con un clic: se ve cuál está elegida al moverse con Tab */
        [data-clic-teclado]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
        /* Si la persona pidió menos movimiento en su sistema: nada se desplaza, crece ni gira rápido. Los cambios de color y de
           transparencia siguen (no mueven nada y avisan qué cambió), igual que lo que avisa sin moverse. */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important;
                                     transition-property: opacity, color, background-color, border-color, outline-color, box-shadow, fill, stroke !important; }
            tr.recien-guardado > td { animation-duration: 1.8s !important; }   /* la fila recién guardada se ilumina (solo color) */
            .flash-lector { animation-duration: 0.9s !important; }              /* el destello al leer un código */
            button.trabajando::before { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }   /* «trabajando…», lento */
        }

        /* ===== Clases cortas para lo que antes iba escrito dentro del HTML (style="…") — al final, para ganarle a las reglas generales ===== */
        .u-mono { font-family: var(--font-mono); }
        .u-mayus { text-transform: uppercase; }
        .u-span2 { grid-column: span 2; }
        .u-ancho { grid-column: 1 / -1; }
        .u-centro { text-align: center; }
        .u-m0, :is(h3, h4).u-m0 { margin: 0; }   /* h4: le gana a «.panel-card h4» (misma fuerza, va después) */
        .u-mt4 { margin-top: 4px; }
        .u-mt6 { margin-top: 6px; }
        .u-mt14 { margin-top: 14px; }
        .u-mb10 { margin-bottom: 10px; }
        .u-mb12 { margin-bottom: 12px; }
        .u-mb14 { margin-bottom: 14px; }
        .u-mb16 { margin-bottom: 16px; }
        .u-mb18 { margin-bottom: 18px; }
        .u-min0 { min-width: 0; }
        .u-peligro { color: var(--tx-fb7185); }   /* rojo de texto: el --danger no llega al contraste sobre el fondo al pasar el mouse */
        .u-fila { display: flex; gap: 10px; }
        .u-tit-l, .u-tit-m, .u-tit-s { font-weight: 700; color: var(--text-title); }
        .u-tit-l { font-size: var(--fs-xl); }
        .u-tit-m { font-size: var(--fs-xl); }
        .u-tit-s { font-size: var(--fs-xl); }

        /* ===== Revisión del celular: todo lo que se toca mide al menos 40–44 px y nada queda con letra ilegible ===== */
        @media (max-width: 760px) {
            /* filtros en botonera y pestañas: del alto de un dedo */
            .content-area .segmentado > button, .segmentado > button { min-height: 2.75rem; }
            .tabs .tab { min-height: 44px; }
            /* viaje: «Falta cargar / Planilla cargada» y la incidencia de cada estación */
            .emv-falta { min-height: 40px; padding: 8px 14px; font-size: 0.82rem; }
            .emv-inc { min-height: 40px; padding: 8px 14px; }
            /* gastos del viaje terminado */
            #emv-g-km, #emv-g-viatico { min-height: 44px; }
            /* ficha de la estación: los enlaces (Cómo llegar, teléfonos) se tocan cómodos */
            .em-ubic-fila a, #modal-estac a[href^="tel:"], #modal-estac a[href^="mailto:"] { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
            .em-ver-serie-btn { min-height: 40px; }
            /* Stock: «Mostrar todos» */
            #stock-ocultos a { display: inline-block; padding: 10px 6px; margin: -10px 0; }
            /* menú: contraseña, salir y la versión */
            .btn-usuario { min-height: 2.75rem; }
            .link-version { padding: 12px 8px; margin-top: -8px; }
            /* campana: marcar todas, limpiar y quitar cada aviso */
            .notif-link { min-height: 40px; padding: 8px 10px; }
            .notif-quitar { width: 40px; height: 40px; }
            /* resumen del viaje: la letra más chica llega a 11 px */
            .emres-cal .m, .emres-cal .s { font-size: 11px; }
            .emres-esc { font-size: 11px; height: 17px; }
            .emres-hora small { font-size: 11px; }
            /* dashboard de Ingeniería: las tarjetas de abajo no quedan pegadas una a la otra */
            #view-dash .table-wrap[data-bloque] { margin-bottom: 16px; }
        }

        /* ===== Cartel de «viaje en curso» en el encabezado de Estaciones: pastilla en la PC, franja de todo el ancho en el celular ===== */
        .em-cartel { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0 16px; padding: 6px 7px 6px 14px; border-radius: 999px; cursor: pointer;
                     border: 1px solid color-mix(in srgb, var(--em-viaje) 45%, transparent); background: color-mix(in srgb, var(--em-viaje) 10%, transparent);
                     color: var(--text-body); font: inherit; font-size: var(--fs-sm); text-align: left; }
        .em-cartel:hover { background: color-mix(in srgb, var(--em-viaje) 17%, transparent); }
        .em-cartel:focus-visible { outline: 2px solid var(--em-viaje); outline-offset: 2px; }
        .em-cartel-punto { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--em-viaje); animation: em-cartel-late 1.6s ease-in-out infinite; }
        @keyframes em-cartel-late { 50% { opacity: 0.35; } }
        @media (prefers-reduced-motion: reduce) { .em-cartel-punto { animation: none; } }
        .em-cartel-txt { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
        .em-cartel-txt b { flex: none; color: var(--em-viaje); font-weight: 600; white-space: nowrap; }
        .em-cartel-txt span { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .em-cartel-ver { flex: none; padding: 4px 12px; border-radius: 999px; background: var(--em-viaje); color: var(--c-tinta); font-weight: 600; white-space: nowrap; }
        /* si el encabezado no tiene lugar de sobra (casi todas las pantallas), es una franja de todo el ancho pegada debajo */
        @media (max-width: 1800px) {
            main > header { flex-wrap: wrap; }
            .em-cartel { order: 9; flex: 0 0 auto; width: calc(100% + 72px); margin: 12px -36px -16px; padding: 7px 36px; border-radius: 0; border-width: 1px 0 0; }
            .em-cartel-txt { flex: 1; }
        }
        @media (max-width: 760px) {
            .em-cartel { width: calc(100% + 24px); margin: 0 -12px -10px; padding: 6px 12px; min-height: 46px; }
            .em-cartel-txt { flex-direction: column; align-items: stretch; gap: 0; line-height: 1.3; }
            .em-cartel-txt span { font-size: var(--fs-xs); }
            .em-cartel-ver { padding: 0; background: none; color: var(--em-viaje); }
            .em-cartel-ver::after { content: " ›"; }
        }

        /* ===== Viaje cancelado: queda en la lista en gris, con la fecha tachada y el motivo ===== */
        .emv-tarjeta.emv-cancelado { opacity: 0.85; }
        .emv-cancelado .emv-tarjeta-fecha { text-decoration: line-through; color: var(--text-muted); }
        .emv-cancelado .emv-paso { color: var(--text-muted); }
        .emv-cancel-info { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-subtle); color: var(--text-body); font-size: var(--fs-sm); overflow-wrap: anywhere; }

        /* ===== Tarjeta de viaje: «Abrir» a la vista y el resto en un menú «⋯» ===== */
        .emv-tmas { position: relative; }
        .emv-tmas > summary { list-style: none; cursor: pointer; min-width: 34px; justify-content: center; font-weight: 700; letter-spacing: 1px; }
        .emv-tmas > summary::-webkit-details-marker { display: none; }
        .emv-tmas-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px; padding: 6px; border-radius: 10px;
                        background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); box-shadow: 0 12px 28px rgba(0, 0, 0, calc(0.45 * var(--sombra))); }
        .emv-tmas-menu button { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 2.375rem; padding: 0.5rem 0.625rem; border: 0; border-radius: 8px;
                               background: none; color: var(--text-body); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
        .emv-tmas-menu button:hover, .emv-tmas-menu button:focus-visible { background: rgba(var(--tinte), 0.06); }
        .emv-tmas-menu button.peligro { color: var(--tx-fb7185); }
        @media (max-width: 760px) { .emv-tmas-menu button { min-height: 2.75rem; } }

        /* ===== Números de alerta en 0: sin color de alarma ===== */
        .kpi-card.kpi-tranquilo .kpi-value { color: var(--text-title) !important; }
        .kpi-card.kpi-tranquilo .kpi-icon-wrap { background: rgba(var(--tinte), 0.06) !important; color: var(--text-muted) !important; }
        .emv-tarjeta .emv-tmas .emv-tmas-menu { display: block; height: auto; max-height: none; }
        .emv-tarjeta:has(.emv-tmas[open]) { overflow: visible; position: relative; z-index: 5; }

        /* ===== Cinco números clave: en una sola fila en la PC (con auto-fit, el quinto quedaba solo abajo) ===== */
        @media (min-width: 1200px) { .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }   /* cuenta solo las visibles */

        /* Viajes en la PC: el título de la página ya dice qué es; queda solo la barra con Excel, Importar y Nuevo viaje (en el celular se ve el texto) */
        body:not(.modo-celular) .emv-barra-txt > * { display: none; }

        /* Personas: el formulario de alta se abre con «Nueva persona»; cerrado, la tabla usa todo el ancho */
        .personas-grid:has(> #persona-nueva.oculto) { grid-template-columns: 1fr; }

        /* Proveedores en modo resumido: sin Rubro, CUIT, IVA, Dirección, Localidad y Provincia (columnas 3 a 8) */
        .prov-resumida th:nth-child(n+3):nth-child(-n+8), .prov-resumida td:nth-child(n+3):nth-child(-n+8) { display: none; }

        /* Ficha de material: los botones quedan siempre al pie de la ventana (los comentarios se cargan debajo y los empujaban a la mitad) */
        .ficha-pie { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; position: sticky; bottom: -1px; z-index: 3;
                     padding: 12px 0 4px; background: var(--bg-surface); border-top: 1px solid var(--border-subtle); }

        /* Mapas: los mosaicos de OpenStreetMap son claros; se oscurecen un poco para no encandilar en la pantalla oscura */
        .leaflet-tile-pane { filter: brightness(0.78) contrast(1.05) saturate(0.85); }

        /* Buscadores: con ancho suficiente para que el texto de ejemplo no quede cortado («Buscar por núme») */
        body:not(.modo-celular) input[type="text"][id$="-filtro"], body:not(.modo-celular) #filtro-stock, body:not(.modo-celular) #em-buscar,
        body:not(.modo-celular) #emm-buscar, body:not(.modo-celular) #emv-filtro-texto, body:not(.modo-celular) #ema-buscar { min-width: min(22.5rem, 100%); }

        /* ===== Pantalla de arranque: logo hasta saber si hay sesión; el login aparece encima de ella, sin el programa vacío atrás ===== */
        #arranque { position: fixed; inset: 0; z-index: 9990; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
                    background: var(--bg-body); opacity: 0; visibility: hidden; transition: opacity 0.28s ease, visibility 0s linear 0.28s; padding: 24px; text-align: center; }
        #arranque img { width: 260px; max-width: 70vw; height: auto; filter: drop-shadow(0 0 18px rgba(0, 173, 154, 0.15)); }
        #arranque p { margin: 0; max-width: 360px; color: var(--text-muted); font-size: var(--fs-sm); }
        #arranque .ruedita { width: 22px; height: 22px; color: var(--primary); }
        #arranque p:empty { display: none; }
        body.arrancando #arranque { opacity: 1; visibility: visible; transition: none; }
        body.arrancando > *:not(#arranque):not(#toast-container):not(.modal-overlay) { visibility: hidden; }
        @media (prefers-reduced-motion: reduce) { #arranque { transition: none; } }

        /* ===== Cambio de módulo: tarjeta con el símbolo, el color y el nombre del módulo nuevo ===== */
        body.cambiando-modulo #arranque { opacity: 1; visibility: visible; transition: opacity 0.22s ease; }
        body.cambiando-modulo > *:not(#arranque):not(#toast-container):not(aside) { transition: opacity 0.22s ease, transform 0.22s ease; opacity: 0.4; transform: scale(0.985); }
        #arranque.arranque-modulo { gap: 12px; }
        .arranque-ico { width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
                        color: var(--mod); background: color-mix(in srgb, var(--mod) 14%, transparent); border: 1px solid color-mix(in srgb, var(--mod) 40%, transparent); }
        .arranque-ico .ico { width: 32px; height: 32px; }
        #arranque.arranque-modulo b { font-size: var(--fs-2xl); font-weight: 600; color: var(--text-title); }
        .arranque-sub { font-size: var(--fs-sm); color: var(--text-muted); }
        .arranque-barra { width: 160px; height: 3px; border-radius: 2px; background: var(--border-subtle); overflow: hidden; margin-top: 6px; }
        .arranque-barra i { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--mod); animation: arranque-barra 1s ease-in-out infinite; }
        @keyframes arranque-barra { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
        @media (prefers-reduced-motion: reduce) { .arranque-barra i { animation: none; width: 100%; } body.cambiando-modulo > *:not(#arranque) { transform: none; } }

        /* Menú «⋯» de la tarjeta de viaje: se abre hacia la izquierda (alineado con el botón); si ahí no entra, ladoMenuEM() lo abre hacia la derecha */
        body.modo-celular .emv-tmas-menu { max-width: calc(100vw - 40px); }
        .emv-tmas-menu.hacia-der { right: auto; left: 0; }
        body.modo-celular .emv-tmas > summary { min-width: 40px; }

        /* ===== Configuración de Estaciones · Tipos de repuesto ===== */
        .emc-tipos { display: flex; flex-wrap: wrap; gap: 6px; }
        .emc-tipo { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
        .emc-tipo.propio { padding-right: 4px; border-color: color-mix(in srgb, var(--primary) 50%, transparent); background: var(--primary-glow); }
        .emc-tipo button { border: 0; background: none; color: var(--text-muted); cursor: pointer; min-width: 1.625rem; min-height: 1.625rem; border-radius: 50%; }
        .emc-tipo button:hover { color: var(--tx-fb7185); }
        .emc-tipo-nuevo { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
        .emc-tipo-nuevo input { flex: 1 1 220px; min-width: 0; }
        @media (max-width: 760px) { .emc-tipo button { min-width: 2.5rem; min-height: 2.5rem; } .emc-tipo-nuevo .btn { width: 100%; justify-content: center; } }

        /* ===== Tipo de mantenimiento de cada estación del viaje (preventivo / correctivo, sin valor por defecto) ===== */
        .emv-tipo { display: inline-flex; border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; flex: none; }
        .emv-tipo.falta { border-color: rgba(244, 63, 94, 0.7); }
        .emv-tipo button { border: 0; background: none; color: var(--text-muted); font: inherit; font-size: var(--fs-xs); padding: 0.3125rem 0.5625rem; cursor: pointer; }
        .emv-tipo button + button { border-left: 1px solid var(--border-subtle); }
        .emv-tipo button:hover { color: var(--text-body); }
        .emv-tipo button.activo.preventivo { background: var(--primary-glow); color: var(--tx-5eead4); font-weight: 600; }
        .emv-tipo button.activo.correctivo { background: rgba(249, 115, 22, 0.16); color: var(--tx-fdba74); font-weight: 600; }
        /* dentro de la fila de la estación los botones son de flecha (26 px): el selector de tipo no toma ese tamaño */
        .emv-acc .emv-tipo button { width: auto; height: auto; min-height: 1.5rem; border: 0; border-radius: 0; }
        .emv-acc .emv-tipo button + button { border-left: 1px solid var(--border-subtle); }
        .emv-acc .emv-tipo { margin-right: 4px; }
        .emf-tipo { align-self: flex-start; }
        .emf-tipo button { padding: 0.5rem 1rem; font-size: var(--fs-sm); }
        @media (max-width: 760px) {
            .emv-nodo > .emv-acc .emv-tipo { order: 1; flex: 1 1 100%; margin-right: 0; }
            .emv-acc .emv-tipo button, .emf-tipo button { flex: 1; min-height: 2.5rem; }
            .emf-tipo { display: flex; width: 100%; }
        }
        .emv-tipo-fila { margin-top: 5px; }
        .emv-tipo-fila .emv-tipo button { min-height: 1.625rem; }
        @media (max-width: 760px) { .emv-tipo-fila .emv-tipo { display: flex; } .emv-tipo-fila .emv-tipo button { flex: 1; min-height: 2.5rem; } }

        /* ===== Personas y permisos: pestañas por módulo y una sola barra para guardar ===== */
        .perm-pestanas { margin: 24px 0 12px; }
        .perm-pestanas button.con-cambios::after { content: " •"; color: var(--warning); }
        .perm-table[data-tab="ING"] .perm-st, .perm-table[data-tab="ING"] .perm-em,
        .perm-table[data-tab="ST"] .perm-ing, .perm-table[data-tab="ST"] .perm-em,
        .perm-table[data-tab="EM"] .perm-ing, .perm-table[data-tab="EM"] .perm-st { display: none; }
        .perm-table[data-tab] thead .perm-sub { display: none; }
        .perm-barra { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px;
                      padding: 12px 14px; border-radius: 12px; background: var(--bg-surface-elevated); border: 1px solid var(--warning);
                      box-shadow: 0 10px 28px rgba(0, 0, 0, calc(0.45 * var(--sombra))); }
        .perm-barra b { flex: 1 1 240px; color: var(--tx-fcd34d); font-weight: 600; font-size: var(--fs-sm); }

        /* ===== Mi perfil · Mis avisos: en la computadora, columnas; en el celular, cada aviso en su tarjeta con tres botones ===== */
        .mav-cab, .mav-fila { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 52px); gap: 6px; align-items: center; }
        .mav-cab { font-size: var(--fs-xs); color: var(--text-muted); text-align: center; padding-bottom: 4px; }
        .mav-fila { padding: 7px 0; border-top: 1px solid var(--border-subtle); }
        .mav-chips { display: contents; }
        .mav-desc { font-size: var(--fs-sm); line-height: 1.35; }
        .mav-grupo { display: flex; align-items: center; gap: 6px; margin: 14px 0 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--accent, var(--tx-2dd4bf)); }
        .mav-grupo .ico { width: 13px; height: 13px; }
        .mav-t { justify-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: 36px; height: 32px;
                 border-radius: 8px; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-muted); font: inherit; cursor: pointer; }
        .mav-t span { display: none; }
        .mav-t .ico { width: 16px; height: 16px; }
        .mav-t.on { background: var(--success-glow); border-color: var(--success); color: var(--success); }
        .mav-t:disabled { opacity: .45; cursor: not-allowed; }
        .mav-na { border-style: dashed; opacity: .45; cursor: default; }
        .mav-fijo { cursor: default; color: var(--text-muted); background: rgba(var(--tinte), 0.04); }
        .mav-nota { margin: 10px 0 0; }
        @media (max-width: 600px) {
            .mav-cab { display: none; }
            .mav-fila { display: block; padding: 10px 0; }
            .mav-chips { display: flex; gap: 6px; margin-top: 8px; }
            .mav-t { flex: 1 1 0; width: auto; min-width: 0; height: 40px; }
            .mav-t span { display: inline; font-size: var(--fs-xs); }
        }

        /* Mi actividad: separación entre las tarjetas (Próximos viajes, Mis viajes, Mis mantenimientos) */
        #view-emact > .table-wrap + .table-wrap { margin-top: 16px; }
        /* En el celular, el Dashboard sin la fila de accesos rápidos ni «Personalizar» (ya están en el menú) */
        body.modo-celular .dash-accesos { display: none !important; }

        /* ===== Portal de incidencias (Ministerio y Omixom) y las incidencias dentro de Estaciones: color violeta propio ===== */
        :root { --inc: var(--c-lila); --inc-glow: rgba(167, 139, 250, 0.16); }
        body.modo-portal .dep-wrap, body.modo-portal .notif-wrap, body.modo-portal #em-cartel-viaje, body.modo-portal .em-rc-header,
        body.modo-portal .nav-sep, body.modo-portal .link-version { display: none !important; }
        /* Portada del portal: quién entra de afuera ve de qué se trata (la red de estaciones) antes que nada */
        .portal-portada { position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; margin-bottom: 14px; padding: 22px 24px 26px;
                          border-radius: 16px; border: 1px solid rgba(0, 173, 154, 0.28); background: #0f2023; }
        .portal-portada-txt { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; }
        .portal-portada h2 { margin: 0 0 6px; font-size: 1.75rem; line-height: 1.15; color: var(--text-title); font-weight: 700; }
        .portal-portada p { margin: 0 0 14px; color: var(--text-body); max-width: 56ch; }
        .portal-portada-quien { display: inline-block; font-size: var(--fs-xs); font-weight: 600; color: var(--inc); background: var(--inc-glow);
                                border: 1px solid rgba(167, 139, 250, 0.45); border-radius: 999px; padding: 4px 12px; }
        .portal-portada-quien:empty { display: none; }
        /* la «red»: puntos como estaciones, uno violeta (una incidencia) */
        .portal-portada-red { position: relative; flex: 0 0 300px; align-self: stretch; min-height: 110px;
                              background-image: radial-gradient(circle, rgba(45, 120, 118, 0.75) 2.5px, transparent 3px);
                              background-size: 30px 30px; background-position: 0 0;
                              -webkit-mask-image: linear-gradient(90deg, transparent, var(--c-negro) 35%); mask-image: linear-gradient(90deg, transparent, var(--c-negro) 35%); }
        .portal-portada-red i { position: absolute; left: 63%; top: 38%; width: 12px; height: 12px; border-radius: 50%; background: var(--inc);
                                box-shadow: 0 0 0 6px rgba(167, 139, 250, 0.18); }
        .portal-portada-firma { position: absolute; right: 14px; bottom: 8px; font-size: var(--fs-xs); color: var(--text-muted); }
        @media (max-width: 700px) {
            .portal-portada { padding: 18px 16px 26px; }
            .portal-portada h2 { font-size: 1.35rem; }
            .portal-portada-red { position: absolute; inset: 0 -40px 0 45%; opacity: .5; }
        }
        body.modo-portal #nav-portal { order: 1; } body.modo-portal #nav-portalinc { order: 2; }
        .portal-tit { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }
        .portal-vertodas { margin-top: 10px; }
        .portal-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
        .portal-filtros input[type=search] { flex: 1 1 220px; min-width: 0; }
        .inc-chip-filtro { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; border: 1px solid var(--inc); color: var(--inc); background: var(--inc-glow);
                           border-radius: 999px; padding: 4px 12px; font: inherit; font-size: var(--fs-xs); cursor: pointer; }
        body[data-deposito="EM"] #nav-emincid, body[data-deposito="EM"] #nav-emfallas { order: 2; }
        .portal-cab { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
        .portal-quien { display: flex; flex-direction: column; gap: 2px; }
        .portal-quien b { color: var(--text-title); font-size: var(--fs-md); }
        .portal-cargar { width: 100%; min-height: 48px; justify-content: center; margin-bottom: 14px; }
        #portal-filtros, .inc-filtros { margin-bottom: 12px; }
        .inc-lista { display: grid; gap: 10px; }
        .inc-card { display: block; width: 100%; text-align: left; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px;
                    padding: 0.75rem 0.875rem; color: inherit; font: inherit; cursor: pointer; }
        .inc-card:hover, .inc-card:focus-visible { border-color: var(--inc); }
        .inc-card-top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
        .inc-card-top b { color: var(--text-title); min-width: 0; overflow-wrap: anywhere; }
        .inc-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; overflow-wrap: anywhere; }
        .inc-detalle { color: var(--text-body); }
        .inc-estado { flex: none; display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 600; padding: 3px 8px; border-radius: 6px;
                      border: 1px solid currentColor; white-space: nowrap; }
        .inc-RECIBIDA { color: var(--inc); } .inc-CONFIRMADA { color: var(--warning); } .inc-PROGRAMADA { color: var(--tx-93c5fd); } .inc-EN_VIAJE { color: var(--tx-38bdf8); } .inc-VISITADA { color: var(--tx-2dd4bf); }
        .inc-RESUELTA { color: var(--success); } .inc-DESCARTADA { color: var(--text-muted); }
        .inc-marca { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--inc); background: var(--inc-glow);
                     border: 1px solid rgba(167, 139, 250, 0.45); padding: 2px 7px; border-radius: 6px; vertical-align: middle; }
        .inc-marca .ico { width: 12px; height: 12px; }
        .inc-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border: 1px solid var(--inc); background: var(--inc-glow); border-radius: 12px;
                      padding: 10px 12px; margin-bottom: 12px; }
        .inc-banner > div { flex: 1 1 200px; min-width: 0; }
        .inc-viaje { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 9px 12px; margin: 8px 0; font-size: var(--fs-sm); }
        .inc-viaje .ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
        .inc-elegida { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
        .inc-recorrido { list-style: none; margin: 6px 0 0; padding: 0; }
        .inc-recorrido li { position: relative; padding: 0 0 16px 24px; }
        .inc-recorrido li::before { content: ""; position: absolute; left: 3px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--inc); }
        .inc-recorrido li:not(:last-child)::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: 2px; width: 2px; background: var(--border-subtle); }
        .inc-ev-tit { font-weight: 600; color: var(--text-title); }
        .inc-ev-txt { white-space: pre-wrap; font-size: var(--fs-sm); margin-top: 4px; overflow-wrap: anywhere; }
        .inc-adj { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
        .inc-adj .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-content: flex-start; }   /* el nombre arranca a la izquierda: si no entra, se ve el principio */
        .inc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
        #incc-problemas label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 8px 10px;
                                cursor: pointer; min-height: 42px; font-size: var(--fs-sm); }
        #incc-problemas label:has(input:checked) { border-color: var(--inc); background: var(--inc-glow); }
        .inc-res { display: grid; gap: 4px; margin-top: 6px; max-height: 260px; overflow-y: auto; }
        .inc-res button { text-align: left; background: transparent; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.5625rem 0.625rem; color: inherit;
                          font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
        .inc-res button:hover, .inc-res button:focus-visible { border-color: var(--inc); }
        .inc-aviso { border: 1px solid var(--warning); border-radius: 8px; padding: 8px 10px; font-size: var(--fs-sm); margin-top: 8px; }
        #inc-cuerpo textarea, #inc-cuerpo input[type=file] { width: 100%; max-width: 100%; box-sizing: border-box; }
        .inc-franja { width: 100%; text-align: left; color: inherit; font: inherit; cursor: pointer; }
        /* Dashboard del portal a todo el ancho: arriba portada + números (2x2); abajo últimas, actividad y mapa con la misma altura */
        .portal-arriba { margin-bottom: 14px; }
        .portal-arriba .portal-portada { margin-bottom: 0; }
        #portal-kpis { margin-bottom: 14px; }
        .portal-portada-acc { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
        .portal-cargar-in { display: flex; width: fit-content; min-height: 42px; padding-inline: 18px; }
        .portal-abajo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: stretch; }
        .portal-col { min-width: 0; display: flex; flex-direction: column; }
        .portal-col-mapa .inc-mapa { flex: 1; height: auto; min-height: 340px; }
        .portal-actividad { display: flex; flex-direction: column; gap: 2px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px;
                            padding: 6px; flex: 1; }
        .portal-actividad .inc-vacio { border: none; }
        .portal-ev { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; text-align: left; padding: 9px 8px;
                     background: transparent; border: none; border-radius: 8px; color: inherit; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
        .portal-ev:hover, .portal-ev:focus-visible { background: rgba(var(--tinte), 0.035); }
        .portal-ev > i { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; }
        .portal-ev b { color: var(--text-title); }
        .portal-ev small { display: block; color: var(--text-muted); font-size: var(--fs-xs); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        @media (max-width: 1200px) { .portal-abajo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .portal-col-mapa { grid-column: 1 / -1; } }
        @media (max-width: 900px) {
            .portal-arriba, .portal-abajo { grid-template-columns: minmax(0, 1fr); }
            .portal-col-mapa .inc-mapa { min-height: 240px; }
            .portal-cargar-in { width: 100%; justify-content: center; }
        }
        /* resumen, tarjetas con avance y mapa (portal e Incidencias de Estaciones) */
        .inc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
        .inc-kpi { text-align: left; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px 12px;
                   color: inherit; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
        .inc-kpi:hover, .inc-kpi:focus-visible { border-color: var(--c); }
        .inc-kpi.activo { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
        .inc-kpi span { font-size: var(--fs-xs); color: var(--text-muted); }
        .inc-kpi b { font-size: 1.55rem; font-weight: 700; color: var(--c); line-height: 1.15; }
        .inc-kpi small { font-size: var(--fs-xs); color: var(--text-muted); }
        .inc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
        .inc-mapa-caja { position: sticky; top: 12px; }
        .inc-mapa { height: min(62vh, 560px); border-radius: 12px; border: 1px solid var(--border-subtle); overflow: hidden; background: var(--bg-surface); }
        .inc-ley { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 6px; }
        .inc-ley i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
        .inc-card { border-left: 4px solid var(--c, var(--inc)); }
        .inc-card-nom { min-width: 0; overflow-wrap: anywhere; }
        .inc-card-nom b { color: var(--text-title); }
        .inc-sub .ico { width: 13px; height: 13px; vertical-align: -2px; }
        .inc-pasos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
        .inc-pasos span { height: 5px; border-radius: 3px; background: var(--border-subtle); }
        .inc-pasos span.on { background: var(--c); }
        .inc-pasos-txt { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
        .inc-pasos-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .inc-vacio { text-align: center; border: 1px dashed var(--border-subtle); border-radius: 12px; padding: 22px 16px; display: flex; flex-direction: column;
                     align-items: center; gap: 8px; }
        .inc-vacio > .ico { width: 30px; height: 30px; color: var(--inc); }
        .inc-vacio b { color: var(--text-title); }
        .inc-como { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; width: 100%; margin: 6px 0; }
        .inc-como div { border: 1px dashed var(--border-subtle); border-radius: 10px; padding: 12px 10px; font-size: var(--fs-sm); display: flex; flex-direction: column;
                        align-items: center; gap: 6px; }
        .inc-como .ico { width: 22px; height: 22px; color: var(--inc); }
        @media (max-width: 900px) {
            .inc-layout { grid-template-columns: minmax(0, 1fr); }
            .inc-mapa-caja { position: static; order: -1; }
            .inc-mapa { height: 230px; }
        }
        @media (max-width: 600px) { .inc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        /* Cargar incidencia: pasos numerados, fichas grandes, sensores como fichas, fotos con miniatura y el pie siempre a la vista */
        .incc-cab { gap: 12px; align-items: flex-start; }
        .incc-cab .hint { margin: 2px 0 0; }
        .incc-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--inc-glow); color: var(--inc); display: flex; align-items: center; justify-content: center; }
        .incc-ico .ico { width: 20px; height: 20px; }
        .incc-paso { margin-bottom: 18px; }
        .incc-tit { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-title); margin-bottom: 8px; font-size: var(--fs-sm); }
        .incc-tit > span { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--inc-glow); color: var(--inc); font-size: var(--fs-xs);
                           display: inline-flex; align-items: center; justify-content: center; }
        .incc-tit small { font-weight: 400; color: var(--text-muted); }
        .incc-estacion { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px; flex-wrap: wrap; }
        .incc-estacion > .ico { width: 18px; height: 18px; color: var(--inc); flex: none; }
        .incc-estacion > span { flex: 1 1 160px; min-width: 0; }
        .incc-fichas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
        .incc-ficha { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; border: 1px solid var(--border-subtle);
                      border-radius: 10px; cursor: pointer; font-size: var(--fs-sm); transition: border-color .15s, background-color .15s; }
        .incc-ficha input, .incc-chip input { position: absolute; opacity: 0; pointer-events: none; }
        @supports not selector(:has(*)) { .incc-ficha input, .incc-chip input { position: static; opacity: 1; pointer-events: auto; } }   /* sin :has (iPhone viejo): se ve la casilla tildada */
        .incc-ficha .ico { width: 20px; height: 20px; color: var(--text-muted); flex: none; }
        .incc-ficha:hover { border-color: var(--border-hover); }
        .incc-ficha:has(input:checked) { border-color: var(--inc); background: var(--inc-glow); color: var(--text-title); }
        .incc-ficha:has(input:checked) .ico { color: var(--inc); }
        .incc-ficha:has(input:checked)::after { content: "✓"; position: absolute; top: 6px; right: 9px; font-size: 12px; font-weight: 700; color: var(--inc); }
        .incc-ficha:has(input:focus-visible), .incc-chip:has(input:focus-visible) { outline: 2px solid var(--inc); outline-offset: 2px; }
        .incc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
        .incc-chip { position: relative; display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border: 1px solid var(--border-subtle);
                     border-radius: 999px; cursor: pointer; font-size: var(--fs-xs); }
        .incc-chip:has(input:checked) { border-color: var(--inc); background: var(--inc-glow); color: var(--text-title); }
        .incc-texto { position: relative; }
        .incc-texto textarea { width: 100%; box-sizing: border-box; padding-bottom: 1.375rem; }
        .incc-texto small { position: absolute; right: 10px; bottom: 8px; font-size: var(--fs-xs); color: var(--text-muted); pointer-events: none; }
        .incc-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
        .incc-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 16px; border: 1.5px dashed var(--border-hover);
                     border-radius: 10px; cursor: pointer; font-size: var(--fs-sm); }
        .incc-drop:hover { border-color: var(--inc); }
        .incc-drop .ico { width: 24px; height: 24px; color: var(--inc); }
        .incc-drop b { font-weight: 600; color: var(--text-title); }
        .incc-miniaturas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
        .incc-miniaturas:empty { display: none; }
        .incc-mini { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-subtle); background: var(--bg-body);
                     display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
        .incc-mini img { width: 100%; height: 100%; object-fit: cover; }
        .incc-mini button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.7); color: var(--c-blanco);
                            font-size: 15px; line-height: 1; cursor: pointer; }
        .incc-pie { position: sticky; bottom: -26px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
                    margin: 6px -26px -26px; padding: 14px 26px; background: var(--bg-surface); border-top: 1px solid var(--border-subtle); }
        @media (max-width: 600px) {
            .incc-pie { bottom: -18px; margin: 6px -14px -18px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
            .incc-pie > div { flex: 1; }
            .incc-pie .btn { flex: 1; justify-content: center; }
            .incc-pie .hint:empty { display: none; }
        }
        /* Lista de incidencias agrupada por estado: una fila por incidencia (en el celular, dos renglones) */
        .inc-buscar { width: 100%; margin-bottom: 12px; }
        .inc-grupo { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; }
        .inc-grupo > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none;
                               font-weight: 600; color: var(--text-title); font-size: var(--fs-sm); }
        .inc-grupo > summary::-webkit-details-marker { display: none; }
        .inc-grupo > summary > span { display: flex; align-items: center; flex: 1; min-width: 0; }
        .inc-grupo > summary b { color: var(--c); font-variant-numeric: tabular-nums; }
        .inc-grupo > summary::after { content: "▾"; color: var(--text-muted); transition: transform .15s; }
        .inc-grupo:not([open]) > summary::after { transform: rotate(-90deg); }
        .inc-grupo[open] > summary { border-bottom: 1px solid var(--border-subtle); }
        .inc-punto { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 8px; }
        .inc-fila { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr) 80px; gap: 10px; align-items: center; width: 100%;
                    text-align: left; padding: 9px 12px; background: transparent; border: none; border-bottom: 1px solid var(--border-subtle); color: inherit;
                    font: inherit; font-size: var(--fs-sm); cursor: pointer; }
        .inc-fila:last-child { border-bottom: none; }
        .inc-fila:hover, .inc-fila:focus-visible { background: rgba(var(--tinte), 0.035); }
        .inc-fila > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .inc-fila-nom b { color: var(--text-title); }
        .inc-fila-extra { color: var(--text-muted); font-size: var(--fs-xs); }
        .inc-fila-bar { display: flex; gap: 3px; }
        .inc-fila-bar i { flex: 1; height: 4px; border-radius: 2px; background: var(--border-subtle); }
        .inc-fila-bar i.on { background: var(--c); }
        .inc-lista { container-type: inline-size; }
        @container (max-width: 680px) {   /* lista angosta (al lado del mapa o en el celular): dos renglones por incidencia */
            .inc-fila { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 56px; row-gap: 4px; }
            .inc-fila-nom { grid-column: 1 / 3; grid-row: 1; }
            .inc-fila-bar { grid-column: 3; grid-row: 1; }
            .inc-fila-prob { grid-column: 1; grid-row: 2; font-size: var(--fs-xs); }
            .inc-fila-extra { grid-column: 2 / 4; grid-row: 2; text-align: right; }
        }
        /* números de Incidencias: tarjetas como las del resto del programa; la elegida (filtro) con el borde de su color */
        .inc-kpi-card.activo { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
        .inc-kpi-card:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
        /* eliminar una incidencia: primero el botón; al tocarlo, el motivo */
        .inc-eliminar { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
        .inc-eliminar-form { display: none; }
        .inc-eliminar.abierto .inc-eliminar-form { display: block; }
        .inc-eliminar.abierto .inc-eliminar-btn { display: none; }
        .inc-eliminar-form textarea { width: 100%; box-sizing: border-box; margin-top: 4px; }
        .inc-ELIMINADA { color: var(--text-muted); text-decoration: line-through; }
        /* lugares de factibilidad en los viajes (violeta, como su punto en el mapa) */
        .emv-fact { display: inline-block; font-size: var(--fs-xs); font-weight: 500; padding: 1px 8px; border-radius: 999px;
                    background: color-mix(in srgb, var(--c-violeta-osc) 20%, transparent); color: var(--tx-c4b5fd); vertical-align: 1px; }
        .emlug-lbl { display: block; font-size: var(--fs-sm); color: var(--text-muted); margin: 12px 0 4px; }
        #modal-emlugar input { width: 100%; box-sizing: border-box; }
        .emlug-mapa { height: 220px; margin-top: 8px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-subtle); }
        .emlug-fila { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; }
        @media (max-width: 520px) { .emlug-fila { grid-template-columns: minmax(0, 1fr); } }
        .emv-fact-res { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
        .emv-fact-res button { min-height: 2.75rem; padding: 0.375rem; border-radius: 10px; border: 1px solid var(--border-subtle); background: transparent;
                               color: var(--text-body); font: inherit; cursor: pointer; }
        .emv-fact-res button[aria-checked="true"] { border-color: var(--c-violeta-osc); background: color-mix(in srgb, var(--c-violeta-osc) 22%, transparent); color: var(--text-title); font-weight: 600; }
        #emv-fact-nota { width: 100%; box-sizing: border-box; margin-bottom: 10px; font-size: 16px; }
        /* contacto del lugar de factibilidad: en el celular, llamar o escribirle */
        .emv-fact-contacto { margin: 10px 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--c-violeta-osc) 45%, transparent); border-radius: 10px; font-size: var(--fs-sm); }
        .emv-fact-contacto-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
        .emv-fact-contacto-btns .btn { justify-content: center; min-height: 2.625rem; text-decoration: none; }
        .emlug-fila.emlug-contacto { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
        @media (max-width: 520px) { .emlug-fila.emlug-contacto { grid-template-columns: minmax(0, 1fr); } }
        /* Incidencias (Trazarg): el buscador con «Cargar incidencia» al lado */
        .inc-barra { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
        .inc-barra .inc-buscar { flex: 1; min-width: 0; margin-bottom: 0; }
        .inc-barra .btn { flex-shrink: 0; min-height: 2.5rem; }
        @media (max-width: 600px) { .inc-barra { flex-direction: column; align-items: stretch; } .inc-barra .btn { justify-content: center; } }
        /* comentario de cada sensor con falla: en «Informar estado» aparece al tildarlo; en la ficha, debajo de los sensores */
        /* «Informar estado» (lista): prioridad en botones, fuera de servicio en una caja, una fila por sensor con interruptor */
        .emi-arriba { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; justify-content: space-between; }
        .emi-lbl { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin: 16px 0 8px; }
        .emi-prio .emi-lbl { margin-top: 0; }
        .emi-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border-subtle); border-radius: 10px; overflow: hidden; }
        .emi-seg label { position: relative; cursor: pointer; }
        .emi-seg input { position: absolute; opacity: 0; pointer-events: none; }
        .emi-seg span { display: block; padding: 8px 12px; font-size: var(--fs-sm); color: var(--text-body); border-right: 1px solid var(--border-subtle); }
        .emi-seg label:last-child span { border-right: none; }
        .emi-seg input:checked + span { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--text-title); font-weight: 600; }
        .emi-seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }
        .emi-fuera { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--border-subtle); border-radius: 10px; cursor: pointer; }
        .emi-fuera input { width: 18px; height: 18px; flex-shrink: 0; }
        .emi-fuera b { display: block; font-size: var(--fs-sm); color: var(--text-title); }
        .emi-fuera small { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
        .emi-fuera:has(input:checked) { border-color: var(--c-ambar); background: color-mix(in srgb, var(--c-ambar) 10%, transparent); }
        .emi-lista { border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; }
        .emi-fila { border-bottom: 1px solid var(--border-subtle); --c: var(--c-verde); }
        .emi-fila:last-child { border-bottom: none; }
        .emi-fila.mal { --c: var(--c-rojo); background: color-mix(in srgb, var(--c-rojo) 9%, transparent); }
        .emi-fila.rev { --c: var(--c-ambar); background: color-mix(in srgb, var(--c-ambar) 9%, transparent); }
        /* las tres opciones de cada sensor: Funciona / Para revisar / No funciona */
        .emi-tres { display: inline-flex; border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
        .emi-tres label { position: relative; cursor: pointer; }
        .emi-tres input { position: absolute; opacity: 0; pointer-events: none; }
        .emi-tres span { display: block; padding: 6px 10px; font-size: var(--fs-xs); color: var(--text-muted); border-right: 1px solid var(--border-subtle); white-space: nowrap; }
        .emi-tres label:last-child span { border-right: none; }
        .emi-tres input:checked + span { color: var(--text-title); font-weight: 600; background: color-mix(in srgb, var(--c) 22%, transparent); }
        .emi-tres input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }
        .emi-cab { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; min-height: 44px; box-sizing: border-box; }
        .emi-cab .em-punto { background: var(--c); }
        .emi-nom { flex: 1; min-width: 0; font-size: var(--fs-md); color: var(--text-title); }
        .em-mal-nota { display: block; width: calc(100% - 28px); box-sizing: border-box; margin: 0 14px 12px; padding: 7px 10px; font-size: var(--fs-sm); }
        .em-sens-nota { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-body); }
        .em-sens-nota b { color: var(--tx-fda4af); font-weight: 600; }
        .em-sens-nota-rev b { color: var(--tx-fcd34d); }
        .em-sens-rev { --c: var(--c-ambar); --c-txt: var(--tx-fcd34d); }
        .em-sens.em-sens-rev { background: color-mix(in srgb, var(--c) 8%, transparent); border-color: color-mix(in srgb, var(--c) 45%, transparent); color: var(--text-title); }
        /* «Para revisar» en el viaje (planificador, resumen y viaje en curso) */
        .em-revisar { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: var(--fs-sm); line-height: 1.45; text-align: left;
                      color: var(--tx-fcd34d); background: color-mix(in srgb, var(--c-ambar) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c-ambar) 35%, transparent); }
        .em-revisar > .ico { flex-shrink: 0; margin-top: 3px; }
        .em-revisar b { color: var(--tx-fde68a); font-weight: 600; }
        .em-rev-txt { color: var(--tx-fcd34d); }
        @media (max-width: 600px) {
            .emi-arriba { flex-direction: column; align-items: stretch; }
            .emi-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* «Automática» arriba a todo el ancho; las demás de a tres */
            .emi-seg label:first-child { grid-column: 1 / -1; }
            .emi-seg span { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--border-subtle); }
            .em-mal-nota { font-size: 16px; }
            .emi-tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }   /* en el celular: debajo del nombre, a todo el ancho */
            .emi-tres span { text-align: center; padding: 9px 4px; }
        }
        /* Análisis de fallas (Estaciones): ranking de sensores con barra, y la tabla de estaciones al lado */
        .emf-grilla { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
        .emf-panel { padding-bottom: 6px; }
        .emf-fila { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(0, 1.6fr) 52px 60px; gap: 10px; align-items: center; width: 100%;
                    padding: 8px 16px; background: none; border: none; color: var(--text-body); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
        .emf-fila > span:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
        .emf-cab { cursor: default; color: var(--text-muted); font-size: var(--fs-xs); padding-top: 4px; padding-bottom: 2px; }
        button.emf-fila:hover, button.emf-fila.activo { background: rgba(var(--tinte), 0.05); }
        button.emf-fila:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
        .emf-barra { display: block; height: 10px; }
        .emf-barra > span { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--c-rojo); }
        .emf-hoy { background: rgba(244, 63, 94, 0.14); color: var(--tx-fda4af); border: 1px solid rgba(244, 63, 94, 0.35); }
        .emf-fila.apagado .emf-barra > span { opacity: .3; }
        @media (max-width: 1000px) { .emf-grilla { grid-template-columns: minmax(0, 1fr); } }
        /* posible falla que ya se había descartado: aviso en la tarjeta de la ficha y marca en el Dashboard */
        .em-descartes { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-size: var(--fs-sm); line-height: 1.5;
                        color: var(--tx-fcd34d); background: color-mix(in srgb, var(--c-ambar) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c-ambar) 40%, transparent); }
        .em-descartes > .ico { flex-shrink: 0; margin-top: 3px; }
        .em-descartes b { font-weight: 600; color: var(--tx-fde68a); }
        .em-descartes summary { cursor: pointer; margin-top: 4px; width: fit-content; }
        .em-descartes details div { color: var(--text-body); }
        .em-descartada { font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--tx-fcd34d); background: color-mix(in srgb, var(--c-ambar) 14%, transparent);
                         border-radius: 999px; padding: 1px 7px; margin-right: 4px; }
        .em-fila-dato:has(.em-descartada) { max-width: 62%; }   /* que entren la marca y el sensor */
        /* mantenimiento: cómo quedó cada falla que tenía la estación (en la PC, al final del paso 2; en la planilla del celular) */
        .emf-fallas { margin-top: 14px; }
        .emf-falla { --c: var(--text-muted); display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 9px 12px; border: 1px solid var(--border-subtle); border-radius: 10px; margin-bottom: 6px; }
        .emf-falla.ok { --c: var(--c-verde); } .emf-falla.mal { --c: var(--c-rojo); }
        .emf-falla.falta { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
        .emf-falla-nom { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 8px; color: var(--text-title); }
        .emf-falla-nom .em-punto { width: 9px; height: 9px; border-radius: 50%; flex: none; margin: 0; background: var(--c); }
        .emf-falla-cambio { display: none; font-size: var(--fs-sm); color: var(--tx-86efac); }
        .emf-falla.cambiado .emf-falla-cambio { display: inline; }
        .emf-falla.cambiado .emf-falla-op { display: none; }
        .emf-falla-op { display: inline-flex; gap: 6px; flex-wrap: wrap; }
        .emf-falla-op button { min-height: 2.25rem; padding: 0 0.75rem; border-radius: 8px; border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
        .emf-falla-op button:hover { color: var(--text-title); border-color: var(--border-hover); }
        .emf-falla-op button[data-v="ok"][aria-pressed="true"] { color: var(--text-title); border-color: var(--c-verde); background: color-mix(in srgb, var(--c-verde) 16%, var(--bg-card)); }
        .emf-falla-op button[data-v="mal"][aria-pressed="true"] { color: var(--text-title); border-color: var(--c-rojo); background: color-mix(in srgb, var(--c-rojo) 16%, var(--bg-card)); }
        .emf-falla-op button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
        .emcp-falla { padding: 8px 0; border-top: 1px solid var(--border-subtle); }
        .emcp-falla:first-of-type { border-top: none; }
        .emcp-falla-nom { margin: 0 0 6px; color: var(--text-title); font-weight: 600; }
        @media (max-width: 760px) { .emf-falla-op { width: 100%; } .emf-falla-op button { flex: 1; min-height: 2.75rem; } }
        /* sensor cuyo repuesto del stock se usó: el N° de serie se carga en el repuesto, no acá (la batería queda solo si falta elegir el tipo) */
        #emm-cuerpo .em-sensor.por-repuesto .em-nuevo, #emm-cuerpo .em-sensor.por-repuesto-entera { display: none !important; }
        /* secciones plegables (<details>): se despliegan suave en vez de empujar todo de golpe.
           Donde el navegador no sabe animar la altura (Safari del iPhone, Firefox) se abren de golpe como antes. */
        :root { interpolate-size: allow-keywords; }
        details::details-content { height: 0; overflow: clip; transition: height 0.22s ease, content-visibility 0.22s allow-discrete; }
        details[open]::details-content { height: auto; }
        @media (prefers-reduced-motion: reduce) { details::details-content { transition: none; } }
        /* botón que está guardando: la ruedita en lugar del ícono (la pone api() si el servidor tarda) */
        button.trabajando { cursor: progress; }
        button.trabajando > svg.ico { display: none; }
        button.trabajando::before { content: ''; display: inline-block; flex: none; width: 13px; height: 13px; margin-right: 6px; vertical-align: -2px;
                                    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar 0.8s linear infinite; }
        .btn.trabajando::before, .emv-grande.trabajando::before { margin-right: 0; }   /* (estos ya separan con gap) */
        @media (prefers-reduced-motion: reduce) { button.trabajando::before { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; } }
        /* comentarios: el tilde a la derecha (resuelto), «Ver resueltos» y lo resuelto más apagado */
        .coment-ok { flex: none; align-self: flex-start; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-subtle); background: none;
                     color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
                     transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
        .coment-ok .ico { width: 15px; height: 15px; }
        @media (hover: hover) { .coment-ok:hover { border-color: var(--success); color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
                                .coment-ok.abrir:hover { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); } }
        .coment-ok:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
        @media (max-width: 760px) { .coment-ok { width: 38px; height: 38px; } }   /* celular: fácil de tocar */
        .coment { transition: opacity 0.2s ease; }
        .coment.coment-saliendo { opacity: 0; }
        .coment-ver-res { background: none; border: none; padding: 8px 0 0; font: inherit; font-size: var(--fs-xs); color: var(--text-muted); cursor: pointer; }
        .coment-ver-res:hover { color: var(--text-body); }
        .coment-resueltos .coment { opacity: 0.6; }
        .coment-resuelto-txt { margin-top: 2px; }
        .men-resuelto { opacity: 0.65; }
        .men-chip-res { font-size: var(--fs-xs); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 40%, transparent); border-radius: 999px; padding: 0 7px; margin-left: 4px; }
        /* links de acción dentro de un texto (ej. «Mostrar todos» en Stock): el color del programa, no el azul del navegador */
        .link-accion { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
        .link-accion:hover { color: var(--text-title); }
        /* Celular: lo que se toca, del alto de un dedo (44px) */
        @media (max-width: 760px) {
            .modal-card .sel-boton { min-height: 2.75rem; }
            .btn-ojo { width: 40px; height: 40px; right: 2px; }
            .btn-pantalla-completa { min-width: 2.75rem; min-height: 2.75rem; }
            .emv-tec-edit .sel-boton { min-height: 44px; }
            .table-header-bar :is(h3, h4).fila-click { min-height: 44px; display: flex; align-items: center; gap: 6px; flex: 1 1 auto; }
            #dash-kpi-valor { min-height: 44px; display: flex; align-items: center; }
            .em-fila { min-height: 44px; }
            .link-accion { padding: 15px 0; }   /* va dentro de una frase: agranda el toque sin mover el renglón */
        }
        /* Celular: las tablas de la ficha de proyecto pasan a tarjetas (arriba nombre y cantidad, abajo el resto), sin deslizar de costado */
        @media (max-width: 760px) {
            .fp-tarjetas table, .fp-tarjetas tbody { display: block; width: 100%; min-width: 0; }
            .fp-tarjetas thead { display: none; }
            .fp-tarjetas tbody tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline;
                                    padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); }
            .fp-tarjetas tbody td { display: block; padding: 0; border: 0; text-align: left; min-width: 0; font-size: var(--fs-sm); }
            .fp-tarjetas tbody td[colspan] { grid-column: 1 / -1; }
            .fp-tarjetas tbody tr > td { background: transparent !important; box-shadow: none !important; }   /* el color de la entrega va en toda la tarjeta */
            .fp-tarjetas tr.fila-atrasada { background: rgba(244, 63, 94, 0.13); box-shadow: inset 3px 0 0 var(--c-rojo); }
            .fp-tarjetas tr.fila-hoy { background: rgba(245, 158, 11, 0.12); box-shadow: inset 3px 0 0 var(--c-ambar); }
            #fp-servicios-wrap .table-wrap, #fp-compras-wrap .table-wrap { clear: both; }   /* que el «Total» flotante no la achique */
            .fp-tarjetas tbody td:nth-child(1) { grid-area: 1 / 1 / 2 / 4; }            /* lo principal arriba a la izquierda… */
            .fp-tarjetas tbody td.fp-cant { grid-area: 1 / 4 / 2 / 5; text-align: right; white-space: nowrap; }   /* …y la cantidad a la derecha */
            /* entregas: entrega · OC · proveedor */
            #fp-entregas td:nth-child(2) { grid-area: 1 / 1 / 2 / 4; }
            #fp-entregas td:nth-child(1) { grid-area: 2 / 1; }
            #fp-entregas td:nth-child(4) { grid-area: 2 / 2; }
            #fp-entregas td:nth-child(5) { grid-area: 2 / 3 / 3 / 5; }
            /* servicios: estado · fecha · OC / proveedor · importe */
            #fp-servicios td:nth-child(4) { grid-area: 2 / 1; }
            #fp-servicios td:nth-child(3) { grid-area: 2 / 2; }
            #fp-servicios td:nth-child(5) { grid-area: 2 / 3 / 3 / 5; }
            #fp-servicios td:nth-child(6) { grid-area: 3 / 1 / 4 / 4; }
            #fp-servicios td:nth-child(7) { grid-area: 3 / 4; text-align: right; }
            /* materiales: egresado · devuelto · valor */
            #fp-materiales td:nth-child(2) { grid-area: 2 / 1; color: var(--text-muted); }
            #fp-materiales td:nth-child(3) { grid-area: 2 / 2; }
            #fp-materiales td:nth-child(5) { grid-area: 2 / 4; text-align: right; }
            #fp-materiales td:nth-child(2)::before { content: 'Egresó '; }
            #fp-materiales td:nth-child(3)::before { content: 'Devolvió '; }
            #fp-materiales td.fp-cant::before { content: 'Neto '; font-weight: 400; color: var(--text-muted); font-size: var(--fs-xs); }
            /* movimientos: tipo · fecha · usuario / referencia */
            #fp-movimientos td:nth-child(2) { grid-area: 1 / 1 / 2 / 4; }
            #fp-movimientos td:nth-child(3) { grid-area: 2 / 1; }
            #fp-movimientos td:nth-child(1) { grid-area: 2 / 2; }
            #fp-movimientos td:nth-child(6) { grid-area: 2 / 3 / 3 / 5; }
            #fp-movimientos td:nth-child(5) { grid-area: 3 / 1 / 4 / 5; }
            #fp-movimientos td:nth-child(5):empty { display: none; }
        }
        /* Menú lateral plegable (solo PC): botón al pie y versión con solo íconos */
        .btn-plegar { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.4375rem 0.75rem; border: 1px solid transparent; border-radius: 8px; background: none;
                      color: var(--text-muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
        .btn-plegar:hover { color: var(--text-title); background: var(--bg-surface-elevated); }
        .btn-plegar .ico { width: 18px; height: 18px; flex-shrink: 0; }
        @media (max-width: 760px) { .btn-plegar { display: none; } }
        @media (min-width: 761px) {
            body.menu-plegado aside { width: 68px; min-width: 68px; padding: 20px 8px; overflow-x: hidden; }
            body.menu-plegado .brand { justify-content: center; padding: 6px 0 16px; }
            body.menu-plegado .brand-icon { width: 40px; height: 40px; }
            body.menu-plegado .brand-marca, body.menu-plegado .user-details, body.menu-plegado .user-acciones,
            body.menu-plegado .creditos, body.menu-plegado .link-version { display: none; }
            body.menu-plegado .nav-btn { justify-content: center; padding: 0.625rem 0; position: relative; }
            /* el nombre queda oculto a la vista pero lo sigue leyendo el lector de pantalla */
            body.menu-plegado .nav-btn > span:not(.nav-num), body.menu-plegado .btn-plegar > span {
                position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
            body.menu-plegado .nav-num { position: absolute; top: 1px; right: 1px; min-width: 16px; padding: 0 4px; font-size: 0.65rem; }
            body.menu-plegado .nav-sep { font-size: 0; padding: 0; margin: 8px 6px 4px; border-top: 1px solid var(--border-subtle); }
            body.menu-plegado .btn-plegar { justify-content: center; padding: 0.5625rem 0; }
            body.menu-plegado .btn-plegar .ico { transform: scaleX(-1); }
            body.menu-plegado .user-fila { justify-content: center; margin: 0; padding: 4px 0; }
        }
        /* PC: los títulos de columna y los textos pueden ir en dos renglones, así la tabla entra sin deslizar de costado */
        .tabla-compacta th { white-space: normal; text-wrap: balance; }   /* balance: la flecha de ordenar no queda sola en el segundo renglón */
        .tabla-compacta td:not(.num) { white-space: normal; }
        .oc-prox .badge { white-space: nowrap; }   /* OC · Próxima fecha: la fecha puede bajar debajo de la etiqueta, la etiqueta no se parte */
        /* Clientes: textos largos (rubro, dirección, mail) cortados con «…»; el texto completo aparece al pasar el mouse */
        .txt-corto { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        /* Historial: la recepción que cambió el costo del material (el valor del stock se mueve por precio, no por cantidad) */
        .hist-costo { display: block; margin-top: 4px; color: var(--warning); font-size: var(--fs-xs); }
        .hist-costo .ico { width: 13px; height: 13px; vertical-align: -2px; }

/* mail, carpetas y copias del servidor: solo las ve y cambia el superusuario */
body:not(.superusuario) .solo-super { display: none !important; }

/* ===== Tema claro: lo que no alcanza con cambiar las variables de :root ===== */
/* logos con letras oscuras (mismas imágenes de la marca, versión sobre fondo claro) */
:root[data-tema="claro"] .brand-marca { content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAicAAAB0CAMAAABpC2KfAAAAwFBMVEUAAAALEhULem0LEhULem0LEhULEhULEhULEhULEhULEhULem0Lem0Lem0Lem0Lem0Lem0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA25116AAAAQHRSTlMA/f0FBYmw0W4uT3LRiy5OsQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgzVseAAAEcxJREFUeNrtnWubq6oOgJkBQa3W/v9fe7xVISQhWNrO2gf2s9eHqVqEl5AbqdK9+ynRbK+Unv/r7OVHONv0en7K/L+gzZfp1uu7azqls+54+W35b1Nd432ZbXXqzeYLmsvdc65pu+UdNfP+64e6bxub9T12fnDfFBm4ZZqWXnTNKxMxk7K9rIQTOKorKJq/o7dl3nYGRSe+S/XhZKyg8L17jWJnbdvTMG797VZIMr/GzZPifkq1dulHW2IGkmt1H1WEe27y5nvKva1lZ11jgrXV3D0LWa+v1nWZEY9Xumvtxceqn5Ijp1QJ6dQIQFlG1WF3spx05d7WJb5KxyPh2M1Kl1hk2x6hCXYviytnS3Iy91DZUms1pWpoZCJ+HCtQynLCaUOLOHHYAmA2q0KcbB3TmGr2iub4JzlJyIWNE1T/bjjCPsbJggM2567/ACfI7vuy4vhXOVl1nYTSh37TLNr/BCcKtyI5paYYJ9i+/aIC/2c5mRWnlJroCMDoqfgUJ6iOvTVmXyzHCRDHy4i86Pz4s5zMK48T0bh2khIoH+OEEieshlKQE9d5X1LCa1SUk0XcFePEcd6GZSIuqDakECovT0izj8a4ICf+IBRxLrpGNaWGzvUlOeG28mX7bZj5Uzp//gpysiiNLt/mL8mJJ1Vf33Q293PXFhUAxThZVh7pCFDMqzea8Uh2zQc40QyO9L5YkpNDTVv+fR2TVQR0bdugzVrUN4xf3O5eVBt74kUtDjiQJo+mjB3BhkC/bW7/OHnCbW+kbwjh5PrgPcXW8saW8vILn37MLbUs4tDP7Bbm3FgxJ7bvRFE93UWGW0N7oHlJytjUwhAj2r9Gxsny5W1ibQo5sa1w8OaZcqhXVhNbrZsjQV2XMRqa92XBjnfJ4JeNxJ+wI/PLCh3Q86X258pMvNKiwWA44QW91UJ50mjp6C0bqsNCBBr31S8h2+wlo8kWyazVomEuh5wsOiXz/OBeBTcTMnSvU/Eyzj2ur7X1VifgRLPaydOHIuKkl/Z3vb3F/E/oFtj0XfZopPgJv71V/D2QEyvldutMiD4RNWONnVQo7AVpMjcRJyppfBMmD+RkzVyQjN7WuVCIbZxoZAt0Tefz8Q5ZmxTokJMmYwOItA6ak6QC37xj4xHKk7TtTb9YK9LPqGwXsKTXhJNoqFzL5zJd4ySU8MkkLshJK5yvne1WMJwCuZ4KG1+UJhBjlBMt8eU1aGzhMiebXEDlSSROXEbC4HVOumuclNRPsDViI19hKxKpeeoJ0NXQ/BPMvnCNFYWNCU6kg9cg+omGNrHrdQYlWrg9leJE1qeulWgZse9ksdWhUS0RKDmrCvHQWS2jeFYzOmhz2KLyZBs81N6B4qQtLks+yckyC30r8p8gvpM1P7lzOSmGXr6ouHtOoAMhvpM1JBf/EX01XJ5cGrx9qmxGdg7rM9Ef2Xdam2gOyezFfC/Iut6sBx2vp5Qxt6aLzknFgoZ0D41TxuJkv6yzacud4qRvLnRvHxWXkz4cOU271vPHvpuTy+HKjpDr8Xpdm80wefbM88zTCfH3po0d+9SB02FjnJOLg9diWSe9ztADfAvK9u+XJ/EYXY8XI76T5unga8Vh493V/VrEssF3jg4Va7FShaWcoZxcy4TY9DOw3dlOTAkcadt/gJP2aohSItePTRwT7Uw40L4h3y422Xcc4qWN7IsoJxcX2S7Im5+LVgXs8Zx/8mZO1MWcDyyfTaPr8ml598J47oup54wLJF79Ow0aJUjAibq4yFblGSwGlxf3C89a2vdzcinlA3WyMcsSOVdFh411+47kE8TYOeKmsRM5lpflONmUZ0itzXFS/yuc9FpLkuzPbX5hSOIe1yUw+elx5Qma7MdliGJlk5zoq5zsuw7IBm7Uf44TXDlB8qA9x2YMUYt7PQtIE9wm1gwKiDoPj2MV46TVaNZ4+8c5yddP8BPbxJrUdJpP7C7Ql80viIkWnCj2ZgZVrd7CyQEx4MT1/zVOCHcQusefFy7RjLSuqF+2dLa4kxYEimft5Pz++AAjnLgynJxRsX+Lk2y72PZUupfmt3jUPR4+izmAlbFctfDkWQu7xwsUnJM+t1yB/mc56eWlXpbyJ0TgG/OJKzDOXUJDkeSu8MdYmO5pPo6JicPgSRgnOSfT4OD9a5zwr+rcHqRY4wjbe2rZiWIQJNEq6UPRaN0Nt7Z0lGfpHxlnRnwnQFzopDzEOGErtpy9ngdvi8L4G3GXcRL3D3DCKShNp2WJ3RpzYkWWJWLyKM0f6HBN38vTismzNxrb9BJ1cMJ9keCEie9EW7TWzCnZ5q/vO5qOUbSYz1V4ojjOO4hH1QYGNpKUsGzomYkoxJ9BvCi2nYnglGY54bL3ojWmgHz9l/xsmlUKeiVM7EZOFPeYbRrtTSrkpImNyOzENlFWLB534MLGOCdMKKpV7Oj9W357jafzCsuccD5xnU71AV2Ot53+OdQv51gzvhN2X/RcLOi+w1TQTEwHZNdlxgE/zcl2nM5mV6FIRXZwTrqGDhtHWmGpvHxERe2E8Smd4oTxQLWpqoWv5BV8gxNNeu8Jp9U1uY65x311Eu7Yrit1gAXxnRDGM51ORXGyylJHhje0fG31+s/LE1JxF1UBXeS6+xFEK9Cw8TEV0AKwZcQJYewQR3Rg/ozXO0Ke0PWQHDd4sYWYkff4JU6Yw+OuvyJOmk5TxzbpsHFkKZbiRChOMJ9yk+ZkSwu2ZGhYfNo7I4/6i5yQSkojKOiNOLG0sMBfS3oo20Kc6CjpUtPmPbkvcpwoRVVuYWTEK+cyvsbJXpuScAQovuwr5hMXV5s5ex15sotwgsUL6FK/9L7IcMINnu1oF/H1c17f40QxrtmmYwuxYAlAXM0kSld8GyeNuPwHEzbmOLmk4WEpWdJzo9/khHFDW7ZKYywi2F05Uiqfa+gtnOg4BsMrDVROHs/JVgTW5VXewc6h96ITbmBJf5wTquCto391ZOmFlReXZcLGsX5SoLJDMlCczqLZk60TnGidPXhoXYvWP/LNHCy23+NkfRv6XckyW01GmXhFh40Re+dy4RzNB4pzCvM/zwyk5MkFDY+ok6NTJ/FhVaBPc7Jpcg1dflZSUyqV6Yl6vRSSzeH6Eh578YEQStHe3X3pfQc5u+WrRISwc0gaTaoET1T55vOcKEW/q8JdrG1euSQkbNyhnGwDdl19JSI7qZ9jImILEk5oJWXV8LSkzsZeCmRJ9tHSqoWf52Q7R0lqs9ix2yy5vgtT1FBFUqbEtTGJSpmIGS4oF4JKIAEnnJJiUZOXqQvqmHeHB6+/wMmupAhNPMx3kq5YQUxewfr2mw6MptELfjgQTacScbIKjc7STnwdH2Yp8AOQX+GECSBHJl68fATWLGryqKKcHGfu4i1OwknvUFnQiiqck7lL+HmREnXLv8QJrblDEw9xYgls2VincaU52cQa5juR9A4TQlJO1sHDN26stFCZ30H4mjwhlZTAxEO8q5J0YE1lNRfnRPcXKghisQUtlyecb7bTyNm2Ir+r8qW6W3Sw3Hb6QqA49btrmzFVmBM0WiNyduJH0oScMFVqsYo2ZX6n6Yv12Ugl5TDxMgLFESkOCZUW50QaKJaFjXM40dTGjXrcdGf/VU4YJeVp4umMQHE6Y+UN+076pGpO2FjOSUrDQ9zgr/6O5DflieZAQYdTWmIsVmyWhVaYkyg7zQoTKfFMiRxOOLUDi4C8/ru0CU5cTkVTYJ2kTVjmXfdE/Zwfl+ZDYMurdu6tv+otP3KHpv6HnCTPIpBqB+6he/F3rjP8EMmirJCT5PIiA8h2D3+3PxfPyMZy2cUlr39e/TVEd/X3F2JX4yLu+qysZ1JJoc4iLIVQ7eVydAkXsz2Z6iQOrnMblOQVbs6AuD7nlqUV7jvOZsXtdLglbwpeX+p3c5s1OhLk8jQ55x7WwLmDC+N8nmteGLxeE57ctRrq7JV3uZh08rQm0Sx5M+tkh7jWEWsclmUAnCy201lHHxdd1pUpx0qVGfGWs8ss9hwugn2wzg7LqpbvpPwIfQd7xkDfZlbOtZ2qrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaavtn2vS7tNEog39ujLmtl9xMeMV8x/i73xx+NH/y2D64o099fj4p+MT7dl/0Xd4lykzjflXUhkmp+/CbbsM9eeHwmMgx+X9s+7A8DD41819v+yVg0o05pmsEnxy3DCgoz8+HcCLmHhxTd8MBm2+4cdM7P/HxK2kPyYV47/+/OSFmZlnjzyvC5W92SbQhZMKPxl/vJhM/c8TIC56IYTv/ZUoIASkn84USuTNVUCAnAy5QvIEHnBhvRkZFcYINNcWJ8abuht1mxvT0F+Vk7mFtISe4QPHXeDDjweIHMx5wgoCCc3LuVji2h9bzSU4eVZ5ATjBR76sMwYQbE07aSHOyAGjSnARfhWFrktJkVcdvIk5uSsZJFSgxJyMm6m+4YADiJNRQACcRKDgncIYjI+rmGyPjeIvbtNwx3dJtMqc8GZAnjZ6KXhvg5PceL2HzS3EC5PuoaE4gKBgnUJxAgeLp07P5a+jtQLhRHJyMuPr+XAaPSkjESWQbk4pGJE7COYecLBSZBCfxhuH3xt/nbmb7A9boT6Irh6MP6Md7F4dKSMQJVDn9NRx8CrUTgELMySK+DcdJLE5CgWKOBb5a2pjRfI2T4U7wVjmhORkM8Hs9CE4OcTJMU6yhIJwEDl+ME881d0NMnnOfuynCfs9rBye407XuOxwnoU4ANxdfnjxOc+AWaSgnJ4/BtzANyYknTrwnBgLlmDdCN5l2PXZ266fbzficmFt0wcMzjGqLOAnNFrAVHJycAI3BDBsDOHj4tuwJCsKJz8apPBsTfeOdkCZTnl08qpMTNVa7OJeTkdEsT05OcbLM5ATvPTiYw3IKAQWTJ8OJhokFyvEnKgy1b0v5frZFngzVz5bLSbAVEMGOkIxgywAcTP6kn7pAxIkJNq/ziYeGctxBRKGertrSnAwVE4KTR7R5QE6Mr50YiA3kIARlAwNy4qFmtidCgXJM//RRTmrAmOTkoCG0iYNPpoCpWEMJOYhBiTgBurDPDeDkXoiTh4STsSag0Jzssh4Z8GMtP37BNAOBAjgJMxCWjSXkBAMNCJQMeXJ/CPOUTk6QO4bhcburiknEye0W2Mbe3N6mgBNPnDw3BTjPsbwIQTmsoDt44hg98aBWrJ/k+0+A+X/zYgkVD8iJN5erJnlM/aiCtWxOQXM3qJ2M6qmTL5ZUsIsEuwxmJ0vsnZMT2dwG/pPQsDOH0lThiDh5ePM/+smOw7n6p1DQnB4vKFAw/8jdX7D3X1R/GRE3/iZQPP+JKsJJ4I8NHYpjlSMcJ+qYvcW3ZHylJODEPLDAX7BzoH55L2158A1pzFGHaSi8P/YlTsLeLS7YCgrDyWEID9MxbA8vdDptIwoN6MhPRsSDkfz2Tamd8OTJ31Cg8PGd1zgBuXLVzmE5QUK2q9YZcvLAMx0D1xuehxSDssmTAXPJA4HCx4sPl85VTkDu7aOCwnESx0ZGXzqsqfN3YOxgGgqV/xpxeFeGFCehhpLIP3k+ejDStAIYLzYqyJerDjZOnsQTCTkxD+IwT2jyEOcuoKfiTmgnmEBh89me0uayPIFuHvQ8SeVkk7RRltot0EqXoUO1ExUZtyMBEwDlTmonfnxpCF0o2/cH+bFHGsDqDcnKjz3JMlWbFXKiQGISmKDJ004iv2g44TgnESj3MPSsFCNQlDEPSdgmM99+CPKnqjYr4wRLdPSzBHDtJBIoFCfwqNZdkeIECBTzrvM7wU5VtVkZJ6FwfxgoT9SD9nb5AoXkxPPZ758P3BOhU/YN5wFDjaZqs0JO/KSTO4jqTb7vhDkSNg/vSJ8Z9VG8M+JEedrQM8pjyp8vjs7CQ222EuJz8nRWe8M0wiSiO1W5AAqU6bzDcAUQhpMZNJ0xKpXwhnoFQ3wWxddma9rjs60rdPAiMfuSHc9csk0vuD1HcJio0ga3Q1w/2OIU0+O5kU2sgH+WXvFTa8vWPxmw088ni0PlZG//A52XC5zGc9+sAAAAAElFTkSuQmCC"); }
:root[data-tema="claro"] .login-marca, :root[data-tema="claro"] #arranque img { content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAuYAAAC2CAMAAACiVri/AAAAwFBMVEUlsawPo5MAqmYAY1YqyboqyLkuyboBr5xVqqoAsJwnzLUEa2FV//8wz8AKICEA/wAA3c8FV1AIQDwKCg0FWlI00cAAfwALgXYAAAAKEhUKem0uxLYLEhQArJkJem4KEhULEhULCQ0BtqILEhULEhULEhUKEhUKem0Kem0Jg3ULeW0KemwKem0Kem0AsZ0IOTYA/38AqpcGW1QA//8FYFgx0cIJl4gAwqwAqqkmuasJKSkuyLoHR0Mux7lV/6otxbdkqA1JAAAAQHRSTlMP7gQFSrPToQNbE/4D//cBGaz/S1dJAkUA/f7+Bf4EL6/+/m/RTo1I1f4ytY5r/v4CvfwB/v/+/wP//o/+bAMsC4z2pQAAGztJREFUeNrtnQeX28aux71e1zgvt71CcUckJRZRNb5et02c5Pt/qzvDOgXTSGpF6QHn5OR41SjqRxD4D4B5EaCh3by9wFOAhpijoSHmaGiIORoaYo6GhpijoSHmaGiIORra+TF/fIcnF+3GMX/8Tv/7iKcX7YYxf6Tv+terIPgzwhOMdquY/xwEP/3+8PD6L/r2j3iK0W4R8z8ryL88PPzXw+9/Vf9EQ7sxzN89Bi/+YJAz+/Lwx0+Vc0dDuyHMWdb5x5sG8gZ0+gnf8Tyj3QzmEQ1QXr3mIK9Af0NB/4igo90G5kwo/+v1g2pf3jDRBdVFtOvHvNIQf6dpJ2ivGegouqBdOeY/t/IKbLXoguoi2jVj/s4MeZ2L/v6ieiIa2lVi/u4jpyGaQGeiC8roaNeI+Ucaibx6Y4W8Ax1LutCuDvNaQ3xwNaou1hcGGtrVYP74p0ZDNID+Gku60K4Jc7OGqDdW0oXqItp1YP6zXV5BdRHtujGnieSLQZA36iKWdKHNHvNKQ3wzEHKU0dGuAXMPDdEoutCSLgQdbZ6Ye2qIJtBfYcMo2iwxH6AhmkQXVBfR5of5UA3RrC6i6II2J8wHa4jGXBQbRtFmhPkoDdFY6TKFukjybDHasiKm70QCkg59syxJ46B6D4dDph+UJ9xrU2J5IX28mORr0jeyHRl/CpKcENuRxcngU1bkxHjKmg+P8yLx+fZJ7I/5aA3RVrs4UnTJk8UExkgbd8lk7a/mgDllKZGvMmKCj8RpNtHXNIJOoRUvpyS1PJ/EI66/LKmcgwb0inH6zSnjWebttLwwn0RDtKiLbFLXcJvk56enJmduY+ybFTGxc05/vlx5oQk/+li+mOxr6r0nu6cU8itykzunjxQjj4hdSOBXr/1Omgy6mr0wn0xDtKiLYxpGJ/r9F+zMxBNgZOecQJdTGhgxT6f6mmbMA/WmkZluNBNgzi5xzXend4qhdwkPzKfVEM3q4rvHS2NeTIJ5xZERdOYyAWgTgzufEvPUHAsDXJniHPr3CWLGBEhNyKh0xAPzyTXE85R0zQ1zY1hQkwElbSxqvjDmLJjK4ITuvJgvlMxYTtLPhvkZNMTzlHTNDXN2l7dkbYXOpV0Y84AkThBOjvkiJfLbklE5tyPmNCl0afOcGvQ/bwFzE7BaZ17lerqXPQ/mzIFq9TlyXsyVWyAZ94WdMD+jhjh9w+i8UtBWnDDJLIVO7SWXxZzoFPCCkDNjLihNRHfDmzQFPbOGaGkYjT5eTFAkU2FO3Z8hMtCqlrnBm+fP4c1zfRh2bsyzXmkaT7mDoPgMGuK0DaPpRO4kng5zg2pHDLdjvbBGBktrzpizzy4MoTM5L+ZcpEfGRizVj2nEvCrRuhTkwxpGJ1zsnwxz7WIPIaYlqNQQA8dFdm7MU1NWrX3VRJhziTvJx99NjZj/WWmIXy6Jub+6SGLQ8hwAo0hz+NnVurKCufbp4gcpNxR90kZMnirRFpAQ7de0HZp8EjSYs09OTEoI0a1UJvKiZp47HJf64zQZOAvQMrgAJqVvnbt8be4bvoA1xD8uC/kAddGQ7cnKa5bGJglExjzLY+J4oUmgJ7l2/dpU6JTlplxvWGGbXAyjx9x0V9RdtwrmRexUvEY/Ly8g2ZLApWAJ8zfE/SQQLebPriHaGkZdK12IzgLZL+TmZ8uYp6aniy+VsrdMi7k5uTJq54NMOTQd5gFJvBZwYMwT4nqkgfyBDebQGepKsXy+ts6bP7+GaCnpGluhK69dG6szAgXzLA5c/YcMSQZH2cRaHJYP99tuX0qDObEFxJo1Lxnzwvn4lVygusTBM5TEw8+KRNHjZTREE+j/E4xsLpJ1uITYluFj+f5LnO8nhUMyqdfM7dr58JPghDmxVY3D2rmEua3QQfpxMhVz4AzVJdKEDDozLyTK3z7MzL48vA2ikb+w6KIKe4eA4xo3EE04YW6v9M2n9Ob1keUOWqddmIdvhQrmHucMxFxRAeqWEzJN99DH4G69nhfmX8NyNOZB7sOtBnOnMFDkFw5aAEFYaRconBozfAJUSXGHMIc0c+XIQO1cwrxNvZ2OTPrIOi+Rz1B1JolvlqbH/N/r7fLbfCBfhuF2fxWY1+lUak9BAaksyZVln3Q6zKEj02GeKgssikwVw68cgjkUhNenW46dUuJxe3PB/Nun377OxaPfbcO5YO7CnIIELCgqmnnVa5Taa6+h/kjHuFyW7SBYiSqzpETtaUiJqzd3OGdxLlcg1kCnqsDj/G3tgiLD/PNq8eE0B9CfGOSz8ea0T8tshdqPC4Ueqquq1QuJsMzYlNaEqYQt/NgNOjIQc1kzTyB3CwkeGm8e59YDS8C2KymQsWlj0rXKlp2YxcTkzVeL1Y/l+vR0YcjvwnA2mJNhtQQp0EGkKsJ5fYeNM68y3soTJtngwm4o8pAvtbg+stSqncOYDynAyaCYJfe4c/WrgVkREyPmi9Viu15e0qE/fQ3DmWBeT5XIJyrdArxjux6SeHRrkpH9BjFIeQ4uSMoHDGjnIOYkGdxABIgvzpjnUFELjPlitfp0Ol0MdA7ymWA+qFgO+iBFc2zEN3WtNtHq9USZfDFBxwdRNPMmOlHzBvVWIGMeO6mmmsEKcsd15p5/SkuBWWHBnIJOM9HlRUAXIJ8F5sGwyucYjAwAZ06gpSWtO2c3hHHjWqDAX71jNbmmWs2lhsoA5sPCvKLOrAu3691WLKRrq+Awp4HLh/XpAqAvw3B+mA8JM+HPUVxjA7PqzjXauaXuy/XIiE0z79Z4VOEjtcXmQzGvBCClQMZ9jV8+Nw6YU9B/XVKHflo/u4Z4E5jD4xgUMaMNdAHOtGuoyfhuA2LVzLurDNCG5LvBVJjndemciHl6ZsypQw8p58vnE12eFMivFvMidtLMuThXLjuBtfPxlCcxuGYlZ4wxd2DALegM3rxPU5JhoflAzFkmyhz6cv10KcivFPN6GqKTZt7TpA0bHHvYRnSo6jTzrtcpMWrnk2DerZ2Kjb1Zfm5v3mWizxGiS5nnVaegGg+kaua8aOGinRt72IbG5YFteUqd9iidwykw7y4/CfPkOTCnDr3KRM8OugbyaxQU6+4k4lBnLmoWwMqRGhyMC1kKTSOUIrOIVxj9h1E7BzH3EhSTnLurXQDzNhM9L+hayOeCee4+rDvVTesGYlwJJkVskbS0gQJ+P0ccHq+sjgyQIgWbdg7q5iTzGJXNOYZLBC1NJlr587OBfrcNZ465sdmfjudmVlCj7bhxV3Ji18xFiu3aObjmkjWfbzZ6aDHRHJmqmUszCWzaOYi5qdm/PeTmlAkH9vwpaOfPa3d+HnXRCPlcvLkhOJcDAf1ihlIdIvkptUZX0s6BuwrrAvZpb3KbzaIMeQO0c6s31wfnSU4C7Tl7dkFRxXx6dbEr0Zo55tpIs4DqVjQ7OiSWWj8CaOd8JqimwqlX15i2eCDNzHmqmhQk/E4FEOaGACszjkoY3lg6IebTqotWyOeBeRU2J/rBPpp+cssERABRUDsPtMJe1nhF7053Szt/rB4X0S3f6jHX6lMZCQwHpiz2k6GL/aMwny5Ef/oahteBefUmifekRGfNPHDRztWYJu0IHzf6IM/slV2munM4NtdP4M8tVcbDS7emxHwa0J0gnwvmhuVHt55odd8STc13bFqmyRfDhg74jN2AO5YB7dyGOby7i3VywYhC3KkxnwD0ZRheGeaa2ZX2fQ410jNxWkHKecxTawnkEMxzl2lI6hcgDphrNpswDwse3FYxPeYjQbfIKzPEXL93ggvnTk04mkLFrgdewjwjE4y5IEAFvKZkTK+dazCvzgpcJ1Et+ujL6Qc2yXlg/sEV8xHq4pMz5DPC3NArV8SBdePa2KlrQt2ssJ/tI2NeTBKyEP11Zem76OnTYV7H9IVWUyRuk7gc53n4YL4+hYuVG+ZD1UUHeWWWmGsnWErymmYmplkzNy3V9L4xHTAoyQaGRztHqtmOQ4953erkt5nH8AEWHpjTlf1fV46YD1EXHTPPuWKucU5ZHpg3lLVq5gaxpa1pkjBPp8AcWpEijvR1F7cB8zpAz9yryMCFNMdxRD6YL0+nD6JDN2DuG6L7Qj4vzGvO4QA9NwTooGau33tFo51L75JNgrldMzdVy/dFhVrMq6fAiag21tMOlyPOff12zCm6X39buWLuA7o/5DPD3NBUn6WmYNPaTmkbJAF689Gxud/gDKiRtZVUElM5ui7WK2LiOkw1S4l9CpN8b7JgTh36p9XKFXNn0O+24dVjHuhXRA23e3Npom25puh2cEiHDnZw3Z3UOOVT+z0smBt2Qc3dR2MX9sHPcvpgw5ySu/1t5erN3UAfBPk8MddsdaVTgx01cz0TMYj5Ih411x+MDsyXDn0hqJ07YK69BwaaNo8CquO37tggvsyOOYX3R+vQzbH5px8undFPwyCfIebearC1+cZFO6+kRnnkvet2MdA5gdXL1HNr6pwAXcpAfq3dlhxedNBtylKwkXGGBVRpBzIHzCnArbRoxvxz00hnUhcHQz5HzA0qWZaDYxNVhcLizcEVGzWRzZw2/wI2n+pCavB6MobyCdA/bce8KuWCY72UQLWTmi226r6V3HGTMyfMO2nRhnnbSKdTF4dknrPGvBbCM11VErGspluPANbOJ9vludFo2DEUftsHaGoRHDA37IWhifXI+L1+3TBvpUUb5n0j3XpqyOeKubZcI5PVYEAzt7Z9QZkhIRNuZp42wazSlGc9MFA7d8ScibEL3QZ1xGOH4Ikxb6RFO+btSBcA9HGQz9ib6wJ0SQ22NN5ogwNgZst0mCf1eCtlPClxOLRU3XDADXO9GJtA98Dxm5m7Y15Li3bMu5EuEuh32/A2MTf8DoIa7KeZW4YwT4Z5tbLqN2zaMgTSBfMA2L1Sv+gwAefumDNpceGAeT/ShQN9POQzxlwfP/I7qflp5ibtfErMFzlYmuh2ZCkU6CduWxuqIZzXxMkzYk6ddLh0wJw69M+nE1e76FeidYWY6wP0Tg0mnpq5flPxOJgac1UzJ26HBt0DXDE3xXrQ/NI8ey7Ml8u1E+YsE20d+unp6WsY3jjm+nKNrFXJfDVzY0Q/tTdPB2zrBWvnzpg3sUjmtlM6MfTgngHzpSPmfSa6XIbh7WNuKNdogk1fzZy/uauFipNiLgNUxG4XIDjV1x3zil04EY3BHlRdQ+kFMV9U+xbND/PMIzb2wlwvfNVl4kpk4FwkrtwGqLOdMgXVV4/7u3NJgLdvO66J9eDknMTF0DljAzBv4m4L5jQT3a5nhbnsUXM75pnHr68N0JvJF/nAjecVmtgOI/liMkFRXhpyv/7UXk3pzSxrqfV2bwWsUYFTb0g+yKOzFMkT89PXH3CILmNOA5cqE50R5vxtNrP+nEL1hf3pTValbOqWNZiLu4S4b/0nz3+oFvxH7sbCrzaJ0l7m04rEvlQmTeLgqkkS+1bsVSlXkjmkoc1ELvrN6SnOMt/p296YLxeL7doF8yoTPc0I84BflbCXcwqLGE5diBUzsr+pQ11BGcwKt5ku4GJKfeAjAlV1sT/1nE4AB8zNa7vLOcmd9Bq2JJoswOlKmqF4Fem+tyxvzH+pt5dzwLxaNp0R5mj/383Lm3MrQIg52o1ivuq2l0PM0W4Zc04wRMzRbhfzeqNzxBzttjHnahERc7SbxVzKRBFztNvEvN9eDjFHu13Mue3lqPEjXRBztKvAXFO6ImHO1yKuleGiiDnazDEP79YumPOZqDJcFDFHmzfmdIx/uHbBvMpET3Xl4mn9YbVCzNGuB3M6dgWqRQQwpw797rSs3b84XBQxR5u9N+9Kxm2YL1b0eeva/a/5TBQxR5s/5lXcfXLFvHX/XCaKmKNdAeZ887ID5o37Z8NFEXO0K8K8EgxPrpg37p9moosVYo52PZjLtYhmzFv332SiiDnatWAu1iKy7iET5o37r7e5QMzRrgbzBd8VZ/Pmnfuns+hWF8B8Uz35GEXwk+nfD+wJ5UZ8t/bv1UulB47V3/e7AHrP5nXyB0bBsaxfFsGHzZ6+O+5L+Mvu++MxGvvYvfEZ+2OE7iFw3OWZr0X8vFqZMW/cP8tEnx/z5tkHkEn2x4aeUvz1u79TdKQHdu0DG+AAuod30qs2PLHAgdAL0sTnsf9Yo+2Co+0p5QY5d93MnOuK43cjgjFv3P9p/fmfl8I83MGYd/iJmEcRR5XAJYc5uwAi3RvuxLeLejcNXx0WJ3xwxtzB6R+Rc0fM+Uy0Fwx1mLfuf/3844g6JxrA3ryEMedpOQYazAFeNJj3zpx9UgTcA8rw+TCnz0JzxLzLRE9qLaKKee/+L4S5xokeQwjzSISKd+fiQ4o/13lznmLlSISrYGzQ4oJ5id7cGXM20JlxXguGQi0igHnn/i+FeanGxHwsIWF+0N3kpStA5hzEXMJ4r6SnVoTLnS21bJx+5IQ5vdLQXDGv9EGqtHyqBMPPfBcRhHnj/i+FORhhHEIIc4U7jkv5MSm3hTCPRGcuu3Ph4fJw3Mi22+zYwUX0/xuTsef1X+kAPONYdkeN5ot5swLE74sLYl67/4thrrhzIc8UMd9rczblEjhIGSqAuRyTlJFG1Cm1XtZVBeze7Ag/vG8zFTRfzJuOIa4WUYP54nKCYuN4JST2IOZqEMFdIeqDhwiKT3rMFWcuunPuDek7sWdDFmgfkZ946JQlyJqjK5Fwf2/erQB1++LOEnO9li1j3rrXUnXnQCC9jwDPzWHef04JROd90H0MAnC9qeHcC3P2dYBLpVslQMKHYN7VIjb74s4TcyH3k5xsj3kP8j7qdL7ulVC+uI9UpjvMuc/ZdSuZG+Cy2QfReAGEx1x9cHcMMWgZg3kzvbzpipsp5lKwsAk1mLfula2/y+68x/J4ADgHMO8+hwbeLfEl4Os1q6O7fVmWbBH/WNptw2EebORH+WQDbRDmQi3iXDEvI6380WEe8Wh3yHfReffwIeCuE+7VEub951T3kqN8wXE5I7x+tW+e76ebswMqcX1oQGc/0PMpYM5nojPFXIixDyGEOSfJVfGs7M67vxwjPn7pXq5gzjnzqF8n4i6bvaEaoYP14I/5zrTYhAZifreWVoAAzLlMtO4FPS/m5QDMe7qiXajBfMcp4lzBX/PKDp9NIHJecw14cx5s1Z1HQakPps+E+T7CVVAY87dsHJE8RkvBvM1Ev9IJFqzw9qyYHwZg3omKijTeu+MDX+yluHMec6EWpeZcxrx35tXrpRCmekJoKNA9C+aHCDEHMQ8eg/d365Nci6hi3nbFseoVjfufypdvgr8F/pg3sYFaRdJgLjhz4XpobgQC5mLN1a4CX8A8kqMUxZ07Yx6VDqdlzystcNnAHuNyLeaU85cUdKkWEcBc2NH59Hl1nqlb2/J47/hF2t+/5GU7Lv8s9zzmXGS+k7x3485FzAMh06viGBFz0ZkD7tw5aAmizdFmG143l+5XhyMrI9jVXxINxjz4HlDQl2shEwUxF6YoflXd/wSQV8uF9z6Ylz3XG97nsgdEzHdydCO5cwlzsVKccS55czXlFN25cwoaeevmgv8/8m1KaDrMK9BfvF9+40IRGPMqE205F+P5KTCvIf8eeHnzQ6+Al1ViWfbK2p7HXIzMAXcuYy5z3i22C5E6p7vz7twqKPKYe6+CCkXs+4BbC0XTY16D/na97ktXNJhXunkL+lZy/6Mh3wU+zS991rXniDtwagqHuerMlehcwVzkfH/kA/XuQ8sIqHHfCFdCCSE4zpsLLUmHAHuG3DAPHl8y0L+1oYgL5kJv0VjMt1uWQL18DLwx5xfpd33+Kbk/JTJX3bmKOfvjAZA8IsiZC+5cuDuAi/2jMGcvOWhKzNAMmNPTSD36+7en2qE7YU4LAMLFNFO3tnsaFLz0+624qvBDCFRkie4PcOZSdA5gHkBt97sg4p15pHfnptKtcZgH3LKrNstFzAPdpIX3d1s2ncUNc05aHIU5lVcGJFD8Uk8J1NeKmB+gBmnBKUOYS26zwxxy5orYYinE3YXDY/P62Et5CQvNAXMaon8M7l/d/Vg5Y95JiyMw34ZUQ3y89/4ivXeOlNkOGy5OqStXwcp0ySsDmEtus8N8D4bd/XObPHXft1UoGB7DEd68qf0KRckTzQnzKhd9fP/pl9WvJzfMW2lxMOa1vPJywBfhMJfd+Z7XVkpNZK5G5zuwcVnmfBdonLkanUcRv3ojNskduATSp0mOL7iMDqFp5gZirrefKOiHRdM95IB5JS0OxdxTQ9RgrpSK7yTMwchcEVt0mEuc7wI4MgfduX0h/xD4tTyXfAk8f2SYiPpgXp29+3+cKM6/uXjzSlr8ZRDmjYb4GIzFXCpkaf/WY37QjS7iHbMGcz4UbwT5na7XWtXON3bM/Qtx4SPbI+c+mFeBMpPRlWFEGsxZb9EQzJm8cv849IsISAtliVEkYa515qIAvtPNfRFo6tadwMkZojs/wzgiQVWJhPfHRNQL8yD433umLq6BjRG38K5zp63vAAtWouWrIWoxF4rMj+KfSg49SL/eyHOBgPFGPOcbvTPnw/F9FJ1luFwpj4SM9qFxMhNibopcHpm6+E2uRdRgXk3o8i7Riu7HfBFN4VTnY1u6y7aGChY1on70AzgLVOF8188gjUzjvjrhb9pRoaUy8ohPRLFI0Q9zmhhGrHbxm1iLqMXca+pWpSEG9+O+yEaIRzt5jftLDXBXjQJXY3dhC71gjs3TwIRld2h6ixri93CI0HLedThMPPgZGGDHXUeIuS/mde3iW2ljxAkw3zJUBsoraGhTY16D/lrYGHE05rW88hJ/CLTZYF6XdL3ue4vGYl6XaEV/w98BbUaYU9DpetHf//2Dm7o1AvMhJVpoaOfHvK5dfPWPCbx5pSHikjTaLDGvq0g3v4zEfAINEQ3tjJhXuejf0zGYe7V5oqFdBPOK0DgbivmYEi00tOfDnBkpVttv/ph7t3mioV0Q8yD413+/Pa39MN+G3m2eaGgXxTxoahfdMUcNEe36ML//XtcuOmI+rM0TDe3S3ryuXWx3gjZiPrTNEw3t0pg3tYsnBXS4RAurV9CuE/NmSpeci07Vy4yGNg/MK9C/S6BP1+aJhjYPzJtxdDzocpsnaohoV485Bf27qC5O1+aJhjYbzNu5i20uiiVaaDeJeTt3sQZ9ujZPNLRZYU4T0cdWXcQ2T7SbxbxXF7HNE+2GMW9AX2KbJ9pNY16ri/+H8graTWNeq4uPCDnabWNOwxUMytFuH3M0NMQcDQ0xR0NDzNHQEHM0NMQcDTFHQ0PM0dAQczS0Odp/AC1o6H7Rr52fAAAAAElFTkSuQmCC"); }
/* sombras: las del tema oscuro son casi negras y en claro ensucian */
:root[data-tema="claro"] .modal-card, :root[data-tema="claro"] .notif-panel, :root[data-tema="claro"] .tema-menu { box-shadow: 0 16px 40px rgba(11, 18, 21, 0.16); }
:root[data-tema="claro"] { --inc: #6d28d9; --inc-glow: rgba(109, 40, 217, 0.1); }
:root[data-tema="claro"] .btn-warning { color: var(--c-blanco); }   /* sobre el naranja oscuro del tema claro, la letra negra no se lee */
:root[data-tema="claro"] .ac-chip button { color: var(--text-body); }
/* Estaciones: en claro los colores de prioridad y estado van más oscuros (se usan como letra) y lo que va encima de ellos, en blanco */
:root[data-tema="claro"] {
    --em-alta: #991b1b; --em-media: #9a3412; --em-baja: #854d0e; --em-muy-baja: #1e40af; --em-ok: #166534;
    --em-posible: #6b21a8; --em-viaje: #075985; --em-sistema: #6b21a8; --em-tiempo: #1e40af; --em-plan: #5b21b6;
}
:root[data-tema="claro"] :is(.emv-paso.ok i, .emv-paso.actual i, .emv-paso.fact i, .emv-lin-fila.hecha .emv-num, .emv-lin-fila.actual .emv-num) { color: var(--c-blanco); }
:root[data-tema="claro"] .em-cartel-ver { color: var(--c-blanco); }
:root[data-tema="claro"] :is(.em-falla, .em-falla-media, .em-falla-baja, .em-falla-sis) { --c-on: var(--c-blanco); }
/* colores que arma app.js (estados, prioridades, rankings) y usa como letra con tonoTema(): en el oscuro usan su #hex, en el claro estos */
:root[data-tema="claro"] { --tx-22c55e: #166534; --tx-f87171: #991b1b; --tx-9ca3af: #475569; --tx-3b82f6: #1e40af; --tx-eab308: #854d0e; --tx-f97316: #9a3412;
    --tx-ef4444: #991b1b; --tx-8b5cf6: #5b21b6; --tx-f472b6: #9d174d; --tx-facc15: #854d0e; --tx-6b7280: #4b5563; --tx-64748b: #475569; }
:root[data-tema="claro"] :is(select option, select optgroup) { color: var(--text-title) !important; }
@media (max-width: 760px) { :root[data-tema="claro"] .em-cartel-ver { color: var(--em-viaje); } }   /* en el celular «Ver viaje» va sin fondo */
:root[data-tema="claro"] .toast-success { background: rgba(236, 253, 243, 0.96); color: #14532d; }
:root[data-tema="claro"] .toast-error { background: rgba(254, 242, 242, 0.96); color: #7f1d1d; }
:root[data-tema="claro"] .num-btn:hover { color: var(--primary); }

        /* ===== Buscador general (lupa del encabezado / Ctrl+K) ===== */
        .busg-abrir { display: flex; align-items: center; gap: 8px; height: 40px; min-width: 230px; padding: 0 10px 0 12px; border-radius: 10px; cursor: pointer;
                      background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-faint); font: inherit; font-size: var(--fs-sm, 0.85rem); }
        .busg-abrir:hover { border-color: var(--border-hover); color: var(--text-body); }
        .busg-abrir .ico { width: 17px; height: 17px; }
        .busg-abrir-txt { flex: 1; text-align: left; }
        .busg-abrir kbd, .busg-esc { font: 600 0.68rem var(--font-sans); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-hover); color: var(--text-muted); }
        #modal-buscador { align-items: flex-start; padding-top: 9vh; }
        #modal-buscador .busg-card { max-width: 640px; padding: 0.875rem; display: flex; flex-direction: column; max-height: 78vh; }
        .busg-caja { display: flex; align-items: center; gap: 10px; padding: 0 6px 0 14px; border-radius: 10px; border: 1px solid var(--primary); background: var(--bg-body); }
        .busg-caja > .ico { color: var(--primary); width: 18px; height: 18px; }
        .busg-caja input { flex: 1; min-width: 0; height: 46px; border: none; outline: none; background: transparent; color: var(--text-title); font: inherit; font-size: 1rem; }
        .busg-caja input::-webkit-search-cancel-button { display: none; }
        .busg-cerrar.modal-close { font-size: inherit; padding: 0.375rem; }
        .busg-cerrar-txt { display: none; }
        .busg-res { overflow-y: auto; margin-top: 10px; overscroll-behavior: contain; }
        .busg-vacio { color: var(--text-muted); padding: 18px 8px; margin: 0; }
        .busg-grupo + .busg-grupo { margin-top: 10px; }
        .busg-grupo-tit { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 6px 8px 4px; }
        .busg-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
        .busg-item.sel { background: var(--bg-surface-elevated); border-color: var(--primary); }
        .busg-item-txt { flex: 1; min-width: 0; }
        .busg-item-tit { color: var(--text-title); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .busg-item-det { color: var(--text-muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .busg-mod { flex-shrink: 0; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: rgba(var(--tinte), 0.07); color: var(--text-body); }
        .busg-mas { background: none; border: none; color: var(--primary); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 4px 10px; }
        .busg-mas-txt { color: var(--text-faint); font-size: 0.78rem; margin: 2px 10px 0; }
        .busg-pie { color: var(--text-faint); font-size: 0.75rem; margin: 10px 4px 0; }
        @media (max-width: 1100px) { .busg-abrir { min-width: 0; } .busg-abrir-txt, .busg-abrir kbd { display: none; } }
        @media (max-width: 760px) {
            .busg-abrir { width: 40px; padding: 0; justify-content: center; }
            header .header-actions { gap: 6px; }   /* con la lupa son cuatro botones: que el título no quede cortado */
            body #modal-buscador { align-items: stretch; padding: 0; }
            body #modal-buscador > .modal-card.busg-card { max-height: none; height: 100dvh; border-radius: 0; border: none;
                                                           padding: calc(0.75rem + env(safe-area-inset-top)) 0.75rem calc(0.75rem + env(safe-area-inset-bottom)); }
            .busg-caja input { font-size: 16px; }   /* 16px: el iPhone no agranda la pantalla al tocar la caja */
            .busg-esc, .busg-pie { display: none; }
            .busg-cerrar-txt { display: inline; color: var(--primary); font-weight: 600; font-size: 0.95rem; }
            body .busg-cerrar.modal-close { font-size: inherit; min-width: 4rem; }
            .busg-item { padding: 12px; background: var(--bg-surface-elevated); margin-bottom: 8px; border-radius: 10px; }
            .busg-item-tit, .busg-item-det { white-space: normal; }
            .busg-item { flex-direction: column; align-items: flex-start; gap: 4px; }
            .busg-item .busg-mod { background: none; padding: 0; color: var(--primary); }
        }
/* detalle de OC: si la tabla no entra a lo ancho, la columna de acciones queda fija a la derecha */
table:has(#tb-moc) :is(th, td):last-child { position: sticky; right: 0; z-index: 1; background: var(--bg-surface); box-shadow: -10px 0 10px -10px rgba(0, 0, 0, calc(0.6 * var(--sombra))); }
table:has(#tb-moc) thead th:last-child { background: var(--bg-surface-elevated); z-index: 2; }

/* ===== Vidrio moderado: fondo de colores en Dashboards y login, vidrio en lo que flota, relieve en las tarjetas del Dashboard ===== */
:root {
    --malla: radial-gradient(55% 45% at 10% 6%, rgba(0, 173, 154, 0.34), transparent 70%),
             radial-gradient(45% 40% at 95% 10%, rgba(56, 189, 248, 0.22), transparent 70%),
             radial-gradient(55% 50% at 75% 100%, rgba(20, 184, 138, 0.22), transparent 70%),
             radial-gradient(40% 40% at 0% 100%, rgba(99, 102, 241, 0.16), transparent 70%);
    --vidrio: rgba(19, 30, 34, 0.84);
    --relieve: 8px 8px 20px rgba(0, 0, 0, 0.45), -6px -6px 16px rgba(255, 255, 255, 0.035), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
:root[data-tema="claro"] {
    --malla: radial-gradient(55% 45% at 10% 6%, rgba(0, 173, 154, 0.16), transparent 70%),
             radial-gradient(45% 40% at 95% 10%, rgba(59, 130, 246, 0.10), transparent 70%),
             radial-gradient(55% 50% at 75% 100%, rgba(20, 184, 138, 0.12), transparent 70%),
             radial-gradient(40% 40% at 0% 100%, rgba(139, 92, 246, 0.07), transparent 70%);
    --vidrio: rgba(255, 255, 255, 0.86);
    --relieve: 8px 8px 20px rgba(11, 18, 21, 0.08), -8px -8px 20px rgba(255, 255, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 1);
}
/* fondo de colores: solo Dashboards, login y pantalla de carga */
main:has(#view-dash.active, #view-emdash.active) { background-image: var(--malla); }
#modal-login, #arranque { background-image: var(--malla); }
/* vidrio: solo lo que flota */
:is(.modal-card, .tema-menu) { background: var(--vidrio); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); border-color: rgba(var(--tinte), 0.14); }
/* la campana va sólida (translúcida no se leía bien) */
.notif-panel { background: var(--bg-surface); border-color: rgba(var(--tinte), 0.14); }
/* relieve sutil en las tarjetas de resumen del Dashboard */
:is(#view-dash, #view-emdash) .kpi-card { background: var(--bg-surface); border-color: transparent; box-shadow: var(--relieve); }
:is(#view-dash, #view-emdash) .kpi-card::before { display: none; }
.tema-lateral { display: none; }
/* Celular: el título entra entero (Apariencia pasa al menú lateral) y, si igual no entra, va en dos renglones */
@media (max-width: 760px) {
    .header-title h2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: var(--fs-lg); line-height: 1.15; text-wrap: balance; }
    .header-actions { gap: 6px; }
    .header-actions > :empty { display: none; }
    .notif-wrap:has(#btn-tema) { display: none; }   /* Apariencia va en el menú lateral */
    .tema-lateral { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
}
.tema-lateral [aria-checked="true"] { color: var(--primary); border-color: var(--primary); background: var(--primary-glow); }
/* Calendario en el celular: próximos 7 días, días vacíos agrupados, encabezado compacto */
@media (max-width: 760px) {
    .cal-atr-fila .cal-chip { padding: 0; border: solid transparent; border-width: 5px 8px; }   /* margen con borde (no relleno): el recorte de 2 renglones no deja asomar un tercero */
    .cal-barra { flex-wrap: nowrap; gap: 8px; margin-bottom: 8px; }
    .cal-nav { min-width: 0; flex: 1; }
    .cal-nav :is(h3, h4) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 4px; }
    .cal-ver-hecho { font-size: var(--fs-xs); flex-shrink: 0; }
    .cal-leyenda { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 10px; padding: 0 12px; }
    .cal-leyenda::-webkit-scrollbar { display: none; }
    .cal-leyenda .cal-chip { flex-shrink: 0; }
    .cal-agenda-vacios { font-size: var(--fs-xs); color: var(--text-muted); padding: 2px 12px; }
}
body.modo-celular .cal-hecho-corto { display: inline; }
/* Estado del sistema: carpeta larga acortada; tocándola se ve entera */
.est-ruta-btn { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: inherit; border-bottom: 1px dashed var(--border-hover); }
.est-ruta-btn .ruta-entera, .est-ruta-btn.abierta .ruta-corta { display: none; }
.est-ruta-btn.abierta .ruta-entera { display: inline; overflow-wrap: anywhere; }
/* Lista o pantalla vacía: ícono, título, para qué sirve y botón para empezar */
.vacio-bloque { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 16px; grid-column: 1 / -1; }   /* en listas en grilla, ocupa todo el ancho */
.vacio-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-glow); color: var(--primary); margin-bottom: 4px; }
.vacio-ico .ico { width: 24px; height: 24px; }
.vacio-bloque b { color: var(--text-title); font-size: var(--fs-md); }
.vacio-bloque .hint { max-width: 420px; }
.vacio-bloque .btn { margin-top: 8px; }
td:has(> .vacio-bloque) { padding: 0 !important; }   /* el bloque ya trae su propio margen */
/* Encabezado: el título cede lugar (la descripción pasa a dos renglones) y los botones quedan siempre a la derecha, en la misma fila */
.header-title { flex: 1 1 0; min-width: 0; }
.header-actions { flex-shrink: 0; }
@media (min-width: 1101px) and (max-width: 1400px) { .busg-abrir { min-width: 180px; } }   /* hasta 1100 ya va sin texto (y en el celular, solo la lupa) */
/* Tabla cargando: renglones grises que brillan suave hasta que llegan los datos */
.fila-esq td { padding-top: 0.9375rem; padding-bottom: 0.9375rem; }
.esq { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgba(var(--tinte), 0.06) 25%, rgba(var(--tinte), 0.13) 50%, rgba(var(--tinte), 0.06) 75%);
       background-size: 200% 100%; animation: esq-brillo 1.4s ease-in-out infinite; }
@keyframes esq-brillo { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .esq { animation: none; } }
/* Tablas largas: renglones alternados suaves (sin tapar los colores propios de cada fila) */
@media (min-width: 761px) { .table-wrap tbody tr:nth-child(even) > td { background-image: linear-gradient(rgba(var(--tinte), 0.025), rgba(var(--tinte), 0.025)); } }   /* en el celular las tablas son tarjetas: ahí no */
/* Barras de herramientas: el buscador no se achica hasta quedar solo la lupa; si no hay lugar, los botones bajan de renglón */
.toolbar { flex-wrap: wrap; }
.toolbar .search-container { min-width: 200px; }
.toolbar > :is(select, .segmentado, .btn) { flex-shrink: 0; }
/* Órdenes de Compra en la PC: entra en 1280 (tipo solo con ícono, proveedor en hasta 2 renglones, sin la columna «Ver»: tocar el renglón ya abre la OC) */
@media (min-width: 761px) {
    #tabla-oc :is(th, td) { padding-left: 0.4375rem; padding-right: 0.4375rem; }
    #tabla-oc tr:is(:not(.fila-estado), .fila-esq) > :is(th, td):last-child { display: none; }   /* el mensaje de una sola celda (vacía, error) queda */
    #tabla-oc .col-tipo-oc .badge { font-size: 0; gap: 0; padding: 0.25rem 0.375rem; }
    #tabla-oc .col-tipo-oc .badge .ico { width: 14px; height: 14px; }
    #tabla-oc .txt-prov { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    #tabla-oc .progreso { width: 44px; }
}
/* Mi actividad: el recorrido de cada viaje en chips numerados chicos */
.emv-pasos-chico { padding: 0; gap: 4px; }
.emv-pasos-chico .emv-paso { font-size: var(--fs-xs); padding: 2px 9px 2px 2px; gap: 6px; }
.emv-pasos-chico .emv-paso i { width: 18px; height: 18px; font-size: 0.68rem; }
@media (min-width: 761px) {
    :is(#tb-emact-viajes, #tb-emact-prox) .emd-est { min-width: 340px; width: 45%; }
    #tb-emact-viajes td:last-child .em-chip { white-space: normal; }   /* el estado largo pasa a dos renglones en vez de cortarse */
}

/* ===== Stock · Sin movimiento ===== */
#btn-sin-mov.activo-sinmov { border-color: var(--primary); color: var(--text-title); background: rgba(0, 173, 154, 0.14); }
.sinmov-banda { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; margin: 0 0 12px; border: 1px solid var(--border-subtle);
                border-radius: 10px; background: var(--bg-card); }
.sinmov-linea { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sinmov-linea label { margin: 0; color: var(--text-body); }
.sinmov-linea select { width: auto; min-width: 6.875rem; }
.sinmov-total { font-weight: 700; color: var(--tx-fbbf24); }
.sinmov-nunca { font-weight: 700; color: var(--tx-fbbf24); }
.solo-cel-txt { display: none; }
#view-stock .col-sinmov { display: none; white-space: nowrap; }
#view-stock.modo-sinmov .col-sinmov { display: table-cell; }
/* en este modo sobran la casilla de revisar, la marca, el proveedor y el costo unitario */
#view-stock.modo-sinmov table :is(th, td:not(.tabla-estado)):is(:nth-child(1), :nth-child(4), :nth-child(6), :nth-child(8)) { display: none; }

/* Dashboard: comparación con el cierre del mes anterior («↑ 2 vs. octubre») */
.kpi-vs { display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
          font-variant-numeric: tabular-nums; background: rgba(var(--tinte), 0.07); color: var(--text-muted); }
.kpi-vs.vs-bien { background: var(--success-glow); color: var(--tx-86efac); }
.kpi-vs.vs-mal { background: var(--danger-glow); color: var(--tx-fca5a5); }

/* Transiciones: la campana y el menú del tema bajan desde su botón; en el celular las ventanas suben desde abajo; lo recién guardado se ilumina */
@keyframes desplegableBaja { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
.tema-menu, .notif-panel { transform-origin: top right; animation: desplegableBaja 0.16s cubic-bezier(0.16, 1, 0.3, 1); }
@media (max-width: 760px) {
    body .modal-overlay:not(#modal-confirmar):not(#modal-login) > .modal-card:not(.pantalla-completa):not(.dep3d-card) { transform: translateY(100%); transition: transform 0.16s ease-in; }
    body .modal-overlay.active:not(#modal-confirmar):not(#modal-login) > .modal-card:not(.pantalla-completa):not(.dep3d-card) { transform: none; transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
    @starting-style { body .modal-overlay.active:not(#modal-confirmar):not(#modal-login) > .modal-card:not(.pantalla-completa):not(.dep3d-card) { transform: translateY(100%); } }
    /* 3: la ventana se baja con el dedo desde el título (app.js); la rayita de arriba avisa que se puede */
    body .modal-overlay:not(#modal-confirmar):not(#modal-login) > .modal-card:not(.pantalla-completa):not(.dep3d-card):not(.busg-card):not(.emcp-card) > .modal-header:first-child { touch-action: none; }
    body .modal-overlay:not(#modal-confirmar):not(#modal-login) > .modal-card:not(.pantalla-completa):not(.dep3d-card):not(.busg-card):not(.emcp-card) > .modal-header:first-child::before {
        content: ""; position: absolute; top: 5px; left: 50%; width: 36px; margin-left: -18px; height: 4px; border-radius: 2px; background: rgba(var(--tinte), 0.25); }
}
/* mientras se arrastra, el fondo oscuro se aclara a medida que la ventana baja */
@supports (background-color: color-mix(in srgb, red 50%, transparent)) {
    .modal-overlay.arrastrando { background-color: color-mix(in srgb, var(--velo) calc(var(--velo-k, 1) * 100%), transparent); }
}
@keyframes recienGuardado { 0%, 35% { background-color: var(--primary-glow); } 100% { background-color: transparent; } }
tr.recien-guardado > td { animation: recienGuardado 1.8s ease-out; }
/* Al apretar: el botón se hunde apenas y se oscurece en el mismo instante; al soltar vuelve suave (con la transición que ya tiene) */
:is(.btn, .nav-btn, .fila-click) { -webkit-tap-highlight-color: transparent; }
.btn:active:not(:disabled) { transform: scale(0.97); filter: brightness(0.9); transition-duration: 0s; }
.btn-outline:active:not(:disabled) { background: rgba(var(--tinte), 0.08); border-color: var(--border-hover); }
.nav-btn:active { background: var(--bg-surface-elevated); transform: scale(0.98); transition-duration: 0s; }
tr.fila-click:active > td { background: rgba(var(--tinte), 0.08); }
@media (prefers-reduced-motion: reduce) { :is(.btn, .nav-btn):active { transform: none; } }   /* con «menos movimiento» solo se oscurece */

        /* Foco con teclado: botón «Ir al contenido» (solo aparece con Tab) y la pantalla sin borde al recibir el salto */
        .ir-contenido { position: fixed; top: 10px; left: 10px; z-index: 10000; transform: translateY(-160%); background: var(--primary); color: var(--on-primary); border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); cursor: pointer; }
        .ir-contenido:focus { transform: none; }
        main:focus { outline: none; }
        /* Campos sin borde dentro de una caja con borde: el halo va en la caja, no adentro (se veía un recuadro dentro de otro) */
        .busg-caja input:focus, .emcp-hora input:focus { box-shadow: none; }
        .busg-caja:focus-within, .emcp-hora:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px var(--primary-glow); }

        /* Íconos que antes eran emoji: la bandera de llegada en los mapas de Viajes */
        .emv-pin .ico { width: 14px; height: 14px; vertical-align: -2px; }

        /* Franja «Sin conexión»: cuelga del borde de abajo de la barra de arriba (que queda fija), así se ve en todas las pantallas */
        main > header { flex-wrap: wrap; }   /* la franja va en un renglón propio y empuja la pantalla (no la tapa); igual que el cartel del viaje */
        .franja-red { order: 10; flex: 0 0 auto; width: calc(100% + 72px); margin: 12px -36px -16px; padding: 7px 36px; display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; }
        @media (max-width: 760px) { .franja-red { width: calc(100% + 24px); margin: 8px -12px -10px; padding: 7px 12px; } }
        .franja-red.oculto { display: none; }
        .franja-red.sin { background: color-mix(in srgb, var(--warning) 16%, var(--bg-body)); color: var(--tx-fbbf24); border-bottom: 1px solid color-mix(in srgb, var(--warning) 45%, transparent); }
        .franja-red.con { background: color-mix(in srgb, var(--success) 16%, var(--bg-body)); color: var(--tx-86efac); border-bottom: 1px solid color-mix(in srgb, var(--success) 45%, transparent); }
        .franja-red .punto { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex: none; }
        /* aviso de actualización (franja-sistema): texto a la izquierda, botón a la derecha */
        .franja-red.gris { background: var(--bg-surface); color: var(--text-body); border-bottom: 1px solid var(--border-subtle); }
        .franja-red .franja-txt { flex: 1; min-width: 0; }
        .franja-red .btn { flex: none; }
        .franja-red .reloj-act { font-variant-numeric: tabular-nums; }
        /* Calendario en el celular: la leyenda en dos renglones (la tira que se deslizaba parecía cortada) */
        @media (max-width: 760px) { .cal-leyenda { flex-wrap: wrap; overflow: visible; margin: 0 0 10px; padding: 0; } }

/* Borrador del egreso y de la OC nueva: cartel para seguir con lo que quedó sin terminar */
.cartel-borrador { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; font-size: var(--fs-sm);
    background: color-mix(in srgb, var(--primary) 10%, var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); color: var(--text-body); }
.cartel-borrador > .ico { color: var(--primary); flex: none; }
.cartel-borrador > span:not(.acciones) { flex: 1 1 240px; min-width: 0; }
.cartel-borrador b { color: var(--text-title); }
.cartel-borrador .acciones { display: flex; gap: 8px; flex-wrap: wrap; }

/* Atajos de teclado: el botón del menú del usuario ocupa el renglón entero */
.user-acciones .btn-atajos { grid-column: 1 / -1; order: 3; }

/* ===== Impresión: solo el contenido, en claro y sin botones (el encabezado y el pie los completa app.js al imprimir) ===== */
@media print {
    @page { size: A4; margin: 16mm 12mm;
        @top-left { font: 600 10pt system-ui, sans-serif; color: #000; }
        @top-right { font: 8.5pt system-ui, sans-serif; color: #555; }
        @bottom-left { font: 8.5pt system-ui, sans-serif; color: #555; }
        @bottom-right { content: "Página " counter(page) " de " counter(pages); font: 8.5pt system-ui, sans-serif; color: #555; } }
    html, body { background: #fff !important; height: auto !important; overflow: visible !important; display: block !important; }
    body { color: #000; }
    *, *::before, *::after { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; backdrop-filter: none !important; }
    aside, main > header, #toast-container, .ir-contenido, .franja-red, .cartel-borrador, #ing-avisos-borrador, .em-cartel,
    .tabs, .segmentado, .search-container, .modal-close, .notif-panel, .tema-menu, button:not(td button), .btn { display: none !important; }
    main { margin: 0 !important; padding: 0 !important; overflow: visible !important; display: block !important; }
    .panel-card, .table-wrap, .kpi-card { background: #fff !important; border: 1px solid #ccc !important; }
    .table-wrap, .tabla-scroll { overflow: visible !important; max-height: none !important; }
    thead { display: table-header-group; }
    table { width: 100% !important; min-width: 0 !important; table-layout: auto !important; }
    th, td { min-width: 0 !important; max-width: none !important; width: auto !important; padding: 3px 0.25rem !important; font-size: 8pt !important; overflow-wrap: break-word; }
    td button { color: inherit !important; background: none !important; border: 0 !important; padding: 0 !important; font: inherit !important; }
    td :is(input[type=checkbox]:not(:checked), label:has(> input[type=checkbox]:not(:checked))) { visibility: hidden !important; }   /* las marcadas se ven */   /* la columna queda (si no, se corren los títulos) */
    tr, .kpi-card { break-inside: avoid; }
    a { color: inherit !important; text-decoration: none !important; }
    .fm-foto:has(> .sin-foto) { display: none !important; }   /* sin foto, el recuadro vacío ocupaba media hoja */
    /* con una ventana abierta (ficha de un material, de un préstamo…) se imprime solo esa ventana */
    body:has(.modal-overlay.active:not(#modal-login):not(#modal-confirmar)) > :is(aside, main) { display: none !important; }
    .modal-overlay.active { position: static !important; inset: auto !important; background: none !important; padding: 0 !important; display: block !important; }
    .modal-overlay.active .modal-card { max-height: none !important; max-width: none !important; width: auto !important; overflow: visible !important;
        border: 0 !important; transform: none !important; background: #fff !important; }
}

/* Letras de los atajos de teclado (solo en la PC): en el menú aparecen al pasar el mouse y en la pantalla actual */
kbd.atajo { font: 600 0.68rem var(--font-sans); line-height: 1; padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border-hover);
    border-bottom-width: 2px; color: var(--text-muted); background: var(--bg-surface); flex: none; }
.nav-btn:has(> kbd.atajo) { position: relative; }
.nav-btn kbd.atajo { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); visibility: hidden; }   /* no ocupa lugar: el nombre no se parte en dos renglones */
.nav-btn:hover kbd.atajo, .nav-btn.active kbd.atajo, .nav-btn:focus-visible kbd.atajo { visibility: visible; }
.btn kbd.atajo { margin-left: 4px; background: color-mix(in srgb, currentColor 14%, transparent); border-color: color-mix(in srgb, currentColor 40%, transparent); color: inherit; }
body.modo-celular kbd.atajo, body.menu-plegado .nav-btn kbd.atajo { display: none; }

/* «Editar ítems» de una OC ya creada: el panel de carga sin la cabecera (proveedor, fecha, moneda… quedan como están) */
#panel-nueva-oc.modo-agregar :is(#oc-tipo-botones, .leyenda-campos, .form-grid:not(.oc-item-grid)) { display: none; }
#oc-items-actuales tr.oc-item-sale td { background: color-mix(in srgb, var(--danger) 8%, transparent); }
#oc-items-actuales tr.oc-item-sale .oc-item-nombre { text-decoration: line-through; color: var(--text-muted); }

/* Lista de OC de a 100 («Ver 100 más» / «Ver todas») */
.ver-mas { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 14px 0 4px; color: var(--text-muted); font-size: var(--fs-sm); }
.ver-mas.oculto { display: none; }
/* Ventana de la OC mientras llegan los datos: se ve enseguida, los botones esperan */
#modal-oc.cargando-oc .modal-card button:not(.modal-close) { pointer-events: none; opacity: .45; }

/* Secciones del menú que se pliegan tocando el título (Ingeniería y Servicio Técnico) */
.nav-sep[data-seccion] { cursor: pointer; display: flex; justify-content: space-between; align-items: center; border-radius: 6px; user-select: none; }
.nav-sep[data-seccion].oculto { display: none; }
.nav-sep[data-seccion]::after { content: '▾'; font-size: 0.9em; opacity: 0.7; }
.nav-sep[data-seccion].plegada::after { content: '▸'; }
.nav-sep[data-seccion]:hover { color: var(--text-muted); }
.nav-sep[data-seccion]:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
body:not(.menu-plegado) .nav-btn.sec-plegada { display: none; }
body.menu-plegado .nav-sep[data-seccion]::after { content: none; }
/* Campana: pestañas Notificaciones / Menciones */
.notif-pestanas { display: flex; gap: 4px; margin: 10px 12px 0; background: var(--bg-surface); border-radius: 9px; padding: 3px; }
.notif-pestanas button { flex: 1; border: 0; background: none; color: var(--text-muted); font: inherit; font-size: var(--fs-sm); font-weight: 600; padding: 0.4375rem 0.5rem; border-radius: 7px; cursor: pointer; }
.notif-pestanas button.activo { background: var(--bg-card); color: var(--text-title); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.notif-pest-num:not(:empty) { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--primary); color: #fff; font-size: var(--fs-xs); line-height: 18px; }
.notif-head.oculto, .notif-lista.oculto { display: none; }
.notif-ver-todas { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--tx-6fdccd); font: inherit; font-size: var(--fs-sm); font-weight: 600; padding: 12px 16px; cursor: pointer; }
.notif-ver-todas:hover { background: var(--primary-glow); }
body[data-deposito="EM"] .nav-sep.nav-sep-em[data-seccion]:not(.oculto) { display: flex; }   /* las de Estaciones también se pliegan */
        /* ===== Anotar service o arreglo ===== */
        .vhr-card { display: flex; flex-direction: column; gap: 1rem; }
        .vhr-cab { align-items: center; gap: 14px; margin-bottom: 0; }
        .vhr-cab .modal-close { margin-left: auto; align-self: flex-start; }
        .vhr-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
        .vhr-tipos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
        .vhr-tipo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface-elevated);
                    cursor: pointer; text-align: left; color: var(--text-body); font: inherit; }
        .vhr-tipo svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; color: var(--text-muted); }
        .vhr-tipo b { display: block; color: var(--text-title); } .vhr-tipo small { color: var(--text-muted); font-size: var(--fs-xs); }
        .vhr-tipo.activo { border-color: var(--primary); background: var(--primary-glow); } .vhr-tipo.activo svg { color: var(--primary); }
        .vhr-tipo.vhr-arr.activo { border-color: var(--tx-fbbf24); background: rgba(251, 191, 36, .08); } .vhr-tipo.vhr-arr.activo svg { color: var(--tx-fbbf24); }
        .vhr-sec { display: flex; flex-direction: column; gap: 10px; }
        .vhr-sec > h4 { margin: 0; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 8px; }
        .vhr-sec > h4::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }
        .vhr-campo { display: flex; align-items: center; background: var(--bg-surface-elevated); border: 1px solid var(--borde-campo, var(--border-subtle)); border-radius: 8px; min-width: 0; }
        .vhr-campo:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px var(--primary-glow); }
        .vhr-campo input { flex: 1; min-width: 0; width: 100%; border: 0; background: none; box-shadow: none !important; }
        .vhr-campo > span { color: var(--text-muted); padding: 0 12px; white-space: nowrap; }
        .vhr-campo > span:first-child { padding-right: 0; }
        .vhr-chips { display: flex; flex-wrap: wrap; gap: 7px; }
        .vhr-chip { border: 1px solid var(--border-subtle); background: var(--bg-surface-elevated); color: var(--text-body); border-radius: 99px; padding: 5px 11px;
                    font-family: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
        .vhr-chip::before { content: ""; width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--text-faint); flex: none; }
        .vhr-chip.activo { border-color: var(--primary); color: var(--text-title); background: var(--primary-glow); }
        .vhr-chip.activo::before { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 10px no-repeat; }
        .vhr-es-arreglo .vhr-chip.activo { border-color: var(--tx-fbbf24); background: rgba(251, 191, 36, .08); }
        .vhr-es-arreglo .vhr-chip.activo::before { border-color: var(--tx-fbbf24); background-color: var(--tx-fbbf24); }
        .vhr-drop { position: relative; border: 1.5px dashed var(--border-subtle); border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer;
                    background: var(--bg-surface-elevated); color: var(--text-muted); font-size: var(--fs-sm); }
        .vhr-drop:hover, .vhr-drop.arrastrando, .vhr-drop:focus-within { border-color: var(--primary); }
        .vhr-drop.con-archivo { border-style: solid; border-color: var(--primary); }
        .vhr-drop svg { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--primary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
        .vhr-drop b { display: block; color: var(--text-title); word-break: break-word; }
        .vhr-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
        .vhr-aviso { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--primary-glow); border: 1px solid var(--primary); font-size: var(--fs-sm); }
        .vhr-aviso svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--primary); stroke-width: 2; }
        .vhr-aviso b { color: var(--text-title); }
        .vhr-pie { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
        .vhr-total { margin-right: auto; } .vhr-total b { color: var(--text-title); font-size: var(--fs-md); }
        @media (max-width: 560px) { .vhr-tipos { grid-template-columns: 1fr; } .vhr-total { width: 100%; } }
        /* ===== Revisión cada 15 días ===== */
        .vh-dato-c small svg[viewBox] { stroke-linecap: round; stroke-linejoin: round; }
        .vh-rev.vh-medio { border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .05); }
        .vh-rev.vh-medio > .vh-serv-fila b { color: var(--tx-fbbf24); }
        .vh-rev .vh-serv-fila b { color: var(--text-title); font-size: var(--fs-lg); }
        .vh-puntos-rev { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
        .vh-punto-rev { font-size: var(--fs-xs); padding: 2px 8px; border-radius: 99px; background: rgba(52, 211, 153, .1); color: var(--tx-34d399); }
        .vh-punto-rev.vh-rep { background: var(--primary-glow); color: var(--primary); }
        .vh-punto-rev.vh-mal { background: rgba(251, 113, 133, .12); color: var(--tx-fb7185); }
        .vhv-todo { align-self: flex-end; margin-top: -6px; background: none; border: 0; color: var(--primary); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
        .vhv-items { display: flex; flex-direction: column; gap: 8px; }
        .vhv-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 11px; background: var(--bg-surface-elevated); }
        .vhv-item b { display: block; color: var(--text-title); } .vhv-item small { color: var(--text-muted); font-size: var(--fs-xs); }
        .vhv-ii { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-glow); color: var(--primary); }
        .vhv-ii svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
        .vhv-seg { display: flex; border: 1px solid var(--border-subtle); border-radius: 9px; overflow: hidden; }
        .vhv-seg button { background: none; border: 0; border-left: 1px solid var(--border-subtle); color: var(--text-muted); font: inherit; font-size: var(--fs-sm); font-weight: 600; padding: 0.4375rem 0.6875rem; cursor: pointer; }
        .vhv-seg button:first-child { border-left: 0; }
        .vhv-seg button[data-estado="OK"].activo { background: rgba(52, 211, 153, .15); color: var(--tx-34d399); }
        .vhv-seg button[data-estado="REP"].activo { background: var(--primary-glow); color: var(--primary); }
        .vhv-seg button[data-estado="MAL"].activo { background: rgba(251, 113, 133, .15); color: var(--tx-fb7185); }
        .vhv-item.vhv-mal { border-color: rgba(251, 113, 133, .5); }
        .vhv-nota, .vhv-ruedas { grid-column: 1 / -1; display: none; }
        .vhv-item.vhv-mal .vhv-nota { display: block; }
        .vhv-item.vhv-con-ruedas .vhv-ruedas { display: flex; flex-direction: column; gap: 6px; }
        .vhv-auto { position: relative; width: 250px; height: 150px; margin: 0 auto; }
        .vhv-carro { position: absolute; left: 62px; right: 62px; top: 6px; bottom: 6px; border: 2px solid var(--text-faint); border-radius: 40px 40px 18px 18px; display: flex; justify-content: center; }
        .vhv-carro span { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
        .vhv-rueda { position: absolute; width: 88px; padding: 7px 4px; border-radius: 9px; border: 1.5px solid var(--border-subtle); background: var(--bg-card); color: var(--text-body); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
        .vhv-rueda.activo { border-color: var(--primary); background: var(--primary-glow); color: var(--text-title); }
        .vhv-mal .vhv-rueda.activo { border-color: var(--tx-fb7185); background: rgba(251, 113, 133, .15); }
        .vhv-DI { left: 0; top: 18px; } .vhv-DD { right: 0; top: 18px; } .vhv-TI { left: 0; bottom: 18px; } .vhv-TD { right: 0; bottom: 18px; }
        @media (max-width: 560px) { .vhv-item { grid-template-columns: auto minmax(0, 1fr); } .vhv-seg { grid-column: 1 / -1; } .vhv-seg button { flex: 1; } }
        /* ===== Historia del equipo (por número de serie) ===== */
        .hs-card { display: flex; flex-direction: column; gap: 0.875rem; }
        .hs-cab { align-items: center; gap: 14px; margin-bottom: 0; }
        .hs-cab .modal-close { margin-left: auto; align-self: flex-start; }
        .hs-ic { width: 48px; height: 48px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--primary-glow); color: var(--primary); }
        .hs-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
        .hs-sub { margin-top: 3px; }
        .hs-serie { font: 700 var(--fs-sm) var(--font-mono); color: var(--text-title); background: rgba(var(--tinte), .06); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 1px 7px; }
        .hs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
        .hs-resumen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
        .hs-dato { background: rgba(var(--tinte), .03); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 9px 12px; min-width: 0; }
        .hs-dato small { display: block; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
        .hs-dato b { color: var(--text-title); font-size: var(--fs-lg); } .hs-dato span { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
        .hs-filtros { display: flex; gap: 6px; flex-wrap: wrap; }
        .hs-filtro { border: 1px solid var(--border-subtle); background: var(--bg-surface-elevated); color: var(--text-body); border-radius: 99px; padding: 4px 11px; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
        .hs-filtro span { color: var(--text-muted); font-weight: 500; }
        .hs-filtro.activo { border-color: var(--primary); color: var(--text-title); background: var(--primary-glow); }
        .hs-linea { display: flex; flex-direction: column; }
        .hs-ev { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
        .hs-ev:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--border-subtle); }
        .hs-punto { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid currentColor; background: var(--bg-card); }
        .hs-punto svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        .hs-c-ing { color: var(--text-faint); } .hs-c-venta { color: var(--tx-7dd3fc); } .hs-c-comis { color: var(--tx-c4b5fd); } .hs-c-ent { color: var(--tx-34d399); }
        .hs-c-rep { color: var(--tx-fbbf24); } .hs-c-gar { color: var(--tx-fbbf24); } .hs-c-baja { color: var(--tx-fb7185); } .hs-c-com { color: var(--text-muted); }
        .hs-tarj { background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); border-radius: 11px; padding: 10px 13px; min-width: 0; }
        .hs-tarj-rep { border-color: rgba(251, 191, 36, .35); }
        .hs-futuro .hs-tarj { border-style: dashed; }
        .hs-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
        .hs-top b { color: var(--text-title); }
        .hs-fecha { color: var(--text-muted); font-size: var(--fs-sm); white-space: nowrap; }
        .hs-tarj p { margin: 4px 0 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
        .hs-tarj a, .hs-enlace { color: var(--primary); font-weight: 600; text-decoration: none; }
        .hs-tarj a:hover, .hs-enlace:hover { text-decoration: underline; }
        .hs-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin-top: 6px; font-size: var(--fs-sm); }
        .hs-kv span:nth-child(odd) { color: var(--text-muted); } .hs-kv span:nth-child(even) { overflow-wrap: anywhere; }
        .hs-rptos { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
        .hs-rptos span { font-size: var(--fs-xs); padding: 2px 8px; border-radius: 99px; background: rgba(var(--tinte), .05); border: 1px solid var(--border-subtle); }
        .hs-badge { font-size: var(--fs-xs); font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-left: 6px; }
        .hs-b-gar { background: rgba(52, 211, 153, .12); color: var(--tx-34d399); } .hs-b-pago { background: rgba(56, 189, 248, .12); color: var(--tx-7dd3fc); }
        .hs-b-rein { background: rgba(251, 113, 133, .12); color: var(--tx-fb7185); } .hs-b-abierta { background: rgba(251, 191, 36, .12); color: var(--tx-fbbf24); }
        .hs-pie { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
        @media (max-width: 600px) { .hs-resumen { grid-template-columns: 1fr 1fr; } .hs-pie .btn { flex: 1 1 100%; justify-content: center; } }
        /* ===== Análisis de fallas: columnas, visitas por mes y estaciones con más viajes (compactos: sin desplazar) ===== */
        .emf-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
        .emf-leyenda { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: var(--fs-xs); }
        .emf-leyenda > span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; background: var(--k); }
        .emf-leyenda > .emf-ley-linea::before { height: 2px; width: 12px; border-radius: 0; vertical-align: 3px; }
        #emf-meses { padding: 6px 12px 0; }
        .emf-svg { display: block; width: 100%; height: auto; max-height: 170px; }
        .emf-ejes line { stroke: var(--border-subtle); stroke-width: 1; } .emf-ejes line.base { stroke: var(--border-hover); }
        .emf-txt text { fill: var(--text-muted); font-size: 10.5px; font-family: inherit; }
        .emf-svg g:hover > rect:not([fill="transparent"]) { filter: brightness(1.2); }
        .emf-resumen { margin: 2px 14px 10px; }
        .emf-pc { display: inline-flex; align-items: center; gap: 8px; }
        .emf-pc-barra { display: flex; width: 80px; height: 7px; border-radius: 99px; overflow: hidden; background: rgba(var(--tinte), .07); }
        .emf-pc-barra i { display: block; height: 100%; }
        .emf-mas { text-align: center; padding: 6px !important; }
        .ra-fila { grid-template-columns: minmax(110px, 1.1fr) minmax(0, 1.6fr) 60px 56px; cursor: default; }
        .ra-barra { display: flex; height: 10px; }
        .ra-barra i { display: block; height: 100%; }
        .ra-barra i:last-child { border-radius: 0 4px 4px 0; }
        .ra-etapas { padding: 6px 16px 10px; display: grid; gap: 8px; }
        .ra-etapas-barra { display: flex; height: 16px; border-radius: 6px; overflow: hidden; gap: 2px; }
        .ra-etapas-barra i { display: block; min-width: 3px; }
        .ra-ordenes { background: rgba(var(--tinte), .03); }
        .ra-ordenes .btn { margin: 2px; }

/* ===== Opciones del equipo: «Reducir transparencia» (vidrio sólido, sin desenfoque) y «Aumentar contraste» (bordes y grises más marcados) ===== */
@media (prefers-reduced-transparency: reduce) {
    :root, :root[data-tema] { --vidrio: var(--bg-surface); --bg-card: var(--bg-surface); --bg-header: var(--bg-sidebar); }
    :is(.modal-overlay, .modal-card, .tema-menu, .notif-panel, .toast, main > header) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
    :root, :root[data-tema] { --border-subtle: rgba(var(--tinte), 0.3); --border-hover: rgba(var(--tinte), 0.5); --borde-campo: rgba(var(--tinte), 0.5);
                              --text-muted: var(--text-body); --text-faint: var(--text-body); --vidrio: var(--bg-surface); }
    :is(.modal-overlay, .modal-card, .tema-menu, .notif-panel, main > header) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}

/* Stock y Herramientas en la PC: la marca ocupa 2 renglones como máximo (entera al pasar el mouse) */
@media (min-width: 761px) { .marca-2r { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }
/* cuenta de caracteres debajo de los campos con largo máximo */
.cuenta-campo { text-align: right; }
/* Reparaciones: la falla en 3 renglones como máximo (entera al pasar el mouse y en la ficha) */
.falla-3r { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* 2 · Herramientas en la PC: el tipo en un renglón de hasta 180 px (entero al pasar el mouse) y la descripción con un ancho mínimo */
@media (min-width: 761px) {
    #tb-herr .badge-herr { display: inline-block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
    #tb-herr td:nth-child(3) { min-width: 240px; }
}
/* Avisos de arriba y menú del celular: se pueden arrastrar de costado para sacarlos (app.js); lo vertical sigue siendo desplazar */
.toast { touch-action: pan-y; cursor: grab; }
@media (max-width: 760px) { aside { touch-action: pan-y; } }
/* Cambio de tema: los colores pasan de uno a otro (lo pone el script del <head> solo mientras cambia) */
:root.cambiando-tema, :root.cambiando-tema *, :root.cambiando-tema *::before, :root.cambiando-tema *::after {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, fill 0.25s ease, stroke 0.25s ease, box-shadow 0.25s ease !important;
}
