/* pianoGallery — servicios, cotizaciones y facturas, inventario y lo de Munus (sigue a pg-gestion.css). */

/* ===== /servicios: el formulario arriba, pocos toques ===== */
.pg-agenda { padding: 40px 0 24px;
  background: radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--pg-accent) 14%, transparent), transparent 70%); }
.pg-agenda-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: start; }
.pg-agenda-texto h1 { font-family: var(--pg-serif); font-size: clamp(30px, 4.2vw, 46px); line-height: 1.1; margin: 8px 0 12px; }
.pg-agenda-texto > p { font-size: 17px; color: var(--pg-ink-2); margin: 0 0 20px; }
.pg-agenda-puntos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pg-agenda-puntos li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.pg-agenda-puntos .pg-ico { width: 20px; height: 20px; color: var(--pg-accent); }
.pg-agenda-card { background: var(--pg-surface); border: 1px solid var(--pg-line); border-radius: 16px;
  padding: 22px; box-shadow: var(--pg-shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.pg-agenda-paso { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.pg-agenda-paso > span { width: 24px; height: 24px; border-radius: 50%; background: var(--pg-accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.pg-agenda-servicios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pg-agenda-servicio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 6px; border: 1.5px solid var(--pg-line); border-radius: 12px; background: var(--pg-bg);
  color: var(--pg-ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s, transform .1s; }
.pg-agenda-servicio .pg-ico { width: 26px; height: 26px; color: var(--pg-accent); }
.pg-agenda-servicio:hover { border-color: var(--pg-accent); }
.pg-agenda-servicio:active { transform: scale(.97); }
.pg-agenda-servicio.is-elegido { border-color: var(--pg-accent); background: var(--pg-accent-soft); color: var(--pg-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pg-accent) 18%, transparent); }
.pg-agenda-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pg-agenda-ancho { grid-column: 1 / -1; }
.pg-agenda-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--pg-line); border-radius: 10px;
  background: var(--pg-bg); padding: 0 12px; transition: border-color .15s, box-shadow .15s; }
.pg-agenda-input:focus-within { border-color: var(--pg-accent); box-shadow: 0 0 0 3px var(--pg-accent-soft); }
.pg-agenda-input .pg-ico { color: var(--pg-ink-3); width: 18px; height: 18px; }
.pg-agenda-input input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--pg-ink);
  font: inherit; font-size: 16px; padding: 12px 0; outline: none; }
