/* svg-editor-ui.css — la carcasa del editor de vectores (js/lib/svg-editor-ui.js), compartida.
   Estilos tal cual de /nest (public/css/nest-editor.css): barra, ficha de medidas, espesor, unidad,
   colores y menú del clic derecho. Colores por tokens del tema de cada página. */

/* Toolbar de herramientas — ahora vive DENTRO de la cabecera del canvas (modo edición),
   por eso es inline (sin position absolute ni pill flotante). */
.nt-ed-toolbar {
display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
}
/* Chip flotante de medidas (W/L/%) — esquina superior IZQUIERDA del canvas, solo al seleccionar */
/* Dos píldoras flotantes UNIFORMES a la derecha (como admin): chip de medidas arriba,
   espesor justo debajo. Compactas: mismo radio, sombra, fondo y padding. */
/* Pila flotante arriba a la derecha: espesor → tamaño → unidad. Lo que no se muestra no ocupa sitio. */
.nt-ed-stack { position: absolute; right: 10px; top: 10px; z-index: 8; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: min(92%, 640px); }
.nt-ed-dims-float, .nt-ed-thick {
background: var(--bg2); border: 1px solid var(--border);
border-radius: 11px; padding: 4px 8px; box-shadow: 0 5px 16px var(--shadow);
}
[data-theme="light"] .nt-ed-dims-float, [data-theme="light"] .nt-ed-thick { background: #fff; }
.nt-ed-dims-float { display: flex; align-items: center; }
/* Espesor: primera píldora de la pila; oculto si no se detecta (el JS le pone display). */
.nt-ed-thick {
display: flex; align-items: center; gap: 5px; white-space: nowrap;   /* una sola fila */
font-family: 'DM Sans', sans-serif; font-size: 11.5px; color: var(--muted);
}
/* Selector de unidad para DXF sin $INSUNITS — debajo del espesor (top 94). Borde de acento. */
.nt-ed-unit {
display: none;
align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--cyan);
border-radius: 11px; padding: 4px 8px; box-shadow: 0 5px 16px var(--shadow);
font-family: 'DM Sans', sans-serif; font-size: 11.5px; color: var(--muted);
}
[data-theme="light"] .nt-ed-unit { background: #fff; }
.nt-ed-unit-lbl { color: var(--cyan); font-weight: 600; }
.nt-ed-unit-x   { cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 2px; margin-left: 2px; }
.nt-ed-unit-x:hover { color: var(--text); }
.nt-ed-unit-lbl b { color: var(--text); }
.nt-ed-unit-btn { background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 1px 8px; font-size: 11px; cursor: pointer; }
.nt-ed-unit-btn:hover { border-color: var(--cyan); color: var(--cyan); }
/* .nt-ed-thick-hl / .nt-ed-thick-hl-halo y el "peek" (ocultar chrome al ver cotas) → estilo
   UNIFICADO con el catálogo en partials/_editor-overlay-styles.blade.php. */

/* ── Barra de colores (estilo LightBurn): flota abajo-centro del lienzo ── */
/* Una sola fila: crece HORIZONTAL (no hacia arriba). Si hay muchos colores, scroll-x oculto. */
.nt-ed-colors {
position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 8;
display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; justify-content: flex-start;
max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-card);
padding: 6px 12px; box-shadow: 0 6px 20px var(--shadow); font-family: 'DM Sans', sans-serif;
}
.nt-ed-colors::-webkit-scrollbar { display: none; }
[data-theme="light"] .nt-ed-colors { background: #fff; }
.nt-ed-colors-label { font-size: 11px; color: var(--muted); font-family: 'Outfit', sans-serif; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; flex: 0 0 auto; }
.nt-ed-colors-list { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; flex: 0 0 auto; }
.nt-ed-sw { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--bg3); border-radius: 8px; padding: 3px 7px; cursor: pointer; }
[data-theme="light"] .nt-ed-sw { background: var(--bg2); }
.nt-ed-sw:hover { border-color: var(--orange); }
.nt-ed-sw.active { border-color: var(--orange); box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 25%, transparent); }
.nt-ed-sw-dot { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.25); display: block; }
.nt-ed-sw-n { font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.nt-ed-colors-conv { display: inline-flex; align-items: center; gap: 5px; padding-left: 6px; border-left: 1px solid var(--border); flex: 0 0 auto; }
.nt-ed-colors-arrow { font-size: 11px; color: var(--muted); white-space: nowrap; }
.nt-ed-cv { width: 24px; height: 24px; border: 1px solid var(--border); background: var(--bg3); border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
[data-theme="light"] .nt-ed-cv { background: var(--bg2); }
.nt-ed-cv:hover { border-color: var(--orange); }
/* Colores del láser elegido en «Mis procesos»: primero y resaltados suave. */
.nt-ed-cv.nt-ed-cv-tuyo { border-color: color-mix(in srgb, var(--orange) 55%, transparent); background: color-mix(in srgb, var(--orange) 14%, var(--bg2)); }
.nt-ed-cv-sep { display: inline-block; width: 1px; height: 18px; margin: 0 3px; background: var(--border); vertical-align: middle; }
.nt-ed-cv-dot { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.25); display: block; }
/* "Otro color": abre la rueda del sistema. El <input type=color> se tapa con el propio
   botón (no se puede dar estilo a su caja en todos los navegadores) y el punto lleva el
   degradado del arcoíris, que es como se lee "elige tú". */
.nt-ed-cv-otro { position: relative; overflow: hidden; }
.nt-ed-cv-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; }
.nt-ed-cv-dot-otro { background: conic-gradient(#ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000); }
/* Eliminar las líneas del color activo. */
.nt-ed-cv-del { width: 26px; height: 24px; margin-left: 2px; border: 1px solid var(--border); background: var(--bg3); color: var(--muted);
border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
[data-theme="light"] .nt-ed-cv-del { background: var(--bg2); }
.nt-ed-cv-del:hover { border-color: var(--danger); color: var(--danger); }
.nt-ed-colors-uni { margin-left: 2px; border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 8px; padding: 4px 9px; font-size: 12px; cursor: pointer; font-family: 'DM Sans', sans-serif; white-space: nowrap; flex: 0 0 auto; }
.nt-ed-colors-uni:hover { border-color: var(--orange); color: var(--orange); }
/* Resaltado de un color → atenuado UNIFICADO con el catálogo en partials/_editor-overlay-styles.blade.php */
.nt-ed-tbtn {
display: inline-flex; align-items: center; justify-content: center;
width: 34px; height: 34px; padding: 0; border: none; background: transparent;
border-radius: var(--radius-button); color: var(--text); cursor: pointer; transition: background .15s;
}
.nt-ed-tbtn svg { width: 18px; height: 18px; display: block; }
.nt-ed-tbtn:hover:not(:disabled) { background: var(--bg3); }
.nt-ed-tbtn:disabled { opacity: .35; cursor: default; }
.nt-ed-tsep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
/* «Experimental» (solo admin): interruptor de funciones en evaluación, apagado de serie */
.nt-ed-exp { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 8px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.nt-ed-exp input { accent-color: var(--purple); cursor: pointer; margin: 0; }
.nt-ed-tbtn.active, .nt-ed-tbtn.active:hover { background: var(--fill); color: #fff; }
/* En celular ocultamos las herramientas de DIBUJO (rectángulo/círculo): en móvil
   no se dibuja a mano y así la toolbar queda simple. Pinch-zoom sigue disponible. */
@media (max-width: 600px) {
.nt-ed-tbtn[data-act="addRect"],
.nt-ed-tbtn[data-act="addCircle"] { display: none; }
/* Al ocultar rect+círculo quedaban 2 separadores juntos ("2 palitos"):
   ocultamos el que sigue al círculo para dejar uno solo entre grupos. */
.nt-ed-tbtn[data-act="addCircle"] + .nt-ed-tsep { display: none; }
/* Detector de espesor (fila) fuera en celular — simple y limpio. */
.nt-ed-thick { display: none; }
/* La barra en UNA fila: lo que no entra se desliza con el dedo (los menús se abren en el body: no se cortan). */
.nt-ed-toolbar { flex-wrap: nowrap; overflow-x: auto; min-width: 0; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.nt-ed-toolbar::-webkit-scrollbar { display: none; }
.nt-ed-toolbar > * { flex: 0 0 auto; }
}
.nt-ed-dims {
display: inline-flex; align-items: center; gap: 5px;
font-family: 'DM Sans', sans-serif; white-space: nowrap; padding: 0 2px;
font-variant-numeric: tabular-nums;
}
.nt-ed-dims b { color: var(--text); font-weight: 700; font-size: 12.5px; }
/* Cada control en su CONTENEDOR (como en admin): grupo con borde; los inputs van sin
   borde dentro. Admiten fórmulas (texto). */
.nt-ed-grp {
display: inline-flex; align-items: center; gap: 3px;
background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 2px 6px;
}
[data-theme="light"] .nt-ed-grp { background: var(--bg3); }
.nt-ed-grp:focus-within { border-color: var(--orange); box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 22%, transparent); }
.nt-ed-grp input {
width: 54px; text-align: right; font-family: inherit; font-size: 12.5px; font-weight: 700;
color: var(--text); -webkit-text-fill-color: var(--text);
background: transparent; border: none; box-shadow: none; padding: 1px 1px;
-moz-appearance: textfield; appearance: textfield;
}
.nt-ed-grp input:focus { outline: none; }
.nt-ed-grp.nt-ed-pct input { width: 38px; }
.nt-ed-grp i { color: var(--muted); font-style: normal; font-size: 11.5px; }
.nt-ed-sep { width: 1px; height: 18px; background: var(--border); }
.nt-ed-reset {
display: inline-flex; align-items: center; justify-content: center;
width: 24px; height: 24px; padding: 0; border: 1px solid var(--border);
background: var(--bg); border-radius: 7px; color: var(--muted); cursor: pointer;
font-size: 14px; line-height: 1; transition: background .15s, color .15s, border-color .15s;
}
[data-theme="light"] .nt-ed-reset { background: var(--bg3); }
.nt-ed-reset:hover { border-color: var(--orange); color: var(--orange); }
.nt-ed-lock {
display: inline-flex; align-items: center; justify-content: center;
width: 20px; height: 20px; padding: 0; border: none;
background: transparent; border-radius: 6px; color: var(--muted); cursor: pointer;
transition: background .15s, color .15s;
}
.nt-ed-lock svg { width: 12px; height: 12px; display: block; }
.nt-ed-lock:hover { background: var(--bg3); color: var(--text); }
.nt-ed-lock.active { background: var(--fill); color: #fff; }

/* Menú contextual (clic derecho). Por encima de TODO: es pasajero, y en el editor del catálogo
   la mesa vive dentro de una ventana (z 10000) que lo tapaba — el menú salía, pero detrás. */
.nt-ed-ctx {
position: fixed; z-index: 2147483000; min-width: 184px;
background: var(--bg2); border: 1px solid var(--border);
border-radius: var(--radius-card); padding: 5px; box-shadow: 0 12px 34px var(--shadow);
font-family: 'DM Sans', sans-serif; font-size: 13.5px; color: var(--text);
user-select: none; -webkit-user-select: none;
}
.nt-ed-ctx .it {
display: flex; align-items: center; gap: 9px;
padding: 8px 11px; border-radius: var(--radius-button); cursor: pointer; white-space: nowrap;
}
.nt-ed-ctx .it:hover { background: var(--bg3); }
.nt-ed-ctx .it.danger:hover { background: color-mix(in srgb, #ef4444 16%, transparent); color: #ef4444; }
.nt-ed-ctx .it.disabled { opacity: .4; cursor: default; }
.nt-ed-ctx .it .ico { width: 16px; height: 16px; display: inline-flex; align-items: center; opacity: .85; }
.nt-ed-ctx .it .ico svg { width: 16px; height: 16px; display: block; }
.nt-ed-ctx .it kbd {
margin-left: auto; padding-left: 14px; font-family: inherit; font-size: 11px;
color: var(--muted); letter-spacing: .02em;
}
.nt-ed-ctx .sep { height: 1px; background: var(--border); margin: 4px 6px; }

/* ── La mesa misma (SvgShapeEditor): área de agarre, selección, manijas y marquee. UNA vez para /nest, el
   catálogo, el mandala y el vectorizador. Sin estas reglas esos rect/path salen con el fill NEGRO por defecto
   (el «cuadrado negro» al seleccionar). ── */
.sse-stage svg { width: 100%; height: 100%; display: block; }
.sse-piece { cursor: move; }
/* Las piezas se ven IGUAL en todas las mesas (user 25-10, REGLA: una sola mesa, la de /nest): sin relleno, línea
   de 1 px de pantalla a cualquier zoom, con el color de su trazo; lo que solo trae relleno se ve por su borde.
   Una mesa que pinta el relleno (la IA de Vectorizar) lleva `sse-relleno` en su contenedor: relleno tal cual,
   sin borde añadido. Solo la vista: lo que se descarga sale de los atributos, que no cambian. */
.sse-piece *:not(.sse-hit) { stroke-width: 1px; vector-effect: non-scaling-stroke; }
.sse-piece *:not(.sse-hit):not(.sse-relleno *) { fill: none; }
.sse-piece [stroke="none"]:not(.sse-hit):not(.sse-relleno *),
.sse-piece [fill]:not([fill="none"]):not([stroke]):not(.sse-hit):not(.sse-relleno *) { stroke: #000; }
/* Agarre por la FORMA (01-11): la pieza se agarra por dentro de su contorno o sobre su línea; el espacio vacío
   de su caja (las esquinas de un triángulo) queda para lo que haya debajo. La caja (.sse-hit) solo agarra en la
   pieza que es pura línea (.sse-linea), que no tiene un «dentro». */
.sse-piece *:not(.sse-hit) { pointer-events: all; }
.sse-hit { fill: none; stroke: none; pointer-events: none; }
.sse-piece.sse-linea > .sse-hit { pointer-events: all; }
/* Agarre: borde invisible de 8 px de pantalla alrededor del área de agarre, para no tener que atinarle a una
   línea fina. !important: el visor de /nest (svg-viewer) mete un * {stroke-width … !important} global. */
.sse-piece:not(.sel) .sse-hit { stroke: transparent; stroke-width: 8px !important; vector-effect: non-scaling-stroke; }
/* Selección: el área de agarre se vuelve un recuadro punteado */
.sse-piece.sel .sse-hit { stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.sse-selbox { fill: none; stroke: var(--orange); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.sse-rhandle { fill: #e2e8f0; stroke: #475569; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.sse-roth-ic { fill: none; stroke: #475569; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sse-marquee { fill: color-mix(in srgb, var(--orange) 12%, transparent); stroke: var(--orange); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
