﻿/* ══════════════════════════════════════════════════════════════
   S-Work Pro — CSS Principal (extraído de CRM_Pro_V2_vf2_VR56.html L20-239)
══════════════════════════════════════════════════════════════ */

html,body{overflow-x:hidden}body{font-family:sans-serif;background:#f9fafb;margin:0;padding:0}
.modal{display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.12);z-index:1000;overflow-y:auto}
.modal>div{box-shadow:0 18px 55px rgba(0,0,0,.45)}
.modal.active{display:flex;align-items:center;justify-content:center;padding:1rem}
.modal.modal-wide>div{max-width:720px!important}
.linea-doc{display:grid;grid-template-columns:3fr 70px 90px 60px 90px 28px;gap:3px;align-items:center;padding:4px 6px;border-bottom:1px solid #f0f0f0}
.linea-doc:last-child{border-bottom:none}
.linea-doc input{padding:3px 5px;border:1px solid #d1d5db;border-radius:4px;font-size:12px;width:100%}
.linea-doc input:focus{outline:none;border-color:#5f8f9c}
.cl-buscador-wrap{position:relative}
.cl-drop{display:none;position:absolute;z-index:9999;width:100%;background:#fff;border:1px solid #ddd;border-radius:6px;max-height:160px;overflow-y:auto;box-shadow:0 4px 12px rgba(0,0,0,.15);top:100%;left:0}
.cl-drop-item{padding:8px 10px;cursor:pointer;font-size:13px;border-bottom:1px solid #f3f4f6}
.cl-drop-item:hover{background:#eef1f5}
.doc-totales{background:#eef3ee;border:1px solid #cbe0cf;border-radius:6px;padding:8px;margin-bottom:8px;font-size:13px}
@media print{.no-print{display:none!important}.ficha-print{font-family:Arial,sans-serif;color:#111}}
.tp-linea-drop{position:absolute;z-index:9999;background:#fff;border:1px solid #bae6fd;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,.15);max-height:160px;overflow-y:auto;min-width:280px}
.tp-linea-item{padding:6px 10px;cursor:pointer;font-size:12px;border-bottom:1px solid #f0f9ff}
.tp-linea-item:hover{background:#e0f2fe}
.tab-content{display:none}.tab-content.active{display:block}
/* 2026-07-01: greyar por COLOR, no por opacity. La opacity creaba stacking context en la fila
   y atrapaba el dropdown (position:fixed) detras de las filas de abajo -> no se podia clicar
   Editar/Ver Ficha en filas completadas/albaranadas. El color no crea stacking context. */
.completado{text-decoration:line-through;color:#9ca3af;border-left:3px solid #77a693}
.completado .dropdown-content a{color:#374151}
.urgente{border-left:3px solid #a86a6a;background:#ece0dc}
.dropdown{position:relative;display:inline-block}
.dropdown-content{display:none;position:fixed;background:#fff;min-width:140px;box-shadow:0 4px 16px rgba(0,0,0,.2);z-index:9999;border-radius:8px;padding:4px 0}
.dropdown-content.show{display:block}
.dropdown-content a{color:#374151;padding:10px 14px;text-decoration:none;display:block;font-size:13px}
.dropdown-content a:hover{background:#f3f4f6}
/* 2026-07-01: columnas de dinero -> cabecera alineada a la derecha (sobre los números, que ya van a la derecha). Homogéneo en todas las secciones. */
th[data-sort="base"],th[data-sort="total"],th[data-sort="importe"],th[data-sort="comision"]{text-align:right}
/* 2026-07-01: Nº / Fecha / Hora / Estado / Tipo -> cabecera centrada, homogéneo en todas las secciones. */
/* 2026-07-01: ajuste visual tablas CRM. Numeros/fechas/horas/tipos/estados centrados; textos largos con ellipsis y tooltip nativo. */
#t-tar td:nth-child(1),#t-tar td:nth-child(2),#t-tar td:nth-child(3),#t-tar td:nth-child(5),#t-tar td:nth-child(7),
#t-o td:nth-child(1),#t-o td:nth-child(2),#t-o td:nth-child(3),#t-o td:nth-child(6),
#t-alb td:nth-child(1),#t-alb td:nth-child(2),#t-alb td:nth-child(3),#t-alb td:nth-child(5),#t-alb td:nth-child(10){text-align:center}
#t-tar td:nth-child(5) span{margin:0 auto;justify-content:center}
#t-o td:nth-child(4),#t-alb td:nth-child(4),#t-alb td:nth-child(6){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
th[data-sort="numTar"],th[data-sort="numOferta"],th[data-sort="numAlbaran"],th[data-sort="numOT"],th[data-sort="numPedido"],th[data-sort="num"],th[data-sort="fecha"],th[data-sort="fechaPedido"],th[data-sort="fechaEntrega"],th[data-sort="hora"],th[data-sort="estado"],th[data-sort="tipo"],th[data-sort="tipoTarea"],th[data-sort="numero"],th[data-sort="plazo"],th[data-sort="_otestado"]{text-align:center}
/* 2026-07-01: centrar columnas cortas en CELDAS (mismo criterio que cabeceras). Money sigue a la derecha. */
#t-com td:nth-child(1),#t-com td:nth-child(3),#t-com td:nth-child(4),#t-ped td:nth-child(2),#t-ped td:nth-child(4),#t-ped td:nth-child(5),#t-ped td:nth-child(8),#t-aud td:nth-child(2),#t-aud td:nth-child(6),#t-c td:nth-child(2),#t-p td:nth-child(2),#t-v td:nth-child(2),#t-v td:nth-child(5),#t-v td:nth-child(6),#t-ll td:nth-child(2),#t-ll td:nth-child(5){text-align:center}
#mcont .mb-2:first-child{display:flex;flex-wrap:wrap;gap:8px 16px;padding:10px 12px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;margin-bottom:12px}
#mcont .mb-2:first-child label{display:flex;align-items:center;gap:4px;cursor:pointer;font-size:13px;white-space:nowrap}
@media print{body *{visibility:hidden}.printarea,.printarea *{visibility:visible}.printarea{position:absolute;left:0;top:0}}
button{transition:all .2s ease}
button:hover{filter:brightness(1.15);transform:translateY(-1px);box-shadow:0 2px 8px rgba(0,0,0,.15)}
button:active{transform:translateY(0);filter:brightness(0.95)}
.tab-btn{transition:all .2s ease}
.tab-btn:hover{filter:brightness(1.15);transform:translateY(-1px)}
a.text-blue-600{transition:all .15s ease}
a.text-blue-600:hover{transform:scale(1.3);display:inline-block}
@keyframes pulse-mic{0%{box-shadow:0 0 0 0 rgba(220,38,38,.5)}70%{box-shadow:0 0 0 8px rgba(220,38,38,0)}100%{box-shadow:0 0 0 0 rgba(220,38,38,0)}}
.dash-panel{transition:transform .2s ease,box-shadow .2s ease}
.dash-panel.dragging{opacity:.4;transform:scale(0.95)}
.dash-panel.drag-over{box-shadow:0 0 0 3px #7189b3;transform:scale(1.02)}
.dash-handle:hover{color:#7189b3 !important}
.dash-handle{user-select:none}
#sidebar-nav a[data-sec]{transition:border-top 0.15s}
#sidebar-nav a[data-sec]:hover .drag-handle{opacity:0.8 !important}
@keyframes slideIn{from{transform:translateX(100px);opacity:0}to{transform:translateX(0);opacity:1}}

/* ═══════════════════════════════════════════════════════
   SIDEBAR FIJO IZQUIERDO — S-WORK PRO
   ══════════════════════════════════════════════════════ */

/* Navbar fija en la parte superior */
#app-navbar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:200;
}

/* Espacio para que el contenido no quede tapado por el navbar.
   --navbar-h la fija _syncNavbarHeight() (app-modules.js) con la altura REAL
   de #app-navbar; 72px es solo el valor de respaldo antes de que corra el JS. */
#crm-app > #crm-sidebar,
#crm-app > div:not(#app-navbar){
  margin-top:var(--navbar-h,72px);
}

/* Sidebar fijo a la izquierda debajo del navbar */
#crm-sidebar{
  position:fixed;
  top:var(--navbar-h,72px);
  left:0;
  width:210px;
  height:calc(100vh - var(--navbar-h,72px));
  background:#f1f3f5;
  border-right:1px solid #dee2e6;
  z-index:100;
  overflow:hidden;
  transition:width 0.25s ease,opacity 0.2s ease;
  display:flex;
  flex-direction:column;
}
#crm-sidebar.collapsed{
  width:0 !important;
  opacity:0;
  pointer-events:none;
}
#sidebar-inner{
  width:210px;
  height:100%;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
}
#sidebar-nav{flex:1;padding-bottom:20px}
#sidebar-nav a{
  display:block !important;
  padding:9px 14px 9px 12px;
  font-size:12.5px;
  color:#495057;
  text-decoration:none;
  border-left:3px solid transparent;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  transition:background 0.12s,color 0.12s,border-color 0.12s;
}
#sidebar-nav a:hover{
  background:#e9ecef !important;
  color:#374151;
  border-left-color:#9ca3af;
}
#sidebar-nav a.active{
  background:#e8e8e8 !important;
  color:#374151;
  font-weight:600;
  border-left-color:#9ca3af;
}
#sidebar-nav .drag-handle{
  display:inline-block;
  opacity:0.25;
  font-size:10px;
  margin-right:5px;
  cursor:grab;
}

/* Contenido desplazado a la derecha del sidebar fijo */
#content-dashboard,
#content-estadisticas,#content-clientes,#content-prospectos,
#content-ofertas,#content-ots,#content-visitas,#content-llamadas,
#content-proveedores,#content-pedidos,#content-comisiones,
#content-albaranes,#content-tareas,#content-auditorias,#content-planificador,
#content-recursos{
  margin-left:210px;
  width:calc(100vw - 210px);
  max-width:calc(100vw - 210px);
  box-sizing:border-box;
  overflow:hidden;
  transition:margin-left 0.25s ease, width 0.25s ease;
}
body.sidebar-collapsed #content-dashboard,
body.sidebar-collapsed #content-estadisticas,
body.sidebar-collapsed #content-clientes,
body.sidebar-collapsed #content-prospectos,
body.sidebar-collapsed #content-ofertas,
body.sidebar-collapsed #content-ots,
body.sidebar-collapsed #content-visitas,
body.sidebar-collapsed #content-llamadas,
body.sidebar-collapsed #content-proveedores,
body.sidebar-collapsed #content-pedidos,
body.sidebar-collapsed #content-comisiones,
body.sidebar-collapsed #content-albaranes,
body.sidebar-collapsed #content-tareas,
body.sidebar-collapsed #content-auditorias,
body.sidebar-collapsed #content-planificador,
body.sidebar-collapsed #content-recursos{
  margin-left:0;
  width:100vw;
  max-width:100vw;
}

/* 2026-07-10: Planificador y Recursos estan fuera del bloque #crm-app que recibe el margen del navbar. */
#content-planificador,
#content-recursos{
  margin-top:var(--navbar-h,72px);
}
/* Dark mode */
body.dark-mode #crm-sidebar{background:#1c1c1e;border-right-color:#3a3a3c}
body.dark-mode #sidebar-nav a{color:#aeaeb2}
body.dark-mode #sidebar-nav a:hover{background:#2c2c2e !important;color:#f2f2f7;border-left-color:#60a5fa}
body.dark-mode #sidebar-nav a.active{background:#34506b !important;color:#b3c4de;border-left-color:#7189b3}

/* ── Panel Alertas — adaptativo claro/oscuro ─────────── */
.alrt-h-venc{color:#a86a6a;background:#ece0dc}
.alrt-card-venc{background:#f5f0ee;color:#1f2937}
.alrt-h-cruce{color:#b58c56;background:#f5f5f4}
.alrt-card-cruce{background:#f6f3ea;color:#1f2937}
.alrt-h-com{color:#8579a6;background:#ebe4f0}
.alrt-card-com{background:#f4f1f7;color:#1f2937}
body.dark-mode .alrt-h-venc{color:#cf9a9a;background:#290a0a}
body.dark-mode .alrt-card-venc{background:#1c0a0a;color:#f2f2f7}
body.dark-mode .alrt-h-cruce{color:#fbbf24;background:#291509}
body.dark-mode .alrt-card-cruce{background:#1a1003;color:#f2f2f7}
body.dark-mode .alrt-h-com{color:#c4b5fd;background:#190a29}
body.dark-mode .alrt-card-com{background:#120820;color:#f2f2f7}
/* Panel alertas - mejoras dark mode */
body.dark-mode #alertas-sistema{color:#f2f2f7}
body.dark-mode .alrt-card-venc:hover,body.dark-mode .alrt-card-cruce:hover,body.dark-mode .alrt-card-com:hover{filter:brightness(1.15)}
body.dark-mode .alrt-card-venc{cursor:pointer}
body.dark-mode .alrt-card-cruce span{color:#fbbf24!important}
body.dark-mode .alrt-card-com span{color:#c4b5fd!important}

/* Panel config (Paneles del Dashboard) dark mode */
body.dark-mode #panel-config{background:#1c1c1e !important;border-color:#3a3a3c !important;color:#f2f2f7}
body.dark-mode #panel-config h4{color:#f2f2f7 !important}
body.dark-mode #panel-config label{background:#2c2c2e !important;border-color:#3a3a3c !important;color:#aeaeb2 !important}
body.dark-mode #panel-checkboxes label{background:#2c2c2e !important;border-color:#3a3a3c !important;color:#aeaeb2}
body.dark-mode #panel-checkboxes label[style*="background:#eef3ee"]{background:#0d2318 !important;border-color:#166534 !important;color:#86efac !important}
body.dark-mode #panel-checkboxes label[style*="background:#f5f0ee"]{background:#290a0a !important;border-color:#7f1d1d !important;color:#fca5a5 !important}

/* Planificador: grid ocupa 100% sin padding lateral.
   2026-07-06: quitado el margin-top:112px fijo (dejaba ~40px de hueco muerto
   vs el resto de secciones, que usan var(--navbar-h) real ~53-72px). Ahora
   Planificador/Recursos heredan la misma altura dinamica que todas las demas. */
#content-planificador{background:#f2f2f7}
#content-planificador > div{padding:26px 30px 16px !important;box-sizing:border-box;width:100%;overflow:visible;background:#f2f2f7 !important;box-shadow:none !important;border-radius:0 !important}
#plan-content{width:100%;overflow:hidden}
#plan-content > div[style*="grid"]{width:100% !important;box-sizing:border-box}

/* 2026-07-06: cabecera y vista Mes alineadas con Licit GO Planificacion.
   Mantiene el scroll continuo por semanas sin recuperar el margin-top fijo. */
.plan-act-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;flex-wrap:wrap;gap:10px}
.plan-act-left{flex:1;min-width:0}
.plan-act-right{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.plan-pg-title{font-size:24px;font-weight:700;color:#111827;line-height:1.2;letter-spacing:-.5px}
.plan-pg-sub{font-size:13px;color:#6b7280;margin-top:3px;display:block}
.plan-dot{display:inline-block;width:8px;height:8px;border-radius:999px;margin-right:5px;vertical-align:1px}
.plan-btn{display:inline-flex;align-items:center;gap:4px;border-radius:8px;padding:6px 12px;font-size:12px;font-weight:600;line-height:1.2;cursor:pointer;border:1px solid #d1d5db;background:#fff;color:#374151;transition:all .15s ease}
.plan-btn:hover{background:#f9fafb;border-color:#34506b;color:#34506b}
.plan-btn-primary{background:#8579a6;border-color:#8579a6;color:#fff}
.plan-btn-primary:hover{background:#746698;border-color:#746698;color:#fff}
.plan-btn-secondary{background:#fff;color:#374151}
.plan-cal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;flex-wrap:wrap;gap:10px}
.plan-nav{display:flex;align-items:center;gap:8px}
.plan-nav-btn{background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:6px 12px;cursor:pointer;font-size:14px;font-family:inherit;transition:all .15s ease;color:#374151}
.plan-nav-btn:hover{background:#f9fafb;border-color:#5f77a8;color:#5f77a8}
.plan-cal-title{font-size:18px;font-weight:700;color:#111827;min-width:200px;text-align:center}
.plan-views{display:flex;gap:2px;padding:3px;background:#f9fafb;border-radius:8px}
.plan-vbtn{border:none;background:transparent;border-radius:6px;padding:6px 14px;cursor:pointer;font-size:12px;font-weight:600;color:#6b7280;font-family:inherit;transition:all .15s ease}
.plan-vbtn:hover{background:#e5e7eb;color:#374151}
.plan-vbtn.active{background:#fff;color:#111827;box-shadow:0 1px 3px rgba(0,0,0,.1)}
.plan-month-dow{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:#e5e5ea;border-radius:12px 12px 0 0;overflow:hidden;box-sizing:border-box;padding-right:var(--plan-scrollbar-w,0px)}
.plan-dow{padding:8px;text-align:center;font-size:10px;font-weight:700;color:#8e8e93;background:#f2f2f7;letter-spacing:.8px;text-transform:uppercase}
.plan-dow.weekend{color:#8e8e93;background:#f2f2f7}
.plan-month-scroll{max-height:660px;overflow-y:auto;overflow-x:hidden;border-radius:0 0 12px 12px;background:#e5e5ea;scroll-behavior:auto;scrollbar-gutter:stable}
.plan-month-grid{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:110px;gap:1px;background:#e5e5ea}
.plan-day{height:110px;padding:6px 8px;background:#fff;overflow:hidden;position:relative;box-sizing:border-box}
.plan-workday{cursor:pointer;transition:background .15s ease}
.plan-workday:hover{background:#eef1f5}
.plan-day.today{background:#eef3ef}
/* ── Timeline Día/Semana del planificador (2026-07-17): eventos como BLOQUES sobre la franja horaria real (patrón Licit GO). Cabecera + franja "Sin hora" sticky dentro del scroll → columnas siempre alineadas sin cálculo de scrollbar. ── */
.plan-tl-scroll{max-height:640px;overflow-y:auto;overflow-x:hidden;background:#e5e5ea;border-radius:12px}
.plan-tl-dow{position:sticky;top:0;z-index:6;display:grid;grid-template-columns:56px repeat(7,minmax(0,1fr));gap:1px;background:#e5e5ea}
.plan-tl-corner{background:#f3f4f6}
.plan-tl-dowc{background:#f3f4f6;text-align:center;font-size:12px;font-weight:600;color:#374151;padding:8px 2px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.plan-tl-dowc.today{background:#eef1f5;color:#5f77a8;font-weight:800}
.plan-tl-nohora{position:sticky;top:35px;z-index:5;display:grid;grid-template-columns:56px repeat(7,minmax(0,1fr));gap:1px;background:#e5e5ea}
.plan-tl-nohora-lbl{background:#f3f4f6;font-size:10px;color:#9ca3af;text-align:right;padding:4px 6px;display:flex;align-items:center;justify-content:flex-end;line-height:1.1}
.plan-tl-nohora-day{background:#fff;min-height:26px;padding:3px;display:flex;flex-wrap:wrap;gap:3px;align-content:flex-start;cursor:pointer}
.plan-tl-nohora-day-full{grid-column:2 / -1}
.plan-tl-chip{font-size:10px;color:#fff;border-radius:4px;padding:1px 6px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cal-tl{display:grid;gap:1px;background:#e5e5ea}
.cal-tl-hours{display:flex;flex-direction:column;background:#f3f4f6}
.cal-tl-hh{font-size:11px;color:#9ca3af;text-align:right;padding:1px 6px;box-sizing:border-box;border-bottom:1px solid #e5e7eb}
.cal-tl-day{position:relative;background:#fff;min-width:0}
.cal-tl-day.today-col{background:#eef1f5}
/* Cada celda = 1 hora. Líneas discretas (José 2026-07-17: no cargar la pantalla):
   hora = línea suave (border-bottom); media hora = línea casi inapreciable.
   Sin cuartos. El posicionamiento de eventos es por minutos en JS, NO depende de estas líneas. */
.cal-tl-slot{box-sizing:border-box;border-bottom:1px solid #e5e7eb;cursor:pointer;background-image:linear-gradient(to bottom,transparent calc(50% - 0.5px),#f0f1f3 calc(50% - 0.5px),#f0f1f3 calc(50% + 0.5px),transparent calc(50% + 0.5px))}
.cal-tl-slot:hover{background-color:#f6f7f9}
.cal-evt-block{box-sizing:border-box;padding:2px 5px;font-size:10px;line-height:1.12;z-index:2;box-shadow:0 1px 2px rgba(0,0,0,.15);border-radius:4px;white-space:normal;overflow:hidden;cursor:pointer;border:1px solid transparent}
.plan-weekend{background:#f9fafb;opacity:.45}
.plan-month-divider{margin:-6px -8px 4px -8px;padding:3px 8px 2px;font-size:9px;font-weight:800;color:#5f77a8;background:#eef1f5;border-bottom:1px solid #dde3ec;text-transform:uppercase;letter-spacing:.4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}



/* 2026-07-01: reparacion estetica Ofertas/Albaranes. Cabeceras legibles y texto largo en celdas. */
.swork-table{table-layout:fixed;width:100%;border-collapse:collapse}
.swork-table th{white-space:nowrap;overflow:visible;text-overflow:clip;vertical-align:middle}
.swork-table-ofertas th:nth-child(1),.swork-table-ofertas th:nth-child(2),.swork-table-ofertas th:nth-child(3),.swork-table-ofertas th:nth-child(7),.swork-table-ofertas th:nth-child(8),
.swork-table-albaranes th:nth-child(1),.swork-table-albaranes th:nth-child(2),.swork-table-albaranes th:nth-child(3),.swork-table-albaranes th:nth-child(5),.swork-table-albaranes th:nth-child(10),.swork-table-albaranes th:nth-child(11){text-align:center}
.swork-table-ofertas th:nth-child(6),.swork-table-albaranes th:nth-child(7),.swork-table-albaranes th:nth-child(8),.swork-table-albaranes th:nth-child(9){text-align:right}
.swork-table-ofertas td:nth-child(4),.swork-table-ofertas td:nth-child(5),.swork-table-albaranes td:nth-child(4),.swork-table-albaranes td:nth-child(6){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.swork-table-ofertas td:nth-child(6),.swork-table-albaranes td:nth-child(7),.swork-table-albaranes td:nth-child(8),.swork-table-albaranes td:nth-child(9){text-align:right;white-space:nowrap}
/* Albaranes/Ofertas: ancho minimo para que las columnas NO se pisen; el contenedor (overflow-x:auto) muestra scroll horizontal cuando la ventana es estrecha */
.swork-table-albaranes{min-width:1080px}
.swork-table-ofertas{min-width:900px}

/* 2026-07-01: Estadísticas — vista que se AJUSTA a la pantalla (portátil/iPad/iPhone). */
#content-estadisticas > div > *{flex:0 0 auto}
#content-estadisticas .est-cards > div{padding:3px 2px;line-height:1.05}
#content-estadisticas .est-cards p{margin:0}
#content-estadisticas .est-cards p:first-child{font-size:9px}
#content-estadisticas .est-cards p:last-child{font-size:13px !important}
#content-estadisticas #stats-negocio{max-height:34vh;overflow:auto;margin-bottom:6px !important}
#content-estadisticas #stats-negocio .p-3{padding:6px 8px}
#content-estadisticas #stats-negocio .grid{gap:6px !important;margin-bottom:6px !important}
#content-estadisticas #stats-negocio .text-lg{font-size:15px}
#content-estadisticas #stats-negocio .font-bold.text-sm{font-size:12px;margin-bottom:2px}
#content-estadisticas .grid.grid-cols-3.gap-4{margin-bottom:6px !important}
#content-estadisticas .grid.grid-cols-3.gap-4 select{padding:5px 8px;font-size:13px}
#content-estadisticas > div > div:first-child{margin-bottom:6px !important}
#content-estadisticas #stats-resumen{padding:5px 10px !important;margin-top:6px !important}

/* 2026-07-09: Visitas y planificador: hora visible y layout respirable en ventanas estrechas. */
.plan-list-row{min-width:0;background:#fff}
.plan-list-label{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.35}
.plan-list-actions{display:inline-flex;gap:6px;align-items:center;flex:0 0 auto;margin-left:auto}
.plan-list-actions:empty{display:none}
.plan-day .truncate{min-width:0}
.swork-table-wrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid #e5e7eb;border-radius:8px;background:#fff}
.swork-table-visitas{width:100%;min-width:0;table-layout:fixed}
.swork-table-visitas th,.swork-table-visitas td{padding:7px 6px;vertical-align:middle;min-width:0}
.swork-table-visitas th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.swork-table-visitas th:nth-child(1),.swork-table-visitas td:nth-child(1){width:30px;text-align:center}
.swork-table-visitas th:nth-child(2),.swork-table-visitas td:nth-child(2){width:58px;text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}
.swork-table-visitas th:nth-child(3),.swork-table-visitas td:nth-child(3){width:132px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.swork-table-visitas th:nth-child(4),.swork-table-visitas td:nth-child(4){width:26px;text-align:center;padding-left:0;padding-right:0}
.swork-table-visitas th:nth-child(5),.swork-table-visitas td:nth-child(5){width:84px;text-align:center}
.swork-table-visitas th:nth-child(6),.swork-table-visitas td:nth-child(6){width:78px;text-align:center}
.swork-table-visitas th:nth-child(8),.swork-table-visitas td:nth-child(8){width:36px;text-align:center;padding-left:2px;padding-right:2px}
.swork-table-visitas th:nth-child(4),.swork-table-visitas td:nth-child(4){position:relative}.swork-table-visitas th:nth-child(4){font-size:14px}.swork-table-visitas td:nth-child(4){font-size:16px;line-height:1;text-align:center}
.swork-table-visitas .visita-dir-icon{display:inline-block;transform:translateX(-10px)}.swork-table-visitas td:nth-child(4) a{display:inline-flex;align-items:center;justify-content:center;width:22px;height:24px;margin:0 auto;border-radius:6px;text-decoration:none;transform:translateX(-10px)}
.swork-table-visitas td:nth-child(4) a:hover{background:#eef1f5}
.swork-table-visitas .visita-resultado{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;line-height:1.35}
#content-visitas .tar-day-hdr td>div{gap:10px}
#content-visitas .tar-day-hdr td>div>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:760px){
  #content-visitas>div{padding:14px 12px!important}
  #content-visitas .flex.justify-between.mb-4{gap:10px;align-items:flex-start;flex-wrap:wrap}
  .swork-table-visitas th,.swork-table-visitas td{padding:6px 4px;font-size:12px}
  .swork-table-visitas th:nth-child(3),.swork-table-visitas td:nth-child(3){width:108px}
  .swork-table-visitas th:nth-child(5),.swork-table-visitas td:nth-child(5){width:74px}
  .swork-table-visitas th:nth-child(6),.swork-table-visitas td:nth-child(6){width:68px}
  .plan-list-row{align-items:flex-start;gap:8px;flex-wrap:wrap}
  .plan-list-label{white-space:normal;flex-basis:100%}
  .plan-list-actions{margin-left:0}
}

/* 2026-07-13: unificar tamaño botones de cabecera de secciones */
#crm-app .tab-content > div > .flex.justify-between.mb-4 > .flex.gap-2,
#content-recursos > div > .flex.justify-between.items-center.mb-4 > .flex.gap-2,
#content-planificador .plan-act-right{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  flex-wrap:wrap !important;
}
#crm-app .tab-content > div > .flex.justify-between.mb-4 > .flex.gap-2 > button,
#content-recursos > div > .flex.justify-between.items-center.mb-4 > .flex.gap-2 > button,
#content-planificador .plan-act-right > button{
  height:40px !important;
  min-height:40px !important;
  max-height:40px !important;
  padding:0 14px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  box-sizing:border-box !important;
  border-radius:6px !important;
  font-size:14px !important;
  font-weight:600 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  margin:0 !important;
  vertical-align:middle !important;
}

/* 2026-07-13b: cabeceras de seccion limpias y alineadas */
#crm-app .tab-content > div > .flex.justify-between.mb-4,
#crm-app .tab-content > div > .flex.justify-between.items-center.mb-4,
#content-recursos > div > .flex.justify-between.items-center.mb-4,
#content-planificador .plan-act-bar{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  flex-wrap:wrap !important;
}
#crm-app .tab-content > div > .flex.justify-between.mb-4 > h2,
#crm-app .tab-content > div > .flex.justify-between.items-center.mb-4 > h2,
#content-recursos > div > .flex.justify-between.items-center.mb-4 > h2,
#content-planificador .plan-pg-title{
  margin:0 !important;
  line-height:40px !important;
  min-height:40px !important;
  white-space:nowrap !important;
}
#crm-app .tab-content > div > .flex.justify-between.mb-4 > .flex.gap-2,
#crm-app .tab-content > div > .flex.justify-between.items-center.mb-4 > .flex.gap-2,
#content-recursos > div > .flex.justify-between.items-center.mb-4 > .flex.gap-2,
#content-planificador .plan-act-right{
  min-height:40px !important;
}
#crm-app .tab-content > div > .flex.justify-between.mb-4 > button,
#crm-app .tab-content > div > .flex.justify-between.items-center.mb-4 > button,
#crm-app .tab-content > div > .flex.justify-between.mb-4 > .flex.gap-2 > button,
#crm-app .tab-content > div > .flex.justify-between.items-center.mb-4 > .flex.gap-2 > button,
#content-recursos > div > .flex.justify-between.items-center.mb-4 > .flex.gap-2 > button,
#content-planificador .plan-act-right > button{
  height:40px !important;
  min-height:40px !important;
  max-height:40px !important;
  padding:0 14px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  box-sizing:border-box !important;
  border-radius:6px !important;
  font-size:14px !important;
  font-weight:600 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  margin:0 !important;
  vertical-align:middle !important;
}
