.th {
  display: block;
  min-width: 0;
  margin: 0 0 14px;
  padding: 14px 16px 6px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  border-radius: var(--r-xl, 16px);
  box-shadow: var(--shadow-1), var(--shadow-2);
  color: var(--text);
}
.th-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 8px; }
.th-cab__titulo { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.th-cab__fecha { margin-left: auto; font-size: 14px; color: var(--muted); }
.th-nota { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.th-fila { padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); min-width: 0; }
.th-fila__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.th-fila__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.th-fila__rotulo { font-size: 14px; font-weight: 600; color: var(--muted); }
.th-fila__resumen { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.th-fila__lista { margin: 6px 0 0; padding: 0 0 0 18px; font-size: 15px; color: var(--text); }
.th-fila__lista li { margin: 2px 0; overflow-wrap: anywhere; }
.th-fila__mas { list-style: none; margin-left: -18px; color: var(--muted); }
.th-fila__lista--abierta { padding-left: 18px; }
.th-btn {
  flex: none;
  min-height: 56px;
  min-width: 56px;
  padding: 0 18px;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid var(--border);
}
.th-btn--prim { background: var(--acento, #F59800); border-color: var(--acento, #F59800); color: #130702; } 
.th-btn--sec { background: var(--surface); color: var(--text); }
.th-btn:disabled { opacity: .55; cursor: not-allowed; }
.th-btn:focus-visible { outline: 2px solid var(--focus-ring, var(--acento, #F59800)); outline-offset: 2px; }
.th-form {
  display: flex; flex-direction: column; gap: 10px;
  margin: 10px 0 2px; padding: 12px;
  background: var(--surface-2);
  border-radius: 12px;
}
.th-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.th-campo__et { font-size: 14px; font-weight: 600; color: var(--muted); }
.th-entrada {
  width: 100%; min-width: 0; box-sizing: border-box;
  min-height: 56px; padding: 8px 12px;
  font: inherit; font-size: 16px; 
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
}
select.th-entrada {
  -webkit-appearance: none; appearance: none; padding-right: 34px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%238C654F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
}
.th-entrada--area { min-height: 72px; resize: none; }
.th-form__pie { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.th-aviso { margin: 0; font-size: 15px; font-weight: 600; }
.th-aviso--mal { color: var(--bad-text); }
.th-aviso--ok { color: var(--ok-text); }
.th-vacio { padding: 6px 0 12px; }
.th-vacio__t { margin: 0; font-size: 17px; font-weight: 700; color: var(--ok-text); }
@media (min-width: 900px) {
  .th { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .th-cab, .th-nota, .th-vacio { grid-column: 1 / -1; }
}
@media (max-width: 700px), (max-height: 700px) and (min-width: 900px) {
  .th { padding-top: 10px; }
  .th-fila__lista:not(.th-fila__lista--abierta) { display: none; }
}
.cc-pronto {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .06em; line-height: 1.5; white-space: nowrap;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}
.cc-pestana .cc-pronto { margin-left: 8px; }
.cc-bloqueado { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 15px; font-weight: 600; }
.cc-candado { position: relative; flex: none; width: 16px; height: 12px; margin-top: 7px; border-radius: 3px; background: currentColor; }
.cc-candado::before { content: ""; position: absolute; left: 3px; top: -8px; width: 6px; height: 8px; border: 2px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; }
.mrj-metrica--coste .mrj-metrica__valor { color: var(--warn-text); }
.mrj-metrica--margen .mrj-metrica__valor { color: var(--ok-text); }
.mrj-metrica--margen.mrj-metrica--pierde .mrj-metrica__valor { color: var(--bad-text); } 
