/* ---Css vista: Presupuestos */

:root {
  --presupuesto-surface: #ffffff;
  --presupuesto-bg: #f3f6fb;
  --presupuesto-border: #e2e8f0;
  --presupuesto-divider: #e5e7eb;
  --presupuesto-header-bg: #008080;
  --presupuesto-text: #0f172a;
  --presupuesto-muted: #64748b;
  --presupuesto-accent: #1d4ed8;
  --presupuesto-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  --presupuesto-col-p2: 140px;
  --presupuesto-col-p3: 520px;
  --presupuesto-col-p4: 120px;
  --presupuesto-col-p5: 130px;
  --presupuesto-col-p6: 320px;
  --presupuesto-col-p7: 130px;
  --presupuesto-col-p8: 140px;
}

#presupuesto-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.box_titulo_obra {
  min-height: 40px;
  width: min(1800px, 98vw);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 4px auto 12px;
  padding: 2px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #000000;
  box-shadow: none;
  font-family: "Poppins", sans-serif;
}

.tipo_obra {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  color: #000000;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.titulo_obra {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  color: #000000;
  text-align: center;
  line-height: 1.3;
}

.box_presupuesto {
  height: 100%;
  width: min(1800px, 98vw);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  margin: 0 auto 0;
  flex: 1;
  min-height: 0;
  background: var(--presupuesto-bg);
  border: 1px solid var(--presupuesto-border);
  box-shadow: var(--presupuesto-shadow);
  padding: 14px;
}

.box_presupuesto > .presupuesto-table {
  flex: 1 1 auto;
  min-height: 0;
}

.presupuesto-table {
  height: 100%;
  max-height: clamp(320px, calc(100vh - 250px), 980px);
  max-height: clamp(320px, calc(100dvh - 250px), 980px);
  overflow-x: auto;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--presupuesto-surface);
  border: 1px solid var(--presupuesto-border);
  position: relative;
}

.presupuesto-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: "Poppins", sans-serif;
  table-layout: fixed;
}

.presupuesto-table col[data-col="p2"] {
  width: var(--presupuesto-col-p2);
}

.presupuesto-table col[data-col="p3"] {
  width: var(--presupuesto-col-p3);
}

.presupuesto-table col[data-col="p4"] {
  width: var(--presupuesto-col-p4);
}

.presupuesto-table col[data-col="p5"] {
  width: var(--presupuesto-col-p5);
}

.presupuesto-table col[data-col="p6"] {
  width: var(--presupuesto-col-p6);
}

.presupuesto-table col[data-col="p7"] {
  width: var(--presupuesto-col-p7);
}

.presupuesto-table col[data-col="p8"] {
  width: var(--presupuesto-col-p8);
}

.presupuesto-table thead {
  background: var(--presupuesto-header-bg);
}

.presupuesto-table th {
  text-align: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--presupuesto-header-bg);
  border-right: 1px solid var(--presupuesto-divider);
  position: sticky;
  overflow: visible;
}

.presupuesto-table td {
  padding: 12px 16px;
  color: var(--presupuesto-text);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--presupuesto-border);
  border-right: 1px solid var(--presupuesto-divider);
}

.presupuesto-table td.p4,
.presupuesto-table td.p5,
.presupuesto-table td.p7,
.presupuesto-table td.p8 {
  text-align: center;
}

.presupuesto-table th.p6,
.presupuesto-table td.p6 {
  text-align: left;
}

.presupuesto-table td.p6 {
  font-size: 0.76rem;
  line-height: 1.2;
  white-space: normal;
  text-transform: uppercase;
}

.presupuesto-table td.p4 .rename-input,
.presupuesto-table td.p5 .rename-input,
.presupuesto-table td.p7 .rename-input,
.presupuesto-table td.p8 .rename-input,
.presupuesto-table td.p4 .presupuesto-select,
.presupuesto-table td.p5 .presupuesto-select,
.presupuesto-table td.p7 .presupuesto-select,
.presupuesto-table td.p8 .presupuesto-select {
  text-align: center;
}

.presupuesto-table th:last-child,
.presupuesto-table td:last-child {
  border-right: none;
}

.presupuesto-table tbody tr.presupuesto-row-inputs td {
  padding: 1px;
  border-right: 1px solid var(--presupuesto-divider);
}

.presupuesto-table tbody tr.presupuesto-row-inputs {
  cursor: default;
}

.presupuesto-table tbody tr.presupuesto-row-inputs .presupuesto-tree {
  align-items: center;
  gap: 6px;
}

.presupuesto-table tbody tr.presupuesto-row-inputs .presupuesto-select {
  margin-bottom: 0;
}

.presupuesto-table tbody tr.presupuesto-row-inputs .rename-input,
.presupuesto-table tbody tr.presupuesto-row-inputs .presupuesto-select {
  border-radius: 6px;
}

.presupuesto-table tbody tr.presupuesto-row-inputs td.p3 {
  vertical-align: top;
}

.presupuesto-table tbody tr {
  transition: background-color 0.15s ease;
  background-color: var(--presupuesto-surface);
}

.presupuesto-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.presupuesto-table tbody tr:hover {
  background-color: #e9f2ff;
}

.presupuesto-group {
  background-color: #eaf2ff !important;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
}

#presupuesto-root .presupuesto-table tbody tr.presupuesto-group[data-presupuesto-level] td,
#presupuesto-root .presupuesto-table tbody tr.presupuesto-group[data-presupuesto-level] .presupuesto-node-label,
#presupuesto-root .presupuesto-table tbody tr.presupuesto-group[data-presupuesto-level] .presupuesto-toggle {
  color: var(--presupuesto-partida-color);
}

.presupuesto-group.is-selected {
  background-color: #bfdbfe !important;
  color: #0f172a;
  box-shadow: inset 4px 0 0 #2563eb, inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.presupuesto-concepto.is-selected {
  background-color: #bfdbfe !important;
  color: #0f172a;
  box-shadow: inset 4px 0 0 #2563eb, inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.presupuesto-concepto-inserted {
  background-color: #dbeafe !important;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.presupuesto-concepto.is-selected.presupuesto-concepto-inserted {
  background-color: #bfdbfe !important;
  color: #0f172a;
  box-shadow: inset 4px 0 0 #2563eb, inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.presupuesto-group-new {
  background-color: #f1f7ff !important;
}

.presupuesto-group-new.is-selected {
  background-color: #bfdbfe !important;
  color: #0f172a;
  box-shadow: inset 4px 0 0 #2563eb, inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.presupuesto-obra-total {
  cursor: default;
}

.presupuesto-obra-total td.p8 {
  text-align: right;
}

.presupuesto-concepto-new {
  background-color: #f8fbff !important;
}

.presupuesto-concepto-new.is-selected {
  background-color: #bfdbfe !important;
  color: #0f172a;
  box-shadow: inset 4px 0 0 #2563eb, inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.presupuesto-table .rename-input[readonly] {
  background-color: #eff6ff;
  color: #1e3a8a;
  cursor: default;
}

.presupuesto-total-row td {
  background: #e2e8f0;
  font-weight: 700;
}

.presupuesto-total-row td.p8 {
  text-align: right;
}

.presupuesto-total-letra-row td {
  background: #f8fafc;
  font-size: 0.82rem;
}

.presupuesto-total-letra-label {
  font-weight: 700;
  text-transform: uppercase;
}

.presupuesto-total-letra-value {
  text-transform: uppercase;
}

.presupuesto-row-draggable[draggable="true"] {
  cursor: grab;
}

.presupuesto-row-draggable.presupuesto-dragging {
  opacity: 0.6;
}

.presupuesto-drop-target {
  outline: 2px dashed var(--presupuesto-accent);
  outline-offset: -2px;
}

.presupuesto-drop-line-indicator {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--presupuesto-accent);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.15);
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.presupuesto-drop-line-indicator.is-visible {
  opacity: 1;
}

