/*
 * PROSPECTA CORBAN · DARK REFINEMENT v286
 * A single blue/cyan visual language for the authenticated dark workspace.
 * Deliberately uses #app-view specificity to override legacy green !important rules.
 * Semantic statuses (success, online, warning, failure) are intentionally excluded.
 * Layout and business behavior are unchanged.
 */

html[data-app-theme="dark"] #app-view {
  --app-accent: #56d7fa !important;
  --app-accent-soft: rgba(62, 177, 240, .14) !important;
  --app-mint: #73cfe9 !important;
  --app-button-bg: #54c9f5 !important;
  --app-button-text: #061928 !important;
  --app-surface: #0e243a !important;
  --app-surface-2: #122d46 !important;
  --app-surface-3: #16354e !important;
  --app-control: #102b43 !important;
  --app-border: #2c536e !important;
  --app-border-strong: #4e8eb0 !important;
  --app-text: #f0f9ff !important;
  --app-muted: #b2ccdc !important;
  --app-muted-2: #9dbbd0 !important;
  --dark-refine-bg: #081727;
  --dark-refine-card: #102a42;
  --dark-refine-border: rgba(99, 189, 232, .35);
  --dark-refine-glow: rgba(51, 169, 248, .28);
}

/* A marca Prospecta mantém as cores, a forma e o brilho originais.
   Não aplicar overrides à .side-brand-symbol, span ou i. */
html[data-app-theme="dark"] #app-view .nav.active {
  color: #f5fdff !important;
  border-color: rgba(91, 212, 252, .46) !important;
  background: linear-gradient(90deg, rgba(47, 139, 233, .24), rgba(52, 186, 235, .065)) !important;
  box-shadow: inset 3px 0 0 #71e4ff, 0 0 20px rgba(49, 153, 234, .12) !important;
}
html[data-app-theme="dark"] #app-view :is(
  .topbar, .employees-panel-top, .tables-panel-top, .company-list-stage-toolbar
)::after {
  background: linear-gradient(90deg, transparent, rgba(89, 200, 252, .62), rgba(67, 147, 237, .20), transparent) !important;
  filter: drop-shadow(0 0 5px rgba(63, 181, 253, .28)) !important;
}

