/* ============================================================
   KleverList Enterprise ERP — Industrial Design System v4.0
   Arquitectura de Frontend Optimizada y Dimensionada
   Inspirado en SAP S/4HANA Fiori, Oracle NetSuite y Linear
   ============================================================ */

/* ── 1. TOKENS DE DISEÑO & PALETA OBSIDIANA / DEEP SLATE ── */
:root {
  /* Fondos y Superficies de Alta Profundidad */
  --bg-base: #080b11;
  --bg-surface: #0e1422;
  --bg-elevated: #131b2e;
  --bg-card: #152037;
  --bg-card-hover: #1b2846;
  --bg-hover: rgba(255, 255, 255, 0.045);

  /* Sistema de Bordes y Líneas Capilares */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(99, 102, 241, 0.35);
  --border-focus: #6366f1;
  --border-color: rgba(255, 255, 255, 0.08);

  /* Identidad & Acentos Industriales */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.28);
  --primary-dim: rgba(99, 102, 241, 0.12);
  --accent-primary: #6366f1;

  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;
  --accent-violet: #8b5cf6;

  /* Jerarquía Tipográfica */
  --text-heading: #f8fafc;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Dimensionamiento Estándar ERP */
  --sidebar-width: 250px;
  --sidebar-collapsed: 68px;
  --topbar-height: 54px;
  --row-height: 38px;
  --input-height: 36px;
  --input-height-sm: 30px;
  --btn-height: 34px;
  --btn-height-sm: 28px;

  /* Geometría Precisa */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Sombras y Luces */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 32px rgba(99, 102, 241, 0.2);

  /* Transiciones Suaves */
  --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── MODO CLARO / DIURNO (ERGONÓMICO / SOFT SLATE PARA DESCANSO VISUAL) ── */
[data-theme="light"] {
  /* Fondos y Superficies Suaves (Evita reflejos agresivos y deslumbramiento) */
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-hover: rgba(0, 0, 0, 0.04);

  /* Sistema de Bordes y Separadores */
  --border: #e2e8f0;
  --border-strong: rgba(99, 102, 241, 0.45);
  --border-focus: #4f46e5;
  --border-color: #cbd5e1;

  /* Identidad & Acentos Industriales con Contraste Ergonómico */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #6366f1;
  --primary-glow: rgba(79, 70, 229, 0.18);
  --primary-dim: rgba(79, 70, 229, 0.08);
  --accent-primary: #4f46e5;

  --accent-green: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-cyan: #0891b2;
  --accent-violet: #7c3aed;

  /* Jerarquía Tipográfica de Alto Contraste para Lectura Cómoda */
  --text-heading: #0f172a;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;

  /* Sombras Precisas */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 24px rgba(79, 70, 229, 0.12);
}

/* ── OVERRIDES ESPECÍFICOS MODO CLARO ── */
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
}

[data-theme="light"] .sidebar-header {
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .sidebar-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

[data-theme="light"] .nav-item {
  color: #475569;
}

[data-theme="light"] .nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .nav-item.active {
  background: rgba(79, 70, 229, 0.09);
  color: #4f46e5;
  border-left-color: #4f46e5;
}

[data-theme="light"] .nav-section-label {
  color: #94a3b8;
}

[data-theme="light"] .topbar-search-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #64748b;
}

[data-theme="light"] .topbar-search-btn:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  color: #0f172a;
}