.pg-agenda-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-chip-opcion { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--pg-line); background: transparent; color: var(--pg-ink-2); font: inherit; font-size: 13.5px; cursor: pointer; }
.pg-chip-opcion.is-elegido { border-color: var(--pg-accent); color: var(--pg-accent); background: var(--pg-accent-soft); font-weight: 600; }
.pg-agenda-mas { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  color: var(--pg-accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.pg-agenda-detalles { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.pg-agenda-detalles textarea { font: inherit; font-size: 15px; color: var(--pg-ink); background: var(--pg-bg);
  border: 1px solid var(--pg-line); border-radius: 10px; padding: 10px 12px; resize: vertical; }
.pg-agenda-aviso { color: var(--pg-red); font-size: 14px; font-weight: 600; }
.pg-agenda-enviar { width: 100%; justify-content: center; padding: 15px; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.pg-agenda-wa { text-align: center; font-size: 14px; color: var(--pg-green); text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; }
.pg-agenda-listo { align-items: center; text-align: center; padding: 34px 22px; }
.pg-agenda-listo-ico { width: 56px; height: 56px; border-radius: 50%; background: color-mix(in srgb, var(--pg-green) 18%, transparent);
  color: var(--pg-green); display: inline-flex; align-items: center; justify-content: center; }
.pg-agenda-listo-ico .pg-ico { width: 28px; height: 28px; }
.pg-agenda-listo h3 { margin: 4px 0 0; font-family: var(--pg-serif); font-size: 24px; }
.pg-agenda-acciones { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pg-agenda-acciones .pg-btn { display: inline-flex; align-items: center; gap: 6px; }
.pg-servicio-icono .pg-ico { width: 22px; height: 22px; }
.pg-razon-num .pg-ico { width: 18px; height: 18px; }
.pg-agenda-contacto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.pg-agenda-contacto a { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--pg-line);
  border-radius: 12px; background: var(--pg-surface); color: var(--pg-ink); text-decoration: none; }
.pg-agenda-contacto a:hover { border-color: var(--pg-accent); }
.pg-agenda-contacto .pg-ico { width: 22px; height: 22px; color: var(--pg-accent); }
.pg-agenda-contacto span { display: flex; flex-direction: column; font-size: 13.5px; color: var(--pg-ink-2); }
.pg-agenda-contacto strong { color: var(--pg-ink); font-size: 15px; }
@media (max-width: 860px) {
  .pg-agenda { padding-top: 20px; }
  .pg-agenda-grid { grid-template-columns: 1fr; gap: 18px; }
  .pg-agenda-texto h1 { font-size: 30px; margin: 0 0 6px; }
  .pg-agenda-texto > p { font-size: 15px; margin-bottom: 0; }
  .pg-agenda-puntos { display: none; }
  .pg-agenda-card { padding: 16px; border-radius: 14px; }
  .pg-agenda-campos { grid-template-columns: 1fr; }
}
@media (max-width: 380px) { .pg-agenda-servicios { grid-template-columns: repeat(2, 1fr); } }

/* ===== Cotizaciones y facturas (de Mediamix) ===== */
.pg-doc-cifras { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.pg-doc-cifras > div { background: var(--pg-surface); border: 1px solid var(--pg-line-soft); border-radius: var(--pg-radius-sm);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.pg-doc-cifras strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.pg-doc-cifras span { font-size: 12.5px; color: var(--pg-ink-2); }
.pg-doc-cifras .is-aviso strong { color: var(--pg-accent); }
.pg-doc-cifras .is-alerta strong { color: var(--pg-red); }
.pg-doc-cifras .is-bien strong { color: var(--pg-green); }
.pg-fila-click { cursor: pointer; }
.pg-fila-click:hover td { background: var(--pg-surface-2); }
.pg-doc-estado { display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; padding: 3px 9px;
  border-radius: 999px; background: var(--pg-surface-2); color: var(--pg-ink-2); white-space: nowrap; }
.pg-doc-estado.is-enviada { background: color-mix(in srgb, var(--pg-accent) 14%, transparent); color: var(--pg-accent); }
.pg-doc-estado.is-aprobada, .pg-doc-estado.is-emitida { background: color-mix(in srgb, #d99a1e 18%, transparent); color: #b07a0c; }
.pg-doc-estado.is-facturada, .pg-doc-estado.is-pagada { background: color-mix(in srgb, var(--pg-green) 15%, transparent); color: var(--pg-green); }
.pg-doc-estado.is-rechazada, .pg-doc-estado.is-anulada, .pg-doc-estado.is-vencida { background: color-mix(in srgb, var(--pg-red) 14%, transparent); color: var(--pg-red); }
.pg-doc-lineas input { width: 100%; box-sizing: border-box; }
.pg-doc-lineas input.pg-num { width: 100px; text-align: right; }
.pg-doc-lineas input[type=checkbox] { width: auto; }
.pg-doc-detalle { margin-top: 5px; font-size: 12.5px; }
.pg-doc-totales { display: grid; gap: 4px; margin: 10px 0 16px auto; max-width: 340px; }
.pg-doc-totales > div { display: flex; justify-content: space-between; gap: 20px; font-variant-numeric: tabular-nums; }
.pg-doc-totales > div span { color: var(--pg-ink-2); }
.pg-doc-totales .is-total { border-top: 2px solid var(--pg-ink); padding-top: 6px; margin-top: 4px; font-size: 18px; }
.pg-doc-totales .is-total span { color: var(--pg-ink); font-weight: 600; }
.pg-doc-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pg-doc-dialogo { margin-bottom: 16px; }
.pg-doc-dialogo .pg-btn { margin-right: 8px; }
.pg-doc-hoja { background: #fff; color: #1d1a17; border: 1px solid var(--pg-line-soft); border-radius: var(--pg-radius);
  padding: 36px 40px; max-width: 900px; box-shadow: var(--pg-shadow); }
.pg-doc-hoja .pg-muted { color: #6b645c; }
.pg-doc-hoja .pg-tabla th, .pg-doc-hoja .pg-tabla td { color: #1d1a17; border-color: #e6e1da; background: transparent; }
.pg-doc-hoja .pg-doc-totales > div span { color: #6b645c; }
.pg-doc-hoja .pg-doc-totales .is-total { border-color: #1d1a17; }
.pg-doc-hoja .pg-doc-totales .is-total span { color: #1d1a17; }
.pg-doc-cab { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 1px solid #e6e1da; padding-bottom: 18px; }
.pg-doc-logo { height: 54px; width: auto; }
.pg-doc-tipo { font-family: var(--pg-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #6b645c; margin: 14px 0 4px; }
.pg-doc-cab h2 { font-family: var(--pg-serif); font-size: 24px; margin: 0; }
.pg-doc-numero { text-align: right; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.pg-doc-numero strong { font-size: 18px; font-family: var(--pg-mono); }
.pg-doc-partes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 20px 0; font-size: 14px; }
.pg-doc-partes > div { display: flex; flex-direction: column; gap: 2px; }
.pg-doc-eti { font-family: var(--pg-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #6b645c; margin-bottom: 4px; }
.pg-doc-tabla { margin-top: 8px; }
.pg-doc-exento { margin-left: 8px; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f0ece6; color: #6b645c; }
.pg-doc-condiciones { font-size: 12.5px; color: #6b645c; border-top: 1px solid #e6e1da; padding-top: 12px; margin-top: 16px; white-space: pre-line; }
.pg-doc-pagada { margin-top: 16px; padding: 10px 14px; border-radius: var(--pg-radius-sm); background: color-mix(in srgb, var(--pg-green) 12%, transparent); color: var(--pg-green); }
@media (max-width: 640px) {
  .pg-doc-hoja { padding: 22px 18px; }
  .pg-doc-partes { grid-template-columns: 1fr; }
  .pg-doc-numero { text-align: left; }
}
.pg-doc-escritorio { margin-bottom: 18px; }
.pg-doc-pendientes { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pg-doc-pendientes li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pg-doc-pendiente { all: unset; box-sizing: border-box; cursor: pointer; flex: 1 1 320px; display: flex; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--pg-line-soft); border-radius: var(--pg-radius-sm); }
.pg-doc-pendiente:hover { background: var(--pg-surface-2); }
.pg-doc-pendiente:focus-visible { outline: 2px solid var(--pg-accent); }
.pg-doc-pendiente-der { display: flex; gap: 10px; align-items: center; }
/* Al imprimir sale solo la hoja. */
@media print {
  body * { visibility: hidden !important; }
  .pg-doc-hoja, .pg-doc-hoja * { visibility: visible !important; }
  .pg-doc-hoja { position: absolute; left: 0; top: 0; width: 100%; max-width: none; border: 0; box-shadow: none; padding: 0; }
}

/* Piano de la tarea, dentro de la tarjeta del cliente (Munus). */
.pg-tarea-piano { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; font-size: 14px; }
.pg-tarea-piano label { font-weight: 600; }
.pg-tarea-piano select { flex: 1 1 220px; max-width: 420px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: inherit; font: inherit; }
.pg-tarea-piano select option { color: #111; }
.pg-tarea-modelo { display: flex; gap: 8px; flex: 1 1 100%; flex-wrap: wrap; }
.pg-tarea-modelo select { flex: 0 1 200px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: inherit; font: inherit; }
.pg-tarea-modelo select option { color: #111; }
.pg-tarea-modelo input { flex: 1 1 160px; max-width: 260px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: inherit; font: inherit; }
.pg-tarea-modelo input:disabled { opacity: .5; }
.pg-tarea-modelo button { padding: 6px 14px; border-radius: 8px; border: 0; background: #7b68ee; color: #fff; font: inherit; cursor: pointer; }

/* Desplegables propios dentro del modal oscuro de Munus. */
.pg-tarea-piano {
  --pg-surface: #26262c; --pg-surface-2: #34343c; --pg-ink: #e8e8ea; --pg-ink-3: #8b8d98;
  --pg-line: rgba(255,255,255,.16); --pg-accent: #8b7cf6;
}
.pg-tarea-piano-etq { font-weight: 600; }
.pg-tarea-piano > .pg-select { flex: 1 1 220px; max-width: 420px; }
.pg-tarea-modelo .pg-select { flex: 0 1 220px; min-width: 180px; }
.pg-tarea-piano .pg-select-lista { max-height: 280px; }
.pg-combo { position: relative; flex: 1 1 160px; max-width: 260px; }
.pg-combo input { width: 100%; box-sizing: border-box; padding: 8px 12px; border-radius: var(--pg-radius-sm);
  border: 1px solid var(--pg-line); background: var(--pg-surface); color: var(--pg-ink); font: inherit; font-size: 14px; line-height: 1.4; }
.pg-combo input:focus { outline: none; border-color: var(--pg-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pg-accent) 18%, transparent); }
.pg-combo input:disabled { opacity: .5; }
.pg-combo-tipo { font-size: 12px; color: var(--pg-ink-3); font-weight: 400; }
.pg-tarea-piano .pg-select-boton,
.pg-tarea-piano .pg-select-boton:hover,
.pg-tarea-piano .pg-select-boton.is-abierto { background: var(--pg-surface); color: var(--pg-ink); }

/* Cotizaciones del cliente dentro de la tarea (Munus). */
.pg-tarea-cot { margin: 12px 0 4px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.pg-tarea-cot-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pg-tarea-cot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-tarea-cot li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; }
.pg-tarea-cot-doc { all: unset; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; flex: 1 1 240px; }
.pg-tarea-cot-doc:hover strong { text-decoration: underline; }
.pg-tarea-cot-meta { flex-basis: 100%; font-size: 12.5px; color: #8b8d98; }
.pg-tarea-cot-btn { padding: 6px 12px; border-radius: 8px; border: 0; background: #7b68ee; color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.pg-tarea-cot-btn.is-ghost { background: transparent; border: 1px solid rgba(255,255,255,.2); color: inherit; }
.pg-tarea-cot-listo { font-size: 13px; color: #3fb37f; }
.pg-tarea-cot-vacio { margin: 0; color: #8b8d98; font-size: 13px; }
/* Cotizar / Facturar en cada tarea (Munus). */
.pg-tarea-docs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 10px; font-size: 13.5px; }
.pg-tarea-docs-txt { flex: 1 1 200px; color: #8b8d98; }

/* Editor de cotización/factura, con la forma de Mediamix. */
.pg-doc-editor { padding: 28px; border-radius: 22px; }
.pg-doc-editor-cab { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--pg-line-soft); }
.pg-doc-editor-cab .pg-doc-logo { height: 44px; }
.pg-doc-editor-cab h3 { margin: 0; font-family: var(--pg-serif); font-size: 26px; }
.pg-doc-editor-cab p { margin: 2px 0 0; font-size: 13.5px; }
.pg-doc-editor .pg-campo > input, .pg-doc-editor .pg-campo > textarea, .pg-doc-editor .pg-combo input,
.pg-doc-editor .pg-doc-lineas input:not([type=checkbox]) {
  width: 100%; box-sizing: border-box; border: 1.5px solid var(--pg-line); border-radius: 12px; padding: 11px 14px;
  background: var(--pg-surface); color: var(--pg-ink); font: inherit; font-size: 15px; }
.pg-doc-editor .pg-campo > input:focus, .pg-doc-editor .pg-campo > textarea:focus, .pg-doc-editor .pg-combo input:focus,
.pg-doc-editor .pg-doc-lineas input:focus { border-color: var(--pg-ink); outline: none; box-shadow: none; }
.pg-doc-editor .pg-select { display: block; width: 100%; }
.pg-doc-editor .pg-select-boton { border: 1.5px solid var(--pg-line); border-radius: 12px; padding: 11px 14px; font-size: 15px; }
.pg-doc-editor .pg-combo { position: relative; max-width: none; flex: 1 1 auto; }
.pg-doc-editor .pg-combo .pg-select-lista { min-width: 100%; }
.pg-doc-editor .pg-combo .pg-select-opcion { justify-content: space-between; }
.pg-doc-lineas td { vertical-align: top; }
.pg-doc-lineas input.pg-num { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.pg-doc-lineas .pg-doc-detalle { margin-top: 6px; font-size: 13px !important; padding: 8px 12px !important; }
.pg-doc-lineas input[type=checkbox] { width: 18px; height: 18px; margin-top: 12px; accent-color: var(--pg-ink); }
.pg-doc-lineas td.pg-num { padding-top: 22px; font-variant-numeric: tabular-nums; }
.pg-doc-tarjetas { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 18px 0 22px; }
.pg-doc-tarjeta { background: var(--pg-surface-2); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.pg-doc-tarjeta span { font-family: var(--pg-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--pg-ink-2); }
.pg-doc-tarjeta strong { font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pg-doc-tarjeta.is-total { background: var(--pg-ink); color: var(--pg-bg, #fff); }
.pg-doc-tarjeta.is-total span { color: color-mix(in srgb, var(--pg-bg, #fff) 70%, transparent); }
.pg-doc-editor .pg-doc-lineas td:first-child { width: 100%; min-width: 280px; }
.pg-doc-editor .pg-doc-lineas input.pg-num { width: 110px; padding: 11px 12px; }
.pg-doc-editor .pg-doc-lineas td:nth-child(2) input.pg-num { width: 76px; }
.pg-doc-editor .pg-doc-lineas td.pg-num { white-space: nowrap; }
.pg-doc-editor-cab h3 { text-transform: none; letter-spacing: -.01em; color: var(--pg-ink); }

/* Cotización dinámica y enlace público. */
.pg-doc-dinamica { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; max-width: 900px;
  border: 1px solid var(--pg-line-soft); border-radius: 12px; background: var(--pg-surface); font-size: 14px; }
.pg-doc-dinamica input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--pg-accent); }
.pg-doc-enlace { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; font-size: 14px; }
.pg-doc-enlace a { color: var(--pg-accent); word-break: break-all; }
.pg-doc-publica { padding: 28px 0 56px; }
.pg-doc-publica .pg-doc-hoja { margin: 0 auto; }
.pg-doc-publica .pg-doc-acciones { max-width: 900px; margin: 0 auto 14px; align-items: center; }

/* Inventario por categorías. */
.pg-inv-filtro { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--pg-surface-2); margin-left: auto; }
.pg-inv-filtro button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 13.5px; color: var(--pg-ink-2); cursor: pointer; }
.pg-inv-filtro button.is-activo { background: var(--pg-surface); color: var(--pg-ink); box-shadow: var(--pg-shadow); font-weight: 600; }
.pg-inv-tabla tr.pg-inv-grupo th { text-align: left; padding: 22px 12px 8px; font-family: var(--pg-serif); font-size: 18px;
  letter-spacing: 0; text-transform: none; color: var(--pg-ink); border-bottom: 2px solid var(--pg-line); background: transparent; }
.pg-inv-tabla tr.pg-inv-grupo th span { margin-left: 8px; font-family: var(--pg-mono); font-size: 12px; color: var(--pg-ink-3); }

/* Piezas marcadas en el esquema (cotización). */
.pg-ac-pieza.is-marcada > * { stroke: #e5484d; stroke-width: 2.6; }
.pg-ac-pieza.is-marcada .pg-ac-fieltro { stroke: #e5484d; }
.pg-ac-svg.tiene-marcadas .pg-ac-pieza:not(.is-marcada):not(.is-act) { opacity: .4; }
.pg-ac-svg.tiene-marcadas .pg-ac-fijo { opacity: .4; }
.pg-ac-etiqueta.is-marcada .pg-ac-globo { fill: #e5484d; stroke: #e5484d; }
.pg-ac-etiqueta.is-marcada text { fill: #fff; }
.pg-ac-etiqueta.is-marcada line { stroke: #e5484d; opacity: 1; stroke-dasharray: none; }
.pg-ac-elegir-lista li.is-marcada { color: #e5484d; font-weight: 600; }
.pg-ac-elegir-lista li.is-marcada .pg-ac-elegir-n { background: #e5484d; color: #fff; border-color: #e5484d; }
.pg-ac-solo-ver { pointer-events: none; }

/* Piezas de la mecánica en la cotización. */
.pg-doc-piezas { margin: 4px 0 18px; padding: 14px 16px; border: 1.5px solid var(--pg-line); border-radius: 14px; }
.pg-doc-piezas-cab { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pg-doc-piezas-cab .pg-muted { flex: 1 1 200px; font-size: 13.5px; }
.pg-doc-piezas .pg-ac-elegir { margin-top: 12px; }
.pg-doc-piezas-lista { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-doc-piezas-lista li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pg-doc-piezas-lista .pg-select { min-width: 200px; }
.pg-doc-pieza-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.pg-doc-pieza-nombre { flex: 1 1 200px; font-weight: 600; }
.pg-doc-hoja-piezas { margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid #e6e1da; }
.pg-doc-hoja-piezas-cuerpo { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: center; }
.pg-doc-hoja-piezas ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.pg-doc-hoja-piezas li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pg-doc-hoja-piezas li em { font-style: normal; font-size: 12px; color: #6b645c; margin-left: auto; }
.pg-doc-hoja .pg-ac-svg { width: 100%; height: auto; }
@media (max-width: 640px) { .pg-doc-hoja-piezas-cuerpo { grid-template-columns: 1fr; } }

/* Piezas de la mecánica dentro de la tarea (Munus). */
.pg-tarea-piezas { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; font-size: 14px;
  --pg-surface: #26262c; --pg-surface-2: #34343c; --pg-ink: #e8e8ea; --pg-ink-2: #b4b6c0; --pg-ink-3: #8b8d98;
  --pg-line: rgba(255,255,255,.16); --pg-line-soft: rgba(255,255,255,.1); --pg-accent: #8b7cf6; }
.pg-tarea-piezas .pg-ac-elegir { margin-top: 10px; background: #f6f3ee; border-radius: 10px; padding: 8px; color: #1d1a17;
  --pg-ink: #1d1a17; --pg-ink-2: #4a453f; --pg-ink-3: #6b645c; --pg-surface: #fff; --pg-line: #ddd6cc; }
.pg-tarea-piezas-n { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 12px; }
.pg-tarea-piezas-lista { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-tarea-piezas-lista li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pg-tarea-piezas-lista .pg-select { min-width: 190px; }
.pg-borrar-x { border: 0; background: transparent; color: #8b8d98; font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.pg-borrar-x:hover { color: #e5484d; background: rgba(229,72,77,.1); }

/* Piezas de la mecánica de un servicio (inventario). */
.pg-serv-piezas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pg-serv-piezas.is-fila { margin-top: 6px; }
.pg-serv-pieza { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 999px;
  background: var(--pg-surface-2); font-size: 12.5px; }
.pg-serv-pieza .pg-doc-pieza-n { width: 20px; height: 20px; font-size: 11px; }
.pg-serv-pieza button { border: 0; background: transparent; cursor: pointer; color: var(--pg-ink-3); font-size: 15px; line-height: 1; padding: 0 2px; }
.pg-serv-pieza button:hover { color: #e5484d; }

/* Miniatura del dibujo por línea (cotización). */
.pg-doc-linea-piezas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.pg-doc-linea-mini { display: flex; align-items: center; gap: 10px; }
.pg-doc-linea-mini .pg-ac-solo-ver { width: 170px; flex: none; border: 1px solid var(--pg-line-soft); border-radius: 8px; background: #fbf9f6; overflow: hidden; }
.pg-doc-linea-mini .pg-ac-svg { width: 100%; height: auto; display: block; }
.pg-doc-linea-mini span { font-size: 13px; font-weight: 600; color: #e5484d; }
.pg-doc-linea-mini.is-hoja { margin-top: 6px; }
.pg-doc-linea-mini.is-hoja .pg-ac-solo-ver { width: 150px; }
.pg-doc-linea-dibujo { flex-basis: 100%; }
@media print {
  .pg-doc-hoja .pg-ac-svg, .pg-doc-hoja .pg-ac-svg * { visibility: visible !important; }
  .pg-doc-linea-mini .pg-ac-solo-ver, .pg-doc-hoja-piezas { break-inside: avoid; }
  .pg-doc-hoja { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.pg-doc-linea-texto { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: #e5484d; }
.pg-doc-linea-piezas .pg-doc-linea-texto { margin-top: 0; }

/* Descripción de los servicios al pie de la cotización. */
.pg-doc-hoja-servicios { margin: 18px 0 4px; padding-top: 14px; border-top: 1px solid #e6e1da; break-inside: avoid; }
.pg-doc-hoja-servicios dl { margin: 0; display: grid; grid-template-columns: minmax(150px, 1fr) 3fr; gap: 6px 18px; font-size: 13px; }
.pg-doc-hoja-servicios dt { font-weight: 600; }
.pg-doc-hoja-servicios dd { margin: 0; color: #4a453f; }
@media (max-width: 640px) { .pg-doc-hoja-servicios dl { grid-template-columns: 1fr; } .pg-doc-hoja-servicios dd { margin-bottom: 6px; } }

/* Fotos de la tarea en la cotización. */
.pg-doc-hoja-fotos { margin: 18px 0 4px; padding-top: 14px; border-top: 1px solid #e6e1da; }
.pg-doc-hoja-fotos-rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pg-doc-hoja-fotos figure { margin: 0; break-inside: avoid; }
.pg-doc-hoja-fotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.pg-doc-hoja-fotos figcaption { font-size: 11.5px; color: #6b645c; margin-top: 4px; }
@media (max-width: 640px) { .pg-doc-hoja-fotos-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* El selector de piezas dentro de un recuadro (tarea, cotización, servicio):
   el dibujo cabe en el ancho que haya, y la lista va debajo. */
.pg-ac-elegir .pg-ac-svg, .pg-ac-solo-ver .pg-ac-svg { min-width: 0; }
.pg-ac-elegir { min-width: 0; }
.pg-ac-elegir-dibujo { min-width: 0; overflow: hidden; }
.pg-tarea-piezas .pg-ac-elegir,
.pg-doc-piezas .pg-ac-elegir,
.pg-doc-linea-dibujo .pg-ac-elegir,
.pg-serv-piezas + .pg-ac-elegir,
.pg-campo .pg-ac-elegir { grid-template-columns: 1fr; }
.pg-tarea-piezas .pg-ac-elegir-lista,
.pg-doc-piezas .pg-ac-elegir-lista,
.pg-doc-linea-dibujo .pg-ac-elegir-lista,
.pg-campo .pg-ac-elegir-lista { max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 8px; }
.pg-tarea-piezas .pg-ac-elegir {
  --pg-surface-2: #ece7df; --pg-accent: #4f46e5; --pg-accent-soft: rgba(79,70,229,.1);
  --pg-line-soft: #e2dbd0; }
.pg-tarea-piezas .pg-ac-elegir-dibujo { background: #fbf9f6; }
