/* Theme overrides are last in the cascade; no remote fonts or icon dependencies. */
.theme-sun{display:none}
[data-theme=dark] .theme-moon{display:none}
[data-theme=dark] .theme-sun{display:block}
.settings-top{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:12px}
.settings-top>.panel{grid-column:auto!important;min-width:0;height:100%}
#workspace[data-current-view=settings] .page-heading-copy{display:none}
#workspace[data-current-view=settings] .page-heading{justify-content:flex-end;margin:0 0 10px}
.log-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0}
.log-toolbar p{margin:0}
.operations summary{display:flex;justify-content:space-between;gap:12px;align-items:center;cursor:pointer;list-style:none}
.operations summary:before{content:'›';font-size:17px;color:var(--muted)}
.operations details[open]>summary:before{transform:rotate(90deg)}
.operations summary>span:first-child::after{content:none}
.operations summary>span:first-of-type{flex:1}
html[data-theme=dark]{color-scheme:dark;--bg:#161a20;--surface:#20262e;--text:#e3e7ed;--muted:#a2adb9;--line:#39424d;--primary:#d58b73;--primary-soft:#3a2c28;--green:#75c8a3;--orange:#edba63;--red:#ed9199;background:var(--bg);color:var(--text)}
[data-theme=dark] body{background:var(--bg);color:var(--text)}
[data-theme=dark] #dashboard,[data-theme=dark] #sidebar.sidebar,[data-theme=dark] .panel,[data-theme=dark] .card,[data-theme=dark] .stat-card,[data-theme=dark] dialog,[data-theme=dark] .login-panel,[data-theme=dark] .admin-dropdown{background:var(--surface);color:var(--text);border-color:var(--line)}
[data-theme=dark] :is(h1,h2,h3,.panel h2,.panel h3,.stat-card strong,.sidebar .brand,.counter-strip b,.card h3){color:var(--text)}
[data-theme=dark] :is(.hint,.stat-card small,.stat-caption,.resource-line,.domain-origin,.event time,.settings-row p,.settings-row h3,.sidebar .nav-item,.card-footer p,.rank-row b,.rank-head,.rank-total,.server-meta,.server-meter,.recent-event,.recent-event time,.donut-legend b,.donut-legend small,.table-details summary,.statistics-note summary,.node-domain-option small,.chart-labels,dt){color:var(--muted)}
[data-theme=dark] :is(input,select,textarea,.range-filter select,.node-add-form,.counter-strip,.chart-empty,.node-domain-option,.admin-preview,pre,#maintenance-command){background:#191f26;color:var(--text);border-color:var(--line)}
[data-theme=dark] input::placeholder,[data-theme=dark] textarea::placeholder{color:#8895a4}
[data-theme=dark] button.quiet,[data-theme=dark] .icon-button.quiet{background:transparent;color:var(--text);border-color:var(--line)}
[data-theme=dark] button.quiet:hover,[data-theme=dark] .sidebar .nav-item:hover{background:#303944;color:var(--text)}
[data-theme=dark] .sidebar .nav-item.active,[data-theme=dark] .brand-logo{background:#3a2c28;color:#edb39f;border-color:#725345}
[data-theme=dark] button:not(.quiet):not(.danger){color:#181c22}
[data-theme=dark] .quick-actions button.quiet{background:#293341;color:#cedbed}
[data-theme=dark] :is(.settings-row,.event,.card-footer,.node-traffic,.section-footnote,.node-domain-line,.server-row,.rank-row,.rank-head,.recent-event,.system-panel dl>div,th,td){border-color:var(--line)}
[data-theme=dark] th{background:#29313b;color:var(--muted)}
[data-theme=dark] .alert-ok,[data-theme=dark] .badge{background:#1e3d32;color:#8bd3b1;border-color:#35564a}
[data-theme=dark] .badge.offline{background:#49382c;color:#efc28a}
[data-theme=dark] .alert-item,[data-theme=dark] .admin-warning{background:#3a3024;color:#e9ceb0;border-color:#7a6137}
[data-theme=dark] .alert-item.critical{background:#402a30;color:#efb3b9;border-color:#81505b}
[data-theme=dark] .alert-item.info{background:#243349;color:#b1c8ec;border-color:#456389}
[data-theme=dark] .error,[data-theme=dark] .certificate-status.error{color:#ed9199}
[data-theme=dark] .danger{background:#422a32;color:#f2a5ad;border-color:#69404c}
[data-theme=dark] .danger:hover{background:#57313d}
[data-theme=dark] .card.is-selected,[data-theme=dark] .card:focus-visible{background:#342c29;box-shadow:inset 3px 0 0 var(--primary);border-color:var(--primary)}
[data-theme=dark] .chart-axis{fill:#acb7c3}
[data-theme=dark] .chart-grid{stroke:#3a434e}
[data-theme=dark] .chart-empty{background:#191f26;border-color:#3a434e}
[data-theme=dark] .donut>div{background:var(--surface)}
[data-theme=dark] :is(.avatar,.stat-icon,.rank-meter){background:#2c3540;color:#d6bba8}
[data-theme=dark] .node-traffic b{color:#85cfb9}
[data-theme=dark] .toast{background:#303945;color:var(--text);border-color:var(--line)}
[data-theme=dark] dialog::backdrop{background:#0009}
@media(max-width:999px){.settings-top{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-top>#settings-section{grid-column:1/-1!important}}
@media(max-width:620px){.settings-top{grid-template-columns:minmax(0,1fr)}.settings-top>.panel{grid-column:1!important}.log-toolbar button{width:100%}}