/* Explicit Master Global home fixes: remove green glass from metric cards / list. */
html[data-app-theme="dark"] #app-view #section-dashboard .stats article,
html[data-app-theme="dark"] #app-view #section-dashboard .stats article.accent {
  color: #f1f9ff !important;
  border-color: rgba(85, 166, 210, .37) !important;
  background:
    radial-gradient(ellipse at 93% 0%, rgba(36, 132, 228, .15), transparent 48%),
    linear-gradient(145deg, #112c46 0%, #0b2136 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(205, 246, 255, .085),
    0 10px 32px rgba(1, 9, 25, .27) !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard .stats article::before {
  background: linear-gradient(90deg, transparent, rgba(89, 202, 247, .76), transparent) !important;
  opacity: .65 !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard .stats article:hover {
  border-color: rgba(119, 214, 249, .55) !important;
  box-shadow: inset 0 1px 0 rgba(220, 247, 255, .10), 0 12px 31px rgba(1, 9, 25, .30), 0 0 18px rgba(56, 159, 228, .11) !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard .stats article strong {
  color: #f5fcff !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard .stats article :is(small, .stat-code, span:not(.badge)) {
  color: #a9c7d9 !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard :is(
  .recent-stream, .panel, .recent-company-list
) {
  border-color: rgba(88, 164, 206, .33) !important;
  background: linear-gradient(154deg, #102c46, #0c2238 70%, #0b1f33) !important;
  box-shadow: inset 0 1px 0 rgba(198, 241, 255, .065), 0 14px 33px rgba(0, 7, 22, .23) !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard .recent-stream-bar {
  border-color: rgba(94, 174, 220, .26) !important;
  background: linear-gradient(90deg, #15344e, #102a42) !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard .recent-stream-signal :is(span,i) {
  background: #6dd4fb !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard .company-list-item {
  background: linear-gradient(105deg, #102d47, #0c233a) !important;
  border-color: rgba(82, 168, 208, .27) !important;
  box-shadow: inset 0 1px 0 rgba(165, 222, 251, .05) !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard .company-list-item:hover {
  background: linear-gradient(105deg, #183950, #102e49) !important;
  border-color: rgba(100, 212, 250, .48) !important;
}

/* Specific fix for the dark green/black void below the company rows. */
html[data-app-theme="dark"] #app-view #section-companies .company-commandbar,
html[data-app-theme="dark"] #app-view #section-companies .company-data-stage.company-list-stage,
html[data-app-theme="dark"] #app-view #section-companies .companies-list-wrap,
html[data-app-theme="dark"] #app-view #section-companies .companies-list,
html[data-app-theme="dark"] #app-view #section-companies .company-data-stage .companies-empty {
  border-color: rgba(97, 178, 220, .37) !important;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(34, 134, 222, .08), transparent 49%),
    linear-gradient(150deg, #102a44 0%, #0a2035 100%) !important;
  box-shadow: inset 0 1px 0 rgba(197, 241, 255, .055), 0 11px 29px rgba(0, 7, 22, .20) !important;
}
html[data-app-theme="dark"] #app-view #section-companies .companies-list-wrap,
html[data-app-theme="dark"] #app-view #section-companies .companies-list {
  border: 0 !important;
  box-shadow: none !important;
}
html[data-app-theme="dark"] #app-view #section-companies .company-list-stage-toolbar {
  background: linear-gradient(90deg, #17374f, #102c44) !important;
  border-bottom-color: rgba(96, 177, 220, .33) !important;
}
html[data-app-theme="dark"] #app-view #section-companies .company-list-item {
  background: linear-gradient(120deg, #173952 0%, #102a43 100%) !important;
  border-color: rgba(94, 180, 229, .39) !important;
}
html[data-app-theme="dark"] #app-view #section-companies .company-list-item:hover {
  border-color: rgba(122, 226, 255, .58) !important;
  background: linear-gradient(120deg, #1d435d, #14364f) !important;
}

/* Bank catalog with a blue stage, blue cards, and zero ambient green. */
html[data-app-theme="dark"] #app-view #section-automation-banks :is(
  .automation-banks-admin-commandbar, .automation-banks-admin-stage,
  .automation-bank-admin-card
) {
  border-color: rgba(94, 183, 225, .36) !important;
  background:
    radial-gradient(circle at 94% 0%, rgba(35, 142, 239, .12), transparent 50%),
    linear-gradient(145deg, #132f4a 0%, #0c2137 100%) !important;
  box-shadow: inset 0 1px 0 rgba(217, 246, 255, .08), 0 13px 28px rgba(0, 8, 23, .23) !important;
}
html[data-app-theme="dark"] #app-view #section-automation-banks .automation-banks-admin-commandbar {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-app-theme="dark"] #app-view #section-automation-banks .automation-bank-admin-card:hover {
  border-color: rgba(117, 227, 255, .64) !important;
  background: linear-gradient(140deg, #1a405c, #10304b) !important;
  box-shadow: 0 12px 29px rgba(0, 8, 23, .29), 0 0 17px rgba(72, 181, 247, .13) !important;
}
html[data-app-theme="dark"] #app-view #section-automation-banks .automation-bank-admin-logo {
  color: #a0eaff !important;
  border-color: rgba(98, 209, 248, .47) !important;
  background: #1a4462 !important;
}
html[data-app-theme="dark"] #app-view #section-automation-banks .automation-banks-admin-kicker {
  color: #72dcff !important;
}
html[data-app-theme="dark"] #app-view #section-automation-banks .automation-banks-admin-heading > small,
html[data-app-theme="dark"] #app-view #section-automation-banks .automation-bank-admin-copy small {
  color: #b1cbdc !important;
  opacity: 1 !important;
}

/* Shared workspaces across roles: subtle sky-blue illumination, never green. */
html[data-app-theme="dark"] #app-view :is(
  .pipeline-commandbar, .pipeline-stage, .employees-panel,
  .settings-module-card, .tables-panel, .banks-settings-panel,
  .phases-panel, .products-settings-panel, .workers-commandbar,
  .worker-card, .reports-launch-card, .table-bank-card,
  .table-promoter-card, .company-license-state-card,
  .company-bank-access-card, .employee-row, .company-commission-row
) {
  border-color: rgba(93, 176, 220, .31) !important;
  background:
    radial-gradient(ellipse at 96% -10%, rgba(35, 137, 221, .10), transparent 52%),
    linear-gradient(146deg, #132c45, #0c2034 90%) !important;
  box-shadow: inset 0 1px 0 rgba(206, 246, 255, .055), 0 12px 30px rgba(0, 6, 22, .23) !important;
}
html[data-app-theme="dark"] #app-view :is(
  .settings-module-card, .reports-launch-card, .table-bank-card, .table-promoter-card
):hover {
  border-color: rgba(114, 224, 255, .58) !important;
  box-shadow: 0 14px 36px rgba(0, 7, 23, .32), 0 0 20px rgba(62, 176, 246, .16) !important;
}
/* Operational Home cards generated dynamically, all profiles. */
html[data-app-theme="dark"] #app-view :is(
  .mcd-metric, .mcd-section, .mcd-flow-card, .mcd-attention-card,
  .mcd-shortcut, .mcd-table-row, .mcd-goal-card
) {
  border-color: rgba(97, 187, 230, .36) !important;
  background:
    radial-gradient(ellipse at 94% 0%, rgba(40, 143, 244, .14), transparent 52%),
    linear-gradient(138deg, #102b44 0%, #0b2035 100%) !important;
  box-shadow: inset 0 1px 0 rgba(213, 248, 255, .072), 0 12px 34px rgba(0, 6, 20, .28) !important;
}
html[data-app-theme="dark"] #app-view :is(.mcd-flow-card, .mcd-shortcut, .mcd-attention-card):hover {
  border-color: rgba(122, 226, 255, .60) !important;
  box-shadow: 0 14px 36px rgba(0, 6, 22, .3), 0 0 22px rgba(57, 159, 229, .14) !important;
}
html[data-app-theme="dark"] #app-view .mcd-goal-card {
  border-color: rgba(94, 205, 240, .48) !important;
  background:
    radial-gradient(ellipse at 95% 0%, rgba(29, 140, 239, .19), transparent 60%),
    linear-gradient(115deg, #0e3448, #0b2639 100%) !important;
}
/* Progress bars and award markers remain readable. Existing movement unchanged. */
html[data-app-theme="dark"] #app-view .mcd-goal-fill {
  background: linear-gradient(90deg, #248fd4, #48c0e8 65%, #7bdcf3) !important;
  box-shadow: 0 0 18px rgba(51, 182, 245, .30) !important;
}
html[data-app-theme="dark"] #app-view .mcd-goal-current > strong,
html[data-app-theme="dark"] #app-view .mcd-goal-next strong {
  color: #84e5ff !important;
}

/* ONE primary style for primary actions: highly luminous cyan/azure. */
html[data-app-theme="dark"] #app-view :is(
  .btn.primary, .company-register-button, .company-new-button,
  .automation-banks-admin-new, .pipeline-add-button, .proposal-save-button,
  .employee-save-button, .employee-new-button, .profile-save-button,
  .credential-finish-button, .table-catalog-save-button,
  .tables-primary-action, .banks-settings-primary-action,
  .phases-primary-action, .products-settings-primary-action,
  .workers-primary, .company-bank-access-save, .company-license-save,
  .company-commission-save, .company-commission-add,
  .proposal-confirm-button
) {
  color: #041a2c !important;
  border: 1px solid rgba(150, 232, 255, .79) !important;
  background: linear-gradient(112deg, #429df8 0%, #64d2ff 49%, #86f0ff 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .38),
    0 0 0 1px rgba(86, 195, 247, .19),
    0 0 19px rgba(55, 180, 255, .28),
    0 9px 25px rgba(20, 111, 210, .31) !important;
  text-shadow: none !important;
  transition: filter .18s ease, box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
html[data-app-theme="dark"] #app-view :is(
  .btn.primary, .company-register-button, .company-new-button,
  .automation-banks-admin-new, .pipeline-add-button, .proposal-save-button,
  .employee-save-button, .employee-new-button, .profile-save-button,
  .credential-finish-button, .table-catalog-save-button,
  .tables-primary-action, .banks-settings-primary-action,
  .phases-primary-action, .products-settings-primary-action,
  .workers-primary, .company-bank-access-save, .company-license-save,
  .company-commission-save, .company-commission-add,
  .proposal-confirm-button
):hover:not(:disabled) {
  color: #031526 !important;
  background: linear-gradient(112deg, #54b2ff 0%, #83e0ff 57%, #a1f5ff 100%) !important;
  border-color: #b0f2ff !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .48),
    0 0 0 1px rgba(118, 224, 255, .26),
    0 0 27px rgba(66, 194, 252, .38),
    0 12px 31px rgba(21, 130, 223, .38) !important;
}
html[data-app-theme="dark"] #app-view :is(
  .btn.primary, .company-register-button, .automation-banks-admin-new,
  .pipeline-add-button, .proposal-save-button, .employee-save-button,
  .employee-new-button, .profile-save-button
)::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.53), transparent) !important;
}

