/**
 * Vertex — Modo escuro
 * Aplica-se via html[data-theme="dark"].
 * A sidebar (.sidebar) mantém identidade azul Vertex — não incluída aqui.
 */

html[data-theme="dark"] {
  color-scheme: dark;

  --vertex-bg: #0f1419;
  --vertex-bg-secondary: #1a2129;
  --vertex-white: #1e2630;
  --vertex-text: #eef2f6;
  --vertex-text-secondary: #9aa4b2;
  --vertex-border: #2a3441;
  --vertex-link: #7eb3ff;
  --vertex-link-hover: #a4caff;
  --vertex-input-bg: #161d26;
  --vertex-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .app-main a:not(.button):not(.sidebar-link):not(.opp-ws-tab):not(.opp-page-link) {
  color: var(--vertex-link);
}

html[data-theme="dark"] .app-main a:not(.button):not(.sidebar-link):hover {
  color: var(--vertex-link-hover);
}

html[data-theme="dark"] .app-main .button.secondary {
  background: var(--vertex-input-bg);
  border-color: var(--vertex-border);
  color: var(--vertex-text);
}

html[data-theme="dark"] .app-main .button.secondary:hover {
  background: var(--vertex-bg-secondary);
  border-color: #3d4a5c;
}

html[data-theme="dark"] .app-main .button.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .app-main input,
html[data-theme="dark"] .app-main select,
html[data-theme="dark"] .app-main textarea {
  background: var(--vertex-input-bg);
  border-color: var(--vertex-border);
  color: var(--vertex-text);
}

html[data-theme="dark"] .app-main input:focus,
html[data-theme="dark"] .app-main select:focus,
html[data-theme="dark"] .app-main textarea:focus {
  border-color: #4b7fd4;
  box-shadow: 0 0 0 3px rgba(75, 127, 212, 0.2);
}

html[data-theme="dark"] .app-main input::placeholder,
html[data-theme="dark"] .app-main textarea::placeholder {
  color: #6b7785;
}

html[data-theme="dark"] .app-main tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .app-main .dropdown-menu,
html[data-theme="dark"] .app-main .modal {
  box-shadow: var(--vertex-shadow);
}

html[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .app-main .badge.success {
  background: rgba(22, 163, 74, 0.18);
  color: #6ee7a0;
}

html[data-theme="dark"] .app-main .badge.warning,
html[data-theme="dark"] .app-main .badge.urgent {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

html[data-theme="dark"] .app-main .badge.danger {
  background: rgba(220, 38, 38, 0.16);
  color: #fca5a5;
}

html[data-theme="dark"] .app-main .badge.info {
  background: rgba(37, 99, 235, 0.16);
  color: #93c5fd;
}

html[data-theme="dark"] .app-main .badge.muted {
  background: rgba(255, 255, 255, 0.08);
  color: var(--vertex-text-secondary);
}

html[data-theme="dark"] .app-main .alert.success {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.28);
  color: #86efac;
}

html[data-theme="dark"] .app-main .alert.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fcd34d;
}

html[data-theme="dark"] .app-main .alert.danger {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.28);
  color: #fca5a5;
}

html[data-theme="dark"] .app-main .alert.info {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.28);
  color: #93c5fd;
}

html[data-theme="dark"] .toast {
  background: var(--vertex-white);
  box-shadow: var(--vertex-shadow);
}

html[data-theme="dark"] .skeleton-line {
  background: linear-gradient(90deg, #1a2129 25%, #252e3a 50%, #1a2129 75%);
}

html[data-theme="dark"] .app-main .breadcrumb-item {
  color: var(--vertex-text-secondary);
}

html[data-theme="dark"] .app-main .breadcrumb-item.is-current {
  color: var(--vertex-text);
}

.theme-toggle-button {
  position: relative;
}

.theme-toggle-button .theme-toggle-icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

html:not([data-theme="dark"]) .theme-toggle-button .theme-toggle-icon--dark {
  display: none;
}

html[data-theme="dark"] .theme-toggle-button .theme-toggle-icon--light {
  display: none;
}

html[data-theme="dark"] .auth-page {
  background: #0b1118;
}

html[data-theme="dark"] .auth-shell {
  background: var(--vertex-white);
  border-color: var(--vertex-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .auth-page__corner {
  color: #667085;
}

html[data-theme="dark"] .auth-form-title {
  color: #eef2f6;
}

html[data-theme="dark"] .auth-field__label {
  color: var(--vertex-text);
}

html[data-theme="dark"] .auth-field__control input {
  background: var(--vertex-input-bg);
  border-color: var(--vertex-border);
  color: var(--vertex-text);
}

html[data-theme="dark"] .auth-field__control input:focus {
  background: #1a2129;
  border-color: #3d4a5c;
}

html[data-theme="dark"] .admin-hero__cta {
  background: rgba(255, 255, 255, 0.95);
  color: var(--vertex-primary);
}

html[data-theme="dark"] .admin-hero__cta:hover {
  background: #ffffff;
}

html[data-theme="dark"] .admin-kpi-card__icon--blue {
  background: rgba(126, 179, 255, 0.12);
  color: #7eb3ff;
}

html[data-theme="dark"] .opp-card,
html[data-theme="dark"] .opp-filters,
html[data-theme="dark"] .opp-analysis-panel,
html[data-theme="dark"] .opp-stat-card,
html[data-theme="dark"] .opp-cnae-ms,
html[data-theme="dark"] .opp-cnae-ms__panel,
html[data-theme="dark"] .opp-page-link,
html[data-theme="dark"] .opp-ws-card,
html[data-theme="dark"] .opp-ws-mini-card,
html[data-theme="dark"] .opp-ws-sidecard,
html[data-theme="dark"] .opp-ws-tabs,
html[data-theme="dark"] .opp-cnae-chip,
html[data-theme="dark"] .opp-subscore,
html[data-theme="dark"] .opp-buyer-score-panel {
  background: var(--vertex-white);
  border-color: var(--vertex-border);
}

html[data-theme="dark"] .opp-card__detail--deadline {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.28);
}

html[data-theme="dark"] .opp-card__detail--deadline dt,
html[data-theme="dark"] .opp-card__detail--deadline dd {
  color: #fbbf24;
}

html[data-theme="dark"] .opp-card__buyer-ring__chart::before {
  background: var(--vertex-white);
}

html[data-theme="dark"] .opp-card__buyer-ring__chart {
  background: conic-gradient(var(--buyer-ring-color) calc(var(--buyer-score) * 0.1%), #2a3441 0);
}

html[data-theme="dark"] .opp-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--vertex-text);
}

html[data-theme="dark"] .opp-badge--muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--vertex-text-secondary);
}

