@font-face { font-family: "Manrope"; src: url(../fuentes/Manrope-400-latin.woff2) format("woff2"); font-weight: 400; font-display: swap }
@font-face { font-family: "Manrope"; src: url(../fuentes/Manrope-600-latin.woff2) format("woff2"); font-weight: 500 600; font-display: swap }
@font-face { font-family: "Manrope"; src: url(../fuentes/Manrope-700-latin.woff2) format("woff2"); font-weight: 700; font-display: swap }
@font-face { font-family: "Manrope"; src: url(../fuentes/Manrope-800-latin.woff2) format("woff2"); font-weight: 800; font-display: swap }

:root {
  --bg: #08111c; --panel: #0e1824; --panel2: #13202e; --soft: #1a2838; --line: #1f3043; --line2: #2a3e54;
  --ink: #edf4f8; --ink2: #95a8b8; --ink3: #64798b;
  --acc: #1FD1C1; --acc-o: #13a99b; --onacc: #032421; --acc-s: rgba(31, 209, 193, .12);
  --peligro: #ff6b5b; --azul: #5aa0ff; --ok: #3ee26b;
  --r: 12px; --sombra: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0 }
html, body { height: 100% }
body { background: var(--bg); color: var(--ink); font: 500 14px/1.45 Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer; background: none; border: 0 }
.ic { flex: none; display: block }
small { font-size: 12px; color: var(--ink2) }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 10px; padding: 9px 13px; font-weight: 700; font-size: 13.5px; white-space: nowrap; text-decoration: none; transition: background .15s, transform .1s }
.btn:active { transform: scale(.98) }
.btn.pri { background: var(--acc); color: var(--onacc) }
.btn.pri:hover { background: #4fe0d3 }
.btn.suave { background: var(--soft); color: var(--ink) }
.btn.suave:hover { background: var(--line2) }
.btn.borde { border: 1px solid var(--line2); color: var(--ink) }
.btn.borde:hover { border-color: var(--acc-o) }
.btn.peligro { background: var(--peligro); color: #1a0d0b }
.btn.chico { padding: 7px 10px; font-size: 12.5px }
.btn.ancho { width: 100%; justify-content: center; margin-top: 12px }
.ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--ink2) }
.ico:hover { background: var(--soft); color: var(--ink) }
.ico.peligro:hover { color: var(--peligro) }
.link { color: var(--acc); text-decoration: underline; font-weight: 700; padding: 0 }