[data-theme="light"] .topbar-search-text kbd {
  background: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .form-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .form-input:focus {
  background: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

[data-theme="light"] .data-table thead th {
  background: #f8fafc;
  color: #475569;
  border-bottom-color: #cbd5e1;
}

[data-theme="light"] .data-table tbody td {
  border-bottom-color: #f1f5f9;
}

[data-theme="light"] .data-table tbody tr:hover {
  background: #f8fafc;
}

[data-theme="light"] .card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .card-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .stat-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .stat-trend.flat {
  background: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .modal-overlay,
[data-theme="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .modal {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .modal-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .modal-footer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

[data-theme="light"] .modal-close {
  background: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .modal-close:hover {
  background: var(--accent-rose);
  color: #ffffff;
}

[data-theme="light"] .kanban-column {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .kanban-col-header {
  background: #ffffff;
}

[data-theme="light"] .kanban-col-count {
  background: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .sidebar-nav {
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
}
[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .kanban-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .kanban-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tabs {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

[data-theme="light"] .tab {
  color: #64748b;
}

[data-theme="light"] .tab:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .tab.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tab-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b !important;
}

[data-theme="light"] .tab-btn:hover {
  background: #e2e8f0;
  color: #0f172a !important;
  border-color: #94a3b8;
}

[data-theme="light"] .tab-btn.active {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border-color: #4338ca;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}


[data-theme="light"] .btn-outline {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-outline:hover {
  background: #f8fafc;
  border-color: #4f46e5;
  color: #4f46e5;
}

[data-theme="light"] .btn-icon {
  color: #475569;
}

[data-theme="light"] .btn-icon:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .topbar-user-badge {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .topbar-user-badge:hover {
  background: #f1f5f9;
  border-color: #6366f1;
}

[data-theme="light"] .topbar-user-name {
  color: #0f172a;
}

[data-theme="light"] .topbar-user-cargo {
  color: #64748b;
}

[data-theme="light"] .avatar-dropdown {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .avatar-dropdown-header {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .avatar-dropdown-item {
  color: #334155;
}

[data-theme="light"] .avatar-dropdown-item:hover {
  background: #f1f5f9;
  color: #4f46e5;
}

[data-theme="light"] .bonus-tech-item {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .bonus-tech-item:hover {
  background: #f8fafc;
}

[data-theme="light"] #cmdPaletteCard {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] #cmdPaletteInput {
  color: #0f172a !important;
}

[data-theme="light"] .cmd-item {
  border-bottom-color: #f1f5f9 !important;
}

[data-theme="light"] .cmd-item:hover,
[data-theme="light"] .cmd-item.selected {
  background: #f1f5f9 !important;
}

[data-theme="light"] .cmd-item-title {
  color: #0f172a !important;
}

[data-theme="light"] .cmd-item-sub {
  color: #64748b !important;
}

[data-theme="light"] .cmd-item-key {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

[data-theme="light"] #roleSelectorOverlay > div,
[data-theme="light"] #kbHelpOverlay > div {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] #roleSelectorOverlay h3,
[data-theme="light"] #kbHelpOverlay h3 {
  color: #0f172a !important;
}

[data-theme="light"] #roleSelectorOverlay button {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] #roleSelectorOverlay button:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] #kbHelpOverlay span {
  color: #334155 !important;
}

[data-theme="light"] #kbHelpOverlay kbd {
  background: #e2e8f0 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

/* Modales dinámicos y Overlays en Modo Diurno */
[data-theme="light"] .modal-overlay,
[data-theme="light"] .modal-backdrop,
[data-theme="light"] #cmdPaletteOverlay,
[data-theme="light"] #kbHelpOverlay,
[data-theme="light"] #roleSelectorOverlay,
[data-theme="light"] #paymentProofViewerModal,
[data-theme="light"] #notifCopyModal,
[data-theme="light"] #quoteFormModal,
[data-theme="light"] #quoteDetailModal,
[data-theme="light"] #quoteCloseModal,
[data-theme="light"] #bomEditorModal,
[data-theme="light"] #quoteExpenseModal,
[data-theme="light"] #followUpModal,
[data-theme="light"] #leadFormModal,
[data-theme="light"] #coordinacionModal,
[data-theme="light"] #qrScannerModal,
[data-theme="light"] #serviciosPhotoPreviewModal,
[data-theme="light"] #serviceActModal {
  background: rgba(15, 23, 42, 0.45) !important;
}

[data-theme="light"] #quoteFormModal > div,
[data-theme="light"] #quoteDetailModal > div,
[data-theme="light"] #quoteCloseModal > div,
[data-theme="light"] #bomEditorModal > div,
[data-theme="light"] #quoteExpenseModal > div,
[data-theme="light"] #followUpModal > div,
[data-theme="light"] #leadFormModal > div,
[data-theme="light"] #coordinacionModal > div,
[data-theme="light"] #paymentProofViewerModal > div,
[data-theme="light"] #notifCopyModal > div {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] #quoteFormModal div[style*="position:sticky"],
[data-theme="light"] #quoteDetailModal div[style*="position:sticky"],
[data-theme="light"] #coordinacionModal div[style*="position:sticky"],
[data-theme="light"] #bomEditorModal div[style*="position:sticky"] {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* ── Estimador de Costos: Resumen y Desglose Financiero (Modo Diurno) ── */
[data-theme="light"] .cost-summary-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  color: #1e293b !important;
}

[data-theme="light"] .cost-summary-title {
  color: #0f172a !important;
}

[data-theme="light"] .cost-row-item {
  border-bottom-color: #e2e8f0 !important;
  color: #475569 !important;
}

[data-theme="light"] .cost-row-item span {
  color: #475569 !important;
}

[data-theme="light"] .cost-row-item strong {
  color: #0f172a !important;
}

[data-theme="light"] .cost-row-item.cost-row-divider {
  border-top-color: #cbd5e1 !important;
}

[data-theme="light"] .cost-row-item.total-highlight {
  background: #f0fdf4 !important;
  border: 1px solid #86efac !important;
  border-left: 4px solid #16a34a !important;
}

[data-theme="light"] .cost-row-item.total-highlight span:first-child {
  color: #14532d !important;
}

[data-theme="light"] .cost-row-item.total-highlight #res-total-cotizacion {
  color: #15803d !important;
}

[data-theme="light"] .section-title-sm {
  color: #475569 !important;
}

/* ── Personal & Nómina Legal (Modo Diurno / Alto Contraste) ── */
[data-theme="light"] .tech-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .tech-card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .tech-name {
  color: #0f172a !important;
}

[data-theme="light"] .tech-rut {
  color: #475569 !important;
}

[data-theme="light"] .tech-cargo-badge {
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  color: #4338ca !important;
  font-weight: 700 !important;
}

/* Recuadro de Sueldo Base, Hora Ordinaria y Horas Extras */
[data-theme="light"] .tech-salary-box {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .tech-salary-box span,
[data-theme="light"] .tech-salary-label {
  color: #334155 !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.01em;
}

[data-theme="light"] .tech-salary-box strong,
[data-theme="light"] .tech-salary-val {
  font-weight: 700 !important;
  font-size: 13px !important;
}

[data-theme="light"] .tech-salary-box strong:not([style*="cyan"]):not([style*="amber"]),
[data-theme="light"] .tech-salary-val.val-sueldo {
  color: #0f172a !important;
}

[data-theme="light"] .tech-salary-box strong[style*="cyan"],
[data-theme="light"] .tech-salary-val.val-ord {
  color: #0284c7 !important;
}

[data-theme="light"] .tech-salary-box strong[style*="amber"],
[data-theme="light"] .tech-salary-val.val-extra {
  color: #b45309 !important;
}

/* Barras de Habilidad y Contacto en Modo Diurno */
[data-theme="light"] .skill-bar-header {
  color: #334155 !important;
}

[data-theme="light"] .skill-bar-header strong {
  color: #0f172a !important;
}

[data-theme="light"] .skill-bar-track {
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .provider-contact-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

[data-theme="light"] .provider-contact-pill.whatsapp {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #15803d !important;
  font-weight: 600 !important;
}

[data-theme="light"] .provider-contact-pill.email {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
  color: #0369a1 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .provider-card-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

/* Modal y Banner de Tarifas Legales */
[data-theme="light"] .tech-modal-rates-box {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

[data-theme="light"] .tech-modal-rates-box div {
  color: #334155 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .tech-modal-rates-box #tm-rate-ord {
  color: #0f172a !important;
}

[data-theme="light"] .tech-modal-rates-box #tm-rate-ext {
  color: #b45309 !important;
}

[data-theme="light"] .tech-modal-rates-box #tm-rate-fest {
  color: #be123c !important;
}

[data-theme="light"] code {
  background: #e0e7ff !important;
  border-color: #c7d2fe !important;
  color: #3730a3 !important;
}

[data-theme="light"] .login-overlay {
  background: radial-gradient(ellipse at 30% 40%, #eef2f6 0%, #dfe7ef 100%) !important;
}

[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1), 0 0 40px rgba(99, 102, 241, 0.06) !important;
}

[data-theme="light"] .login-title {
  color: #0f172a !important;
}

[data-theme="light"] .login-subtitle {
  color: #64748b !important;
}

[data-theme="light"] .login-tenant-badge {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

/* ── 2. RESET Y TIPOGRAFÍA BASE ──────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-size: 13.5px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button, a, [role="button"], input[type="submit"], label[for] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.88em;
  color: var(--primary-light);
}

/* ── 3. SCROLLBARS ULTRA-SLIM ESTILO ERP ─────────────────── */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* ── 4. APP SHELL CONTAINER (100VH SIN SCROLL ERRÁTICO) ──── */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-base);
}

/* SIDEBAR FIJO */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--transition-slow), transform var(--transition-slow);
  overflow: hidden;
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-info {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo {
  display: flex;
  align-items: center;
}
.sidebar .logo .pivox-brand-wrapper {
  display: inline-flex;
  align-items: center;
}
.logo-icon-collapsed {
  display: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
}
.sidebar.collapsed .logo .pivox-brand-wrapper {
  display: none !important;
}
.sidebar.collapsed .logo .logo-icon-collapsed {
  display: flex !important;
}
.logo-icon img, .pivox-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.pivox-logo-img {
  height: 28px;
  width: auto;
  max-width: 145px;
  object-fit: contain;
  display: block;
  transition: opacity 0.25s ease, transform 0.2s ease;
}

/* ============================================================
   AJUSTE DE CONTRASTE DEL FONDO SEGÚN MODO DIURNO O NOCTURNO
   - En Modo Nocturno: El contenedor adopta un fondo blanco de alto contraste
     con sombra suave para que el logo oscuro del usuario resalte con nitidez.
   - En Modo Diurno: El fondo es transparente integrándose de forma limpia
     en la interfaz clara.
   ============================================================ */
:root:not([data-theme="light"]) .pivox-contrast-capsule {
  background: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 5px 12px;
  border-radius: 9px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .pivox-contrast-capsule {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
}

.logo-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-heading);
  line-height: 1.1;
}
.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: 1px;
}
.logo-credit {
  font-size: 9px;
  color: rgba(249, 115, 22, 0.8);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.sidebar-toggle {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
}
.sidebar-toggle:hover {
  color: var(--primary-light);
  background: var(--primary-dim);
}
.sidebar.collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

.sidebar-nav {
  flex: 1;
  padding: 8px 8px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
.nav-section-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 14px 10px 4px;
  text-transform: uppercase;
  opacity: 0.85;
}
.nav-section-label:first-child {
  padding-top: 4px;
}
.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
}
.nav-item:hover {
  background: var(--primary-dim);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.28);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary-light);
}
.nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--primary-dim);
  color: var(--primary-light);
  border: 1px solid var(--border-strong);
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 10px;
  color: var(--text-muted);
}
.btn-logout {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.btn-logout:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
}

/* MAIN CONTENT VIEWPORT */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
  transition: margin-left var(--transition-slow);
}
.main-content.expanded {
  margin-left: var(--sidebar-collapsed);
}

/* TOPBAR PINNED (54PX) */
.topbar {
  height: var(--topbar-height);
  background: rgba(11, 16, 28, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.breadcrumb {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}
.mobile-menu-btn {
  font-size: 18px;
  color: var(--text-secondary);
  display: none;
}
.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  max-width: 460px;
  margin: 0 auto;
}
.topbar-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}
.topbar-search-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
}
.topbar-search-text {
  flex: 1;
}
.topbar-search-text kbd {
  float: right;
  padding: 1px 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 4px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--primary-light);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.db-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.db-status-pill.online {
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}
.topbar-time {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
}
.btn-icon:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-rose);
}

