/* MHB Beheer dark theme. Loaded after all feature styles so legacy panels with
   hard-coded light colours remain readable as the platform grows. */
html[data-mhb-color="dark"] {
  color-scheme: dark;
  --bg:#0d1723;
  --panel:#162435;
  --soft:#1b2b3d;
  --border:#32465c;
  --text:#e7eef6;
  --muted:#a9b8c9;
  --nav:#102b4c;
  --shadow:0 10px 28px rgba(0,0,0,.28);
}
html[data-mhb-color="dark"] body { background:#0d1723; color:var(--text); }
html[data-mhb-color="dark"] .auth-screen { background:linear-gradient(145deg,#0d1723,#122235 55%,#102b3d); }
html[data-mhb-color="dark"] :is(.auth-card,.card,.modal-card,.system-box,.install-item,.customer-card,.bms-metric,.bms-chart-card,.financial-metric,.health-check,.health-device,.cerbo-ess-panel,.cerbo-ess-field,.cerbo-ess-toggle,.jkbms-progress-card,.api-gauge-card,.quick-tile,.project-card,.project-section,.project-summary-card) {
  background:#162435!important;
  border-color:#32465c!important;
  color:var(--text)!important;
}
html[data-mhb-color="dark"] :is(input,select,textarea,.search,.note-area,.whatsapp-reply textarea) {
  background:#101d2b!important;
  border-color:#3b5068!important;
  color:#eef5fb!important;
}
html[data-mhb-color="dark"] :is(input,textarea)::placeholder { color:#7f91a5; }
html[data-mhb-color="dark"] :is(.btn:not(.primary):not(.success):not(.warning):not(.danger):not(.purple):not(.back-button),.logout-button,.modal-close,.user-menu-card) {
  background:#1b2b3d!important;
  border-color:#3b5068!important;
  color:#e7eef6!important;
}
html[data-mhb-color="dark"] :is(.title h1,.section-head h2,.modal-head h2,.card h2,.card h3,.system-box>strong,.bms-metric strong,.user-menu-text strong,.health-check-value,.health-score,.value) { color:#edf5fc!important; }
html[data-mhb-color="dark"] :is(.label,.sub,.placeholder,.form-field,.system-row span:first-child,.section-head span,.api-official,.jkbms-progress-message) { color:#a9b8c9!important; }
html[data-mhb-color="dark"] :is(th,.table-toolbar,.whatsapp-chat-title,.whatsapp-thread-head,.whatsapp-reply,.modal-head) {
  background:#162435!important;
  border-color:#32465c!important;
  color:#dfe9f2!important;
}
html[data-mhb-color="dark"] :is(td,th,.system-row,.table-toolbar,.whatsapp-conversation,.whatsapp-thread-head,.whatsapp-reply) { border-color:#32465c!important; }
html[data-mhb-color="dark"] :is(.status-pill,.system-status-grid .system-row,.progress,.jkbms-progress-track) { background:#101d2b!important; }
html[data-mhb-color="dark"] :is(.clickable-row:hover td,.customer-card:hover,.user-menu-card:hover) { background:#20354a!important; }
html[data-mhb-color="dark"] .menu-group.open .menu-subitems { background:#162435!important; border-color:#3b5068!important; }
html[data-mhb-color="dark"] .menu-group.open .menu-subitems::before { color:#e7eef6!important; }
html[data-mhb-color="dark"] .menu-group .menu-sub,
html[data-mhb-color="dark"] .menu-group .menu-sub:nth-child(n),
html[data-mhb-color="dark"] .victron-popup-group .menu-sub {
  background:#1b2b3d!important;
  border-color:#3b5068!important;
  color:#e7eef6!important;
}
html[data-mhb-color="dark"] .menu-group .menu-sub:hover,
html[data-mhb-color="dark"] .menu-group .menu-sub.active { background:#23405a!important; color:#fff!important; }
html[data-mhb-color="dark"] .whatsapp-thread,
html[data-mhb-color="dark"] .whatsapp-bubbles { background:#101d2b!important; }
html[data-mhb-color="dark"] .whatsapp-conversation { background:#162435!important; }
html[data-mhb-color="dark"] .whatsapp-conversation:hover,
html[data-mhb-color="dark"] .whatsapp-conversation.active { background:#1d3a34!important; }
html[data-mhb-color="dark"] .whatsapp-conversation strong { color:#e7eef6!important; }
html[data-mhb-color="dark"] .whatsapp-bubble { background:#203248!important; color:#eef5fb!important; }
html[data-mhb-color="dark"] .whatsapp-bubble.outbound { background:#24503d!important; }
html[data-mhb-color="dark"] .api-gauge::before,
html[data-mhb-color="dark"] .soh-ring::before { background:#162435!important; }
html[data-mhb-color="dark"] .website-frame { background:#101d2b; }
html[data-mhb-color="dark"] .appearance-choice { background:#162435; border-color:#3b5068; color:#e7eef6; }
html[data-mhb-color="dark"] .appearance-choice.selected { background:#173e5c; border-color:#49a7e2; }

.appearance-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:14px; }
.appearance-choice { min-height:116px; padding:16px; border:1px solid var(--border); border-radius:14px; background:#fff; color:var(--text); text-align:left; }
.appearance-choice.selected { border-color:#2f80ed; background:#edf6ff; box-shadow:0 0 0 3px rgba(47,128,237,.12); }
.appearance-choice strong { display:block; margin:8px 0 4px; font-size:15px; }
.appearance-choice span { display:block; color:var(--muted); font-size:11px; line-height:1.4; }
.appearance-choice-icon { font-size:25px; line-height:1; }
@media(max-width:620px){.appearance-grid{grid-template-columns:1fr}.appearance-choice{min-height:88px}}