.presupuesto-drop-tooltip {
  position: fixed;
  z-index: 9999;
  width: max-content;
  max-width: min(220px, calc(100vw - 16px));
  padding: 6px 10px;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.presupuesto-drop-tooltip.is-visible {
  opacity: 1;
}

.presupuesto-tree {
  display: flex;
  align-items: center;
  gap: 6px;
}

.presupuesto-tree .rename-input {
  flex: 1;
  min-width: 0;
}

.presupuesto-node-label {
  display: block;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  text-align: justify;
  text-justify: inter-word;
  white-space: normal;
  overflow-wrap: anywhere;
}

.presupuesto-toggle {
  border: none;
  background: transparent;
  padding: 0;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--presupuesto-accent);
  cursor: pointer;
}

.presupuesto-toggle:disabled {
  cursor: default;
}

.presupuesto-toggle-icon {
  display: inline-block;
  transform: rotate(0deg);
  transition: transform 0.15s ease-in-out;
  line-height: 1;
}

.presupuesto-toggle.is-open .presupuesto-toggle-icon {
  transform: rotate(90deg);
}

.presupuesto-toggle.is-empty {
  visibility: hidden;
}

.presupuesto-file-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: #cbd5f5;
  display: inline-block;
}

.presupuesto-empty {
  text-align: center;
  padding: 16px;
  color: var(--presupuesto-muted);
}

.disenoIcono.diseno-insert {
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.disenoIcono.diseno-insert-partida {
  width: 170px;
}

.btn-icon.btn-insert {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 12px;
  color: #0f172a;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
  background-color: #f8fafc;
}

.btn-icon.btn-insert:disabled {
  opacity: 0.6;
}

.presupuesto-select {
  width: 100%;
  margin-bottom: 6px;
  padding: 6px 8px;
  border: 1px solid var(--presupuesto-border);
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.85rem;
  color: #0f172a;
}

.presupuesto-select:focus {
  outline: none;
  border-color: var(--presupuesto-accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.box_presupuesto .rename-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--presupuesto-border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--presupuesto-text);
  background-color: #f8fafc;
}

.box_presupuesto .rename-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.box_presupuesto .rename-textarea {
  width: 100%;
  min-height: 1.35em;
  line-height: 1.35;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
}

.presupuesto-table tbody tr.presupuesto-row-inputs .cell-editor {
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--presupuesto-border);
  border-radius: 6px;
  box-shadow: none;
  background-color: #f8fafc;
  font-size: 0.85rem;
  color: var(--presupuesto-text);
}

.presupuesto-table tbody tr.presupuesto-row-inputs .cell-editor:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.box_presupuesto input[type="number"].rename-input::-webkit-inner-spin-button,
.box_presupuesto input[type="number"].rename-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.box_presupuesto input[type="number"].rename-input {
  -moz-appearance: textfield;
  appearance: textfield;
}


  /* ======== Ancho de columnas en Presupuesto de obra=========== */

.p2 {
  /* Clave */
  width: var(--presupuesto-col-p2);
}

.p3 {
  /* Descripcion */
  width: var(--presupuesto-col-p3);
}

.p4 {
  /* Unidad */
  width: var(--presupuesto-col-p4);
}

.p5 {
  /* Cantidad */
  width: var(--presupuesto-col-p5);
}

.p6 {
  /* Precio en letra */
  width: 200px;
}

.p7 {
  /* P.U. */
  width: var(--presupuesto-col-p7);
}

.p8 {
  /* Importe */
  width: var(--presupuesto-col-p8);
}
  
  /* :::::::::::::::::::::::::::::::::::::::::::::::::: */
  


/* ---Css vista: Auxiliares (Presupuesto) --- */

#presupuesto-root {
  --aux-surface: #ffffff;
  --aux-bg: #f3f6fb;
  --aux-border: #e2e8f0;
  --aux-divider: #e5e7eb;
  --aux-text: #0f172a;
  --aux-muted: #64748b;
  --aux-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  --aux-col-clave: 120px;
  --aux-col-familia: 180px;
  --aux-col-descripcion: 420px;
  --aux-col-unidad: 120px;
  --aux-col-costo: 120px;
  --aux-mat-col-clave: 110px;
  --aux-mat-col-descripcion: 420px;
  --aux-mat-col-unidad: 90px;
  --aux-mat-col-cantidad: 110px;
  --aux-mat-col-precio: 110px;
  --aux-mat-col-importe: 110px;
  --aux-modal-col-descripcion: 420px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#presupuesto-root .aux-header {
  width: min(1800px, 98vw);
  margin: 12px auto 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#presupuesto-root .aux-header-bar {
  height: 4px;
  background: #008080;
}

#presupuesto-root .aux-header-fields {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 24px;
  align-items: start;
  padding: 6px 6px 2px;
}

#presupuesto-root .aux-header-fields-with-cantidad {
  grid-template-columns: 160px minmax(320px, 1fr) 140px 140px 160px;
}

@media (max-width: 1100px) {
  #presupuesto-root .aux-header-fields-with-cantidad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #presupuesto-root .aux-header-fields-with-cantidad .aux-header-field-wide {
    grid-column: 1 / -1;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  #presupuesto-root .aux-header-fields-with-cantidad {
    grid-template-columns: 1fr;
  }

  #presupuesto-root .aux-header-fields-with-cantidad .aux-header-field-wide {
    grid-column: auto;
  }
}

#presupuesto-root .aux-header-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "Poppins", sans-serif;
}

#presupuesto-root .aux-header-field-wide {
  min-width: 320px;
}

#presupuesto-root .aux-header-label {
  font-size: 0.85rem;
  color: var(--aux-text);
  font-weight: 600;
}

#presupuesto-root .aux-header-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--aux-border);
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.85rem;
  color: var(--aux-text);
}

#presupuesto-root .aux-header-input[readonly] {
  color: var(--aux-text);
}

#presupuesto-root .aux-header-description {
  min-height: 34px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#presupuesto-root .auxiliares-box {
  height: 100%;
  width: min(1800px, 98vw);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  margin: 0 auto 0;
  flex: 1;
  min-height: 0;
  background: var(--aux-bg);
  border: 1px solid var(--aux-border);
  box-shadow: var(--aux-shadow);
  padding: 14px;
}

#presupuesto-root .auxiliares-box > .auxiliares-table,
#presupuesto-root .auxiliares-box > .aux-materiales-table,
#presupuesto-root .auxiliares-box > .aux-resumen {
  flex: 1 1 auto;
  min-height: 0;
}

#presupuesto-root .auxiliares-table {
  height: 100%;
  overflow: auto;
  border-radius: 12px;
  background: var(--aux-surface);
  border: 1px solid var(--aux-border);
}

#presupuesto-root .auxiliares-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: "Poppins", sans-serif;
  table-layout: fixed;
}

#presupuesto-root .auxiliares-table col.aux-col-clave {
  width: var(--aux-col-clave);
}

#presupuesto-root .auxiliares-table col.aux-col-familia {
  width: var(--aux-col-familia);
}

#presupuesto-root .auxiliares-table col.aux-col-descripcion {
  width: var(--aux-col-descripcion);
}

#presupuesto-root .auxiliares-table col.aux-col-unidad {
  width: var(--aux-col-unidad);
}

#presupuesto-root .auxiliares-table col.aux-col-costo {
  width: var(--aux-col-costo);
}

#presupuesto-root .auxiliares-table thead {
  background: #008080;
}

#presupuesto-root .auxiliares-table th {
  text-align: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 12px 16px;
  background: #008080;
  border-right: 1px solid var(--aux-divider);
  position: sticky;
  top: 0;
  z-index: 2;
}

#presupuesto-root .aux-th {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#presupuesto-root .aux-th span {
  flex: 1;
  text-align: center;
}

#presupuesto-root .aux-sort-button {
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-left: auto;
}

