/* Cihantas OS Dark Mode v3
   Acceptance Feedback #3: consistency sweep.
   Loaded after dark_mode_v2.css to remove remaining light islands and
   normalize special-purpose component typography without affecting light mode. */

/* Daily Flow: operational pulse + command surface */
html[data-theme="dark"] .operational-pulse{
  background:var(--dm-surface-card)!important;
  border-color:var(--dm-border)!important;
  box-shadow:0 8px 24px rgba(0,0,0,.10)!important;
}
html[data-theme="dark"] .operational-pulse-label{
  color:var(--dm-text-secondary)!important;
  border-color:var(--dm-border)!important;
}
html[data-theme="dark"] .pulse-live-dot{box-shadow:0 0 0 3px rgba(53,166,111,.18)!important}
html[data-theme="dark"] .operational-pulse-item{
  background:transparent!important;
  border-color:var(--dm-border)!important;
  color:var(--dm-text-muted)!important;
}
html[data-theme="dark"] .operational-pulse-item b{color:var(--dm-text-primary)!important}
html[data-theme="dark"] .operational-pulse-item:hover{background:var(--dm-surface-elevated)!important;color:#dce6f3!important}
html[data-theme="dark"] .operational-pulse-item.active{background:#202b3a!important;color:#aebfff!important}
html[data-theme="dark"] .operational-pulse-item.active b{color:#b8c8ff!important}
html[data-theme="dark"] .operational-pulse-item.warning b{color:var(--dm-amber)!important}
html[data-theme="dark"] .operational-pulse-item.risk b{color:var(--dm-red)!important}
html[data-theme="dark"] .operational-pulse-item.positive b{color:var(--dm-green)!important}
html[data-theme="dark"] .flow-insights-trigger{
  background:transparent!important;
  color:var(--dm-text-secondary)!important;
}
html[data-theme="dark"] .flow-insights-trigger:hover{background:var(--dm-surface-elevated)!important;color:#dbe5ff!important}
html[data-theme="dark"] .flow-commandbar{
  background:var(--dm-surface-card)!important;
  border-color:var(--dm-border)!important;
  box-shadow:0 8px 24px rgba(0,0,0,.08)!important;
}
html[data-theme="dark"] .flow-filter-menu summary{color:var(--dm-text-secondary)!important}
html[data-theme="dark"] .flow-filter-menu summary:hover,
html[data-theme="dark"] .flow-filter-menu[open] summary{background:var(--dm-surface-elevated)!important;color:#fff!important}
html[data-theme="dark"] .flow-filter-menu.has-filter summary{background:#22304a!important;color:#afc0ff!important}
html[data-theme="dark"] .flow-filter-menu summary b{background:#2c3b57!important;color:#c9d5ff!important}
html[data-theme="dark"] .flow-filter-popover{
  background:var(--dm-surface-card)!important;
  border-color:var(--dm-border)!important;
  box-shadow:0 18px 42px rgba(0,0,0,.32)!important;
}
html[data-theme="dark"] .flow-filter-popover label{color:var(--dm-text-muted)!important}
html[data-theme="dark"] .flow-filter-popover select{
  background:var(--dm-surface-input)!important;
  border-color:var(--dm-border)!important;
  color:var(--dm-text-primary)!important;
}
html[data-theme="dark"] .work-update-mark{background:#202a36!important;border-color:#334154!important;color:#abb6c5!important}
html[data-theme="dark"] .work-table thead th{background:rgba(20,27,36,.97)!important}

/* Daily Flow insights drawer */
html[data-theme="dark"] .flow-insights-panel,
html[data-theme="dark"] .insights-head,
html[data-theme="dark"] .insight-section{background:var(--dm-surface-card)!important;border-color:var(--dm-border)!important}
html[data-theme="dark"] .insights-head h2,
html[data-theme="dark"] .insight-section-head h3,
html[data-theme="dark"] .insight-bar-row b,
html[data-theme="dark"] .insight-load>div>b{color:var(--dm-text-primary)!important}
html[data-theme="dark"] .insights-head p,
html[data-theme="dark"] .insight-section-head span,
html[data-theme="dark"] .insight-bar-row>div:first-child,
html[data-theme="dark"] .insight-load>strong{color:var(--dm-text-muted)!important}
html[data-theme="dark"] .insight-bar-track,
html[data-theme="dark"] .insight-load>div>div{background:#26313e!important}
html[data-theme="dark"] .insight-work-list>button{color:var(--dm-text-secondary)!important}
html[data-theme="dark"] .insight-work-list>button:hover{background:var(--dm-surface-hover)!important}

/* Device 360: KPI cards and navigation */
html[data-theme="dark"] .device-v2-stat{
  background:var(--dm-surface-card)!important;
  border-color:var(--dm-border-strong)!important;
  color:var(--dm-text-primary)!important;
  box-shadow:0 12px 30px rgba(0,0,0,.12)!important;
}
html[data-theme="dark"] .device-v2-stat>span,
html[data-theme="dark"] .device-v2-stat>small{color:var(--dm-text-muted)!important}
html[data-theme="dark"] .device-v2-stat>b{color:var(--dm-text-primary)!important}
html[data-theme="dark"] .device-v2-stat.service-attention.quiet>b{color:var(--dm-green)!important}
html[data-theme="dark"] .device-v2-stat.service-attention.warning{
  background:#2a2419!important;
  border-color:#5b4928!important;
}
html[data-theme="dark"] .device-v2-stat.service-attention.warning>b{color:var(--dm-amber)!important}
html[data-theme="dark"] .device-v2-stat.service-attention.critical{
  background:#2f1c23!important;
  border-color:#67303c!important;
}
html[data-theme="dark"] .device-v2-stat.service-attention.critical>b{color:var(--dm-red)!important}
html[data-theme="dark"] .device-v2-main-tabs{border-color:var(--dm-border)!important}
html[data-theme="dark"] .device-v2-main-tabs .tab{color:var(--dm-text-muted)!important;border-color:var(--dm-border)!important}
html[data-theme="dark"] .device-v2-main-tabs .tab.active{
  background:var(--dm-surface-elevated)!important;
  color:var(--dm-text-primary)!important;
  border-bottom-color:#829dff!important;
}
html[data-theme="dark"] .device-v2-subnav{
  background:var(--dm-surface-section)!important;
  border-color:var(--dm-border)!important;
}
html[data-theme="dark"] .device-v2-subnav button{color:var(--dm-text-muted)!important}
html[data-theme="dark"] .device-v2-subnav button:hover,
html[data-theme="dark"] .device-v2-subnav button.active{background:var(--dm-surface-elevated)!important;color:var(--dm-text-primary)!important;box-shadow:none!important}
html[data-theme="dark"] .device-v2-service-focus{background:#211d17!important;border-color:#4a3e29!important}
html[data-theme="dark"] .device-v2-service-list button{border-color:#3a3327!important}
html[data-theme="dark"] .device-v2-service-list button:hover{background:#2a2419!important}
html[data-theme="dark"] .device-v2-service-list button b{color:var(--dm-text-primary)!important}
html[data-theme="dark"] .device-v2-service-list button small{color:var(--dm-text-muted)!important}

/* Shared compact KPI cards used by Device 360 and Contract 360 */
html[data-theme="dark"] .device-kpi,
html[data-theme="dark"] .profitability-compact .device-kpi,
html[data-theme="dark"] .profitability-economics .device-kpi{
  background:var(--dm-surface-elevated)!important;
  border-color:var(--dm-border)!important;
  color:var(--dm-text-primary)!important;
}
html[data-theme="dark"] .device-kpi small{color:var(--dm-text-muted)!important}
html[data-theme="dark"] .device-kpi b{color:var(--dm-text-primary)!important}
html[data-theme="dark"] .profit-positive{color:var(--dm-green)!important}
html[data-theme="dark"] .profit-negative{color:var(--dm-red)!important}

/* Customer 360: summary band + service focus */
html[data-theme="dark"] .customer-v2-summary{
  background:var(--dm-border)!important;
  border-color:var(--dm-border)!important;
}
html[data-theme="dark"] .customer-v2-summary>div{background:var(--dm-surface-card)!important}
html[data-theme="dark"] .customer-v2-summary span{color:var(--dm-text-muted)!important}
html[data-theme="dark"] .customer-v2-summary b,
html[data-theme="dark"] .customer-v2-summary .customer-v2-code b{color:var(--dm-text-primary)!important}
html[data-theme="dark"] .customer-v2-summary .attention{background:#2a2419!important}
html[data-theme="dark"] .customer-v2-summary .attention b{color:var(--dm-amber)!important}
html[data-theme="dark"] .customer-v2-service-head{border-color:var(--dm-border)!important}
html[data-theme="dark"] .customer-v2-service-row{background:var(--dm-surface-card)!important;border-color:var(--dm-border)!important;color:var(--dm-text-secondary)!important}
html[data-theme="dark"] .customer-v2-service-row:hover{background:var(--dm-surface-hover)!important}
html[data-theme="dark"] .customer-v2-service-main b{color:var(--dm-text-primary)!important}
html[data-theme="dark"] .customer-v2-service-main small,
html[data-theme="dark"] .customer-v2-service-state small{color:var(--dm-text-muted)!important}
html[data-theme="dark"] .customer-v2-service-state b{color:var(--dm-text-secondary)!important}

/* Contract / commercial controls */
html[data-theme="dark"] .currency-switch,
html[data-theme="dark"] .report-tabs{background:var(--dm-surface-section)!important;border-color:var(--dm-border)!important}
html[data-theme="dark"] .currency-chip,
html[data-theme="dark"] .report-tabs button{color:var(--dm-text-muted)!important}
html[data-theme="dark"] .currency-chip:hover,
html[data-theme="dark"] .report-tabs button:hover{background:var(--dm-surface-elevated)!important;color:var(--dm-text-primary)!important}
html[data-theme="dark"] .currency-chip.active,
html[data-theme="dark"] .report-tabs button.active{background:#5264d9!important;color:#fff!important}
html[data-theme="dark"] .danger-ghost{
  background:#2e1b21!important;
  border-color:#60303a!important;
  color:#ff929e!important;
}
html[data-theme="dark"] .danger-ghost:hover{background:#3a2028!important;border-color:#7a3a47!important}

/* Pilot Control Center: restore readable typography and remove bright seams */
html[data-theme="dark"] .pilot-status-card,
html[data-theme="dark"] .pilot-card,
html[data-theme="dark"] .pilot-kpi,
html[data-theme="dark"] .pilot-backup-box,
html[data-theme="dark"] .pilot-quarter-box{
  background:var(--dm-surface-card)!important;
  border-color:var(--dm-border)!important;
  color:var(--dm-text-primary)!important;
}
html[data-theme="dark"] .pilot-kpis{background:var(--dm-border)!important;border-color:var(--dm-border)!important}
html[data-theme="dark"] .pilot-status-copy h3,
html[data-theme="dark"] .pilot-kpi b,
html[data-theme="dark"] .pilot-mini-row b,
html[data-theme="dark"] .pilot-backup-box b,
html[data-theme="dark"] .pilot-quarter-meta b,
html[data-theme="dark"] .pilot-quarter-head b,
html[data-theme="dark"] .pilot-quarter-metrics b{color:var(--dm-text-primary)!important}
html[data-theme="dark"] .pilot-status-copy p,
html[data-theme="dark"] .pilot-kpi small,
html[data-theme="dark"] .pilot-mini-row small,
html[data-theme="dark"] .pilot-backup-box small,
html[data-theme="dark"] .pilot-quarter-meta small,
html[data-theme="dark"] .pilot-quarter-head small,
html[data-theme="dark"] .pilot-quarter-metrics span{color:var(--dm-text-muted)!important}
html[data-theme="dark"] .pilot-status-copy span,
html[data-theme="dark"] .pilot-kpi span,
html[data-theme="dark"] .pilot-section-head span,
html[data-theme="dark"] .pilot-backup-box span{color:#96a2b3!important}
html[data-theme="dark"] .pilot-status-badge.ok{background:#173126!important;color:#7de0ae!important}
html[data-theme="dark"] .pilot-status-badge.warn{background:#302719!important;color:#efc575!important}
html[data-theme="dark"] .pilot-mini-row,
html[data-theme="dark"] .pilot-quarter-metrics>div{border-color:var(--dm-border)!important}
html[data-theme="dark"] .pilot-backup-box,
html[data-theme="dark"] .pilot-quarter-box{background:var(--dm-surface-section)!important}
html[data-theme="dark"] .pilot-retention-line span{background:var(--dm-surface-elevated)!important;color:var(--dm-text-secondary)!important}

/* Generic light islands found during acceptance */
html[data-theme="dark"] .info-grid>div,
html[data-theme="dark"] .report-metrics>div,
html[data-theme="dark"] .picker-selection,
html[data-theme="dark"] .device-match-preview,
html[data-theme="dark"] .revision-reason,
html[data-theme="dark"] .revision-changes>div,
html[data-theme="dark"] .job-problem,
html[data-theme="dark"] .part-input-row{
  background:var(--dm-surface-elevated)!important;
  border-color:var(--dm-border)!important;
  color:var(--dm-text-secondary)!important;
}

/* Multi-company workspace switcher */
html[data-theme="dark"] .company-switcher-btn{
  background:var(--dm-surface-card)!important;
  border-color:var(--dm-border)!important;
  color:var(--dm-text-secondary)!important;
}

html[data-theme="dark"] .company-switcher-btn:hover{
  background:var(--dm-surface-hover)!important;
  border-color:var(--dm-border-strong)!important;
  color:var(--dm-text-primary)!important;
}

html[data-theme="dark"] .company-switcher-menu{
  background:var(--dm-surface-card)!important;
  border-color:var(--dm-border)!important;
  color:var(--dm-text-primary)!important;
  box-shadow:0 18px 44px rgba(0,0,0,.34)!important;
}

html[data-theme="dark"] .company-switcher-label{
  color:var(--dm-text-muted)!important;
}

html[data-theme="dark"] .company-switcher-option{
  background:transparent!important;
  color:var(--dm-text-secondary)!important;
}

html[data-theme="dark"] .company-switcher-option b{
  color:var(--dm-text-primary)!important;
}

html[data-theme="dark"] .company-switcher-option small{
  color:var(--dm-text-muted)!important;
}

html[data-theme="dark"] .company-switcher-option:hover{
  background:var(--dm-surface-hover)!important;
  color:#fff!important;
}

html[data-theme="dark"] .company-switcher-option.active{
  background:#22304a!important;
  color:#dce5ff!important;
}

html[data-theme="dark"] .company-switcher-option.active b{
  color:#f3f6ff!important;
}

html[data-theme="dark"] .company-switcher-check{
  color:#9fb3ff!important;
}
