/* ---Css vista: TP/TL --- */

#tptl-root {
  --tptl-surface: #ffffff;
  --tptl-bg: #f3f6fb;
  --tptl-border: #e2e8f0;
  --tptl-divider: #e5e7eb;
  --tptl-text: #0f172a;
  --tptl-muted: #64748b;
  --tptl-accent: #0e7490;
  --tptl-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  --tptl-col-clave: 160px;
  --tptl-col-descripcion: 720px;
  --tptl-col-valor: 160px;
  --tptl2-col-clave: 110px;
  --tptl2-col-descripcion: 720px;
  --tptl2-col-unidad: 140px;
  --tptl2-col-valor: 180px;
  --tptl-cat-col-clave: 120px;
  --tptl-cat-col-escalafon: 120px;
  --tptl-cat-col-descripcion: 720px;
  --tptl-cat-col-unidad: 120px;
  --tptl-cat-col-sal-nom: 120px;
  --tptl-cat-col-fsr: 120px;
  --tptl-cat-col-sal-integrado: 180px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

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

.tptl-box--single-scroll {
  height: 100%;
  overflow: auto;
}

.tptl-format-selector {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100%;
  justify-content: center;
  padding: 24px 10px;
}

.tptl-format-selector-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 760px;
}

.tptl-format-selector-title {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.6rem, 2.3vw, 2.2rem);
  font-weight: 700;
  color: var(--tptl-text);
}

.tptl-format-selector-text {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #334155;
}

.tptl-format-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tptl-format-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-height: 220px;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.22), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tptl-format-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.12);
}

.tptl-format-card:focus-visible {
  outline: none;
  border-color: rgba(14, 116, 144, 0.78);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.18), 0 22px 42px rgba(15, 23, 42, 0.12);
}

.tptl-format-card.is-active {
  border-color: rgba(14, 116, 144, 0.82);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.18), transparent 32%),
    linear-gradient(180deg, #f4fffd 0%, #ecfeff 100%);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.14), 0 26px 46px rgba(14, 116, 144, 0.16);
}

.tptl-format-card.is-active .tptl-format-card-title {
  color: #0c4a6e;
}

.tptl-format-card.is-active .tptl-format-card-kicker {
  color: #0c4a6e;
}

.tptl-format-card-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(14, 116, 144, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: #0f766e;
  font-family: "Poppins", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tptl-format-card.is-active .tptl-format-card-state {
  opacity: 1;
  transform: translateY(0);
  border-color: rgba(14, 116, 144, 0.32);
  background: rgba(14, 116, 144, 0.1);
  color: #0c4a6e;
}

.tptl-format-card-kicker {
  font-family: "Poppins", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
}

.tptl-format-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tptl-format-card-logo {
  width: auto;
  max-width: 96px;
  height: 40px;
  object-fit: contain;
  object-position: right center;
}

.tptl-format-card-logo--siop {
  max-width: 88px;
}

.tptl-format-card-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--tptl-text);
}

.tptl-format-card-text {
  font-family: "Poppins", sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #475569;
}

.tptl-table {
  height: 100%;
  overflow: auto;
  border-radius: 12px;
  background: var(--tptl-surface);
  border: 1px solid var(--tptl-border);
  position: relative;
}

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

.tptl-table col.tptl-col-clave {
  width: var(--tptl-col-clave);
}

.tptl-table col.tptl-col-descripcion {
  width: var(--tptl-col-descripcion);
}

.tptl-table col.tptl-col-valor {
  width: var(--tptl-col-valor);
}

.tptl-table col.tptl2-col-clave {
  width: var(--tptl2-col-clave);
}

.tptl-table col.tptl2-col-descripcion {
  width: var(--tptl2-col-descripcion);
}

.tptl-table col.tptl2-col-unidad {
  width: var(--tptl2-col-unidad);
}

.tptl-table col.tptl2-col-valor {
  width: var(--tptl2-col-valor);
}

.tptl-categorias-table col.tptl-cat-col-clave {
  width: var(--tptl-cat-col-clave);
}

.tptl-categorias-table col.tptl-cat-col-escalafon {
  width: var(--tptl-cat-col-escalafon);
}

.tptl-categorias-table col.tptl-cat-col-descripcion {
  width: var(--tptl-cat-col-descripcion);
}

.tptl-categorias-table col.tptl-cat-col-unidad {
  width: var(--tptl-cat-col-unidad);
}

.tptl-categorias-table col.tptl-cat-col-sal-nom {
  width: var(--tptl-cat-col-sal-nom);
}

.tptl-categorias-table col.tptl-cat-col-fsr {
  width: var(--tptl-cat-col-fsr);
}

