/* RCB2 Flow — Premium UI 2026
   Camada visual não destrutiva: preserva estrutura, IDs, eventos e contratos do frontend. */
:root{
  --pf-bg:#f4f7fb;--pf-bg-2:#eef3f8;--pf-surface:#ffffff;--pf-surface-2:#f8fafc;
  --pf-ink:#102033;--pf-muted:#627286;--pf-soft:#8c9aab;--pf-line:#dfe7ef;
  --pf-navy:#0b1730;--pf-navy-2:#102342;--pf-blue:#2f7cf6;--pf-blue-2:#1f65d6;
  --pf-mint:#35c6b6;--pf-mint-soft:#e7f8f5;--pf-blue-soft:#eaf2ff;
  --pf-danger:#c94157;--pf-warning:#b87813;--pf-success:#16866f;
  --pf-shadow:0 16px 44px rgba(15,32,51,.08);--pf-shadow-lg:0 26px 80px rgba(15,32,51,.13);
  --pf-radius:20px;--pf-radius-sm:14px;--pf-font:"Inter","Segoe UI",Arial,sans-serif;
}
html[data-theme="dark"]{
  --pf-bg:#07101f;--pf-bg-2:#0a1425;--pf-surface:#0f1b2e;--pf-surface-2:#142238;
  --pf-ink:#f3f7fb;--pf-muted:#a9b7c8;--pf-soft:#7f8fa3;--pf-line:#26364c;
  --pf-navy:#050b17;--pf-navy-2:#091426;--pf-blue:#6a9cf9;--pf-blue-2:#79a7ff;
  --pf-mint:#51d7c7;--pf-mint-soft:#0e2a2a;--pf-blue-soft:#102645;
  --pf-shadow:0 16px 44px rgba(0,0,0,.22);--pf-shadow-lg:0 26px 80px rgba(0,0,0,.34);
}
html,body{font-family:var(--pf-font)!important;background:var(--pf-bg)!important;color:var(--pf-ink)!important}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
h1,h2,h3,h4,h5,h6{color:var(--pf-ink);letter-spacing:-.035em;font-weight:800}
p{color:var(--pf-muted)}
a,button,input,select,textarea{font:inherit}
a{transition:color .18s ease,background .18s ease,border-color .18s ease,transform .18s ease}
button,.btn,[class*="btn-"]{transition:transform .18s ease,box-shadow .18s ease,background .18s ease,border-color .18s ease}
button:hover,.btn:hover,[class*="btn-"]:hover{transform:translateY(-1px)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid rgba(47,124,246,.22)!important;outline-offset:2px}
::selection{background:rgba(47,124,246,.18);color:var(--pf-ink)}