#presupuesto-root .aux-sort-button img {
  width: 14px;
  height: 14px;
  display: block;
}

#presupuesto-root .auxiliares-table td {
  padding: 12px 16px;
  color: var(--aux-text);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--aux-border);
  border-right: 1px solid var(--aux-divider);
}

#presupuesto-root .auxiliares-table td.aux-col-unidad,
#presupuesto-root .auxiliares-table td.aux-col-costo {
  text-align: center;
}

#presupuesto-root .auxiliares-table th.aux-col-unidad,
#presupuesto-root .auxiliares-table th.aux-col-costo {
  text-align: center;
}

#presupuesto-root .aux-col-costo-action {
  cursor: pointer;
}

#presupuesto-root .aux-col-costo-action:focus {
  outline: 2px solid rgba(14, 116, 144, 0.6);
  outline-offset: -2px;
}

#presupuesto-root .auxiliares-table th:last-child,
#presupuesto-root .auxiliares-table td:last-child {
  border-right: none;
}

#presupuesto-root .auxiliares-table tbody tr {
  background-color: var(--aux-surface);
  transition: background-color 0.15s ease;
  cursor: pointer;
}

#presupuesto-root .auxiliares-table tbody tr:nth-child(even) {
  background-color: #e5e7eb;
}

#presupuesto-root .auxiliares-table tbody tr:hover {
  background-color: #e9f2ff;
}

#presupuesto-root .aux-row-inputs td {
  padding: 1px;
}

#presupuesto-root .aux-row-inputs {
  cursor: default;
}

#presupuesto-root .aux-row-new {
  background-color: #f1f7ff;
}

#presupuesto-root .aux-row-dragging {
  opacity: 0.6;
}

#presupuesto-root .aux-row-draggable[draggable="true"] {
  cursor: grab;
}

#presupuesto-root .auxiliares-table tbody tr.is-selected {
  background-color: #e0f2fe !important;
  box-shadow: inset 0 0 0 2px rgba(14, 116, 144, 0.35);
}

#presupuesto-root .auxiliares-table tbody tr.aux-drop-target {
  outline: 2px dashed rgba(14, 116, 144, 0.35);
  outline-offset: -2px;
}

#presupuesto-root .aux-materiales-table tbody tr.aux-drop-target {
  outline: 2px dashed rgba(14, 116, 144, 0.35);
  outline-offset: -2px;
}

#presupuesto-root .aux-basicos-table tbody tr.aux-drop-target {
  outline: 2px dashed rgba(14, 116, 144, 0.35);
  outline-offset: -2px;
}

#presupuesto-root .aux-equipo-table tbody tr.aux-drop-target {
  outline: 2px dashed rgba(14, 116, 144, 0.35);
  outline-offset: -2px;
}

#presupuesto-root .aux-herramienta-table tbody tr.aux-drop-target {
  outline: 2px dashed rgba(14, 116, 144, 0.35);
  outline-offset: -2px;
}

#presupuesto-root .aux-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--aux-border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--aux-text);
  background-color: #f8fafc;
}

#presupuesto-root .aux-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#presupuesto-root .auxiliares-table td.aux-col-unidad .aux-input,
#presupuesto-root .auxiliares-table td.aux-col-costo .aux-input {
  text-align: center;
}

#presupuesto-root .aux-error {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  color: #dc2626;
}

#presupuesto-root .aux-empty {
  text-align: center;
  padding: 16px;
  color: var(--aux-muted);
}

#presupuesto-root .aux-costo-readonly {
  color: var(--aux-text);
}

#presupuesto-root .aux-materiales-table {
  max-height: clamp(320px, calc(100vh - 250px), 980px);
  max-height: clamp(320px, calc(100dvh - 250px), 980px);
  border-radius: 12px;
  background: var(--aux-surface);
  border: 1px solid var(--aux-border);
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#presupuesto-root .aux-materiales-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: "Poppins", sans-serif;
  table-layout: fixed;
}

#presupuesto-root .aux-materiales-table col.aux-mat-col-clave {
  width: var(--aux-mat-col-clave);
}

#presupuesto-root .aux-materiales-table col.aux-mat-col-descripcion {
  width: var(--aux-mat-col-descripcion);
}

#presupuesto-root .aux-materiales-table col.aux-mat-col-unidad {
  width: var(--aux-mat-col-unidad);
}

#presupuesto-root .aux-materiales-table col.aux-mat-col-cantidad {
  width: var(--aux-mat-col-cantidad);
}

#presupuesto-root .aux-materiales-table col.aux-mat-col-precio {
  width: var(--aux-mat-col-precio);
}

#presupuesto-root .aux-materiales-table col.aux-mat-col-importe {
  width: var(--aux-mat-col-importe);
}

#presupuesto-root .aux-materiales-table thead {
  background: #008080;
}

#presupuesto-root .aux-materiales-table th {
  text-align: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #008080;
  border-right: 1px solid var(--aux-divider);
}

#presupuesto-root .aux-select-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  cursor: pointer;
}

#presupuesto-root .aux-select-all-checkbox {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #1d4ed8;
}

#presupuesto-root .aux-select-all-checkbox:disabled {
  cursor: default;
  opacity: 0.55;
}

#presupuesto-root .aux-resumen-select-all-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 10px;
  padding: 0 2px;
}

#presupuesto-root .aux-resumen-select-all {
  width: auto;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--aux-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--aux-text);
  font-family: "Poppins", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
}

#presupuesto-root .aux-materiales-table td {
  padding: 12px 16px;
  color: var(--aux-text);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--aux-border);
  border-right: 1px solid var(--aux-divider);
}

#presupuesto-root .aux-materiales-table tbody tr {
  background-color: var(--aux-surface);
  transition: background-color 0.15s ease;
  cursor: pointer;
}

#presupuesto-root .aux-materiales-table tbody tr.aux-row-draggable[draggable="true"] {
  cursor: grab;
}

#presupuesto-root .aux-basicos-table tbody tr.aux-row-draggable[draggable="true"] {
  cursor: grab;
}

#presupuesto-root .aux-basicos-table {
  scrollbar-gutter: stable;
}

#presupuesto-root .aux-materiales-table .aux-total-row {
  position: sticky;
  bottom: 0;
  z-index: 3;
}

#presupuesto-root .aux-equipo-table tbody tr.aux-row-draggable[draggable="true"] {
  cursor: grab;
}

#presupuesto-root .aux-herramienta-table tbody tr.aux-row-draggable[draggable="true"] {
  cursor: grab;
}

#presupuesto-root .aux-materiales-table tbody tr:hover {
  background-color: #e9f2ff;
}

#presupuesto-root .aux-materiales-table tbody tr.is-selected {
  background-color: #e0f2fe !important;
  box-shadow: inset 0 0 0 2px rgba(14, 116, 144, 0.35);
}

#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price td,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .aux-mat-input {
  color: #dc2626;
}

#presupuesto-root .aux-mat-input {
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--aux-border);
  border-radius: 6px;
  box-shadow: none;
  background: #f8fafc;
  font-size: 0.85rem;
  color: var(--aux-text);
  text-align: inherit;
}

#presupuesto-root .aux-mat-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

/* Tab Materiales (/presupuesto/materiales): igual a /insumos/materiales */
#presupuesto-root .aux-materiales-table[data-material-drop-root="1"] th {
  padding: 12px 16px;
  font-size: 0.9rem;
}

#presupuesto-root .aux-materiales-table[data-material-drop-root="1"] td {
  padding: 12px 16px;
  font-size: 0.9rem;
}

#presupuesto-root .aux-materiales-table[data-material-drop-root="1"] tbody tr.aux-row-inputs td {
  padding: 1px;
}

#presupuesto-root .aux-materiales-table[data-material-drop-root="1"] tbody tr.aux-row-inputs {
  cursor: default;
}

