#programas-root {
  --prg-head-year-height: 24px;
  --prg-surface: #ffffff;
  --prg-modal-bg: #f8fafc;
  --prg-modal-border: #e2e8f0;
  --prg-modal-accent: #0e7490;
  --prg-grid-border: #e2e8f0;
  --prg-grid-divider: #e5e7eb;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#programas-root .prg-page {
  width: min(1800px, 98vw);
  margin: 0 auto;
  padding: 8px 0 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#programas-root .prg-title-wrap {
  border-bottom: 1px solid #d5d5d5;
  background: #ffffff;
  padding: 8px 14px;
}

#programas-root .prg-title {
  margin: 0;
  text-align: center;
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 600;
  color: #101010;
}

#programas-root .prg-config-section {
  margin-top: 0;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#programas-root .prg-config-subhead {
  display: grid;
  grid-template-columns: 1fr auto;
  background: #eaf4ff;
  color: #334155;
  border: 1px solid #b7d7ff;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 12px;
}

#programas-root .prg-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--prg-modal-border);
  background: var(--prg-surface);
  border-radius: 8px;
  padding: 10px 12px;
  color: #0f172a;
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
}

#programas-root .prg-config-values {
  margin-top: 12px;
  margin-bottom: 0;
}

#programas-root .prg-options-modal {
  width: clamp(420px, 56vw, 760px);
}

#programas-root .prg-options-modal .modal-body {
  min-height: 0;
  overscroll-behavior: contain;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

#programas-root .prg-options-modal .form_title1 {
  font-family: "Verdana", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#programas-root .prg-config-row .fsr-switch {
  justify-self: auto;
}

#programas-root .prg-option-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#programas-root .prg-option-state {
  min-width: 36px;
  text-align: right;
  font-family: "Poppins", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#programas-root .prg-option-state.is-on {
  color: var(--prg-modal-accent);
}

#programas-root .prg-option-state.is-off {
  color: #6b7280;
}

#programas-root .prg-config-row-breakdown {
  margin-top: 8px;
  border-color: #8fd0cf;
  background: #f0fdfa;
}

#programas-root .prg-breakdown-text {
  flex: 1;
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  color: #0f172a;
}

#programas-root .materiales-search-button,
#programas-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;
}

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

#programas-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;
}

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

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

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

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

#programas-root .prg-table-wrap {
  border: 1px solid var(--prg-grid-border);
  border-top: none;
  overflow-y: auto;
  overflow-x: auto;
  background: #ffffff;
  flex: 1;
  min-height: 0;
  position: relative;
  isolation: isolate;
}

#programas-root .prg-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-family: "Poppins", sans-serif;
  color: #2b2b2b;
  font-size: 0.9rem;
}

#programas-root .prg-table col.c-clave {
  width: 120px;
}

#programas-root .prg-table col.c-desc {
  width: 520px;
}

#programas-root .prg-table col.c-area-trabajo {
  width: 190px;
}

#programas-root .prg-table col.c-unidad,
#programas-root .prg-table col.c-cantidad {
  width: 92px;
}

#programas-root .prg-table col.c-pu,
#programas-root .prg-table col.c-importe {
  width: 112px;
}

#programas-root .prg-table col.c-cantidad-equipos {
  width: 132px;
}

#programas-root .prg-table col.c-inicio,
#programas-root .prg-table col.c-termino {
  width: 138px;
}

#programas-root .prg-table col.c-duracion {
  width: 98px;
}

#programas-root .prg-table col.c-cantidad-label {
  width: 96px;
}

#programas-root .prg-table col.c-month {
  width: 95px;
}

#programas-root .prg-table th,
#programas-root .prg-table td {
  padding: 6px 6px;
}

#programas-root .prg-table tbody tr {
  background-color: #ffffff;
  transition: background-color 0.15s ease;
}

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

#programas-root .prg-table tbody tr:hover {
  background-color: #e9f2ff;
}

#programas-root .prg-table tbody tr td {
  background-color: inherit;
}

#programas-root .prg-table .prg-head-year th,
#programas-root .prg-table .prg-head-cols th {
  background: #008080;
  color: #ffffff;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.02em;
  background-clip: padding-box;
  border-right: 1px solid var(--prg-grid-divider);
}

#programas-root .prg-table .prg-head-year th {
  border-bottom: none;
  padding: 3px 6px;
  height: var(--prg-head-year-height);
  position: sticky;
  top: 0;
  z-index: 8;
}

#programas-root .prg-table .prg-head-cols th {
  border-top: none;
  border-bottom: 1px solid var(--prg-grid-divider);
  padding: 6px 6px;
  position: sticky;
  top: var(--prg-head-year-height);
  z-index: 9;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

#programas-root .prg-table .prg-head-cols th[data-prg-col="cantidadEquipos"] {
  white-space: normal;
  line-height: 1.05;
}

