/* AKILL FOOD — tema global e protecoes responsivas */
:root{
  --ak-orange:#ff6a00;
  --ak-dark:#0d0e13;
  --ak-dark-panel:#15171e;
  --ak-dark-panel-2:#1b1e26;
  --ak-dark-line:#2e323d;
  --ak-dark-text:#f5f6f8;
  --ak-dark-muted:#a0a5af;
  --ak-light:#f4f6f8;
  --ak-light-panel:#ffffff;
  --ak-light-line:#dfe3e8;
  --ak-light-text:#1c1e23;
  --ak-light-muted:#666c76;
}
html,body{max-width:100%;overflow-x:hidden}
img,video,canvas,svg{max-width:100%}
input,select,textarea,button{max-width:100%}

/* botao fixo de tema */
.ak-theme-toggle{
  position:fixed;
  top:18px;
  right:18px;
  z-index:999;
  min-width:126px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 14px;
  border:1px solid rgba(128,132,142,.32);
  border-radius:12px;
  background:rgba(20,22,28,.96);
  color:#fff;
  box-shadow:0 10px 28px rgba(0,0,0,.22);
  backdrop-filter:blur(12px);
  cursor:pointer;
  font:800 11px/1 Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  white-space:nowrap;
  transition:transform .18s ease,background .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.ak-theme-toggle:hover{transform:translateY(-1px);box-shadow:0 14px 32px rgba(0,0,0,.25)}
.ak-theme-toggle svg{width:18px;height:18px;display:block;flex:0 0 auto}
.ak-theme-toggle .ak-theme-label{display:block}
html[data-ak-theme="light"] .ak-theme-toggle{
  background:rgba(255,255,255,.96);
  color:#252830;
  border-color:#d7dbe2;
  box-shadow:0 8px 24px rgba(24,32,44,.12);
}
html[data-ak-theme="dark"] .ak-theme-toggle{
  background:rgba(20,22,28,.94);
  color:#fff;
  border-color:#363a45;
}

/* espaco para o botao fixo nao cobrir controles */
.dashboard-topbar,.plans-topbar,.signup-top{padding-right:160px!important}

/* ---------- MODO ESCURO em paginas originalmente claras ---------- */
html[data-ak-theme="dark"] body:not(.login-page):not(.home-sales-page){
  background:var(--ak-dark)!important;
  color:var(--ak-dark-text)!important;
}
html[data-ak-theme="dark"] :is(
  .signup-page,.dashboard-shell,.dashboard-main,.plans-page,.paused-page,
  .storefront-shell,.menu-admin-main,.settings-main,.auth-shell
){
  background:var(--ak-dark)!important;
  color:var(--ak-dark-text)!important;
}
html[data-ak-theme="dark"] :is(
  .signup-card,.pricing-card,.paused-card,.desktop-sidebar,.dashboard-topbar,
  .dashboard-stats article,.order-card,.category-box,.products-admin,.admin-product,
  .admin-modal-card,.settings-card,.store-header,.store-summary article,.category,
  .product-card,.store-benefit,.cart-bar,.auth-card,.plans-message,.subscription-banner
){
  background:var(--ak-dark-panel)!important;
  border-color:var(--ak-dark-line)!important;
  color:var(--ak-dark-text)!important;
  box-shadow:none!important;
}
html[data-ak-theme="dark"] :is(
  .order-column,.order-column>header,.customer-box,.order-empty .empty-icon,.category .category-emoji,
  .header-search,.header-cart,.price-note,.media-note,.no-photo,.category-chip,
  .panel-link,.prep-time-btn,.print-order-btn,.admin-product-actions button,
  .category-box input,.category-box form button,.admin-modal input,.admin-modal textarea,
  .admin-modal select,.settings-card input,.signup-grid input,.signup-grid select
){
  background:var(--ak-dark-panel-2)!important;
  border-color:var(--ak-dark-line)!important;
  color:var(--ak-dark-text)!important;
}
html[data-ak-theme="dark"] :is(
  .plans-hero h1,.plan-top h2,.price-row,.pricing-card li,.paused-card h1,
  .signup-intro h1,.signup-intro h2,.signup-card-title h2,.signup-grid label,
  .topbar-title strong,.dashboard-stats strong,.order-column>header strong,.order-card-head strong,
  .customer-box strong,.order-card li,.menu-toolbar h1,.category-box strong,.products-head strong,
  .admin-product-copy strong,.modal-head h2,.settings-intro h1,.card-head h2,
  .switch-row strong,.store-brand-copy strong,.menu-heading h2,.section-head h2,
  .product-info h3
){
  color:var(--ak-dark-text)!important;
}
html[data-ak-theme="dark"] :is(
  .plans-hero>p,.plans-trust,.plan-top p,.price-row>small,.plan-not-included,.plans-footer,
  .signup-intro>p,.signup-grid label>small,.signup-login,.topbar-title small,.dashboard-stats small,
  .order-card-head small,.customer-box span,.order-meta span,.menu-toolbar p,.category-box small,
  .products-head span,.admin-product-copy p,.admin-modal label,.settings-intro p,.settings-card label,
  .switch-row small,.helper,.store-brand-copy span,.store-summary small,.store-summary p,
  .product-info p,.result-count
){
  color:var(--ak-dark-muted)!important;
}
html[data-ak-theme="dark"] .desktop-sidebar{border-right-color:var(--ak-dark-line)!important}
html[data-ak-theme="dark"] .sidebar-link{color:#c9ccd3!important}
html[data-ak-theme="dark"] .sidebar-link span{color:#9297a2!important}
html[data-ak-theme="dark"] .sidebar-link:hover{background:#1b1e26!important;color:#fff!important}
html[data-ak-theme="dark"] .sidebar-link.active{background:rgba(255,106,0,.13)!important;color:#ff8b3e!important}
html[data-ak-theme="dark"] .dashboard-topbar{border-bottom-color:var(--ak-dark-line)!important}
html[data-ak-theme="dark"] .order-column{background:#111319!important}
html[data-ak-theme="dark"] .category.active{background:rgba(255,106,0,.12)!important;border-color:#ff6a00!important;color:#ff9a5b!important}
html[data-ak-theme="dark"] .paid-btn{background:#1b1e26!important;color:#fff!important;border-color:#343945!important}
html[data-ak-theme="dark"] .value-strip{background:#08090d!important}
html[data-ak-theme="dark"] .signup-selected-plan{background:#21160f!important;border-color:#5b351c!important;color:#fff!important}
html[data-ak-theme="dark"] .signup-selected-plan strong{color:#fff!important}
html[data-ak-theme="dark"] .signup-selected-plan small{color:#b8bbc3!important}

/* storefront escuro */
html[data-ak-theme="dark"] .storefront-shell{background:#101218!important}
html[data-ak-theme="dark"] .store-header{background:rgba(16,18,24,.96)!important;border-bottom-color:#2c3039!important}
html[data-ak-theme="dark"] .menu-area{color:#fff!important}
html[data-ak-theme="dark"] .products{background:transparent!important}
html[data-ak-theme="dark"] .product-photo{background:#1a1d24!important}
html[data-ak-theme="dark"] .store-benefit{background:#15171e!important;border-color:#2e323d!important}
html[data-ak-theme="dark"] .cart-bar{background:rgba(15,17,23,.97)!important;border-color:#30343d!important}

/* ---------- MODO CLARO em paginas originalmente escuras ---------- */
html[data-ak-theme="light"] body.login-page,
html[data-ak-theme="light"] body.home-sales-page{
  background:var(--ak-light)!important;
  color:var(--ak-light-text)!important;
}
html[data-ak-theme="light"] :is(.login-card,.home-pre-card){
  background:var(--ak-light-panel)!important;
  border-color:var(--ak-light-line)!important;
  color:var(--ak-light-text)!important;
  box-shadow:0 24px 70px rgba(25,32,45,.10)!important;
}
html[data-ak-theme="light"] :is(
  .login-card h1,.login-brand strong,.field-label,.login-footer a,.home-pre-content h1
){
  color:var(--ak-light-text)!important;
}
html[data-ak-theme="light"] :is(
  .login-brand small,.login-step>p,.home-pre-content>p,.login-footer,.chosen-email
){
  color:var(--ak-light-muted)!important;
}
html[data-ak-theme="light"] .field-wrap{
  background:#f7f8fa!important;
  border-color:#cfd4dc!important;
}
html[data-ak-theme="light"] .field-wrap input{color:#202228!important}
html[data-ak-theme="light"] .field-wrap input::placeholder{color:#9197a1!important}
html[data-ak-theme="light"] .login-primary{
  background:#ff6a00!important;
  color:#fff!important;
}
html[data-ak-theme="light"] .help-access{
  background:#fafbfc!important;
  color:#292c32!important;
  border-top-color:#e2e5ea!important;
}
html[data-ak-theme="light"] .login-proof,
html[data-ak-theme="light"] .login-footer{
  background:#f7f8fa!important;
  border-top-color:#e2e5ea!important;
}
html[data-ak-theme="light"] .login-proof span:not(:first-child){
  background:#fff!important;
  border-color:#d7dbe2!important;
  color:#555b65!important;
}

/* showcase continua fotografico, sempre com contraste correto */
html[data-ak-theme="light"] .login-showcase{
  border-color:#d7dbe2!important;
  box-shadow:0 24px 70px rgba(25,32,45,.11)!important;
}
/* O painel visual da HOME permanece escuro nos dois temas.
   NUNCA herdar texto preto do modo claro sobre a foto escura. */
html[data-ak-theme="light"] .login-showcase .showcase-copy h2,
html[data-ak-theme="dark"] .login-showcase .showcase-copy h2{
  color:#ffffff!important;
}
html[data-ak-theme="light"] .login-showcase .showcase-copy>p,
html[data-ak-theme="dark"] .login-showcase .showcase-copy>p{
  color:#eceef2!important;
}
html[data-ak-theme="light"] .login-showcase .showcase-kicker,
html[data-ak-theme="dark"] .login-showcase .showcase-kicker{
  color:#ff7b20!important;
}
html[data-ak-theme="light"] .login-showcase .sales-flow span,
html[data-ak-theme="dark"] .login-showcase .sales-flow span{
  color:#ffffff!important;
}
html[data-ak-theme="light"] .login-showcase .showcase-features strong,
html[data-ak-theme="dark"] .login-showcase .showcase-features strong{
  color:#ffffff!important;
}
html[data-ak-theme="light"] .login-showcase .showcase-features span,
html[data-ak-theme="dark"] .login-showcase .showcase-features span{
  color:#d2d5db!important;
}
html[data-ak-theme="light"] .login-showcase .price-highlight,
html[data-ak-theme="dark"] .login-showcase .price-highlight{
  color:#ffffff!important;
}
html[data-ak-theme="light"] .login-showcase .price-highlight span,
html[data-ak-theme="dark"] .login-showcase .price-highlight span{
  color:#f3f4f6!important;
}
html[data-ak-theme="light"] .login-showcase .price-highlight strong,
html[data-ak-theme="dark"] .login-showcase .price-highlight strong{
  color:#ff7b20!important;
}
html[data-ak-theme="light"] .login-showcase .price-highlight small,
html[data-ak-theme="dark"] .login-showcase .price-highlight small{
  color:#e2e4e8!important;
}
html[data-ak-theme="light"] .login-showcase .zero-badge,
html[data-ak-theme="dark"] .login-showcase .zero-badge{
  color:#ffffff!important;
}
html[data-ak-theme="light"] .login-showcase .zero-badge b,
html[data-ak-theme="dark"] .login-showcase .zero-badge b{
  color:#ff7b20!important;
}

/* planos que aparecem na home */
html[data-ak-theme="light"] .home-plan-stage{color:#1c1e23!important}
html[data-ak-theme="light"] .home-plan-heading h2{color:#1c1e23!important}
html[data-ak-theme="light"] .home-plan-heading p{color:#6b717a!important}
html[data-ak-theme="light"] .home-plan-card{
  background:#fff!important;
  border-color:#dfe3e8!important;
  color:#1c1e23!important;
  box-shadow:0 14px 36px rgba(24,32,44,.07)!important;
}
html[data-ak-theme="light"] .home-plan-card h3,
html[data-ak-theme="light"] .home-plan-price{color:#1c1e23!important}
html[data-ak-theme="light"] .home-plan-card>p,
html[data-ak-theme="light"] .home-plan-card li{color:#5f6570!important}

/* pizza, carrinho, checkout e acompanhamento em claro */
html[data-ak-theme="light"] :is(.pizza-shell,.checkout-shell){
  background:var(--ak-light)!important;
  color:var(--ak-light-text)!important;
}
html[data-ak-theme="light"] :is(
  .builder,.builder-step,.summary-card,.checkout-section,.final-card,
  .choice,.flavor-choice,.count-choice,.sticky-selection span
){
  background:#fff!important;
  border-color:#dfe3e8!important;
  color:#1d2025!important;
}
html[data-ak-theme="light"] :is(
  .builder-step h1,.builder-step h2,.builder-step h3,.summary-card strong,
  .checkout-section h2,.choice b,.flavor-choice b,.final-card strong
){color:#1d2025!important}
html[data-ak-theme="light"] :is(
  .builder-step p,.summary-card small,.checkout-section p,.final-card small
){color:#6c727c!important}
html[data-ak-theme="light"] :is(.notes-label textarea,.checkout-shell input,.checkout-shell select,.checkout-shell textarea){
  background:#fff!important;
  border-color:#cfd4dc!important;
  color:#1d2025!important;
}
html[data-ak-theme="light"] .builder-footer{
  background:rgba(255,255,255,.97)!important;
  border-top-color:#dfe3e8!important;
}
html[data-ak-theme="light"] .secondary-btn{background:#fff!important;color:#333!important;border-color:#d0d5dc!important}

/* auth generico */
html[data-ak-theme="light"] .auth-shell{background:var(--ak-light)!important}
html[data-ak-theme="light"] .auth-card{
  background:#fff!important;border-color:#dfe3e8!important;color:#1c1e23!important;
  box-shadow:0 22px 60px rgba(24,32,44,.10)!important
}
html[data-ak-theme="light"] .auth-card :is(h1,label,.auth-brand){color:#1c1e23!important}
html[data-ak-theme="light"] .auth-card p{color:#666c76!important}
html[data-ak-theme="light"] .auth-card input{background:#f7f8fa!important;border-color:#cfd4dc!important;color:#1c1e23!important}

/* mobile: protecoes globais */
@media(max-width:900px){
  .ak-theme-toggle{top:12px;right:12px;min-width:112px;height:42px;padding:0 12px;border-radius:11px;font-size:10px}
  .dashboard-topbar,.plans-topbar,.signup-top{padding-right:140px!important}
  :is(.app-shell,.dashboard-shell,.plans-page,.signup-shell,.settings-main,.menu-admin-main,.auth-shell){
    max-width:100%!important;
  }
  .dashboard-main{min-width:0!important}
  .orders-board{max-width:100%!important}
}
@media(max-width:760px){
  body{font-size:16px}
  input,select,textarea{font-size:16px!important}
  :is(.signup-grid,.form-grid,.mode-grid,.store-summary,.products,.pricing-grid,.dashboard-stats){
    max-width:100%!important;
  }
  .store-header-inner{
    grid-template-columns:1fr auto!important;
    gap:10px!important;
    padding-left:14px!important;
  }
  .header-search{grid-column:1/-1!important;order:3!important}
  .store-summary{grid-template-columns:1fr!important;margin-left:14px!important;margin-right:14px!important}
  .menu-area{padding-left:14px!important;padding-right:14px!important}
  .products{grid-template-columns:1fr!important}
  .product-card{grid-template-columns:112px minmax(0,1fr)!important}
  .product-photo,.product-photo img{min-height:132px!important}
}
@media(max-width:520px){
  .ak-theme-toggle{min-width:96px;height:38px;top:10px;right:10px;padding:0 10px;font-size:9px}
  .ak-theme-toggle svg{width:16px;height:16px}
  .plans-topbar,.signup-top{padding-right:118px!important}
  .dashboard-topbar{padding-right:118px!important}
  .product-card{grid-template-columns:96px minmax(0,1fr)!important}
}
@media print{
  .ak-theme-toggle{display:none!important}
  html[data-ak-theme] body{background:#fff!important;color:#000!important}
}


/* ===== BOTAO VOLTAR GLOBAL ===== */
.ak-back-button{
  position:fixed;
  top:18px;
  left:18px;
  z-index:999;
  min-width:96px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:0 14px;
  border:1px solid rgba(128,132,142,.32);
  border-radius:12px;
  background:rgba(20,22,28,.96);
  color:#fff;
  box-shadow:0 10px 28px rgba(0,0,0,.20);
  backdrop-filter:blur(12px);
  cursor:pointer;
  font:800 11px/1 Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  white-space:nowrap;
  transition:transform .18s ease,background .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.ak-back-button:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 32px rgba(0,0,0,.24);
}
.ak-back-button svg{
  width:17px;
  height:17px;
  flex:0 0 auto;
}
html[data-ak-theme="light"] .ak-back-button{
  background:rgba(255,255,255,.97);
  color:#252830;
  border-color:#d7dbe2;
  box-shadow:0 8px 24px rgba(24,32,44,.12);
}
html[data-ak-theme="dark"] .ak-back-button{
  background:rgba(20,22,28,.96);
  color:#fff;
  border-color:#363a45;
}

/* reserva espaco para controles fixos globais */
html[data-ak-theme] .desktop-sidebar{
  padding-top:76px!important;
}
html[data-ak-theme] :is(.dashboard-topbar,.plans-topbar,.signup-top){
  padding-left:112px!important;
}

@media(max-width:900px){
  .ak-back-button{
    top:12px;
    left:12px;
    min-width:88px;
    height:42px;
    padding:0 12px;
    border-radius:11px;
    font-size:10px;
  }
  html[data-ak-theme] .desktop-sidebar{
    padding-top:22px!important;
  }
  html[data-ak-theme] :is(.dashboard-topbar,.plans-topbar,.signup-top){
    padding-left:108px!important;
  }
}
@media(max-width:520px){
  .ak-back-button{
    top:10px;
    left:10px;
    min-width:80px;
    height:38px;
    padding:0 10px;
    font-size:9px;
  }
  .ak-back-button svg{width:15px;height:15px}
  html[data-ak-theme] :is(.dashboard-topbar,.plans-topbar,.signup-top){
    padding-left:98px!important;
  }
}
@media print{
  .ak-back-button{display:none!important}
}


/* ===== STOREFRONT NOVA: TEMA SEM CONTRASTE QUEBRADO ===== */
html[data-ak-theme="dark"] body.storefront-page{
  background:#0d0e13!important;
  color:#f5f6f8!important;
}
html[data-ak-theme="dark"] .storefront-shell{
  background:#101218!important;
}
html[data-ak-theme="dark"] .store-header{
  background:rgba(16,18,24,.97)!important;
  border-bottom-color:#2d313a!important;
}
html[data-ak-theme="dark"] .store-header-inner{
  background:transparent!important;
}
html[data-ak-theme="dark"] .store-brand-copy strong{color:#f6f7f9!important}
html[data-ak-theme="dark"] .store-brand-copy span{color:#a8adb6!important}
html[data-ak-theme="dark"] .header-search{
  background:#1a1d24!important;
  border-color:#30343e!important;
}
html[data-ak-theme="dark"] .header-search input{color:#fff!important}
html[data-ak-theme="dark"] .header-search input::placeholder{color:#848a95!important}
html[data-ak-theme="dark"] .header-cart{
  background:#1a1d24!important;
  border-color:#30343e!important;
  color:#fff!important;
}
html[data-ak-theme="dark"] .store-info-card{
  background:#15171e!important;
  border-color:#2d313a!important;
  box-shadow:none!important;
}
html[data-ak-theme="dark"] .store-info-title{
  border-bottom-color:#2d313a!important;
}
html[data-ak-theme="dark"] .store-info-title h2{color:#fff!important}
html[data-ak-theme="dark"] .direct-badge{
  background:rgba(255,106,0,.12)!important;
  color:#ff9b58!important;
}
html[data-ak-theme="dark"] .store-summary article{
  background:#1b1e26!important;
  border-color:#30343e!important;
}
html[data-ak-theme="dark"] .store-summary strong{color:#f5f6f8!important}
html[data-ak-theme="dark"] .store-summary p{color:#9ea3ad!important}
html[data-ak-theme="dark"] .categories{
  background:rgba(16,18,24,.97)!important;
  border-bottom-color:#2d313a!important;
}
html[data-ak-theme="dark"] .category{
  background:#1b1e26!important;
  border-color:#343944!important;
  color:#d6d9df!important;
}
html[data-ak-theme="dark"] .category.active{
  background:rgba(255,106,0,.13)!important;
  border-color:#ff6a00!important;
  color:#ff9b58!important;
}
html[data-ak-theme="dark"] .menu-heading h2,
html[data-ak-theme="dark"] .section-head h2{
  color:#f6f7f9!important;
}
html[data-ak-theme="dark"] .menu-heading button{
  background:rgba(255,106,0,.13)!important;
  color:#ff9b58!important;
}
html[data-ak-theme="dark"] .product-card{
  background:#15171e!important;
  border-color:#2d313a!important;
}
html[data-ak-theme="dark"] .product-info h3{color:#f5f6f8!important}
html[data-ak-theme="dark"] .product-info p{color:#a4a9b2!important}
html[data-ak-theme="dark"] .product-photo{background:#1c1f27!important}
html[data-ak-theme="dark"] .products-empty{
  background:#15171e!important;
  border-color:#343944!important;
}
html[data-ak-theme="dark"] .products-empty strong{color:#f2f3f5!important}
html[data-ak-theme="dark"] .products-empty p{color:#9da2ab!important}
html[data-ak-theme="dark"] .cart-bar{
  background:#161920!important;
  border-color:#343944!important;
  color:#fff!important;
}
html[data-ak-theme="dark"] .cart-bar strong{color:#fff!important}
html[data-ak-theme="dark"] .cart-bar small{color:#acb0b8!important}

html[data-ak-theme="light"] body.storefront-page{
  background:#f3f4f6!important;
  color:#202228!important;
}
html[data-ak-theme="light"] .store-cover h1{color:#fff!important}
html[data-ak-theme="light"] .store-cover p{color:#f1f2f4!important}

/* controles globais ficam fora da barra do cardapio */
@media(min-width:901px){
  .storefront-page .ak-back-button{top:18px}
  .storefront-page .ak-theme-toggle{top:18px}
}
@media(max-width:900px){
  .storefront-page .store-header{top:58px!important}
  .storefront-page .storefront-shell{padding-top:58px!important}
}


/* evita que voltar/tema cubram telas app-like no celular */
@media(max-width:900px){
  .checkout-shell,
  .pizza-shell{
    padding-top:58px!important;
  }
}
@media(max-width:520px){
  .checkout-shell,
  .pizza-shell{
    padding-top:54px!important;
  }
}


/* ===== ACESSIBILIDADE E QUALIDADE DE INTERACAO ===== */
:where(button,a,input,select,textarea,[role="button"]):focus-visible{
  outline:3px solid color-mix(in srgb,#ff6a00 68%,#fff)!important;
  outline-offset:2px!important;
}
:where(button,a,input,select,textarea):disabled{
  cursor:not-allowed!important;
}
::selection{
  background:rgba(255,106,0,.22);
}
.sr-only{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
@media(max-width:760px){
  :where(button,a){
    -webkit-tap-highlight-color:transparent;
  }
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}


/* ===== CONTRATO GLOBAL DE TEMA — REVISAO 2026-09-26 =====
   Regra: controles e tipografia funcional nunca podem manter cores do tema anterior. */
html[data-ak-theme="light"]{color-scheme:light}
html[data-ak-theme="dark"]{color-scheme:dark}

/* Controles de formulario em TODAS as telas atuais */
html[data-ak-theme="light"] body :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea
){
  background:#ffffff!important;
  border-color:#cfd4dc!important;
  color:#1c1f24!important;
  caret-color:#1c1f24!important;
}
html[data-ak-theme="light"] body :is(input,textarea)::placeholder{
  color:#8b919b!important;
  opacity:1!important;
}
html[data-ak-theme="light"] body select option{
  background:#ffffff!important;
  color:#1c1f24!important;
}

html[data-ak-theme="dark"] body :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea
){
  background:#1a1d24!important;
  border-color:#343944!important;
  color:#f5f6f8!important;
  caret-color:#ffffff!important;
}
html[data-ak-theme="dark"] body :is(input,textarea)::placeholder{
  color:#8f96a2!important;
  opacity:1!important;
}
html[data-ak-theme="dark"] body select option{
  background:#1a1d24!important;
  color:#f5f6f8!important;
}

/* Titulos funcionais sempre legiveis no dark.
   O hero fotografico ja usa branco, portanto a regra e segura ali tambem. */
html[data-ak-theme="dark"] body :is(h1,h2,h3,h4,h5,h6){
  color:#f5f6f8!important;
}
html[data-ak-theme="dark"] body :is(
  .dashboard-main,.menu-admin-main,.settings-main,.ai-main,.plans-page,.signup-page,
  .checkout-shell,.pizza-shell,.auth-shell,.cart-shell,.tracking-shell
){
  color:#f5f6f8!important;
}

/* Cards e paineis funcionais mais comuns */
html[data-ak-theme="light"] :is(
  .ai-simulator-card,.ai-inspector section,.ai-stats article,
  .settings-card,.category-box,.products-admin,.admin-product,.order-column,
  .checkout-section,.summary-card,.pricing-card
){
  color:#20242a!important;
}
html[data-ak-theme="dark"] :is(
  .ai-simulator-card,.ai-inspector section,.ai-stats article,
  .settings-card,.category-box,.products-admin,.admin-product,.order-column,
  .checkout-section,.summary-card,.pricing-card
){
  color:#f5f6f8!important;
}

/* textos secundarios funcionais */
html[data-ak-theme="dark"] :is(
  .ai-main p,.ai-main span:not(.sidebar-logo):not(.simulator-avatar),
  .menu-admin-main p,.menu-admin-main small,.settings-main p,.settings-main small,
  .plans-page p,.plans-page small,.checkout-shell p,.checkout-shell small
){
  color:#a6acb6;
}

/* Reserva de seguranca para o toggle em cabecalhos internos */
@media(min-width:901px){
  :is(.ai-topbar,.dashboard-topbar,.plans-topbar,.signup-top,.menu-toolbar,.settings-intro){
    padding-right:max(156px,env(safe-area-inset-right))!important;
  }
}

/* Foco consistente nos dois temas */
html[data-ak-theme] body :is(input,select,textarea):focus{
  border-color:#ff6a00!important;
  box-shadow:0 0 0 3px rgba(255,106,0,.10)!important;
  outline:none!important;
}


/* ===== CONTRATO GLOBAL DE TEMA / PAINEL ===== */
:root{
  --ak-page:#f5f6f8;
  --ak-surface:#ffffff;
  --ak-surface-soft:#f8f9fb;
  --ak-border:#e6e9ee;
  --ak-text:#1d2229;
  --ak-muted:#737b86;
  --ak-shadow:0 12px 34px rgba(20,28,38,.06);
}
html[data-ak-theme="dark"]{
  --ak-page:#0d0f14;
  --ak-surface:#151820;
  --ak-surface-soft:#1b1f28;
  --ak-border:#2a303a;
  --ak-text:#f4f6f8;
  --ak-muted:#9ba3af;
  --ak-shadow:none;
}
html[data-ak-theme] body:not(.login-page):not(.home-sales-page){
  background:var(--ak-page)!important;
  color:var(--ak-text)!important;
}
html[data-ak-theme] .profile-main{
  background:var(--ak-page)!important;
  color:var(--ak-text)!important;
}
html[data-ak-theme] .profile-main :is(.profile-hero,.profile-card,.profile-topbar>a){
  background:var(--ak-surface)!important;
  border-color:var(--ak-border)!important;
  color:var(--ak-text)!important;
}
html[data-ak-theme] .profile-main :is(h1,h2,h3,strong,dd){color:var(--ak-text)!important}
html[data-ak-theme] .profile-main :is(p,small,dt){color:var(--ak-muted)!important}
html[data-ak-theme] .profile-main :is(.profile-detail,.profile-row){border-color:var(--ak-border)!important}
html[data-ak-theme] .profile-main .profile-detail{background:var(--ak-surface-soft)!important}

/* Em telas internas o tema pertence ao menu; nunca fica flutuando sobre ações da página. */
.panel-sidebar .ak-theme-toggle{
  position:static!important;
  inset:auto!important;
  width:100%!important;
  min-width:0!important;
  height:40px!important;
  margin:auto 0 4px!important;
  justify-content:flex-start!important;
  padding:0 12px!important;
  border-radius:10px!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  font-size:11px!important;
  transform:none!important;
}
.panel-sidebar .ak-theme-toggle:hover{transform:none!important}
.panel-sidebar .ak-theme-toggle svg{width:17px!important;height:17px!important}
.panel-sidebar .sidebar-logout{margin-top:0!important}
html[data-ak-theme] .panel-sidebar{padding-top:20px!important}

/* Tipografia do menu é imutável entre páginas. */
.panel-sidebar,
.panel-sidebar *{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif!important;
}
.panel-sidebar .sidebar-link{
  font-size:13px!important;
  font-weight:650!important;
  letter-spacing:-.05px!important;
}
.panel-sidebar .sidebar-store-copy strong{font-weight:750!important}
.panel-sidebar .sidebar-brand strong{font-weight:850!important}

/* O botão global só é flutuante fora do painel. */
body:has(.panel-sidebar)>.ak-theme-toggle,
body:has(.panel-sidebar)>.ak-back-button{display:none!important}

@media(max-width:900px){
  .panel-sidebar .ak-theme-toggle{display:none!important}
  html[data-ak-theme] .panel-sidebar{padding-top:20px!important}
}

/* Inputs compostos: o container desenha o campo inteiro; filhos nunca criam divisorias */
html[data-ak-theme] body .field-wrap{
  overflow:hidden!important;
}
html[data-ak-theme] body .field-wrap input{
  background:transparent!important;
  border:0!important;
  border-color:transparent!important;
  border-radius:0!important;
  box-shadow:none!important;
}
html[data-ak-theme] body .field-wrap .field-icon,
html[data-ak-theme] body .field-wrap .password-toggle{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
html[data-ak-theme="dark"] body .field-wrap{
  background:#1a1d24!important;
}
html[data-ak-theme="light"] body .field-wrap{
  background:#fff!important;
}
