.tm-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem .75rem;
  align-items: flex-end;
}

.tm-tools .form-field.search-field-cliente {
  flex: 1 1 16rem;
  max-width: 22rem;
}

.tm-empty {
  color: var(--text-muted);
}

.tm-table .tm-row:hover td,
.tm-table .tm-row:focus td {
  background: var(--primary-soft);
}

.tm-row {
  cursor: pointer;
}

.tm-factura {
  color: var(--primary);
  font-weight: 600;
}

.tm-preview {
  display: block;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.tm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 32, 64, .42);
}

.tm-modal {
  width: min(760px, 100%);
  max-height: min(92vh, 880px);
  overflow: auto;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(7, 89, 185, .18);
  padding: 1.35rem 1.4rem 1.2rem;
}

.tm-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.tm-modal-head h2 {
  margin: .1rem 0 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.tm-kicker {
  margin: 0;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
}

.tm-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .15rem;
}

.tm-facts,
.tm-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem 1.1rem;
}

.tm-facts {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.tm-fact-wide {
  grid-column: 1 / -1;
}

.tm-fact span,
.tm-label,
.tm-form .form-field span {
  display: block;
  margin-bottom: .3rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tm-fact strong {
  font-weight: 600;
}

.tm-doc-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.tm-doc-link:hover {
  text-decoration: underline;
}

.tm-form {
  margin-bottom: 1rem;
}

.tm-form .form-field {
  max-width: none;
}

.tm-novedades {
  display: flex;
  flex-direction: column;
}

.tm-log {
  min-width: 0;
}

.tm-log-list {
  list-style: none;
  margin: 0 0 .75rem;
  padding: 0;
  max-height: 14rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.tm-log-list li {
  background: var(--surface-muted);
  border-radius: 6px;
  padding: .35rem .5rem;
}

.tm-log-list time {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tm-log-list p {
  margin: .15rem 0 0;
  white-space: pre-wrap;
}

.tm-log-add {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
}

.tm-note {
  width: 100%;
  min-height: 9.5rem;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}

.tm-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1rem;
}

@media (max-width: 700px) {
  .tm-facts,
  .tm-form {
    grid-template-columns: 1fr;
  }
}

.tm-estado {
  min-width: 7.2rem;
  font-weight: 600;
}

.tm-frio {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #b9d4f5;
}

.tm-tibio {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: #ffd7ad;
}

.tm-caliente {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: #f5c2bc;
}

.tm-status {
  display: block;
  margin-top: .25rem;
  font-size: .72rem;
  color: var(--success-text);
}

.tm-status.is-error {
  color: var(--danger-text);
}

.tm-error {
  margin: 0 0 1rem;
  color: var(--danger-text);
}

.tm-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .65rem;
  margin-top: .85rem;
}

.tm-cliente {
  font-weight: 600;
}