#programas-root .prg-table .prg-head-cols .prg-head-stack {
  display: inline-block;
  text-align: center;
  white-space: normal;
  line-height: 1.05;
}

#programas-root .prg-table .prg-head-cols th[data-prg-col="cantidad"],
#programas-root .prg-table .prg-head-cols th[data-prg-col="cantidadEquipos"],
#programas-root .prg-table .prg-head-cols th[data-prg-col="pu"] {
  white-space: normal;
  line-height: 1.05;
}

#programas-root .prg-table .prg-head-year th:last-child,
#programas-root .prg-table .prg-head-cols th:last-child {
  border-right: none;
}

#programas-root .prg-table td {
  border-right: 1px solid var(--prg-grid-divider);
  border-bottom: 1px solid var(--prg-grid-border);
}

#programas-root .prg-table td:last-child {
  border-right: none;
}

#programas-root .prg-table tfoot td {
  border-right: 1px solid var(--prg-grid-divider);
  border-top: 1px solid var(--prg-grid-border);
  background: #eef4fb;
  color: #1f2937;
  font-weight: 600;
}

#programas-root .prg-table tfoot tr.prg-percent-row td {
  background: #f6f9fd;
}

#programas-root .prg-table tfoot tr.prg-total-acc-row td {
  background: #e8f1fb;
}

#programas-root .prg-table tfoot tr.prg-percent-acc-row td {
  background: #f1f6fd;
}

#programas-root .prg-table tfoot td:last-child {
  border-right: none;
}

#programas-root .prg-table tfoot td.prg-summary-label {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
  line-height: 1.2;
  padding-left: 10px;
}

#programas-root .prg-group-row td {
  height: 44px;
}

#programas-root .prg-obra-total-row td {
  background: #e6f4f4;
  font-weight: 700;
}

#programas-root .prg-obra-total-row td[data-prg-col="clave"],
#programas-root .prg-obra-total-row td[data-prg-col="inicio"],
#programas-root .prg-obra-total-row td[data-prg-col="duracion"],
#programas-root .prg-obra-total-row td[data-prg-col="termino"] {
  text-align: center;
}

#programas-root .prg-group-row td.group-label {
  font-weight: 700;
  color: #111111;
}

#programas-root .prg-concept-row td {
  vertical-align: middle;
}

#programas-root .prg-concept-row .prg-desc {
  font-size: 0.82rem;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#programas-root .prg-table td[data-prg-col="clave"] {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

#programas-root .prg-table .prg-head-cols th[data-prg-col="inicio"],
#programas-root .prg-table .prg-head-cols th[data-prg-col="duracion"],
#programas-root .prg-table .prg-head-cols th[data-prg-col="termino"],
#programas-root .prg-table .prg-head-cols th[data-prg-col="importe"],
#programas-root .prg-table td[data-prg-col="inicio"],
#programas-root .prg-table td[data-prg-col="duracion"],
#programas-root .prg-table td[data-prg-col="termino"],
#programas-root .prg-table td[data-prg-col="pu"],
#programas-root .prg-table td[data-prg-col="importe"] {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

#programas-root .prg-concept-row td.num {
  text-align: right;
}

#programas-root .prg-concept-row td[data-prg-col="clave"],
#programas-root .prg-concept-row td[data-prg-col="areaTrabajo"],
#programas-root .prg-concept-row td[data-prg-col="unidad"],
#programas-root .prg-concept-row td[data-prg-col="inicio"],
#programas-root .prg-concept-row td[data-prg-col="duracion"],
#programas-root .prg-concept-row td[data-prg-col="termino"],
#programas-root .prg-group-row td[data-prg-col="clave"] {
  text-align: center;
}

#programas-root .prg-concept-row td.qty-label {
  color: #2e2e2e;
  text-align: center;
  position: relative;
}

#programas-root .prg-date-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  width: 100%;
}

#programas-root .prg-date-input,
#programas-root .prg-duration-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.8rem;
  font-family: "Poppins", sans-serif;
  padding: 2px 6px;
}

#programas-root .prg-date-input {
  border-right: none;
  border-radius: 2px 0 0 2px;
  text-align: center;
}

#programas-root .prg-date-input::selection {
  background: #38bdf8;
  color: #ffffff;
}

#programas-root .prg-date-picker {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 0 2px 2px 0;
  background: #ffffff;
  color: #0f172a;
  padding: 0;
  cursor: pointer;
}

#programas-root .prg-date-picker::-webkit-datetime-edit {
  display: none;
}

#programas-root .prg-date-picker::-webkit-calendar-picker-indicator {
  margin: 0 auto;
  cursor: pointer;
}

#programas-root .prg-duration-input {
  text-align: right;
  -moz-appearance: textfield;
  appearance: textfield;
}