/* App shell */
.app{background:var(--pf-bg)!important}
.sidebar{
  width:258px!important;padding:24px 18px!important;background:
  radial-gradient(circle at 15% 0%,rgba(53,198,182,.13),transparent 30%),
  linear-gradient(180deg,var(--pf-navy),#081327 68%,#07101f)!important;
  border-right:1px solid rgba(255,255,255,.06);box-shadow:18px 0 48px rgba(9,23,48,.08);
}
.sidebar .brand{
  min-height:auto!important;margin:0 0 28px!important;padding:8px 10px 18px!important;
  gap:0!important;border-bottom:1px solid rgba(255,255,255,.08);color:#fff!important;
}
.sidebar .brand img{width:168px!important;max-height:58px!important;filter:brightness(0) invert(1);opacity:.98}
.sidebar .brand>span{display:none}
.menu{display:flex;flex-direction:column;gap:4px}
.menu a{
  position:relative;min-height:46px!important;margin:0!important;padding:12px 14px 12px 16px!important;
  border-radius:13px!important;color:#aebbd0!important;font-size:14px;font-weight:650;letter-spacing:-.01em;
}
.menu a:hover{background:rgba(255,255,255,.07)!important;color:#fff!important;transform:translateX(2px)}
.menu a.active{
  background:linear-gradient(135deg,rgba(47,124,246,.95),rgba(53,198,182,.74))!important;
  color:#fff!important;box-shadow:0 12px 28px rgba(47,124,246,.22);
}
.menu a.active:before{content:"";position:absolute;left:-7px;top:12px;bottom:12px;width:3px;border-radius:9px;background:#fff}
.main{margin-left:258px!important;width:calc(100% - 258px)!important;padding:30px clamp(22px,3vw,46px) 50px!important;background:var(--pf-bg)!important}
.mobilebar{
  border:1px solid var(--pf-line)!important;background:var(--pf-surface)!important;color:var(--pf-ink)!important;
  box-shadow:var(--pf-shadow);border-radius:13px!important;font-weight:750!important
}

/* Typography and page headers */
.main h1{font-size:clamp(2rem,2.8vw,3.15rem);line-height:1.05;margin-bottom:10px}
.main h2{font-size:clamp(1.35rem,2vw,2rem)}
.main h3{font-size:1.05rem}
.top,.page-header,.hero-dashboard,.clientes-hero,.hero-panel{
  border:1px solid var(--pf-line)!important;border-radius:24px!important;background:
  radial-gradient(circle at 95% 5%,rgba(53,198,182,.11),transparent 28%),
  linear-gradient(135deg,var(--pf-surface),var(--pf-surface-2))!important;
  box-shadow:var(--pf-shadow)!important;color:var(--pf-ink)!important;
}
.hero-dashboard,.clientes-hero,.hero-panel,.page-header{padding:28px!important;margin-bottom:22px!important}
.hero-dashboard p,.clientes-hero p,.hero-panel p,.page-header p{max-width:820px;color:var(--pf-muted)!important;line-height:1.65}
.eyebrow,.ai-badge,[class*="kicker"],[class*="overline"]{
  color:var(--pf-blue)!important;font-size:11px!important;text-transform:uppercase;letter-spacing:.14em!important;font-weight:800!important
}

/* Cards */
.card,.panel,.box,.support-card,.chart-card,.metric-card,.method-card,.modal-content,.table-wrap,.filters,.dashboard-controls{
  background:var(--pf-surface)!important;border:1px solid var(--pf-line)!important;border-radius:var(--pf-radius)!important;
  box-shadow:var(--pf-shadow)!important;color:var(--pf-ink)!important;
}
.card,.panel,.support-card,.chart-card{padding:22px!important}
.card:hover,.metric-card:hover{box-shadow:0 20px 55px rgba(15,32,51,.10)!important}
.kpi-grid,.grid{gap:16px!important}
.metric-card,.kpi{
  position:relative;overflow:hidden;padding:22px!important;min-height:130px;
}
.metric-card:before,.kpi:before{
  content:"";position:absolute;inset:0 auto 0 0;width:4px;background:linear-gradient(var(--pf-blue),var(--pf-mint));
}
.metric-card span,.kpi span{color:var(--pf-muted)!important;font-size:12px;font-weight:750;text-transform:uppercase;letter-spacing:.07em}
.metric-card strong,.kpi b{display:block;margin:9px 0 4px;color:var(--pf-ink)!important;font-size:clamp(1.65rem,2.5vw,2.35rem)!important;letter-spacing:-.045em}
.metric-card small,.kpi small{color:var(--pf-muted)!important}
.decision-grid article{
  border:1px solid var(--pf-line)!important;background:var(--pf-surface-2)!important;border-radius:16px!important;padding:18px!important
}
.decision-grid article strong{color:var(--pf-ink)!important}

/* Forms */
input,select,textarea{
  min-height:44px;border:1px solid var(--pf-line)!important;border-radius:12px!important;
  background:var(--pf-surface)!important;color:var(--pf-ink)!important;padding:11px 13px!important;
  box-shadow:0 1px 1px rgba(15,32,51,.02);transition:border-color .18s,box-shadow .18s,background .18s
}
textarea{min-height:110px}
input:hover,select:hover,textarea:hover{border-color:#bccada!important}
input:focus,select:focus,textarea:focus{border-color:var(--pf-blue)!important;box-shadow:0 0 0 4px rgba(47,124,246,.09)!important}
input::placeholder,textarea::placeholder{color:#93a1b2!important}
label{color:var(--pf-ink)!important;font-size:12px;font-weight:750;letter-spacing:.01em}
.filters,.dashboard-controls{padding:16px!important;gap:12px!important}
.filter-field{gap:7px!important}
button,.btn,.btn-primary{
  min-height:43px!important;padding:10px 16px!important;border-radius:12px!important;border:1px solid transparent!important;
  background:linear-gradient(135deg,var(--pf-blue),#377fe6)!important;color:#fff!important;font-weight:750!important;
  box-shadow:0 8px 20px rgba(47,124,246,.16)
}
button:hover,.btn:hover,.btn-primary:hover{box-shadow:0 12px 28px rgba(47,124,246,.22)}
.btn.secondary,.secondary,[class*="btn-secondary"]{
  background:var(--pf-surface-2)!important;color:var(--pf-ink)!important;border-color:var(--pf-line)!important;box-shadow:none!important
}
button.danger,.btn-danger{background:#fff0f2!important;color:var(--pf-danger)!important;border-color:#f3c9d0!important;box-shadow:none!important}

/* Tables */
.table-wrap{overflow:auto!important;padding:4px!important}
table{border-collapse:separate!important;border-spacing:0!important;background:transparent!important}
th,td{padding:13px 14px!important;border-bottom:1px solid var(--pf-line)!important;color:var(--pf-ink)!important;font-size:13px!important}
th{
  position:sticky;top:0;z-index:1;background:var(--pf-surface-2)!important;color:var(--pf-muted)!important;
  font-size:11px!important;text-transform:uppercase;letter-spacing:.07em;font-weight:800!important
}
tbody tr{transition:background .16s ease}
tbody tr:hover td{background:rgba(47,124,246,.035)!important}
tbody tr:last-child td{border-bottom:0!important}

/* Badges */
.badge,[class*="badge"],[class*="pill"],[class*="chip"]{border-radius:999px!important}
.badge{background:var(--pf-blue-soft)!important;color:var(--pf-blue-2)!important;font-weight:750!important}
.badge.ok,.ok{background:#e8f7f2!important;color:var(--pf-success)!important}
.badge.danger,.danger{background:#fff0f2!important;color:var(--pf-danger)!important}

/* Charts and analytics */
.chart-wrap,.chart,.display-graphic{border-radius:16px}
.chart-card canvas{max-width:100%}
.chart-tabs{display:flex;gap:6px;flex-wrap:wrap;padding:5px;background:var(--pf-surface-2);border:1px solid var(--pf-line);border-radius:14px}
.chart-tabs .tab-btn{background:transparent!important;color:var(--pf-muted)!important;box-shadow:none!important;border:0!important}
.chart-tabs .tab-btn.active{background:var(--pf-surface)!important;color:var(--pf-blue)!important;box-shadow:0 4px 16px rgba(15,32,51,.07)!important}
.chart-note{color:var(--pf-muted)!important}
.alert-item{border-bottom:1px solid var(--pf-line)!important;padding:14px 0!important}
.alert-item b{color:var(--pf-blue)!important}

/* Session / scope */
.session-badge,.dashboard-scope-pill,.scope-chip{
  background:var(--pf-surface)!important;border-color:var(--pf-line)!important;box-shadow:0 8px 24px rgba(15,32,51,.05)!important
}
.session-avatar{background:linear-gradient(135deg,var(--pf-blue),var(--pf-mint))!important}
.session-label,.session-info small,.dashboard-scope-pill span{color:var(--pf-muted)!important}
.session-info strong,.dashboard-scope-pill strong{color:var(--pf-ink)!important}

/* Modals */
.modal{backdrop-filter:blur(8px);background:rgba(5,15,31,.42)!important}
.modal-content{box-shadow:var(--pf-shadow-lg)!important}
dialog{border:1px solid var(--pf-line)!important;border-radius:22px!important;background:var(--pf-surface)!important;color:var(--pf-ink)!important;box-shadow:var(--pf-shadow-lg)!important}

/* Login */
.login{
  min-height:100vh!important;display:grid!important;place-items:center!important;padding:36px 20px!important;
  background:
    radial-gradient(circle at 18% 18%,rgba(53,198,182,.18),transparent 31%),
    radial-gradient(circle at 82% 10%,rgba(47,124,246,.17),transparent 31%),
    linear-gradient(150deg,#f6f9fc,#edf3f8)!important;
}
html[data-theme="dark"] .login{background:radial-gradient(circle at 18% 18%,rgba(53,198,182,.11),transparent 31%),linear-gradient(150deg,#07101f,#0b1527)!important}
.login .box{
  width:min(100%,470px)!important;padding:38px!important;border-radius:28px!important;
  background:rgba(255,255,255,.93)!important;backdrop-filter:blur(18px);box-shadow:0 35px 90px rgba(15,32,51,.15)!important
}
html[data-theme="dark"] .login .box{background:rgba(15,27,46,.93)!important}
.login .box>img{width:min(250px,72%)!important;margin:0 auto 28px!important}
.login h1{font-size:clamp(1.85rem,4vw,2.5rem)!important;text-align:center;margin-bottom:10px!important}
.login .box>p{text-align:center!important;line-height:1.65!important;color:var(--pf-muted)!important;margin-bottom:28px!important}
.login form{display:grid;gap:12px}
.login input,.login select{width:100%!important;min-height:50px!important}
.login button{width:100%!important;min-height:50px!important;margin-top:4px!important}
.login .box>a{display:block;text-align:center;margin-top:22px;color:var(--pf-blue)!important;font-weight:700;text-decoration:none}

/* Landing page refinements */
.site-header{background:rgba(11,23,48,.92)!important;border-bottom:1px solid rgba(255,255,255,.08)!important;backdrop-filter:blur(18px)}
.site-header .brand img,.footer .brand img{filter:brightness(0) invert(1);width:170px!important;max-height:55px!important}
.hero{background:
  radial-gradient(circle at 75% 10%,rgba(53,198,182,.17),transparent 30%),
  radial-gradient(circle at 20% 0%,rgba(47,124,246,.18),transparent 34%),
  linear-gradient(145deg,#08152b,#0c1e3a 68%,#0b2740)!important}
.hero h1{letter-spacing:-.065em!important}
.hero h1 em{color:#77ded2!important}
.button{background:linear-gradient(135deg,#6de1d5,#4abac4)!important;color:#092038!important;border-radius:12px!important;box-shadow:0 12px 32px rgba(53,198,182,.2)!important}
.button-outline{border-radius:12px!important}
.product-window{border-color:rgba(113,220,227,.38)!important;box-shadow:0 40px 100px rgba(0,0,0,.34)!important}
.pain-grid article,.feature-card,.role-grid article,.price-card{border-radius:18px!important;overflow:hidden}
.feature-card{border-color:rgba(255,255,255,.12)!important}
.solution{background:linear-gradient(145deg,#0b1d37,#0d2a45)!important}
.showcase-display{background:linear-gradient(145deg,#0b1730,#103553)!important}
.contact{background:linear-gradient(145deg,#08152b,#0c2943)!important}
.footer{background:#061224!important}
.footer-main{border-bottom-color:rgba(255,255,255,.08)!important}

/* Mobile app landing */
.site-head .brand img{width:42px!important;height:42px!important;filter:none!important}
.site-head{backdrop-filter:blur(16px)}

/* Theme toggle */
.rcb2-theme-toggle{
  width:42px!important;height:42px!important;background:var(--pf-surface)!important;color:var(--pf-ink)!important;
  border:1px solid var(--pf-line)!important;box-shadow:var(--pf-shadow)!important
}

/* Responsive */
@media(max-width:1100px){
  .main{padding-inline:24px!important}
}
@media(max-width:900px){
  .sidebar{width:min(84vw,310px)!important;z-index:2147482100!important}
  .main{margin-left:0!important;width:100%!important;padding:88px 18px 34px!important}
  body:not(.rcb2-mobile-ui) .main{padding-top:24px!important}
  .grid,.grid-2,.dashboard-grid,.kpi-grid,.decision-grid{grid-template-columns:1fr!important}
  .card,.panel,.chart-card{padding:18px!important}
  .hero-dashboard,.clientes-hero,.hero-panel,.page-header{padding:22px!important}
  .session-badge{margin-right:0!important}
}
@media(max-width:600px){
  :root{--pf-radius:17px}
  .main{padding-inline:14px!important}
  .card,.panel,.chart-card,.support-card{padding:16px!important}
  .hero-dashboard,.clientes-hero,.hero-panel,.page-header{border-radius:20px!important;padding:19px!important}
  .main h1{font-size:1.9rem!important}
  .filters,.dashboard-controls{display:grid!important;grid-template-columns:1fr!important}
  .filters>*,.dashboard-controls>*{width:100%!important}
  .table-wrap{border-radius:16px!important}
  .login{padding:18px 12px!important}
  .login .box{padding:26px 20px!important;border-radius:22px!important}
  .sidebar .brand img{width:152px!important}
}
@media(prefers-reduced-motion:reduce){
  *,*:before,*:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}
}
/* Owner validation mode */
.owner-validation-card{display:flex;align-items:center;justify-content:space-between;gap:28px;margin-bottom:22px!important;background:linear-gradient(135deg,var(--pf-surface),var(--pf-blue-soft))!important}
.owner-validation-card>div{max-width:820px}.owner-validation-card h2{margin:4px 0 8px}.owner-validation-card p{margin:0;line-height:1.65}.owner-validation-card button{flex:none}
.rcb2-validation-banner{position:fixed;z-index:2147483000;left:278px;right:18px;bottom:18px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:13px 14px 13px 18px;border:1px solid rgba(47,124,246,.22);border-radius:18px;background:rgba(255,255,255,.95);backdrop-filter:blur(18px);box-shadow:0 20px 55px rgba(15,32,51,.16);color:var(--pf-ink)}
html[data-theme="dark"] .rcb2-validation-banner{background:rgba(15,27,46,.96)}
.rcb2-validation-banner div{display:flex;flex-direction:column;gap:2px;min-width:0}.rcb2-validation-banner strong{color:var(--pf-ink);font-size:13px}.rcb2-validation-banner span{color:var(--pf-muted);font-size:12px}.rcb2-validation-banner button{min-height:38px!important;white-space:nowrap}
body.rcb2-validation-active .main{padding-bottom:104px!important}
@media(max-width:900px){.owner-validation-card{align-items:stretch;flex-direction:column}.owner-validation-card button{width:100%}.rcb2-validation-banner{left:14px;right:14px;bottom:14px;align-items:stretch;flex-direction:column}.rcb2-validation-banner button{width:100%}body.rcb2-validation-active .main{padding-bottom:170px!important}}
/* Mobile validation banner placement */
@media(max-width:900px){
  body.rcb2-mobile-ui.rcb2-validation-active .rcb2-validation-banner{
    bottom:calc(82px + env(safe-area-inset-bottom))!important;
    left:12px!important;
    right:12px!important;
  }
  body.rcb2-mobile-ui.rcb2-validation-active .main{
    padding-bottom:calc(250px + env(safe-area-inset-bottom))!important;
  }
}

/* =========================================================
   RCB2 Flow — Legibilidade e contraste AA (desktop + app)
   ========================================================= */
:root{
  --pf-bg:#f4f7fb;
  --pf-bg-2:#eef3f8;
  --pf-surface:#ffffff;
  --pf-surface-2:#f8fafc;
  --pf-ink:#0f172a;
  --pf-muted:#475569;
  --pf-soft:#64748b;
  --pf-line:#d9e2ec;
}
html[data-theme="dark"]{
  --pf-bg:#08111f;
  --pf-bg-2:#0a1425;
  --pf-surface:#0f1b2e;
  --pf-surface-2:#142238;
  --pf-ink:#f3f7fb;
  --pf-muted:#c4d0df;
  --pf-soft:#9fb0c4;
  --pf-line:#2b3b52;
}

/* Marca da navegação escura */
.sidebar .brand{
  min-height:72px!important;
  padding:10px 8px 18px!important;
  margin:0 0 24px!important;
  border-bottom:1px solid rgba(255,255,255,.10)!important;
  overflow:visible!important;
}
.sidebar .brand img{
  content:url('/assets/rcb2-flow-logo-light-2026.svg?v=20260917-contrast-1')!important;
  width:184px!important;
  height:auto!important;
  max-width:100%!important;
  max-height:66px!important;
  object-fit:contain!important;
  filter:none!important;
  opacity:1!important;
}
.sidebar .menu a{
  color:#d8e3f0!important;
  opacity:1!important;
  font-weight:700!important;
}
.sidebar .menu a:hover{
  color:#fff!important;
  background:rgba(255,255,255,.08)!important;
}
.sidebar .menu a.active{
  color:#fff!important;
  background:linear-gradient(135deg,#2f7cf6,#2baea4)!important;
}

/* Texto geral */
.main,.main p,.main span,.main small,.main label,.card,.panel,.table-wrap{
  opacity:1!important;
}
.main h1,.main h2,.main h3,.main h4,.main h5,.main h6,
.card h1,.card h2,.card h3,.card h4,.card strong,
.panel h1,.panel h2,.panel h3,.panel strong{
  color:var(--pf-ink)!important;
}
.main p,.card p,.panel p,.chart-note,.filter-field label,
.session-label,.session-info small,.dashboard-scope-pill span,
.metric-card small,.kpi small,.muted,.description,.subtitle{
  color:var(--pf-muted)!important;
  opacity:1!important;
}
.main small,.card small,.panel small,.metric-card span,.kpi span{
  color:var(--pf-soft)!important;
  opacity:1!important;
}

/* Superfícies */
.card,.panel,.metric-card,.chart-card,.dashboard-controls,.table-wrap,.method-card{
  background:var(--pf-surface)!important;
  border-color:var(--pf-line)!important;
}
.hero-dashboard,.page-header,.hero-panel,.clientes-hero{
  background:
    radial-gradient(circle at 96% 6%,rgba(53,198,182,.10),transparent 28%),
    linear-gradient(135deg,#ffffff,#f6fafc)!important;
  color:var(--pf-ink)!important;
}
.hero-dashboard h1,.hero-dashboard h2,.page-header h1,.page-header h2,
.hero-panel h1,.hero-panel h2,.clientes-hero h1,.clientes-hero h2{
  color:#10213b!important;
}
.hero-dashboard p,.page-header p,.hero-panel p,.clientes-hero p{
  color:#53657b!important;
  opacity:1!important;
}

/* Copiloto: volta a ser uma área escura, com contraste correto */
.copilot-card{
  color:#eaf2fb!important;
  background:
    radial-gradient(circle at 88% 5%,rgba(53,198,182,.18),transparent 32%),
    linear-gradient(135deg,#0a1730,#10375a)!important;
  border:1px solid rgba(151,185,214,.28)!important;
  box-shadow:0 22px 55px rgba(10,23,48,.18)!important;
}
.copilot-card h2,.copilot-card h3,.copilot-card strong{
  color:#ffffff!important;
}
.copilot-card p,.copilot-card li,.copilot-card .chart-note{
  color:#d7e3ef!important;
  opacity:1!important;
}
.copilot-card .ai-badge{
  color:#dff7f4!important;
  background:rgba(53,198,182,.14)!important;
  border-color:rgba(85,221,205,.35)!important;
}
.copilot-card .decision-grid article{
  background:rgba(255,255,255,.07)!important;
  border-color:rgba(203,222,239,.18)!important;
}
.copilot-card .decision-grid span,
.copilot-card .decision-grid small{
  color:#c6d8e8!important;
  opacity:1!important;
}
.copilot-card .decision-grid strong{
  color:#fff!important;
}
.copilot-card .recommendation-list li{
  background:rgba(255,255,255,.07)!important;
}
.copilot-card .recommendation-list span{
  color:#8ec5ff!important;
}
.copilot-card .recommendation-list p{
  color:#d4e0eb!important;
}
.copilot-card .method-card{
  background:rgba(255,255,255,.07)!important;
  border-color:rgba(203,222,239,.18)!important;
}
.copilot-card .method-card strong{color:#fff!important}
.copilot-card .method-card p{color:#d4e0eb!important}
.copilot-card .method-card a{color:#8fc9ff!important}

/* KPIs */
.metric-card,.kpi{
  background:var(--pf-surface)!important;
  border:1px solid var(--pf-line)!important;
}
.metric-card span,.kpi span{
  color:#52637a!important;
  font-weight:800!important;
  opacity:1!important;
}
.metric-card strong,.kpi b{
  color:#10213b!important;
  font-weight:850!important;
}
.metric-card small,.kpi small{
  color:#5f6f84!important;
  opacity:1!important;
}

/* Tabelas e formulários */
th{color:#556579!important;background:#f7f9fc!important}
td{color:#1e293b!important}
input,select,textarea{
  color:#172033!important;
  background:#fff!important;
  border-color:#cfd9e4!important;
}
input::placeholder,textarea::placeholder{color:#7c8ba0!important;opacity:1!important}
label{color:#344256!important}

/* App/PWA */
@media(max-width:900px){
  .sidebar .brand img{width:174px!important;max-height:64px!important}
  .rcb2-mobile-header{
    background:rgba(8,24,46,.985)!important;
    color:#fff!important;
  }
  .rcb2-mobile-brand strong{color:#fff!important}
  .rcb2-mobile-brand small{color:#c7d5e5!important;opacity:1!important}
  .rcb2-mobile-nav{
    background:rgba(255,255,255,.985)!important;
    border-color:#cfd9e4!important;
  }
  .rcb2-mobile-nav a,.rcb2-mobile-nav button{
    color:#4d6078!important;
  }
  .rcb2-mobile-nav .active{
    color:#0b56b3!important;
    background:#e8f1fb!important;
  }
  body.rcb2-mobile-ui .main :is(.hero-dashboard,.clientes-hero,.hero-panel,.agenda-hero){
    background:linear-gradient(135deg,#0a2441,#0d4b72)!important;
    color:#fff!important;
  }
  body.rcb2-mobile-ui .main :is(.hero-dashboard,.clientes-hero,.hero-panel,.agenda-hero) :is(h1,h2,h3,p,.eyebrow,.agenda-eyebrow){
    color:#f7fbff!important;
    opacity:1!important;
  }
  body.rcb2-mobile-ui .main :is(.card,.dashboard-card,.metric-card,.metric,.agenda-card,.price-card){
    background:#fff!important;
    color:#172033!important;
    border-color:#d9e2ec!important;
  }
  body.rcb2-mobile-ui .main :is(.card,.dashboard-card,.metric-card,.metric,.agenda-card,.price-card) :is(p,small,label){
    color:#53657b!important;
    opacity:1!important;
  }
  body.rcb2-mobile-ui .copilot-card{
    background:linear-gradient(135deg,#0a1730,#10375a)!important;
    color:#eaf2fb!important;
  }
  body.rcb2-mobile-ui .copilot-card :is(h2,h3,strong){color:#fff!important}
  body.rcb2-mobile-ui .copilot-card :is(p,small,span,li){opacity:1!important}
}

/* =========================================================
   RCB2 Flow — DARK MODE SOURCE FIX 2026-09-18
   Autoritativo para desktop + PWA/app. Carregado por último.
   ========================================================= */
html[data-theme="dark"]{
  color-scheme:dark;
  --pf-bg:#08111f;
  --pf-bg-2:#0a1425;
  --pf-surface:#0f1b2e;
  --pf-surface-2:#142238;
  --pf-ink:#f3f7fb;
  --pf-muted:#c4d0df;
  --pf-soft:#9fb0c4;
  --pf-line:#2b3b52;
  --pf-blue:#6a9cf9;
  --pf-blue-2:#8ab2ff;
  --pf-mint:#51d7c7;
  --pf-blue-soft:#102645;
  --pf-mint-soft:#0e2a2a;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .app,
html[data-theme="dark"] .main,
html[data-theme="dark"] .dashboard-page,
html[data-theme="dark"] .agenda-page{
  background:#08111f!important;
  color:#f3f7fb!important;
}

/* Superfícies */
html[data-theme="dark"] :is(
  .card,.panel,.box,.support-card,.chart-card,.metric-card,.method-card,
  .table-wrap,.filters,.dashboard-controls,.agenda-card,.agenda-modal,
  .detail-card,.participant-pill,.history-box,.history-modal,
  .participant-checklist,.participant-check,.session-badge,
  .dashboard-scope-pill,.scope-chip,.owner-validation-card
){
  background:#0f1b2e!important;
  color:#f3f7fb!important;
  border-color:#2b3b52!important;
  box-shadow:0 16px 44px rgba(0,0,0,.24)!important;
}

/* Tipografia */
html[data-theme="dark"] :is(
  h1,h2,h3,h4,h5,h6,strong,b,
  .agenda-card h3,.agenda-modal h2,.detail-card strong,
  .participant-check b,.participant-pill b,.cal-day-title
){
  color:#f8fbff!important;
}
html[data-theme="dark"] :is(
  p,small,label,.muted,.description,.subtitle,.chart-note,
  .agenda-card p,.agenda-modal p,.detail-card p,.field small,
  .agenda-owner-field small,.modal-owner-field small,
  .session-label,.session-info small,.dashboard-scope-pill span
){
  color:#c4d0df!important;
  opacity:1!important;
}
html[data-theme="dark"] :is(.field span,.detail-card span,.agenda-eyebrow){
  color:#aebfd3!important;
  opacity:1!important;
}

/* Hero */
html[data-theme="dark"] :is(.hero-dashboard,.hero-panel,.clientes-hero,.page-header,.agenda-hero){
  background:
    radial-gradient(circle at 94% 6%,rgba(81,215,199,.11),transparent 28%),
    linear-gradient(135deg,#0c182c,#12253d)!important;
  border-color:#2b3b52!important;
  color:#f8fbff!important;
}
html[data-theme="dark"] :is(.hero-dashboard,.hero-panel,.clientes-hero,.page-header,.agenda-hero) :is(h1,h2,h3,p,.eyebrow,.agenda-eyebrow){
  color:#f8fbff!important;
  opacity:1!important;
}

/* Inputs */
html[data-theme="dark"] :is(
  input,select,textarea,
  .agenda-toolbar input,.agenda-toolbar select,
  .agenda-form input,.agenda-form select,.agenda-form textarea,
  .agenda-owner-field select,.modal-owner-field select
){
  background:#142238!important;
  color:#f3f7fb!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] :is(input,textarea)::placeholder{
  color:#91a3b8!important;
  opacity:1!important;
}
html[data-theme="dark"] :is(input,select,textarea):focus{
  border-color:#6a9cf9!important;
  box-shadow:0 0 0 4px rgba(106,156,249,.14)!important;
}
html[data-theme="dark"] select option{
  background:#142238!important;
  color:#f3f7fb!important;
}

/* Agenda toolbar / tabs */
html[data-theme="dark"] .view-tabs{
  background:#0f1b2e!important;
  border-color:#31445e!important;
  box-shadow:0 10px 24px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] .view-tab{
  color:#c4d0df!important;
  background:transparent!important;
}
html[data-theme="dark"] .view-tab.active{
  color:#fff!important;
  background:linear-gradient(135deg,#3b82f6,#2563eb)!important;
}

/* Agenda calendar */
html[data-theme="dark"] .calendar-grid{
  background:transparent!important;
}
html[data-theme="dark"] .cal-day{
  background:linear-gradient(180deg,#111f34,#0f1b2e)!important;
  border-color:#2f4158!important;
  color:#f3f7fb!important;
}
html[data-theme="dark"] .cal-day-title{
  color:#f8fbff!important;
}
html[data-theme="dark"] .cal-event{
  background:#17263d!important;
  border-color:#6a9cf9!important;
  box-shadow:0 12px 28px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] .cal-event span,
html[data-theme="dark"] .cal-event small{
  color:#b7c6d8!important;
}
html[data-theme="dark"] .cal-event strong{
  color:#fff!important;
}
html[data-theme="dark"] .legend-item{
  background:#142238!important;
  color:#c4d0df!important;
  border:1px solid #2b3b52!important;
}

/* Histórico e participantes */
html[data-theme="dark"] .history-box,
html[data-theme="dark"] .history-box.empty,
html[data-theme="dark"] .history-modal{
  background:#142238!important;
  color:#d7e1ed!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .participant-checklist{
  background:#0f1b2e!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .participant-check{
  background:#142238!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .participant-check:hover{
  background:#182941!important;
}
html[data-theme="dark"] .participant-check b,
html[data-theme="dark"] .participant-check small{
  color:#e8eef6!important;
}
html[data-theme="dark"] .participant-empty{
  color:#b7c6d8!important;
}

/* Modais e detalhes */
html[data-theme="dark"] .agenda-modal{
  background:#0f1b2e!important;
  border-color:#2b3b52!important;
}
html[data-theme="dark"] .agenda-modal-head,
html[data-theme="dark"] .agenda-modal-actions{
  border-color:#2b3b52!important;
}
html[data-theme="dark"] .detail-card{
  background:#142238!important;
  border-color:#2b3b52!important;
}
html[data-theme="dark"] .detail-card span{color:#9fb0c4!important}
html[data-theme="dark"] .detail-card strong{color:#f8fbff!important}
html[data-theme="dark"] .detail-card p{color:#c9d5e4!important}
html[data-theme="dark"] .participant-pill{
  background:#142238!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .participant-pill b{color:#fff!important}
html[data-theme="dark"] .participant-pill small{color:#b7c6d8!important}

/* Botões */
html[data-theme="dark"] :is(button,.btn,.btn-primary,.btn-main,.mini){
  color:#fff!important;
}
html[data-theme="dark"] :is(.btn-ghost,.mini.light,.modal-close){
  background:#1b2a40!important;
  color:#e9f0f7!important;
  border:1px solid #31445e!important;
}
html[data-theme="dark"] .help-btn.compact{
  background:#172943!important;
  color:#8ab2ff!important;
}

/* Tabelas */
html[data-theme="dark"] th{
  background:#142238!important;
  color:#b8c7d8!important;
  border-color:#2b3b52!important;
}
html[data-theme="dark"] td{
  color:#eef4fa!important;
  border-color:#26364c!important;
}
html[data-theme="dark"] tbody tr:hover td{
  background:rgba(106,156,249,.06)!important;
}

/* Banner validação */
html[data-theme="dark"] .rcb2-validation-banner{
  background:rgba(15,27,46,.98)!important;
  color:#f3f7fb!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .rcb2-validation-banner strong{color:#fff!important}
html[data-theme="dark"] .rcb2-validation-banner span{color:#c4d0df!important}

/* Mobile/PWA */
@media(max-width:900px){
  html[data-theme="dark"] body.rcb2-mobile-ui,
  html[data-theme="dark"] body.rcb2-mobile-ui .main{
    background:#08111f!important;
  }
  html[data-theme="dark"] .rcb2-mobile-nav{
    background:#0f1b2e!important;
    border-color:#2b3b52!important;
  }
  html[data-theme="dark"] .rcb2-mobile-nav a,
  html[data-theme="dark"] .rcb2-mobile-nav button{
    color:#b9c8d9!important;
  }
  html[data-theme="dark"] .rcb2-mobile-nav .active{
    color:#dce9ff!important;
    background:#173150!important;
  }
  html[data-theme="dark"] .rcb2-mobile-header{
    background:rgba(6,16,31,.985)!important;
    color:#fff!important;
  }
  html[data-theme="dark"] body.rcb2-mobile-ui .main :is(.card,.dashboard-card,.metric-card,.metric,.agenda-card,.price-card){
    background:#0f1b2e!important;
    color:#f3f7fb!important;
    border-color:#2b3b52!important;
  }
}

/* =========================================================
   RCB2 FLOW — DARK MODE GLOBAL COMPONENT FIX 2026-09-18
   Fecha componentes legados de Vendas/Financeiro/Equipe/
   Sinistros/Relatórios/Regras/Dashboard em desktop + PWA.
   ========================================================= */
html[data-theme="dark"]{
  --rcb2-bg:#08111f;
  --rcb2-surface:#0f1b2e;
  --rcb2-surface-2:#142238;
  --rcb2-surface-3:#182941;
  --rcb2-border:#2b3b52;
  --rcb2-text:#f3f7fb;
  --rcb2-muted:#c4d0df;
  --rcb2-soft:#9fb0c4;
  --rcb2-blue:#6a9cf9;
}

/* páginas de módulo */
html[data-theme="dark"] :is(.vendas-page,.financeiro-page,.equipe-page,.sin-page,.rel-page,.regras-page){
  background:var(--rcb2-bg)!important;
  color:var(--rcb2-text)!important;
}

/* filtros e heróis específicos */
html[data-theme="dark"] :is(.glass-filter,.equipe-filterbar,.sin-filter-card,.rel-filter-card){
  background:var(--rcb2-surface)!important;
  border-color:var(--rcb2-border)!important;
  color:var(--rcb2-text)!important;
}
html[data-theme="dark"] :is(.glass-filter,.equipe-filterbar,.sin-filter-card,.rel-filter-card) :is(h1,h2,h3,strong){
  color:var(--rcb2-text)!important;
}
html[data-theme="dark"] :is(.glass-filter,.equipe-filterbar,.sin-filter-card,.rel-filter-card) :is(p,small,label,span){
  color:var(--rcb2-muted)!important;
  opacity:1!important;
}

/* KPIs que usam classes próprias */
html[data-theme="dark"] :is(.metric,.equipe-kpi,.sin-kpi,.rel-kpi){
  background:var(--rcb2-surface)!important;
  border-color:var(--rcb2-border)!important;
  color:var(--rcb2-text)!important;
  box-shadow:0 14px 34px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] :is(.metric,.equipe-kpi,.sin-kpi,.rel-kpi) span{
  color:var(--rcb2-soft)!important;
  opacity:1!important;
}
html[data-theme="dark"] :is(.metric,.equipe-kpi,.sin-kpi,.rel-kpi) strong{
  color:#fff!important;
}
html[data-theme="dark"] :is(.metric,.equipe-kpi,.sin-kpi,.rel-kpi) small{
  color:var(--rcb2-muted)!important;
  opacity:1!important;
}
html[data-theme="dark"] .metric small b{color:#fff!important}

/* cards específicos */
html[data-theme="dark"] :is(
  .chart-card,.form-card,.table-card,.lock-card,
  .equipe-card,.sin-card,.rel-card,
  .access-reset-card,.report-preview
){
  background:var(--rcb2-surface)!important;
  border-color:var(--rcb2-border)!important;
  color:var(--rcb2-text)!important;
  box-shadow:0 16px 44px rgba(0,0,0,.24)!important;
}
html[data-theme="dark"] :is(
  .chart-card,.form-card,.table-card,.lock-card,
  .equipe-card,.sin-card,.rel-card,
  .access-reset-card,.report-preview
) :is(h1,h2,h3,h4,strong,b){
  color:var(--rcb2-text)!important;
}
html[data-theme="dark"] :is(
  .chart-card,.form-card,.table-card,.lock-card,
  .equipe-card,.sin-card,.rel-card,
  .access-reset-card,.report-preview
) :is(p,small,label,.muted){
  color:var(--rcb2-muted)!important;
  opacity:1!important;
}

/* gráficos: área e controles */
html[data-theme="dark"] :is(.chart-wrap,.equipe-chart-wrap,.sin-chart-wrap,.rel-chart-wrap){
  background:var(--rcb2-surface)!important;
  color:var(--rcb2-text)!important;
}
html[data-theme="dark"] :is(.chart-controls select,.chart-picker summary,.equipe-chart-controls select,.sin-card-head select,.rel-card-head select){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .chart-picker button{
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
}
html[data-theme="dark"] .chart-picker button:hover{
  background:var(--rcb2-surface-3)!important;
}
html[data-theme="dark"] .chart-picker[open]::after{
  background:var(--rcb2-surface)!important;
  border-color:var(--rcb2-border)!important;
}

/* Vendas e Financeiro */
html[data-theme="dark"] :is(.sales-form,.finance-form) label{color:var(--rcb2-muted)!important}
html[data-theme="dark"] :is(.sales-form,.finance-form,.finance-search,.search-box) :is(input,select,textarea){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .checks label{
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .rule-preview{
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-muted)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .rule-preview strong{color:#fff!important}

/* Regras e comissões */
html[data-theme="dark"] :is(.faixa-row,.rule-card,.user-rule-card){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] :is(.faixa-row,.rule-card,.user-rule-card) :is(h4,strong,b){
  color:#fff!important;
}
html[data-theme="dark"] :is(.faixa-row,.rule-card,.user-rule-card) :is(p,small,.rule-faixas){
  color:var(--rcb2-muted)!important;
}
html[data-theme="dark"] .rule-meta span{
  background:#173150!important;
  color:#dce9ff!important;
}
html[data-theme="dark"] .user-rule-actions select{
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}

/* Equipe */
html[data-theme="dark"] :is(.ranking-list,.equipe-alert-list,.reset-results){
  color:var(--rcb2-text)!important;
}
html[data-theme="dark"] :is(.ranking-item,.equipe-alert-item,.reset-user-card,.reset-empty){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] :is(.ranking-item,.equipe-alert-item,.reset-user-card,.reset-empty) :is(strong,b){
  color:#fff!important;
}
html[data-theme="dark"] :is(.ranking-item,.equipe-alert-item,.reset-user-card,.reset-empty) :is(p,small,span){
  color:var(--rcb2-muted)!important;
  opacity:1!important;
}
html[data-theme="dark"] .reset-toolbar :is(input,select){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}

/* Sinistros */
html[data-theme="dark"] :is(.sin-filters select,.sin-filters input,.sin-card-head select,.sin-search,.sin-form input,.sin-form select,.sin-form textarea){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] :is(.alert-item,.timeline-item){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] :is(.alert-item,.timeline-item) strong{color:#fff!important}
html[data-theme="dark"] :is(.alert-item,.timeline-item) small{color:var(--rcb2-muted)!important}

/* Relatórios */
html[data-theme="dark"] :is(.rel-filters select,.rel-filters input,.rel-search){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] :is(.insights-list,.insight-item,.paper-summary,.report-section,.report-preview){
  color:var(--rcb2-text)!important;
}
html[data-theme="dark"] :is(.insight-item,.paper-summary,.report-section){
  background:var(--rcb2-surface-2)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] :is(.insight-item,.paper-summary,.report-section) :is(h3,h4,strong,b){color:#fff!important}
html[data-theme="dark"] :is(.insight-item,.paper-summary,.report-section) :is(p,small,span){color:var(--rcb2-muted)!important}

/* empty states e avisos genéricos */
html[data-theme="dark"] :is(
  .empty,.empty-state,.empty-result,.empty-message,.no-data,
  .ranking-empty,.insight-empty,.alert-empty,.notice-box,
  .dashboard-note,.info-box,.info-strip,.helper-box,.tip-box
){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-muted)!important;
  border-color:#31445e!important;
  opacity:1!important;
}
html[data-theme="dark"] :is(
  .empty,.empty-state,.empty-result,.empty-message,.no-data,
  .ranking-empty,.insight-empty,.alert-empty,.notice-box,
  .dashboard-note,.info-box,.info-strip,.helper-box,.tip-box
) :is(span,p,small,strong,b){
  color:inherit!important;
  opacity:1!important;
}

/* Dashboard: alertas e ranking */
html[data-theme="dark"] .alerts-card .alert-item{
  background:var(--rcb2-surface-2)!important;
  border:1px solid #31445e!important;
  border-radius:14px!important;
  padding:14px!important;
}
html[data-theme="dark"] .alerts-card .alert-item :is(span,p,small){
  color:var(--rcb2-muted)!important;
  opacity:1!important;
}
html[data-theme="dark"] .alerts-card .alert-item strong{color:#fff!important}

/* tabelas */
html[data-theme="dark"] table{background:transparent!important}
html[data-theme="dark"] th{
  background:var(--rcb2-surface-2)!important;
  color:#b8c7d8!important;
  border-color:var(--rcb2-border)!important;
}
html[data-theme="dark"] td{
  color:#eef4fa!important;
  border-color:#26364c!important;
}
html[data-theme="dark"] tbody tr:hover td{
  background:rgba(106,156,249,.06)!important;
}

/* controles e placeholders */
html[data-theme="dark"] :is(input,select,textarea){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] :is(input,textarea)::placeholder{
  color:#91a3b8!important;
  opacity:1!important;
}
html[data-theme="dark"] select option{
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
}

/* PWA */
@media(max-width:900px){
  html[data-theme="dark"] body.rcb2-mobile-ui :is(
    .metric,.equipe-kpi,.sin-kpi,.rel-kpi,
    .equipe-card,.sin-card,.rel-card,.faixa-row,.rule-card,.user-rule-card
  ){
    background:var(--rcb2-surface)!important;
    color:var(--rcb2-text)!important;
    border-color:var(--rcb2-border)!important;
  }
}

/* Dark fix — componentes residuais */
html[data-theme="dark"] :is(.wallet-item,.audit-item,.report-paper,.paper-summary div,.equipe-modal-card,.equipe-edit-form section,.equipe-modal-alert,.equipe-sem-acao){
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] :is(.wallet-item,.audit-item,.report-paper,.paper-summary div,.equipe-modal-card,.equipe-edit-form section) :is(h2,h3,h4,strong,b){
  color:#fff!important;
}
html[data-theme="dark"] :is(.wallet-item,.audit-item,.report-paper,.paper-summary div,.equipe-modal-card,.equipe-edit-form section) :is(p,small,span,label,li){
  color:var(--rcb2-muted)!important;
  opacity:1!important;
}
html[data-theme="dark"] :is(.equipe-edit-grid input,.equipe-edit-grid select){
  background:var(--rcb2-surface-3)!important;
  color:var(--rcb2-text)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .equipe-modal-close{
  background:var(--rcb2-surface-3)!important;
  color:#fff!important;
}
html[data-theme="dark"] .equipe-badge-icon,
html[data-theme="dark"] .insight-icon,
html[data-theme="dark"] .filter-title span,
html[data-theme="dark"] .shield{
  background:var(--rcb2-surface-3)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .paper-head{
  border-color:var(--rcb2-border)!important;
}
html[data-theme="dark"] .paper-head h2,
html[data-theme="dark"] .paper-text h3{color:#fff!important}
html[data-theme="dark"] .paper-head p,
html[data-theme="dark"] .paper-text p,
html[data-theme="dark"] .paper-text li{color:var(--rcb2-muted)!important}
html[data-theme="dark"] .action-small{
  background:var(--rcb2-surface-3)!important;
  color:#e8f1fb!important;
  border-color:#31445e!important;
}
/* Dark fix — faixas auxiliares de gráficos */
html[data-theme="dark"] .chart-note{
  background:var(--rcb2-surface-2)!important;
  color:var(--rcb2-muted)!important;
  border:1px solid #31445e!important;
  opacity:1!important;
}
html[data-theme="dark"] .chart-note :is(span,strong,b){
  color:inherit!important;
  opacity:1!important;
}

/* =========================================================
   RCB2 FLOW — DARKFIX 3: CLIENTES + VENDAS
   Corrige componentes residuais observados em produção.
   ========================================================= */

/* CLIENTES — dashboard e filtros */
html[data-theme="dark"] .clientes-page{
  background:var(--rcb2-bg,#08111f)!important;
  color:var(--rcb2-text,#f3f7fb)!important;
}

html[data-theme="dark"] .dashboard-card{
  background:var(--rcb2-surface,#0f1b2e)!important;
  color:var(--rcb2-text,#f3f7fb)!important;
  border:1px solid var(--rcb2-border,#2b3b52)!important;
  box-shadow:0 16px 44px rgba(0,0,0,.24)!important;
}
html[data-theme="dark"] .dashboard-card :is(h1,h2,h3,h4,strong,b){
  color:#f8fbff!important;
}
html[data-theme="dark"] .dashboard-card :is(p,small,span,label){
  color:var(--rcb2-muted,#c4d0df)!important;
  opacity:1!important;
}
html[data-theme="dark"] .dash-head h2{color:#f8fbff!important}
html[data-theme="dark"] .dash-head p{color:var(--rcb2-muted,#c4d0df)!important}
html[data-theme="dark"] .dash-controls label{
  color:var(--rcb2-muted,#c4d0df)!important;
  opacity:1!important;
}
html[data-theme="dark"] :is(.dash-controls select,.filter-card select,.filter-card input,.cliente-form input,.cliente-form select,.cliente-form textarea,.corretor-inline-select){
  background:var(--rcb2-surface-2,#142238)!important;
  color:var(--rcb2-text,#f3f7fb)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .chart-wrap{
  background:var(--rcb2-surface,#0f1b2e)!important;
  color:var(--rcb2-text,#f3f7fb)!important;
}
html[data-theme="dark"] .pill-soft{
  background:#173150!important;
  color:#dce9ff!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .ghost{
  background:var(--rcb2-surface-2,#142238)!important;
  color:#f3f7fb!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .switch-line{
  background:var(--rcb2-surface-2,#142238)!important;
  color:#f3f7fb!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .client-toast{
  background:var(--rcb2-surface,#0f1b2e)!important;
  color:#f3f7fb!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .client-toast span{
  color:var(--rcb2-muted,#c4d0df)!important;
}

/* VENDAS — estados desabilitados e pill residual */
html[data-theme="dark"] .pill.neutral,
html[data-theme="dark"] .neutral{
  background:#173150!important;
  color:#dce9ff!important;
  border:1px solid #31445e!important;
  opacity:1!important;
}
html[data-theme="dark"] :is(
  input:disabled,select:disabled,textarea:disabled,
  input[readonly],select[readonly],textarea[readonly]
){
  background:#1a2740!important;
  color:#d7e3ef!important;
  border-color:#31445e!important;
  opacity:1!important;
  -webkit-text-fill-color:#d7e3ef!important;
}
html[data-theme="dark"] :is(
  input:disabled,textarea:disabled,
  input[readonly],textarea[readonly]
)::placeholder{
  color:#9fb0c4!important;
  opacity:1!important;
}
html[data-theme="dark"] .rule-preview{
  background:var(--rcb2-surface-2,#142238)!important;
  color:var(--rcb2-muted,#c4d0df)!important;
  border-color:#31445e!important;
}
html[data-theme="dark"] .rule-preview :is(h1,h2,h3,h4,strong,b){
  color:#f8fbff!important;
}
html[data-theme="dark"] .rule-preview :is(p,span,small){
  color:var(--rcb2-muted,#c4d0df)!important;
  opacity:1!important;
}

/* RCB2 Flow — dark fix específico: Dono da venda */
html[data-theme="dark"] #ownerSelect{
  background:#142238!important;
  background-color:#142238!important;
  color:#f3f7fb!important;
  border-color:#31445e!important;
  opacity:1!important;
  -webkit-text-fill-color:#f3f7fb!important;
  color-scheme:dark!important;
}
html[data-theme="dark"] #ownerSelect:disabled{
  background:#1a2740!important;
  background-color:#1a2740!important;
  color:#d7e3ef!important;
  border-color:#31445e!important;
  opacity:1!important;
  -webkit-text-fill-color:#d7e3ef!important;
}
html[data-theme="dark"] #ownerSelect option{
  background:#142238!important;
  color:#f3f7fb!important;
}