.tptl-categorias-table col.tptl-cat-col-sal-integrado {
  width: var(--tptl-cat-col-sal-integrado);
}

#tptl-root .tptl-external-import-table col.tptl-cat-col-clave {
  width: var(--tptl-cat-col-clave);
}

#tptl-root .tptl-external-import-table col.tptl-cat-col-escalafon {
  width: var(--tptl-cat-col-escalafon);
}

#tptl-root .tptl-external-import-table col.tptl-cat-col-descripcion {
  width: var(--tptl-cat-col-descripcion);
}

#tptl-root .tptl-external-import-table col.tptl-cat-col-unidad {
  width: var(--tptl-cat-col-unidad);
}

#tptl-root .tptl-external-import-table col.tptl-cat-col-sal-nom {
  width: var(--tptl-cat-col-sal-nom);
}

#tptl-root .tptl-external-import-table col.tptl-cat-col-fsr {
  width: var(--tptl-cat-col-fsr);
}

#tptl-root .tptl-external-import-table col.tptl-cat-col-sal-integrado {
  width: var(--tptl-cat-col-sal-integrado);
}

.tptl-table thead {
  background: #4aa390;
}

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

#tptl-root .tptl-categorias-table thead {
  background: #008080;
}

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

#tptl-root .tptl-categorias-table td {
  font-size: 0.9rem;
  padding: 12px 16px;
  color: var(--tptl-text);
  border-bottom: 1px solid var(--tptl-border);
  border-right: 1px solid var(--tptl-divider);
  vertical-align: middle;
}

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

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

#tptl-root .tptl-categorias-table .tptl-input,
#tptl-root .tptl-search-input {
  font-size: 0.85rem;
}

#tptl-root .tptl-search-button,
#tptl-root .tptl-search-clear,
#tptl-root .tptl-import-file-name {
  font-size: 0.84rem;
}

#tptl-root .tptl-error {
  font-size: 0.7rem;
}

#tptl-root .tptl-tooltip {
  font-size: 0.75rem;
}

.tptl-th {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.tptl-th span {
  flex: 1;
  text-align: center;
}

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

.tptl-sort-button img {
  width: 14px;
  height: 14px;
  display: block;
}

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

.tptl-table td.tptl-col-clave,
.tptl-table td.tptl-col-valor {
  text-align: center;
}

.tptl-categorias-table th.tptl-cat-col-unidad,
.tptl-categorias-table th.tptl-cat-col-sal-nom,
.tptl-categorias-table th.tptl-cat-col-fsr,
.tptl-categorias-table th.tptl-cat-col-sal-integrado,
.tptl-categorias-table td.tptl-cat-col-clave,
.tptl-categorias-table td.tptl-cat-col-unidad,
.tptl-categorias-table td.tptl-cat-col-sal-nom,
.tptl-categorias-table td.tptl-cat-col-fsr,
.tptl-categorias-table td.tptl-cat-col-sal-integrado {
  text-align: center;
}

#tptl-root .tptl-categorias-table td.tptl-cat-col-fsr,
#tptl-root .tptl-categorias-table td.tptl-cat-col-sal-integrado {
  color: #0f4c75;
  font-weight: 700;
}

#tptl-root .tptl-categorias-table td.tptl-cat-col-clave .tptl-input,
#tptl-root .tptl-categorias-table td.tptl-cat-col-unidad .tptl-input,
#tptl-root .tptl-categorias-table td.tptl-cat-col-sal-nom .tptl-input,
#tptl-root .tptl-categorias-table td.tptl-cat-col-fsr .tptl-input,
#tptl-root .tptl-categorias-table td.tptl-cat-col-sal-integrado .tptl-input {
  text-align: center;
}

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

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

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

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

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

.tptl-categorias-table tbody tr.tptl-drop-target {
  outline: 2px dashed rgba(14, 116, 144, 0.35);
  outline-offset: -2px;
}

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

.tptl-table tbody tr:hover {
  background-color: #d5d5d5;
}

#tptl-root .tptl-categorias-table tbody tr:hover {
  background-color: #e9f2ff;
}

#tptl-root .tptl-categorias-table tbody tr.tptl-row-inputs td {
  padding: 1px;
}

.tptl-table tbody tr.tptl-row-inputs td {
  padding: 1px;
}

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

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

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

.tptl-categorias-table td.tptl-salario-bajo-minimo {
  color: #b91c1c;
  font-weight: 700;
}

.tptl-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;
}

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

.tptl-row-new {
  background-color: #f1f7ff;
}

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

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

.tptl-table td.tptl-col-valor .tptl-input {
  text-align: center;
}

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

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

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

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

.tptl-factor-table td.tptl-col-descripcion {
  text-align: center;
}