#presupuesto-root .aux-materiales-table[data-material-drop-root="1"] .aux-mat-input {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--aux-text);
  line-height: 1.35;
}

#presupuesto-root .aux-materiales-table[data-material-drop-root="1"] .aux-mat-input:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

#presupuesto-root .aux-materiales-table[data-material-drop-root="1"] tbody tr.aux-row-inputs .aux-mat-input {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--aux-border);
  border-radius: 6px;
  box-shadow: none;
  background-color: #f8fafc;
  font-size: 0.85rem;
  color: var(--aux-text);
}

#presupuesto-root .aux-materiales-table td.aux-mat-col-descripcion {
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

#presupuesto-root .aux-materiales-table td.aux-mat-col-descripcion .aux-mat-description-text {
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#presupuesto-root .aux-materiales-table td.aux-mat-col-descripcion .aux-mat-description-editor {
  min-height: 48px;
  line-height: 1.35;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#presupuesto-root .aux-materiales-table[data-material-drop-root="1"] tbody tr.aux-row-inputs .aux-mat-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#presupuesto-root .aux-materiales-table[data-manoobra-drop-root="1"] .aux-mat-input,
#presupuesto-root .aux-materiales-table[data-herramienta-drop-root="1"] .aux-mat-input,
#presupuesto-root .aux-materiales-table[data-equipo-drop-root="1"] .aux-mat-input,
#presupuesto-root .aux-materiales-table[data-basico-drop-root="1"] .aux-mat-input,
#presupuesto-root .aux-resumen-table .aux-mat-input {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--aux-text);
  line-height: 1.35;
}

#presupuesto-root .aux-materiales-table[data-manoobra-drop-root="1"] .aux-mat-input:focus,
#presupuesto-root .aux-materiales-table[data-herramienta-drop-root="1"] .aux-mat-input:focus,
#presupuesto-root .aux-materiales-table[data-equipo-drop-root="1"] .aux-mat-input:focus,
#presupuesto-root .aux-materiales-table[data-basico-drop-root="1"] .aux-mat-input:focus,
#presupuesto-root .aux-resumen-table .aux-mat-input:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

#presupuesto-root .aux-materiales-table td.aux-inline-edit-cell {
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.35);
  background: rgba(191, 219, 254, 0.28);
}

#presupuesto-root .aux-materiales-table td.aux-inline-edit-cell:focus-within {
  box-shadow: inset 0 0 0 2px rgba(29, 78, 216, 0.65);
}

#presupuesto-root .aux-materiales-table .aux-mat-input.aux-inline-readonly,
#presupuesto-root .aux-materiales-table .aux-rename-input.aux-inline-readonly {
  pointer-events: none;
  user-select: none;
  cursor: default;
}

#presupuesto-root .aux-materiales-table .aux-mat-input.aux-inline-editing,
#presupuesto-root .aux-materiales-table .aux-rename-input.aux-inline-editing {
  pointer-events: auto;
  user-select: text;
  cursor: text;
}

#presupuesto-root .aux-materiales-table td.aux-inline-edit-cell .aux-mat-input.aux-inline-editing,
#presupuesto-root .aux-materiales-table td.aux-inline-edit-cell .aux-rename-input.aux-inline-editing {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--aux-border);
  border-radius: 6px;
  box-shadow: none;
  background: #f8fafc;
}

#presupuesto-root .aux-materiales-table td.aux-inline-edit-cell .aux-mat-input.aux-inline-editing:focus,
#presupuesto-root .aux-materiales-table td.aux-inline-edit-cell .aux-rename-input.aux-inline-editing:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#presupuesto-root .aux-herramienta-table td.aux-mat-col-cantidad {
  padding: 12px 16px;
}

#presupuesto-root .aux-herramienta-table .aux-rename-input {
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--aux-border);
  border-radius: 6px;
  box-shadow: none;
  font-size: 0.85rem;
  color: var(--aux-text);
  background-color: #f8fafc;
}

#presupuesto-root .aux-herramienta-table .aux-rename-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#presupuesto-root .aux-materiales-table td.aux-mat-col-unidad,
#presupuesto-root .aux-materiales-table th.aux-mat-col-unidad {
  text-align: center;
}

#presupuesto-root .aux-materiales-table td.aux-mat-col-cantidad,
#presupuesto-root .aux-materiales-table td.aux-mat-col-precio,
#presupuesto-root .aux-materiales-table td.aux-mat-col-importe {
  text-align: right;
}

#presupuesto-root .aux-materiales-table th.aux-mat-col-unidad,
#presupuesto-root .aux-materiales-table th.aux-mat-col-cantidad,
#presupuesto-root .aux-materiales-table th.aux-mat-col-precio,
#presupuesto-root .aux-materiales-table th.aux-mat-col-importe {
  text-align: center;
}

#presupuesto-root .aux-materiales-table td.aux-mat-col-unidad .aux-mat-input {
  text-align: center;
}

#presupuesto-root .aux-materiales-table td.aux-mat-col-cantidad .aux-mat-input,
#presupuesto-root .aux-materiales-table td.aux-mat-col-precio .aux-mat-input {
  text-align: right;
}

#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price td,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .aux-mat-input,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .aux-rename-input,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .cell-editor {
  color: #dc2626 !important;
}

#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price td,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .aux-mat-input,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .aux-rename-input,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .cell-editor {
  color: #dc2626 !important;
}

/* Resumen: inputs planos como /insumos/materiales (sin caja interna) */
#presupuesto-root .aux-materiales-table.aux-resumen-table .aux-input,
#presupuesto-root .aux-materiales-table.aux-resumen-table .aux-mat-input {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-size: 0.9rem;
  line-height: 1.35;
}

#presupuesto-root .aux-materiales-table.aux-resumen-table .aux-input:focus,
#presupuesto-root .aux-materiales-table.aux-resumen-table .aux-mat-input:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

#presupuesto-root .aux-materiales-table th:last-child,
#presupuesto-root .aux-materiales-table td:last-child {
  border-right: none;
}

#presupuesto-root .aux-materiales-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

#presupuesto-root .aux-total-row {
  display: flex;
  justify-content: flex-end;
  gap: 40px;
  font-weight: 700;
  padding: 10px 14px;
  border-top: 1px solid var(--aux-border);
  background: #ffffff;
}

#presupuesto-root .aux-resumen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--aux-surface);
  border: 1px solid var(--aux-border);
  border-radius: 12px;
  padding: 18px 20px;
  min-height: 420px;
  max-height: clamp(320px, calc(100vh - 250px), 980px);
  max-height: clamp(320px, calc(100dvh - 250px), 980px);
  overflow-x: hidden;
  overflow-y: auto;
}

#presupuesto-root .aux-resumen-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#presupuesto-root .aux-resumen-row {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  font-family: "Poppins", sans-serif;
  color: var(--aux-text);
}

#presupuesto-root .aux-resumen-title {
  font-weight: 600;
}

#presupuesto-root .aux-resumen-total-label {
  text-align: right;
  font-weight: 600;
}

#presupuesto-root .aux-resumen-total {
  min-width: 110px;
  text-align: right;
  font-weight: 700;
}

#presupuesto-root .aux-resumen-toggle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid #1d9a8a;
  background: #1d9a8a;
  padding: 0;
  position: relative;
  cursor: pointer;
}

#presupuesto-root .aux-resumen-toggle::before,
#presupuesto-root .aux-resumen-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
}

#presupuesto-root .aux-resumen-toggle::before {
  width: 14px;
  height: 2px;
}

#presupuesto-root .aux-resumen-toggle::after {
  width: 2px;
  height: 14px;
}

#presupuesto-root .aux-resumen-section[data-resumen-open="1"] .aux-resumen-toggle::after {
  opacity: 0;
}

#presupuesto-root .aux-resumen-section[data-resumen-open="0"] .aux-resumen-panel {
  display: none;
}