/* AVATAR MENU */
.topbar-avatar-menu {
  position: relative;
}
.topbar-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-primary);
  text-align: left;
}
.topbar-user-badge:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}
.topbar-avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  border: none;
  flex-shrink: 0;
}
.topbar-user-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 160px;
  line-height: 1.2;
}
.topbar-user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-user-cargo {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-user-chevron {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 2px;
  transition: transform var(--transition-fast);
}
.topbar-user-badge:hover .topbar-user-chevron {
  color: var(--primary-light);
}

@media (max-width: 768px) {
  .topbar-user-info,
  .topbar-user-chevron {
    display: none !important;
  }
  .topbar-user-badge {
    padding: 0;
    background: transparent;
    border: none;
  }
}
.avatar-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: viewFadeIn 0.15s ease;
}
.avatar-dropdown-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.avatar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}
.avatar-dropdown-item:hover {
  background: var(--primary-dim);
  color: var(--primary-light);
}

/* ── 5. VIEW CONTAINER (SCROLL INDEPENDIENTE) ─────────────── */
.view {
  display: none;
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 24px 36px;
  flex: 1;
  scroll-behavior: smooth;
  animation: viewFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  overscroll-behavior: contain;
}
.view.active {
  display: block;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.view-header h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  line-height: 1.2;
}
.view-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 680px;
}

/* ── 6. CARDS & CONTENEDORES ─────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.015);
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.01em;
}

/* ── 7. STATS GRID & KPIS CON SPARKLINES ─────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.stat-card:hover {
  border-color: var(--accent, var(--primary));
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-sm);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--accent, var(--primary));
}
.stat-icon {
  width: 38px;
  height: 38px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  color: var(--accent, var(--primary));
}
.stat-body {
  flex: 1;
  min-width: 0;
}
.stat-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 3px;
}
.stat-trend {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.3;
}
.stat-trend.up { color: #34d399; background: rgba(16, 185, 129, 0.12); }
.stat-trend.down { color: #fc8181; background: rgba(239, 68, 68, 0.12); }
.stat-trend.flat { color: var(--text-muted); background: rgba(255, 255, 255, 0.06); }
.stat-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.stat-sparkline { display: block; margin-top: 4px; opacity: 0.7; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; gap: 12px; } }

/* ── 8. DATA TABLES & GRIDS (ENTERPRISE STANDARD) ────────── */
.table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 275px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 9px 13px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  backdrop-filter: blur(12px);
}
.data-table tbody td {
  padding: 8px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
  line-height: 1.4;
}
.data-table tbody tr {
  transition: background var(--transition-fast);
}
.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.empty-row td {
  text-align: center;
  padding: 32px;
}

/* ALINEACIÓN MONETARIA Y NUMÉRICA */
td code, td.number, td.monetary, td[style*="text-align:right"] {
  font-variant-numeric: tabular-nums;
}

/* ── 9. TABS / SEGMENTED CONTROLS ────────────────────────── */
.tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-fast);
  white-space: nowrap;
}
.tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 8px rgba(99, 102, 241, 0.35);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── SUB-PESTAÑAS DE COORDINACIÓN & RUTAS (ALTO CONTRASTE MODO NOCHE Y DÍA) ── */
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc !important; /* Alto contraste nítido en modo noche */
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.tab-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff !important;
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}
.tab-btn.active {
  background: #4f46e5 !important;
  color: #ffffff !important;
  font-weight: 700;
  border-color: #6366f1;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
}