#tptl-root .tptl-factor-table .tptl-factor-input {
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: inset 0 0 0 1px transparent;
  font-size: inherit;
  line-height: inherit;
}

#tptl-root .tptl-factor-table .tptl-factor-input:focus {
  outline: none;
  border: 0;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #1d4ed8, 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.tptl-bold {
  font-weight: 700;
}

.tptl-formato2 {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100%;
  overflow: visible;
}

.tptl-formato2-table-wrapper {
  width: 100%;
  border-radius: 12px;
  overflow: visible;
  overflow-y: visible;
}

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

.tptl-formato2-table td {
  padding: 12px 16px;
  color: var(--tptl-text);
  font-size: 0.9rem;
  line-height: 1.15;
  border-right: 1px solid var(--tptl-divider);
  border-bottom: 1px solid var(--tptl-border);
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
  background: var(--tptl-surface);
}

.tptl-formato2-table tbody tr:last-child td {
  border-bottom: none;
}

.tptl-formato2-table td:last-child {
  border-right: none;
}

.tptl-formato2-table .tptl2-col-clave,
.tptl-formato2-table .tptl2-col-unidad,
.tptl-formato2-table .tptl2-col-valor {
  text-align: center;
}

.tptl-formato2-table .tptl2-col-descripcion {
  text-align: left;
}

.tptl-formato2-row-summary td {
  font-weight: 700;
}

.tptl-formato2-table tbody tr {
  transition: background-color 0.15s ease;
  background-color: var(--tptl-surface);
  cursor: pointer;
}

.tptl-formato2-table tbody tr:hover {
  background-color: #d5d5d5;
}

.tptl-formato2-table tbody tr:hover td {
  background-color: #d5d5d5;
}

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

.tptl-formato2-summary-wrapper {
  width: 100%;
}

.tptl-formato2-uma-wrapper {
  width: 100%;
}

#tptl-root .tptl-formato2-table .tptl-factor-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: inset 0 0 0 1px transparent;
  font-size: inherit;
  line-height: inherit;
  text-align: center;
}

#tptl-root .tptl-formato2-table .tptl-factor-input:focus {
  outline: none;
  border: 0;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #1d4ed8, 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#tptl-root .tptl-formato2-table .tptl2-col-valor {
  font-variant-numeric: tabular-nums;
}

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

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

#tptl-root .tptl-import-file-button {
  width: auto;
  min-width: 170px;
  padding-inline: 16px;
}

#tptl-root .tptl-import-file-name {
  font-family: "Poppins", sans-serif;
  font-size: 0.84rem;
  color: #475467;
}

#tptl-root .manoobra-tabs-right {
  display: flex;
  align-items: flex-end;
  gap: clamp(0.5rem, 1vw, 1rem);
}

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

#tptl-root .materiales-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

#tptl-root .materiales-search-inline {
  min-width: min(560px, 48vw);
}

#tptl-root .materiales-search-input {
  flex: 1;
  min-width: 260px;
  background-color: #ffffff;
}

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

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

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

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

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

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

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

#tptl-root .tptl-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

#tptl-root .tptl-search-inline {
  min-width: min(560px, 48vw);
}

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

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

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

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

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

#tptl-root .tptl-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;
}

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

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

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

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

#tptl-root .tptl-categorias-table .tptl-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;
}

#tptl-root .tptl-categorias-table .tptl-sort-button:hover {
  opacity: 0.9;
}

#tptl-root .tptl-categorias-table .tptl-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;
}

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

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

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

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

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

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

#tptl-root .tptl-config-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

#tptl-root .tptl-config-tab {
  border: 1px solid var(--tptl-border);
  background: #ffffff;
  color: var(--tptl-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#tptl-root .tptl-config-tab:hover {
  border-color: rgba(14, 116, 144, 0.4);
}

#tptl-root .tptl-config-tab.is-active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.18);
}

#tptl-root .tptl-config-tab:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

#tptl-root .tptl-columns-config-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--tptl-border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

#tptl-root .tptl-columns-config-head,
#tptl-root .tptl-columns-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  align-items: center;
  gap: 14px;
}

#tptl-root .tptl-columns-config-head {
  background: #f8fafc;
  color: var(--tptl-muted);
  font-family: "Poppins", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--tptl-border);
}

#tptl-root .tptl-columns-config-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--tptl-border);
}

#tptl-root .tptl-columns-config-row:last-child {
  border-bottom: none;
}

#tptl-root .tptl-columns-config-row.is-disabled {
  background: #f8fafc;
}

#tptl-root .tptl-columns-config-row .fsr-switch {
  justify-self: center;
}

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

#tptl-root .tptl-columns-config-row.is-disabled .tptl-columns-config-input {
  color: var(--tptl-muted);
  background: #f8fafc;
}

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