#presupuesto-root .aux-resumen-section[data-resumen-open="0"] .aux-resumen-total-block {
  display: none;
}

#presupuesto-root .aux-resumen-section[data-resumen-open="1"] .aux-resumen-total-inline {
  visibility: hidden;
}

#presupuesto-root .aux-resumen-panel {
  padding-left: 40px;
}

#presupuesto-root .aux-resumen-table {
  margin-top: 6px;
  max-height: clamp(220px, calc(100vh - 470px), 480px);
  max-height: clamp(220px, calc(100dvh - 470px), 480px);
  overflow-x: auto;
  overflow-y: auto;
}

#presupuesto-root .aux-resumen-table tbody tr {
  cursor: default;
}

#presupuesto-root .aux-resumen-total-row {
  display: flex;
  justify-content: flex-end;
  gap: 40px;
  font-weight: 700;
  padding: 8px 10px 2px;
}

#presupuesto-root .aux-resumen-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

#presupuesto-root .aux-resumen-summary {
  display: grid;
  gap: 6px;
  min-width: 360px;
  font-family: "Poppins", sans-serif;
  color: var(--aux-text);
}

#presupuesto-root .aux-resumen-summary-row {
  display: grid;
  grid-template-columns: 1fr 90px 120px;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  font-weight: 600;
}

#presupuesto-root .aux-resumen-summary-row.is-highlight {
  background: #f6d365;
  border-radius: 2px;
  font-weight: 700;
}

#presupuesto-root .aux-resumen-summary-label {
  text-align: right;
}

#presupuesto-root .aux-resumen-summary-percent,
#presupuesto-root .aux-resumen-summary-amount {
  text-align: right;
}

#presupuesto-root .presupuesto-resumen-config-modal {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
}

#presupuesto-root .presupuesto-resumen-config-table {
  display: grid;
  gap: 12px;
}

#presupuesto-root .presupuesto-resumen-config-head,
#presupuesto-root .presupuesto-resumen-config-subhead,
#presupuesto-root .presupuesto-resumen-config-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 84px minmax(0, 140px) minmax(0, 140px);
  align-items: center;
  gap: 16px;
}

#presupuesto-root .presupuesto-resumen-config-head {
  padding: 0 6px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  color: #475569;
  font-family: "Poppins", sans-serif;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

#presupuesto-root .presupuesto-resumen-config-head-priority {
  grid-column: 3 / 5;
  text-align: center;
}

#presupuesto-root .presupuesto-resumen-config-subhead {
  padding: 0 6px 4px;
  color: #475569;
  font-family: "Poppins", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
}

#presupuesto-root .presupuesto-resumen-config-column-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  text-align: center;
}

#presupuesto-root .presupuesto-resumen-config-column-choice input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #1d4ed8;
  cursor: pointer;
}

#presupuesto-root .presupuesto-resumen-config-row {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

#presupuesto-root .presupuesto-resumen-config-row.is-disabled {
  background: rgba(226, 232, 240, 0.32);
  border-radius: 12px;
  border-bottom-color: transparent;
}

#presupuesto-root .presupuesto-resumen-config-row:last-child {
  border-bottom: 0;
}

#presupuesto-root .presupuesto-resumen-config-label,
#presupuesto-root .presupuesto-resumen-config-label-input {
  color: #0f172a;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

#presupuesto-root .presupuesto-resumen-config-label-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 8px 12px;
  background: #f8fafc;
}

#presupuesto-root .presupuesto-resumen-config-row.is-disabled .presupuesto-resumen-config-label,
#presupuesto-root .presupuesto-resumen-config-row.is-disabled .presupuesto-resumen-config-label-input {
  color: #64748b;
  text-decoration: line-through;
}

#presupuesto-root .presupuesto-resumen-config-label-input:focus {
  outline: none;
  border-color: rgba(2, 162, 239, 0.85);
  box-shadow: 0 0 0 3px rgba(2, 162, 239, 0.14);
}

#presupuesto-root .presupuesto-resumen-config-row .fsr-switch {
  justify-self: center;
}

#presupuesto-root .presupuesto-resumen-config-display {
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 0 12px;
  background: #e2e8f0;
  color: #1e293b;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: right;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

#presupuesto-root .presupuesto-resumen-config-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 0 12px;
  background: #f8fafc;
  color: #0f172a;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: right;
}

#presupuesto-root .presupuesto-resumen-config-row.is-disabled .presupuesto-resumen-config-display,
#presupuesto-root .presupuesto-resumen-config-row.is-disabled .presupuesto-resumen-config-input {
  background: #f1f5f9;
  color: #64748b;
  border-color: rgba(148, 163, 184, 0.34);
}

#presupuesto-root .presupuesto-resumen-config-input:focus {
  outline: none;
  border-color: rgba(2, 162, 239, 0.85);
  box-shadow: 0 0 0 3px rgba(2, 162, 239, 0.14);
}

#presupuesto-root .aux-modal-table {
  border-radius: 12px;
  background: var(--aux-surface);
  border: 1px solid var(--aux-border);
  overflow: auto;
}

#presupuesto-root .presupuesto-modal-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--aux-border);
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 10px;
}

#presupuesto-root .presupuesto-modal-search-label {
  font-family: "Poppins", sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: #0f172a;
}

#presupuesto-root .presupuesto-modal-search-input {
  width: min(360px, 100%);
  padding: 6px 10px;
  border: 1px solid var(--aux-border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--aux-text);
  background: #ffffff;
}

#presupuesto-root .presupuesto-modal-search-input:focus {
  outline: none;
  border-color: var(--presupuesto-accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#presupuesto-root .presupuesto-decimals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#presupuesto-root .presupuesto-decimals-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#presupuesto-root .presupuesto-decimals-label {
  font-family: "Poppins", sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: #0f172a;
}

#presupuesto-root .presupuesto-decimals-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--aux-border);
  border-radius: 8px;
  font-size: 0.86rem;
  color: var(--aux-text);
  background: #ffffff;
}

#presupuesto-root .presupuesto-decimals-input:focus {
  outline: none;
  border-color: var(--presupuesto-accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#presupuesto-root .presupuesto-decimals-help {
  margin-top: 10px;
}

@media (max-width: 900px) {
  #presupuesto-root .presupuesto-decimals-grid {
    grid-template-columns: 1fr;
  }
}

#presupuesto-root .aux-modal-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: "Poppins", sans-serif;
  table-layout: fixed;
}

#presupuesto-root .aux-modal-table th {
  text-align: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #008080;
  border-right: 1px solid var(--aux-divider);
}

#presupuesto-root .aux-modal-th {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#presupuesto-root .aux-modal-th span {
  flex: 1;
  text-align: center;
}

#presupuesto-root .aux-modal-sort-button {
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  margin-left: auto;
}

#presupuesto-root .aux-modal-sort-button:hover {
  opacity: 0.9;
}

#presupuesto-root .aux-modal-sort-icon {
  width: 14px;
  height: 14px;
  display: block;
  transform-origin: 50% 50%;
  transition: transform 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

#presupuesto-root .aux-modal-sort-button.is-active {
  color: #1d4ed8;
}

#presupuesto-root .aux-modal-sort-button.is-active[data-sort-direction="desc"] .aux-modal-sort-icon {
  transform: rotate(180deg);
}

#presupuesto-root .aux-modal-table td {
  padding: 6px 10px;
  color: var(--aux-text);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--aux-border);
  border-right: 1px solid var(--aux-divider);
}

#presupuesto-root .aux-modal-table td.aux-modal-col-unidad,
#presupuesto-root .aux-modal-table td.aux-modal-col-costo {
  text-align: center;
}

#presupuesto-root .aux-modal-table td.aux-modal-col-descripcion {
  text-align: left;
}

#presupuesto-root .aux-modal-table col.aux-modal-col-descripcion {
  width: var(--aux-modal-col-descripcion);
}

