/* CommercialOS V7.3.5 — Contrast / Visibility / Dark Surface Audit
   IMPORTANT: targets the CURRENT Command Center (.cos-*) markup used by the dashboard.
   Loaded last so legacy light-theme declarations cannot win the cascade.
*/
:root{
  --cos75-bg:#07111f;
  --cos75-surface:#0d1a2b;
  --cos75-surface2:#101f33;
  --cos75-surface3:#13263d;
  --cos75-border:#2f5278;
  --cos75-border-soft:#25415f;
  --cos75-text:#f5f9ff;
  --cos75-text2:#dbe7f5;
  --cos75-muted:#aebfd2;
  --cos75-blue:#69a7ff;
}

/* ===== Command Center / Dashboard actually rendered by views/dashboard.php ===== */
.app .cos-home{color:var(--cos75-text)!important}
.app .cos-home-title h1{color:#f7fbff!important}
.app .cos-home-title h1 strong{color:#69a7ff!important}
.app .cos-home-title p,.app .cos-home-title p strong{color:#aebfd2!important}
.app .cos-kicker{color:#69a7ff!important}
.app .cos-ghost-btn{background:#101f33!important;color:#e6eef8!important;border:1px solid #385b7d!important}
.app .cos-ghost-btn:hover{background:#162a43!important;color:#fff!important;border-color:#5a88b5!important}
.app .cos-period-form select,.app .cos-period-form input{background:#0a1728!important;color:#eef5fd!important;border-color:#385675!important}

.app .cos-kpi{
  background:linear-gradient(145deg,#101f33,#0c1a2b)!important;
  color:#eef5fd!important;
  border:1px solid #2f5278!important;
  box-shadow:0 12px 30px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.025)!important;
}
.app .cos-kpi:hover{background:#13263d!important;border-color:#4a78a8!important;box-shadow:0 14px 34px rgba(0,0,0,.24)!important}
.app .cos-kpi small{color:#c0cede!important}
.app .cos-kpi em{color:#9fb3ca!important}
.app .cos-kpi strong{color:#f7fbff!important}
.app .cos-kpi-delta{color:#69d391!important}
.app .cos-kpi-delta.down{color:#ff8585!important}
.app .cos-kpi-delta.neutral{color:#b8c9dc!important}
.app .cos-kpi-icon.purple{background:#2b2350!important;color:#c7b7ff!important;border:1px solid #574b8d!important}
.app .cos-kpi-icon.green{background:#123c2b!important;color:#65e6a0!important;border:1px solid #26734e!important}
.app .cos-kpi-icon.amber{background:#493215!important;color:#ffd27a!important;border:1px solid #80612b!important}
.app .cos-kpi-icon.blue{background:#153458!important;color:#8fc3ff!important;border:1px solid #34679a!important}

.app .cos-panel,.app .cos-side-card{
  background:linear-gradient(145deg,#101f33,#0c1a2b)!important;
  color:#eef5fd!important;
  border:1px solid #2f5278!important;
  box-shadow:0 14px 35px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.025)!important;
}
.app .cos-panel-head h2{color:#f7fbff!important}
.app .cos-panel-head>a{color:#72adff!important}
.app .cos-panel-head h2 i{color:#fff!important}
.app .cos-action-row{border-top-color:#294662!important}
.app .cos-action-copy strong{color:#f1f6fc!important}
.app .cos-action-copy span{color:#a8b9cd!important}
.app .cos-action-value strong{color:#edf4fd!important}
.app .cos-action-value small{color:#ff9292!important}
.app .cos-action-row.medio .cos-action-value small{color:#79b7ff!important}
.app .cos-action-icon{background:#163052!important;color:#79b7ff!important}
.app .cos-action-row.alto .cos-action-icon{background:#453016!important;color:#ffd27a!important}
.app .cos-action-row.critico .cos-action-icon{background:#461d27!important;color:#ff9ca9!important}
.app .cos-action-btn{background:#17365d!important;color:#cfe4ff!important;border:1px solid #376da4!important}
.app .cos-action-btn:hover{background:#1c4675!important;color:#fff!important}
.app .cos-more{color:#9fb3ca!important}

.app .cos-empty{color:#f1f6fc!important}
.app .cos-empty>span{background:#123c2b!important;color:#65e6a0!important;border:1px solid #26734e!important}
.app .cos-empty strong{color:#f7fbff!important}
.app .cos-empty p{color:#b8c9dc!important}

.app .cos-small-empty{color:#aebfd2!important}
.app .cos-commit time{color:#dbe7f5!important}
.app .cos-commit strong{color:#f0f5fb!important}
.app .cos-commit small{color:#9fb3ca!important}
.app .cos-commit>b{color:#9fb3ca!important}
.app .cos-timeline:before{background:#294662!important}
.app .cos-commit-dot{background:#101f33!important;border-color:#7e95ae!important}
.app .cos-commit:nth-child(1) .cos-commit-dot{border-color:#69a7ff!important}
.app .cos-connection{border-top-color:#294662!important}
.app .cos-connection strong{color:#f0f5fb!important}
.app .cos-connection small{color:#9fb3ca!important}
.app .cos-connection-logo.whatsapp{background:#123c2b!important;color:#65e6a0!important}
.app .cos-connection-logo.mail{background:#17304d!important;color:#b9d5f5!important}
.app .cos-connection i.neutral{background:#7e95ae!important}
.app .cos-connection i.online{box-shadow:0 0 0 3px #173b2d!important}

/* Focus card and lower Command Center cards */
.app .cos-focus-card{background:linear-gradient(145deg,#0d192b,#162944)!important;border:1px solid #315779!important;color:#f7fbff!important}
.app .cos-focus-card strong{color:#f7fbff!important}
.app .cos-focus-card small{color:#b8c9dc!important}
.app .cos-focus-card .cos-kicker{color:#77b4f5!important}
.app .cos-quick-summary>div,.app .cos-secondary-grid>div,.app .cos-opportunity-row,.app .cos-activity-row{
  background:#101f33!important;color:#edf4fd!important;border-color:#2f5278!important;
}
.app .cos-opportunity-row strong,.app .cos-activity-row strong{color:#f4f8ff!important}
.app .cos-opportunity-row small,.app .cos-activity-row small{color:#b8c9dc!important}
.app .cos-opportunity-row .cos-stage{color:#b9cbe0!important}
.app .cos-opportunity-row .cos-value{color:#f0f6fd!important}

/* ===== Analytics currently appended to dashboard and previously left white ===== */
.app .cos-legacy-analytics{color:#eef5fd!important}
.app .cos-analytics-head h2{color:#f7fbff!important}
.app .cos-analytics-head p{color:#aebfd2!important}
.app .cos-analysis-grid{color:#eef5fd!important}
.app .cos-analysis-card,.app .cos-analysis-details{
  background:linear-gradient(145deg,#101f33,#0c1a2b)!important;
  color:#eef5fd!important;
  border:1px solid #2f5278!important;
  box-shadow:0 12px 30px rgba(0,0,0,.17)!important;
}
.app .cos-analysis-card h3{color:#f7fbff!important}
.app .cos-analysis-card p{color:#b8c9dc!important}
.app .cos-analysis-card a{color:#72adff!important}
.app .cos-scenario-mini div{background:#13263d!important;border-color:#2f5278!important;color:#edf4fd!important}
.app .cos-scenario-mini small{color:#b8c9dc!important}
.app .cos-scenario-mini strong{color:#f7fbff!important}
.app .cos-analysis-details>summary{color:#f0f6fd!important}
.app .cos-analysis-row{color:#e2ebf6!important;border-bottom-color:#294662!important}
.app .cos-analysis-row.head{color:#b8c9dc!important}
.app .cos-analysis-person{border-bottom-color:#294662!important}
.app .cos-analysis-person strong{color:#f4f8ff!important}
.app .cos-analysis-person small{color:#b8c9dc!important}
.app .cos-team-mini div{background:#13263d!important;border-color:#2f5278!important}
.app .cos-team-mini strong{color:#f4f8ff!important}
.app .cos-team-mini small{color:#b8c9dc!important}
.app .cos-chart-wrap{background:linear-gradient(180deg,#0f1f32,#0b192a)!important;border:1px solid #2f5278!important}

/* Legacy drawer must also match the new shell */
.app .cos-legacy-drawer{background:linear-gradient(145deg,#101f33,#0b1829)!important;color:#eef5fd!important;border-color:#365574!important;box-shadow:0 25px 70px rgba(0,0,0,.48)!important}
.app .cos-legacy-head{border-bottom-color:#294662!important}
.app .cos-legacy-head strong{color:#f7fbff!important}
.app .cos-legacy-head small,.app .cos-legacy-foot span{color:#b8c9dc!important}
.app .cos-legacy-head button{background:#17304d!important;color:#e7f0fa!important}
.app .cos-legacy-grid a{color:#dbe7f5!important}
.app .cos-legacy-grid a:hover{background:#162a43!important;color:#fff!important}
.app .cos-legacy-foot{border-top-color:#294662!important}

/* ===== Global light-surface traps ===== */
.app .field-help{color:#aebfd2!important}
.app .help-category,.app .help-form,.app .help-card{color:#eef5fd!important}
.app .help-category details{color:#dbe7f5!important}
.app .help-category details summary{color:#eaf2fb!important}
.app .help-category details p{color:#aebfd2!important}
.app .help-form input,.app .help-form textarea{background:#0a1728!important;color:#eef5fd!important;border-color:#385675!important}
.app .help-form input::placeholder,.app .help-form textarea::placeholder{color:#8fa5bd!important}

/* Any remaining explicit light card inside the application gets a dark surface,
   while preserving semantic status colors and primary buttons. */
.app .card:not(.document-preview),.app .panel,.app .box{
  background:linear-gradient(145deg,#101f33,#0c1a2b)!important;
  color:#edf4fd!important;
  border-color:#2f5278!important;
}
.app .card h1,.app .card h2,.app .card h3,.app .card h4,.app .card h5,.app .card h6,
.app .panel h1,.app .panel h2,.app .panel h3,.app .panel h4,.app .box h1,.app .box h2,.app .box h3{color:#f7fbff!important}
.app .card p,.app .card li,.app .card small,.app .panel p,.app .panel small,.app .box p,.app .box small{color:#b8c9dc!important}

/* Explicitly neutralize the most common old light-theme foregrounds. */
.app [style*="color:#172033"],.app [style*="color: #172033"],
.app [style*="color:#1b2638"],.app [style*="color: #1b2638"],
.app [style*="color:#334155"],.app [style*="color: #334155"],
.app [style*="color:#475569"],.app [style*="color: #475569"],
.app [style*="color:#64748b"],.app [style*="color: #64748b"]{color:#b8c9dc!important}

/* Buttons/links remain visually actionable */
.app a:not(.cos-kpi):not(.menu-item){text-decoration-color:transparent}
.app a:focus-visible,.app button:focus-visible,.app input:focus-visible,.app select:focus-visible,.app textarea:focus-visible,.app summary:focus-visible{
  outline:3px solid #67a9ff!important;outline-offset:2px;
}

@media(max-width:760px){
  .app .cos-home-title h1{font-size:27px!important}
  .app .cos-kpi{padding:14px 12px!important}
}
@media(max-width:480px){
  .app .cos-home-title p{font-size:12px!important}
}