#tptl-root .tptl-external-import-modal {
  width: clamp(860px, 88vw, 1480px);
  max-width: 1480px;
  height: min(88vh, 920px);
  max-height: 920px;
  min-height: 560px;
}

#tptl-root .tptl-external-import-header {
  border-bottom: 1px solid var(--tptl-border);
}

#tptl-root .tptl-external-import-title {
  color: #ffffff;
}

#tptl-root .tptl-external-import-close:hover {
  opacity: 0.8;
}

#tptl-root .tptl-external-import-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

#tptl-root .tptl-external-import-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  min-height: 0;
}

#tptl-root .tptl-external-import-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#tptl-root .tptl-external-import-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
}

#tptl-root .tptl-external-import-section-title {
  font-family: "Poppins", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tptl-text);
  margin-bottom: 10px;
}

#tptl-root .tptl-external-import-worklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

#tptl-root .tptl-external-import-work {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--tptl-border);
  border-radius: 12px;
  background: #ffffff;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

#tptl-root .tptl-external-import-work:hover {
  border-color: rgba(14, 116, 144, 0.35);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

#tptl-root .tptl-external-import-work.is-selected {
  border-color: rgba(14, 116, 144, 0.7);
  background: #ecfeff;
  box-shadow: 0 10px 22px rgba(14, 116, 144, 0.14);
}

#tptl-root .tptl-external-import-work-title {
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--tptl-text);
}

#tptl-root .tptl-external-import-work-copy {
  font-family: "Poppins", sans-serif;
  font-size: 0.83rem;
  color: #334155;
}

#tptl-root .tptl-external-import-work-meta {
  font-family: "Poppins", sans-serif;
  font-size: 0.77rem;
  color: var(--tptl-muted);
}

#tptl-root .tptl-external-import-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#tptl-root .tptl-external-import-search-label {
  font-family: "Poppins", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tptl-muted);
}

#tptl-root .tptl-external-import-table {
  min-height: 0;
  flex: 1;
  overflow: auto;
  border-radius: 12px;
  background: var(--tptl-surface);
  border: 1px solid var(--tptl-border);
}

#tptl-root .tptl-external-import-table table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  font-family: "Poppins", sans-serif;
  table-layout: fixed;
}

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

#tptl-root .tptl-external-import-table td {
  padding: 10px 12px;
  color: var(--tptl-text);
  font-size: 0.84rem;
  border-bottom: 1px solid var(--tptl-border);
  border-right: 1px solid var(--tptl-divider);
}

#tptl-root .tptl-external-import-table td.tptl-cat-col-unidad,
#tptl-root .tptl-external-import-table td.tptl-cat-col-sal-nom,
#tptl-root .tptl-external-import-table td.tptl-cat-col-fsr,
#tptl-root .tptl-external-import-table td.tptl-cat-col-sal-integrado {
  text-align: center;
}

#tptl-root .tptl-external-import-table th:last-child,
#tptl-root .tptl-external-import-table td:last-child {
  border-right: none;
}

#tptl-root .tptl-external-import-table tbody tr {
  transition: background-color 0.15s ease;
  background-color: var(--tptl-surface);
  cursor: pointer;
}

#tptl-root .tptl-external-import-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

#tptl-root .tptl-external-import-table tbody tr:hover {
  background-color: #e9f2ff;
}

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

#tptl-root .tptl-external-import-col-check {
  width: 52px;
  text-align: center;
}

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

#tptl-root .tptl-external-conflict-modal {
  width: clamp(720px, 70vw, 980px);
  max-width: 980px;
}

#tptl-root .tptl-external-conflict-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#tptl-root .tptl-external-conflict-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}

#tptl-root .tptl-external-conflict-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--tptl-border);
  border-radius: 12px;
  background: #f8fafc;
}

#tptl-root .tptl-external-conflict-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: var(--tptl-text);
  font-family: "Poppins", sans-serif;
  font-size: 0.84rem;
}

#tptl-root .tptl-external-conflict-side strong {
  font-size: 0.88rem;
}

#tptl-root .tptl-external-conflict-arrow {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tptl-accent);
}

@media (max-width: 1100px) {
  #tptl-root .tptl-external-import-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #tptl-root .tptl-external-import-modal,
  #tptl-root .tptl-external-conflict-modal {
    width: min(96vw, 96vw);
    min-height: 0;
  }

  #tptl-root .tptl-external-import-table table {
    min-width: 960px;
  }

  #tptl-root .tptl-external-conflict-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .tptl-format-selector-grid {
    grid-template-columns: 1fr;
  }

  .tptl-format-card {
    min-height: 180px;
  }

  #tptl-root .tptl-decimals-grid {
    grid-template-columns: 1fr;
  }

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