#presupuesto-root .aux-modal-table th:last-child,
#presupuesto-root .aux-modal-table td:last-child {
  border-right: none;
}

#presupuesto-root .aux-modal-table tbody tr {
  background-color: var(--aux-surface);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#presupuesto-root .aux-modal-table tbody tr.is-selected {
  background-color: #e0f2fe !important;
  box-shadow: inset 0 0 0 2px rgba(14, 116, 144, 0.35);
}

.aux-tooltip {
  position: fixed;
  z-index: 9999;
  padding: 8px 12px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
}

.aux-tooltip.is-visible {
  opacity: 1;
}

#presupuesto-root .tabs-right,
#presupuesto-root .presupuesto-tabs-right {
  display: flex;
  align-items: flex-end;
  gap: clamp(0.4rem, 0.8vw, 0.75rem);
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 0;
}

#presupuesto-root .materiales-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  min-width: 0;
  flex: 0 1 auto;
}

#presupuesto-root .materiales-search-inline {
  flex: 0 1 clamp(150px, 24vw, 520px);
  min-width: 150px;
  max-width: 34vw;
}

#presupuesto-root .materiales-search-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--presupuesto-border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--presupuesto-text);
  flex: 1;
  min-width: 0;
  background-color: #ffffff;
}

#presupuesto-root .materiales-search-input:focus {
  outline: none;
  border-color: var(--presupuesto-accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#presupuesto-root .materiales-search-button,
#presupuesto-root .materiales-search-clear {
  border: 1px solid #0e7490;
  border-radius: 8px;
  background: #008080;
  color: #ffffff;
  font-family: "Poppins", sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#presupuesto-root .materiales-search-clear {
  background: #0f766e;
}

#presupuesto-root .materiales-search-button {
  min-width: auto;
  padding: 0;
  border: none;
  background: transparent;
}

#presupuesto-root .materiales-search-button-icon {
  width: clamp(22px, 1.6vw, 30px);
  height: clamp(22px, 1.6vw, 30px);
  object-fit: scale-down;
  margin-left: clamp(4px, 0.6vw, 8px);
  margin-right: clamp(4px, 0.6vw, 8px);
  display: block;
}

#presupuesto-root .materiales-search-button:hover,
#presupuesto-root .materiales-search-clear:hover {
  filter: brightness(1.06);
}

#presupuesto-root .materiales-search-button:hover {
  filter: none;
  opacity: 0.7;
}

#presupuesto-root .materiales-search-button:focus,
#presupuesto-root .materiales-search-clear:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.25);
}

#presupuesto-root .materiales-search-button:disabled,
#presupuesto-root .materiales-search-clear:disabled {
  opacity: 0.6;
  cursor: default;
}

#presupuesto-root .presupuesto-print-button {
  flex: 0 0 auto;
  margin-left: -2px;
  transform: translateY(-3px);
}

#presupuesto-root .presupuesto-actions-right {
  display: flex;
  align-items: flex-end;
  gap: clamp(0.2rem, 0.5vw, 0.45rem);
  margin-left: auto;
  flex: 0 0 auto;
  min-width: max-content;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
}

#presupuesto-root .presupuesto-config-button-wrap {
  flex: 0 0 auto;
}

#presupuesto-root .tabs-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: clamp(0.5rem, 0.9vw, 0.75rem);
  min-width: 0;
  flex-wrap: nowrap;
}

#presupuesto-root .tab-menu {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
}

#presupuesto-root .tab-menu .tab {
  flex: 0 0 auto;
}

#presupuesto-root .IconosModulo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: max-content;
  max-width: none;
  overflow: visible;
  margin-left: 0;
  padding-right: clamp(0.15rem, 0.45vw, 0.4rem);
}

#presupuesto-root .IconosModulo .disenoIcono {
  flex: 0 0 auto;
}

#presupuesto-root .tab-menu-right {
  padding-left: 0;
}

#presupuesto-root .presupuesto-print-modal {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 58px rgba(15, 23, 42, 0.28);
}

#presupuesto-root .presupuesto-external-concept-modal {
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 58px rgba(15, 23, 42, 0.28);
}

#presupuesto-root .presupuesto-basico-breakdown-modal {
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100vw - 32px));
  max-width: 1180px;
  max-height: min(860px, calc(100vh - 32px));
  max-height: min(860px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 58px rgba(15, 23, 42, 0.28);
}

#presupuesto-root .dial.presupuesto-basico-breakdown-modal .presupuesto-basico-breakdown-modal-header {
  background: var(--presupuesto-breakdown-level-color, #1297d8);
}

#presupuesto-root .dial.presupuesto-basico-breakdown-modal .presupuesto-basico-breakdown-modal-header .form_title1,
#presupuesto-root .dial.presupuesto-basico-breakdown-modal .presupuesto-basico-breakdown-modal-header .modal-close {
  color: var(--presupuesto-breakdown-level-fg, #ffffff);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

#presupuesto-root .dial.presupuesto-basico-breakdown-modal .presupuesto-print-modal-header {
  background: var(--presupuesto-breakdown-level-color, #1297d8);
}

#presupuesto-root .dial.presupuesto-basico-breakdown-modal .presupuesto-print-modal-title,
#presupuesto-root .dial.presupuesto-basico-breakdown-modal .presupuesto-basico-breakdown-modal-header .form_title1 {
  background: var(--presupuesto-breakdown-level-color, #1297d8);
  color: var(--presupuesto-breakdown-level-fg, #ffffff);
}

#presupuesto-root .dial.presupuesto-basico-breakdown-modal .presupuesto-print-modal-close {
  background: color-mix(in srgb, var(--presupuesto-breakdown-level-color, #1297d8) 78%, #000000 22%);
  color: var(--presupuesto-breakdown-level-fg, #ffffff);
  border-left: 1px solid color-mix(in srgb, var(--presupuesto-breakdown-level-fg, #ffffff) 18%, transparent 82%);
}

#presupuesto-root .dial.presupuesto-basico-breakdown-modal .presupuesto-print-modal-close:hover {
  background: color-mix(in srgb, var(--presupuesto-breakdown-level-color, #1297d8) 58%, #000000 42%);
  color: var(--presupuesto-breakdown-level-fg, #ffffff);
}

#presupuesto-root .dial.presupuesto-basico-breakdown-modal .presupuesto-basico-breakdown-modal-header[data-breakdown-level="1"] {
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.12);
}

#presupuesto-root .presupuesto-basico-precio-cell {
  cursor: zoom-in;
}

#presupuesto-root .presupuesto-basico-precio-cell:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

#presupuesto-root .presupuesto-basico-breakdown-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

#presupuesto-root .presupuesto-basico-breakdown-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  font-family: "Poppins", sans-serif;
}

#presupuesto-root .presupuesto-basico-breakdown-key {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

#presupuesto-root .presupuesto-basico-breakdown-description {
  margin-top: 4px;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#presupuesto-root .presupuesto-basico-breakdown-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, auto));
  gap: 10px;
}

#presupuesto-root .presupuesto-basico-breakdown-summary > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 92px;
  padding: 8px 10px;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  background: #f8fafc;
  text-align: right;
}

#presupuesto-root .presupuesto-basico-breakdown-summary span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
}

#presupuesto-root .presupuesto-basico-breakdown-summary strong {
  color: #0f172a;
  font-size: 0.9rem;
}

#presupuesto-root .presupuesto-basico-breakdown-sections {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 12px;
  min-height: 0;
  overflow: visible;
  padding-right: 4px;
}

#presupuesto-root .presupuesto-basico-breakdown-section {
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

#presupuesto-root .presupuesto-basico-breakdown-section-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 9px 12px;
  background: #edf7f7;
  color: #0f172a;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
}

#presupuesto-root .presupuesto-basico-breakdown-table {
  overflow-x: auto;
}

#presupuesto-root .presupuesto-basico-breakdown-table table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Poppins", sans-serif;
}

