/* =============================================================================
 * NS Gestión · CRM comercial — r124. Estilos propios (prefijo crm-) con los tokens del sistema de diseño.
 * ========================================================================== */
.crm-page{display:flex;flex-direction:column;gap:12px;min-width:0}
.crm-cab{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:var(--ds-radius,14px);padding:16px 18px;box-shadow:var(--ds-shadow)}
.crm-cab h2{margin:0 0 3px;font-size:20px}
.crm-cab p{margin:0;color:var(--ds-muted,#64748b);font-size:13.5px}
.crm-cab-acc{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.crm-cab-acc .btn-primary,.crm-cab-acc .btn-light{white-space:nowrap}
.crm-campana{all:unset;position:relative;cursor:pointer;width:38px;height:38px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--ds-line,#e6eaf0);background:var(--ds-surface,#fff);color:var(--ds-ink-2,#334155)}
.crm-campana svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.crm-campana b{position:absolute;top:-6px;right:-6px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--ds-bad,#dc2626);color:#fff;font-size:11px;line-height:18px;text-align:center}
.crm-sub .nsb-subnav{margin:0!important;max-width:100%}
@media (max-width:760px){.crm-sub .nsb-subnav{display:flex!important;overflow-x:auto;flex-wrap:nowrap!important}}
.crm-pill{display:inline-flex;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--ds-sunken,#eef1f5);color:var(--ds-ink-2,#334155);font-size:11.5px;font-weight:700;align-items:center;justify-content:center}
.crm-pill.rojo{background:var(--ds-bad,#dc2626);color:#fff}
.crm-cargando{padding:30px;text-align:center;color:var(--ds-muted,#64748b)}
.crm-vacio{padding:28px 18px;text-align:center;color:var(--ds-muted,#64748b);background:var(--ds-surface,#fff);border:1px dashed var(--ds-line-strong,#d5dbe3);border-radius:var(--ds-radius,14px)}
.crm-vacio h3{margin:0 0 6px;color:var(--ds-ink,#0f172a);font-size:15px}
.crm-vacio p{margin:0 0 10px}
.crm-muted{color:var(--ds-muted,#64748b)}
.crm-nota{font-size:12.5px;margin:4px 0 10px}
.crm-rojo{color:var(--ds-bad,#dc2626)}

/* barra de filtros */
.crm-barra{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.crm-barra input[type=search]{flex:1 1 260px;min-width:0;padding:9px 12px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:10px;font:inherit;background:var(--ds-surface,#fff)}
.crm-barra select,.crm-barra input[type=date],.crm-barra input[type=number]{padding:8px 10px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:10px;font:inherit;background:var(--ds-surface,#fff);max-width:100%}
.crm-barra .nsb-subnav{margin:0!important}
.crm-mas{background:var(--ds-surface-2,#f8fafc);border:1px solid var(--ds-line,#e6eaf0);border-radius:12px;padding:10px 12px;align-items:flex-end}
.crm-mas label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:600;color:var(--ds-ink-2,#334155)}
.crm-chk{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--ds-ink-2,#334155);white-space:nowrap}
.crm-resumen{display:flex;gap:16px;flex-wrap:wrap;font-size:13px;color:var(--ds-ink-2,#334155)}
.crm-resumen b{color:var(--ds-ink,#0f172a)}
.crm-aviso{color:var(--ds-warn,#b45309)}

/* tablero Kanban */
.crm-tablero{display:flex;gap:12px;overflow-x:auto;padding:2px 2px 12px;align-items:flex-start;scroll-snap-type:x proximity;min-height:360px}
.crm-col{flex:0 0 288px;max-width:288px;background:var(--ds-sunken,#f1f4f8);border:1px solid var(--ds-line,#e6eaf0);border-radius:14px;display:flex;flex-direction:column;max-height:calc(100vh - 290px);min-height:220px;scroll-snap-align:start;transition:box-shadow .12s,border-color .12s}
.crm-col.crm-sobre{border-color:var(--crm-c,#2457e6);box-shadow:0 0 0 2px color-mix(in srgb,var(--crm-c,#2457e6) 35%,transparent)}
.crm-col-cab{padding:10px 12px 8px;border-top:4px solid var(--crm-c,#64748b);border-radius:14px 14px 0 0;background:var(--ds-surface,#fff);border-bottom:1px solid var(--ds-line,#e6eaf0);display:flex;flex-direction:column;gap:4px}
.crm-col-tit{display:flex;align-items:center;gap:7px;min-width:0}
.crm-col-tit i{width:9px;height:9px;border-radius:50%;background:var(--crm-c,#64748b);flex:none}
.crm-col-tit strong{font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}
.crm-col-tot{display:flex;justify-content:space-between;font-size:12.5px;color:var(--ds-ink-2,#334155);font-weight:600}
.crm-col-tot small{color:var(--ds-muted,#64748b);font-weight:500}
.crm-col-add{all:unset;cursor:pointer;font-size:12.5px;font-weight:600;color:var(--ds-primary,#2457e6);padding:3px 0}
.crm-col-add:hover{text-decoration:underline}
.crm-col-cuerpo{padding:8px;display:flex;flex-direction:column;gap:8px;overflow-y:auto;flex:1;min-height:80px}
.crm-col-vacia{font-size:12.5px;color:var(--ds-faint,#94a3b8);text-align:center;padding:18px 6px;border:1px dashed var(--ds-line-strong,#d5dbe3);border-radius:10px}
.crm-rapida{padding:8px;border-bottom:1px solid var(--ds-line,#e6eaf0);background:var(--ds-surface,#fff)}
.crm-rapida-f{display:flex;flex-direction:column;gap:6px}
.crm-rapida-f input,.crm-rapida-f select{font:inherit;font-size:13px;padding:7px 9px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:8px;min-width:0;width:100%;box-sizing:border-box}
.crm-rapida-2{display:grid;grid-template-columns:1fr 92px;gap:6px}
.crm-rapida-acc{display:flex;gap:6px;justify-content:flex-end}

.crm-card{background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:11px;padding:10px 11px;display:flex;flex-direction:column;gap:6px;cursor:pointer;box-shadow:0 1px 2px rgba(15,23,42,.05);border-left:3px solid transparent;outline:none;user-select:none;-webkit-user-select:none}
.crm-card.mov{cursor:grab;touch-action:pan-y}
.crm-card:hover{border-color:var(--ds-line-strong,#cfd6df);box-shadow:0 3px 10px rgba(15,23,42,.08)}
.crm-card:focus-visible{box-shadow:0 0 0 2px var(--ds-primary,#2457e6)}
.crm-card.alta{border-left-color:var(--ds-bad,#dc2626)}
.crm-card-top{display:flex;gap:6px;align-items:flex-start;justify-content:space-between}
.crm-card-top strong{font-size:13.5px;line-height:1.3;word-break:break-word}
.crm-card-menu{all:unset;cursor:pointer;width:26px;height:22px;border-radius:6px;text-align:center;line-height:20px;color:var(--ds-muted,#64748b);font-weight:800;flex:none}
.crm-card-menu:hover,.crm-card-menu:focus-visible{background:var(--ds-sunken,#eef1f5);color:var(--ds-ink,#0f172a)}
.crm-card-cta{font-size:12.5px;color:var(--ds-muted,#64748b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-card-monto{font-weight:700;font-size:14px;color:var(--ds-ink,#0f172a)}
.crm-card-monto small{font-weight:500;color:var(--ds-muted,#64748b);font-size:11.5px}
.crm-card-etq{display:flex;gap:4px;flex-wrap:wrap}
.crm-card-etq span{font-size:11px;padding:1px 7px;border-radius:999px;background:var(--ds-primary-50,#eef3ff);color:var(--ds-primary,#2457e6);font-weight:600}
.crm-card-marcas{display:flex;gap:4px;flex-wrap:wrap}
.crm-card-pie{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--ds-ink-2,#334155);flex-wrap:wrap}
.crm-prio{color:var(--ds-bad,#dc2626);font-weight:700}
.crm-av{display:inline-flex;width:24px;height:24px;border-radius:50%;background:var(--ds-navy,#1e293b);color:#fff;font-size:10.5px;font-weight:700;align-items:center;justify-content:center;flex:none}
.crm-tag{display:inline-flex;align-items:center;gap:3px;font-size:11px;font-weight:650;padding:1px 7px;border-radius:999px;border:1px solid var(--ds-line,#e6eaf0);background:var(--ds-surface-2,#f8fafc);color:var(--ds-ink-2,#334155);white-space:nowrap}
.crm-tag.rojo{background:var(--ds-bad-50,#fdecec);border-color:#f5c2c2;color:var(--ds-bad,#dc2626)}
.crm-tag.ambar{background:var(--ds-warn-50,#fff7e8);border-color:#f6dfb5;color:var(--ds-warn,#b45309)}
.crm-tag.verde{background:var(--ds-good-50,#eafaf0);border-color:#cdeedb;color:var(--ds-good,#16a34a)}
.crm-tag.azul{background:var(--ds-primary-50,#eef3ff);border-color:var(--ds-primary-100,#dfe8ff);color:var(--ds-primary,#2457e6)}
.crm-tag.gris{color:var(--ds-muted,#64748b)}

/* arrastre */
.crm-fantasma{position:fixed;z-index:9500;pointer-events:none;transform:rotate(2deg);box-shadow:0 14px 30px rgba(15,23,42,.25);opacity:.95;margin:0}
.crm-origen{opacity:.35}
.crm-marcador{border:2px dashed var(--ds-primary,#2457e6);border-radius:11px;background:var(--ds-primary-50,#eef3ff);flex:none;max-height:120px}
body.crm-arrastrando,body.crm-arrastrando *{cursor:grabbing!important;user-select:none!important}

/* menú de tarjeta */
.crm-menu{position:fixed;z-index:9400;min-width:220px;background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:12px;box-shadow:var(--ds-shadow-lg,0 12px 32px rgba(15,23,42,.18));padding:6px;display:flex;flex-direction:column}
.crm-menu-tit{font-size:11.5px;font-weight:700;color:var(--ds-muted,#64748b);padding:6px 10px 4px;text-transform:uppercase;letter-spacing:.03em}
.crm-menu button{all:unset;cursor:pointer;padding:8px 10px;border-radius:8px;font-size:13.5px;display:flex;align-items:center;gap:8px}
.crm-menu button i{width:9px;height:9px;border-radius:50%}
.crm-menu button:hover:not([disabled]),.crm-menu button:focus-visible{background:var(--ds-sunken,#eef1f5)}
.crm-menu button[disabled]{opacity:.45;cursor:default}
.crm-menu hr{border:0;border-top:1px solid var(--ds-line,#e6eaf0);margin:4px 0}

/* panel lateral */
.crm-panel-fondo{position:fixed;inset:0;z-index:8500;background:rgba(15,23,42,0);transition:background .18s}
.crm-panel-fondo.abierto{background:rgba(15,23,42,.35)}
.crm-panel{position:absolute;top:0;right:0;bottom:0;width:min(640px,100%);background:var(--ds-bg,#f6f8fb);box-shadow:-10px 0 30px rgba(15,23,42,.18);transform:translateX(100%);transition:transform .18s ease-out;overflow-y:auto;overscroll-behavior:contain}
.crm-panel-fondo.abierto .crm-panel{transform:none}
.crm-ficha{padding:18px 20px 30px;display:flex;flex-direction:column;gap:12px}
.crm-ficha-cab{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.crm-ficha-cab small{color:var(--ds-muted,#64748b);font-weight:600}
.crm-ficha-cab h3{margin:2px 0 4px;font-size:19px;line-height:1.25}
.crm-ficha-cab p{margin:0;font-size:13.5px}
.crm-x{all:unset;cursor:pointer;width:34px;height:34px;border-radius:9px;text-align:center;font-size:24px;line-height:32px;color:var(--ds-muted,#64748b);flex:none}
.crm-x:hover{background:var(--ds-sunken,#eef1f5)}
.crm-banda{padding:9px 12px;border-radius:10px;font-size:13px;font-weight:600;background:var(--ds-sunken,#eef1f5);color:var(--ds-ink-2,#334155)}
.crm-banda.ganada{background:var(--ds-good-50,#eafaf0);color:#166534}
.crm-banda.perdida{background:var(--ds-bad-50,#fdecec);color:#991b1b}
.crm-pasos{display:flex;gap:3px;overflow-x:auto;padding-bottom:2px}
.crm-pasos button{all:unset;flex:1 1 0;min-width:86px;text-align:center;font-size:11.5px;font-weight:650;padding:7px 6px;background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);color:var(--ds-muted,#64748b);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-pasos button:first-child{border-radius:9px 0 0 9px}.crm-pasos button:last-child{border-radius:0 9px 9px 0}
.crm-pasos button.pasada{background:color-mix(in srgb,var(--crm-c) 14%,#fff);color:var(--ds-ink-2,#334155)}
.crm-pasos button.actual{background:var(--crm-c);color:#fff;border-color:var(--crm-c)}
.crm-pasos button[disabled]{cursor:default}
.crm-pasos button:not([disabled]):hover{border-color:var(--crm-c)}
.crm-ficha-acc{display:flex;gap:6px;flex-wrap:wrap}
.crm-btn-ganar{background:var(--ds-good,#16a34a)!important;border-color:var(--ds-good,#16a34a)!important;color:#fff!important}
.crm-btn-perder{color:var(--ds-bad,#dc2626)!important}
.crm-peligro{color:var(--ds-bad,#dc2626)!important}
.crm-datos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:var(--ds-line,#e6eaf0);border:1px solid var(--ds-line,#e6eaf0);border-radius:12px;overflow:hidden}
.crm-datos>div{background:var(--ds-surface,#fff);padding:9px 12px;display:flex;flex-direction:column;gap:2px;min-width:0}
.crm-datos span{font-size:11.5px;color:var(--ds-muted,#64748b);font-weight:600}
.crm-datos b{font-size:13.5px;font-weight:600;word-break:break-word}
.crm-datos b small{font-weight:500;color:var(--ds-muted,#64748b)}
.crm-desc{background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:12px;padding:10px 12px;font-size:13.5px;white-space:normal}
.crm-ficha-tabs{margin:4px 0 0!important}
.crm-fila-acc{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.crm-h4{margin:8px 0 2px;font-size:14px}
.crm-nota-f{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.crm-nota-f textarea{font:inherit;padding:9px 11px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:10px;resize:vertical}
.crm-nota-f button{align-self:flex-end}
.crm-tl{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.crm-tl li{display:flex;gap:10px;position:relative;padding:0 0 12px}
.crm-tl li::before{content:"";position:absolute;left:13px;top:28px;bottom:0;width:2px;background:var(--ds-line,#e6eaf0)}
.crm-tl li:last-child::before{display:none}
.crm-tl i{font-style:normal;width:28px;height:28px;border-radius:50%;background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);display:flex;align-items:center;justify-content:center;font-size:13px;flex:none}
.crm-tl div{min-width:0;flex:1}
.crm-tl b{font-size:13.5px}
.crm-tl p{margin:2px 0;font-size:13px;color:var(--ds-ink-2,#334155);word-break:break-word}
.crm-tl small{color:var(--ds-muted,#64748b);font-size:11.5px}
.crm-tl li.t-nota div{background:var(--ds-warn-50,#fff9eb);border:1px solid #f6e3b8;border-radius:10px;padding:7px 10px}
.crm-tl li.t-ganada i{background:var(--ds-good-50,#eafaf0)}
.crm-tl li.t-perdida i{background:var(--ds-bad-50,#fdecec)}

/* actividades */
.crm-acts{display:flex;flex-direction:column;gap:6px}
.crm-act{display:flex;gap:10px;align-items:flex-start;background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:11px;padding:9px 11px}
.crm-act.vencida{border-left:3px solid var(--ds-bad,#dc2626)}
.crm-act.hoy{border-left:3px solid var(--ds-warn,#d97706)}
.crm-act.completada{opacity:.75}
.crm-act.completada b{text-decoration:line-through;text-decoration-color:var(--ds-faint,#94a3b8)}
.crm-check{all:unset;cursor:pointer;width:20px;height:20px;border-radius:50%;border:2px solid var(--ds-line-strong,#cbd5e1);flex:none;margin-top:1px;display:inline-flex;align-items:center;justify-content:center;font-size:12px;color:#fff;box-sizing:border-box}
button.crm-check:hover{border-color:var(--ds-good,#16a34a);background:var(--ds-good-50,#eafaf0)}
.crm-check.ok{background:var(--ds-good,#16a34a);border-color:var(--ds-good,#16a34a);cursor:default}
.crm-act-tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.crm-act-tx b{font-size:13.5px}
.crm-act-tx small{font-size:12px;color:var(--ds-muted,#64748b)}
.crm-act-tx p{margin:2px 0 0;font-size:12.5px;color:var(--ds-ink-2,#334155)}
.crm-res{background:var(--ds-surface-2,#f8fafc);border-radius:8px;padding:4px 8px}
.crm-act-acc{display:flex;gap:4px;flex:none}
.crm-mini{margin:0!important}

/* tablas y listas */
.crm-tabla-box{overflow-x:auto;background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:12px}
.crm-tabla{width:100%;border-collapse:collapse;font-size:13px}
.crm-tabla th{text-align:left;font-size:11.5px;color:var(--ds-muted,#64748b);font-weight:700;padding:9px 12px;border-bottom:1px solid var(--ds-line,#e6eaf0);white-space:nowrap;background:var(--ds-surface-2,#f8fafc)}
.crm-tabla td{padding:9px 12px;border-bottom:1px solid var(--ds-line,#eef1f5);vertical-align:middle}
.crm-tabla tr:last-child td{border-bottom:0}
.crm-tabla .right{text-align:right;white-space:nowrap}
.crm-tabla tr.clic{cursor:pointer}
.crm-tabla tr.clic:hover td{background:var(--ds-surface-2,#f8fafc)}
.crm-ficha .crm-tabla{background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:12px;overflow:hidden}
.crm-lista{display:flex;flex-direction:column;gap:5px}
.crm-lista button,.crm-cot-lista button,.crm-avisos button{all:unset;cursor:pointer;display:flex;flex-direction:column;gap:2px;padding:9px 12px;border:1px solid var(--ds-line,#e6eaf0);border-radius:10px;background:var(--ds-surface,#fff);font-size:13.5px}
.crm-lista button span,.crm-cot-lista button span{font-size:12px;color:var(--ds-muted,#64748b)}
.crm-lista button:hover,.crm-cot-lista button:hover:not([disabled]){border-color:var(--ds-primary,#2457e6)}
.crm-cot-lista{display:flex;flex-direction:column;gap:5px;max-height:50vh;overflow:auto;margin-top:8px}
.crm-cot-lista button[disabled]{opacity:.5;cursor:default}
.crm-avisos{display:flex;flex-direction:column;gap:6px}
.crm-avisos button{flex-direction:row;gap:10px;align-items:flex-start}
.crm-avisos button.nueva{border-color:var(--ds-primary-100,#dfe8ff);background:var(--ds-primary-50,#eef3ff)}
.crm-avisos i{font-style:normal;font-size:16px}
.crm-avisos span{display:flex;flex-direction:column;gap:2px}
.crm-avisos small{color:var(--ds-muted,#64748b);font-size:12px}
.crm-subir{display:flex;flex-direction:column;align-items:center;gap:3px;padding:16px;border:2px dashed var(--ds-line-strong,#d5dbe3);border-radius:12px;background:var(--ds-surface,#fff);cursor:pointer;margin-bottom:10px;text-align:center}
.crm-subir input{display:none}
.crm-subir span{font-weight:700;color:var(--ds-primary,#2457e6)}
.crm-subir small{color:var(--ds-muted,#64748b)}
.crm-subir:hover{border-color:var(--ds-primary,#2457e6)}

/* formularios */
.crm-f2,.crm-f3{display:grid;gap:10px}
.crm-f2{grid-template-columns:repeat(2,minmax(0,1fr))}
.crm-f3{grid-template-columns:repeat(3,minmax(0,1fr))}
.crm-f2>div>label{display:block;font-size:13px;font-weight:600;color:var(--ds-ink-2,#334155);margin-bottom:5px}
@media (max-width:620px){.crm-f2,.crm-f3{grid-template-columns:1fr}}
.crm-ac{position:relative}
.crm-ac input{width:100%;box-sizing:border-box;font:inherit;padding:8px 10px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:9px}
.crm-ac-lista{position:absolute;left:0;right:0;top:100%;margin-top:3px;z-index:20;background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:10px;box-shadow:var(--ds-shadow-lg,0 12px 32px rgba(15,23,42,.18));max-height:260px;overflow:auto;display:flex;flex-direction:column;padding:4px}
.crm-ac-lista button{all:unset;cursor:pointer;padding:7px 9px;border-radius:7px;display:flex;flex-direction:column;font-size:13px}
.crm-ac-lista button small{color:var(--ds-muted,#64748b);font-size:11.5px}
.crm-ac-lista button:hover{background:var(--ds-sunken,#eef1f5)}
.crm-nuevo-con{background:var(--ds-surface-2,#f8fafc);border:1px solid var(--ds-line,#e6eaf0);border-radius:10px;padding:10px}

/* dashboard */
.crm-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.crm-kpi{background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:var(--ds-radius,14px);padding:14px 16px;display:flex;flex-direction:column;gap:3px;box-shadow:var(--ds-shadow)}
.crm-kpi small{font-size:12.5px;font-weight:600;color:var(--ds-ink-2,#334155)}
.crm-kpi strong{font-size:22px;font-weight:700;letter-spacing:-.02em}
.crm-kpi span{font-size:12px;color:var(--ds-muted,#64748b)}
.crm-kpi.verde strong{color:var(--ds-good,#16a34a)}
.crm-kpi.rojo span{color:var(--ds-bad,#dc2626);font-weight:600}
.crm-grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(420px,100%),1fr));gap:12px}
.crm-card-box{background:var(--ds-surface,#fff);border:1px solid var(--ds-line,#e6eaf0);border-radius:var(--ds-radius,14px);padding:14px 16px;box-shadow:var(--ds-shadow);min-width:0}
.crm-card-box h3{margin:0 0 12px;font-size:14.5px}
.crm-barras{display:flex;flex-direction:column;gap:8px}
.crm-barra-h{display:grid;grid-template-columns:minmax(80px,140px) 1fr auto;gap:10px;align-items:center;font-size:12.5px}
.crm-barra-h span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ds-ink-2,#334155)}
.crm-barra-h div{height:12px;background:var(--ds-sunken,#eef1f5);border-radius:6px;overflow:hidden}
.crm-barra-h i{display:block;height:100%;background:var(--ds-primary,#2457e6);border-radius:6px;min-width:2px}
.crm-barra-h b{font-weight:600;white-space:nowrap}
.crm-cols{display:flex;align-items:stretch;gap:6px;height:170px;padding-top:6px}
.crm-cols-g{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.crm-cols-b{flex:1;width:100%;display:flex;align-items:flex-end;justify-content:center;gap:2px;border-bottom:1px solid var(--ds-line,#e6eaf0)}
.crm-cols-b i{width:min(16px,40%);border-radius:4px 4px 0 0}
.crm-cols-g small{font-size:10.5px;color:var(--ds-muted,#64748b);white-space:nowrap}
.c1{background:var(--ds-primary,#2457e6)}.c2{background:var(--ds-primary-100,#bcd0fb)}
.crm-leyenda{display:flex;gap:14px;font-size:12px;color:var(--ds-muted,#64748b);margin-top:8px}
.crm-leyenda i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}

/* configuración */
.crm-etapas{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
.crm-etapa{display:grid;grid-template-columns:14px minmax(0,1fr) 50px 100px auto;gap:10px;align-items:center;padding:9px 12px;border:1px solid var(--ds-line,#e6eaf0);border-radius:10px;background:var(--ds-surface,#fff);font-size:13.5px}
.crm-etapa i{width:12px;height:12px;border-radius:50%}
.crm-etapa>div{display:flex;gap:4px}
@media (max-width:620px){.crm-etapa{grid-template-columns:14px 1fr auto}.crm-etapa>span{display:none}.crm-etapa>div{grid-column:1/-1}}
.crm-regla{display:flex;gap:14px;align-items:flex-start;padding:12px 0;border-bottom:1px solid var(--ds-line,#eef1f5)}
.crm-regla:last-child{border-bottom:0}
.crm-regla p{margin:3px 0 6px;font-size:13px;color:var(--ds-ink-2,#334155)}
.crm-param{display:inline-flex;align-items:center;gap:6px;font-size:13px;margin:0 14px 6px 0}
.crm-param input[type=number]{width:70px;padding:5px 8px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:8px;font:inherit}
.crm-param select{padding:5px 8px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:8px;font:inherit}
.crm-switch{position:relative;display:inline-block;width:40px;height:22px;flex:none;margin-top:2px}
.crm-switch input{opacity:0;width:0;height:0}
.crm-switch span{position:absolute;inset:0;background:var(--ds-line-strong,#cbd5e1);border-radius:999px;transition:.15s;cursor:pointer}
.crm-switch span::before{content:"";position:absolute;width:16px;height:16px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.15s}
.crm-switch input:checked+span{background:var(--ds-good,#16a34a)}
.crm-switch input:checked+span::before{transform:translateX(18px)}
.crm-switch input:disabled+span{opacity:.5;cursor:default}
.crm-opciones{display:flex;flex-direction:column;gap:10px;max-width:640px}
.crm-opciones label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:600}
.crm-opciones input,.crm-opciones textarea{font:inherit;font-weight:400;padding:8px 10px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:9px}

/* celular */
@media (max-width:760px){
  .crm-cab{padding:12px 14px}
  .crm-cab-acc{width:100%}
  .crm-cab-acc .btn-primary{flex:1}
  .crm-col{flex-basis:84vw;max-width:84vw;max-height:none}
  .crm-tablero{scroll-snap-type:x mandatory}
  .crm-ficha{padding:14px 14px 30px}
  .crm-datos{grid-template-columns:1fr 1fr}
  .crm-act{flex-wrap:wrap}
  .crm-act-acc{width:100%;justify-content:flex-end}
  .crm-barra-h{grid-template-columns:90px 1fr auto}
}

/* el tema general ensancha los campos al 100 %: en las barras del CRM van en línea */
html body .crm-barra select,html body .crm-barra input[type=date],html body .crm-barra input[type=number]{width:auto!important;flex:0 1 auto;margin:0!important}
html body .crm-barra input[type=search]{width:auto!important;flex:1 1 260px;margin:0!important}
html body .crm-barra .crm-chk input{width:auto!important;margin:0!important}
html body .crm-mas input,html body .crm-mas select{width:150px!important}
html body .crm-param input[type=checkbox],html body .crm-switch input{width:auto!important}
.crm-resp-nom{max-width:90px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:760px){html body .crm-barra select,html body .crm-barra input[type=search]{flex:1 1 100%}}
/* el panel lateral queda sobre la barra del celular; los diálogos que abre, sobre el panel */
.crm-panel-fondo{z-index:9600}
body.crm-panel-abierto .fx-back{z-index:9700}
.crm-menu{z-index:9800}
.crm-tl small{display:block}

/* r128 · Órdenes de trabajo (usa los estilos del CRM) */
.ot-panel{width:min(760px,100%)}
.ot-l{display:flex;flex-direction:column;gap:4px;font-size:12.5px;font-weight:600;color:var(--ds-ink-2,#334155);margin-bottom:8px}
.ot-l textarea{font:inherit;font-weight:400;padding:8px 10px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:9px;resize:vertical}
.ot-cab{display:flex;justify-content:space-between;align-items:center;gap:8px}.ot-cab h3{margin:0 0 10px}
.ot-add{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px;align-items:center}
html body .ot-add input,html body .ot-add select{width:auto!important;margin:0!important;padding:7px 9px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:9px;font:inherit}
html body .ot-add .crm-ac{flex:1 1 240px}html body .ot-add .crm-ac input{width:100%!important}
html body .ot-add input[type=number]{max-width:120px}html body .ot-add #otCarDesc,html body .ot-add #otHorDesc{flex:1 1 200px}
.ot-file{position:relative;overflow:hidden;cursor:pointer}.ot-file input{position:absolute;inset:0;opacity:0;cursor:pointer}
.ot-fotos{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px}
.ot-fotos a{display:flex;flex-direction:column;gap:3px;text-decoration:none;color:inherit;border:1px solid var(--ds-line,#e6eaf0);border-radius:10px;padding:5px;align-items:center;background:var(--ds-surface,#fff)}
.ot-fotos img{width:100%;height:84px;object-fit:cover;border-radius:7px}.ot-fotos span{font-size:34px;height:84px;display:flex;align-items:center}
.ot-tot{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px}.ot-tot div{display:flex;flex-direction:column}
.ot-tot span{font-size:12px;color:var(--ds-muted,#64748b)}.ot-tot b{font-size:15px}.ot-tot .g b{font-size:19px;color:var(--ds-primary,#2457e6)}
.ot-anulado td{opacity:.55;text-decoration:line-through}
.crm-ficha-acc select{padding:7px 9px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:9px;font:inherit;width:auto!important;margin:0!important}
.crm-datos select,.crm-datos input[type=date]{font:inherit;padding:4px 6px;border:1px solid var(--ds-line-strong,#d5dbe3);border-radius:7px;width:auto!important;margin:0!important}
html body.crm-panel-abierto .ns-nav-mobile-toggle,html.mpos-off body.crm-panel-abierto .ns-nav-mobile-toggle{display:none!important}
