/* ============================================================
   Kaizer Order — Mode sombre / clair
   S'applique lorsque <html data-theme="dark"> (voir ko-theme.js)
   ============================================================ */
html[data-theme="dark"]{
  color-scheme: dark;
  /* — palettes communes — */
  --paper:#0e1a21; --cream:#0e1a21; --bg:#0e1a21; --paper2:#12222b;
  --ink:#e9eff3; --muted:#93a4ad; --line:#253842;
  --card:#14242e; --card2:#172a35; --panel:#14242e;
  --shadow:0 14px 40px rgba(0,0,0,.45);
  --green:#2e7ea0; --green2:#2a6d8c; --lime:#f08a72;
  --navy:#0e1a21; --navy2:#12222b;
}

html[data-theme="dark"] body{
  background:#0e1a21 !important;
  color:#e9eff3 !important;
}

/* — blocs & cartes blancs deviennent sombres — */
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .box,
html[data-theme="dark"] .demo-card,
html[data-theme="dark"] .feat,
html[data-theme="dark"] .step,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .kpi,
html[data-theme="dark"] .pm-dish,
html[data-theme="dark"] .dc-body,
html[data-theme="dark"] .screen,
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .order-card,
html[data-theme="dark"] .card-row,
html[data-theme="dark"] .tools,
html[data-theme="dark"] .toast{
  background:#14242e !important;
  color:#e9eff3 !important;
  border-color:#253842 !important;
}

/* sections blanches pleine largeur → fond sombre */
html[data-theme="dark"] section,
html[data-theme="dark"] main,
html[data-theme="dark"] .screen,
html[data-theme="dark"] .phone{
  background-color:transparent;
}
html[data-theme="dark"] .phone{
  background:#0e1a21 !important;
  border-color:#253842 !important;
}

/* — textes — */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong,
html[data-theme="dark"] b,
html[data-theme="dark"] label,
html[data-theme="dark"] .section-title{
  color:#f2f7fa !important;
}
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] td,
html[data-theme="dark"] span:not(.pill):not(.tag):not(.eyebrow):not(.btn){
  color:#c3ced5;
}
html[data-theme="dark"] .sub,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .fine,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .desc,
html[data-theme="dark"] .order-meta{
  color:#93a4ad !important;
}
html[data-theme="dark"] .eyebrow{color:#f1af37 !important;}

/* — barres, nav, en-têtes — */
html[data-theme="dark"] header,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .client-topbar,
html[data-theme="dark"] nav,
html[data-theme="dark"] .bottom-nav,
html[data-theme="dark"] .dock{
  background:#12222b !important;
  border-color:#253842 !important;
  color:#e9eff3 !important;
}

/* — champs de formulaire — */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:#0e1a21 !important;
  color:#e9eff3 !important;
  border-color:#2a3d48 !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#6d7f89 !important;}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus{
  border-color:#EE7E66 !important;
  box-shadow:0 0 0 3px rgba(238,126,102,.18) !important;
}
html[data-theme="dark"] select option{background:#14242e;color:#e9eff3;}

/* — boutons secondaires — */
html[data-theme="dark"] .btn-ghost,
html[data-theme="dark"] .back,
html[data-theme="dark"] .small-btn,
html[data-theme="dark"] .tab,
html[data-theme="dark"] .fchip,
html[data-theme="dark"] .cat,
html[data-theme="dark"] .pay-opt{
  background:#172a35 !important;
  color:#dbe4ea !important;
  border-color:#2a3d48 !important;
}

/* — tableaux & lignes — */
html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td{
  border-color:#253842 !important;
}
html[data-theme="dark"] tr:nth-child(even){background:#16262f !important;}
html[data-theme="dark"] th{background:#12222b !important;color:#f2f7fa !important;}

/* — cartes plats (app) : reposent sur les variables --card — */
html[data-theme="dark"] .dish{
  background:#14242e !important;
  border-color:#253842 !important;
  box-shadow:0 6px 16px rgba(0,0,0,.35);
}
html[data-theme="dark"] .dish-visual{background:#1a2c36 !important;}

/* — badges / pastilles : conservent leur couleur — */
html[data-theme="dark"] .pill,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .badge-demo,
html[data-theme="dark"] .fl-tag{color:#0e1a21 !important;}

/* — bandeaux d'info (jaune/rouge) restent lisibles — */
html[data-theme="dark"] .err{background:#3a1d1a !important;color:#f2b8ae !important;border-color:#5b2a24 !important;}
html[data-theme="dark"] .okmsg{background:#12301f !important;color:#9fe0bc !important;border-color:#1d4a31 !important;}

/* — ombres des boutons primaires conservées (coral/navy) — */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .primary,
html[data-theme="dark"] .go{
  color:#fff !important;
}

/* — scrollbar — */
html[data-theme="dark"] ::-webkit-scrollbar{width:10px;height:10px}
html[data-theme="dark"] ::-webkit-scrollbar-thumb{background:#2a3d48;border-radius:8px}
html[data-theme="dark"] ::-webkit-scrollbar-track{background:#0e1a21}

/* — bouton flottant de bascule — */
.ko-theme-btn{
  position:fixed; right:14px; bottom:24px; z-index:60000;
  width:44px; height:44px; border-radius:50%;
  background:#194457; color:#fff; border:2px solid rgba(255,255,255,.25);
  font-size:19px; line-height:1; cursor:pointer;
  box-shadow:0 8px 22px rgba(15,42,54,.35);
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s ease;
}
.ko-theme-btn:hover{transform:scale(1.08)}
/* au-dessus de la barre de navigation de l'app */
body:has(.bottom-nav) .ko-theme-btn{bottom:86px}

/* bandeau prototype : garde sa couleur, texte sombre partout */
html[data-theme="dark"] .demo-banner{background:#fff3d6 !important;color:#5c4a12 !important;border-color:#e8d48a !important;}
html[data-theme="dark"] .demo-banner b{color:#3f320b !important;}
html[data-theme="dark"] .demo-banner span{color:#5c4a12 !important;}