/* Secondary buttons: distinctive luminous outlines, subdued versus primary. */
html[data-app-theme="dark"] #app-view :is(
  .btn.secondary, .automation-banks-admin-refresh, .workers-refresh,
  .toolbar-button, .theme-toggle, .sidebar-theme-toggle,
  .sidebar-toggle, .logout-button, .pipeline-icon-action,
  .settings-back-button, .table-catalog-icon-button,
  .proposal-cancel-button, .company-license-action
) {
  color: #dff5ff !important;
  border-color: rgba(105, 192, 241, .48) !important;
  background: linear-gradient(145deg, #163b58, #0f2a42) !important;
  box-shadow: inset 0 1px 0 rgba(193, 237, 255, .085), 0 0 13px rgba(63, 163, 231, .095) !important;
}
html[data-app-theme="dark"] #app-view :is(
  .btn.secondary, .automation-banks-admin-refresh, .workers-refresh,
  .toolbar-button, .theme-toggle, .sidebar-toggle, .logout-button,
  .pipeline-icon-action, .settings-back-button
):hover:not(:disabled) {
  border-color: rgba(145, 233, 255, .69) !important;
  background: linear-gradient(145deg, #215171, #13374e) !important;
  box-shadow: 0 0 17px rgba(65, 187, 245, .20), inset 0 1px rgba(211, 245, 255, .10) !important;
}

/* Informational color ≠ status. Real status pills keep semantic colors. */
html[data-app-theme="dark"] #app-view :is(
  .automation-bank-admin-status:not(.is-off), .company-list-status .badge,
  .worker-status.is-online, .worker-status-dot.is-online, .company-live-indicator span
) {
  color: #86edc7;
}
html[data-app-theme="dark"] #app-view :is(
  .pipeline-phase-badge.is-rejected, .status-rejected, .status-error
) {
  /* Deliberately no override: original negative/status colors retained. */
}

/* Bright gradients should not move or flash continuously. */
@media (prefers-reduced-motion: reduce) {
  html[data-app-theme="dark"] #app-view :is(
    .btn.primary, .company-register-button, .automation-banks-admin-new,
    .pipeline-add-button, .proposal-save-button
  ) {
    transition: none !important;
  }
}