/* Flowmatic – dark look, follows the system setting (html[data-bs-theme=dark], set in base.html).
   Bootstrap 5.3 darkens its own components; here the app's colours and the few fixed light ones. */

html[data-bs-theme="dark"] {
  --app-bg: #111714;
  --app-surface: #1b2420;
  --app-border: #2c3833;
  --app-border-strong: #3b4943;
  --app-text: #e6ebe8;
  --app-text-2: #a9b4ae;
  --app-text-3: #7d8983;
  --app-accent: #a6cc2a;
  --app-accent-hover: #b8dc3c;
  --app-accent-soft: #2a3519;
  --app-accent-strong: #c2e04f;
  --app-on-accent: #111714;
  --app-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --side-bg: #0c110f;
  --tone-amber: #f5b82e;
  --tone-green: #7cc043;
  --tone-blue: #5aa6e8;
  --tone-red: #f06b6b;
  --tone-orange: #f59a45;
  --tile-alarm-bg: #3a1d1d;
  --bs-body-bg: var(--app-bg);
  --bs-body-color: var(--app-text);
  --bs-border-color: var(--app-border);
  --bs-secondary-color: var(--app-text-2);
  --bs-tertiary-bg: #222c27;
  --bs-link-color-rgb: 166, 204, 42;
  --bs-link-hover-color: #b8dc3c;
  --bs-link-hover-color-rgb: 184, 220, 60;
  --bs-primary-rgb: 166, 204, 42;
  color-scheme: dark;
}
html[data-bs-theme="dark"] body { background: var(--app-bg); color: var(--app-text); }
html[data-bs-theme="dark"] .card, html[data-bs-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .dropdown-menu, html[data-bs-theme="dark"] .app-top,
html[data-bs-theme="dark"] .list-group-item { background-color: var(--app-surface); }
html[data-bs-theme="dark"] .form-control, html[data-bs-theme="dark"] .form-select { background-color: #141b18; border-color: var(--app-border-strong); }
html[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: var(--app-text-2); --bs-btn-border-color: var(--app-border-strong);
  --bs-btn-hover-bg: #26312c; --bs-btn-hover-color: var(--app-text); --bs-btn-hover-border-color: var(--app-border-strong);
  --bs-btn-active-bg: #2d3a34; --bs-btn-active-color: var(--app-text); }
html[data-bs-theme="dark"] .table-app > tbody td { border-bottom-color: var(--app-border); }
html[data-bs-theme="dark"] .table-app > tbody tr:hover td { background: #212b26; }
html[data-bs-theme="dark"] .text-muted { color: var(--app-text-3) !important; }

/* soft badges and hints */
html[data-bs-theme="dark"] .badge-soft.add { background: #233318; color: #a8d67a; }
html[data-bs-theme="dark"] .badge-soft.change { background: #3a3220; color: #e8c674; }
html[data-bs-theme="dark"] .badge-soft.delete { background: #3d2020; color: #f2a0a0; }
html[data-bs-theme="dark"] .badge-soft.draft { background: #3a2d18; color: #f0b866; }
html[data-bs-theme="dark"] .alert-line { background: #33291a; }
html[data-bs-theme="dark"] .alert-line.level-alarm { background: #3a1d1d; }
html[data-bs-theme="dark"] .alert-line.level-info { background: #1b2840; }
html[data-bs-theme="dark"] .alert-level { background: #4a3a14; color: #f2d27a; }
html[data-bs-theme="dark"] .alert-level.level-alarm { background: #4d2222; color: #f5b1b1; }
html[data-bs-theme="dark"] .alert-level.level-info { background: #1f3156; color: #a9c4f5; }
html[data-bs-theme="dark"] .energy-card .label, html[data-bs-theme="dark"] .alarm-card .label,
html[data-bs-theme="dark"] .price-facts .label { color: var(--app-text-2); }
html[data-bs-theme="dark"] .energy-card .when, html[data-bs-theme="dark"] .alarm-card .when { color: var(--app-text-3); }
html[data-bs-theme="dark"] .alarm-card.state-set-alarm, html[data-bs-theme="dark"] .alarm-card.state-acknowledged { background: #3a1d1d; }
html[data-bs-theme="dark"] .price-level { background: #2c3833; }
html[data-bs-theme="dark"] .price-level.level-0 { background: #1d3a2a; color: #8fd8ae; }
html[data-bs-theme="dark"] .price-level.level-1 { background: #2a3a1a; color: #b9db86; }
html[data-bs-theme="dark"] .price-level.level-3 { background: #46301a; color: #f5bd7f; }
html[data-bs-theme="dark"] .price-level.level-4 { background: #4d2222; color: #f5b1b1; }
html[data-bs-theme="dark"] .room-facts .warn { color: #f0a95a; }
html[data-bs-theme="dark"] .tile-error { color: #f59a9a; }
html[data-bs-theme="dark"] .seg-item { background: #26312c; }
html[data-bs-theme="dark"] .seg-item:hover { background: #2d3a34; }
html[data-bs-theme="dark"] .room-item:hover { background: rgba(255, 255, 255, 0.04); }
html[data-bs-theme="dark"] .room-items { border-color: var(--app-border); }

/* tiles: blind drawing and switch pill */
html[data-bs-theme="dark"] .blind-svg .bw-glass { fill: #24384a; }
html[data-bs-theme="dark"] .blind-svg .bw-slat { fill: #6d7772; }
html[data-bs-theme="dark"] .blind-svg .bw-gap { fill: #4a534f; }
html[data-bs-theme="dark"] .tile-fav.on { color: #f5b82e; }
html[data-bs-theme="dark"] .bottom-bar { box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.4); }
