.app-content {
  --tm-registro-texto: #152740;
  --tm-registro-secundario: #435a75;
  --tm-registro-borda: #d3deec;
  --tm-registro-fundo: #f0f5fb;
  --tm-registro-link: #135bbd;
}

.app-content .panel:has(> form:not(.filter-bar)),
.app-content .tm-registro-documento {
  border: 1px solid var(--tm-registro-borda);
  border-radius: 12px;
  background: #fff;
}

.app-content :where(form label) {
  color: var(--tm-registro-texto);
  font-size: 12px;
  font-weight: 700;
}

.app-content :where(form) :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=color],[type=range],[type=submit],[type=button],[type=reset],.tm-select-search), select, textarea) {
  min-height: 40px;
  max-width: 100%;
  border: 1px solid var(--tm-registro-borda);
  border-radius: 8px;
  background-color: #fff;
  color: var(--tm-registro-texto);
  padding: 8px 10px;
}

.app-content :where(input, select, textarea, a, button):focus-visible {
  outline: 2px solid #286ac6;
  outline-offset: 2px;
}

.app-content .form-actions,
.app-content .head-actions,
.tm-registro-acoes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.app-content .tm-registro-link {
  color: var(--tm-registro-link);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-content .tm-registro-abrir {
  background: transparent;
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-weight: 750;
  color: var(--tm-registro-link);
  padding: 2px 0;
  text-align: left;
}

.app-content .tm-acao-excluir {
  background: #fff0f1;
  color: #a6212c;
  border: 1px solid #f4b9bf;
}

.app-content.tm-previa-aberta > :not(#registro-previa),
.app-content [data-registros] [hidden],
.app-content #registro-previa[hidden],
.app-content .tm-registro-acoes[hidden] {
  display: none !important;
}

.tm-registro-documento > h2,
.tm-nota-cabecalho {
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 2px solid #c72232;
}

.tm-registro-dados,
#nota-venda dl {
  margin: 0;
  background: var(--tm-registro-fundo);
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
  gap: 14px 28px;
}

.tm-registro-dados dt,
#nota-venda dt {
  color: var(--tm-registro-secundario);
  font-size: 11px;
  font-weight: 750;
}

.tm-registro-dados dd,
#nota-venda dd {
  color: var(--tm-registro-texto);
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.tm-registro-acoes {
  margin-top: 18px;
}
.tm-registro-acoes form {
  max-width: 100%;
  min-width: 0 !important;
}
.tm-registro-acoes .inline-form {
  flex-wrap: wrap;
}
.tm-registro-acoes form:has(> input[type=hidden]):not(:has(input:not([type=hidden]), select, textarea)) {
  margin: 0;
}

#nota-venda dl {
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 16px;
}
#nota-venda .num {
  text-align: right;
  white-space: nowrap;
}
#nota-venda .totais {
  max-width: 330px;
  margin: 16px 0 0 auto;
  padding: 12px;
  background: var(--tm-registro-fundo);
  border-radius: 8px;
}
#nota-venda .totais div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
@media (max-width: 700px) {
  .app-content .form-grid { grid-template-columns: minmax(0,1fr); }
}
@media print {
  body:has(#nota-venda) .topbar,
  body:has(#nota-venda) .sidebar,
  body:has(#nota-venda) .app-content > :not(#nota-venda),
  #nota-venda .tm-registro-acoes { display: none !important; }
  body:has(#nota-venda) .app-content,
  #nota-venda { margin: 0; padding: 0; border: 0; box-shadow: none; background: #fff; }
  #nota-venda tr { break-inside: avoid; }
}