#presupuesto-root .presupuesto-basico-breakdown-table th,
#presupuesto-root .presupuesto-basico-breakdown-table td {
  padding: 7px 9px;
  border-top: 1px solid #e5edf3;
  border-right: 1px solid #e5edf3;
  color: #0f172a;
  font-size: 0.82rem;
  vertical-align: top;
}

#presupuesto-root .presupuesto-basico-breakdown-table th {
  background: #008080;
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}

#presupuesto-root .presupuesto-basico-breakdown-table td:nth-child(3),
#presupuesto-root .presupuesto-basico-breakdown-table td:nth-child(4),
#presupuesto-root .presupuesto-basico-breakdown-table td:nth-child(5),
#presupuesto-root .presupuesto-basico-breakdown-table td:nth-child(6) {
  text-align: right;
}

#presupuesto-root .presupuesto-breakdown-col-clave {
  width: 120px;
}

#presupuesto-root .presupuesto-breakdown-col-descripcion {
  width: 360px;
}

#presupuesto-root .presupuesto-breakdown-col-unidad {
  width: 95px;
}

#presupuesto-root .presupuesto-breakdown-col-cantidad,
#presupuesto-root .presupuesto-breakdown-col-precio,
#presupuesto-root .presupuesto-breakdown-col-importe {
  width: 120px;
}

#presupuesto-root .presupuesto-breakdown-precio-cell {
  position: relative;
}

#presupuesto-root .dial:not(.presupuesto-print-modal) {
  background: #ffffff;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 28px 58px rgba(15, 23, 42, 0.28);
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .modal-header {
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  min-height: 58px;
  overflow: hidden;
  background: rgb(2, 162, 239);
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .form_title1 {
  min-height: 58px;
  padding: 18px 24px;
  background: transparent;
  color: #ffffff;
  font-family: "Verdana", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .modal-close {
  width: 58px;
  height: 100%;
  min-height: 58px;
  align-self: stretch;
  border-left: none;
  border-radius: 0;
  background: rgba(12, 115, 162, 0.92);
  color: #5c3d38;
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .modal-close:hover {
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .modal-body {
  background: #ffffff;
  padding: 24px 24px 12px;
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .txtmensaje {
  color: #0f172a;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  padding: 18px 24px 24px;
  background: #ffffff;
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .BotonModal_Aceptar,
#presupuesto-root .dial:not(.presupuesto-print-modal) .BotonModal_Return {
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: "Verdana", sans-serif;
  font-size: 15px;
  font-weight: 700;
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .BotonModal_Aceptar {
  min-width: 118px;
  border: 0;
  background: #ffc907;
  color: #111111;
  box-shadow: 0 10px 22px rgba(255, 201, 7, 0.3);
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .BotonModal_Aceptar:hover:not(:disabled) {
  background: rgb(244, 208, 63);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 3px 8px 0 rgba(0, 0, 0, 0.15);
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .BotonModal_Return {
  min-width: 122px;
  border: 1px solid #111111;
  background: #ffffff;
  color: #111111;
}

#presupuesto-root .dial:not(.presupuesto-print-modal) .BotonModal_Return:hover:not(:disabled) {
  background: #f8fafc;
  filter: none;
}

#presupuesto-root .presupuesto-print-modal-header {
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  background: rgb(2, 162, 239);
  padding: 0;
  overflow: hidden;
}

#presupuesto-root .presupuesto-print-modal-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 18px 24px;
}

#presupuesto-root .presupuesto-print-modal-close {
  width: 58px;
  height: 100%;
  min-height: 58px;
  border-left: 0;
  color: #5c3d38;
  background: rgba(12, 115, 162, 0.92);
  transition: background 0.25s ease, color 0.25s ease;
}

#presupuesto-root .presupuesto-print-modal-close:hover {
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

#presupuesto-root .dial.import-modal-shell .presupuesto-print-modal-close {
  width: 58px;
  height: 100%;
  min-height: 58px;
  border-left: 0;
  color: #5c3d38;
  background: rgba(12, 115, 162, 0.92);
  transition: background 0.25s ease, color 0.25s ease;
}

#presupuesto-root .dial.import-modal-shell .presupuesto-print-modal-close:hover {
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

#presupuesto-root .dial.import-modal-shell .presupuesto-print-modal-close:focus,
#presupuesto-root .dial.import-modal-shell .presupuesto-print-modal-close:focus-visible {
  outline: none;
  box-shadow: none;
}

#presupuesto-root .presupuesto-print-modal-body {
  padding: 24px 24px 10px;
  background: #ffffff;
  text-align: left;
}

#presupuesto-root .presupuesto-external-concept-body {
  padding: 18px 20px 0;
}

#presupuesto-root .presupuesto-external-concept-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 18px;
  min-height: 460px;
}

#presupuesto-root .presupuesto-external-concept-sidebar {
  border-right: 1px solid rgba(148, 163, 184, 0.28);
  padding-right: 18px;
}

#presupuesto-root .presupuesto-external-concept-main {
  min-width: 0;
}

#presupuesto-root .presupuesto-external-concept-section-title {
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
}

#presupuesto-root .presupuesto-external-concept-worklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

#presupuesto-root .presupuesto-external-concept-work {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 12px 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#presupuesto-root .presupuesto-external-concept-work:hover {
  border-color: rgba(14, 116, 144, 0.55);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

#presupuesto-root .presupuesto-external-concept-work.is-selected {
  border-color: #0e7490;
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.08) 0%, rgba(20, 184, 166, 0.08) 100%);
  box-shadow: 0 10px 26px rgba(14, 116, 144, 0.16);
}

#presupuesto-root .presupuesto-external-concept-work-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

#presupuesto-root .presupuesto-external-concept-work-copy {
  font-size: 0.86rem;
  color: #334155;
}

#presupuesto-root .presupuesto-external-concept-work-meta {
  font-size: 0.78rem;
  color: #64748b;
}

#presupuesto-root .presupuesto-external-concept-table {
  max-height: 520px;
}

#presupuesto-root .presupuesto-external-concept-col-check {
  width: 48px;
  text-align: center;
}

#presupuesto-root .presupuesto-external-concept-col-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#presupuesto-root .presupuesto-external-concept-key {
  display: flex;
  align-items: center;
  gap: 8px;
}

#presupuesto-root .presupuesto-external-concept-table td.aux-modal-col-descripcion {
  text-align: justify;
}

#presupuesto-root .presupuesto-external-concept-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.12);
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#presupuesto-root .presupuesto-external-concept-badge.is-muted {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

#presupuesto-root .presupuesto-print-modal-copy {
  margin: 0 0 14px;
  color: #60708b;
  font-size: 15px;
  line-height: 1.45;
}

#presupuesto-root .presupuesto-print-modal-copy a {
  color: #0c7ead;
  font-weight: 600;
  text-decoration: none;
}

#presupuesto-root .presupuesto-print-modal-copy a:hover {
  text-decoration: underline;
}

#presupuesto-root .presupuesto-print-tabs {
  display: inline-flex;
  gap: 10px;
  margin: 0 auto 16px 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  justify-content: flex-start;
  align-self: flex-start;
}

#presupuesto-root .presupuesto-print-tab {
  min-width: 98px;
  padding: 9px 14px;
  border: 1px solid #cfd8e3;
  border-radius: 9px;
  background: #f8fafc;
  color: #4a5a73;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#presupuesto-root .presupuesto-print-tab:hover {
  color: #0f7692;
  border-color: #b5c4d5;
}

#presupuesto-root .presupuesto-print-tab:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 151, 218, 0.15);
}

#presupuesto-root .presupuesto-print-tab.is-active {
  background: #0c7c99;
  color: #ffffff;
  border-color: #0c7c99;
  box-shadow: none;
}

#presupuesto-root .presupuesto-print-options {
  display: grid;
  gap: 12px;
}

