/* Camada final de compatibilidade para telas legadas. */

form:not(.auth-form):not(.confirm-dialog__panel) {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: var(--rs-radius);
}

.stock-page-header,
.financial-page-header,
.billing-notes-header,
.customers-header,
.technicians-header,
.system-events-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
}

.stock-page-header h1,
.stock-page-header h2,
.financial-page-header h1,
.financial-page-header h2 {
  margin: 0;
  color: var(--rs-text);
  font-size: clamp(26px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.stock-page-header p,
.financial-page-header p {
  margin: 8px 0 0;
  color: var(--rs-text-secondary);
  font-size: 15px;
}

.stock-manual-section,
.stock-return-section,
.stock-import-section,
.stock-tech-card,
.billing-notes-editor-section,
.billing-notes-detail,
.financial-form-section {
  padding: 24px;
  border: 1px solid var(--rs-border-light);
  border-radius: var(--rs-radius);
  background: var(--rs-surface);
  box-shadow: var(--rs-shadow-sm);
}

.stock-manual-section header h3,
.stock-return-section header h3,
.stock-import-section header h3,
.billing-notes-editor-title h3 {
  color: var(--rs-text);
  font-size: 16px;
  font-weight: 600;
}

.stock-message-success,
.financial-message-success,
.billing-notes-message-success,
.customers-message-success,
.technicians-message-success,
.system-events-message-success {
  padding: 12px 16px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: var(--rs-success-light);
  color: #166534;
}

.stock-loading,
.financial-loading,
.billing-notes-loading,
.customers-loading,
.technicians-loading,
.system-events-loading,
.os-loading {
  color: var(--rs-text-secondary);
}

.home-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.home-section-heading h2 { margin: 0; font-size: 18px; font-weight: 600; }
.home-section-heading p { margin: 5px 0 0; color: var(--rs-text-secondary); }
.home-section-heading > span { color: var(--rs-text-secondary); font-size: 12px; }
.sector-card { position: relative; }
.sector-card-content { min-width: 0; flex: 1; }
.sector-card-arrow { align-self: center; margin-left: auto; color: var(--rs-text-muted); font-size: 24px; }

.sector-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.sector-menu-item {
  min-height: 64px;
  padding: 16px;
  border: 1px solid var(--rs-border-light);
  border-radius: 10px;
  background: var(--rs-surface);
  color: var(--rs-text);
  font-weight: 600;
  text-align: left;
}

.sector-menu-item:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
  color: var(--rs-primary);
}

.os-results-card .section-card__body { padding: 0; }
.os-results-heading h2 { display: flex; align-items: center; gap: 10px; }
.results-count-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--rs-primary-light);
  color: var(--rs-primary);
  font-size: 11px;
  font-weight: 600;
}

.os-filter-actions { display: flex; align-items: center; gap: 8px; }
.os-table-actions { width: 72px; text-align: center; }
.os-table-actions .action-menu { display: inline-block; text-align: left; }
.os-number { color: var(--rs-text); font-weight: 600; }
.table-primary { color: var(--rs-text); font-weight: 500; }
.table-truncate { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth-submit {
  background: var(--rs-primary);
  border-color: var(--rs-primary);
  border-radius: 8px;
  box-shadow: none;
}

.auth-submit:hover { background: var(--rs-primary-hover); box-shadow: none; transform: none; }

@media (max-width: 720px) {
  .stock-page-header,
  .financial-page-header,
  .billing-notes-header,
  .customers-header,
  .technicians-header,
  .system-events-header,
  .home-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .os-filter-actions { width: 100%; }
  .os-filter-actions > button { flex: 1; }
  .stock-manual-section,
  .stock-return-section,
  .stock-import-section,
  .stock-tech-card { padding: 16px; }
}