html[data-theme="dark"] .opp-badge--ai {
  background: rgba(126, 179, 255, 0.14);
  color: #a4caff;
}

html[data-theme="dark"] .opp-filters__toggle,
html[data-theme="dark"] .opp-cnae-ms__trigger,
html[data-theme="dark"] .opp-ws-tab {
  background: var(--vertex-input-bg);
  border-color: var(--vertex-border);
  color: var(--vertex-text-secondary);
}

html[data-theme="dark"] .opp-ws-tab.is-active {
  background: rgba(4, 38, 98, 0.45);
  border-color: rgba(126, 179, 255, 0.35);
  color: #eef2f6;
}

html[data-theme="dark"] .opp-analysis-hero--high { background: rgba(22, 163, 74, 0.12); }
html[data-theme="dark"] .opp-analysis-hero--recommended { background: rgba(37, 99, 235, 0.12); }
html[data-theme="dark"] .opp-analysis-hero--monitor { background: rgba(245, 158, 11, 0.12); }
html[data-theme="dark"] .opp-analysis-hero--low { background: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] .opp-insight--positive { background: rgba(22, 163, 74, 0.1); }
html[data-theme="dark"] .opp-insight--warning { background: rgba(245, 158, 11, 0.1); }
html[data-theme="dark"] .opp-insight--danger { background: rgba(220, 38, 38, 0.1); }
html[data-theme="dark"] .opp-ws-alert {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fcd34d;
}

html[data-theme="dark"] .doc-attention-card,
html[data-theme="dark"] .doc-card,
html[data-theme="dark"] .doc-filter-bar,
html[data-theme="dark"] .doc-stat-card {
  background: var(--vertex-white);
  border-color: var(--vertex-border);
}

html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .profile-section,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .dashboard-stat,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .stat-card {
  background: var(--vertex-white);
  border-color: var(--vertex-border);
}

html[data-theme="dark"] .opp-page-link.is-active {
  background: var(--vertex-primary);
  border-color: var(--vertex-primary);
  color: #fff;
}

html[data-theme="dark"] .profile-summary-icon--primary {
  background: rgba(37, 99, 235, 0.14);
  color: #93c5fd;
}

html[data-theme="dark"] .profile-summary-icon--secondary {
  background: rgba(89, 37, 220, 0.14);
  color: #c4b5fd;
}

html[data-theme="dark"] .profile-summary-icon--categories,
html[data-theme="dark"] .profile-shortcut-icon--categories {
  background: rgba(241, 87, 6, 0.14);
}

html[data-theme="dark"] .profile-summary-icon--regions {
  background: rgba(22, 163, 74, 0.14);
}

html[data-theme="dark"] .profile-tab.is-active {
  background: var(--vertex-primary);
  border-color: var(--vertex-primary);
  color: #fff;
}

html[data-theme="dark"] .mt-stat-card,
html[data-theme="dark"] .mt-kanban-column,
html[data-theme="dark"] .mt-kanban-card,
html[data-theme="dark"] .mt-table-card,
html[data-theme="dark"] .mt-filters-form {
  background: var(--vertex-white);
  border-color: var(--vertex-border);
}

html[data-theme="dark"] .mt-view-toggle {
  background: var(--vertex-input-bg);
  border-color: var(--vertex-border);
}

html[data-theme="dark"] .mt-view-toggle__btn.is-active {
  background: rgba(4, 38, 98, 0.45);
  color: #eef2f6;
}

html[data-theme="dark"] .flash-message {
  background: var(--vertex-white);
  border-color: var(--vertex-border);
}