#presupuesto-root .presupuesto-print-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 10px 12px 11px;
  text-align: left;
  border: 1px solid #d5dde8;
  border-radius: 9px;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

#presupuesto-root .presupuesto-print-option:hover:not(:disabled) {
  border-color: #c1ccd9;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

#presupuesto-root .presupuesto-print-option:focus {
  outline: none;
  border-color: #0c7c99;
  box-shadow: 0 0 0 3px rgba(12, 124, 153, 0.14);
}

#presupuesto-root .presupuesto-print-option.is-active {
  border-color: #d5dde8;
  background: #ffffff;
}

#presupuesto-root .presupuesto-print-option:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
}

#presupuesto-root .presupuesto-print-option-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

#presupuesto-root .presupuesto-print-option-title {
  color: #1f2937;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
}

#presupuesto-root .presupuesto-print-option-description {
  color: #637594;
  font-size: 13px;
  line-height: 1.42;
}

#presupuesto-root .presupuesto-print-option-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -4px 0 2px;
  padding: 0 12px 0 14px;
}

#presupuesto-root .presupuesto-print-option-extra-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#presupuesto-root .presupuesto-print-option-extra-title {
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

#presupuesto-root .presupuesto-print-option-extra-description {
  color: #637594;
  font-size: 12px;
  line-height: 1.35;
}

#presupuesto-root .presupuesto-print-option-extra-switch {
  flex: 0 0 auto;
}

#presupuesto-root .presupuesto-print-option-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

#presupuesto-root .presupuesto-print-option-state {
  min-width: 30px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: right;
}

#presupuesto-root .presupuesto-print-option.is-active .presupuesto-print-option-state {
  color: #0c7c99;
}

#presupuesto-root .presupuesto-print-option-track {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: #c8ccd1;
  transition: background 0.18s ease;
}

#presupuesto-root .presupuesto-print-option-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease, background 0.18s ease;
}

#presupuesto-root .presupuesto-print-option.is-active .presupuesto-print-option-track {
  background: #9eb6f5;
}

#presupuesto-root .presupuesto-print-option.is-active .presupuesto-print-option-knob {
  transform: translateX(18px);
  background: #2f67d8;
}

#presupuesto-root .presupuesto-print-modal-note {
  margin: 12px 2px 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

#presupuesto-root .presupuesto-print-modal-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 18px 24px 24px;
  background: #ffffff;
}

#presupuesto-root .presupuesto-print-cancel {
  min-width: 122px;
  min-height: 42px;
  width: auto;
  padding-inline: 18px;
}

#presupuesto-root .presupuesto-print-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 142px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #ffc907;
  color: #111111;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(255, 201, 7, 0.3);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

#presupuesto-root .presupuesto-print-submit:hover {
  background: rgb(244, 208, 63);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 3px 8px 0 rgba(0, 0, 0, 0.15);
}

#presupuesto-root .presupuesto-print-submit:focus {
  outline: none;
  background: rgb(244, 208, 63);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 3px 8px 0 rgba(0, 0, 0, 0.15);
}

@media (max-width: 767px) {
  #presupuesto-root .presupuesto-print-modal {
    width: min(100vw - 18px, 760px);
  }

  #presupuesto-root .presupuesto-resumen-config-modal {
    width: min(100vw - 18px, 760px);
  }

  #presupuesto-root .presupuesto-external-concept-modal {
    width: min(100vw - 18px, 1120px);
  }

  #presupuesto-root .presupuesto-print-modal-body {
    padding: 18px 16px 8px;
  }

  #presupuesto-root .presupuesto-external-concept-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  #presupuesto-root .presupuesto-external-concept-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    padding-right: 0;
    padding-bottom: 14px;
  }

  #presupuesto-root .presupuesto-external-concept-worklist,
  #presupuesto-root .presupuesto-external-concept-table {
    max-height: 260px;
  }

  #presupuesto-root .presupuesto-print-tabs {
    width: 100%;
  }

  #presupuesto-root .presupuesto-print-tab {
    flex: 1 1 0;
    min-width: 0;
  }

  #presupuesto-root .presupuesto-print-option {
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }

  #presupuesto-root .presupuesto-print-option-switch {
    margin-top: 2px;
  }

  #presupuesto-root .presupuesto-print-modal-footer {
    gap: 14px;
    padding: 18px 16px 22px;
    flex-wrap: wrap;
  }

  #presupuesto-root .presupuesto-resumen-config-head,
  #presupuesto-root .presupuesto-resumen-config-subhead,
  #presupuesto-root .presupuesto-resumen-config-row {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 10px;
  }

  #presupuesto-root .presupuesto-resumen-config-head-priority,
  #presupuesto-root .presupuesto-resumen-config-column-choice {
    grid-column: auto;
    text-align: left;
    justify-content: flex-start;
  }

  #presupuesto-root .presupuesto-resumen-config-row {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  #presupuesto-root .presupuesto-resumen-config-display,
  #presupuesto-root .presupuesto-resumen-config-input {
    grid-column: 1 / -1;
  }

  #presupuesto-root .presupuesto-resumen-config-label {
    font-size: 0.88rem;
  }
}

@media (max-width: 1366px) {
  #presupuesto-root .materiales-search-inline {
    flex-basis: 240px;
    min-width: 130px;
  }
}

#presupuesto-root .presupuesto-precio-action {
  cursor: pointer;
}

#presupuesto-root .presupuesto-precio-action:focus-visible {
  outline: 2px solid #008080;
  outline-offset: -2px;
}

#presupuesto-root .presupuesto-import-file {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

#presupuesto-root .presupuesto-import-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

#presupuesto-root .presupuesto-import-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 170px;
  padding-inline: 16px;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

#presupuesto-root .presupuesto-import-file-button:hover {
  background: rgb(244, 208, 63);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 3px 8px 0 rgba(0, 0, 0, 0.15);
}

#presupuesto-root .presupuesto-import-file-input:focus + .presupuesto-import-file-button,
#presupuesto-root .presupuesto-import-file-input:focus-visible + .presupuesto-import-file-button {
  outline: none;
  background: rgb(244, 208, 63);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 3px 8px 0 rgba(0, 0, 0, 0.15);
}

#presupuesto-root .presupuesto-import-file-name {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  max-width: min(460px, 85vw);
  padding: 8px 12px;
  border: 1px solid var(--presupuesto-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--presupuesto-text);
  font-family: "Poppins", sans-serif;
  font-size: 0.86rem;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tabs internos: estilo de celdas/inputs igual a /insumos/materiales */
#presupuesto-root .aux-materiales-table th {
  padding: 12px 16px;
  font-size: 0.9rem;
}

#presupuesto-root .aux-materiales-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
}

#presupuesto-root .aux-materiales-table .aux-mat-input,
#presupuesto-root .aux-materiales-table .aux-rename-input,
#presupuesto-root .aux-materiales-table .cell-editor {
  width: 100%;
  min-height: 32px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--aux-border);
  border-radius: 6px;
  box-shadow: none;
  background: #f8fafc;
  font-size: 0.85rem;
  color: var(--aux-text);
}

#presupuesto-root .aux-materiales-table .aux-mat-input:focus,
#presupuesto-root .aux-materiales-table .aux-rename-input:focus,
#presupuesto-root .aux-materiales-table .cell-editor:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#presupuesto-root .aux-materiales-table td.aux-mat-col-unidad .aux-mat-input {
  text-align: center;
}

#presupuesto-root .aux-materiales-table td.aux-mat-col-cantidad .aux-mat-input,
#presupuesto-root .aux-materiales-table td.aux-mat-col-precio .aux-mat-input {
  text-align: right;
}

#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price td,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .aux-mat-input,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .aux-rename-input,
#presupuesto-root .aux-materiales-table tbody tr.aux-material-zero-price .cell-editor {
  color: #dc2626 !important;
}