/* ---------- barra de arriba ---------- */
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column }
.barra { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none }
.marca { display: flex; align-items: center; gap: 9px; font-size: 18px; letter-spacing: -.02em }
.marca b { font-weight: 800 }
.proy-nombre { flex: 1; min-width: 0; text-align: left; font-weight: 700; color: var(--ink2); padding: 6px 10px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.proy-nombre:hover { background: var(--soft); color: var(--ink) }
.acciones { display: flex; gap: 8px }

/* ---------- área ---------- */
.area { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 392px }
.lienzo { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0 }
.lienzo-barra { position: absolute; z-index: 3; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none }
.lienzo-barra > * { pointer-events: auto }
.segmento, .zoom { display: flex; background: rgba(14, 24, 36, .88); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 11px; padding: 3px }
.segmento button { padding: 7px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--ink2); white-space: nowrap }
.segmento button.on { background: var(--acc); color: var(--onacc) }
.zoom button { width: 34px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--ink2) }
.zoom button:hover { background: var(--soft); color: var(--ink) }
.vista3d { flex: 1; position: relative; overflow: hidden; touch-action: none; cursor: grab; min-height: 0;
  background: radial-gradient(ellipse at 50% 38%, #17304a 0%, #0c1826 58%, #08111c 100%) }
.vista3d[hidden] { display: none }
/* capturas para la landing y los anuncios (?demo#3d=abierto&solo): solo el 3D, sin botones y con fondo transparente */
.captura3d body, .captura3d .vista3d { background: transparent }
.captura3d .barra, .captura3d .lienzo-barra, .captura3d .panel, .captura3d .barra3d, .captura3d .ayuda3d { display: none !important }
.captura3d .area { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; height: 100dvh }
.vista3d canvas { display: block; outline: none }
.vista3d.cargando::after { content: "Armando el 3D…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink2); font-weight: 700 }
.barra3d { position: absolute; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center }
.barra3d .girar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: rgba(14, 24, 36, .88); border: 1px solid var(--line); color: var(--ink2) }
.barra3d .girar.on { background: var(--acc); color: var(--onacc); border-color: var(--acc) }
.ayuda3d { position: absolute; left: 0; right: 0; bottom: 62px; text-align: center; font-size: 12px; color: var(--ink2); opacity: .75; pointer-events: none; transition: opacity .4s }
.vista3d.girando .ayuda3d, .vista3d.visto .ayuda3d { opacity: 0 }
.vista { flex: 1; position: relative; overflow: hidden; touch-action: none; cursor: grab;
  background: radial-gradient(circle at 50% 40%, #12233a 0, #08111c 72%), var(--bg) }
.vista::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 28px 28px; pointer-events: none }
.lamina { position: absolute; left: 0; top: 0; transform-origin: 0 0 }
.lamina.zoom-alto svg [filter*="Sombra"] { filter: none }
.lamina > svg { display: block }
.lamina .papel { background: #fff; border-radius: 6px; box-shadow: var(--sombra) } /* sin padding: un margen fijo se correría al terminar el zoom */
.tablero-svg .ap { cursor: pointer }
.tablero-svg .ap.sel { cursor: grab }
.tablero-svg .ap.arrastrando { opacity: .85; cursor: grabbing }
.tablero-svg .agregar { cursor: pointer }
.tablero-svg .agregar:hover rect { fill-opacity: .22 }

/* ---------- panel ---------- */
.panel { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0 }
.pestanas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); flex: none }
.pestanas button { padding: 9px 4px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--ink2) }
.pestanas button.on { background: var(--soft); color: var(--ink); box-shadow: inset 0 -2px 0 var(--acc) }
.panel-cuerpo { flex: 1; overflow: auto; padding: 14px 16px 90px }
.grupo { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); font-weight: 800; margin: 20px 0 10px; display: flex; align-items: center; gap: 8px }
.grupo:first-child { margin-top: 4px }
.nota { color: var(--ink2); font-size: 12.5px; margin: 8px 0 }
.aviso-n { background: var(--acc-s); color: #9ff3ea; border-radius: 9px; padding: 9px 11px }
.vacio { color: var(--ink2); text-align: center; padding: 30px 10px }

.fila-elegir { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px }
.fila-elegir > span { color: var(--ink2); font-size: 12.5px; margin-right: 2px }
.fila-elegir button { border: 1px solid var(--line2); border-radius: 9px; padding: 5px 10px; font-weight: 700; font-size: 12.5px; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2 }
.fila-elegir button small { font-size: 10.5px; font-weight: 600 }
.fila-elegir button.on { border-color: var(--acc); background: var(--acc-s) }

.catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px }
.pieza { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; transition: border-color .15s, background .15s }
.pieza:hover { border-color: var(--acc-o); background: #182839 }
.pieza .mini { height: 74px; display: flex; align-items: center; justify-content: center }
.pieza .mini svg { height: 74px; width: auto; max-width: 92px }
.pieza-n { font-size: 11.5px; font-weight: 700; line-height: 1.2; color: var(--ink) }
.catalogo.bloqueado .pieza .mini { opacity: .45; filter: grayscale(.4) }
.pieza .candado, .ej .candado { position: absolute; top: 6px; right: 6px; color: var(--acc) }
.chip-candado { display: inline-flex; align-items: center; gap: 4px; background: var(--acc-s); color: var(--acc); border-radius: 99px; padding: 2px 8px; letter-spacing: 0; text-transform: none; font-size: 11px }
.mini-cat { margin: 12px 0 }
.mini-cat .pieza { cursor: default }

/* campos */
.campos { display: flex; flex-direction: column; gap: 10px }
.campos label, .nombre-c { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink2) }
input, select, textarea { background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; padding: 9px 11px; font-size: 15px; color: var(--ink); width: 100%; min-width: 0 }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acc); outline-offset: -1px; border-color: transparent }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--acc); padding: 0 }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.dos-b { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px }
.et { font-size: 12.5px; font-weight: 700; color: var(--ink2) }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chips button { border: 1px solid var(--line2); background: var(--panel2); border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 13px; min-width: 40px }
.chips button:hover { border-color: var(--acc-o) }
.chips button.on { background: var(--acc); border-color: var(--acc); color: var(--onacc) }
.conductores { display: flex; flex-direction: column; gap: 8px }
.cond { display: grid; grid-template-columns: 22px 1fr 140px; align-items: center; gap: 10px }
.cond b { font-size: 13px }
.cond select { padding: 6px 8px; font-size: 13px }
.muestra { display: inline-block; width: 22px; height: 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); vertical-align: middle; margin-right: 6px }
.cond .muestra { margin: 0 }

