/* Costos y materiales (costos.js): editor privado del Profesional, margen en vivo y catálogo «Mis costos» */
#costos-dialog { color: var(--texto, #172d42); background: var(--panel, #fff); border: 1px solid var(--borde, #dce4eb); border-radius: 22px;
  width: min(1120px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; box-shadow: 0 24px 64px rgba(14, 34, 54, .28); overflow: auto; }
#costos-dialog::backdrop { background: #0e2236c2; backdrop-filter: blur(5px); }
#costos-dialog * { box-sizing: border-box; }
#costos-dialog h2, #costos-dialog p { margin: 0; }
#costos-dialog button, #costos-dialog input, #costos-dialog select { font: inherit; }
#costos-dialog button { cursor: pointer; }
#costos-dialog button:disabled { cursor: not-allowed; opacity: .55; }
#costos-dialog :focus-visible { outline: 3px solid #087f93; outline-offset: 2px; }
.ct-cab { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 20px 22px 12px; }
.ct-cab small { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #9b6200; font-weight: 700; }
.ct-cab h2 { font-size: 22px; letter-spacing: -.3px; margin-top: 2px; }
.ct-cab p { color: var(--suave, #536575); font-size: 13px; margin-top: 4px; max-width: 70ch; }
.ct-x { background: none; border: 0; color: inherit; width: 44px; height: 44px; border-radius: 12px; font-size: 26px; line-height: 1; flex: none; }
.ct-x:hover { background: var(--fondo-2, #f1f5f8); }
.ct-tabs { display: none; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--borde, #dce4eb); }
.ct-tabs button { background: none; border: 0; padding: 12px 14px; min-height: 44px; color: var(--suave, #536575); font-weight: 600; border-bottom: 3px solid transparent; }
.ct-tabs button[aria-selected="true"] { color: var(--texto, #172d42); border-bottom-color: #087f93; }
.ct-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; padding: 8px 22px 16px; align-items: start; }
.ct-resumen { display: none; }
.ct-lateral { position: sticky; top: 8px; display: grid; gap: 12px; padding: 14px; border: 1px solid var(--borde, #dce4eb); border-radius: 16px; background: var(--fondo-2, #f6f9fb); }
.ct-acc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.ct-acc .btn { min-height: 40px; }
.ct-del-cat { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; }
.ct-del-cat select { min-height: 40px; max-width: 260px; border: 1px solid var(--borde, #c9d4dd); border-radius: 10px; padding: 6px 8px; background: var(--panel, #fff); color: inherit; }
.ct-tabla { display: grid; gap: 6px; }
.ct-fila { display: grid; grid-template-columns: minmax(160px, 2.4fr) minmax(108px, 1.1fr) 78px 70px 104px 96px 64px 40px; gap: 6px; align-items: center; }
.ct-enc { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--suave, #536575); font-weight: 700; }
.ct-fila input:not([type="checkbox"]), .ct-fila select { width: 100%; min-width: 0; min-height: 40px; padding: 6px 8px; border: 1px solid var(--borde, #c9d4dd); border-radius: 9px; background: var(--panel, #fff); color: inherit; font-size: 14px; }
.ct-fila input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.ct-imp { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.ct-comprado { display: flex; justify-content: center; }
.ct-comprado input { width: 20px; height: 20px; accent-color: #1f8a4c; }
.ct-quitar { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--borde, #dce4eb); background: none; color: inherit; font-size: 20px; line-height: 1; }
.ct-quitar:hover { background: #fdecea; color: #a3312b; }
.ct-vacio { color: var(--suave, #536575); font-size: 13.5px; padding: 18px; border: 1px dashed var(--borde, #c9d4dd); border-radius: 14px; text-align: center; }
.ct-kpis { display: grid; gap: 8px; }
.ct-kpis div { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; background: var(--panel, #fff); border: 1px solid var(--borde, #dce4eb); }
.ct-kpis small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--suave, #536575); font-weight: 700; }
.ct-kpis b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ct-kpis em { font-style: normal; font-size: 12px; color: var(--suave, #536575); }
.ct-kpis .ok { border-color: #1f8a4c; } .ct-kpis .av { border-color: #c98a14; } .ct-kpis .er { border-color: #c2413b; }
.ct-kpis .ok b { color: #1f7a45; } .ct-kpis .av b { color: #9b6200; } .ct-kpis .er b { color: #a3312b; }
.ct-barra { position: relative; height: 12px; border-radius: 6px; background: #d5efe0; overflow: visible; }
.ct-barra .costo { display: block; height: 100%; border-radius: 6px; background: #627e96; }
.ct-barra .meta { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #9b6200; }
.ct-estado { font-size: 13px; line-height: 1.45; padding: 8px 10px; border-radius: 10px; }
.ct-estado.ok { background: #e8f6ee; color: #135c3e; } .ct-estado.av { background: #fff4dd; color: #6e4700; } .ct-estado.er { background: #fdecea; color: #a3312b; } .ct-estado.neu { background: var(--panel, #fff); color: var(--suave, #536575); }
.ct-meta { display: grid; gap: 6px; } .ct-meta p { font-size: 12.5px; color: var(--suave, #536575); }
.ct-campo { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; }
.ct-campo small { font-weight: 400; color: var(--suave, #536575); }
.ct-campo input { min-height: 44px; font-size: 16px; padding: 8px 11px; border: 1px solid var(--borde, #c9d4dd); border-radius: 10px; background: var(--panel, #fff); color: inherit; width: 100%; max-width: 160px; }
.ct-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.ct-cats li { display: flex; justify-content: space-between; gap: 8px; } .ct-cats b { font-variant-numeric: tabular-nums; }
.ct-error { grid-column: 1 / -1; color: #a3312b; background: #fdecea; border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.ct-pie { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; background: var(--panel, #fff); border-top: 1px solid var(--borde, #dce4eb); }
.ct-pie .btn { min-height: 44px; }
.ct-cfg-lista { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.ct-cfg-lista li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--borde, #dce4eb); border-radius: 12px; }
.ct-cfg-lista li span { display: grid; min-width: 0; } .ct-cfg-lista small { color: var(--suave, #536575); }
.ct-meta-cfg { margin: 10px 0; }
#costos-dialog .sr, .ct-cfg-lista .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* chip de margen en la barra fija de entrega y en el resumen de la cotización (fv.js) */
.fv-margen { display: inline-flex; gap: 8px; align-items: center; text-align: left; min-height: 44px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--borde, #dce4eb); background: var(--fondo-2, #f6f9fb); color: inherit; font: inherit; cursor: pointer; }
.fv-margen b { display: block; font-size: 13.5px; } .fv-margen small { display: block; font-size: 11.5px; color: var(--suave, #536575); }
.fv-margen.ok { border-color: #1f8a4c; } .fv-margen.ok b { color: #1f7a45; }
.fv-margen.av { border-color: #c98a14; } .fv-margen.av b { color: #9b6200; }
.fv-margen.er { border-color: #c2413b; } .fv-margen.er b { color: #a3312b; }
.fv-solo { font-style: normal; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #9b6200; background: #fff4dd; border-radius: 5px; padding: 2px 5px; margin-left: 4px; vertical-align: middle; }
.fv-margen-txt.ok { color: #1f7a45; } .fv-margen-txt.av { color: #9b6200; } .fv-margen-txt.er { color: #a3312b; }
@media (max-width: 900px) {
  .ct-tabs { display: flex; }
  .ct-cuerpo { grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
  .ct-lateral { display: none; }
  .ct-resumen { display: grid; gap: 12px; }
  .ct-lista[data-oculto], .ct-resumen[data-oculto] { display: none; }
  .ct-enc { display: none; }
  /* cada concepto es una tarjeta: concepto y quitar; tipo, cantidad y unidad; costo, importe y comprado */
  .ct-fila { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "d d q" "t n u" "c i k"; padding: 10px; border: 1px solid var(--borde, #dce4eb); border-radius: 12px; }
  .ct-fila > :nth-child(1) { grid-area: d; } .ct-fila > :nth-child(2) { grid-area: t; } .ct-fila > :nth-child(3) { grid-area: n; }
  .ct-fila > :nth-child(4) { grid-area: u; } .ct-fila > :nth-child(5) { grid-area: c; } .ct-fila > :nth-child(6) { grid-area: i; }
  .ct-fila > :nth-child(7) { grid-area: k; } .ct-fila > :nth-child(8) { grid-area: q; justify-self: end; align-self: end; }
  #costos-dialog .ct-fila .sr { position: static; width: auto; height: auto; clip: auto; white-space: normal; font-size: 11px; color: var(--suave, #536575); display: block; }
  #costos-dialog .ct-fila .ct-comprado .sr { order: -1; }
  .ct-fila label { display: grid; gap: 2px; }
  .ct-comprado { flex-direction: column; align-items: center; gap: 4px; }
  .ct-imp { align-self: end; padding-bottom: 10px; }
  .ct-cab, .ct-pie { padding-inline: 16px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ct-estado.ok { background: #123a28; color: #c9f1da; }
  :root:not([data-theme="light"]) .ct-estado.av { background: #3d2d0b; color: #ffe3a6; }
  :root:not([data-theme="light"]) .ct-estado.er, :root:not([data-theme="light"]) .ct-error { background: #4a1d1a; color: #ffd2cd; }
  :root:not([data-theme="light"]) .fv-solo { background: #3d2d0b; color: #ffcd78; }
  :root:not([data-theme="light"]) .ct-kpis .ok b, :root:not([data-theme="light"]) .fv-margen.ok b, :root:not([data-theme="light"]) .fv-margen-txt.ok { color: #6fd39d; }
  :root:not([data-theme="light"]) .ct-kpis .av b, :root:not([data-theme="light"]) .fv-margen.av b, :root:not([data-theme="light"]) .fv-margen-txt.av { color: #ffcd78; }
  :root:not([data-theme="light"]) .ct-kpis .er b, :root:not([data-theme="light"]) .fv-margen.er b, :root:not([data-theme="light"]) .fv-margen-txt.er { color: #ff9b91; }
  :root:not([data-theme="light"]) .ct-cab small { color: #ffcd78; }
  :root:not([data-theme="light"]) .ct-barra { background: #1d4a35; }
}
@media print { .fv-margen, .fv-cot-costos, .fv-solo { display: none !important; } }
/* ---- 12-11-2026: alta y edición de «Mis costos» en Configuración */
.ct-cfg-nuevo{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;margin-top:12px;padding:12px;border:1px dashed var(--borde,#dce4eb);border-radius:12px}
.ct-cfg-nuevo>b,.ct-cfg-acc{grid-column:1/-1}.ct-cfg-acc{display:flex;gap:8px;flex-wrap:wrap}
.ct-cfg-b{display:flex;gap:6px;flex:none}
@media(max-width:600px){.ct-cfg-nuevo{grid-template-columns:1fr}}
