/* Final semantic theme adapter. Loaded after module styles so user-selected
   tokens remain authoritative without changing any business component API. */
.app-background { background: var(--theme-gradient-background); }
.app-shell,
.app-workspace,
.view-root,
.page { color: var(--theme-text); }
.view-root { background-color: var(--theme-app-bg); }

.sidebar-host,
.sidebar,
.sidebar__surface { background-color: var(--theme-sidebar-bg); border-color: var(--theme-border); }
.topbar-host,
.topbar { background-color: var(--theme-topbar-bg); border-color: var(--theme-border); color: var(--theme-text); }

.card,
.modal,
.dropdown-menu,
.table-shell,
.settings-admin-card,
.products-panel,
.products-catalog,
.hr-section-card,
.fiscal-card {
  background-color: var(--theme-card-bg);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

.btn.btn--primary,
.products-page .btn--primary,
.human-resources-page .btn--primary,
.fiscal-page .btn--primary {
  background: var(--theme-module-button);
  border-color: var(--theme-module-button);
  color: var(--theme-module-on-button);
}
.btn.btn--primary:hover,
.products-page .btn--primary:hover,
.human-resources-page .btn--primary:hover,
.fiscal-page .btn--primary:hover {
  background: var(--theme-module-button-hover);
  border-color: var(--theme-module-button-hover);
}
.btn.btn--primary:active { background: var(--theme-module-button-active); }

.btn.btn--ghost { background-color: var(--theme-card-bg); border-color: var(--theme-border); color: var(--theme-module-accent); }
.btn.btn--ghost:hover { background-color: var(--theme-module-soft); border-color: var(--theme-module-accent); }

.field__input,
.field__select,
.field__textarea,
.search-input,
.filter-select {
  background-color: var(--theme-input-bg);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

.data-table thead,
.products-table thead,
.hr-data-table thead { background-color: var(--theme-section-bg); color: var(--theme-text-muted); }
.data-table td,
.data-table th,
.products-table td,
.products-table th,
.hr-data-table td,
.hr-data-table th { border-color: var(--theme-divider); }

.inventory-tab.is-active,
.products-tab.is-active,
.hr-nav-tab.is-active,
.fiscal-tab.is-active,
.settings-admin-tab.is-active {
  color: var(--theme-module-accent);
  border-color: var(--theme-module-accent);
  background-color: var(--theme-module-soft);
}

.badge--primary,
.badge--info { background-color: var(--theme-module-soft); color: var(--theme-module-accent); }
.badge--success { background-color: color-mix(in srgb, var(--theme-success) 12%, var(--theme-card-bg)); color: var(--theme-success); }
.badge--warning { background-color: color-mix(in srgb, var(--theme-warning) 14%, var(--theme-card-bg)); color: var(--theme-warning); }
.badge--danger { background-color: color-mix(in srgb, var(--theme-danger) 12%, var(--theme-card-bg)); color: var(--theme-danger); }

.modal-overlay { background: var(--theme-overlay); backdrop-filter: blur(var(--theme-blur)); }
a { color: var(--theme-link); }
