/*
  Prospecta Corban — Dark refinement v287
  Targeted repair of legacy green accents in Global Home, Companies & Pipeline.
  No layout, phase/status, modal layering, or behavioral changes.
  Dark theme only; loaded after v286.
*/
html[data-app-theme="dark"] #app-view {
  --corban-blue-base: #0c2035;
  --corban-blue-panel: #112b43;
  --corban-blue-panel-high: #173952;
  --corban-blue-edge: rgba(95, 179, 222, .35);
  --corban-blue-glow: rgba(73, 190, 251, .19);
}

/* TOP STRIPS — recolor ambient lighting; don't hide content-bearing pseudo-elements. */
html[data-app-theme="dark"] #app-view :is(
  .company-list-stage-toolbar, .recent-stream-bar,
  .pipeline-commandbar, .pipeline-stage-toolbar,
  .pipeline-stage-rail, .company-data-rail
) {
  border-color: rgba(101, 179, 219, .33) !important;
  background: linear-gradient(90deg, #15344d, #112a42) !important;
}
html[data-app-theme="dark"] #app-view :is(
  .company-list-stage-toolbar, .recent-stream-bar,
  .pipeline-stage-toolbar
)::after {
  background: linear-gradient(
    90deg, transparent, rgba(98, 205, 255, .65),
    rgba(54, 135, 223, .22), transparent
  ) !important;
  box-shadow: 0 0 8px rgba(78, 187, 244, .14) !important;
  filter: none !important;
}
html[data-app-theme="dark"] #app-view :is(
  .company-data-rail, .pipeline-stage-rail, .recent-stream-signal
) span {
  background: #66d8ff !important;
}
html[data-app-theme="dark"] #app-view :is(
  .company-data-rail, .pipeline-stage-rail, .recent-stream-signal
) i {
  background: linear-gradient(90deg, #69d5ff, transparent) !important;
}

/* GLOBAL HOME — actual legacy rows use .company-row, not just .company-list-item. */
html[data-app-theme="dark"] #app-view #section-dashboard .recent-stream,
html[data-app-theme="dark"] #app-view #section-dashboard .recent-company-list {
  background: linear-gradient(155deg, #112b44, #0c2136) !important;
  border-color: var(--corban-blue-edge) !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard .recent-stream::before {
  background-image: linear-gradient(
    90deg, transparent 0 49.8%,
    rgba(104, 190, 229, .11) 50%, transparent 50.2%
  ) !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard :is(
  .recent-company-list .company-row,
  .recent-company-list .company-list-item
) {
  background: linear-gradient(110deg, #102a41, #0d2237) !important;
  border-color: rgba(88, 170, 217, .25) !important;
  box-shadow: inset 0 1px 0 rgba(198, 237, 255, .045) !important;
  color: #eaf7ff !important;
}
html[data-app-theme="dark"] #app-view #section-dashboard :is(
  .recent-company-list .company-row,
  .recent-company-list .company-list-item
):hover {
  background: linear-gradient(110deg, #16364f, #103049) !important;
  border-color: rgba(110, 213, 250, .49) !important;
  box-shadow: 0 0 18px rgba(58, 158, 231, .10) !important;
}

/* COMPANY LIST — eliminate dark-green patches underneath rows. */
html[data-app-theme="dark"] #app-view #section-companies :is(
  .company-data-stage, .company-list-stage,
  .companies-list-wrap, .companies-list
) {
  background: linear-gradient(150deg, #112b43, #0c2136) !important;
  border-color: rgba(100, 178, 219, .33) !important;
}
html[data-app-theme="dark"] #app-view #section-companies :is(
  .company-list-item, .company-row
) {
  background: linear-gradient(115deg, #173850, #112b43) !important;
  border-color: rgba(100, 184, 227, .39) !important;
  color: #edf8ff !important;
}
html[data-app-theme="dark"] #app-view #section-companies :is(
  .company-list-item, .company-row
):hover {
  background: linear-gradient(115deg, #1c425e, #16354e) !important;
  border-color: rgba(121, 224, 255, .55) !important;
  box-shadow: 0 0 17px rgba(62, 170, 238, .11) !important;
}

/* SEARCH: dark navy across wrapper, icon slot and input — no black/green tile. */
html[data-app-theme="dark"] #app-view #section-companies .company-search-shell {
  background: linear-gradient(120deg, #142e47, #10283f) !important;
  border: 1px solid rgba(105, 186, 230, .36) !important;
  box-shadow: inset 0 1px rgba(200, 238, 255, .055) !important;
}
html[data-app-theme="dark"] #app-view #section-companies .company-search-shell > span {
  color: #82dfff !important;
  background: #122c44 !important;
  box-shadow: none !important;
}
html[data-app-theme="dark"] #app-view #section-companies .company-search-shell svg {
  color: #82dfff !important;
  stroke: #82dfff !important;
}
html[data-app-theme="dark"] #app-view #section-companies .company-search-shell input,
html[data-app-theme="dark"] #app-view #section-companies .company-search-shell input:focus {
  color: #ecf9ff !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html[data-app-theme="dark"] #app-view #section-companies .company-search-shell:focus-within {
  border-color: #77dfff !important;
  box-shadow: 0 0 0 3px rgba(89, 189, 247, .15) !important;
}
html[data-app-theme="dark"] #app-view #section-companies .company-search-shell::after {
  background: linear-gradient(90deg, rgba(112, 218, 252, .60), transparent 88%) !important;
}