/* ── 10. FORM INPUTS & CONTROLES ─────────────────────────── */
.form-group {
  margin-bottom: 14px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-label {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}
.form-input {
  width: 100%;
  height: var(--input-height);
  padding: 0 12px;
  background: rgba(13, 19, 33, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12.5px;
  transition: var(--transition-fast);
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
  background: rgba(13, 19, 33, 0.95);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-input-sm {
  height: var(--input-height-sm);
  padding: 0 10px;
  font-size: 11.5px;
}
textarea.form-input {
  height: auto;
  min-height: 76px;
  padding: 8px 12px;
}
select.form-input {
  cursor: pointer;
}

/* ── 11. BOTONES DEL SISTEMA ─────────────────────────────── */
.btn-primary {
  height: var(--btn-height);
  padding: 0 14px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  height: var(--btn-height);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  transition: var(--transition-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.btn-sm {
  height: var(--btn-height-sm);
  padding: 0 10px;
  font-size: 11.5px;
}
.btn-xs {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger-soft {
  height: var(--btn-height);
  padding: 0 14px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-danger-soft:hover {
  background: var(--accent-rose);
  color: white;
}
.btn-remove {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--transition-fast);
}
.btn-remove:hover { background: var(--accent-rose); color: white; }
.btn-edit {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--transition-fast);
}
.btn-edit:hover { background: var(--accent-amber); color: #111; }
.link-btn {
  background: none;
  border: none;
  color: var(--primary-light);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

/* ── 12. CHIPS & BADGES ──────────────────────────────────── */
.chip-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  transition: var(--transition-fast);
}
.chip:hover { border-color: var(--primary); color: var(--primary-light); }
.chip.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 2px 8px var(--primary-glow); }
.chip-green.active { background: var(--accent-green); border-color: var(--accent-green); }
.chip-yellow.active { background: var(--accent-amber); border-color: var(--accent-amber); color: #111; }
.chip-red.active { background: var(--accent-rose); border-color: var(--accent-rose); }

/* ── 13. EMPTY STATES ────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 10px;
  color: var(--text-secondary);
}
.empty-icon { font-size: 36px; opacity: 0.35; display: block; }
.empty-state p { font-size: 13px; }
.empty-state-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 16px;
}
.empty-icon-sm { font-size: 16px; opacity: 0.5; }

/* ── 14. WIZARD GENERADOR DE ÓRDENES ─────────────────────── */
.wizard-container {
  max-width: 960px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.wizard-step { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition-fast);
}
.wizard-step.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 14px var(--primary-glow);
}
.wizard-step.completed .step-num {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}
.step-label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.wizard-step.active .step-label { color: var(--primary-light); }
.wizard-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 30px;
  max-width: 70px;
  margin: 0 8px;
  margin-bottom: 18px;
}
.wizard-panel { display: none; padding: 24px; }
.wizard-panel.active { display: block; animation: viewFadeIn 0.2s ease; }
.wizard-panel-title { font-size: 16px; font-weight: 700; color: var(--text-heading); margin-bottom: 16px; }
.wizard-hint { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 16px; margin-top: -8px; }
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.selector-group { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── 15. CHECKLIST & DYNAMIC FORM ────────────────────────── */
.repair-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.checklist-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  user-select: none;
}
.checklist-card:hover { border-color: var(--primary); }
.checklist-card.selected {
  border-color: var(--primary);
  background: var(--primary-dim);
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.checklist-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
  transition: var(--transition-fast);
}
.checklist-card.selected .checklist-checkbox { background: var(--primary); border-color: var(--primary); }
.checklist-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.checklist-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.checklist-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--primary-dim);
  color: var(--primary-light);
  border: 1px solid var(--border-strong);
  margin-top: 4px;
}

.dynamic-form { display: flex; flex-direction: column; gap: 16px; }
.dynamic-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dynamic-section-header {
  padding: 10px 14px;
  background: rgba(99, 102, 241, 0.08);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-light);
}
.dynamic-section-body {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

/* ── 16. MODAL & DIALOGS (DIMENSIONAMIENTO PRECISO) ──────── */
.modal-overlay, .modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(5, 8, 16, 0.82);
  backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.modal-overlay.active, .modal-backdrop.active {
  display: flex !important;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 32px var(--primary-glow);
  animation: slideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.modal-sm { max-width: 440px; }
.modal-md { max-width: 580px; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1040px; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}
.modal-header h2, .modal-header h3, .modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
}
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  transition: var(--transition-fast);
}
.modal-close:hover {
  background: var(--accent-rose);
  color: white;
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── 17. KANBAN BOARD ────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 280px;
}
@media (max-width: 1200px) { .kanban-board { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .kanban-board { grid-template-columns: repeat(3, 260px); overflow-x: auto; padding-bottom: 12px; } }
.kanban-column {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 200px;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 2px solid currentColor;
}
.kanban-col-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  flex: 1;
}
.kanban-col-count {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.kanban-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.kanban-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.kanban-card-code {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-light);
  font-family: 'JetBrains Mono', monospace;
}
.kanban-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-card-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kanban-card-hh {
  font-size: 10px;
  color: var(--primary-light);
  background: var(--primary-dim);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}
.kanban-empty {
  text-align: center;
  padding: 20px 10px;
  color: var(--text-muted);
  font-size: 11.5px;
}

/* ── 18. LOGIN OVERLAY & DIÁLOGOS DE ENTRADA ─────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: radial-gradient(ellipse at 30% 40%, #0d1240 0%, #060910 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
  overflow: hidden;
}
.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}
.login-bg-orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.18;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: var(--primary); top: -100px; left: -100px; }
.orb-2 { width: 300px; height: 300px; background: var(--accent-violet); bottom: -80px; right: -80px; animation-delay: -3s; }
.orb-3 { width: 200px; height: 200px; background: var(--accent-cyan); bottom: 30%; left: 60%; animation-delay: -6s; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-20px) scale(1.05); }
  66% { transform: translate(-20px,30px) scale(0.95); }
}
.login-card {
  background: rgba(22, 32, 56, 0.88);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 410px;
  box-shadow: 0 0 80px rgba(99,102,241,0.18), 0 30px 80px rgba(0,0,0,0.7);
  backdrop-filter: blur(20px);
  text-align: center;
  position: relative;
  z-index: 1;
  animation: loginCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.login-pivox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 14px;
  margin-bottom: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
:root:not([data-theme="light"]) .login-pivox-badge {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .login-pivox-badge {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.login-pivox-badge .pivox-logo-img {
  height: 44px;
  max-width: 220px;
}
.login-logo-sub { font-size: 11.5px; color: var(--text-muted); letter-spacing: 0.08em; margin-top: 2px; font-weight: 500; }
.login-logo-credit { font-size: 10px; color: rgba(249, 115, 22, 0.85); margin-top: 3px; font-weight: 600; letter-spacing: 0.04em; }
.login-title { font-size: 17px; font-weight: 700; color: var(--text-heading); margin-bottom: 4px; }
.login-subtitle { font-size: 12.5px; color: var(--text-muted); margin-bottom: 22px; }
.password-wrapper { position: relative; display: flex; }
.password-wrapper .form-input { padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  font-size: 15px; cursor: pointer; padding: 4px;
}
.btn-login {
  width: 100%;
  justify-content: center;
  height: 40px;
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-top: 6px;
}
.login-error {
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.3);
  color: #fda4af;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11.5px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.login-footer {
  margin-top: 20px;
  font-size: 10.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── 19. CUSTOM TOOLTIP ──────────────────────────────────── */
.custom-tooltip {
  position: fixed; z-index: 9990;
  background: rgba(8, 12, 26, 0.96);
  border: 1px solid rgba(99,102,241,0.4);
  color: #c7d2fe;
  font-size: 11.5px; font-weight: 400; line-height: 1.45;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
}
.custom-tooltip.visible { opacity: 1; }

/* ── 20. RESPONSIVE MEDIA QUERIES ────────────────────────── */
@media (max-width: 992px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .nav-label, .sidebar .nav-badge, .sidebar .logo-text, .sidebar .nav-section-label, .sidebar .user-info { display: none; }
  .main-content { margin-left: var(--sidebar-collapsed); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 260px !important; z-index: 9500; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.mobile-open .nav-label, .sidebar.mobile-open .nav-badge, .sidebar.mobile-open .logo-text, .sidebar.mobile-open .nav-section-label, .sidebar.mobile-open .user-info { display: block !important; }
  .main-content { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; min-width: 40px; min-height: 40px; padding: 8px; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
  .topbar-left { flex-shrink: 1; min-width: 0; gap: 8px !important; overflow: hidden; }
  .breadcrumb { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; max-width: 140px; font-size: 13px !important; }
  .topbar-center { display: none !important; }
  .topbar { padding: 0 10px; height: 50px; flex-wrap: nowrap !important; overflow: visible !important; align-items: center; position: relative; z-index: 950; }
  .avatar-dropdown { position: fixed !important; top: 54px !important; right: 10px !important; left: auto !important; width: 250px !important; max-width: calc(100vw - 20px) !important; z-index: 999999 !important; box-shadow: 0 16px 48px rgba(0,0,0,0.85), 0 0 0 1px var(--border-strong) !important; border-radius: 14px !important; }
  .topbar-right { display: flex !important; align-items: center; flex-wrap: nowrap !important; gap: 6px !important; flex-shrink: 0; }
  .tenant-plan-pill { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #topbarGpsMapBtn, #topbarTurnoBtn, #dbStatusBadge, .topbar-time { display: none !important; }
  .topbar-user-info, .topbar-user-chevron { display: none !important; }
  .topbar-user-badge { padding: 0 !important; background: transparent !important; border: none !important; }
  .view { padding: 14px 12px 76px; height: calc(100vh - 50px); }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 20px; }
  .form-row { grid-template-columns: 1fr !important; }
  .mobile-bottom-nav { display: flex !important; }

  /* ── Touch targets mínimos adaptados a barra compacta ── */
  .btn-icon { width: 38px; height: 38px; font-size: 16px; border-radius: 50%; flex-shrink: 0; }
  .topbar-avatar-btn { width: 36px; height: 36px; font-size: 12px; flex-shrink: 0; }
  .sidebar-toggle { width: 36px; height: 36px; padding: 6px; }
  .tab { padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; }

  /* ── Fuentes mínimas legibles en móvil (≥11px) ── */
  .nav-section-label { font-size: 11px; }
  .nav-badge { font-size: 11px; padding: 2px 7px; }
  .stat-trend { font-size: 11px; }
  .stat-sub { font-size: 11.5px; }
  .calendar-event-pill { font-size: 11px; }
  .data-table thead th { font-size: 12px; }

  /* ── Safe area insets para notch y barra de gestos (navegador normal) ── */
  .topbar {
    padding-top: max(0px, env(safe-area-inset-top, 0px));
    height: calc(50px + env(safe-area-inset-top, 0px));
  }
  .mobile-bottom-nav {
    padding-bottom: max(6px, env(safe-area-inset-bottom, 6px));
    height: calc(60px + env(safe-area-inset-bottom, 0px));
  }
  .view { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Overlay de fondo al abrir sidebar en móvil ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9400;
  animation: viewFadeIn 0.2s ease;
}
.sidebar-overlay.visible { display: block; }

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  height: 60px;
  z-index: 110;
  padding: 0 4px;
  align-items: center;
  justify-content: space-around;
}
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition-fast);
  min-width: 48px;
  min-height: 44px;
  justify-content: center;
}
.mnav-icon { font-size: 20px; line-height: 1; }
.mobile-nav-btn.active {
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.12);
}