.lista-circ { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px }
.lista-circ li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; cursor: pointer }
.lista-circ li.on, .lista-circ li:hover { border-color: var(--acc-o) }
.lista-circ .num { width: 28px; height: 28px; border-radius: 8px; background: var(--soft); display: grid; place-items: center; font-weight: 800 }
.lista-circ b { display: block }
.conds { display: flex; gap: 3px }
.conds i { width: 7px; height: 22px; border-radius: 4px; border: 1px solid rgba(255,255,255,.18) }

.tabla { width: 100%; border-collapse: collapse; font-size: 12.5px }
.tabla th, .tabla td { text-align: left; padding: 7px 5px; border-bottom: 1px solid var(--line); vertical-align: middle }
.tabla th { color: var(--ink3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em }
.tabla .n { text-align: right; white-space: nowrap }
.tabla small { display: block }
.presu .precio { width: 88px; padding: 6px 7px; font-size: 13px; text-align: right }
.extras { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px }
.extra { display: grid; grid-template-columns: 1fr 58px 84px 34px; gap: 6px; align-items: center }
.extra input { padding: 7px 8px; font-size: 13px }
.extra .ico { width: 34px; height: 34px }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--acc-s); border: 1px solid rgba(31, 209, 193, .35) }
.total span { font-weight: 700; color: var(--ink2) }
.total b { font-size: 22px; font-weight: 800; color: var(--acc) }
.textos { display: flex; flex-direction: column; gap: 10px }
.texto { background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px }
.texto p { color: var(--ink2); font-size: 12.5px; margin-top: 4px }

/* ---------- hoja del aparato ---------- */
#app { position: relative }
.hoja { position: absolute; z-index: 5; right: 0; top: var(--alto-barra, 57px); bottom: 0; width: 392px; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(0, 0, 0, .25) }
.hoja[hidden] { display: none }
.hoja-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 10px 8px 16px }
.hoja-cab small { display: block; color: var(--acc); font-weight: 700 }
.hoja-cab b { font-size: 15px; line-height: 1.3 }
.hoja-cuerpo { flex: 1 1 auto; overflow: auto; padding: 4px 16px 10px; display: flex; flex-direction: column; gap: 12px }
.campo-chips { display: flex; flex-direction: column; gap: 6px }
.interruptores { display: flex; gap: 16px }
.interruptores label { display: flex; gap: 7px; align-items: center; font-weight: 700; font-size: 13px }
.hoja-pie { display: flex; align-items: center; gap: 2px; padding: 8px 10px; border-top: 1px solid var(--line) }
.hoja-pie .sep { flex: 1 }
.tip { font-size: 11.5px; color: var(--ink3); padding: 0 16px 12px }

/* ---------- ventanas ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(5, 7, 10, .62); display: grid; place-items: center; padding: 16px }
.modal[hidden] { display: none }
.modal-caja { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 22px 20px 18px; box-shadow: var(--sombra) }
.modal-caja.ancha { width: min(680px, 100%) }
.modal-caja.chica { width: min(380px, 100%) }
.modal-caja h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 6px; display: flex; gap: 8px; align-items: center }
.modal-caja .pie { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px }
.confirmar { font-size: 15px; font-weight: 600 }
.proy-lista { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 }
.proy { display: flex; align-items: center; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: 4px 4px 4px 0 }
.proy.on { border-color: var(--acc-o) }
.proy .abrir { flex: 1; text-align: left; padding: 8px 12px; min-width: 0 }
.proy .abrir b, .proy .abrir small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.ejemplos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px }
.ej { position: relative; text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px }
.ej:hover { border-color: var(--acc-o) }
.ej b, .ej small { display: block }
.ej.bloq { opacity: .7 }
.checks { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 }
.checks label { display: flex; gap: 10px; align-items: center; font-weight: 600 }
.logo-carga { display: flex; align-items: center; gap: 12px }
.logo-prev { width: 64px; height: 64px; border-radius: 12px; background: var(--panel2); border: 1px dashed var(--line2); display: grid; place-items: center; font-size: 11px; color: var(--ink3); overflow: hidden }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain }

.aviso { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #f4f6f8; color: #14171c; font-weight: 700; padding: 11px 16px; border-radius: 12px; box-shadow: var(--sombra); transition: .2s; max-width: calc(100% - 32px); text-align: center }
.aviso.ver { opacity: 1; transform: translate(-50%, 0) }

/* ---------- entrada ---------- */
.entrada { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px }
.entrada-caja { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sombra); padding: 32px 28px 26px; display: flex; flex-direction: column }
.entrada-caja .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; margin-bottom: 26px }
.entrada-caja h1 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2 }
.entrada-caja .sub { color: var(--ink2); margin: 6px 0 22px }
.entrada-caja label { font-weight: 700; font-size: 13px; margin-bottom: 6px }
.entrada-caja input { margin-bottom: 12px }
.entrada-caja .btn { justify-content: center; padding: 12px 14px; font-size: 14.5px }
.entrada-caja .msg { color: var(--peligro); min-height: 20px; margin-top: 10px; font-size: 13px }
.entrada-caja .ayuda { color: var(--ink3); font-size: 12px; margin-top: 8px }
.entrada-caja .ayuda a { color: var(--ink2) }