#programas-root .prg-duration-input::-webkit-outer-spin-button,
#programas-root .prg-duration-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#programas-root .prg-concept-row td.qty-label::before {
  content: none;
}

#programas-root .prg-timeline-cell {
  padding: 0 !important;
}

#programas-root .prg-timeline-track {
  position: relative;
  min-height: 40px;
  width: 100%;
}

#programas-root .prg-timeline-grid {
  display: grid;
  grid-template-columns: repeat(var(--prg-month-count), minmax(0, 1fr));
  min-height: 40px;
}

#programas-root .prg-timeline-month {
  position: relative;
  border-right: 1px solid var(--prg-grid-divider);
}

#programas-root .prg-timeline-month:last-child {
  border-right: none;
}

#programas-root .prg-timeline-bar {
  position: absolute;
  top: 4px;
  height: 18px;
  min-width: 4px;
  background: #f8bf00;
  border: 2px solid #946600;
  border-radius: 5px;
  box-sizing: border-box;
  cursor: grab;
  touch-action: none;
  overflow: visible;
  z-index: 2;
}

#programas-root .prg-timeline-bar.is-dragging {
  cursor: grabbing;
  opacity: 0.95;
}

#programas-root .prg-timeline-bar.is-resizing {
  cursor: ew-resize;
  opacity: 0.95;
}

#programas-root .prg-timeline-bar.is-readonly {
  cursor: default;
}

#programas-root .prg-resize-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 14px;
  z-index: 3;
}

#programas-root .prg-resize-handle.is-start {
  left: -7px;
  cursor: ew-resize;
}

#programas-root .prg-resize-handle.is-end {
  right: -7px;
  cursor: ew-resize;
}

#programas-root .prg-resize-handle::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(60, 37, 0, 0.55);
  opacity: 0;
  transition: opacity 0.12s ease;
}

#programas-root .prg-timeline-bar:hover .prg-resize-handle::before,
#programas-root .prg-timeline-bar.is-resizing .prg-resize-handle::before {
  opacity: 1;
}

#programas-root .month-val {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  display: block;
  font-size: 0.78rem;
  line-height: 1;
  color: #3f3f3f;
  text-align: center;
}

.programas-tooltip {
  position: fixed;
  z-index: 9999;
  width: max-content;
  max-width: min(240px, 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;
}

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

#programas-root .prg-empty {
  border: 1px solid #d6d6d6;
  background: #ffffff;
  color: #475569;
  text-align: center;
  padding: 22px 10px;
  font-family: "Poppins", sans-serif;
}

#programas-root .presupuesto-print-modal {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

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

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

#programas-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;
}

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

#programas-root .presupuesto-print-modal-body {
  padding: 24px 24px 12px;
}

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

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

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

#programas-root .presupuesto-print-option:hover:not(:disabled) {
  border-color: #98d9f6;
  box-shadow: 0 10px 22px rgba(21, 111, 158, 0.08);
}

#programas-root .presupuesto-print-option:focus {
  outline: none;
  border-color: #1697da;
  box-shadow: 0 0 0 3px rgba(22, 151, 218, 0.15);
}

#programas-root .presupuesto-print-option.is-active {
  border-color: #7dcfe9;
  background: #f2fcff;
}

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

#programas-root .presupuesto-print-option-title {
  color: #1d2433;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

#programas-root .presupuesto-print-option-description {
  color: #73819a;
  font-size: 14px;
  line-height: 1.35;
}

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

#programas-root .presupuesto-print-option-state {
  color: #6a7386;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

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

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

#programas-root .presupuesto-print-option.is-active .presupuesto-print-option-track {
  background: #4a6fe3;
}

#programas-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(15, 23, 42, 0.22);
  transition: transform 0.18s ease;
}

#programas-root .presupuesto-print-option.is-active .presupuesto-print-option-knob {
  transform: translateX(24px);
}

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

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

#programas-root .presupuesto-print-submit {
  min-width: 144px;
  border: 0;
  border-radius: 999px;
  background: #ffca0a;
  color: #111827;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 20px;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

#programas-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);
}

#programas-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: 1280px) {
  #programas-root .prg-title {
    font-size: 1rem;
  }

  #programas-root .prg-table {
    font-size: 0.82rem;
  }

  #programas-root .prg-table .prg-head-year th,
  #programas-root .prg-table .prg-head-cols th {
    font-size: 0.8rem;
  }

  #programas-root .prg-config-row {
    font-size: 0.82rem;
  }

  #programas-root .prg-options-modal {
    width: min(92vw, 760px);
  }
}

@media (max-width: 768px) {
  #programas-root .prg-config-row {
    flex-direction: column;
    align-items: flex-start;
  }

  #programas-root .prg-option-toggle {
    align-self: flex-end;
  }
}