/* ── BREAKPOINT PARA PHONES MUY PEQUEÑOS (≤480px: iPhone SE, Galaxy A, etc) ── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; gap: 8px; }
  .topbar { padding: 0 8px; }
  .topbar-right { gap: 4px; }
  .topbar-time { display: none; }
  .view { padding: 12px 8px calc(76px + env(safe-area-inset-bottom, 0px)); }
  .view-header h1 { font-size: 17px; }
  .view-header { flex-direction: column; align-items: flex-start; }
  .card-header { padding: 10px 12px; flex-direction: column; align-items: flex-start; }
  .stat-card { padding: 10px 12px; gap: 10px; }
  .stat-icon { width: 32px; height: 32px; font-size: 16px; }
  .stat-value { font-size: 18px; }
  .avatar-dropdown { position: fixed !important; top: 54px !important; right: 10px !important; left: auto !important; width: 250px !important; max-width: calc(100vw - 20px) !important; z-index: 999999 !important; }
  .mnav-icon { font-size: 22px; }
  .db-status-pill { display: none; }
  .tenant-plan-pill { max-width: 105px !important; font-size: 10px !important; padding: 2px 6px !important; }
}

/* ── 21. ESTILOS ESPECIALIZADOS DE MÓDULOS EXISTENTES ───── */

/* ============================================================
   PRINT — ventana separada limpia (ver printReport())
   Estilos de seguridad para print directo con remisión de
   encabezados y pies de página de navegador (@page margin:0)
   ============================================================ */
@media print {
  @page { margin: 0 !important; }
  body { padding: 1.5cm !important; background: #fff !important; color: #111 !important; }
  .sidebar, .topbar, .wizard-steps, .wizard-nav, .modal-overlay,
  .toast-container, .login-overlay, .custom-tooltip { display: none !important; }
  #app { display: block !important; }
  .main-content { margin-left: 0 !important; }
  .view { display: none !important; }
  #view-ordenes { display: block !important; padding: 0 !important; }
  #wpanel-1, #wpanel-2, #wpanel-3 { display: none !important; }
  #wpanel-4 { display: block !important; padding: 20px !important; }
  .wizard-container { max-width: 100% !important; border: none !important; background: #fff !important; }
  .report-section, .hh-summary, .report-header { page-break-inside: avoid; }
}

/* ============================================================
   CALCULADORAS — estilos adicionales
   ============================================================ */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; }
.verdict-success { color: var(--accent-green) !important; font-weight: 700; }
.verdict-danger  { color: var(--accent-rose)  !important; font-weight: 700; }
.calc-result-big { font-size: 22px; font-weight: 800; }
.trafo-carga-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.trafo-carga-row .form-input { margin-bottom: 0; flex: 1; }
@media(max-width:820px){ .calc-grid { grid-template-columns: 1fr; } }

/* ============================================================
   INFORME DE INGENIERÍA Y CHECKBOXES
   ============================================================ */
.calc-include-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  accent-color: var(--primary-light);
  cursor: pointer;
}
.calc-include-label:hover {
  color: var(--primary-light) !important;
}
#selected-calcs-summary ul {
  padding-left: 20px;
  margin-top: 8px;
}
#selected-calcs-summary li {
  margin-bottom: 4px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ============================================================
   CATÁLOGO — BÚSQUEDA Y PAGINACIÓN
   ============================================================ */
.catalog-search-wrapper {
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.catalog-search-input {
  flex: 1;
  min-width: 180px;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition: var(--transition);
}
.catalog-search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.catalog-code-badge {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  padding: 2px 7px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-cyan, #38bdf8);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.catalog-pagination-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}
.catalog-page-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.catalog-page-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.catalog-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}



/* ============================================================
   ESTADO DEL SERVIDOR Y BASE DE DATOS
   ============================================================ */
.db-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
  transition: var(--transition);
}
.db-status-pill.online {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}
.db-status-pill.offline {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.35);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: pulse-dot 2s infinite ease-in-out;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ============================================================
   DIRECTORIO DE PROVEEDORES Y COTIZACIONES
   ============================================================ */
.provider-search-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.provider-search-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: center;
}
@media (max-width: 768px) {
  .provider-search-grid {
    grid-template-columns: 1fr;
  }
}
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}
@media (max-width: 820px) {
  .provider-grid {
    grid-template-columns: 1fr;
  }
}
.provider-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}
.provider-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.provider-card-header {
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.provider-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}
.provider-rut {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-muted);
}
.provider-badge-cat {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  white-space: nowrap;
}
.provider-card-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.provider-contact-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.provider-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.provider-contact-pill:hover {
  border-color: var(--primary-light);
  color: white;
  background: rgba(99, 102, 241, 0.2);
}
.provider-contact-pill.whatsapp {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}
.provider-contact-pill.whatsapp:hover {
  background: #22c55e;
  color: white;
}
.provider-contact-pill.email {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}
.provider-contact-pill.email:hover {
  background: #0284c7;
  color: white;
}
.provider-info-block {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.provider-info-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.provider-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.provider-tag {
  font-size: 11px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--text-secondary);
}
.provider-card-footer {
  padding: 12px 20px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}


