/* Muyama Data optional dark appearance — applies only when user chooses Dark mode.
   Original styles, page markup, business logic and coloured branding are preserved. */
html[data-muyama-theme="dark"] {
  color-scheme: dark;
  --ink: #EFF8F1;
  --muted: #a9b9d2;
  --page: #0E1F19;
  --line: #3B5246;
  --shadow: 0 12px 28px rgba(0,0,0,.24);
}
html[data-muyama-theme="dark"] body {
  background: #0E1F19 !important;
  color: #E6F1E9 !important;
}
/* Unbranded surfaces in desktop and mobile templates */
html[data-muyama-theme="dark"] :is(
  .page-shell, .sidebar-drawer, .sidebar, .workspace, .content,
  .wallet-card, .account-card, .transaction-row, .stat-card, .actions-panel,
  .admin-btn, .sales-audit, .status-item, .popup-card, .modal-content,
  .card, .modern-card, .glass-card, .form-card, .profile-card,
  .bg-white, .bg-gray-50, .bg-gray-100, .bg-slate-50, .bg-slate-100,
  .bg-teal-50, .bg-blue-50, .bg-indigo-50, .bg-emerald-50,
  .bg-green-50, .bg-amber-50, .bg-red-50
) {
  background-color: #172438 !important;
  border-color: #3B5246 !important;
  box-shadow: none;
}
html[data-muyama-theme="dark"] :is(.page-shell,.workspace,.content) {
  background-color: #122A22 !important;
}
html[data-muyama-theme="dark"] :is(.sidebar,.sidebar-drawer) {
  background-color: #172E26 !important;
}
html[data-muyama-theme="dark"] :is(.bg-gray-200,.bg-slate-200,.bg-gray-300,.bg-slate-300) {
  background-color: #305346 !important;
}
/* Text that is dark in light mode */
html[data-muyama-theme="dark"] :is(
  .service-label,.section-title,.section-link,.stat-label,.stat-value,.stat-note,
  .tx-title,.tx-meta,.tx-amount,.tx-status,.sidebar-section,.sidebar-link,
  .account-caption,.account-number,.bank-name,.balance,.wallet-label,
  .nav-link,.admin-btn,.admin-btn-text,.top-title,.top-sub,.welcome-title,
  .welcome-copy,.sidebar-user-name,.sidebar-user-role,
  .text-gray-900,.text-gray-800,.text-gray-700,.text-gray-600,
  .text-slate-900,.text-slate-800,.text-slate-700,.text-slate-600,
  .text-brand-dark,.text-black
) {
  color: #e8f0ff !important;
}
html[data-muyama-theme="dark"] :is(.muted,.eyebrow,.stat-note,.tx-meta,.service-hint,.text-gray-500,.text-slate-500,.text-gray-400,.text-slate-400) {
  color: #B0CEC0 !important;
}
html[data-muyama-theme="dark"] :is(.border-gray-100,.border-gray-200,.border-slate-100,.border-slate-200,.divide-gray-200,.divide-slate-200) {
  border-color: #3B5246 !important;
}
html[data-muyama-theme="dark"] :is(input,select,textarea,[contenteditable="true"]) {
  background-color: #172B22 !important;
  color: #F1F9F2 !important;
  border-color: #526E61 !important;
}
html[data-muyama-theme="dark"] :is(input,textarea)::placeholder { color:#9BBEAB !important; }
html[data-muyama-theme="dark"] :is(input,select,textarea):focus {
  outline-color: #78CDA5;
  border-color: #78CDA5 !important;
}
html[data-muyama-theme="dark"] :is(table,th,td,tr) { border-color:#3E5B4B !important; }
html[data-muyama-theme="dark"] thead { background-color:#21324b !important; color:#f1f5ff !important; }
html[data-muyama-theme="dark"] tbody tr:nth-child(even) { background-color:rgba(255,255,255,.035); }
html[data-muyama-theme="dark"] :is(.sidebar-link,.nav-link):hover { background-color:#263b55 !important; }
html[data-muyama-theme="dark"] .sidebar-link.active { background-color:#235D49 !important; color:#fff !important; }
html[data-muyama-theme="dark"] :is(.stat-card,.transaction-row,.actions-panel,.sales-audit,.wallet-card,.account-card) {
  border: 1px solid #3B5246 !important;
}
/* Keep blue/orange hero, promos, bright service icons and intended white-on-colour buttons unchanged. */
html[data-muyama-theme="dark"] :is(.hero,.sidebar-head,.topbar,.promo) { color:#fff; }
html[data-muyama-theme="dark"] :is(.hero,.sidebar-head,.topbar) :is(.greeting,.user-name,.user-role,.sidebar-user-name,.sidebar-user-role,.top-title,.top-sub) { color:#fff !important; }
html[data-muyama-theme="dark"] :is(.wallet-wrap,.section-head,.services-grid) { color:#e8f0ff; }
html[data-muyama-theme="dark"] .service-icon { border:1px solid rgba(255,255,255,.16); }
html[data-muyama-theme="dark"] :is(.sidebar-foot,.bottom-nav) { background-color:#172438 !important; border-color:#3B5246 !important; }
/* Switch controls */
.muyama-theme-floating {
  position:fixed; z-index:79; right:14px; bottom:calc(16px + env(safe-area-inset-bottom, 0px));
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:9px 13px; border:1px solid #B8D5C4; border-radius:999px;
  background:#fff; color:#1C5744; box-shadow:0 8px 25px rgba(0,0,0,.18);
  font:600 12px/1.3 system-ui,-apple-system,sans-serif; cursor:pointer;
  min-height:42px; max-width:160px;
}
.muyama-theme-floating:focus-visible,.muyama-theme-option:focus-visible {outline:3px solid #79D4B2;outline-offset:3px;}
html[data-muyama-theme="dark"] .muyama-theme-floating {
  background:#2A483B; color:#fff; border-color:#587B67;
}
.muyama-theme-option {
  width:100%; border:1px solid #D6EADB; border-radius:11px;
  background:#EFF8F1; color:#1D5947; cursor:pointer;
  margin:10px 0 6px; padding:11px 12px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  font:600 13px/1.4 system-ui,-apple-system,sans-serif; text-align:left;
}
html[data-muyama-theme="dark"] .muyama-theme-option {
  border-color:#395F4D; background:#2A483B; color:#fff;
}
.muyama-theme-status { font-size:11px; opacity:.85; white-space:nowrap; }
@media (max-width:640px) {
  .muyama-theme-floating { padding:9px 10px; right:12px; font-size:11px; }
  body:has(.bottom-nav) .muyama-theme-floating { bottom:calc(90px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion:reduce) {
  .muyama-theme-option,.muyama-theme-floating { transition:none; }
}
