        /* ══════════════════════════════════════════════════════════════
           MEJORAS v13 — resumen partner, export, detalle mejorado, móvil
           ══════════════════════════════════════════════════════════════ */

        /* 1. Tarjetas resumen arriba de Pendientes (solo partners) */
        .partner-resumen-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
        .partner-resumen-card { background: white; border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--if-gray-200); display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm); transition: all 0.25s ease; }
        .partner-resumen-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
        .pr-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
        .pr-icon.pendi { background: var(--if-accent-light); color: var(--if-accent); }
        .pr-icon.cit { background: var(--if-info-light); color: var(--if-info); }
        .pr-icon.fin { background: var(--if-success-light); color: var(--if-success); }
        .pr-icon.proxi { background: var(--if-warning-light); color: var(--if-warning); }
        .pr-content h4 { margin: 0; font-size: 22px; font-family: var(--font-titles); color: var(--if-primary); font-weight: 800; line-height: 1; }
        .pr-content p { margin: 3px 0 0 0; font-size: 12px; color: var(--if-gray-500); text-transform: uppercase; letter-spacing: 0.3px; }
        .pr-content .pr-small { font-size: 13px; font-family: var(--font-titles); font-weight: 700; color: var(--if-primary); line-height: 1.2; }

        /* 2. Botones de exportar */
        .export-bar { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
        .btn-export { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1.5px solid var(--if-gray-200); background: white; border-radius: 50px; font-size: 13px; font-weight: 600; color: var(--if-gray-600); cursor: pointer; font-family: inherit; transition: all 0.25s ease; }
        .btn-export:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
        .btn-export.excel:hover { border-color: #10b981; color: #10b981; }
        .btn-export.pdf:hover { border-color: #ef4444; color: #ef4444; }
        .btn-export i { font-size: 12px; }

        /* 3. Detalle mejorado: botones de acción (llamar, whatsapp, maps) */
        .detalle-acciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 8px; }
        .detalle-accion-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 10px; border: 1.5px solid var(--if-gray-200); background: white; border-radius: var(--radius); cursor: pointer; transition: all 0.25s ease; font-family: inherit; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--if-gray-700); }
        .detalle-accion-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
        .detalle-accion-btn i { font-size: 20px; }
        .detalle-accion-btn.call { color: var(--if-info); }
        .detalle-accion-btn.call:hover { border-color: var(--if-info); background: var(--if-info-light); }
        .detalle-accion-btn.wa { color: #10b981; }
        .detalle-accion-btn.wa:hover { border-color: #10b981; background: var(--if-success-light); }
        .detalle-accion-btn.map { color: var(--if-accent); }
        .detalle-accion-btn.map:hover { border-color: var(--if-accent); background: var(--if-accent-light); }
        .detalle-accion-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

        /* 4. Vista móvil: tarjetas en lugar de tablas */
        .mobile-card-list { display: none; }
        /* citadosTimelineContainer y finalizadosCardsContainer son siempre visibles */
        #mobileCitados, #mobileFinalizados, #mobileFacturas { display: none !important; }
        .mobile-card-item { background: white; border: 1px solid var(--if-gray-200); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
        .mobile-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
        .mobile-card-matr { font-family: 'SF Mono', monospace; font-size: 14px; font-weight: 700; color: var(--if-primary); background: var(--if-accent-light); padding: 4px 10px; border-radius: 6px; }
        .mobile-card-body { font-size: 13px; color: var(--if-gray-700); line-height: 1.6; }
        .mobile-card-body .mc-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
        .mobile-card-body .mc-label { color: var(--if-gray-500); font-size: 12px; }
        .mobile-card-body strong { color: var(--if-primary); }
        .mobile-card-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--if-gray-100); justify-content: flex-end; }

        /* 5. Toast de "nuevo parte" - reutiliza estilo existente, solo añadimos emphasis */
        .toast.nuevo-parte { border-left-color: var(--if-accent); animation: slideInRight 0.4s ease, pulseAccent 2s ease-in-out; }
        @keyframes pulseAccent { 0%, 100% { box-shadow: var(--shadow-lg); } 50% { box-shadow: 0 20px 30px -5px rgba(255,140,0,0.4); } }

        /* 6. Resumen Facturación en Dashboard */
        .factura-kpis-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
        .factura-kpis-row .card { padding: 18px 22px; display: flex; align-items: flex-start; justify-content: space-between; }
        .factura-kpis-row .card > div:first-child > div:first-child { font-size: 12px; color: var(--if-gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
        .factura-kpis-row .card > div:first-child > div:last-child { font-size: 26px; font-weight: 800; }
        .factura-kpis-row .card > i { font-size: 32px; opacity: 0.2; }
        #dashCardLimpio { display: none; }
        #dashCardLimpio.limpio-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

        /* Mostrar cards en móvil, tabla en desktop */
        @media (max-width: 768px) {
            .factura-kpis-row { grid-template-columns: 1fr; gap: 12px; }
            .factura-kpis-row .card { padding: 14px 16px; }
            .factura-kpis-row .card > div:first-child > div:first-child { font-size: 11px; }
            .factura-kpis-row .card > div:first-child > div:last-child { font-size: 20px; }
            .factura-kpis-row .card > i { font-size: 28px; }
            #dashCardLimpio .limpio-amounts { grid-template-columns: 1fr !important; gap: 12px !important; }
            #dashCardLimpio .limpio-amounts > div { padding: 12px !important; }
            #dashCardLimpio .limpio-amounts > div > div:first-child { font-size: 10px !important; }
            #dashCardLimpio .limpio-amounts > div > div:last-child { font-size: 18px !important; }
            #dashCardLimpio > div:last-child { flex-direction: column; gap: 12px; }
            #dashCardLimpio button { margin-left: 0 !important; width: 100%; }
        }
            .partner-resumen-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
            .pr-content h4 { font-size: 18px; }
            .pr-icon { width: 36px; height: 36px; font-size: 14px; }
            .mobile-hide-table { display: none !important; }
            .mobile-card-list { display: block; }
            .export-bar { width: 100%; margin-left: 0; justify-content: stretch; }
            .btn-export { flex: 1; justify-content: center; }
            .detalle-acciones { grid-template-columns: 1fr; }
            .detalle-accion-btn { flex-direction: row; justify-content: flex-start; padding: 12px 16px; gap: 12px; }
        }

        /* 6. Soporte WhatsApp — banner global (solo partners) */
        .soporte-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%); border: 1px solid #10b981; border-radius: var(--radius); margin-bottom: 20px; text-decoration: none; color: #065f46; transition: all 0.25s ease; }
        .soporte-banner:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); color: #065f46; }
        .soporte-banner .sb-icon { width: 38px; height: 38px; background: #25D366; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 18px; flex-shrink: 0; }
        .soporte-banner .sb-text { flex: 1; font-size: 13px; line-height: 1.4; }
        .soporte-banner .sb-text strong { font-weight: 700; color: #047857; }
        .soporte-banner .sb-arrow { color: #10b981; font-size: 14px; transition: transform 0.2s; }
        .soporte-banner:hover .sb-arrow { transform: translateX(4px); }

        @media (max-width: 768px) {
            .soporte-banner { padding: 10px 14px; gap: 10px; }
            .soporte-banner .sb-icon { width: 34px; height: 34px; font-size: 16px; }
            .soporte-banner .sb-text { font-size: 12px; }
        }

        /* ===== WIDE CARDS (estilo moderno sin tablas) ===== */
        .wide-card {
            background: var(--if-white);
            border: 1px solid var(--if-gray-200);
            border-radius: 14px;
            padding: 18px 20px;
            display: grid;
            grid-template-columns: 90px 1fr auto;
            gap: 16px;
            align-items: center;
            cursor: pointer;
            transition: box-shadow 0.22s ease, border-color 0.22s ease;
            position: relative;
            margin-bottom: 10px;
            box-shadow: var(--shadow-sm);
        }
        .wide-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0;
            width: 5px; height: 100%;
            border-radius: 14px 0 0 14px;
        }
        .wide-card.pend::before  { background: linear-gradient(180deg, var(--if-danger), #f87171); }
        .wide-card.cit::before   { background: linear-gradient(180deg, var(--if-info), #60a5fa); }
        .wide-card.fin::before   { background: linear-gradient(180deg, var(--if-success), #34d399); }
        .wide-card:hover { box-shadow: var(--shadow-md); border-color: var(--if-accent); }

        .wide-icon-box {
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            gap: 4px; border-radius: 10px;
            padding: 10px 8px;
            text-align: center;
            min-height: 60px;
        }
        .wide-icon-box.pend { background: var(--if-danger-light); color: var(--if-danger); }
        .wide-icon-box.cit  { background: var(--if-info-light);   color: var(--if-info); }
        .wide-icon-box.fin  { background: var(--if-success-light); color: var(--if-success); }
        .wide-icon-box i { font-size: 18px; }
        .wide-icon-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }
        .wide-icon-sub   { font-size: 11px; font-weight: 600; }

        .wide-main h3 { font-family: var(--font-titles); font-size: 15px; font-weight: 700; color: var(--if-gray-900); margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .wide-matr    { display: inline-flex; align-items: center; gap: 6px; background: var(--if-primary); color: #fff; padding: 3px 10px; border-radius: 6px; font-family: 'SF Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
        .wide-meta    { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
        .wide-meta-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--if-gray-600); background: var(--if-gray-100); padding: 3px 9px; border-radius: 20px; }
        .wide-meta-item i { font-size: 10px; color: var(--if-gray-400); }
        .wide-dias    { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; }
        .wide-dias.ok    { background: #f1f5f9; color: #64748b; }
        .wide-dias.warn  { background: #fef3c7; color: #f59e0b; }
        .wide-dias.alert { background: #fee2e2; color: #dc2626; }

        .wide-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }

        /* Miniaturas fotos en finalizados */
        .fin-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
        .fin-thumb  {
            width: 48px; height: 48px;
            border-radius: 6px;
            object-fit: cover;
            border: 1px solid var(--if-gray-200);
            cursor: pointer;
            transition: transform 0.15s;
            background: var(--if-gray-100);
        }
        .fin-thumb:hover { transform: scale(1.1); }
        .fin-thumb-more {
            width: 48px; height: 48px; border-radius: 6px;
            background: var(--if-gray-100); border: 1px solid var(--if-gray-200);
            display: flex; align-items: center; justify-content: center;
            font-size: 11px; font-weight: 700; color: var(--if-gray-500);
            cursor: pointer;
        }

        /* ===== ACTIONS MENU (3 puntos) ===== */
        .actions-menu { position: relative; display: inline-block; }
        .actions-menu-btn {
            width: 36px; height: 36px;
            border-radius: 8px;
            border: 1.5px solid var(--if-gray-200);
            background: #fff; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            color: var(--if-gray-500);
            transition: all 0.15s;
            font-size: 14px;
        }
        .actions-menu-btn:hover, .actions-menu-btn.open {
            border-color: var(--if-accent);
            color: var(--if-accent);
            background: var(--if-accent-light, #e0f2fe);
            transform: scale(1.08);
        }
        .actions-menu-list {
            position: fixed;
            background: #fff;
            border: 1px solid var(--if-gray-200);
            border-radius: 10px;
            box-shadow: 0 12px 40px rgba(0,0,0,0.16);
            min-width: 210px;
            display: none;
            z-index: 9999;
            overflow: hidden;
        }
        .actions-menu.open .actions-menu-list { display: block; }
        .actions-menu-item {
            display: flex !important;
            align-items: center; gap: 10px;
            padding: 11px 14px; cursor: pointer;
            font-size: 13px; color: #334155;
            border-bottom: 1px solid #e2e8f0;
            transition: background 0.12s;
            background: #fff; border-left: 0; border-right: 0; border-top: 0;
            width: 100%; text-align: left; font-family: inherit;
            text-decoration: none;
        }
        .actions-menu-item:last-child { border-bottom: 0; }
        .actions-menu-item:hover     { background: #f1f5f9 !important; color: var(--if-primary) !important; }
        .actions-menu-item i         { width: 16px; text-align: center; color: #64748b; }
        .actions-menu-item.danger    { color: #dc2626 !important; }
        .actions-menu-item.danger:hover { background: #fee2e2 !important; }
        .actions-menu-item.danger i  { color: #dc2626; }
        .actions-menu-item.success   { color: var(--if-success) !important; }
        .actions-menu-item.success:hover { background: var(--if-success-light) !important; }
        .actions-menu-item.success i { color: var(--if-success); }
        .actions-menu-item.warning   { color: #f59e0b !important; }
        .actions-menu-item.warning:hover { background: #fef3c7 !important; }
        .actions-menu-item.warning i { color: #f59e0b; }

        /* ===== TIMELINE CITADOS ===== */
        .timeline-wrap { display: flex; flex-direction: column; gap: 20px; }
        .timeline-day-header {
            display: flex; align-items: center; gap: 12px;
            margin-bottom: 10px;
        }
        .timeline-day-badge {
            padding: 5px 14px; border-radius: 20px;
            font-size: 12px; font-weight: 700;
            background: var(--if-gray-100); color: var(--if-gray-600);
            white-space: nowrap;
        }
        .timeline-day-badge.hoy     { background: var(--if-accent);  color: #fff; }
        .timeline-day-badge.manana  { background: var(--if-info);    color: #fff; }
        .timeline-day-badge.pasado  { background: #fee2e2; color: #dc2626; }
        .timeline-day-line { flex: 1; height: 1px; background: var(--if-gray-200); }
        .timeline-day-count { font-size: 12px; color: var(--if-gray-400); font-weight: 600; white-space: nowrap; }
        .timeline-cards { display: flex; flex-direction: column; gap: 8px; }

        /* v2.12.7: fondo pastel por grupo de día (hoy/mañana/pasada) en Citados */
        .timeline-day { border-radius: 14px; padding: 10px 10px 4px; transition: background 0.2s; }
        .timeline-day.hoy    { background: rgba(255,140,0,0.06); }
        .timeline-day.manana { background: rgba(59,130,246,0.06); }
        .timeline-day.pasado { background: rgba(220,38,38,0.06); }
        body.dark-mode .timeline-day.hoy    { background: rgba(255,140,0,0.10); }
        body.dark-mode .timeline-day.manana { background: rgba(59,130,246,0.10); }
        body.dark-mode .timeline-day.pasado { background: rgba(220,38,38,0.12); }

        /* ===== VEHICLE CARDS (dentro de pendientes por cliente) ===== */
        .veh-cards-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 0 4px; }
        .veh-card {
            background: var(--if-gray-50);
            border: 1px solid var(--if-gray-200);
            border-radius: 10px;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 14px;
            transition: background 0.15s;
            position: relative;
        }
        .veh-card:hover { background: #fff; box-shadow: var(--shadow-sm); }
        .veh-card-matr {
            background: var(--if-primary);
            color: #fff;
            padding: 4px 10px;
            border-radius: 6px;
            font-family: 'SF Mono', monospace;
            font-size: 12px; font-weight: 700;
            letter-spacing: 0.5px;
            white-space: nowrap;
            min-width: 80px;
            text-align: center;
        }
        .veh-card-info { flex: 1; min-width: 0; }
        .veh-card-info .veh-tipo    { font-size: 12px; color: var(--if-gray-600); }
        .veh-card-info .veh-prov    { font-size: 11px; color: var(--if-gray-400); }
        .veh-card-obs {
            display: flex; align-items: center; gap: 5px;
            font-size: 12px; color: var(--if-danger);
            background: var(--if-danger-light); padding: 3px 10px;
            border-radius: 20px; max-width: 180px; overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap;
        }
        .veh-card-actions { display: flex; gap: 6px; align-items: center; }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 768px) {
            .wide-card {
                grid-template-columns: 1fr auto !important;
                grid-template-rows: auto auto;
                padding: 14px 16px;
                gap: 8px;
            }
            .wide-icon-box { display: none; }
            .wide-main { grid-column: 1; }
            .wide-actions { grid-column: 2; grid-row: 1; align-self: start; }
            .wide-card.fin .fin-thumbs { grid-column: 1 / -1; }
            .veh-card { flex-wrap: wrap; }
            .veh-card-obs { max-width: 100%; }
            .timeline-day-badge { font-size: 11px; padding: 4px 10px; }
            #citadosTimelineContainer,
            #finalizadosCardsContainer,
            #facturasCardsContainer { padding: 10px 12px !important; }
            /* En facturas móvil: mostrar importe grande */
            #facturasCardsContainer .wide-main h3 { font-size: 13px; }
            #facturasCardsContainer .wide-meta-item { font-size: 15px; }
        }

        /* ===== STATS GRID 5 COLUMNAS (v14) ===== */
        .stats-grid.stats-grid-5 {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 16px;
        }
        @media (max-width: 1280px) {
            .stats-grid.stats-grid-5 { grid-template-columns: repeat(3, 1fr); }
        }
        @media (max-width: 768px) {
            .stats-grid.stats-grid-5 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
        }
        @media (max-width: 480px) {
            .stats-grid.stats-grid-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
        }

        /* ===== EN REVISIÓN (v14) ===== */
        .wide-card.rev { background: #fef9c3; border-color: #fde68a; }
        .wide-card.rev::before { background: linear-gradient(180deg, #f59e0b, #fbbf24); }
        .wide-card.rev .wide-icon-box { background: #fef3c7; color: #b45309; }
        .badge-revision {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 3px 10px; border-radius: 999px;
            background: #fff7ed; color: #c2410c;
            border: 1px solid #fdba74;
            font-size: 10px; font-weight: 800;
            letter-spacing: 0.5px; text-transform: uppercase;
        }
        .badge-revision i { font-size: 9px; }
        .stat-icon.revision { background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%); color: #d97706; }
        /* Mobile fallback: el rediseño v14 maneja la versión desktop */
        .nav-badge-revision { background: var(--if-accent); color: #fff; }
        .rev-motivo-box {
            margin-top: 8px;
            font-size: 12px;
            color: #78350f;
            background: #fef9c3;
            border-left: 3px solid #f59e0b;
            padding: 7px 12px;
            border-radius: 6px;
            line-height: 1.45;
        }
        .rev-motivo-box strong { color: #92400e; }

        /* ===== DETALLE MODAL — SECCIONES (v14) ===== */
        .detalle-section {
            margin-top: 20px;
            background: var(--if-gray-50);
            border: 1px solid var(--if-gray-200);
            border-radius: var(--radius);
            padding: 16px 18px;
        }
        .detalle-section:first-child { margin-top: 8px; }
        .detalle-section-head {
            display: flex; align-items: center; gap: 10px;
            margin-bottom: 14px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--if-gray-200);
        }
        .detalle-section-head i {
            width: 32px; height: 32px;
            border-radius: 8px;
            background: var(--if-accent-light);
            color: var(--if-accent);
            display: flex; align-items: center; justify-content: center;
            font-size: 14px;
            flex-shrink: 0;
        }
        .detalle-section-head h4 {
            font-family: var(--font-titles);
            font-size: 14px;
            font-weight: 700;
            color: var(--if-primary);
            margin: 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .detalle-section .form-grid { gap: 12px; }
        .detalle-section .form-group { margin: 0; }
        .detalle-section .form-input,
        .detalle-section .form-textarea { background: var(--if-white); }

        /* ===== FACTURA CARDS (v14 Movertis-style) ===== */
        .factura-card {
            background: var(--if-white);
            border: 1px solid var(--if-gray-200);
            border-radius: 14px;
            padding: 18px 20px 18px 22px;
            display: grid;
            grid-template-columns: minmax(160px, 1.2fr) minmax(0, 1.6fr) minmax(140px, 1fr) auto;
            gap: 18px;
            align-items: center;
            margin-bottom: 10px;
            box-shadow: var(--shadow-sm);
            position: relative;
            transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
            cursor: default;
        }
        .factura-card::before {
            content: ''; position: absolute;
            top: 0; left: 0; width: 5px; height: 100%;
            border-radius: 14px 0 0 14px;
        }
        .factura-card.pagada::before { background: linear-gradient(180deg, var(--if-success), #34d399); }
        .factura-card.pendiente::before { background: linear-gradient(180deg, #f59e0b, #fbbf24); }
        .factura-card:hover { box-shadow: var(--shadow-md); border-color: var(--if-accent); }
        .factura-numero {
            font-family: var(--font-titles);
            font-size: 19px; font-weight: 800;
            color: var(--if-primary);
            letter-spacing: -0.5px;
            line-height: 1.1;
            word-break: break-all;
        }
        .factura-fecha {
            margin-top: 4px;
            font-size: 12px;
            color: var(--if-gray-500);
            display: flex; align-items: center; gap: 6px;
        }
        .factura-fecha i { font-size: 10px; color: var(--if-gray-400); }
        .factura-partner {
            font-size: 14px; font-weight: 700;
            color: var(--if-gray-800);
            line-height: 1.3;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .factura-cliente {
            margin-top: 4px;
            font-size: 12px; color: var(--if-gray-500);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .factura-importe {
            font-family: var(--font-titles);
            font-size: 22px; font-weight: 800;
            color: var(--if-primary);
            text-align: right;
            line-height: 1;
        }
        .factura-importe small {
            display: block; margin-top: 4px;
            font-family: var(--font-body);
            font-size: 11px; font-weight: 500;
            color: var(--if-gray-400);
            letter-spacing: 0.5px;
        }
        .factura-badge {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 6px 12px; border-radius: 999px;
            font-size: 12px; font-weight: 700;
            text-transform: uppercase; letter-spacing: 0.4px;
            margin-top: 6px;
            transition: all 0.25s ease;
            border: 2px solid transparent;
        }
        .factura-badge.pagada   { background: var(--if-success-light); color: var(--if-success); }
        .factura-badge.pendiente{ background: #fef3c7; color: #92400e; }
        .factura-badge.editable {
            cursor: pointer;
            border: 2px solid currentColor;
        }
        .factura-badge.editable:hover {
            transform: scale(1.08);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            font-weight: 800;
        }
        .factura-badge.editable .fa-edit {
            margin-left: 4px;
            opacity: 0;
            transition: opacity 0.25s ease;
            font-size: 10px;
        }
        .factura-badge.editable:hover .fa-edit {
            opacity: 1;
        }
        .factura-actions { display: flex; align-items: center; }
        .factura-actions-visibles { gap: 6px; }
        .factura-actions-visibles .btn-icon { min-width: 38px; min-height: 38px; }
        .factura-load-more {
            grid-column: 1 / -1;
            text-align: center;
            padding: 14px;
            font-size: 13px; font-weight: 600;
            color: var(--if-accent);
            background: var(--if-white);
            border: 2px dashed var(--if-gray-200);
            border-radius: var(--radius);
            cursor: pointer;
            margin-top: 6px;
            transition: all 0.2s;
        }
        .factura-load-more:hover { border-color: var(--if-accent); background: var(--if-accent-light); }
        .factura-counter {
            font-size: 12px; color: var(--if-gray-500);
            padding: 8px 4px 12px;
        }
        @media (max-width: 768px) {
            .factura-card {
                grid-template-columns: 1fr auto;
                grid-template-areas:
                    "ident actions"
                    "main main"
                    "amount amount";
                padding: 14px 16px 14px 18px;
                gap: 10px;
            }
            .factura-ident { grid-area: ident; }
            .factura-main { grid-area: main; }
            .factura-amount { grid-area: amount; }
            .factura-actions { grid-area: actions; align-self: start; }
            .factura-importe { text-align: left; font-size: 26px; }
            .factura-badge { margin-top: 8px; }
        }

        /* ===== MAP POPUP — REDISEÑO (v14) ===== */
        .leaflet-popup-content-wrapper {
            padding: 0;
            border-radius: 14px;
            overflow: hidden;
        }
        .leaflet-popup-content { margin: 0 !important; min-width: 260px; }
        .mp-card { font-family: var(--font-body); }
        .mp-head {
            background: linear-gradient(135deg, var(--if-primary) 0%, var(--if-primary-light) 100%);
            padding: 12px 14px;
            display: flex; align-items: center; gap: 10px;
            color: #fff;
        }
        .mp-head-icon {
            width: 34px; height: 34px;
            background: rgba(255,255,255,0.15);
            border-radius: 8px;
            display: flex; align-items: center; justify-content: center;
            color: #fff; font-size: 14px;
            flex-shrink: 0;
        }
        .mp-head-text { flex: 1; min-width: 0; }
        .mp-head-title {
            font-family: var(--font-titles);
            font-size: 14px; font-weight: 700;
            color: #fff;
            margin: 0;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .mp-head-sub {
            font-size: 11px;
            color: rgba(255,255,255,0.75);
            margin-top: 2px;
        }
        .mp-body { padding: 12px 14px 6px; background: #fff; }
        .mp-row {
            display: flex; align-items: center; gap: 8px;
            padding: 5px 0;
            font-size: 12.5px;
            color: var(--if-gray-700);
        }
        .mp-row i {
            width: 16px; text-align: center;
            color: var(--if-gray-400);
            font-size: 11px;
            flex-shrink: 0;
        }
        .mp-row strong { color: var(--if-gray-800); font-weight: 600; }
        .mp-status {
            display: inline-block;
            padding: 3px 9px;
            border-radius: 999px;
            font-size: 10px; font-weight: 700;
            text-transform: uppercase; letter-spacing: 0.4px;
        }
        .mp-status.pendiente  { background: var(--if-danger-light); color: var(--if-danger); }
        .mp-status.citado     { background: var(--if-info-light); color: var(--if-info); }
        .mp-status.finalizado { background: var(--if-success-light); color: var(--if-success); }
        .mp-actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            padding: 10px 12px 12px;
            background: var(--if-gray-50);
            border-top: 1px solid var(--if-gray-100);
        }
        .mp-btn {
            display: inline-flex; align-items: center; justify-content: center;
            gap: 6px;
            padding: 8px 10px;
            border-radius: 8px;
            font-size: 11.5px; font-weight: 600;
            text-decoration: none; border: none; cursor: pointer;
            font-family: inherit;
            transition: filter 0.15s;
            white-space: nowrap;
        }
        .mp-btn:hover { filter: brightness(1.08); }
        .mp-btn.primary   { background: var(--if-accent); color: #fff; }
        .mp-btn.maps      { background: linear-gradient(135deg, #4285F4 0%, #34A853 100%); color: #fff; }
        .mp-btn.call      { background: var(--if-success); color: #fff; }
        .mp-btn.cite      { background: var(--if-primary); color: #fff; }
        .mp-btn.danger    { background: var(--if-danger); color: #fff; }
        .mp-btn.full      { grid-column: 1 / -1; }

        /* ===== USERS CARDS (v14 — sustituye tabla) ===== */
        .users-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 14px;
        }
        .user-card {
            background: var(--if-white);
            border: 1px solid var(--if-gray-200);
            border-radius: var(--radius);
            padding: 16px;
            display: flex; align-items: center; gap: 14px;
            transition: all 0.2s ease;
            box-shadow: var(--shadow-sm);
        }
        .user-card:hover { border-color: var(--if-accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
        .user-card-avatar {
            width: 48px; height: 48px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--if-primary) 0%, var(--if-primary-light) 100%);
            color: #fff;
            display: flex; align-items: center; justify-content: center;
            font-family: var(--font-titles);
            font-size: 18px; font-weight: 700;
            flex-shrink: 0;
            text-transform: uppercase;
            box-shadow: var(--shadow-sm);
        }
        .user-card-avatar.admin {
            background: linear-gradient(135deg, var(--if-accent) 0%, var(--if-accent-hover) 100%);
        }
        .user-card-info { flex: 1; min-width: 0; }
        .user-card-email {
            font-size: 14px; font-weight: 700;
            color: var(--if-gray-900);
            margin: 0 0 6px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .user-card-meta {
            display: flex; align-items: center; gap: 8px;
            flex-wrap: wrap;
            font-size: 11.5px;
            color: var(--if-gray-500);
        }
        .user-card-role {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 3px 9px;
            border-radius: 999px;
            font-size: 11px; font-weight: 700;
            text-transform: uppercase; letter-spacing: 0.4px;
        }
        .user-card-role.admin   { background: var(--if-accent-light); color: var(--if-accent); }
        .user-card-role.partner { background: var(--if-info-light); color: var(--if-info); }
        .user-card-status {
            display: inline-flex; align-items: center; gap: 6px;
            font-size: 11.5px; font-weight: 600;
            color: var(--if-gray-600);
        }
        .user-card-status .dot {
            width: 8px; height: 8px; border-radius: 50%;
            background: var(--if-gray-300);
            box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
        }
        .user-card-status.activo .dot {
            background: var(--if-success);
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
        }
        .user-card-partner {
            margin-top: 6px;
            font-size: 11.5px;
            color: var(--if-gray-500);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .user-card-partner i { color: var(--if-gray-400); }
        .users-cards-empty {
            grid-column: 1 / -1;
            text-align: center;
            padding: 40px;
            color: var(--if-gray-400);
        }

        /* ===== SIDEBAR — REDISEÑO v1.3 (solo desktop ≥769px) =====
           Spec estricto Linear/Notion/Vercel. Toda regla scopeada a desktop
           para no afectar el drawer móvil (≤768px lo gestiona components.css). */
        @media (min-width: 769px) {

            /* —— HEADER AZUL —— ocupa todo el ancho (incluye sobre la sidebar). Logo a la izquierda, acciones a la derecha. —— */
            /* (el grid lo coloca con grid-area: header / header — ver base.css) */

            /* —— HEADER de usuario (avatar+nombre+rol) —— oculto en desktop: la info de usuario va a la derecha del header azul */
            .sidebar-header { display: none !important; }

            /* —— NAV WRAPPER —— sin padding lateral, items van pegados; padding-top 16px porque ya no hay brand encima —— */
            .sidebar-nav { padding: 16px 0 8px; }

            /* —— SECCIONES —— sin títulos en MAYÚSCULAS; separador fino entre grupos (no antes del primero) —— */
            .nav-section { margin: 0; }
            .nav-section-title { display: none !important; }
            .nav-section + .nav-section::before {
                content: '';
                display: block;
                height: 1px;
                background: var(--if-gray-100);
                margin: 8px 12px;
            }

            /* —— ITEMS —— compactos, sin border-radius, full-width —— */
            .sidebar-nav .nav-item {
                display: flex;
                align-items: center;
                gap: 12px;
                padding: 8px 12px 8px 18px;
                margin: 0;
                border-radius: 0;
                border-left: 3px solid transparent;
                font-size: 13.5px;
                font-weight: 500;
                color: var(--if-gray-600);
                text-decoration: none;
                cursor: pointer;
                transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
            }
            .sidebar-nav .nav-item + .nav-item { margin-top: 0; }
            .sidebar-nav .nav-item span {
                flex: 1;
                min-width: 0;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            /* —— ICONO EN CUADRADITO 28×28 —— */
            .sidebar-nav .nav-item i {
                width: 28px; height: 28px;
                background: var(--if-gray-100);
                border-radius: 6px;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 13px;
                color: var(--if-gray-500);
                flex-shrink: 0;
                text-align: center;
                transition: background 0.12s ease, color 0.12s ease;
            }

            /* —— HOVER —— */
            .sidebar-nav .nav-item:hover {
                background: var(--if-gray-50);
                color: var(--if-gray-700);
                border-left-color: transparent;
            }
            .sidebar-nav .nav-item:hover i {
                background: var(--if-gray-200);
                color: var(--if-gray-600);
            }

            /* —— ACTIVO —— */
            .sidebar-nav .nav-item.active {
                background: var(--if-accent-light);
                border-left-color: var(--if-accent);
                color: var(--if-primary);
                font-weight: 600;
                border-radius: 0;
            }
            .sidebar-nav .nav-item.active i,
            .sidebar-nav .nav-item.active:hover i {
                background: var(--if-primary);
                color: #ffffff;
            }

            /* —— BADGES —— redondos, compactos, naranja sólido —— */
            .sidebar-nav .nav-badge {
                margin-left: auto;
                display: inline-block;
                box-sizing: border-box;
                background: var(--if-accent);
                color: #ffffff;
                font-size: 10px;
                font-weight: 700;
                line-height: 18px;
                padding: 0 5px;
                border-radius: 999px;
                min-width: 18px;
                height: 18px;
                text-align: center;
                box-shadow: none;
                letter-spacing: 0;
            }
            /* nav-badge-revision hereda el mismo estilo de nav-badge */
            .sidebar-nav .nav-item.active .nav-badge {
                background: var(--if-accent);
                color: #ffffff;
            }

            /* —— FOOTER —— minimal —— */
            .sidebar-footer {
                padding: 12px;
                border-top: 1px solid var(--if-gray-100);
                background: var(--if-white);
            }
            .sidebar-footer .version {
                font-size: 10px;
                color: var(--if-gray-300);
                text-align: center;
                margin: 0;
                font-weight: 500;
                letter-spacing: 0.2px;
            }
            .sidebar-footer .version:hover { color: var(--if-accent); text-decoration: underline; }
        }

        /* ══════════════════════════════════════════════════════════════
           REDISEÑO VISUAL v2.1 — pulido profesional global
           Capa aditiva: no se elimina ni renombra ningún selector existente.
           Colores corporativos intocables: navy #000051, naranja #FF8C00.
           ══════════════════════════════════════════════════════════════ */

        /* ---- Transición global suave en hovers / aperturas ---- */
        a, button, input, select, textarea,
        .nav-item, .btn, .action-btn, .actions-menu-btn, .modal,
        .stat-card, .card, .wide-card, .factura-card, .parte-card,
        .toast, .badge, .user-card {
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
                        box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
        }

        /* ---- LOGIN: fondo navy + formas geométricas decorativas en naranja ---- */
        .login-screen {
            position: fixed; inset: 0; overflow: hidden;
            background: radial-gradient(circle at 15% 20%, var(--if-primary-light) 0%, var(--if-primary) 55%, var(--if-primary-dark) 100%);
        }
        .login-shape {
            position: absolute;
            border-radius: 50%;
            background: var(--if-accent);
            opacity: 0.12;
            pointer-events: none;
            z-index: 0;
        }
        .login-shape-1 { width: 420px; height: 420px; top: -140px; right: -120px; border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; }
        .login-shape-2 { width: 260px; height: 260px; bottom: -100px; left: -80px; border-radius: 50% 50% 50% 0; opacity: 0.10; transform: rotate(15deg); }
        .login-shape-3 { width: 140px; height: 140px; top: 18%; left: 8%; border-radius: 30%; opacity: 0.08; transform: rotate(-20deg); }
        .login-container {
            position: relative; z-index: 1;
            backdrop-filter: blur(2px);
        }
        .login-logo img { height: 64px; margin-bottom: 14px; }
        .login-logo h1 { font-size: 26px; }

        /* ---- HEADER: avatar de usuario más elegante + badge de rol ---- */
        .user-avatar {
            font-family: var(--font-titles);
            text-transform: uppercase;
            box-shadow: 0 2px 8px rgba(255,140,0,0.45), 0 0 0 2px rgba(255,255,255,0.25);
        }
        .user-info-text { display: flex; flex-direction: column; line-height: 1.25; }
        .user-info-text #userName { font-weight: 600; font-size: 13px; }

        /* Badge de rol: estiliza el texto ya inyectado por core.js en #sidebarUserRole */
        .sidebar-user-role,
        #sidebarUserRole {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 10.5px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            padding: 2px 9px;
            border-radius: 999px;
            background: rgba(255,255,255,0.18);
            color: #fff;
            margin-top: 2px;
        }

        /* ---- STAT CARDS: animación de entrada escalonada ---- */
        @keyframes statCardIn {
            from { opacity: 0; transform: translateY(16px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .stats-grid .stat-card,
        .dashboard-stats .dashboard-stat {
            animation: statCardIn 0.45s ease both;
            animation-delay: calc(var(--stagger, 0) * 70ms);
        }
        .stat-card { will-change: transform; }
        .stat-icon { font-size: 22px; }

        /* ---- SIDEBAR: iconos más grandes, indicador de sección activa más claro ---- */
        @media (min-width: 769px) {
            .sidebar-nav .nav-item i { width: 30px; height: 30px; font-size: 14px; }
            .sidebar-nav .nav-item { padding: 9px 12px 9px 16px; }
            .sidebar-nav .nav-item.active { box-shadow: inset 0 0 0 9999px rgba(255,140,0,0.04); }
        }
        .sidebar-nav .nav-item { position: relative; }

        /* ---- HEADER con gradiente navy ya presente — refuerzo de profundidad ---- */
        .header {
            background: linear-gradient(120deg, var(--if-primary) 0%, var(--if-primary-light) 60%, #14146b 100%);
        }

        /* ---- BADGES de estado con colores vivos (facturas, wide-cards) ---- */
        .factura-badge.pagada { background: linear-gradient(135deg, var(--if-success-light), #d1fae5); }
        .factura-badge.pendiente { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
        .badge-pendiente, .badge-citado, .badge-finalizado, .badge-facturado, .badge-pagado {
            box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        }

        /* ---- MODALES: backdrop blur más marcado y entrada elegante ---- */
        .modal-overlay { backdrop-filter: blur(6px); }
        .modal { box-shadow: 0 25px 50px -10px rgba(0,0,51,0.35), var(--shadow-lg); }

        /* ---- MENÚ DE 3 PUNTOS: sombra y animación de apertura más vivas ---- */
        .actions-menu-list {
            opacity: 0;
            transform: translateY(-6px) scale(0.97);
            transition: opacity 0.18s ease, transform 0.18s ease;
            pointer-events: none;
        }
        .actions-menu.open .actions-menu-list {
            display: block;
            opacity: 1;
            transform: translateY(0) scale(1);
            pointer-events: auto;
            box-shadow: 0 16px 44px rgba(0,0,51,0.22);
        }

        /* ---- FILTROS / BUSCADOR: refuerzo del estilo pill ---- */
        .search-box input, .filter-select {
            border-width: 1.5px;
        }
        .search-box input:hover, .filter-select:hover {
            border-color: var(--if-accent);
        }

        /* ---- MINIATURAS DE FOTOS: zoom hover más fluido (galerías) ---- */
        .photo-item img, .detail-photo-item img, .fin-thumb {
            transition: transform 0.25s ease, filter 0.25s ease;
        }
        .photo-item:hover img, .detail-photo-item:hover img { transform: scale(1.08); }
        .fin-thumb:hover { transform: scale(1.15); box-shadow: 0 4px 10px rgba(0,0,0,0.25); z-index: 2; }

        /* ---- TOASTS: esquina inferior derecha, look más elegante ---- */
        .toast-container {
            top: auto;
            bottom: 24px;
            right: 24px;
            left: auto;
        }
        .toast {
            border-radius: var(--radius-lg);
            box-shadow: 0 14px 36px rgba(0,0,51,0.18);
            backdrop-filter: blur(6px);
            background: rgba(255,255,255,0.97);
        }
        .toast-icon { width: 32px; height: 32px; font-size: 14px; }
        @keyframes slideUpFade {
            from { transform: translateY(16px); opacity: 0; }
            to   { transform: translateY(0); opacity: 1; }
        }
        .toast { animation: slideUpFade 0.35s ease; }
        @media (max-width: 768px) {
            .toast-container { bottom: 16px; top: auto; right: 16px; left: 16px; }
        }

        /* ---- EMPTY STATES: icono + mensaje, capa visual añadida ---- */
        .empty-state {
            border-radius: var(--radius-lg);
            background: linear-gradient(135deg, var(--if-gray-50) 0%, #fff 100%);
            border: 1.5px dashed var(--if-gray-200);
        }
        .empty-state i {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 88px; height: 88px;
            border-radius: 50%;
            background: var(--if-white);
            box-shadow: var(--shadow-sm);
            color: var(--if-gray-300);
        }
        .users-cards-empty { border-radius: var(--radius-lg); background: var(--if-gray-50); border: 1.5px dashed var(--if-gray-200); }

        /* ---- WIDE-CARDS: leve refuerzo de tipografía y jerarquía visual ----
           NOTA: el hover NO usa `transform` — cualquier transform en un
           ancestro convierte los `position:fixed` descendientes (el menú de
           3 puntos) en relativos a ESE ancestro en vez del viewport, así que
           las coordenadas que calcula toggleActionsMenu() (pensadas para
           viewport) quedan mal y el menú "no se ve" (realmente se renderiza
           fuera de sitio). Por eso aquí solo se anima box-shadow/border. ---- */
        .wide-card { transition: box-shadow 0.2s ease, border-color 0.2s ease; }
        /* v2.12.8: el hover con `transform: scale()` de v2.12.7 rompía el menú de 3
           puntos — cualquier ancestro con `transform` crea un nuevo containing block
           para los descendientes `position:fixed`, así que el menú (fixed, calculado
           contra el viewport) se posicionaba relativo a la card transformada y
           aparecía cortado/escondido. Mismo bug que ya se había arreglado en v2.11.5
           para `.wide-card:hover`, reintroducido sin querer. Se quita `transform`,
           se deja solo la sombra. */
        .wide-card:hover, .veh-card:hover, .cliente-card:hover, .stock-card:hover,
        .esquema-card:hover, .producto-card:hover, .fc-row:hover, .user-card:hover {
            box-shadow: var(--shadow-md);
        }
        .partner-card-header:hover { background: var(--if-gray-50); }
        @keyframes badgeNotasPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(231,76,60,0.25); } 50% { box-shadow: 0 0 0 6px rgba(231,76,60,0.12); } }
        .badge-notas, .badge-notas-inline { animation: badgeNotasPulse 2s ease-in-out infinite; }
        .factura-card { transition: box-shadow 0.2s ease, border-color 0.2s ease; }

        /* ---- BOTONES: micro-interacción consistente ---- */
        .btn:active, .btn-icon:active, .action-btn:active, .actions-menu-btn:active { transform: scale(0.96); }

        /* ---- v2.3: tabs Finalizados/Facturados + sello visual "FACTURADO" ---- */
        .fin-tab-btn.active, .us-tab-btn.active { background: var(--if-primary); color: #fff; border-color: var(--if-primary); }
        .wide-card.wide-card-facturado-visual { position: relative; opacity: 0.7; }
        .factura-stamp {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-15deg);
            border: 3px solid var(--if-danger); color: var(--if-danger); font-weight: 800; font-size: 22px;
            letter-spacing: 2px; padding: 4px 18px; border-radius: 8px; background: rgba(255,255,255,0.85);
            pointer-events: none; z-index: 5; text-transform: uppercase;
        }

        /* ---- v2.4: grid de cards con foto grande (productos / esquemas) ---- */
        .producto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
        .producto-card {
            background: var(--if-white); border: 1.5px solid var(--if-gray-200); border-radius: var(--radius-lg);
            padding: 14px; cursor: pointer; text-align: center; transition: all 0.2s ease;
            display: flex; flex-direction: column; align-items: center; gap: 6px;
        }
        .producto-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--if-accent); }
        .producto-card-foto {
            width: 100%; height: 120px; border-radius: var(--radius); overflow: hidden; background: var(--if-accent-light);
            display: flex; align-items: center; justify-content: center; color: var(--if-accent); font-size: 36px;
        }
        .producto-card-foto img { width: 100%; height: 100%; object-fit: cover; }
        .producto-card-nombre { font-weight: 600; font-size: 14px; color: var(--if-gray-700); }
        .producto-card-total { font-family: var(--font-titles); font-size: 22px; font-weight: 800; color: var(--if-accent); }
        .producto-card-total-label { font-size: 11px; color: var(--if-gray-400); text-transform: uppercase; letter-spacing: 0.4px; margin-top: -6px; }

        /* ---- v2.10: grid de Stock — cards inline-editables, sin modal ---- */
        .stock-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
        @media (max-width: 1100px) { .stock-grid { grid-template-columns: repeat(3, 1fr); } }
        @media (max-width: 768px) { .stock-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
        .stock-card {
            background: var(--if-white); border: 1.5px solid var(--if-gray-200); border-radius: var(--radius-lg);
            padding: 14px; text-align: center; transition: box-shadow 0.2s ease;
            display: flex; flex-direction: column; align-items: center; gap: 8px;
        }
        .stock-card:hover { box-shadow: var(--shadow-md); }
        .stock-card-foto {
            width: 200px; height: 200px; max-width: 100%; border-radius: var(--radius); overflow: hidden;
            background: var(--if-accent-light); display: flex; align-items: center; justify-content: center;
            color: var(--if-accent); font-size: 44px;
        }
        .stock-card-foto img { width: 100%; height: 100%; object-fit: cover; }
        .stock-card-nombre { font-weight: 700; font-size: 14px; color: var(--if-gray-700); }
        .stock-card-meta { font-size: 11px; color: var(--if-gray-500); }
        .stock-card-cantidad { font-family: var(--font-titles); font-size: 48px; font-weight: 800; color: var(--if-accent); line-height: 1; }
        .stock-card-actions { display: flex; gap: 6px; width: 100%; align-items: center; }
        .stock-card-actions input[type="number"] { width: 100%; min-width: 0; text-align: center; padding: 8px 6px; font-size: 13px; }
        .stock-card-actions .btn-icon { flex-shrink: 0; min-height: 38px; min-width: 38px; }

        /* ---- v2.14: fila moderna de factura — reemplaza la card de v2.11.1
           (encabezado oscuro + menú de 3 puntos escondido) por una fila compacta
           tipo tabla con toda la info de un vistazo y las acciones siempre
           visibles (sin menú). Colores de marca: navy #000051 + naranja #FF8C00
           en el icono del número de factura. Solo desktop — la vista móvil sigue
           usando .factura-card-v2 antiguo vía @media, ver más abajo. ---- */
        .factura-row {
            display: flex; align-items: center; gap: 14px; padding: 16px 18px;
            background: var(--if-white); border: 1px solid var(--if-gray-200); border-radius: 14px;
            margin-bottom: 12px; transition: box-shadow 0.2s ease, transform 0.15s ease;
        }
        .factura-row:hover { box-shadow: var(--shadow-md); }
        .factura-row-numero {
            width: 46px; height: 46px; border-radius: 10px; background: var(--if-primary); color: var(--if-accent);
            display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
            flex-shrink: 0; font-family: var(--font-titles);
        }
        .factura-row-info { flex: 1; min-width: 0; }
        .factura-row-titulo { font-weight: 700; font-size: 14px; color: var(--if-gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .factura-row-sub { font-size: 12px; color: var(--if-gray-400); margin-top: 2px; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .factura-row-importe { font-size: 20px; font-weight: 700; color: var(--if-primary); text-align: right; flex-shrink: 0; min-width: 90px; }
        body.dark-mode .factura-row-importe { color: var(--if-accent); }
        .factura-row-badges { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; max-width: 160px; }
        .factura-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
        .factura-row-actions .btn-icon {
            width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--if-gray-200); background: var(--if-white);
            display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s;
        }
        .factura-row-actions .btn-icon:hover { border-color: var(--if-accent); background: var(--if-accent-light); }
        .factura-row-actions .btn-icon.ver     { color: var(--if-info); }
        .factura-row-actions .btn-icon.editar  { color: var(--if-accent); }
        .factura-row-actions .btn-icon.drive   { color: #0f9d58; }
        .factura-row-actions .btn-icon.borrar  { color: var(--if-danger); }
        .factura-row-actions .btn-icon.borrar:hover { border-color: var(--if-danger); background: var(--if-danger-light); }
        @media (max-width: 900px) {
            .factura-row { flex-wrap: wrap; }
            .factura-row-badges { max-width: none; }
        }
        /* v2.14: en móvil se mantiene el comportamiento previo (apilado en columna,
           sin tocar el resto de reglas .mobile-* ya existentes en este archivo). */
        @media (max-width: 768px) {
            .factura-row { flex-direction: column; align-items: stretch; }
            .factura-row-numero { align-self: flex-start; }
            .factura-row-importe { text-align: left; font-size: 22px; }
            .factura-row-badges { justify-content: flex-start; max-width: none; }
            .factura-row-actions { justify-content: flex-end; }
        }

        /* ---- v2.16: asistente paso a paso "Generar Factura" — indicador 1-2-3 con
           los colores de marca (navy #000051 + naranja #FF8C00). Solo desktop en el
           sentido de que no se ha tocado ningún @media existente; el modal sigue
           usando el mismo comportamiento responsive genérico de siempre. ---- */
        .factura-wizard-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
        .factura-wizard-step { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
        .factura-wizard-step-num {
            width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
            background: var(--if-gray-100); color: var(--if-gray-400); font-weight: 700; font-size: 13px; transition: all 0.2s;
        }
        .factura-wizard-step-label { font-size: 12px; font-weight: 600; color: var(--if-gray-400); white-space: nowrap; transition: color 0.2s; }
        .factura-wizard-step.active .factura-wizard-step-num { background: var(--if-primary); color: var(--if-accent); }
        .factura-wizard-step.active .factura-wizard-step-label { color: var(--if-primary); }
        body.dark-mode .factura-wizard-step.active .factura-wizard-step-label { color: var(--if-accent); }
        .factura-wizard-step.done .factura-wizard-step-num { background: var(--if-accent); color: var(--if-primary); }
        .factura-wizard-step.done .factura-wizard-step-label { color: var(--if-gray-600); }
        .factura-wizard-step-line { flex: 1; height: 2px; background: var(--if-gray-200); min-width: 20px; }
        .factura-wizard-pane { display: none; }
        .factura-wizard-pane.active { display: block; }

        .factura-checklist { border: 1px solid var(--if-gray-200); border-radius: var(--radius-sm); max-height: 340px; overflow-y: auto; padding: 8px; }
        .factura-checklist-header {
            display: flex; gap: 10px; padding: 4px 6px; font-size: 11px; color: var(--if-gray-400);
            text-transform: uppercase; font-weight: 600; border-bottom: 1px solid var(--if-gray-200);
        }
        .factura-checklist-row {
            display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--if-gray-100);
        }
        .factura-checklist-row:last-child { border-bottom: none; }
        .factura-lineas-editor .factura-checklist-row { border-bottom: 1px solid var(--if-gray-100); }
        .factura-preview-header { display: flex; align-items: center; gap: 14px; }

        /* ---- v2.11.1: badges de alerta (atrasado / vencido) ---- */
        .badge-alerta { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-top: 4px; cursor: default; }
        .badge-alerta.atrasado { background: var(--if-danger-light); color: var(--if-danger); }
        .badge-alerta.vencido { background: var(--if-accent-light); color: var(--if-accent-hover); }

        /* v2.24: estado de la confirmación de cita por email (mismo idioma visual que atrasado/vencido) */
        .badge-alerta.email-sin-enviar { background: var(--if-gray-100); color: var(--if-gray-400); }
        .badge-alerta.email-enviado { background: var(--if-info-light); color: var(--if-info); }
        .badge-alerta.email-confirmada { background: var(--if-success-light); color: var(--if-success); }
        .badge-alerta.email-cancelada { background: var(--if-danger-light); color: var(--if-danger); }

        /* v2.26: selección múltiple en Pendientes */
        .veh-card-select { margin-right: 4px; }
        .veh-card-select input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--if-accent); }
        .pend-acciones-bar {
            position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
            background: var(--if-primary); color: #fff; border-radius: 999px;
            padding: 12px 20px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
            display: flex; align-items: center; gap: 16px; z-index: 200;
            font-size: 13px; font-weight: 700;
        }
        .pend-acciones-botones { display: flex; align-items: center; gap: 8px; }
        .pend-acciones-botones .btn { font-size: 12px; padding: 8px 14px; }
        @media (max-width: 768px) {
            .pend-acciones-bar { left: 12px; right: 12px; transform: none; bottom: 12px; flex-direction: column; align-items: stretch; gap: 10px; border-radius: 14px; }
            .pend-acciones-botones { flex-wrap: wrap; justify-content: center; }
        }

        /* ---- v2.11: timeline de actividad de un parte (en el modal de detalle) ---- */
        .timeline { position: relative; padding-left: 24px; }
        .timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--if-gray-200); }
        .timeline-item { position: relative; padding-bottom: 18px; }
        .timeline-item:last-child { padding-bottom: 0; }
        .timeline-dot {
            position: absolute; left: -24px; top: 0; width: 20px; height: 20px; border-radius: 50%;
            color: white; display: flex; align-items: center; justify-content: center; font-size: 10px; box-shadow: 0 0 0 3px var(--if-white);
        }
        .timeline-titulo { font-size: 13px; font-weight: 600; color: var(--if-gray-800); text-transform: capitalize; }
        .timeline-sub { font-size: 12px; color: var(--if-gray-500); margin-top: 2px; }
        .timeline-fecha { font-size: 11px; color: var(--if-gray-400); margin-top: 2px; }

        /* ---- v2.11: stepper de estado (Pendiente -> Citado -> Finalizado -> Facturado) ---- */
        .estado-stepper { display: flex; align-items: center; gap: 4px; }
        .estado-stepper .step { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--if-gray-400); }
        .estado-stepper .step.activo { color: var(--if-gray-800); }
        .estado-stepper .step-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--if-gray-300); flex-shrink: 0; }
        .estado-stepper .step.pendiente.activo .step-dot { background: var(--if-gray-400); }
        .estado-stepper .step.citado.activo .step-dot { background: var(--if-accent); }
        .estado-stepper .step.finalizado.activo .step-dot { background: var(--if-success); }
        .estado-stepper .step.facturado.activo .step-dot { background: var(--if-info); }
        .estado-stepper .step-line { width: 18px; height: 2px; background: var(--if-gray-200); }

        /* ---- v2.11.5: Historial de un parte se abre ENCIMA del modal de detalle
           (ambos son .modal-overlay con z-index 1000 — si los dos están "active"
           a la vez, el último en el DOM pintaba por delante). Notas ya no es un
           modal aparte desde v2.12 (vive siempre visible dentro del detalle). ---- */
        #modalHistorialParte { z-index: 2000; }
        /* v2.12.6: modalConfirmar (borrar nota) debe aparecer encima del modalDetalle */
        #modalConfirmar { z-index: 3000; }
        /* v2.30.6: modalConfirmarBorrarParte debe estar visible encima del mapa (z-index 1000 en overlay) */
        #modalConfirmarBorrarParte { z-index: 10001; }

        /* ---- v2.12: badge de notas en la esquina de una card ---- */
        .badge-notas {
            position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%;
            background: var(--if-danger); box-shadow: 0 0 0 3px rgba(231,76,60,0.25); cursor: pointer; z-index: 2;
        }
        .badge-notas i { display: none; }
        .badge-notas-inline { position: static; display: inline-block; margin-left: 6px; vertical-align: middle; box-shadow: 0 0 0 2px rgba(231,76,60,0.2); }

        /* ---- v2.12.4: Facturas Compras — fila tipo lista (miniatura | nombre | fecha | acciones) ---- */
        .fc-row {
            display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px;
            background: var(--if-white); border: 1px solid var(--if-gray-200); margin-bottom: 8px; cursor: pointer;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: box-shadow 0.2s ease;
        }
        .fc-row:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
        .fc-row .fc-checkbox { width: 18px; height: 18px; flex-shrink: 0; }
        .fc-thumb {
            width: 44px; height: 44px; border-radius: 8px; background: var(--if-danger-light); color: var(--if-danger);
            display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
        }
        .fc-info { flex: 1; min-width: 0; }
        .fc-nombre { font-size: 14px; font-weight: 600; color: var(--if-gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .fc-proveedor { font-size: 11px; color: var(--if-gray-400); font-weight: 600; }
        .fc-fecha { font-size: 12px; color: var(--if-gray-500); white-space: nowrap; flex-shrink: 0; }
        .fc-actions { display: flex; gap: 6px; flex-shrink: 0; }
        .fc-select-bar { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }

        /* ---- v2.11.1: buscador grande inline en el Dashboard ---- */
        .dash-search-input { display: flex; align-items: center; gap: 12px; color: var(--if-gray-400); }
        .dash-search-input input { flex: 1; border: none; outline: none; font-size: 16px; background: none; color: var(--if-gray-800); padding: 6px 0; }
        #dashBuscadorResultados { margin-top: 10px; max-height: 320px; overflow-y: auto; }
        #dashBuscadorResultados .search-result-item { border-radius: var(--radius); border-bottom: none; margin-bottom: 4px; }
        @media (max-width: 768px) { .dash-search-card { padding: 14px 16px; } }

        /* ---- v2.11/v2.12.8: buscador general del header — se agranda y se hace más
           visible (antes pasaba desapercibido junto al resto de botones del header). ---- */
        .header-search-btn {
            display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.16); border: 1.5px solid rgba(255,255,255,0.35);
            color: #fff; border-radius: 50px; padding: 11px 20px; cursor: pointer; font-size: 14px; font-weight: 600; min-height: 44px;
            min-width: 220px; transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
        }
        .header-search-btn i { font-size: 15px; }
        .header-search-btn span { flex: 1; text-align: left; opacity: 0.95; }
        .header-search-btn:hover { background: rgba(255,255,255,0.26); border-color: rgba(255,255,255,0.55); box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
        .header-search-btn kbd { background: rgba(255,255,255,0.2); border-radius: 5px; padding: 3px 8px; font-size: 12px; font-family: inherit; font-weight: 700; }
        @media (max-width: 768px) { .header-search-btn { min-width: 0; } .header-search-btn span, .header-search-btn kbd { display: none; } }
        .search-modal-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: none;
            align-items: flex-start; justify-content: center; padding-top: 10vh;
        }
        .search-modal-overlay.active { display: flex; }
        .search-modal { background: var(--if-white); border-radius: var(--radius-lg); width: 100%; max-width: 600px; max-height: 70vh; box-shadow: var(--shadow-lg); overflow: hidden; margin: 0 16px; display: flex; flex-direction: column; }
        .search-modal-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1.5px solid var(--if-gray-200); color: var(--if-gray-400); }
        .search-modal-input input { flex: 1; border: none; outline: none; font-size: 16px; background: none; color: var(--if-gray-800); }
        .search-modal-input kbd { background: var(--if-gray-100); border-radius: 4px; padding: 2px 8px; font-size: 11px; color: var(--if-gray-500); }
        .search-modal-results { overflow-y: auto; max-height: calc(70vh - 60px); }
        .search-result-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; cursor: pointer; border-bottom: 1px solid var(--if-gray-100); }
        .search-result-item:hover { background: var(--if-gray-50); }
        .search-result-item i { color: var(--if-accent); width: 20px; text-align: center; }
        .search-result-titulo { font-size: 14px; font-weight: 600; color: var(--if-gray-800); }
        .search-result-sub { font-size: 12px; color: var(--if-gray-500); }

        /* ---- v2.11: sidebar — grupos contraíbles (Partes/Facturación/Administración) ---- */
        .nav-group-header {
            width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 20px;
            background: none; border: none; color: var(--if-gray-700); font-size: 14px; font-weight: 600;
            cursor: pointer; text-align: left; min-height: 44px;
        }
        .nav-group-header:hover { background: var(--if-gray-50); color: var(--if-primary); }
        .nav-group-header i:first-child { width: 24px; text-align: center; font-size: 18px; color: var(--if-gray-500); }
        .nav-group-header span { flex: 1; }
        .nav-group-caret { font-size: 12px; transition: transform 0.2s ease; }
        .nav-group.collapsed .nav-group-caret { transform: rotate(-90deg); }
        .nav-group-body { max-height: 600px; overflow: hidden; transition: max-height 0.25s ease; }
        .nav-group.collapsed .nav-group-body { max-height: 0; }
        .nav-group-body .nav-item { padding-left: 34px; }

        /* ---- v2.11: Ajustes — pestañas + toggle switch ---- */
        .ajustes-tabs { display: flex; border-bottom: 1.5px solid var(--if-gray-200); overflow-x: auto; }
        .ajustes-tab {
            background: none; border: none; padding: 16px 22px; font-size: 14px; font-weight: 600;
            color: var(--if-gray-500); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px;
        }
        .ajustes-tab:hover { color: var(--if-primary); }
        .ajustes-tab.active { color: var(--if-accent); border-bottom-color: var(--if-accent); }
        .ajustes-pane { display: none; }
        .ajustes-pane.active { display: block; }
        .switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
        .switch input { opacity: 0; width: 0; height: 0; }
        .switch-slider { position: absolute; inset: 0; background: var(--if-gray-300); border-radius: 999px; cursor: pointer; transition: 0.2s; }
        .switch-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: 0.2s; }
        .switch input:checked + .switch-slider { background: var(--if-accent); }
        .switch input:checked + .switch-slider::before { transform: translateX(20px); }

        /* ---- v2.7.2: miniaturas grandes 200x200 en Esquemas (imagen real o thumbnail de PDF) ---- */
        #esquemasCardsContainer.producto-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
        #esquemasCardsContainer .producto-card-foto {
            height: 200px; width: 200px; margin: 0 auto;
        }
        #esquemasCardsContainer .producto-card-foto img,
        #esquemasCardsContainer .producto-card-foto canvas { width: 100%; height: 100%; object-fit: cover; }
        .esquema-pdf-placeholder {
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
            width: 100%; height: 100%; padding: 10px; color: var(--if-danger);
        }
        .esquema-pdf-placeholder i { font-size: 40px; }
        .esquema-pdf-placeholder span {
            font-size: 11px; color: var(--if-gray-500); font-weight: 600; text-align: center;
            overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
        }

        /* ---- v2.11.1: TABLET (768-1024px) — sidebar más estrecho, grids a 2 col ---- */
        @media (min-width: 769px) and (max-width: 1024px) {
            .app-container.active { grid-template-columns: 200px 1fr; }
            .producto-grid, .stock-grid, .dashboard-stats, .stats-grid-5 { grid-template-columns: repeat(2, 1fr) !important; }
        }

        /* ---- MÓVIL: tarjetas más compactas y usables ---- */
        @media (max-width: 768px) {
            .mobile-card-item { border-radius: var(--radius); padding: 12px; }
            .mobile-card-matr { font-size: 13px; padding: 3px 8px; }
            .stat-card { gap: 10px; }
            .stat-icon { width: 38px; height: 38px; font-size: 16px; }
            .stat-info h3 { font-size: 17px; }
            .toast { padding: 12px 14px; }
            .wide-card, .factura-card { border-radius: 12px; }
            .modal { width: 100%; max-width: 100%; margin: 0; border-radius: 0; max-height: 100vh; height: 100vh; }
            .modal-overlay.active { padding: 0; align-items: stretch; }
            .modal-footer .btn, .modal-header .modal-close, .btn-icon, .nav-item { min-height: 44px; }
            .toast-container { left: 5vw; right: 5vw; width: 90vw; }
            .toast { min-width: 0; width: 100%; }
            .data-table { display: block; overflow-x: auto; white-space: nowrap; }
            .actions-menu-list { max-width: 90vw; }
            .dash-paneles-row, .charts-row-main { grid-template-columns: 1fr !important; }
            /* v2.11.6: filas de "Generar factura" tienen anchos fijos (140/110/90px)
               que no encajan en pantallas estrechas — se deja scroll horizontal en
               vez de que se vea roto/solapado. */
            #facturaPartesContainer { overflow-x: auto; }
            #facturaPartesContainer > div { min-width: 480px; }
        }

        /* ---- Toast: animación de salida (v2.9) ---- */
        .toast.toast-out { animation: slideOutRight 0.35s ease forwards; }
        @keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(110%); opacity: 0; } }

        /* ---- Dark mode (v2.9): overrides de variables, mismo naranja/azul de marca ---- */
        body.dark-mode {
            --if-white: #1a1d2b; --if-gray-50: #20243a; --if-gray-100: #262b42; --if-gray-200: #343a56;
            --if-gray-300: #4a5072; --if-gray-400: #6b7299; --if-gray-500: #9aa0c4; --if-gray-600: #c3c7e0;
            --if-gray-700: #d8dbef; --if-gray-800: #eceef8; --if-gray-900: #ffffff;
        }
        body.dark-mode { background: linear-gradient(135deg, #14172a 0%, #1a1d2b 100%); color: var(--if-gray-800); }
        body.dark-mode .modal, body.dark-mode .stat-card, body.dark-mode .wide-card,
        body.dark-mode .factura-card, body.dark-mode .producto-card, body.dark-mode .esquema-card,
        body.dark-mode .partner-card, body.dark-mode .toast, body.dark-mode .admin-card,
        body.dark-mode .data-table { background: var(--if-white); border-color: var(--if-gray-200); }
        body.dark-mode .form-input, body.dark-mode .form-select, body.dark-mode .form-textarea {
            background: var(--if-gray-50); color: var(--if-gray-800); border-color: var(--if-gray-300);
        }
        body.dark-mode .actions-menu-list { background: var(--if-white); border-color: var(--if-gray-200); }
        .dark-mode-toggle { background: none; border: none; color: var(--if-white); font-size: 18px; cursor: pointer; padding: 8px; border-radius: 8px; transition: background 0.2s; }
        .dark-mode-toggle:hover { background: rgba(255,255,255,0.12); }

        /* ---- v2.12.7: dark mode completo — cubre elementos que usaban colores fijos
           (#fff/white) en vez de las variables --if-white/--if-gray-* que ya cambian
           de valor en dark mode. ---- */
        body.dark-mode .partner-resumen-card, body.dark-mode .btn-export,
        body.dark-mode .detalle-accion-btn, body.dark-mode .mobile-card-item,
        body.dark-mode .veh-card, body.dark-mode .veh-card:hover,
        body.dark-mode .mp-body, body.dark-mode .cliente-card,
        body.dark-mode .modal-overlay, body.dark-mode #modalConfirmar .modal,
        body.dark-mode #modalHistorialParte .modal {
            background: var(--if-white); color: var(--if-gray-800);
        }
        body.dark-mode .modal-overlay { background: rgba(0,0,0,0.75); }
        body.dark-mode .timeline-day-badge.pasado { background: #4a1d24; color: #fca5a5; }
        body.dark-mode .switch-slider { background: var(--if-gray-300); }
        body.dark-mode .switch-slider::before { background: var(--if-gray-800); }
        body.dark-mode .badge-notas, body.dark-mode .badge-notas-inline { box-shadow: 0 0 0 3px rgba(231,76,60,0.35); }
        body.dark-mode .actions-menu-item:hover { background: var(--if-gray-100); }
        body.dark-mode .stock-card, body.dark-mode .producto-card-foto,
        body.dark-mode .esquema-card, body.dark-mode .user-card,
        body.dark-mode .fc-row, body.dark-mode .ajustes-pane {
            background: var(--if-white); color: var(--if-gray-800);
        }
        body.dark-mode ::placeholder { color: var(--if-gray-400); }

        /* ═════════ MAP POPUP v2.30.1 ═════════ */
        .mp-card-v2 { font-family: var(--font-body); background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
        .mp-v2-head { background: var(--if-primary); padding: 14px; display: flex; align-items: center; gap: 12px; }
        .mp-v2-icon { width: 44px; height: 44px; border-radius: 50%; background: #FF8C00; color: white; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
        .mp-v2-head-text { flex: 1; min-width: 0; color: white; }
        .mp-v2-title { font-size: 15px; font-weight: 700; margin: 0; color: white; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .mp-v2-partner { font-size: 12px; color: rgba(255,255,255,0.8); margin-top: 2px; }
        .mp-v2-body { padding: 12px 14px; background: white; }
        .mp-v2-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 12px; color: var(--if-gray-700); }
        .mp-v2-row i { width: 16px; text-align: center; color: var(--if-gray-400); flex-shrink: 0; margin-top: 2px; }
        .mp-v2-status { display: flex; gap: 8px; }
        .mp-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
        .mp-badge.pendiente { background: var(--if-danger-light); color: var(--if-danger); }
        .mp-badge.citado { background: var(--if-info-light); color: var(--if-info); }
        .mp-badge.finalizado { background: var(--if-success-light); color: var(--if-success); }
        .mp-v2-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 12px 10px; border-top: 1px solid var(--if-gray-100); }
        .mp-btn-v2 { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; border: none; cursor: pointer; text-decoration: none; font-family: inherit; transition: all 0.2s; white-space: nowrap; color: white !important; }
        .mp-btn-v2:hover { filter: brightness(0.92); transform: translateY(-1px); }
        .mp-btn-v2 i { color: white !important; }
        .mp-btn-v2.maps { background: linear-gradient(135deg, #4285F4 0%, #34A853 100%); color: white !important; }
        .mp-btn-v2.ver { background: var(--if-accent); color: white !important; }
        .mp-btn-v2.call { background: var(--if-success); color: white !important; }
        .mp-btn-v2.cite { background: var(--if-primary); color: white !important; }
        .mp-btn-v2-delete { width: 100%; padding: 9px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; border: 1.5px solid var(--if-danger-light); background: var(--if-danger-light); color: var(--if-danger); cursor: pointer; font-family: inherit; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 5px; }
        .mp-btn-v2-delete i { color: var(--if-danger) !important; }
        .mp-btn-v2-delete:hover { background: var(--if-danger); color: white !important; border-color: var(--if-danger); }
        .mp-btn-v2-delete:hover i { color: white !important; }
        .leaflet-popup-content { margin: 0 !important; min-width: 280px; }
        .mp-popup-v2 .leaflet-popup-content-wrapper { border-radius: 8px; padding: 0 !important; }

        /* ═════════ LEAFLET MARKER CLUSTER (removed v2.30.1) ═════════ */
        /* Marker cluster styles removed in v2.30.1 - no clustering, individual pins only */
