/* 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: #F3F5FF;
  --muted: #A9B8D7;
  --page: #0B1023;
  --line: #364368;
  --shadow: 0 12px 28px rgba(0,0,0,.24);
}
html[data-muyama-theme="dark"] body {
  background: #0B1023 !important;
  color: #E7EDFF !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: #151F3A !important;
  border-color: #364368 !important;
  box-shadow: none;
}
html[data-muyama-theme="dark"] :is(.page-shell,.workspace,.content) {
  background-color: #111C39 !important;
}
html[data-muyama-theme="dark"] :is(.sidebar,.sidebar-drawer) {
  background-color: #172344 !important;
}
html[data-muyama-theme="dark"] :is(.bg-gray-200,.bg-slate-200,.bg-gray-300,.bg-slate-300) {
  background-color: #33477B !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: #B7C7ED !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: #364368 !important;
}
html[data-muyama-theme="dark"] :is(input,select,textarea,[contenteditable="true"]) {
  background-color: #182448 !important;
  color: #F1F5FF !important;
  border-color: #52669F !important;
}
html[data-muyama-theme="dark"] :is(input,textarea)::placeholder { color:#9FB5E8 !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:#3B4979 !important; }
html[data-muyama-theme="dark"] thead { background-color:#1A2B54 !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:#263663 !important; }
html[data-muyama-theme="dark"] .sidebar-link.active { background-color:#284DA6 !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 #364368 !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:#151F3A !important; border-color:#364368 !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 #C7D2FE; border-radius:999px;
  background:#fff; color:#2553C7; 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 #93C5FD;outline-offset:3px;}
html[data-muyama-theme="dark"] .muyama-theme-floating {
  background:#293E78; color:#fff; border-color:#5069B0;
}
.muyama-theme-option {
  width:100%; border:1px solid #DCE7FF; border-radius:11px;
  background:#F3F5FF; color:#1E40AF; 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:#3D4A78; background:#293E78; 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; }
}
