/* ControlPDV Portal Theme + Navigation Contract v1
   Camada visual final. Não altera rotas, permissões, handlers ou contratos de API. */

:root,
html[data-cp-theme="dark"]{
  --cp-bg:#061018;
  --cp-bg-soft:#071923;
  --cp-surface:#0a202d;
  --cp-surface-2:#0b2938;
  --cp-surface-3:#0d3040;
  --cp-sidebar:#06131c;
  --cp-sidebar-soft:#071c27;
  --cp-text:#edf9ff;
  --cp-text-strong:#ffffff;
  --cp-muted:#91afbf;
  --cp-muted-2:#789aaa;
  --cp-border:#1d465a;
  --cp-border-strong:#2b6078;
  --cp-hover:#0c2b3a;
  --cp-active:#11384a;
  --cp-field:#0a2634;
  --cp-field-text:#edf9ff;
  --cp-field-placeholder:#86a7b6;
  --cp-shadow:0 16px 38px rgba(0,0,0,.22);
  --cp-accent:#22b7ce;
  --cp-accent-2:#2dd4bf;
  --cp-accent-soft:rgba(34,183,206,.12);
  --cp-success:#69e8d2;
  --cp-success-bg:rgba(45,212,191,.10);
  --cp-warning:#f6c85f;
  --cp-warning-bg:rgba(246,200,95,.10);
  --cp-danger:#fb7185;
  --cp-danger-bg:rgba(251,113,133,.10);
  --cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h16M12 4v16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

html[data-cp-theme="light"]{
  --cp-bg:#f4f7f9;
  --cp-bg-soft:#eef4f7;
  --cp-surface:#ffffff;
  --cp-surface-2:#f7fafb;
  --cp-surface-3:#edf5f7;
  --cp-sidebar:#fbfdfe;
  --cp-sidebar-soft:#f1f7f9;
  --cp-text:#17313d;
  --cp-text-strong:#0d2530;
  --cp-muted:#566f7c;
  --cp-muted-2:#526d79;
  --cp-border:#d5e2e8;
  --cp-border-strong:#bfd3dc;
  --cp-hover:#edf6f8;
  --cp-active:#def1f4;
  --cp-field:#ffffff;
  --cp-field-text:#132e39;
  --cp-field-placeholder:#5d7581;
  --cp-shadow:0 14px 34px rgba(29,58,72,.10);
  --cp-accent:#087f99;
  --cp-accent-2:#169e94;
  --cp-accent-soft:rgba(8,127,153,.10);
  --cp-success:#13745a;
  --cp-success-bg:#eaf8f3;
  --cp-warning:#8a6412;
  --cp-warning-bg:#fff8e7;
  --cp-danger:#a7394c;
  --cp-danger-bg:#fff0f2;
  color-scheme:light;
}

/* Tema muda atomicamente: evita texto claro/escuro atravessar fundo em transição. */
html.cp-theme-switching *,
html.cp-theme-switching *::before,
html.cp-theme-switching *::after{
  transition:none!important;
  animation-duration:0s!important;
}

/* ---------- navegação agrupada ---------- */
.portal .nav{
  display:flex;
  flex:1 1 auto;
  flex-direction:column;
  gap:2px;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:3px;
  scrollbar-width:thin;
  scrollbar-color:var(--cp-border-strong) transparent;
}
.portal .cp-nav-category{
  margin:12px 10px 5px;
  color:var(--cp-muted-2);
  font-size:9px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:.13em;
  text-transform:uppercase;
  user-select:none;
}
.portal .cp-nav-category:first-child{margin-top:2px}
.portal .nav button.cp-nav-item{
  position:relative;
  display:flex;
  align-items:center;
  min-height:38px;
  gap:10px;
  padding:9px 11px 9px 12px;
  border:1px solid transparent;
  color:var(--cp-muted);
  border-radius:10px;
}
.portal .nav button.cp-nav-item::before{
  content:"";
  width:17px;
  height:17px;
  flex:0 0 17px;
  background:currentColor;
  opacity:.92;
  -webkit-mask:var(--cp-nav-icon) center/contain no-repeat;
  mask:var(--cp-nav-icon) center/contain no-repeat;
}
.portal .nav button.cp-nav-item:hover{
  color:var(--cp-text);
  background:var(--cp-hover);
  border-color:var(--cp-border);
}
.portal .nav button.cp-nav-item.active{
  color:var(--cp-text-strong);
  background:var(--cp-active);
  border-color:color-mix(in srgb,var(--cp-accent) 42%,transparent);
  box-shadow:inset 3px 0 var(--cp-accent);
}
.portal .nav button[data-cp-nav-key="overview"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z' fill='black'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="company"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 21V5l8-3 8 3v16M8 8h2m4 0h2M8 12h2m4 0h2M8 16h2m4 0h2M3 21h18' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="suppliers"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 7h11v10H3zM14 10h4l3 3v4h-7zM7 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm10 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4z' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="team"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm8-1a3 3 0 1 0 0-6M2 21v-3a5 5 0 0 1 5-5h2a5 5 0 0 1 5 5v3m2-8a5 5 0 0 1 6 5v3' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="clients"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0M18 5l1 1 2-2' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="stores"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 10v10h16V10M3 10l2-6h14l2 6M8 20v-6h8v6M3 10c1 3 4 3 5 0 1 3 4 3 5 0 1 3 4 3 5 0 1 3 3 2 3 0' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="pdv-admin"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='13' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 21h8M12 17v4' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="pdv-settings"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h10M18 6h2M4 12h3M11 12h9M4 18h8M16 18h4' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='16' cy='6' r='2' fill='black'/%3E%3Ccircle cx='9' cy='12' r='2' fill='black'/%3E%3Ccircle cx='14' cy='18' r='2' fill='black'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="loads"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7l8-4 8 4-8 4zM4 7v10l8 4 8-4V7M12 11v10' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="food-service"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3v7m-3-7v4a3 3 0 0 0 6 0V3M7 10v11M16 3v18M16 3c3 2 4 5 4 8h-4' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="connectors-admin"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 3v5m8-5v5M6 8h12v3a6 6 0 0 1-6 6v4m-3 0h6' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="infrastructure"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='3' width='16' height='7' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Crect x='4' y='14' width='16' height='7' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 6h.01M8 17h.01M12 10v4' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="billing"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='14' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M3 9h18M7 15h4' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="reports"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20V10m6 10V4m6 16v-7m4 7H2' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="implementation"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3h6l1 3h4v15H4V6h4zM8 12l2 2 5-5M8 18h8' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="support"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 13v-2a8 8 0 0 1 16 0v2M4 13h3v6H5a2 2 0 0 1-2-2v-2a2 2 0 0 1 1-2zm16 0h-3v6h2a2 2 0 0 0 2-2v-2a2 2 0 0 0-1-2zM17 19c-1 2-3 2-5 2' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="communications"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="security"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3l8 3v6c0 5-3 8-8 9-5-1-8-4-8-9V6zM9 12l2 2 4-5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}
.portal .nav button[data-cp-nav-key="legal"]{--cp-nav-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h9l4 4v14H6zM14 3v5h5M9 13h6M9 17h6M9 9h2' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E")}

/* ---------- controle de aparência ---------- */
.cp-theme-control{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--cp-border);
}
.cp-theme-control-title{
  display:block;
  margin:0 8px 7px;
  color:var(--cp-muted-2);
  font-size:9px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.cp-theme-toggle{
  width:100%;
  min-height:38px;
  display:grid;
  grid-template-columns:20px 1fr auto;
  align-items:center;
  gap:8px;
  border:1px solid var(--cp-border);
  border-radius:10px;
  padding:8px 10px;
  color:var(--cp-text);
  background:var(--cp-sidebar-soft);
  cursor:pointer;
  font-weight:800;
  text-align:left;
}
.cp-theme-toggle:hover{border-color:var(--cp-border-strong);background:var(--cp-hover)}
.cp-theme-toggle-icon{font-size:17px;line-height:1}
.cp-theme-toggle-track{
  position:relative;
  width:31px;
  height:18px;
  border-radius:999px;
  background:var(--cp-border-strong);
}
.cp-theme-toggle-track i{
  position:absolute;
  top:3px;
  left:3px;
  width:12px;
  height:12px;
  border-radius:50%;
  background:var(--cp-text-strong);
  transition:transform .18s ease;
}
html[data-cp-theme="light"] .cp-theme-toggle-track{background:var(--cp-accent)}
html[data-cp-theme="light"] .cp-theme-toggle-track i{transform:translateX(13px);background:#fff}

/* ---------- tokens aplicados ao shell ---------- */
html[data-cp-theme] body{
  background:var(--cp-bg);
  color:var(--cp-text);
}
html[data-cp-theme] .portal{
  background:var(--cp-bg);
  color:var(--cp-text);
}
html[data-cp-theme] .portal .sidebar{
  background:var(--cp-sidebar);
  border-color:var(--cp-border);
  box-shadow:6px 0 24px rgba(0,0,0,.04);
}
html[data-cp-theme] .portal .brandline strong,
html[data-cp-theme] .portal .topbar h1,
html[data-cp-theme] .portal h1,
html[data-cp-theme] .portal h2,
html[data-cp-theme] .portal h3{color:var(--cp-text-strong)}
html[data-cp-theme] .portal .brandline small,
html[data-cp-theme] .portal .muted,
html[data-cp-theme] .portal .breadcrumb,
html[data-cp-theme] .portal .kpi span,
html[data-cp-theme] .portal .kpi small{color:var(--cp-muted)!important}
html[data-cp-theme] .portal .main{background:var(--cp-bg)}
html[data-cp-theme] .portal .topbar{border-color:var(--cp-border)}
html[data-cp-theme] .portal .user-mini,
html[data-cp-theme] .portal .version-chip{
  background:var(--cp-sidebar-soft);
  border-color:var(--cp-border);
  color:var(--cp-text);
}
html[data-cp-theme] .portal .user-mini span{color:var(--cp-muted)}

/* ---------- superfícies comuns ---------- */
html[data-cp-theme] .portal .card,
html[data-cp-theme] .modal,
html[data-cp-theme] .mfa-card,
html[data-cp-theme] .portal .cp-evo-card,
html[data-cp-theme] .portal .cp-evo-mini,
html[data-cp-theme] .portal .cp-registry-block,
html[data-cp-theme] .portal .cp019-layer,
html[data-cp-theme] .portal .cp019-state,
html[data-cp-theme] .portal .cp-legal-card,
html[data-cp-theme] .portal .cp-legal-note,
html[data-cp-theme] .portal .glp,
html[data-cp-theme] .portal .glp-mini,
html[data-cp-theme] .portal .glp-notification,
html[data-cp-theme] .portal .glp-check,
html[data-cp-theme] .portal .food-config-box024,
html[data-cp-theme] .portal .food-section024,
html[data-cp-theme] .portal .food-channel-origin024,
html[data-cp-theme] .portal .food-loyalty024,
html[data-cp-theme] .portal .connector-card024,
html[data-cp-theme] .portal .supplier-summary>span,
html[data-cp-theme] .portal .supplier-sync-note,
html[data-cp-theme] .portal .supplier-active-line{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
  box-shadow:var(--cp-shadow);
}
html[data-cp-theme] .portal .hero-card{
  background:
    radial-gradient(circle at 100% 0,var(--cp-accent-soft),transparent 50%),
    var(--cp-surface)!important;
}
html[data-cp-theme] .portal .metric-list div,
html[data-cp-theme] .portal .registry-item,
html[data-cp-theme] .portal .credential-box,
html[data-cp-theme] .portal .permission-option,
html[data-cp-theme] .portal .switch-row,
html[data-cp-theme] .portal .cp-report-kpi,
html[data-cp-theme] .portal .cp-report-cover-preview,
html[data-cp-theme] .portal .food-row024,
html[data-cp-theme] .portal .food-channel-card024,
html[data-cp-theme] .portal .food-external-channel024,
html[data-cp-theme] .portal .client-delivery-box025,
html[data-cp-theme] .portal .ecosystem-flow025,
html[data-cp-theme] .portal .ecosystem-role-grid025,
html[data-cp-theme] .portal .connector-store025{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .cp-evo-muted,
html[data-cp-theme] .portal .cp-logo-box span,
html[data-cp-theme] .portal .cp-addon ul,
html[data-cp-theme] .portal .glp-meta,
html[data-cp-theme] .portal .pc021-note,
html[data-cp-theme] .portal .supplier-sync-note span{color:var(--cp-muted)!important}

/* ---------- tabelas / listas ---------- */
html[data-cp-theme] .portal .table-wrap,
html[data-cp-theme] .portal .cp-table-wrap{
  border-color:var(--cp-border)!important;
  background:var(--cp-surface)!important;
}
html[data-cp-theme] .portal table,
html[data-cp-theme] .portal .table,
html[data-cp-theme] .portal .cp-legal-table{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme] .portal table th,
html[data-cp-theme] .portal .table th,
html[data-cp-theme] .portal .cp-legal-table th{
  background:var(--cp-surface-3)!important;
  color:var(--cp-muted)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal table td,
html[data-cp-theme] .portal .table td,
html[data-cp-theme] .portal .cp-legal-table td{
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal table td strong,
html[data-cp-theme] .portal .table td strong,
html[data-cp-theme] .portal .supplier-table td strong{color:var(--cp-text-strong)!important}
html[data-cp-theme] .portal .empty{color:var(--cp-muted)!important}

/* ---------- campos ---------- */
html[data-cp-theme] .portal input:not([type="checkbox"]):not([type="radio"]),
html[data-cp-theme] .portal select,
html[data-cp-theme] .portal textarea,
html[data-cp-theme] .modal input:not([type="checkbox"]):not([type="radio"]),
html[data-cp-theme] .modal select,
html[data-cp-theme] .modal textarea,
html[data-cp-theme] .cp-legal-grid input,
html[data-cp-theme] .cp-legal-grid select,
html[data-cp-theme] .cp-legal-grid textarea{
  background:var(--cp-field)!important;
  color:var(--cp-field-text)!important;
  border-color:var(--cp-border-strong)!important;
  box-shadow:none!important;
}
html[data-cp-theme] .portal input::placeholder,
html[data-cp-theme] .portal textarea::placeholder,
html[data-cp-theme] .modal input::placeholder,
html[data-cp-theme] .modal textarea::placeholder{color:var(--cp-field-placeholder)!important;opacity:1}
html[data-cp-theme] .portal input:focus,
html[data-cp-theme] .portal select:focus,
html[data-cp-theme] .portal textarea:focus,
html[data-cp-theme] .modal input:focus,
html[data-cp-theme] .modal select:focus,
html[data-cp-theme] .modal textarea:focus{
  border-color:var(--cp-accent)!important;
  box-shadow:0 0 0 3px var(--cp-accent-soft)!important;
  background:var(--cp-field)!important;
}
html[data-cp-theme] .portal option,
html[data-cp-theme] .modal option{background:var(--cp-field)!important;color:var(--cp-field-text)!important}
html[data-cp-theme] input[type="checkbox"],
html[data-cp-theme] input[type="radio"]{accent-color:var(--cp-accent)}

/* ---------- botões ---------- */
html[data-cp-theme] .portal .secondary,
html[data-cp-theme] .portal .ghost,
html[data-cp-theme] .portal .quick-actions button,
html[data-cp-theme] .portal .cp-evo-actions button:not(.primary),
html[data-cp-theme] .portal .cp-evo-button:not(.primary),
html[data-cp-theme] .modal .ghost,
html[data-cp-theme] .modal button:not(.primary):not(.danger){
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .portal .secondary:hover,
html[data-cp-theme] .portal .ghost:hover,
html[data-cp-theme] .portal .quick-actions button:hover,
html[data-cp-theme] .modal .ghost:hover{
  background:var(--cp-hover)!important;
  border-color:var(--cp-accent)!important;
}
html[data-cp-theme] .portal .primary,
html[data-cp-theme] .modal .primary{
  background:linear-gradient(90deg,var(--cp-accent),var(--cp-accent-2))!important;
  color:#fff!important;
}
html[data-cp-theme] .portal .danger,
html[data-cp-theme] .modal .danger{
  background:var(--cp-danger-bg)!important;
  color:var(--cp-danger)!important;
  border:1px solid color-mix(in srgb,var(--cp-danger) 45%,transparent)!important;
}

/* ---------- badges / avisos ---------- */
html[data-cp-theme] .portal .badge,
html[data-cp-theme] .portal .permission-chip,
html[data-cp-theme] .portal .cp-evo-badge,
html[data-cp-theme] .portal .cp-registry-badge,
html[data-cp-theme] .portal .cp-legal-status{
  background:var(--cp-surface-2)!important;
  border-color:var(--cp-border-strong)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme] .portal .badge.ok,
html[data-cp-theme] .portal .cp-evo-badge.ok,
html[data-cp-theme] .portal .cp-registry-badge.ok,
html[data-cp-theme] .portal .cp-legal-status.ok{
  color:var(--cp-success)!important;
  border-color:color-mix(in srgb,var(--cp-success) 50%,transparent)!important;
  background:var(--cp-success-bg)!important;
}
html[data-cp-theme] .portal .badge.warn,
html[data-cp-theme] .portal .cp-evo-badge.warn,
html[data-cp-theme] .portal .cp019-state.warn{
  color:var(--cp-warning)!important;
  border-color:color-mix(in srgb,var(--cp-warning) 45%,transparent)!important;
  background:var(--cp-warning-bg)!important;
}
html[data-cp-theme] .portal .badge.danger,
html[data-cp-theme] .portal .cp-evo-badge.bad,
html[data-cp-theme] .portal .cp019-state.bad{
  color:var(--cp-danger)!important;
  border-color:color-mix(in srgb,var(--cp-danger) 45%,transparent)!important;
  background:var(--cp-danger-bg)!important;
}
html[data-cp-theme] .portal .notice,
html[data-cp-theme] .portal .cp-inline-note,
html[data-cp-theme] .portal .glp-note{
  background:var(--cp-surface-3)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .warnbox,
html[data-cp-theme] .portal .cp-legal-note.warn{
  background:var(--cp-warning-bg)!important;
  color:var(--cp-warning)!important;
  border-color:color-mix(in srgb,var(--cp-warning) 45%,transparent)!important;
}
html[data-cp-theme] .portal .banner{
  background:var(--cp-danger-bg)!important;
  color:var(--cp-danger)!important;
  border-color:color-mix(in srgb,var(--cp-danger) 45%,transparent)!important;
}

/* ---------- evolution / relatórios ---------- */
html[data-cp-theme] .portal .cp-logo-box,
html[data-cp-theme] .portal .cp-report-cover-preview{
  background:var(--cp-surface-2)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .portal .cp-bell,
html[data-cp-theme] .portal .cp-wa{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .portal .cp-bar-track{background:var(--cp-border)!important}
html[data-cp-theme] .portal .cp-report-kpi span{color:var(--cp-muted)!important}

/* ---------- contratação jurídica ---------- */
html[data-cp-theme] .cp-legal-card{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .cp-legal-grid label{color:var(--cp-muted)!important}
html[data-cp-theme] .cp-legal-note{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme] .cp-contract-text{
  background:var(--cp-bg-soft)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .cp-legal-table th,
html[data-cp-theme] .cp-legal-table td{border-color:var(--cp-border)!important}
html[data-cp-theme] .cp-legal-lock{
  background:var(--cp-warning-bg)!important;
  color:var(--cp-warning)!important;
  border-color:color-mix(in srgb,var(--cp-warning) 45%,transparent)!important;
  box-shadow:var(--cp-shadow)!important;
}

/* ---------- implantação / suporte / comunicados ---------- */
html[data-cp-theme] .portal .glp-mini,
html[data-cp-theme] .portal .glp-check,
html[data-cp-theme] .portal .glp-notification,
html[data-cp-theme] .portal .glp-dialog,
html[data-cp-theme] .portal .glp-message{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .glp-notification.unread{
  background:var(--cp-accent-soft)!important;
  border-color:color-mix(in srgb,var(--cp-accent) 42%,var(--cp-border))!important;
}
html[data-cp-theme] .portal .glp-progress{background:var(--cp-border)!important}
html[data-cp-theme] .portal .glp-error{
  background:var(--cp-danger-bg)!important;
  border-color:color-mix(in srgb,var(--cp-danger) 45%,transparent)!important;
  color:var(--cp-danger)!important;
}

/* ---------- Central de Cargas ---------- */
html[data-cp-theme] .portal .lc-kpi024 strong,
html[data-cp-theme] .portal .lc-table024 td strong,
html[data-cp-theme] .portal .lc-detail-grid024 strong{color:var(--cp-text-strong)!important}
html[data-cp-theme] .portal .lc-detail-grid024 div,
html[data-cp-theme] .portal .lc-source-note024,
html[data-cp-theme] .portal .lc-source-status024 code,
html[data-cp-theme] .portal .lc-filters024,
html[data-cp-theme] .portal .lc-sync024{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .lc-table024 th,
html[data-cp-theme] .portal .lc-table024 td{border-color:var(--cp-border)!important}
html[data-cp-theme] .portal .lc-kpi024 span,
html[data-cp-theme] .portal .lc-table024 th,
html[data-cp-theme] .portal .lc-detail-grid024 span,
html[data-cp-theme] .portal .lc-sync024 small,
html[data-cp-theme] .portal .lc-empty024{color:var(--cp-muted)!important}

/* ---------- Food / ecossistema ---------- */
html[data-cp-theme] .portal .food-portal-hero024,
html[data-cp-theme] .portal .food-section024,
html[data-cp-theme] .portal .food-config-box024,
html[data-cp-theme] .portal .food-loyalty024,
html[data-cp-theme] .portal .food-channel-origin024,
html[data-cp-theme] .portal .food-subsection025,
html[data-cp-theme] .portal .connector-external025{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .food-row024,
html[data-cp-theme] .portal .food-channel-card024,
html[data-cp-theme] .portal .food-external-channel024,
html[data-cp-theme] .portal .operation-launcher025,
html[data-cp-theme] .portal .operation-launcher-compact025{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .food-row024:hover,
html[data-cp-theme] .portal .operation-launcher025:hover{background:var(--cp-hover)!important}
html[data-cp-theme] .portal .food-rule024{
  background:var(--cp-accent-soft)!important;
  border-color:color-mix(in srgb,var(--cp-accent) 35%,var(--cp-border))!important;
  color:var(--cp-text)!important;
}

/* ---------- cupons ---------- */
html[data-cp-theme] .portal .cp-coupon-tabs,
html[data-cp-theme] .portal .cp-coupon-filters024,
html[data-cp-theme] .portal .cp-coupon-table024{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .cp-coupon-key024,
html[data-cp-theme] .portal .cp-coupon-json024{
  background:var(--cp-bg-soft)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}

/* ---------- login / ativação / MFA ---------- */
html[data-cp-theme] .auth-card-wrap,
html[data-cp-theme] .mfa-shell{
  background:var(--cp-bg)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme] .auth-card,
html[data-cp-theme] .mfa-card{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
  box-shadow:var(--cp-shadow)!important;
}
html[data-cp-theme] .auth-card .muted,
html[data-cp-theme] .mfa-card .muted{color:var(--cp-muted)!important}
html[data-cp-theme] .auth-card .tabs{background:var(--cp-surface-3)!important}
html[data-cp-theme] .auth-card .tab{color:var(--cp-muted)!important}
html[data-cp-theme] .auth-card .tab.active{
  background:linear-gradient(90deg,var(--cp-accent),var(--cp-accent-2))!important;
  color:#fff!important;
}
html[data-cp-theme] .auth-card .field input,
html[data-cp-theme] .auth-card .field select,
html[data-cp-theme] .mfa-card .field input,
html[data-cp-theme] .mfa-card .field select{
  background:var(--cp-field)!important;
  color:var(--cp-field-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme="light"] .auth-brand{
  background:linear-gradient(135deg,#dceff3,#f4fafb)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] .auth-brand p{color:var(--cp-muted)!important}

/* ---------- modal / toast ---------- */
html[data-cp-theme] .modal{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .toast{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .toast.bad{
  background:var(--cp-danger-bg)!important;
  color:var(--cp-danger)!important;
  border-color:color-mix(in srgb,var(--cp-danger) 45%,transparent)!important;
}
html[data-cp-theme="light"] .modal-back{background:rgba(18,40,50,.42)!important}

/* ---------- pequenos detalhes de contraste ---------- */
html[data-cp-theme] .portal code,
html[data-cp-theme] .portal .codebox{
  color:var(--cp-text)!important;
  background:var(--cp-bg-soft)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .portal a:not(.primary):not(.pdv-launch-side){color:var(--cp-accent)}
html[data-cp-theme] .portal hr{border-color:var(--cp-border)}
html[data-cp-theme] .portal ::selection{background:var(--cp-accent);color:#fff}

@media(max-width:820px){
  .portal .cp-nav-category{grid-column:1/-1;margin-top:10px}
  .portal .nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;overflow:visible;padding-right:0}
  .portal .nav button.cp-nav-item{min-width:0}
  .cp-theme-control{margin-top:12px}
}
@media(max-width:520px){
  .portal .nav{grid-template-columns:1fr}
}


/* ---------- Light-theme hardening over legacy !important contracts ---------- */
html[data-cp-theme="light"]{
  --text:var(--cp-text);
  --white:var(--cp-text-strong);
  --muted:var(--cp-muted);
  --line:var(--cp-border);
  --panel:var(--cp-surface);
  --panel-2:var(--cp-surface-2);
  --cp-portal-bg:var(--cp-bg);
  --cp-portal-surface:var(--cp-surface);
  --cp-portal-surface-2:var(--cp-surface-2);
  --cp-portal-surface-3:var(--cp-surface-3);
  --cp-portal-line:var(--cp-border);
  --cp-portal-line-focus:var(--cp-accent);
  --cp-portal-text:var(--cp-text);
  --cp-portal-muted:var(--cp-muted);
  --cp-portal-accent:var(--cp-accent);
  --cp-portal-mint:var(--cp-accent-2);
  --cp-field-bg:var(--cp-field);
  --cp-field-border:var(--cp-border-strong);
  --cp-field-muted:var(--cp-field-placeholder);
  --cp-panel-soft:var(--cp-surface-2);
}
html[data-cp-theme="dark"]{
  --text:var(--cp-text);
  --white:var(--cp-text-strong);
  --muted:var(--cp-muted);
  --line:var(--cp-border);
  --panel:var(--cp-surface);
  --panel-2:var(--cp-surface-2);
}

/* portal-layout.css deliberately uses !important; appearance owns only its colors */
html[data-cp-theme] .portal{background:var(--cp-bg)!important}
html[data-cp-theme] .portal>.sidebar{
  background:var(--cp-sidebar)!important;
  border-right-color:var(--cp-border)!important;
  box-shadow:6px 0 24px rgba(0,0,0,.04)!important;
}
html[data-cp-theme] .portal .topbar{border-bottom-color:var(--cp-border)!important}
html[data-cp-theme] .portal .nav{
  display:grid!important;
  grid-template-columns:1fr!important;
}
html[data-cp-theme] .portal .cp-nav-category{grid-column:1/-1}
html[data-cp-theme="light"] .portal .pdv-launch-side{
  background:linear-gradient(135deg,#087f99,#169e94)!important;
  color:#fff!important;
  box-shadow:0 10px 24px rgba(8,127,153,.18)!important;
}
html[data-cp-theme] .portal .sidebar-footer{border-color:var(--cp-border)!important}

/* explicit color-scheme reset: the legacy dark contract sets dark on cards/modals */
html[data-cp-theme="light"] .portal .card,
html[data-cp-theme="light"] .portal .section,
html[data-cp-theme="light"] .portal .table-wrap,
html[data-cp-theme="light"] .modal-back .modal,
html[data-cp-theme="light"] .modal-back .modal-wide,
html[data-cp-theme="light"] .modal-back .notice,
html[data-cp-theme="light"] .modal-back .switch-row{
  color-scheme:light!important;
}
html[data-cp-theme="dark"] .portal .card,
html[data-cp-theme="dark"] .portal .section,
html[data-cp-theme="dark"] .portal .table-wrap,
html[data-cp-theme="dark"] .modal-back .modal,
html[data-cp-theme="dark"] .modal-back .modal-wide{color-scheme:dark!important}

/* WebKit may otherwise keep the dark contract's white text-fill on light fields */
html[data-cp-theme] .portal input:not([type="checkbox"]):not([type="radio"]),
html[data-cp-theme] .portal select,
html[data-cp-theme] .portal textarea,
html[data-cp-theme] .modal-back input:not([type="checkbox"]):not([type="radio"]),
html[data-cp-theme] .modal-back select,
html[data-cp-theme] .modal-back textarea{
  -webkit-text-fill-color:var(--cp-field-text)!important;
}
html[data-cp-theme] .portal input::placeholder,
html[data-cp-theme] .portal textarea::placeholder,
html[data-cp-theme] .modal-back input::placeholder,
html[data-cp-theme] .modal-back textarea::placeholder{
  -webkit-text-fill-color:var(--cp-field-placeholder)!important;
  color:var(--cp-field-placeholder)!important;
  opacity:1!important;
}
html[data-cp-theme] .portal input:disabled,
html[data-cp-theme] .portal select:disabled,
html[data-cp-theme] .portal textarea:disabled{
  color:var(--cp-muted)!important;
  -webkit-text-fill-color:var(--cp-muted)!important;
  opacity:.75!important;
}
html[data-cp-theme] .portal small,
html[data-cp-theme] .modal-back small{color:var(--cp-muted)!important}

/* company / registry / permissions / security */
html[data-cp-theme] .portal .registry-empty,
html[data-cp-theme] .portal .registry-mirror,
html[data-cp-theme] .portal .registry-head,
html[data-cp-theme] .portal .registry-item,
html[data-cp-theme] .portal .registry-list>div,
html[data-cp-theme] .portal .registry-ie-option,
html[data-cp-theme] .portal .public-status-grid>div,
html[data-cp-theme] .portal .permission-readonly,
html[data-cp-theme] .portal .status-line,
html[data-cp-theme] .portal .activation-registry{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .registry-head{background:var(--cp-surface-3)!important}
html[data-cp-theme] .portal .registry-grid{background:var(--cp-border)!important}
html[data-cp-theme] .portal .registry-head p,
html[data-cp-theme] .portal .registry-item span,
html[data-cp-theme] .portal .registry-list span,
html[data-cp-theme] .portal .registry-source,
html[data-cp-theme] .portal .activation-registry span,
html[data-cp-theme] .portal .activation-registry small{color:var(--cp-muted)!important}
html[data-cp-theme] .portal .registry-item strong,
html[data-cp-theme] .portal .registry-mirror summary,
html[data-cp-theme] .portal .registry-list>div,
html[data-cp-theme] .portal .registry-ie-option,
html[data-cp-theme] .portal .activation-registry strong{color:var(--cp-text)!important}
html[data-cp-theme] .portal .registry-list code{color:var(--cp-accent)!important}
html[data-cp-theme] .portal .permission-option:hover,
html[data-cp-theme] .portal .status-line:hover{background:var(--cp-hover)!important}
html[data-cp-theme] .portal .activation-progress span{
  background:var(--cp-surface-2)!important;
  color:var(--cp-muted)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .portal .activation-progress span.on{
  background:linear-gradient(135deg,var(--cp-accent),var(--cp-accent-2))!important;
  color:#fff!important;
  border-color:var(--cp-accent-2)!important;
}
html[data-cp-theme] .portal .activation-progress i{background:var(--cp-border)!important}

/* PDV administration and flow chips */
html[data-cp-theme] .portal .pdv-register024,
html[data-cp-theme] .portal .pdv-meta024 span,
html[data-cp-theme] .portal .flow024 span{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}

/* parameter help */
html[data-cp-theme] .portal .cp-param-info024{
  border-color:var(--cp-border-strong)!important;
  background:var(--cp-surface-2)!important;
  color:var(--cp-muted)!important;
}
html[data-cp-theme] .portal .cp-param-info024:hover,
html[data-cp-theme] .portal .cp-param-info024:focus-visible,
html[data-cp-theme] .portal .cp-param-info024[aria-expanded="true"]{
  border-color:var(--cp-accent)!important;
  background:var(--cp-accent-soft)!important;
  color:var(--cp-accent)!important;
}
html[data-cp-theme] .cp-param-tooltip024{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
  box-shadow:var(--cp-shadow)!important;
}
html[data-cp-theme] .cp-param-tooltip024 strong{color:var(--cp-accent)!important}
html[data-cp-theme] .cp-param-tooltip024 span{color:var(--cp-text)!important}

/* evolution components that keep literal dark colors */
html[data-cp-theme] .portal .cp-evo-actions button,
html[data-cp-theme] .portal .cp-evo-button{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .portal .cp-evo-actions button.primary,
html[data-cp-theme] .portal .cp-evo-button.primary{
  background:linear-gradient(90deg,var(--cp-accent),var(--cp-accent-2))!important;
  color:#fff!important;
}
html[data-cp-theme] .portal .cp-addon ul{color:var(--cp-muted)!important}
html[data-cp-theme] .portal .cp-device-row,
html[data-cp-theme] .portal .cp-mode-row,
html[data-cp-theme] .portal .cp-connector-row{border-color:var(--cp-border)!important}

/* go-live / communications / support */
html[data-cp-theme] .portal .glp-dialog{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .portal .glp-message.customer{background:var(--cp-accent-soft)!important}
html[data-cp-theme] .portal .glp-message.support{background:var(--cp-success-bg)!important}
html[data-cp-theme="light"] .glp-dialog::backdrop{background:rgba(18,40,50,.42)!important}

/* local infrastructure */
html[data-cp-theme] .portal .pc021-code{
  background:var(--cp-bg-soft)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
}

/* ecosystem launchers */
html[data-cp-theme] .portal .ecosystem-flow025 span,
html[data-cp-theme] .portal .ecosystem-role-grid025 span{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .ecosystem-flow025 b{color:var(--cp-accent-2)!important}
html[data-cp-theme="light"] .portal .operation-launcher025{
  background:linear-gradient(135deg,#e5f4f6,#edf8f6)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-accent)!important;
}
html[data-cp-theme="light"] .portal .operation-launcher025 a,
html[data-cp-theme="light"] .portal .operation-launcher-compact025 a{
  background:#fff!important;
  color:var(--cp-accent)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme="light"] .portal .operation-launcher025 a:hover,
html[data-cp-theme="light"] .portal .operation-launcher-compact025 a:hover{
  background:var(--cp-hover)!important;
  border-color:var(--cp-accent)!important;
}

/* Food has its own high-specificity dark contract: explicitly invert it for light. */
html[data-cp-theme="light"] .portal .content.food-service-view024{
  color-scheme:light!important;
  --food-bg-1:var(--cp-surface);
  --food-bg-2:var(--cp-surface-2);
  --food-bg-3:var(--cp-hover);
  --food-line:var(--cp-border);
  --food-line-hover:var(--cp-border-strong);
  --food-text:var(--cp-text);
  --food-muted:var(--cp-muted);
  --food-mint:var(--cp-accent-2);
}
html[data-cp-theme="light"] .portal .content.food-service-view024 > *,
html[data-cp-theme="light"] .portal .content.food-service-view024 .card,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-portal-hero024,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-section024{
  color:var(--cp-text)!important;
  color-scheme:light!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-portal-hero024{
  background:radial-gradient(circle at 100% 0,var(--cp-accent-soft),transparent 45%),var(--cp-surface)!important;
  border-color:var(--cp-border)!important;
  box-shadow:var(--cp-shadow)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-section024,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-waiter-guide024{
  background:var(--cp-surface)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-channel-origin024,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-channel-origin024.external,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-config-box024,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-loyalty024,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-channel-card024,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-external-channel024,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-external-channel024.locked,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-row024,
html[data-cp-theme="light"] .portal .content.food-service-view024 .switch-row{
  background:var(--cp-surface-2)!important;
  border-color:var(--cp-border)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-channel-card024:hover,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-external-channel024:hover,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-row024:hover,
html[data-cp-theme="light"] .portal .content.food-service-view024 .switch-row:hover{
  background:var(--cp-hover)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-check-grid024 span{
  background:var(--cp-success-bg)!important;
  border-color:color-mix(in srgb,var(--cp-success) 35%,var(--cp-border))!important;
  color:var(--cp-success)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-check-grid024 strong,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-rule024 strong{color:var(--cp-accent-2)!important}
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-channel-origin-head024 strong,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-external-channel024 strong,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-config-box024 strong,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-row024 strong,
html[data-cp-theme="light"] .portal .content.food-service-view024 h2,
html[data-cp-theme="light"] .portal .content.food-service-view024 h3{color:var(--cp-text-strong)!important}
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-channel-origin-head024 small,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-external-channel024 small,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-row024 small,
html[data-cp-theme="light"] .portal .content.food-service-view024 .muted,
html[data-cp-theme="light"] .portal .content.food-service-view024 .switch-row small,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-store-select024 span{color:var(--cp-muted)!important}
html[data-cp-theme="light"] .portal .content.food-service-view024 .field input,
html[data-cp-theme="light"] .portal .content.food-service-view024 .field select,
html[data-cp-theme="light"] .portal .content.food-service-view024 .field textarea,
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-store-select024 select{
  background:var(--cp-field)!important;
  border-color:var(--cp-border-strong)!important;
  color:var(--cp-field-text)!important;
  -webkit-text-fill-color:var(--cp-field-text)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 .field input:disabled,
html[data-cp-theme="light"] .portal .content.food-service-view024 .field select:disabled,
html[data-cp-theme="light"] .portal .content.food-service-view024 .field textarea:disabled{
  background:var(--cp-bg-soft)!important;
  color:var(--cp-muted)!important;
  -webkit-text-fill-color:var(--cp-muted)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 option{
  background:var(--cp-field)!important;
  color:var(--cp-field-text)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 .secondary{
  background:var(--cp-surface-2)!important;
  border-color:var(--cp-border-strong)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 .food-rule024{
  background:var(--cp-accent-soft)!important;
  border-color:color-mix(in srgb,var(--cp-accent) 35%,var(--cp-border))!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme="light"] .portal .content.food-service-view024 [style*="background:#fff"],
html[data-cp-theme="light"] .portal .content.food-service-view024 [style*="background: #fff"],
html[data-cp-theme="light"] .portal .content.food-service-view024 [style*="background:white"],
html[data-cp-theme="light"] .portal .content.food-service-view024 [style*="background: white"],
html[data-cp-theme="light"] .portal [style*="background:#fff"],
html[data-cp-theme="light"] .portal [style*="background: #fff"],
html[data-cp-theme="light"] .portal [style*="background:white"],
html[data-cp-theme="light"] .portal [style*="background: white"]{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
}

/* activation/login controls */
html[data-cp-theme] .auth-card .actions .ghost{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .auth-card .notice,
html[data-cp-theme] .mfa-card .notice{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .auth-card .step{background:var(--cp-border)!important}
html[data-cp-theme] .auth-card .step.on{background:var(--cp-accent)!important}

@media(max-width:980px){
  html[data-cp-theme] .portal .nav{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:520px){
  html[data-cp-theme] .portal .nav{grid-template-columns:1fr!important}
}


/* ---------- Detailed component audit: dynamic modules ---------- */
html[data-cp-theme] .portal .lc-warning024,
html[data-cp-theme] .portal .acq-warning,
html[data-cp-theme] .portal .notice.bad,
html[data-cp-theme] .portal .alert.danger{
  background:var(--cp-warning-bg)!important;
  color:var(--cp-warning)!important;
  border-color:color-mix(in srgb,var(--cp-warning) 42%,var(--cp-border))!important;
}
html[data-cp-theme] .portal .acq-success,
html[data-cp-theme] .portal .notice.ok{
  background:var(--cp-success-bg)!important;
  color:var(--cp-success)!important;
  border-color:color-mix(in srgb,var(--cp-success) 42%,var(--cp-border))!important;
}
html[data-cp-theme] .portal .acq-plan,
html[data-cp-theme] .portal .acq-code{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .acq-code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  overflow-wrap:anywhere;
}
html[data-cp-theme] .portal .lc-source-store024{
  border-color:var(--cp-border)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme] .portal .lc-provenance024{color:var(--cp-accent)!important}
html[data-cp-theme] .portal .lc-tabs024 button.active{
  background:var(--cp-accent)!important;
  color:#fff!important;
  border-color:var(--cp-accent)!important;
}
html[data-cp-theme] .portal .lc-state024.open{
  background:var(--cp-success-bg)!important;
  color:var(--cp-success)!important;
  border:1px solid color-mix(in srgb,var(--cp-success) 38%,transparent)!important;
}
html[data-cp-theme] .portal .lc-state024.missing{
  background:var(--cp-warning-bg)!important;
  color:var(--cp-warning)!important;
  border:1px solid color-mix(in srgb,var(--cp-warning) 38%,transparent)!important;
}
html[data-cp-theme] .portal .lc-state024.unknown{
  background:var(--cp-surface-3)!important;
  color:var(--cp-muted)!important;
  border:1px solid var(--cp-border)!important;
}
html[data-cp-theme] .portal .pc021-online.ok,
html[data-cp-theme] .portal .pc020-report-export-status.ok{color:var(--cp-success)!important}
html[data-cp-theme] .portal .pc021-online.off,
html[data-cp-theme] .portal .pc020-report-export-status.error{color:var(--cp-danger)!important}
html[data-cp-theme] .portal .pc021-online.unknown,
html[data-cp-theme] .portal .pc020-report-export-status{color:var(--cp-muted)!important}
html[data-cp-theme] .portal .cp-coupon-tabs button.active{
  background:var(--cp-accent-soft)!important;
  color:var(--cp-accent)!important;
  border-color:var(--cp-accent)!important;
}
html[data-cp-theme] .cp-coupon-modal024{
  background:rgba(3,13,19,.68)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme="light"] .cp-coupon-modal024{
  background:rgba(18,40,50,.42)!important;
}


/* ==========================================================================
   ControlPDV Portal Visual System v2 — auditoria humana por vídeo 2026-09-17
   Somente apresentação. Não altera rotas, eventos, permissões ou contratos API.
   ========================================================================== */

html[data-cp-theme="dark"]{
  --cp-bg:#071119;
  --cp-bg-soft:#091821;
  --cp-surface:#0b1e28;
  --cp-surface-2:#0e2631;
  --cp-surface-3:#11323e;
  --cp-sidebar:#07151d;
  --cp-sidebar-soft:#0a202a;
  --cp-text:#eaf5f8;
  --cp-text-strong:#f7fcfd;
  --cp-muted:#9ab0ba;
  --cp-muted-2:#7f98a3;
  --cp-border:#1c3e4d;
  --cp-border-strong:#2a5667;
  --cp-hover:#102c37;
  --cp-active:#123845;
  --cp-field:#0a222c;
  --cp-field-text:#edf8fa;
  --cp-field-placeholder:#86a1ac;
  --cp-shadow:0 10px 28px rgba(0,0,0,.18);
  --cp-accent:#35bdcd;
  --cp-accent-2:#36c6ae;
  --cp-accent-soft:rgba(53,189,205,.11);
}
html[data-cp-theme="light"]{
  --cp-bg:#edf3f5;
  --cp-bg-soft:#f2f6f7;
  --cp-surface:#ffffff;
  --cp-surface-2:#f7fafb;
  --cp-surface-3:#eef5f6;
  --cp-sidebar:#f8fbfc;
  --cp-sidebar-soft:#f0f6f7;
  --cp-text:#1c3741;
  --cp-text-strong:#102a33;
  --cp-muted:#607983;
  --cp-muted-2:#4d6872;
  --cp-border:#d7e3e7;
  --cp-border-strong:#bfd1d7;
  --cp-hover:#eaf4f5;
  --cp-active:#dceff1;
  --cp-field:#ffffff;
  --cp-field-text:#17323b;
  --cp-field-placeholder:#6f858d;
  --cp-shadow:0 1px 2px rgba(20,52,63,.05),0 10px 26px rgba(20,52,63,.06);
  --cp-accent:#087d91;
  --cp-accent-2:#158f82;
  --cp-accent-soft:rgba(8,125,145,.09);
}

/* Shell e ritmo espacial */
html[data-cp-theme] .portal{
  grid-template-columns:252px minmax(0,1fr)!important;
  background:
    radial-gradient(circle at 92% 0,var(--cp-accent-soft),transparent 28%),
    var(--cp-bg)!important;
}
html[data-cp-theme] .portal>.sidebar{
  padding:17px 13px 14px!important;
  background:var(--cp-sidebar)!important;
  border-right:1px solid var(--cp-border)!important;
  box-shadow:8px 0 28px rgba(14,43,54,.035)!important;
}
html[data-cp-theme] .portal .main{
  padding:22px clamp(22px,2.8vw,44px) 56px!important;
  background:transparent!important;
}
html[data-cp-theme] .portal .content,
html[data-cp-theme] .portal .topbar{
  width:min(1540px,100%)!important;
  margin-inline:auto!important;
}
html[data-cp-theme] .portal .topbar{
  margin-bottom:18px!important;
  padding-bottom:15px!important;
  border-bottom:1px solid var(--cp-border)!important;
}
html[data-cp-theme] .portal .topbar h1{
  font-size:28px!important;
  line-height:1.08!important;
  letter-spacing:-.025em!important;
}
html[data-cp-theme] .portal .topbar p:not(.breadcrumb){
  margin-top:5px!important;
  font-size:13px!important;
  line-height:1.45!important;
}
html[data-cp-theme] .portal .breadcrumb{
  margin-bottom:5px!important;
  font-size:9px!important;
  letter-spacing:.1em!important;
}
html[data-cp-theme] .portal #content{
  display:block;
}
html[data-cp-theme] .portal #content>.card,
html[data-cp-theme] .portal #content>.section,
html[data-cp-theme] .portal #content>.cp-evo-card,
html[data-cp-theme] .portal #content>.glp,
html[data-cp-theme] .portal #content>.cp-legal-card{
  margin-bottom:14px!important;
}

/* Sidebar — hierarquia limpa sem parecer uma lista crua */
html[data-cp-theme] .portal .brandline{
  padding:3px 7px 12px!important;
  gap:10px!important;
}
html[data-cp-theme] .portal .brandline img{width:34px!important}
html[data-cp-theme] .portal .brandline strong{font-size:15px!important}
html[data-cp-theme] .portal .brandline small{font-size:9px!important}
html[data-cp-theme] .portal .cp-nav-category{
  margin:12px 9px 4px!important;
  color:var(--cp-muted-2)!important;
  font-size:8px!important;
  letter-spacing:.14em!important;
}
html[data-cp-theme] .portal .nav{
  gap:1px!important;
  padding-right:4px!important;
}
html[data-cp-theme] .portal .nav button.cp-nav-item{
  min-height:35px!important;
  padding:7px 9px!important;
  gap:9px!important;
  border-radius:9px!important;
  font-size:12px!important;
  line-height:1.22!important;
  font-weight:720!important;
}
html[data-cp-theme] .portal .nav button.cp-nav-item::before{
  width:15px!important;
  height:15px!important;
  flex-basis:15px!important;
  opacity:.82!important;
}
html[data-cp-theme] .portal .nav button.cp-nav-item.active{
  color:var(--cp-text-strong)!important;
  background:var(--cp-active)!important;
  border-color:color-mix(in srgb,var(--cp-accent) 36%,var(--cp-border))!important;
  box-shadow:inset 3px 0 var(--cp-accent)!important;
}
html[data-cp-theme="light"] .portal .nav button.cp-nav-item.active{
  color:#0c5260!important;
  background:#e2f1f3!important;
}
html[data-cp-theme] .portal .operation-launcher025,
html[data-cp-theme] .portal .operation-launcher-compact025{
  padding:10px!important;
  margin:2px 0 10px!important;
  border:1px solid var(--cp-border-strong)!important;
  border-radius:12px!important;
  background:
    linear-gradient(135deg,var(--cp-accent-soft),transparent 72%),
    var(--cp-sidebar-soft)!important;
  box-shadow:none!important;
}
html[data-cp-theme] .portal .operation-launcher025>strong,
html[data-cp-theme] .portal .operation-launcher-compact025>strong{
  color:var(--cp-text-strong)!important;
  font-size:11px!important;
  letter-spacing:.01em!important;
}
html[data-cp-theme] .portal .operation-launcher025>div,
html[data-cp-theme] .portal .operation-launcher-compact025>div{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:6px!important;
  margin-top:7px!important;
}
html[data-cp-theme] .portal .operation-launcher025 a,
html[data-cp-theme] .portal .operation-launcher-compact025 a{
  min-height:31px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:6px 7px!important;
  border:1px solid var(--cp-border-strong)!important;
  border-radius:8px!important;
  background:var(--cp-surface)!important;
  color:var(--cp-accent)!important;
  font-size:10px!important;
  font-weight:850!important;
  text-decoration:none!important;
}
html[data-cp-theme="dark"] .portal .operation-launcher025 a,
html[data-cp-theme="dark"] .portal .operation-launcher-compact025 a{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme] .portal .cp-theme-control{
  margin-top:10px!important;
  padding-top:9px!important;
}
html[data-cp-theme] .portal .cp-theme-toggle{
  min-height:34px!important;
  padding:6px 9px!important;
  border-radius:9px!important;
  box-shadow:none!important;
}
html[data-cp-theme] .portal .sidebar-footer{
  margin-top:10px!important;
  padding-top:10px!important;
  gap:7px!important;
  border-top:1px solid var(--cp-border)!important;
}
html[data-cp-theme] .portal .user-mini{
  padding:9px 10px!important;
  border-radius:9px!important;
  background:var(--cp-sidebar-soft)!important;
  border:1px solid var(--cp-border)!important;
  box-shadow:none!important;
}
html[data-cp-theme] .portal .user-mini strong{font-size:11px!important}
html[data-cp-theme] .portal .user-mini span{
  font-size:9px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
html[data-cp-theme] .portal .sidebar-footer>.ghost{
  min-height:34px!important;
  padding:7px 10px!important;
}

/* Tipografia e cabeçalhos internos */
html[data-cp-theme] .portal h2{
  font-size:18px!important;
  line-height:1.18!important;
  letter-spacing:-.012em!important;
}
html[data-cp-theme] .portal h3{
  line-height:1.25!important;
}
html[data-cp-theme] .portal .eyebrow{
  color:var(--cp-accent-2)!important;
  font-size:9px!important;
  letter-spacing:.12em!important;
}
html[data-cp-theme="light"] .portal .eyebrow{
  color:#148878!important;
}
html[data-cp-theme] .portal .muted{
  line-height:1.48!important;
}
html[data-cp-theme] .portal .section-head{
  margin-bottom:12px!important;
}

/* Superfícies: uma única linguagem visual */
html[data-cp-theme] .portal .card,
html[data-cp-theme] .portal .cp-evo-card,
html[data-cp-theme] .portal .glp,
html[data-cp-theme] .portal .cp-legal-card,
html[data-cp-theme] .modal-back .modal,
html[data-cp-theme] .glp-dialog{
  border:1px solid var(--cp-border)!important;
  border-radius:14px!important;
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  box-shadow:var(--cp-shadow)!important;
}
html[data-cp-theme] .portal .card{
  padding:16px!important;
}
html[data-cp-theme] .portal .card .card{
  background:var(--cp-surface-2)!important;
  box-shadow:none!important;
}
html[data-cp-theme] .portal .hero-card{
  min-height:168px!important;
  background:
    radial-gradient(circle at 90% 8%,var(--cp-accent-soft),transparent 45%),
    var(--cp-surface)!important;
}
html[data-cp-theme] .portal .quick-section{
  padding:14px!important;
}
html[data-cp-theme] .portal .dashboard-grid,
html[data-cp-theme] .portal .billing-kpis{
  gap:10px!important;
}
html[data-cp-theme] .portal .kpi{
  min-height:82px!important;
  padding:14px!important;
}
html[data-cp-theme] .portal .kpi span{
  font-size:9px!important;
  letter-spacing:.08em!important;
}
html[data-cp-theme] .portal .kpi strong{
  margin:5px 0 2px!important;
  font-size:21px!important;
  line-height:1.1!important;
}
html[data-cp-theme] .portal .kpi small{font-size:10px!important}
html[data-cp-theme] .portal .metric-list{
  gap:8px!important;
}
html[data-cp-theme] .portal .metric-list>div,
html[data-cp-theme] .portal .public-status-grid>div,
html[data-cp-theme] .portal .supplier-summary>span{
  padding:10px 11px!important;
  border-radius:9px!important;
  border:1px solid var(--cp-border)!important;
  background:var(--cp-surface-2)!important;
  box-shadow:none!important;
}

/* Tabelas */
html[data-cp-theme] .portal .table-wrap,
html[data-cp-theme] .portal .cp-table-wrap{
  border-radius:11px!important;
  border:1px solid var(--cp-border)!important;
  background:var(--cp-surface)!important;
  box-shadow:none!important;
}
html[data-cp-theme] .portal table,
html[data-cp-theme] .portal .table{
  background:transparent!important;
}
html[data-cp-theme] .portal table th,
html[data-cp-theme] .portal .table th{
  padding:9px 11px!important;
  background:var(--cp-surface-3)!important;
  color:var(--cp-muted)!important;
  font-size:8px!important;
  letter-spacing:.075em!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal table td,
html[data-cp-theme] .portal .table td{
  padding:10px 11px!important;
  border-color:var(--cp-border)!important;
  background:var(--cp-surface)!important;
}
html[data-cp-theme] .portal table tbody tr:hover td,
html[data-cp-theme] .portal .table tbody tr:hover td{
  background:var(--cp-hover)!important;
}

/* Formulários */
html[data-cp-theme] .portal .field{
  gap:5px!important;
  margin:10px 0!important;
}
html[data-cp-theme] .portal .field>span,
html[data-cp-theme] .modal-back .field>span{
  font-size:10px!important;
  font-weight:800!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme] .portal input:not([type="checkbox"]):not([type="radio"]),
html[data-cp-theme] .portal select,
html[data-cp-theme] .portal textarea,
html[data-cp-theme] .modal-back input:not([type="checkbox"]):not([type="radio"]),
html[data-cp-theme] .modal-back select,
html[data-cp-theme] .modal-back textarea{
  min-height:38px!important;
  padding:9px 11px!important;
  border-radius:8px!important;
  border:1px solid var(--cp-border-strong)!important;
  background:var(--cp-field)!important;
  color:var(--cp-field-text)!important;
  -webkit-text-fill-color:var(--cp-field-text)!important;
}
html[data-cp-theme] .portal textarea,
html[data-cp-theme] .modal-back textarea{min-height:84px!important}
html[data-cp-theme] .portal input:focus,
html[data-cp-theme] .portal select:focus,
html[data-cp-theme] .portal textarea:focus,
html[data-cp-theme] .modal-back input:focus,
html[data-cp-theme] .modal-back select:focus,
html[data-cp-theme] .modal-back textarea:focus{
  border-color:var(--cp-accent)!important;
  box-shadow:0 0 0 3px var(--cp-accent-soft)!important;
}

/* Botões e estados */
html[data-cp-theme] .portal .primary,
html[data-cp-theme] .modal-back .primary{
  min-height:36px!important;
  padding:8px 13px!important;
  border-radius:8px!important;
  background:linear-gradient(90deg,var(--cp-accent),var(--cp-accent-2))!important;
  color:#fff!important;
  box-shadow:0 5px 14px color-mix(in srgb,var(--cp-accent) 18%,transparent)!important;
}
html[data-cp-theme] .portal .secondary,
html[data-cp-theme] .portal .ghost,
html[data-cp-theme] .modal-back .secondary,
html[data-cp-theme] .modal-back .ghost{
  min-height:35px!important;
  padding:7px 12px!important;
  border-radius:8px!important;
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border:1px solid var(--cp-border-strong)!important;
  box-shadow:none!important;
}
html[data-cp-theme] .portal .secondary:hover,
html[data-cp-theme] .portal .ghost:hover,
html[data-cp-theme] .modal-back .secondary:hover,
html[data-cp-theme] .modal-back .ghost:hover{
  background:var(--cp-hover)!important;
  border-color:var(--cp-accent)!important;
}
html[data-cp-theme] .portal .badge,
html[data-cp-theme] .portal .permission-chip,
html[data-cp-theme] .portal .cp-evo-badge,
html[data-cp-theme] .portal .cp-legal-status{
  padding:5px 8px!important;
  border-radius:999px!important;
  font-size:9px!important;
  line-height:1.15!important;
}
html[data-cp-theme] .portal .notice,
html[data-cp-theme] .portal .cp-inline-note,
html[data-cp-theme] .portal .glp-note{
  border-radius:10px!important;
  padding:10px 12px!important;
  box-shadow:none!important;
}

/* Modal: corrigir componentes fora do .portal (erro visível na gravação) */
html[data-cp-theme] .modal-back{
  backdrop-filter:blur(5px)!important;
}
html[data-cp-theme="light"] .modal-back{background:rgba(22,47,57,.36)!important}
html[data-cp-theme="dark"] .modal-back{background:rgba(0,7,11,.68)!important}
html[data-cp-theme] .modal-back .modal{
  padding:19px!important;
}
html[data-cp-theme] .modal-back .permission-option,
html[data-cp-theme] .modal-back .permission-readonly,
html[data-cp-theme] .modal-back .switch-row,
html[data-cp-theme] .modal-back .credential-box,
html[data-cp-theme] .modal-back .status-line{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
  box-shadow:none!important;
}
html[data-cp-theme="light"] .modal-back .permission-option:hover,
html[data-cp-theme="light"] .modal-back .switch-row:hover{
  background:#edf6f7!important;
  border-color:var(--cp-accent)!important;
}
html[data-cp-theme] .modal-back h1,
html[data-cp-theme] .modal-back h2,
html[data-cp-theme] .modal-back h3,
html[data-cp-theme] .modal-back strong{color:var(--cp-text-strong)!important}
html[data-cp-theme] .modal-back small,
html[data-cp-theme] .modal-back .muted{color:var(--cp-muted)!important}

/* Espelho cadastral: nunca mais dark dentro do tema claro */
html[data-cp-theme] .registry-mirror{
  border:1px solid var(--cp-border)!important;
  border-radius:12px!important;
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  box-shadow:none!important;
}
html[data-cp-theme] .registry-head{
  padding:13px 14px!important;
  background:var(--cp-surface-3)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .registry-grid{
  gap:1px!important;
  background:var(--cp-border)!important;
}
html[data-cp-theme] .registry-item,
html[data-cp-theme] .registry-list>div,
html[data-cp-theme] .registry-ie-option{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .registry-mirror details,
html[data-cp-theme] .registry-source{
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .registry-mirror summary,
html[data-cp-theme] .registry-source,
html[data-cp-theme] .registry-item span,
html[data-cp-theme] .registry-list span{
  color:var(--cp-muted)!important;
}
html[data-cp-theme] .registry-item strong,
html[data-cp-theme] .registry-list strong{color:var(--cp-text-strong)!important}
html[data-cp-theme="light"] .registry-list code{
  background:#e5f1f3!important;
  color:#0d6676!important;
  border-color:#c9e0e5!important;
}

/* Contratação, plano, adicionais e mini-cards */
html[data-cp-theme] .portal .acq-plan,
html[data-cp-theme] .portal .acq-step,
html[data-cp-theme] .portal .cp-evo-mini,
html[data-cp-theme] .portal .cp-addon,
html[data-cp-theme] .portal .glp-mini,
html[data-cp-theme] .portal .pdv-register024,
html[data-cp-theme] .portal .connector-store025,
html[data-cp-theme] .portal .client-delivery-box025{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border:1px solid var(--cp-border)!important;
  border-radius:11px!important;
  box-shadow:none!important;
}
html[data-cp-theme="light"] .portal .acq-plan,
html[data-cp-theme="light"] .portal .cp-evo-mini,
html[data-cp-theme="light"] .portal .glp-mini{
  background:#f8fbfc!important;
}
html[data-cp-theme] .portal .acq-plan ul,
html[data-cp-theme] .portal .cp-addon ul{
  color:var(--cp-muted)!important;
}
html[data-cp-theme] .portal .acq-price,
html[data-cp-theme] .portal .cp-addon .price{
  color:var(--cp-text-strong)!important;
}

/* Lojas / dispositivos / mapa de entidades — superfícies que ficaram pretas no light */
html[data-cp-theme] .portal .pdv-meta024 span,
html[data-cp-theme] .portal .flow024 span,
html[data-cp-theme] .portal .ecosystem-flow025 span,
html[data-cp-theme] .portal .ecosystem-role-grid025 span,
html[data-cp-theme] .portal .cp-inline-note,
html[data-cp-theme] .portal .security-note024,
html[data-cp-theme] .portal .connector-stores025,
html[data-cp-theme] .portal .food-check-grid024 span{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
  box-shadow:none!important;
}
html[data-cp-theme] .portal .flow024 b,
html[data-cp-theme] .portal .ecosystem-flow025 b{color:var(--cp-accent)!important}
html[data-cp-theme="light"] .portal .pdv-meta024 span,
html[data-cp-theme="light"] .portal .flow024 span,
html[data-cp-theme="light"] .portal .ecosystem-flow025 span,
html[data-cp-theme="light"] .portal .ecosystem-role-grid025 span{
  background:#f5f9fa!important;
}

/* Food: preservar identidade sem criar uma ilha dark no tema claro */
html[data-cp-theme="light"] .portal .content.food-service-view024,
html[data-cp-theme="light"] .portal .food-portal-hero024,
html[data-cp-theme="light"] .portal .food-section024,
html[data-cp-theme="light"] .portal .food-config-box024,
html[data-cp-theme="light"] .portal .food-channel-origin024,
html[data-cp-theme="light"] .portal .food-loyalty024,
html[data-cp-theme="light"] .portal .food-waiter-guide024,
html[data-cp-theme="light"] .portal .food-subsection025{
  color-scheme:light!important;
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] .portal .food-row024,
html[data-cp-theme="light"] .portal .food-channel-card024,
html[data-cp-theme="light"] .portal .food-external-channel024,
html[data-cp-theme="light"] .portal .food-channel-origin024.external,
html[data-cp-theme="light"] .portal .connector-store025{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] .portal .food-section024 strong,
html[data-cp-theme="light"] .portal .food-section024 h2,
html[data-cp-theme="light"] .portal .food-section024 h3,
html[data-cp-theme="light"] .portal .food-row024 strong{
  color:var(--cp-text-strong)!important;
}
html[data-cp-theme="light"] .portal .food-section024 small,
html[data-cp-theme="light"] .portal .food-row024 small,
html[data-cp-theme="light"] .portal .food-section024 .muted{
  color:var(--cp-muted)!important;
}

/* Central de cargas / relatórios / infraestrutura */
html[data-cp-theme] .portal .lc-filters024,
html[data-cp-theme] .portal .lc-sync024,
html[data-cp-theme] .portal .lc-source-note024,
html[data-cp-theme] .portal .lc-detail-grid024>div,
html[data-cp-theme] .portal .reports-filters,
html[data-cp-theme] .portal .pc021-summary,
html[data-cp-theme] .portal .pc021-result{
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] .portal .lc-warning024,
html[data-cp-theme] .portal .acq-warning{
  background:var(--cp-warning-bg)!important;
  color:var(--cp-warning)!important;
}
html[data-cp-theme] .portal .acq-success{
  background:var(--cp-success-bg)!important;
  color:var(--cp-success)!important;
}

/* Tema claro precisa de profundidade, não branco chapado */
html[data-cp-theme="light"] .portal .card,
html[data-cp-theme="light"] .portal .cp-evo-card,
html[data-cp-theme="light"] .portal .glp,
html[data-cp-theme="light"] .portal .cp-legal-card{
  box-shadow:0 1px 2px rgba(17,52,63,.045),0 8px 24px rgba(17,52,63,.045)!important;
}
html[data-cp-theme="light"] .portal .card .card,
html[data-cp-theme="light"] .portal .metric-list>div,
html[data-cp-theme="light"] .portal .public-status-grid>div{
  box-shadow:none!important;
}
html[data-cp-theme="light"] .portal .top-actions .badge,
html[data-cp-theme="light"] .portal .version-chip{
  background:#f8fbfc!important;
}

/* Tema escuro: menos borda neon, mais contraste por superfície */
html[data-cp-theme="dark"] .portal .card,
html[data-cp-theme="dark"] .portal .cp-evo-card,
html[data-cp-theme="dark"] .portal .glp{
  background:linear-gradient(180deg,#0b202a,#091b24)!important;
  border-color:#1c4150!important;
}
html[data-cp-theme="dark"] .portal .card .card,
html[data-cp-theme="dark"] .portal .metric-list>div{
  background:#0c252f!important;
}

/* Responsivo */
@media(max-width:1180px){
  html[data-cp-theme] .portal{grid-template-columns:224px minmax(0,1fr)!important}
  html[data-cp-theme] .portal .main{padding:20px 24px 48px!important}
}
@media(max-width:820px){
  html[data-cp-theme] .portal{display:block!important}
  html[data-cp-theme] .portal>.sidebar{position:relative!important;height:auto!important}
  html[data-cp-theme] .portal .nav{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html[data-cp-theme] .portal .operation-launcher025>div{grid-template-columns:1fr 1fr!important}
}
@media(max-width:520px){
  html[data-cp-theme] .portal .nav{grid-template-columns:1fr!important}
  html[data-cp-theme] .portal .operation-launcher025>div{grid-template-columns:1fr!important}
}


/* Registry readiness / busca cadastral: componentes injetados no root */
html[data-cp-theme] .portal .cp-registry-grid{
  gap:12px!important;
}
html[data-cp-theme] .portal .cp-registry-block{
  border:1px solid var(--cp-border)!important;
  border-radius:12px!important;
  padding:14px!important;
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  box-shadow:none!important;
}
html[data-cp-theme] .portal .cp-registry-kv span,
html[data-cp-theme] .portal .cp-registry-source{
  color:var(--cp-muted)!important;
}
html[data-cp-theme] .portal .cp-registry-kv strong{
  color:var(--cp-text-strong)!important;
}
html[data-cp-theme] .portal .cp-registry-actions button{
  min-height:34px!important;
  padding:7px 11px!important;
  border:1px solid var(--cp-border-strong)!important;
  border-radius:8px!important;
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
}
html[data-cp-theme] .portal .cp-registry-actions button:hover{
  background:var(--cp-hover)!important;
  border-color:var(--cp-accent)!important;
}
html[data-cp-theme] .portal .registry-search select,
html[data-cp-theme] .portal .registry-search input,
html[data-cp-theme] .portal .ie-search input{
  background:var(--cp-field)!important;
  color:var(--cp-field-text)!important;
  -webkit-text-fill-color:var(--cp-field-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] .portal .registry-search input:focus,
html[data-cp-theme] .portal .registry-search select:focus,
html[data-cp-theme] .portal .ie-search input:focus{
  border-color:var(--cp-accent)!important;
  box-shadow:0 0 0 3px var(--cp-accent-soft)!important;
}
html[data-cp-theme] .portal .success,
html[data-cp-theme] .modal-back .success{
  background:var(--cp-success-bg)!important;
  color:var(--cp-success)!important;
  border-color:color-mix(in srgb,var(--cp-success) 36%,var(--cp-border))!important;
}


/* ==========================================================================
   ControlPDV Portal Visual System v3 — unified render + full viewport
   2026-09-18
   A camada abaixo fecha a aparência do Portal após a consolidação do renderer.
   ========================================================================== */

/* O Portal é uma aplicação administrativa: usar a largura útil, sem "site centralizado". */
html[data-cp-theme] .portal{
  grid-template-columns:240px minmax(0,1fr)!important;
}
html[data-cp-theme] .portal .main{
  position:relative!important;
  min-width:0!important;
  padding:18px clamp(16px,1.35vw,26px) 40px!important;
}
html[data-cp-theme] .portal .content,
html[data-cp-theme] .portal .topbar{
  width:100%!important;
  max-width:none!important;
  margin-inline:0!important;
  box-sizing:border-box!important;
}
html[data-cp-theme] .portal .topbar{
  margin-bottom:14px!important;
}
html[data-cp-theme] .portal #content{
  min-width:0!important;
}

/* Troca de rota atômica: a tela anterior nunca permanece por baixo da nova. */
html[data-cp-theme] .portal .main[data-cp-view-loading] #content{
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
html[data-cp-theme] .portal .main[data-cp-view-loading]::after{
  content:"";
  position:absolute;
  z-index:4;
  left:clamp(16px,1.35vw,26px);
  right:clamp(16px,1.35vw,26px);
  top:108px;
  height:112px;
  border:1px solid var(--cp-border);
  border-radius:14px;
  background:
    linear-gradient(90deg,transparent 0,rgba(127,160,170,.10) 48%,transparent 100%),
    var(--cp-surface);
  background-size:240% 100%,100% 100%;
  animation:cp-view-loading026 1.05s linear infinite;
  box-shadow:var(--cp-shadow);
}
@keyframes cp-view-loading026{to{background-position:-240% 0,0 0}}
html.cp-theme-switching *,
html.cp-theme-switching *::before,
html.cp-theme-switching *::after{
  transition:none!important;
  animation-duration:0s!important;
}

/* Uma superfície semântica para todos os módulos, inclusive os injetados em runtime. */
html[data-cp-theme] :is(
  .portal .card,
  .portal .cp-evo-card,
  .portal .glp,
  .portal .glp-mini,
  .portal .acq-plan,
  .portal .acq-step,
  .portal .cp-addon,
  .portal .pdv-register024,
  .portal .connector-card024,
  .portal .connector-store025,
  .portal .client-delivery-box025,
  .portal .client-card025,
  .portal .store-card025,
  .portal .cp-registry-block,
  .portal .registry-mirror,
  .portal .registry-item,
  .portal .permission-option,
  .portal .pc019-layer,
  .portal .lc-provider-option026
){
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] :is(
  .portal .card,
  .portal .cp-evo-card,
  .portal .glp,
  .portal .glp-mini,
  .portal .acq-plan,
  .portal .acq-step,
  .portal .cp-addon,
  .portal .pdv-register024,
  .portal .connector-card024,
  .portal .connector-store025,
  .portal .client-delivery-box025,
  .portal .client-card025,
  .portal .store-card025,
  .portal .cp-registry-block,
  .portal .registry-mirror,
  .portal .registry-item,
  .portal .permission-option,
  .portal .pc019-layer,
  .portal .lc-provider-option026
){
  background:var(--cp-surface)!important;
}
html[data-cp-theme="light"] :is(
  .portal .card .card,
  .portal .glp-mini,
  .portal .cp-evo-mini,
  .portal .cp-addon,
  .portal .pdv-meta024 span,
  .portal .flow024 span,
  .portal .ecosystem-flow025 span,
  .portal .metric-list>div,
  .portal .public-status-grid>div,
  .portal .supplier-summary>span,
  .portal .registry-item,
  .portal .registry-list>div,
  .portal .permission-option,
  .portal .lc-provider-option026,
  .portal .cp019-layer
){
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
}

/* Sidebar/footer: sem faixa escura residual no tema claro. */
html[data-cp-theme] .portal .sidebar-footer,
html[data-cp-theme] .portal .cp-theme-control{
  background:transparent!important;
}
html[data-cp-theme="light"] .portal :is(.user-mini,.cp-theme-toggle,.operation-launcher025,.operation-launcher-compact025){
  background:var(--cp-sidebar-soft)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] .portal .sidebar-footer>.ghost{
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}

/* Campos nunca herdam fundo/texto do tema oposto. */
html[data-cp-theme] :is(
  .portal input,
  .portal select,
  .portal textarea,
  .modal-back input,
  .modal-back select,
  .modal-back textarea,
  .glp-dialog input,
  .glp-dialog select,
  .glp-dialog textarea
){
  background:var(--cp-field)!important;
  color:var(--cp-field-text)!important;
  -webkit-text-fill-color:var(--cp-field-text)!important;
  border-color:var(--cp-border-strong)!important;
}
html[data-cp-theme] :is(.portal input,.portal select,.portal textarea):focus{
  border-color:var(--cp-accent)!important;
  box-shadow:0 0 0 3px var(--cp-accent-soft)!important;
}

/* Modais e superfícies fora do .portal também obedecem ao tema global. */
html[data-cp-theme] :is(.modal-back .modal,.glp-dialog,.cp-legal-card){
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] :is(.modal-back .permission-option,.glp-dialog,.cp-legal-card){
  background:#fff!important;
  color:var(--cp-text)!important;
}

/* Espelho cadastral: nenhum fragmento dark no tema claro. */
html[data-cp-theme="light"] :is(
  .registry-mirror,
  .registry-head,
  .registry-item,
  .registry-list>div,
  .registry-source,
  .cp-registry-block,
  .cp-registry-kv,
  .activation-registry
){
  color-scheme:light!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] .registry-head{background:var(--cp-surface-3)!important}
html[data-cp-theme="light"] :is(.registry-item,.registry-list>div,.cp-registry-block,.activation-registry){
  background:var(--cp-surface-2)!important;
}

/* PDVs/Caixas: cards com grade, contorno e metadados legíveis. */
html[data-cp-theme] .portal .pdv-register-grid024{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(290px,1fr))!important;
  gap:12px!important;
  align-items:stretch!important;
}
html[data-cp-theme] .portal .pdv-register024{
  min-width:0!important;
  padding:15px!important;
  border:1px solid var(--cp-border)!important;
  border-radius:12px!important;
  background:var(--cp-surface)!important;
}
html[data-cp-theme] .portal .pdv-meta024{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  margin:12px 0!important;
}
html[data-cp-theme] .portal .pdv-meta024 span{
  min-width:0!important;
  padding:9px 10px!important;
  border:1px solid var(--cp-border)!important;
  border-radius:9px!important;
  background:var(--cp-surface-2)!important;
}
html[data-cp-theme] .portal .pdv-meta024 strong{
  display:block!important;
  margin-top:4px!important;
  color:var(--cp-text-strong)!important;
  overflow-wrap:anywhere!important;
}

/* Cargas/conectores/clientes/lojas: remover cores legadas fixas. */
html[data-cp-theme] .portal :is(
  .lc-sync024,
  .lc-filters024,
  .lc-source-note024,
  .lc-detail-grid024>div,
  .lc-provider-option026,
  .connector-stores025,
  .security-note024,
  .client-delivery-box025
){
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] .portal :is(
  .lc-source-status024 code,
  .glp-note,
  .glp-notification,
  .cp-inline-note,
  .security-note024
){
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}

/* Densidade desktop: aproveitar viewport sem comprimir a leitura. */
@media(min-width:1440px){
  html[data-cp-theme] .portal .main{padding-left:20px!important;padding-right:20px!important}
  html[data-cp-theme] .portal .dashboard-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media(max-width:1180px){
  html[data-cp-theme] .portal{grid-template-columns:220px minmax(0,1fr)!important}
  html[data-cp-theme] .portal .main{padding:18px 18px 36px!important}
}
@media(max-width:760px){
  html[data-cp-theme] .portal .pdv-meta024{grid-template-columns:1fr!important}
}

html[data-cp-theme] .portal .cp-registry-master026{grid-column:1/-1!important}
html[data-cp-theme] .portal .cp-registry-kv-master026{grid-template-columns:minmax(130px,.42fr) minmax(0,1.58fr)!important}
html[data-cp-theme] .portal .cp-registry-details026{
  margin-top:10px!important;
  border-top:1px solid var(--cp-border)!important;
  padding-top:8px!important;
}
html[data-cp-theme] .portal .cp-registry-details026 summary{
  color:var(--cp-text-strong)!important;
  cursor:pointer!important;
  font-weight:750!important;
}
@media(max-width:760px){
  html[data-cp-theme] .portal .cp-registry-kv-master026{grid-template-columns:1fr!important}
}


/* Legacy variable bridge v3 — módulos antigos obedecem ao mesmo tema, sem ilhas dark. */
html[data-cp-theme]{
  --bg:var(--cp-bg)!important;
  --bg2:var(--cp-bg-soft)!important;
  --panel:var(--cp-surface)!important;
  --panel2:var(--cp-surface-2)!important;
  --panel-2:var(--cp-surface-2)!important;
  --line:var(--cp-border)!important;
  --line2:var(--cp-border-strong)!important;
  --border:var(--cp-border)!important;
  --border2:var(--cp-border-strong)!important;
  --text:var(--cp-text)!important;
  --muted:var(--cp-muted)!important;
  --cyan:var(--cp-accent)!important;
  --mint:var(--cp-accent-2)!important;
  --accent:var(--cp-accent)!important;
  --danger:var(--cp-danger)!important;
  --warn:var(--cp-warning)!important;
  --ok:var(--cp-success)!important;
  --shadow:var(--cp-shadow)!important;
  --cp-field-bg:var(--cp-field)!important;
  --cp-field-border:var(--cp-border-strong)!important;

  --cp-field-muted:var(--cp-field-placeholder)!important;
  --cp-panel-soft:var(--cp-surface-2)!important;
}
html[data-cp-theme="light"] .portal :is(
  .pc011-plan,
  .pc011-commercial,
  .pc012-item,
  .pc013-diagnostics,
  .pc013-info,
  .cp-report-kpi,
  .cp-report-cover-preview,
  .cp-logo-box
){
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] :is(.pc012-dialog,.glp-dialog){
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme="light"] .portal :is(
  .pc011-badge,
  .pc012-meta,
  .pc012-copy p,
  .pc013-diagnostics>span,
  .pc013-info,
  .pc011-plan p,
  .pc011-plan-cap span
){color:var(--cp-muted)!important}
html[data-cp-theme="light"] .portal .pc013-info strong,
html[data-cp-theme="light"] .portal .pc011-plan h3,
html[data-cp-theme="light"] .portal .pc011-price{color:var(--cp-text-strong)!important}


/* ==========================================================================
   ControlPDV Portal Visual System v4 — single render engine
   Runtime modules must consume the same theme tokens. This final layer also
   protects the shell against legacy/injected styles loaded after older CSS.
   ========================================================================== */
html[data-cp-theme] body,
html[data-cp-theme] .portal,
html[data-cp-theme] .portal .main,
html[data-cp-theme] .portal #content,
html[data-cp-theme] .portal .content{
  color:var(--cp-text)!important;
}
html[data-cp-theme="light"] body,
html[data-cp-theme="light"] .portal,
html[data-cp-theme="light"] .portal .main,
html[data-cp-theme="light"] .portal #content,
html[data-cp-theme="light"] .portal .content{
  background:var(--cp-bg)!important;
  color-scheme:light!important;
}
html[data-cp-theme="dark"] body,
html[data-cp-theme="dark"] .portal,
html[data-cp-theme="dark"] .portal .main,
html[data-cp-theme="dark"] .portal #content,
html[data-cp-theme="dark"] .portal .content{
  background:var(--cp-bg)!important;
  color-scheme:dark!important;
}
html[data-cp-theme] :is(
  .glp-dialog,
  .pc012-dialog,
  .cp-contract-text,
  .cp-coupon-json024,
  .pc013-diagnostics,
  .pc013-info,
  .lc-provider-option026,
  .lc-sync024,
  .lc-filters024,
  .lc-source-note024,
  .pc021-result,
  .pc020-report-export-status
){
  background:var(--cp-surface-2)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] :is(
  .cp-legal-card,
  .pc012-item,
  .glp-mini,
  .cp-evo-card,
  .pdv-register024,
  .connector-card024,
  .connector-store025
){
  background:var(--cp-surface)!important;
  color:var(--cp-text)!important;
  border-color:var(--cp-border)!important;
}
html[data-cp-theme] :is(.cp-legal-note,.pc013-info,.glp-note,.pc012-notice){
  color:var(--cp-text)!important;
}
html[data-cp-theme] :is(.cp-legal-note.warn,.cp-legal-lock){
  background:var(--cp-warning-bg)!important;
  color:var(--cp-warning)!important;
  border-color:color-mix(in srgb,var(--cp-warning) 40%,var(--cp-border))!important;
}
html[data-cp-theme] :is(.pc020-report-export-status.error){color:var(--cp-danger)!important}
html[data-cp-theme] :is(.pc020-report-export-status.ok,.pc021-online.ok){color:var(--cp-success)!important}