/* PIPELINE — keep shell transparent while repainting the interactive area. */
html[data-app-theme="dark"] #app-view #section-pipeline.pipeline-workspace,
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-shell {
  background: transparent !important;
}
html[data-app-theme="dark"] #app-view #section-pipeline :is(
  .pipeline-commandbar, .pipeline-stage, .pipeline-table-wrap,
  .pipeline-empty
) {
  background:
    radial-gradient(ellipse at 95% 0%, rgba(45, 138, 229, .085), transparent 48%),
    linear-gradient(150deg, #102941, #0c2136) !important;
  border-color: rgba(97, 178, 221, .37) !important;
}
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-search {
  background: linear-gradient(125deg, #14334d, #112a42) !important;
  border: 1px solid rgba(100, 184, 226, .37) !important;
  box-shadow: inset 0 1px rgba(198, 241, 255, .055) !important;
}
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-search svg {
  color: #83deff !important;
  stroke: #83deff !important;
}
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-search input,
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-search input:focus {
  color: #ecf9ff !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-search:focus-within {
  border-color: #7adcff !important;
  box-shadow: 0 0 0 3px rgba(79, 185, 249, .16) !important;
}
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-table thead,
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-table th {
  background: #17364f !important;
  color: #cde2f0 !important;
  border-color: rgba(88, 166, 211, .31) !important;
}
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-table tbody td {
  background: #112940 !important;
  border-color: rgba(79, 144, 182, .28) !important;
}
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-table tbody tr:nth-child(even) td {
  background: #132d46 !important;
}
html[data-app-theme="dark"] #app-view #section-pipeline .pipeline-table tbody tr:hover td {
  background: #1c3c54 !important;
}

/* Preserve luminous controls introduced in v286. Refine hover only, no animation loop. */
html[data-app-theme="dark"] #app-view :is(
  .company-register-button, .automation-banks-admin-new,
  .pipeline-add-button, .btn.primary,
  .products-settings-primary-action, .tables-primary-action
):hover:not(:disabled) {
  border-color: rgba(190, 245, 255, .90) !important;
  background: linear-gradient(110deg, #5db7ff, #86e4ff 56%, #a0f4ff) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.40),
    0 0 23px rgba(73, 194, 255, .31),
    0 12px 28px rgba(29, 143, 230, .31) !important;
}

@media (prefers-reduced-motion: reduce) {
  html[data-app-theme="dark"] #app-view :is(
    .company-register-button, .automation-banks-admin-new,
    .pipeline-add-button, .btn.primary
  ) { transition: none !important; }
}