/* ---------- celular ---------- */
@media (max-width: 820px) {
  .barra { padding: 8px 10px; gap: 8px }
  .marca b { display: none }
  .acciones .btn span { display: none }
  .acciones .btn { padding: 9px }
  .area { grid-template-columns: 1fr; grid-template-rows: 54% 46% }
  .panel { border-left: 0; border-top: 1px solid var(--line) }
  .lienzo-barra { top: 8px; left: 8px; right: 8px }
  .segmento button { padding: 6px 9px; font-size: 12.5px }
  .zoom button { width: 32px }
  /* con 4 vistas no entra todo en una línea: el zoom va en columna a la derecha */
  .lienzo-barra { align-items: flex-start }
  .zoom { flex-direction: column }
  .hoja { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 62dvh; border-radius: 18px 18px 0 0; border: 1px solid var(--line2); border-bottom: 0; box-shadow: var(--sombra) }
  .catalogo { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)) }
  /* en el celular las pestañas se deslizan: se ven 3 y asoma la cuarta */
  .pestanas { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 8px 10px;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent) }
  .pestanas.al-final { -webkit-mask-image: linear-gradient(270deg, #000 88%, transparent); mask-image: linear-gradient(270deg, #000 88%, transparent) }
  .pestanas::-webkit-scrollbar { display: none }
  .pestanas button { flex: 0 0 calc((100% - 12px) / 3.25); scroll-snap-align: start; padding: 11px 6px; font-size: 14px; white-space: nowrap; background: var(--bg2) }
  .modal { align-items: end; padding: 0 }
  .modal-caja, .modal-caja.ancha, .modal-caja.chica { width: 100%; border-radius: 18px 18px 0 0; max-height: 92dvh }
}
@media (max-width: 380px) { .segmento button { padding: 6px 7px; font-size: 12px } }
@media (max-width: 340px) { .segmento button { padding: 6px 5px; font-size: 11.5px } }

/* ---------- PDF (impresión) ---------- */
#imprimir { display: none }
@page { size: A4 landscape; margin: 0 }
@media print {
  html, body { height: auto; background: #fff }
  body > *:not(#imprimir) { display: none !important }
  #imprimir, body.vista-pdf #imprimir { display: block !important; padding: 0 !important }
  body.vista-pdf { background: #fff }
}
body.vista-pdf { background: #5b6370; height: auto }
body.vista-pdf > *:not(#imprimir) { display: none !important }
body.vista-pdf #imprimir { display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 14px }
.pag { width: 297mm; height: 210mm; padding: 12mm 13mm 10mm; background: #fff; color: #1f2937; font: 500 9.5pt/1.4 Manrope, Arial, sans-serif; display: flex; flex-direction: column; overflow: hidden; page-break-after: always; break-after: page; position: relative; -webkit-print-color-adjust: exact; print-color-adjust: exact }
.pag:last-child { page-break-after: auto; break-after: auto }
.pag small { color: #6b7280; font-size: 8pt }
.pdf-marca { display: flex; align-items: center; gap: 3mm }
.pdf-marca img { max-height: 13mm; max-width: 34mm; object-fit: contain }
.pdf-marca b { display: block; font-size: 10.5pt; font-weight: 800 }
.pdf-marca small { display: block }
.pag-cab { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: .5mm solid #12a596; padding-bottom: 3mm; margin-bottom: 4mm }
.pag-cab h2 { font-size: 16pt; font-weight: 800; letter-spacing: -.01em; line-height: 1.1 }
.pag-dibujo { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center }
.pag-dibujo svg { width: 100% !important; height: 100% !important; max-height: 100% }
.pag-dibujo.unif svg { width: 100%; height: 100% }
.pag-pie { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; margin-top: 3mm }
.rotulo { border-collapse: collapse; font-size: 7.5pt; min-width: 112mm }
.rotulo th, .rotulo td { border: .25mm solid #374151; padding: .8mm 2mm; text-align: left }
.rotulo th { background: #f3f4f6; font-weight: 700; color: #4b5563; width: 18mm }
.leyenda { display: flex; flex-wrap: wrap; gap: 2mm 5mm; font-size: 8pt; max-width: 140mm }
.leyenda b { width: 100%; font-size: 8pt }
.leyenda span { display: flex; align-items: center; gap: 1.5mm }
.leyenda i { width: 8mm; height: 2.6mm; border-radius: 1.3mm; border: .2mm solid #9ca3af }
.nota-pdf { font-size: 8pt; color: #6b7280; margin: 1mm 0 3mm }
.pag-dos { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.25fr 1fr; gap: 8mm; align-items: start }
.pag-dos.parejo { grid-template-columns: 1fr 1fr }
.pag-dos .pag-dibujo { height: 100% }
.pag h3 { font-size: 10pt; font-weight: 800; margin-bottom: 2mm }
.tabla-pdf { width: 100%; border-collapse: collapse; font-size: 8.4pt }
.tabla-pdf th { text-align: left; font-size: 7.4pt; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; border-bottom: .4mm solid #1f2937; padding: 1.4mm 1.6mm }
.tabla-pdf td { border-bottom: .2mm solid #e5e7eb; padding: 1.3mm 1.6mm; vertical-align: top }
.tabla-pdf td small { display: block; font-size: 7pt }
.tabla-pdf .n { text-align: right; white-space: nowrap }
.tabla-pdf tfoot td { border-top: .5mm solid #1f2937; border-bottom: 0; font-size: 12pt; font-weight: 800; padding-top: 2.4mm }
.portada { flex: 1; display: grid; grid-template-columns: 1fr 1.05fr; gap: 10mm; min-height: 0 }
.portada-izq { display: flex; flex-direction: column; gap: 8mm }
.portada-tit h1 { font-size: 28pt; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: 2mm 0 6mm }
.portada-tit > small { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: #0e8a7e }
.portada-tit dl { display: grid; grid-template-columns: 26mm 1fr; gap: 1.6mm 3mm; font-size: 10pt }
.portada-tit dt { color: #6b7280; font-weight: 700 }
.portada-tit dd { font-weight: 700 }
.indice { list-style: none; padding: 0; margin-top: auto; font-size: 9pt; columns: 2; column-gap: 6mm }
.indice li { display: flex; gap: 2.4mm; padding: 1mm 0 }
.indice span { width: 5.4mm; height: 5.4mm; border-radius: 1.4mm; background: #12a596; color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 8pt; flex: none }
.portada-der { background: linear-gradient(160deg, #12233a, #08111c); border-radius: 4mm; display: flex; align-items: center; justify-content: center; padding: 7mm; min-height: 0 }
.portada-der svg { width: 100% !important; height: 100% !important }
.presu-pdf { flex: 1; display: flex; flex-direction: column; gap: 4mm }
.presu-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; background: #f9fafb; border-radius: 2mm; padding: 3mm 4mm }
.presu-datos b, .presu-datos small, .presu-datos span { display: block }
.presu-datos b { font-size: 11pt }
.condiciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5mm; font-size: 8.6pt }
.condiciones small { display: block; font-weight: 700 }
.firma { margin-top: auto; align-self: flex-end; width: 70mm; text-align: center }
.firma span { display: block; border-top: .3mm solid #374151; margin-bottom: 1mm }
.tiras { display: flex; flex-direction: column; gap: 4mm; margin: 2mm 0 5mm }
.tira-fila small { display: block; margin-bottom: 1mm }
.tira { display: inline-flex; border: .3mm solid #111 }
.tira span { height: 10mm; border-right: .3mm dashed #111; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 6.6pt; font-weight: 800; line-height: 1.05; text-align: center; overflow: hidden; padding: 0 .6mm; flex: none }
.tira span em { font-style: normal; font-size: 5.4pt; color: #6b7280 }
.tira span:last-child { border-right: 0 }
.directorio { border: .3mm solid #111; border-radius: 1.5mm; padding: 3mm 4mm; width: 120mm }
.directorio ol { list-style: none; padding: 0; columns: 2; column-gap: 6mm; font-size: 8.4pt }
.directorio li { padding: .6mm 0; break-inside: avoid }
.directorio li b { display: inline-block; width: 5mm }
.pieza .mini.vacia { font-size: 34px; font-weight: 600; color: var(--ink3) }
/* muchas filas en la lista de circuitos del PDF: más compacta para que no pise el rótulo */
.tabla-pdf.apretada { font-size: 7.6pt }
.tabla-pdf.apretada td { padding: .7mm 1.4mm }
.tabla-pdf.apretada td small { display: inline; margin-left: 1.5mm }
.tabla-pdf.muy-apretada { font-size: 6.6pt }
.tabla-pdf.muy-apretada td { padding: .35mm 1.2mm }
.tabla-pdf.muy-apretada td small { display: inline; margin-left: 1.2mm }
.carpeta { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--panel2) }
.carpeta summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font-weight: 800 }
.carpeta summary::-webkit-details-marker { display: none }
.carpeta summary small { background: var(--soft); border-radius: 99px; padding: 2px 9px; font-weight: 800 }
.carpeta[open] summary { border-bottom: 1px solid var(--line) }
.carpeta .proy-lista { padding: 8px; margin: 0 }
.barra-av { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 10px }
.barra-av i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .3s }
.botones-pdf { display: flex; flex-direction: column; gap: 8px; margin-top: 12px }
.botones-pdf .btn.ancho { margin-top: 0 }
/* cuadro de cargas */
.balance { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px }
.bal-cab { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px }
.bal-cab span { color: var(--ink2); font-weight: 700; font-size: 13px }
.bal-fila { display: grid; grid-template-columns: 26px 1fr 84px; gap: 10px; align-items: center; margin: 7px 0 }
.bal-f { font-weight: 800; font-size: 13px }
.bal-barra { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden }
.bal-barra i { display: block; height: 100%; border-radius: 99px; transition: width .25s }
.bal-v { text-align: right; line-height: 1.15 }
.bal-v b { display: block; font-size: 14px }
.bal-v small { font-size: 11px }
.bal-nota { font-size: 12.5px; margin-top: 8px; color: var(--ink2) }
.bal-nota.bien { color: var(--ok) }
.bal-nota.mal { color: #ffb36b }
.lista-circ .watts { display: flex; align-items: center; gap: 4px; color: var(--ink3); font-size: 12px; font-weight: 700 }
.lista-circ .watts input { width: 78px; padding: 6px 7px; font-size: 14px; text-align: right }
.lista-circ li { grid-template-columns: 30px 1fr auto }
.cargas-pdf { grid-template-columns: 1.55fr 1fr }
.bal-pdf { border: .3mm solid #e5e7eb; border-radius: 2mm; padding: 4mm }
.bal-pdf .bf { display: grid; grid-template-columns: 8mm 1fr 18mm; gap: 2mm 3mm; align-items: center; margin: 3mm 0 }
.bal-pdf .bf span { font-weight: 800 }
.bal-pdf .bf div { height: 4mm; background: #f1f3f5; border-radius: 2mm; overflow: hidden }
.bal-pdf .bf i { display: block; height: 100%; border-radius: 2mm }
.bal-pdf .bf b { text-align: right; font-size: 10pt }
.bal-pdf .bf small { grid-column: 3; text-align: right; margin-top: -2mm }
.bf-nota { font-size: 9pt; margin: 3mm 0 }
/* presupuesto: IVA, descuento y anticipo */
.iva-fila { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.interruptor-iva { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--ink) !important; font-size: 14px !important }
.iva-pct { flex-direction: row !important; align-items: center; gap: 6px !important }
.iva-pct input { width: 74px; text-align: right }
.total { flex-direction: column; align-items: stretch !important; gap: 4px }
.d-fila { display: flex; justify-content: space-between; color: var(--ink2); font-size: 13.5px; font-weight: 600 }
.d-total { display: flex; justify-content: space-between; align-items: baseline }
.d-total span { font-weight: 700; color: var(--ink2) }
.d-total b { font-size: 22px; font-weight: 800; color: var(--acc) }
.d-fila.d-ant { color: var(--ink) }
.tabla-pdf tfoot tr.sub td { font-size: 9pt; font-weight: 600; padding-top: 1.2mm; border-top: 0 }
.img-prev { width: 100%; border-radius: 10px; margin: 10px 0 4px; border: 1px solid var(--line) }
.pedido pre { white-space: pre-wrap; font: 600 12.5px/1.5 Manrope, system-ui, sans-serif; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-top: 8px; max-height: 220px; overflow: auto }
/* firma del cliente */
.lienzo-firma { display: block; width: 100%; height: 190px; background: #fff; border-radius: 12px; margin: 10px 0; touch-action: none; cursor: crosshair }
.firma-ok { display: flex; align-items: center; gap: 12px; margin-bottom: 4px }
.firma-ok img { width: 140px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px }
.firma-ok b, .firma-ok small { display: block }
/* fotos de la obra */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px }
.foto { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; overflow: hidden }
.foto img { width: 100%; height: 110px; object-fit: cover; display: block }
.foto input { border: 0; border-radius: 0; font-size: 13px; padding: 7px 9px; background: transparent }
.foto .ico { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; background: rgba(8, 17, 28, .75) }
/* PDF: fotos y firmas */
.fotos-pdf { flex: 1; min-height: 0; display: grid; gap: 4mm; align-content: start }
.fotos-pdf.c1 { grid-template-columns: 1fr } .fotos-pdf.c2 { grid-template-columns: 1fr 1fr } .fotos-pdf.c3 { grid-template-columns: 1fr 1fr 1fr }
.fotos-pdf figure { display: flex; flex-direction: column; gap: 1.5mm }
.fotos-pdf img { width: 100%; height: 62mm; object-fit: cover; border-radius: 2mm; border: .3mm solid #e5e7eb }
.fotos-pdf.c1 img, .fotos-pdf.c2 img { height: 120mm }
.fotos-pdf figcaption { font-size: 8.6pt; color: #374151 }
.firmas { margin-top: auto; display: flex; justify-content: space-between; gap: 20mm }
.firmas .firma { margin: 0; width: 75mm; align-self: auto; position: relative }
.firmas .firma img { position: absolute; top: 1mm; left: 50%; transform: translateX(-50%); max-width: 55mm; max-height: 13.5mm }
.firmas .firma { padding-top: 15mm }

.presu-pdf { gap: 3mm }
.presu-pdf .tabla-pdf.apretada td { padding: .55mm 1.4mm }
/* revisión del tablero */
.revision { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px }
.revision.ok { border-color: rgba(62, 226, 107, .35) }
.revision.con-aviso { border-color: rgba(255, 179, 107, .45) }
.revision.con-error { border-color: rgba(255, 138, 76, .6) }
.rev-item { display: flex; gap: 9px; align-items: flex-start; text-align: left; width: 100%; padding: 6px 0; font-size: 13px; color: var(--ink2); line-height: 1.35 }
.rev-item i { flex: none; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 11px; margin-top: 1px }
.rev-item.error i { background: #ff8a4c; color: #2a1200 }
.rev-item.aviso i { background: #ffb36b; color: #2a1600 }
.rev-item.info i { background: var(--soft); color: var(--ink2) }
.rev-item.bien i { background: rgba(62, 226, 107, .18); color: var(--ok) }
.rev-item.error span, .rev-item.aviso span { color: var(--ink) }
button.rev-item:hover span { text-decoration: underline }
.balance #bBalancear { margin-top: 8px }
.pestanas em { font-style: normal; margin-left: 5px; background: #ffb36b; color: #2a1600; border-radius: 99px; padding: 0 6px; font-size: 11px; font-weight: 800 }
.pestanas em.rojo { background: #ff8a4c; color: #2a1200 }
/* PDF */
.rev-pdf { margin-top: 4mm; border-top: .3mm solid #e5e7eb; padding-top: 3mm }
.rev-pdf h3 { font-size: 9.5pt; margin-bottom: 1.5mm }
.rev-pdf p { font-size: 8pt; margin: .8mm 0 }
.rev-pdf p.b { color: #0e7a6f }
.rev-pdf p.m { color: #b45309; font-weight: 700 }