/* ============================================================
   KLEVERLIST V2 — ESTILOS ADICIONALES
   ============================================================ */

/* Badges de Estado de Ciclo de Vida */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-status.borrador { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.badge-status.programada { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-status.ejecutada { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-status.en_cobro { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-status.pagada { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }

/* Búsqueda Profunda (Deep Search) */
.deep-search-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--border-strong, #334155);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.deep-search-grid {
  display: grid;
  grid-template-columns: 2.5fr 1.2fr 1fr;
  gap: 14px;
  align-items: center;
}
@media (max-width: 900px) {
  .deep-search-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CALENDARIO DE CICLO DE VIDA
   ============================================================ */
.calendar-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.calendar-header {
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.calendar-nav-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: rgba(255,255,255,0.03);
  gap: 1px;
}
.calendar-day-header {
  background: var(--bg-elevated);
  padding: 10px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.calendar-day-cell {
  background: var(--bg-card);
  min-height: 105px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}
.calendar-day-cell:hover {
  background: var(--bg-card-hover);
}
.calendar-day-cell.other-month {
  opacity: 0.35;
  background: rgba(0,0,0,0.15);
}
.calendar-day-cell.today {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid var(--primary-light);
}
.calendar-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.calendar-event-pill {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease;
}
.calendar-event-pill:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.event-creacion { background: rgba(234, 179, 8, 0.2); color: #facc15; border-left: 3px solid #eab308; }
.event-programada { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border-left: 3px solid #0ea5e9; }
.event-ejecutada { background: rgba(168, 85, 247, 0.2); color: #c084fc; border-left: 3px solid #a855f7; }
.event-cobro { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border-left: 3px solid #f59e0b; }
.event-pagada { background: rgba(34, 197, 94, 0.2); color: #4ade80; border-left: 3px solid #22c55e; }

/* ============================================================
   TÉCNICOS CONTRATADOS & BARRAS DE HABILIDADES (0 A 7)
   ============================================================ */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
  gap: 20px;
}
@media (max-width: 800px) {
  .tech-grid { grid-template-columns: 1fr; }
}
.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.tech-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.tech-card-header {
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.tech-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
}
.tech-rut {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-muted);
}
.tech-cargo-badge {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.tech-salary-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  text-align: center;
  font-size: 11px;
}
.tech-salary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.tech-salary-box span,
.tech-salary-label {
  color: var(--text-muted);
  font-size: 11px;
  display: block;
}
.tech-salary-box strong,
.tech-salary-val {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
  font-family: var(--font-mono, monospace);
  color: var(--text-heading);
}
.tech-salary-val.val-sueldo {
  color: var(--text-heading);
}
.tech-salary-val.val-ord {
  color: var(--accent-cyan);
}
.tech-salary-val.val-extra {
  color: var(--accent-amber);
}

/* Barras de Habilidad 0 a 7 */
.skill-bar-row {
  margin-bottom: 9px;
}
.skill-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text-secondary);
}
.skill-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.skill-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.skill-low    { background: linear-gradient(90deg, #ef4444, #f87171); } /* 0 - 2 */
.skill-mid    { background: linear-gradient(90deg, #f59e0b, #fbbf24); } /* 3 - 4 */
.skill-high   { background: linear-gradient(90deg, #10b981, #34d399); } /* 5 - 7 */

/* ============================================================
   ESTIMADOR INTEGRAL DE COSTOS
   ============================================================ */
.cost-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 950px) {
  .cost-card-grid { grid-template-columns: 1fr; }
}
.cost-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.cost-summary-title {
  color: var(--text-heading);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cost-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.cost-row-item span {
  color: var(--text-secondary);
}

.cost-row-item strong {
  color: var(--text-heading);
  font-weight: 600;
}

.cost-row-item.cost-row-divider {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  margin-top: 6px;
}

.cost-row-item.total-highlight {
  border-top: none;
  border-bottom: none;
  padding: 14px 18px;
  margin-top: 16px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
}

.cost-row-item.total-highlight span:first-child {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-heading);
}

.cost-row-item.total-highlight #res-total-cotizacion {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent-green, #34d399);
  font-family: 'JetBrains Mono', monospace;
}

.section-title-sm {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ============================================================
   CALENDARIO ERP � V2.2
   ============================================================ */

/* Botones de vista (Mes / Semana / Agenda) */
.cal-view-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-view-btn:hover { background: var(--bg-card); color: var(--text-heading); }
.cal-view-btn.active { background: var(--primary); color: #fff; }

/* Sidebar del Calendario */
.cal-sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.cal-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.cal-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
}
.cal-stat:last-child { border-bottom: none; }
.cal-stat strong { font-weight: 700; }
.cal-sidebar-item {
  font-size: 11px;
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 4px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s;
}
.cal-sidebar-item:hover { background: var(--primary-dim); color: var(--text-heading); }
.cal-filter-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 3px 0;
  cursor: pointer;
}
.cal-filter-row input[type="checkbox"] { cursor: pointer; accent-color: var(--primary); }

/* Celda de d�a con alerta (cobro vencido) */
.calendar-day-cell.has-alert {
  background: rgba(239,68,68,0.05);
  border-color: rgba(239,68,68,0.3);
}
.calendar-day-cell.has-alert .calendar-day-num { color: var(--accent-rose); }

/* Vista Semana */
.week-view-grid {
  display: grid;
  grid-template-columns: 48px repeat(7, 1fr);
  gap: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.week-day-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
}
.week-day-header.today { background: var(--primary-dim); color: var(--primary-light); }
.week-day-header strong { display: block; font-size: 13px; }
.week-day-header span { font-size: 18px; font-weight: 800; color: var(--text-heading); }
.week-time-col { background: var(--bg-elevated); }
.week-time-label {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 4px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
}
.week-day-cell {
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 4px;
  min-height: 54px;
  cursor: pointer;
  transition: background 0.12s;
}
.week-day-cell:hover { background: var(--bg-elevated); }
.week-day-cell.today { background: rgba(99,102,241,0.05); }

/* Vista Agenda */
.agenda-list { display: flex; flex-direction: column; gap: 0; }
.agenda-month-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 16px 0 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 4px;
}
.agenda-day-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  align-items: start;
}
.agenda-day-row.today .agenda-day-label { color: var(--primary-light); }
.agenda-day-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  padding-top: 2px;
}
.agenda-day-label strong { font-size: 22px; font-weight: 800; color: var(--text-heading); line-height: 1; }
.agenda-events { display: flex; flex-direction: column; gap: 5px; }
.agenda-event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background 0.15s;
}
.agenda-event-item:hover { background: var(--bg-card); }
.agenda-event-label { font-size: 12px; font-weight: 600; color: var(--text-heading); }
.agenda-event-sub   { font-size: 11px; color: var(--text-muted); }

/* Checklist card hover y seleccionado */
.checklist-card { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.checklist-card:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-dim); }

/* ============================================================
   ESTATUS DE T�CNICOS � V2.3
   ============================================================ */
.tech-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ============================================================
   B�SQUEDA PROFUNDA EN CALENDARIO � V2.4
   ============================================================ */
.cal-search-result-item {
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.cal-search-result-item:hover {
  border-color: var(--primary-light) !important;
  background: var(--bg-elevated) !important;
  transform: translateY(-1px);
}

/* ============================================================
   M�DULO DE C�LCULO AUTOM�TICO DE BONOS � V2.5
   ============================================================ */
.bonus-config-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 4px solid var(--accent-green) !important;
}
.bonus-tech-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}
.bonus-tech-item.selected {
  border-color: var(--primary-light);
  background: rgba(99, 102, 241, 0.05);
}
.bonus-tech-item.is-jefe {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.05);
}
.bonus-jefe-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.bonus-jefe-badge:hover {
  background: rgba(245, 158, 11, 0.25);
}
.bonus-pct-slider {
  flex: 1;
  accent-color: var(--accent-green);
  cursor: pointer;
}
.bonus-pct-number {
  width: 65px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--primary-light);
}
.bonus-amount-badge {
  min-width: 100px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-green);
}

/* ============================================================
   SERVICIOS EN TERRENO (FSM MOBILE) — ESTILOS ADICIONALES
   ============================================================ */
.service-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}
@media (max-width: 680px) {
  .step-label-text {
    display: none;
  }
}

