/* ASN ERP V5.1.0 — duas identidades APROVADAS pelo usuário.
   Clean Premium = claro, Dark Total = escuro. Camada de apresentação somente.
   Não altera os cálculos, permissões, dados ou integrações. */
:root{font-synthesis:none}
html[data-theme="light"] {
  color-scheme:light;
  --asn-canvas:#f8f8fb; --asn-surface:#ffffff; --asn-elevated:#ffffff;
  --asn-surface-2:#fff9fb; --asn-ink:#202739; --asn-muted:#68748b;
  --asn-line:#e7e8ef; --asn-rose:#e71852; --asn-rose-strong:#c60e3c;
  --asn-rose-soft:#fff0f5; --asn-success:#078b64; --asn-info:#286ee4;
  --asn-shadow:0 7px 30px rgba(49,28,54,.065);
  --bg-main:#f8f8fb!important; --bg-secondary:#fff!important; --bg-tertiary:#fff9fb!important;
  --bg-elevated:#fff!important; --border:#e7e8ef!important; --border-soft:#f0edf1!important;
  --text-main:#202739!important; --text-support:#68748b!important; --text-muted:#858fa2!important;
  --accent:#e71852!important; --accent-hover:#c60e3c!important; --accent-soft:rgba(231,24,82,.085)!important;
  --accent-primary:#e71852!important; --primary:#e71852!important;
  --surface:#ffffff; --soft:#fff9fb; --text:#202739; --muted:#68748b;
  --shadow:0 7px 30px rgba(49,28,54,.065)!important;
}
html[data-theme="dark"] {
  color-scheme:dark;
  --asn-canvas:#080d1d; --asn-surface:#10192c; --asn-elevated:#17213a;
  --asn-surface-2:#121d32; --asn-ink:#f3f6fd; --asn-muted:#a8b4ce;
  --asn-line:#2b3855; --asn-rose:#fa2f66; --asn-rose-strong:#f01957;
  --asn-rose-soft:#3a1934; --asn-success:#41dbab; --asn-info:#7fa7ff;
  --asn-shadow:0 10px 35px rgba(0,0,0,.19);
  --bg-main:#080d1d!important; --bg-secondary:#10192c!important; --bg-tertiary:#17213a!important;
  --bg-elevated:#17213a!important; --border:#2b3855!important; --border-soft:#28344c!important;
  --text-main:#f3f6fd!important; --text-support:#b3bdd0!important; --text-muted:#93a1b9!important;
  --accent:#fa2f66!important; --accent-hover:#f01957!important; --accent-soft:rgba(250,47,102,.14)!important;
  --accent-primary:#fa2f66!important; --primary:#fa2f66!important;
  --surface:#10192c; --soft:#17213a; --text:#f3f6fd; --muted:#a8b4ce;
  --shadow:0 10px 35px rgba(0,0,0,.19)!important;
}
html[data-theme] { background:var(--asn-canvas)!important }
html[data-theme] body {
  background:var(--asn-canvas)!important; color:var(--asn-ink)!important;
  font-family:Inter,'Segoe UI',system-ui,Arial,sans-serif!important;
  -webkit-font-smoothing:antialiased;
}
html[data-theme="light"] body {
  background:radial-gradient(ellipse 50% 38% at 100% 0%,#ffe6ee 0%,transparent 100%),#f8f8fb!important;
}
html[data-theme="dark"] body {
  background:radial-gradient(ellipse 48% 28% at 85% 0%,rgba(129,40,102,.12),transparent 85%),#080d1d!important;
}
html[data-theme] :is(h1,h2,h3,h4,h5,h6,.page-title,.section-title){color:var(--asn-ink)}
html[data-theme] :is(p,.sub,.subtitle,.muted,.page-subtitle){line-height:1.56}
html[data-theme] :is(.card,.panel,.dash-card,.metric-card,.table-container,.table-wrap,.table-responsive,.data-table-wrap,.action-section,.toolbar,.filtros-globais,.v34-panel,.v34-kpi,.v34-side-card,.pp-panel,.pp-card,.pc-card,.asn-modules-panel,.asn-market-table,.asn-stock-table,.asn-inventory-table,.cv-fin-card,.nf-card,.cf-card) {
  border:1px solid var(--asn-line)!important;
  border-radius:16px!important;
  background:var(--asn-surface)!important;
  color:var(--asn-ink)!important;
  box-shadow:var(--asn-shadow)!important;
}
html[data-theme] :is(.card,.panel,.dash-card,.metric-card,.v34-panel,.v34-kpi,.v34-side-card,.pp-panel,.pp-card,.pc-card) :is(h2,h3,strong){color:var(--asn-ink)}
html[data-theme="light"] :is(.card,.panel,.dash-card,.metric-card,.v34-panel,.v34-kpi):hover{border-color:#e8d4de!important}
html[data-theme="dark"] :is(.card,.panel,.dash-card,.metric-card,.v34-panel,.v34-kpi):hover{border-color:#465070!important}
html[data-theme] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.search-input,.sort-select,.pc-input,.pc-select) {
  background:var(--asn-elevated)!important;color:var(--asn-ink)!important;
  border:1px solid var(--asn-line)!important;border-radius:10px!important;
  box-shadow:none!important;
}
html[data-theme] :is(input,select,textarea):focus-visible {
  outline:2px solid var(--asn-rose)!important;outline-offset:1px;
  border-color:var(--asn-rose)!important;
}
html[data-theme] :is(input,textarea)::placeholder{color:var(--asn-muted)!important;opacity:.9}
html[data-theme] :is(button,.btn,.btn-add,.btn-submit,.pp-btn,.pc-button,.v34-btn) {
  border-radius:11px!important;font-weight:700;
}
html[data-theme] :is(.btn.primary,.btn-submit,.btn-add,.pp-btn-primary,.v34-btn-primary,.pc-button.blue,.pc-button.green,.tab-btn.active,.btn-primary) {
  background:linear-gradient(130deg,#fa3a70,var(--asn-rose-strong))!important;
  border-color:var(--asn-rose-strong)!important;color:#fff!important;
  box-shadow:0 5px 14px rgba(224,25,76,.14)!important;
}
html[data-theme] :is(.btn.primary,.btn-submit,.btn-add,.pp-btn-primary,.btn-primary):hover {
  filter:brightness(1.05);
}
html[data-theme] :is(.table-container,table,.tabela-itens){background:var(--asn-surface)!important;color:var(--asn-ink)!important}
html[data-theme] th,html[data-theme] :is(thead,.table-header){background:var(--asn-surface-2)!important;color:var(--asn-muted)!important;border-color:var(--asn-line)!important}
html[data-theme] td{background:transparent!important;color:var(--asn-ink)!important;border-color:var(--asn-line)!important}
html[data-theme] :is(tbody tr:hover td,.data-row:hover){background:var(--asn-surface-2)!important}
html[data-theme] :is(.status-badge.ok,.badge-ok,.asn-v508-pill:not(.disabled)){border-color:rgba(31,182,122,.28)!important;background:rgba(17,177,113,.12)!important;color:var(--asn-success)!important}
html[data-theme] :is(.badge-alerta,.status-pendente){background:rgba(244,63,94,.13)!important;color:var(--asn-rose)!important}
html[data-theme] :is(.modal-content,#custom-confirm-box,.modal,.dialog-panel){background:var(--asn-surface)!important;color:var(--asn-ink)!important;border:1px solid var(--asn-line)!important;border-radius:18px!important}
/* Sidebar: Clean Premium branco e Dark Total azul-marinho. Mantém permissões, links e grupos. */
html[data-theme] body.asn-nav-ready.asn-layout-v4994 #sidebar.asn-sidebar.sidebar {
 background:var(--asn-surface)!important;border-right:1px solid var(--asn-line)!important;
 box-shadow:3px 0 22px rgba(0,0,0,.04)!important;color:var(--asn-ink)!important;
}
html[data-theme="dark"] body.asn-nav-ready.asn-layout-v4994 #sidebar.asn-sidebar.sidebar {
 background:#0d1527!important;border-right-color:#263550!important;box-shadow:4px 0 30px rgba(0,0,0,.24)!important;
}
html[data-theme] body.asn-nav-ready #sidebar.asn-sidebar :is(.asn-nav-brand,.asn-nav-company,.asn-nav-group,.asn-nav-footer) {color:var(--asn-ink)!important;border-color:var(--asn-line)!important}
html[data-theme] body.asn-nav-ready #sidebar.asn-sidebar :is(.asn-nav-brand-text strong,.asn-nav-brand-text small,.asn-nav-company strong,.asn-nav-company small,.asn-nav-company .asn-nav-plan,.asn-nav-user,.asn-nav-cloud,.asn-nav-group) {color:var(--asn-ink)!important}
html[data-theme] body.asn-nav-ready #sidebar.asn-sidebar a.asn-nav-link:not(.active) {background:transparent!important;color:var(--asn-muted)!important;border-color:transparent!important;box-shadow:none!important}
html[data-theme] body.asn-nav-ready #sidebar.asn-sidebar a.asn-nav-link:not(.active):hover {background:var(--asn-rose-soft)!important;color:var(--asn-rose)!important}
html[data-theme] body.asn-nav-ready #sidebar.asn-sidebar a.asn-nav-link.active {
 background:linear-gradient(125deg,#f53c70,#c70c3e)!important;color:#fff!important;
 border-color:transparent!important;box-shadow:0 7px 19px rgba(222,25,79,.15)!important;
}
html[data-theme] body.asn-nav-ready #sidebar.asn-sidebar .asn-nav-mark {
 background:transparent url('asn-brand-symbol-v510.svg') center/contain no-repeat!important;
 border:0!important;box-shadow:none!important;color:transparent!important;font-size:0!important;
}
html[data-theme] body.asn-nav-ready #sidebar.asn-sidebar :is(.asn-nav-footer-grid button,#asn-side-mode-toggle){background:var(--asn-surface-2)!important;border-color:var(--asn-line)!important;color:var(--asn-ink)!important}
html[data-theme] body.asn-nav-ready #sidebar.asn-sidebar .asn-nav-company-select{background:var(--asn-elevated)!important;color:var(--asn-ink)!important;border-color:var(--asn-line)!important}
/* Layout específico do primeiro acesso — presente na tela apontada pelo usuário */
html[data-theme] body:has(.setup-content) .workspace{background:transparent!important}
html[data-theme] body:has(.setup-content) :is(.rail,.app-header){background:var(--asn-surface)!important;border-color:var(--asn-line)!important;color:var(--asn-ink)!important}
html[data-theme] body:has(.setup-content) .rail nav a.selected{background:linear-gradient(130deg,#fa3a70,#c70c3e)!important;color:#fff!important}
html[data-theme] body:has(.setup-content) .rail nav a:not(.selected){color:var(--asn-muted)!important}
html[data-theme] body:has(.setup-content) .brand strong{color:var(--asn-rose)!important}
html[data-theme] body:has(.setup-content) .setup{max-width:1630px!important}
html[data-theme] body:has(.setup-content) .hero{background:transparent!important}
html[data-theme] body:has(.setup-content) .hero h1{font-size:clamp(27px,2.5vw,39px)!important;letter-spacing:-.04em!important;color:var(--asn-ink)!important}
html[data-theme] body:has(.setup-content) .hero>p:last-child{color:var(--asn-muted)!important}
html[data-theme] body:has(.setup-content) .stepitem{border:1px solid transparent!important;border-radius:14px!important;color:var(--asn-ink)!important;background:transparent!important}
html[data-theme] body:has(.setup-content) .stepitem:hover{background:var(--asn-surface-2)!important}
html[data-theme] body:has(.setup-content) .stepitem.active{background:var(--asn-rose-soft)!important;border:1px solid rgba(220,34,80,.15)!important;color:var(--asn-rose)!important;box-shadow:none!important}
html[data-theme] body:has(.setup-content) .stepitem.active .num{background:var(--asn-rose)!important;border-color:var(--asn-rose)!important;color:#fff!important}
html[data-theme] body:has(.setup-content) .stepitem.active small{color:var(--asn-muted)!important}
html[data-theme] body:has(.setup-content) .stepitem.done:not(.active){background:rgba(26,166,113,.07)!important}
html[data-theme] body:has(.setup-content) :is(.card,.platform,.shopitem,.summary-row,.metric,.notice,.info-strip){border-radius:16px!important;border-color:var(--asn-line)!important}
html[data-theme] body:has(.setup-content) .card{background:var(--asn-surface)!important;box-shadow:var(--asn-shadow)!important}
html[data-theme] body:has(.setup-content) .platform{background:var(--asn-surface)!important;min-height:100px!important;box-shadow:0 3px 12px rgba(31,34,60,.025)!important}
html[data-theme] body:has(.setup-content) .platform:hover:not(:disabled){border-color:var(--asn-rose)!important;transform:translateY(-1px)}
html[data-theme] body:has(.setup-content) .platform[aria-pressed="true"]{background:var(--asn-rose-soft)!important;border-color:var(--asn-rose)!important}
html[data-theme] body:has(.setup-content) :is(.notice,.summary-row,.metric,.shopitem){background:var(--asn-surface-2)!important;color:var(--asn-ink)!important}
html[data-theme] body:has(.setup-content) :is(.actions,.page-footer){border-color:var(--asn-line)!important}
html[data-theme] body:has(.setup-content) .stepnav{gap:5px!important}
html[data-theme] body:has(.setup-content) :is(.app-header,.header-actions) {color:var(--asn-ink)!important}
html[data-theme] body:has(.setup-content) .btn.primary{background:linear-gradient(130deg,#f93b70,#c80e3d)!important;color:#fff!important}
/* V5.0.8/5.0.9 central de módulos; corrige tons antigos fixos. */
html[data-theme] body :is(.hub-card,.asn-v508-module,.asn-v508-check,.asn-v508-status,.asn-v509-store-details,.asn-v509-errors,.hub-msg){
  background:var(--asn-surface)!important;border:1px solid var(--asn-line)!important;
  color:var(--asn-ink)!important;border-radius:15px!important;box-shadow:var(--asn-shadow)!important;
}
html[data-theme] body :is(.asn-v508-check span,.asn-v508-check strong,.asn-v508-status-head p,.asn-v508-section-title p,.hub-card span,.hub-top p,.asn-v509-table-scroll p,.asn-v509-errors li){color:var(--asn-muted)!important}
html[data-theme] body :is(.asn-v508-module strong,.asn-v508-check strong,.asn-v508-status-head h2,.asn-v508-section-title h2,.hub-top h1){color:var(--asn-ink)!important}
html[data-theme] body :is(.asn-v509-table-scroll th,.asn-v509-table-scroll td){border-color:var(--asn-line)!important;color:var(--asn-ink)!important}
html[data-theme] body :is(.asn-v508-section-title a,.asn-v508-check a,.asn-v509-errors a){color:var(--asn-rose)!important}
html[data-theme] body .asn-v509-warning{background:var(--asn-rose-soft)!important;border-color:var(--asn-line)!important;color:var(--asn-rose)!important}
/* Formulários próprios dos módulos legados preservam leiaute e recebem superfícies. */
html[data-theme="dark"] body :is(.content,.content-area,.main-content,.page,.wrap,.container,.dashboard-layout,.dashboard-v34-shell,.asn-app-main,.dashboard-v34){color:var(--asn-ink)!important}
html[data-theme="dark"] body :is(.content,.content-area,.main-content,.page,.wrap,.container,.dashboard-layout,.dashboard-v34-shell,.asn-app-main,.dashboard-v34)>:is(header,.header,.page-header,.top,.page-title){color:var(--asn-ink)!important}
html[data-theme] body :is(.topbar,.app-header,.v34-topbar){border-color:var(--asn-line)!important}
html[data-theme="dark"] body :is(.kpi,.kpi-card,.summary-card,.stat-card,.chart-card,.chart-container,.filter-card,.filters-panel){background:var(--asn-surface)!important;color:var(--asn-ink)!important;border-color:var(--asn-line)!important}
html[data-theme="light"] body :is(.kpi,.kpi-card,.summary-card,.stat-card,.chart-card,.chart-container,.filter-card,.filters-panel){background:#fff!important;color:var(--asn-ink)!important;border-color:var(--asn-line)!important}
/* Botão universal. Acessível pelo teclado, sem interceptar cliques de outros controles. */
.asn-v510-switch{position:fixed;top:12px;right:17px;z-index:10020;display:flex;align-items:center;gap:8px;min-height:40px;max-width:calc(100vw - 24px);
 border:1px solid var(--asn-line)!important;border-radius:999px!important;background:var(--asn-surface)!important;color:var(--asn-ink)!important;
 box-shadow:0 7px 22px rgba(0,0,0,.10)!important;padding:7px 13px!important;font:700 12px/1.2 Inter,system-ui,sans-serif!important;cursor:pointer;}
.asn-v510-switch .asn-v510-icon{font-size:16px;line-height:1}
.asn-v510-switch:hover{border-color:var(--asn-rose)!important}
.asn-v510-switch:focus-visible{outline:3px solid var(--asn-rose)!important;outline-offset:3px}
html[data-theme="dark"] .asn-v510-switch{box-shadow:0 8px 25px rgba(0,0,0,.4)!important}
html[data-theme] .asn-v510-mode-badge{background:var(--asn-rose-soft);color:var(--asn-rose);border-radius:999px;padding:4px 9px;font:700 11px Inter,system-ui,sans-serif}
html[data-theme] .asn-v510-userbar{background:var(--asn-surface)}
@media(min-width:901px){html[data-theme] body.asn-nav-ready.asn-layout-v4994 .asn-app-main{padding-top:max(27px,1.8vw)!important}}
@media(max-width:900px){.asn-v510-switch{top:13px;right:12px;z-index:10010;padding:6px 10px!important;font-size:11px!important;min-height:36px}.asn-v510-switch .asn-v510-label{display:none}}
@media(max-width:600px){.asn-v510-switch{top:16px;right:55px;padding:6px 8px!important;min-height:31px}.asn-v510-switch .asn-v510-icon{font-size:15px}}
@media(prefers-reduced-motion:reduce){html[data-theme] :is(.platform,.card,.hub-card){transition:none!important}}

/* V5.1.0: seis plataformas visíveis, apenas duas com OAuth operacional. */
html[data-theme] body:has(.setup-content) .asn-v503-channels{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important}
html[data-theme] body:has(.setup-content) .asn-v503-channel{background:var(--asn-surface)!important;border:1px solid var(--asn-line)!important;border-radius:15px!important;box-shadow:var(--asn-shadow)!important}
html[data-theme] body:has(.setup-content) .asn-v503-channel-main{min-height:204px!important;padding:17px!important;gap:10px!important}
html[data-theme] body:has(.setup-content) .asn-v503-logo{width:46px!important;height:46px!important;flex-basis:46px!important;border-radius:12px!important}
html[data-theme] body:has(.setup-content) .asn-v503-logo svg{width:31px!important;height:31px!important}
html[data-theme] body:has(.setup-content) .asn-v503-channel-copy strong{font-size:16px!important;color:var(--asn-ink)!important}
html[data-theme] body:has(.setup-content) .asn-v503-channel-copy small{font-size:11px!important;color:var(--asn-muted)!important}
html[data-theme] body:has(.setup-content) .asn-v503-channel-status{font-size:10px!important}
html[data-theme] body:has(.setup-content) .asn-v503-channel-cta{padding:9px 11px!important;font-size:11px!important;border-radius:9px!important;background:linear-gradient(130deg,#fa3a70,#c70c3e)!important}
html[data-theme] body:has(.setup-content) .asn-v503-channel-bottom{min-height:43px!important;padding:9px 12px!important;gap:6px!important;border-color:var(--asn-line)!important}
html[data-theme] body:has(.setup-content) .asn-v503-channel-bottom>span{font-size:9px!important}
html[data-theme] body:has(.setup-content) .asn-v503-text-button{font-size:10px!important;color:var(--asn-rose)!important}
html[data-theme] body:has(.setup-content) .asn-v510-planned{opacity:.87!important;cursor:default!important}
html[data-theme] body:has(.setup-content) .asn-v510-planned:hover{transform:none!important;border-color:var(--asn-line)!important}
html[data-theme] body:has(.setup-content) .asn-v510-planned .asn-v503-channel-main{cursor:default!important}
html[data-theme] body:has(.setup-content) .asn-v510-logo{display:grid;place-items:center;width:46px;height:46px;flex:none;border-radius:12px;font-size:29px;font-weight:900;background:var(--asn-surface-2)}
html[data-theme] body:has(.setup-content) .asn-v510-logo.tiktok{background:#090d16;color:#fff;text-shadow:-2px -2px #24f0e6,2px 1px #ff285d}
html[data-theme] body:has(.setup-content) .asn-v510-logo.amazon{background:#f7f2e8;color:#1f2937;font-family:Georgia,serif}
html[data-theme] body:has(.setup-content) .asn-v510-logo.magalu{background:#e6f3ff;color:#1473cb}
html[data-theme] body:has(.setup-content) .asn-v510-logo.aiqfome{background:#f1e5ff;color:#9039ca}
html[data-theme] body:has(.setup-content) .asn-v510-future-cta{display:inline-block;margin-top:auto;padding:8px 11px;border-radius:9px;border:1px solid var(--asn-line);font-size:10px;color:var(--asn-muted)}
html[data-theme] body:has(.setup-content) .asn-v510-platform-disclaimer{font-size:11px;color:var(--asn-muted);padding:6px 0;margin:11px 0}
@media(max-width:1270px){html[data-theme] body:has(.setup-content) .asn-v503-channels{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:690px){html[data-theme] body:has(.setup-content) .asn-v503-channels{grid-template-columns:1fr!important}}

/* Evita controle de tema legado duplicado quando o novo alternador global está visível. */
html[data-theme] body:has(#asn-v510-theme) #asn-theme-toggle{display:none!important}
