.sidebar-control { margin-right:14px; flex-shrink:0; }
.topbar { justify-content:flex-start; }
.topbar > .user-menu { margin-left:auto; }
.topbar > .sidebar-control + div { min-width:0; }
.theme-choice { width:auto; min-width:84px; }
.theme-picker { display:flex; align-items:center; gap:6px; color:var(--ink); }
.theme-symbol { font-size:18px; }
.login-theme { display:flex; justify-content:flex-end; margin-bottom:16px; }
html[data-bs-theme="dark"] .login-body { background:var(--bg); color:var(--ink); }
html[data-bs-theme="dark"] .login-panel { background:var(--panel); color:var(--ink); border-color:var(--line); }
html[data-bs-theme="dark"] .login-brand small { color:var(--muted); }
.sidebar-flyout { position:fixed; left:84px; z-index:1050; width:280px; height:auto; max-height:calc(100dvh - 16px); overflow-y:auto; padding:16px; background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow); }
.sidebar-flyout .flyout-links { display:block; height:auto!important; overflow:visible; margin-top:8px; }
.sidebar-flyout .nav-link { display:flex; align-items:center; gap:10px; min-height:44px; white-space:normal; }
.sidebar-flyout .nav-link { color:var(--ink); padding:12px 4px; }
.sidebar-flyout .nav-link:hover { background:var(--bg); }
@media(min-width:768px) {
  html[data-sidebar="collapsed"] .app-shell { grid-template-columns:80px minmax(0,1fr); }
  html[data-sidebar="collapsed"] .sidebar { padding:18px 8px; }
  html[data-sidebar="collapsed"] .sidebar .brand { padding:8px 4px 22px; justify-content:center; }
  html[data-sidebar="collapsed"] .sidebar .brand > span:last-child { display:none; }
  html[data-sidebar="collapsed"] .sidebar .nav-section-items { display:none!important; }
  html[data-sidebar="collapsed"] .sidebar .nav-section-toggle,
  html[data-sidebar="collapsed"] .sidebar .nav-link-dashboard { font-size:0; justify-content:center; min-height:44px; padding:10px; }
  html[data-sidebar="collapsed"] .sidebar .nav-section-toggle span { font-size:0; gap:0; }
  html[data-sidebar="collapsed"] .sidebar i { font-size:18px; }
  html[data-sidebar="collapsed"] .sidebar .nav-section-chevron { display:none; }
}
html[data-bs-theme="dark"] { --bg:#191c22; --panel:#252a33; --ink:#edf0f5; --muted:#b1bdce; --line:#424b5b; --primary:#53b9ab; --primary-dark:#8cdbd0; --shadow:0 10px 24px rgba(0,0,0,.16); color-scheme:dark; }
html[data-bs-theme="dark"] .topbar,
html[data-bs-theme="dark"] .app-footer,
html[data-bs-theme="dark"] .info-strip,
html[data-bs-theme="dark"] .filter-bar,
html[data-bs-theme="dark"] .analytics-card,
html[data-bs-theme="dark"] .meter-details,
html[data-bs-theme="dark"] .mobile-header { background:var(--panel); color:var(--ink); }
html[data-bs-theme="dark"] .dashboard-view-switch,
html[data-bs-theme="dark"] .chart-period-switch { background:#303846; color:var(--ink); }
html[data-bs-theme="dark"] .dashboard-view-switch label,
html[data-bs-theme="dark"] .chart-period-switch span { color:var(--muted); }
html[data-bs-theme="dark"] body:has(#dashboardViewCurrent:checked) label[for="dashboardViewCurrent"],
html[data-bs-theme="dark"] body:has(#dashboardViewProjected:checked) label[for="dashboardViewProjected"],
html[data-bs-theme="dark"] .chart-period-switch input:checked + span { background:#424d5e; color:#fff; }
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select { background-color:#20252d; color:var(--ink); border-color:var(--line); }
html[data-bs-theme="dark"] .form-control:disabled { background:#353b46; }
html[data-bs-theme="dark"] .table { --bs-table-bg:var(--panel); --bs-table-color:var(--ink); --bs-table-border-color:var(--line); }
html[data-bs-theme="dark"] .table thead th { background:#303846; color:var(--muted); }
html[data-bs-theme="dark"] .date-notice { color:#ffc575; }
html[data-bs-theme="dark"] .chart-empty,
html[data-bs-theme="dark"] .chart-empty-message { background:var(--panel); color:var(--muted); }
html[data-bs-theme="dark"] .linked-source-panel,
html[data-bs-theme="dark"] .integrated-source-fields { background:var(--bg); color:var(--ink); border-color:var(--line); }
html[data-bs-theme="dark"] .integrated-source-title { color:#74d4c5; }
html[data-bs-theme="dark"] .mobile-menu-toggle { background:var(--panel); color:var(--ink); border-color:var(--line); }
@media(max-width:767.98px) { .sidebar-control { display:none; } .mobile-user-actions { flex-wrap:wrap; } .theme-choice { min-width:72px; } }
@media print { .sidebar-control,.theme-picker,.sidebar-flyout { display:none!important; } }