/* ============================================================
   ASIGNACIONES DE SERVICIOS A TÉCNICOS & NOTIFICACIONES
   ============================================================ */
.service-kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1024px) {
  .service-kanban-board {
    grid-template-columns: 1fr;
  }
}
.service-kanban-col {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.service-kanban-col-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid currentColor;
  background: var(--bg-elevated);
}
.service-kanban-col-title {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-heading);
}
.service-kanban-col-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-hover);
  color: var(--text-muted);
}
.service-kanban-col-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}
.tech-filter-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}
.tech-filter-chip:hover {
  border-color: var(--primary-light);
  color: var(--text-heading);
  background: var(--bg-hover);
}
.tech-filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.tech-select-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.tech-select-card:hover {
  border-color: var(--primary-light);
}
.tech-select-card.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}
.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  display: none;
}

/* ============================================================
   DESPACHADOR DE TAREAS Y ASIGNACIONES (FSM DISPATCHER)
   ============================================================ */
.assign-search-container {
  position: relative;
}
.assign-search-input {
  width: 100%;
  padding: 11px 36px 11px 38px;
  background: var(--bg-surface);
  border: 1.5px solid var(--accent-primary);
  border-radius: 9px;
  color: var(--text-heading);
  font-size: 13.5px;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.12);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.assign-search-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}
.assign-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 270px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  z-index: 1050;
}
.assign-search-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.assign-search-item:last-child {
  border-bottom: none;
}
.assign-search-item:hover, .assign-search-item.selected {
  background: var(--bg-hover);
}
.assign-selected-card {
  background: var(--bg-elevated);
  border: 1.5px solid var(--accent-primary);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.assign-preset-chip {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.assign-preset-chip:hover {
  border-color: var(--primary-light);
  color: var(--text-heading);
}
.assign-preset-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.assign-field-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.assign-field-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.assign-eq-card {
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  border-radius: 9px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.assign-eq-card:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}
.assign-eq-card.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.18);
}
.sla-badge-pulse {
  animation: slaPulse 2s infinite ease-in-out;
}
@keyframes slaPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.98); }
}

/* ============================================================
   COTIZACIONES & LISTA DE MATERIALES (BOM) — TABLA & CAMPOS
   ============================================================ */
#quoteItemsTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
#quoteItemsTable th {
  padding: 8px 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  color: var(--text-muted) !important;
  border-bottom: 1px solid var(--border) !important;
  white-space: nowrap !important;
}
#quoteItemsTable td {
  padding: 6px 4px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
#quoteItemsTable .form-input-sm {
  height: 32px !important;
  font-size: 12px !important;
}
#quoteItemsTable .qit-cant {
  text-align: center !important;
  padding: 0 4px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  width: 100% !important;
  min-width: 58px !important;
  box-sizing: border-box !important;
  color: var(--text-heading) !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
}
#quoteItemsTable .qit-cant::-webkit-inner-spin-button, 
#quoteItemsTable .qit-cant::-webkit-outer-spin-button { 
  opacity: 0.6;
  height: 22px;
}
#quoteItemsTable .qit-unid {
  text-align: center !important;
  padding: 0 4px !important;
  font-size: 11.5px !important;
  width: 100% !important;
  min-width: 48px !important;
}
#quoteItemsTable .qit-costo,
#quoteItemsTable .qit-margen {
  padding: 0 6px !important;
  font-size: 12px !important;
  text-align: right !important;
}

[data-theme="light"] #quoteItemsTable td {
  border-bottom: 1px solid #e2e8f0 !important;
}
[data-theme="light"] #quoteItemsTable .qit-cant {
  color: #0f172a !important;
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}
[data-theme="light"] #quoteItemsTable .qit-unid {
  color: #334155 !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
[data-theme="light"] #quoteItemsTable .qit-costo,
[data-theme="light"] #quoteItemsTable .qit-margen,
[data-theme="light"] #quoteItemsTable .qit-desc,
[data-theme="light"] #quoteItemsTable .qit-tipo {
  color: #0f172a !important;
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

/* ============================================================
   KLEVERLIST PWA — APP DEDICADA ANDROID & OPTIMIZACIONES MÓVILES
   ============================================================ */

