.sidebar-utilities{margin-top:auto;padding-top:14px;border-top:1px solid var(--line);display:grid;gap:7px;min-width:0}
.sidebar-utility,.sidebar-theme-toggle{display:flex!important;align-items:center;gap:10px;width:100%;min-width:0;min-height:42px;padding:9px 11px!important;border-radius:10px;background:#f8fafc!important;color:#475569!important;font-weight:700;cursor:pointer}
.sidebar-utility.hidden{display:none!important}
.sidebar-utility span,.sidebar-theme-toggle>span{display:grid;place-items:center;width:27px;height:27px;border-radius:8px;background:#dff7f3;color:#087f73;font-size:17px}
.sidebar-utility b,.sidebar-theme-toggle b{flex:1;text-align:left;font-size:13px}
.sidebar-theme-toggle{margin:0}
.sidebar-theme-toggle input{position:absolute;opacity:0;pointer-events:none}
.sidebar-theme-toggle i{position:relative;width:38px;height:21px;border-radius:999px;background:#cbd5e1;transition:.2s}
.sidebar-theme-toggle i:after{content:"";position:absolute;width:17px;height:17px;left:2px;top:2px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.25);transition:.2s}
.sidebar-theme-toggle input:checked+i{background:#14b8a6}
.sidebar-theme-toggle input:checked+i:after{transform:translateX(17px)}
.install-help-dialog{width:min(460px,calc(100% - 24px))}
.install-help-dialog p{line-height:1.6}
html,body{max-width:100%;overflow-x:hidden}
.main-nav{overflow-x:hidden!important}
@media(display-mode:standalone),(display-mode:fullscreen),(display-mode:minimal-ui),(display-mode:window-controls-overlay){
  #installAppBtn{display:none!important}
}

:root[data-theme="dark"]{color-scheme:dark;--bg:#08131d;--card:#101f2b;--text:#f1f5f9;--muted:#b8c5d1;--line:#365063;--nav:#06111b;--primary:#2dd4bf;--primary2:#14b8a6;--info:#7dd3fc;--shadow:0 10px 30px rgba(0,0,0,.28)}
:root[data-theme="dark"] body{background:radial-gradient(circle at 85% -10%,rgba(20,184,166,.09),transparent 28%),var(--bg);color:var(--text)}
:root[data-theme="dark"] .main-nav,:root[data-theme="dark"] .topbar,:root[data-theme="dark"] .panel,:root[data-theme="dark"] .project-card,:root[data-theme="dark"] .stat,:root[data-theme="dark"] .table-wrap,:root[data-theme="dark"] dialog,:root[data-theme="dark"] input,:root[data-theme="dark"] select,:root[data-theme="dark"] textarea,:root[data-theme="dark"] .document-root,:root[data-theme="dark"] .document-group,:root[data-theme="dark"] .notification-dropdown,:root[data-theme="dark"] .user-dropdown,:root[data-theme="dark"] .machine-results,:root[data-theme="dark"] .auth-card{background:#101f2b;color:var(--text);border-color:var(--line)}
:root[data-theme="dark"] .topbar{border-bottom-color:var(--line)}
:root[data-theme="dark"] .main-nav:before{background-color:#fff;border-radius:8px}
:root[data-theme="dark"] .main-nav button,:root[data-theme="dark"] .user-dropdown button{color:#d7e2ea}
:root[data-theme="dark"] .main-nav button.active{background:#153344;color:#5eead4}
:root[data-theme="dark"] th,:root[data-theme="dark"] .document-root-head,:root[data-theme="dark"] .document-group-head,:root[data-theme="dark"] .folder-access-controls,:root[data-theme="dark"] .document-subgroups,:root[data-theme="dark"] .point-card,:root[data-theme="dark"] .team-member,:root[data-theme="dark"] .project-list>div,:root[data-theme="dark"] .empty-state,:root[data-theme="dark"] .history-item,:root[data-theme="dark"] .join-project-card,:root[data-theme="dark"] .capacity-meter,:root[data-theme="dark"] .export-filter,:root[data-theme="dark"] .setup-danger-zone,:root[data-theme="dark"] .email-chip{background:#132634;color:var(--text);border-color:var(--line)}
:root[data-theme="dark"] td,:root[data-theme="dark"] .document-row,:root[data-theme="dark"] .history-changes dt,:root[data-theme="dark"] .history-changes dd{border-color:var(--line)}
:root[data-theme="dark"] .document-row:hover,:root[data-theme="dark"] .document-row:focus{background:#15382f}
:root[data-theme="dark"] input:disabled,:root[data-theme="dark"] select:disabled,:root[data-theme="dark"] textarea:disabled,:root[data-theme="dark"] #pointNotifier[readonly]{background:#172a37;color:#aebdca}
:root[data-theme="dark"] .muted{color:var(--muted)}
:root[data-theme="dark"] label,:root[data-theme="dark"] h1,:root[data-theme="dark"] h2,:root[data-theme="dark"] h3,:root[data-theme="dark"] h4,:root[data-theme="dark"] p,:root[data-theme="dark"] td,:root[data-theme="dark"] th,:root[data-theme="dark"] dt,:root[data-theme="dark"] dd,:root[data-theme="dark"] legend{color:inherit}
:root[data-theme="dark"] input::placeholder,:root[data-theme="dark"] textarea::placeholder{color:#91a4b5;opacity:1}
:root[data-theme="dark"] button:not(.primary):not(.danger):not(.ghost):not(.sync-live):not(.sync-syncing):not(.sync-offline):not(.bell-button):not(.sidebar-toggle){background:#203545;color:#edf5fa;border-color:var(--line)}
:root[data-theme="dark"] .link-btn,:root[data-theme="dark"] a{color:#7dd3fc}
:root[data-theme="dark"] .badge{background:#2a4152;color:#edf5fa}
:root[data-theme="dark"] .machine-results button{background:#142735;color:#edf5fa}
:root[data-theme="dark"] .machine-results button:hover,:root[data-theme="dark"] .machine-results button:focus,:root[data-theme="dark"] .user-dropdown button:hover{background:#1b3b43}
:root[data-theme="dark"] .setup-mode-tabs button{background:#142735;color:#d7e2ea;border-color:var(--line)}
:root[data-theme="dark"] .setup-mode-tabs button.active{background:#16443f;color:#99f6e4;border-color:#2dd4bf}
:root[data-theme="dark"] .email-suffix-field{background:#172a37;border-color:var(--line)}
:root[data-theme="dark"] .email-suffix-field span{color:#e2e8f0}
:root[data-theme="dark"] .lock-notice{background:#3a2518;color:#fed7aa;border-color:#9a5a26}
:root[data-theme="dark"] .warning-button{background:#3b2c13;color:#fde68a;border-color:#8b641c}
:root[data-theme="dark"] .button-link,:root[data-theme="dark"] .button-label{background:#203545;color:#edf5fa}
:root[data-theme="dark"] .info{background:#102d40;border-color:#245472;color:#c7e9ff}
:root[data-theme="dark"] .notification-item{background:#142735;color:var(--text);border-color:var(--line)}
:root[data-theme="dark"] .notification-item p{color:#b7c6d2}
:root[data-theme="dark"] .notification-item.unread{background:#15382f;border-color:#287c68}
:root[data-theme="dark"] .sidebar-utility,:root[data-theme="dark"] .sidebar-theme-toggle{background:#132634!important;color:#d6e2e9!important}
:root[data-theme="dark"] .dialog-actions{background:#101f2b}
:root[data-theme="dark"] code{color:#c6f6e9}

@media(max-width:850px){
  .sidebar-utilities{margin-top:auto}
}
