/* naves.html · plano de las naves (fase 2 del control de stock, 2/10/2026).
   Encima de stock.css: cabecera, botones, formularios, ventana y avisos. */
[hidden] { display: none !important; }
main.nv { padding: .9rem 1.2rem 0; max-width: none; display: flex; flex-direction: column; height: calc(100vh - 60px - 58px); height: calc(100dvh - 60px - 58px); }
.nv-cab { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.nv-cab h1 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: .55rem; }
.nv-cab h1 i { color: var(--sk-azul); }
.nv-cab h1 small { font-size: .8rem; font-weight: 500; color: var(--sk-mudo); }
.nv-cab-der { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.nv-sel { padding: .5rem .7rem; border: 1px solid #cbd5e1; border-radius: 8px; font-weight: 600; font-size: .9rem; background: #fff; min-width: 220px; }
.nv-modo { display: flex; background: #fff; border: 1px solid var(--sk-borde); border-radius: 10px; padding: .2rem; }
.nv-modo button { border: 0; background: transparent; padding: .4rem .8rem; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--sk-texto-2); font-size: .85rem; }
.nv-modo button.activa { background: var(--sk-azul); color: #fff; }

.nv-barra { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--sk-borde); border-radius: 12px; padding: .45rem .6rem; margin-bottom: .6rem; }
.nv-barra .sep { flex: 1; }
.nv-alturas { display: flex; gap: .25rem; flex-wrap: wrap; }
.nv-alturas button { border: 1px solid var(--sk-borde); background: #fff; border-radius: 999px; padding: .25rem .7rem; font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--sk-texto-2); }
.nv-alturas button.activa { background: var(--sk-azul-suave); border-color: var(--sk-azul); color: var(--sk-azul-osc); }
.nv-leyenda { display: flex; gap: .7rem; flex-wrap: wrap; font-size: .74rem; color: var(--sk-texto-2); }
.nv-leyenda span { display: inline-flex; align-items: center; gap: .3rem; }
.nv-leyenda i { width: 13px; height: 13px; border-radius: 3px; border: 1px solid #94a3b8; display: inline-block; }
.nv-leyenda .vacio { background: #fff; } .nv-leyenda .ocupado { background: #60a5fa; border-color: #2563eb; }
.nv-leyenda .casi { background: #fbbf24; border-color: #d97706; } .nv-leyenda .lleno { background: #f87171; border-color: #dc2626; }
.nv-leyenda .carga { background: #fff; border: 2px solid #ea580c; } .nv-leyenda .busca { background: #c084fc; border-color: #9333ea; }

.nv-cuerpo { flex: 1; min-height: 0; display: flex; gap: .6rem; padding-bottom: .6rem; }
.nv-lienzo { position: relative; flex: 1; min-width: 0; background: #e9eef4; border: 1px solid var(--sk-borde); border-radius: 14px; overflow: hidden; touch-action: none; }
.nv-lienzo svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; -webkit-user-select: none; }
.nv-lienzo svg.arrastrando { cursor: grabbing; }
.nv-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.nv-zoom button { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--sk-borde); background: #fff; cursor: pointer; color: var(--sk-texto-2); box-shadow: 0 2px 6px rgba(15,23,42,.08); }
.nv-escala { position: absolute; left: 12px; bottom: 10px; font-size: .72rem; color: var(--sk-texto-2); background: rgba(255,255,255,.85); padding: .15rem .45rem; border-radius: 6px; }
.nv-escala i { display: inline-block; height: 4px; background: var(--sk-texto-2); vertical-align: middle; margin-right: .35rem; border-radius: 2px; }
.nv-vacio { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; text-align: center; padding: 2rem; color: var(--sk-texto-2); background: #f4f6f9; }
.nv-vacio i.grande { font-size: 2.6rem; color: var(--sk-mudo); }
.nv-vacio .opciones { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }

/* SVG del plano */
.nv-lienzo .contorno { fill: #fff; stroke: #334155; stroke-width: .25; }
.nv-lienzo .rejilla { stroke: #e2e8f0; stroke-width: .05; }
.nv-lienzo .est-base { fill: #f1f5f9; stroke: #64748b; stroke-width: .06; }
.nv-lienzo .celda { stroke: #94a3b8; stroke-width: .03; cursor: pointer; }
.nv-lienzo .celda:hover { stroke: #0f172a; stroke-width: .1; }
.nv-lienzo .celda.sel { stroke: #0f172a; stroke-width: .18; }
.nv-lienzo .celda.carga { stroke: #ea580c; stroke-width: .16; }
.nv-lienzo .apagado { opacity: .25; }
.nv-lienzo .letra { font: 700 .9px 'Segoe UI', sans-serif; fill: #0f172a; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.nv-lienzo .rotulo { font: 600 .8px 'Segoe UI', sans-serif; fill: #475569; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.nv-lienzo .zona-txt { font: 700 1.6px 'Segoe UI', sans-serif; fill: #94a3b8; text-anchor: middle; dominant-baseline: central; pointer-events: none; letter-spacing: .1px; }
.nv-lienzo .puerta { stroke: #f59e0b; stroke-width: .5; stroke-linecap: round; }
.nv-lienzo .bloque { fill: #cbd5e1; stroke: #64748b; stroke-width: .05; }
.nv-lienzo .suelo-base { fill: none; stroke: #64748b; stroke-width: .08; stroke-dasharray: .4 .25; }
.nv-lienzo .tanque { fill: #e0f2fe; stroke: #0369a1; stroke-width: .12; cursor: pointer; }
.nv-lienzo .tanque-nivel { fill: #38bdf8; pointer-events: none; }
.nv-lienzo .editable { cursor: move; }
.nv-lienzo .seleccion { fill: rgba(0,145,216,.08); stroke: #0091d8; stroke-width: .15; stroke-dasharray: .5 .3; pointer-events: none; }
.nv-lienzo .vertice { fill: #fff; stroke: #0091d8; stroke-width: .15; cursor: move; }

/* Panel lateral */
.nv-panel { width: 340px; flex: none; background: #fff; border: 1px solid var(--sk-borde); border-radius: 14px; display: flex; flex-direction: column; min-height: 0; }
.nv-panel-cab { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--sk-borde); }
.nv-panel-cab b { font-size: 1rem; }
.nv-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #f1f5f9; cursor: pointer; }
.nv-panel-cuerpo { flex: 1; overflow: auto; padding: .8rem .9rem; font-size: .88rem; }
.nv-panel-cuerpo h4 { margin: .9rem 0 .4rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.nv-panel-cuerpo .ayuda { font-size: .8rem; color: var(--sk-mudo); margin: .3rem 0; }
.nv-cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; }
.nv-cifras > div { background: #f8fafc; border: 1px solid var(--sk-borde); border-radius: 10px; padding: .45rem .6rem; }
.nv-cifras .l { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sk-texto-2); font-weight: 700; }
.nv-cifras .v { font-weight: 800; font-size: 1.05rem; }
.nv-lista { display: flex; flex-direction: column; gap: .35rem; }
.nv-item { border: 1px solid var(--sk-borde); border-radius: 10px; padding: .45rem .6rem; background: #fff; text-align: left; font: inherit; cursor: pointer; display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.nv-item:hover { background: #f8fafc; }
.nv-item small { color: var(--sk-mudo); display: block; }
.nv-item .kg { font-weight: 700; white-space: nowrap; }
.nv-item.vacio-h { color: var(--sk-mudo); }
.nv-panel .sk-form { grid-template-columns: 1fr 1fr; gap: .5rem; }
.nv-panel .sk-form input, .nv-panel .sk-form select { padding: .4rem .5rem; border: 1px solid #cbd5e1; border-radius: 7px; font-size: .86rem; width: 100%; }
.nv-acciones { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .8rem; }
.nv-aviso { background: var(--sk-ambar-suave); color: #92400e; border-radius: 10px; padding: .55rem .7rem; font-size: .8rem; margin: .5rem 0; }

@media (max-width: 900px) {
    main.nv { padding: .6rem .6rem 0; height: auto; min-height: calc(100dvh - 60px - 58px); }
    header .search-bar { margin: 0 .6rem; }
    header .user-info span { display: none; }
    .nv-cuerpo { flex-direction: column; }
    .nv-lienzo { height: 62vh; flex: none; }
    .nv-panel { width: auto; max-height: none; }
    .nv-leyenda { display: none; }
    .nv-sel { min-width: 0; flex: 1 1 100%; }
    .nv-cab h1 small { display: none; }
}
a.sk-btn, a.nv-item { text-decoration: none; color: inherit; }

/* Vista en 3D (naves3d.js) */
.nv-zoom { z-index: 3; } .nv-escala { z-index: 2; } .nv-vacio { z-index: 4; }
.nv-lienzo canvas.nv-3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.nv-3d-tip { position: absolute; z-index: 5; pointer-events: none; background: rgba(15,23,42,.92); color: #fff; font-size: .8rem; line-height: 1.35; padding: .4rem .6rem; border-radius: 8px; max-width: 280px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.nv-cargando-3d { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: .6rem; color: var(--sk-texto-2); background: rgba(233,238,244,.85); font-weight: 600; }