/* Banner de Instalación Flotante para Android */
.klever-install-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 480px;
  background: #0f172a;
  border: 1px solid rgba(99, 102, 241, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  z-index: 9999;
  animation: slideDownBanner 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownBanner {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-banner-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
}

.install-banner-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.install-banner-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-install-confirm {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border: none;
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
  transition: all 0.15s ease;
}

.btn-install-confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-install-dismiss {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.btn-install-dismiss:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Badge de Estado Fuera de Línea (Terreno) */
.klever-offline-badge {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: #7c2d12;
  border: 1px solid #f97316;
  color: #ffedd5;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9998;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: fadeInOffline 0.25s ease;
}

@keyframes fadeInOffline {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* MODO APP DEDICADA STANDALONE */
body.is-standalone-app {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body.is-standalone-app .klever-install-banner,
body.is-standalone-app .btn-install-app,
body.is-standalone-app .nav-section-install,
body.is-standalone-app .nav-list-install,
body.is-standalone-app .nav-item-install {
  display: none !important;
}

body.is-standalone-app .topbar {
  flex-wrap: nowrap !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 950 !important;
}

body.is-standalone-app .avatar-dropdown {
  position: fixed !important;
  top: 54px !important;
  right: 10px !important;
  left: auto !important;
  width: 250px !important;
  max-width: calc(100vw - 20px) !important;
  z-index: 999999 !important;
  box-shadow: 0 16px 48px rgba(0,0,0,0.85), 0 0 0 1px var(--border-strong) !important;
  border-radius: 14px !important;
  background: var(--bg-elevated) !important;
}

body.is-standalone-app .topbar-right {
  flex-wrap: nowrap !important;
  gap: 6px !important;
  flex-shrink: 0;
}

body.is-standalone-app #topbarGpsMapBtn,
body.is-standalone-app #topbarTurnoBtn,
body.is-standalone-app #dbStatusBadge,
body.is-standalone-app .topbar-time {
  display: none !important;
}

body.is-standalone-app .breadcrumb {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 140px;
}

/* Safe Area Insets para Celulares Modernos con Notch / Barra Gestos */
@supports (padding: max(0px)) {
  body.is-standalone-app .topbar {
    padding-top: max(8px, env(safe-area-inset-top));
    height: calc(var(--topbar-height) + env(safe-area-inset-top));
  }
  body.is-standalone-app .mobile-bottom-nav {
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    height: calc(60px + env(safe-area-inset-bottom));
  }
}

/* Botón de Instalación en Barra Lateral / Menú */
.nav-item-install {
  color: var(--accent-primary) !important;
  font-weight: 700 !important;
  background: rgba(99, 102, 241, 0.08);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.nav-item-install:hover {
  background: rgba(99, 102, 241, 0.18) !important;
}

/* ============================================================
   BANNER PROACTIVO DE PERMISOS MÓVILES (NOTIFICACIONES & GPS)
   ============================================================ */
.klever-permissions-banner {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 580px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 18px rgba(16, 185, 129, 0.25);
  z-index: 9998;
  animation: slideDownBanner 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownBanner {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.perm-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.perm-banner-icon {
  font-size: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.perm-banner-body {
  flex: 1;
  min-width: 0;
}

.perm-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
}

.perm-banner-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
  margin-top: 2px;
}

.perm-banner-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   MAPA GPS INTERACTIVO & PINES VISUALES (LEAFLET + SVG)
   ============================================================ */
.map-full-container {
  width: 100%;
  height: calc(100vh - 140px);
  min-height: 480px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1120;
  border: 1px solid var(--border);
}

/* Pines de Técnicos en Leaflet */
.tech-map-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

.tech-marker-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease;
}

.tech-map-marker:hover .tech-marker-avatar {
  transform: scale(1.15);
}

.tech-pulse-ring {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: techPulseAnim 2.2s infinite ease-out;
}

@keyframes techPulseAnim {
  0% { transform: scale(0.65); opacity: 0.9; }
  70% { transform: scale(1.35); opacity: 0.15; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Pines de Destinos y Locales */
.loc-map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
  cursor: pointer;
  transition: transform 0.2s;
}

.loc-map-marker:hover {
  transform: scale(1.25);
}

.emergency-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  animation: emergencyBlink 1s infinite alternate;
}

@keyframes emergencyBlink {
  from { transform: scale(1); filter: drop-shadow(0 0 4px #ef4444); }
  to { transform: scale(1.25); filter: drop-shadow(0 0 14px #ef4444); }
}

/* Tarjeta Popup del Mapa */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
}

.map-popup-card {
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  padding: 4px 2px;
}

.map-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 13.5px;
}

.map-popup-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

/* ── Radar Táctico Ultraliviano (0 Datos) ────────────────────────── */
.tactical-radar-container {
  width: 100%;
  height: 100%;
  background: #090d16;
  color: #f8fafc;
  font-family: inherit;
}

.tactical-radar-split {
  display: flex;
  flex-direction: row;
  height: 100%;
}

.tactical-squad-panel {
  background: rgba(15, 23, 42, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.map-mode-btn {
  transition: all 0.15s ease;
  font-weight: 600;
  cursor: pointer;
}

.map-mode-btn.active {
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

@keyframes radarSweepDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

@media (max-width: 768px) {
  .tactical-radar-split {
    flex-direction: column !important;
  }
  .tactical-squad-panel {
    max-width: 100% !important;
    min-width: 100% !important;
    border-left: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    max-height: 250px;
  }
}

/* ============================================================
   INTERFAZ MINIMALISTA TÉCNICO EN TERRENO (APK DEDICADA)
   ============================================================ */
@keyframes pulseWarning {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.tech-terreno-container {
  animation: fadeInTerreno 0.2s ease-in-out;
}

@keyframes fadeInTerreno {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tech-card-terreno {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tech-card-terreno:active {
  transform: scale(0.99);
}

@media (max-width: 600px) {
  .tech-terreno-container {
    padding-left: 6px;
    padding-right: 6px;
  }
}

/* Modo Ligero para Mapa OpenStreetMap (tonos limpios de alto contraste) */
.map-lite-mode .leaflet-tile-pane {
  filter: contrast(98%) brightness(101%) saturate(92%);
}

/* ============================================================
   KLEVER FLOATING ASSIGNMENT BANNER (Heads-up in-app notification)
   Aviso flotante superior de alta prioridad para técnicos
   ============================================================ */
#kleverFloatingAssignmentBanner {
  position: fixed !important;
  top: max(10px, env(safe-area-inset-top, 10px)) !important;
  left: 10px !important;
  right: 10px !important;
  max-width: 480px !important;
  margin: 0 auto !important;
  z-index: 9999999 !important;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-130%);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
}

#kleverFloatingAssignmentBanner.kfa-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: all !important;
}

.klever-floating-alert-inner {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.98), rgba(15, 23, 42, 0.98)) !important;
  border: 1.5px solid #6366f1 !important;
  border-radius: 16px !important;
  padding: 12px 14px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 25px rgba(99, 102, 241, 0.4) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  color: #f8fafc !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.kfa-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

.kfa-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.15) !important;
  padding: 3px 8px !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.kfa-pulse-dot {
  width: 7px !important;
  height: 7px !important;
  background: #38bdf8 !important;
  border-radius: 50% !important;
  box-shadow: 0 0 8px #38bdf8 !important;
  animation: kfaPulse 1.2s infinite !important;
}

@keyframes kfaPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.6; }
}

.kfa-time {
  font-size: 11.5px !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  margin-left: auto !important;
}

.kfa-close-btn {
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  padding: 0 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.kfa-content {
  cursor: pointer !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.kfa-title {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.3 !important;
}

.kfa-subtitle {
  font-size: 12.5px !important;
  color: #cbd5e1 !important;
  line-height: 1.35 !important;
}

.kfa-actions {
  display: flex !important;
  justify-content: flex-end !important;
  margin-top: 3px !important;
}

.kfa-btn-action {
  background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  justify-content: center !important;
}

.kfa-btn-action:active {
  transform: scale(0.98) !important;
}

/* Modal de Mapa GPS & Rutas en Terreno (Pantalla Completa en Móvil/APK) */
#gpsMapModal {
  z-index: 99999 !important;
}
#gpsMapModal .modal {
  max-width: 1200px;
  width: 96vw;
  height: 92vh;
  max-height: 94vh;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
  #gpsMapModal {
    padding: 0 !important;
    z-index: 999999 !important;
  }
  #gpsMapModal .modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
  }
  #gpsMapModal .modal-header {
    padding: 10px 14px !important;
  }
  #gpsMapModal #modalMapFilters {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
}

/* Modal de Notificaciones y Servicios Asignados (Campana Superior) */
#notificationsModal {
  z-index: 999999 !important;
}
#notificationsModal .modal {
  max-width: 520px;
  width: 96%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}
@media (max-width: 768px) {
  #notificationsModal {
    padding: 12px !important;
    z-index: 999999 !important;
  }
  #notificationsModal .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 14px !important;
  }
}



