[data-theme="dark"]{
    --background:#0b1220;--surface:#131c2e;--surface-2:#1a2438;
    --text:#e6edf6;--muted:#94a3b8;--soft:#64748b;
    --border:#2a3549;--border-soft:#1e293b;
    --primary:#2a2a5c;--accent:#8b6cf5;
    color-scheme:dark
}
[data-theme="dark"] body{background:var(--background);color:var(--text)}
[data-theme="dark"] a{color:var(--accent)}
[data-theme="dark"] .topbar{background:rgba(19,28,46,.9);border-bottom-color:var(--border)}
[data-theme="dark"] .topbar-title{color:var(--text)}
[data-theme="dark"] .icon-btn{background:var(--surface);border-color:var(--border);color:var(--muted)}
[data-theme="dark"] .bell-badge{border-color:var(--surface)}
[data-theme="dark"] .user-chip{background:var(--surface);border-color:var(--border)}
[data-theme="dark"] .sidebar{background:var(--surface);border-right-color:var(--border)}
[data-theme="dark"] .sidebar-brand{border-bottom-color:var(--border)}
[data-theme="dark"] .sidebar-footer{border-top-color:var(--border)}
[data-theme="dark"] .nav-divider{background:var(--border)}
[data-theme="dark"] .nav-item{color:var(--text)}
[data-theme="dark"] .nav-item:hover{background:var(--surface-2)}
[data-theme="dark"] .sidebar-user{background:var(--surface-2)}
[data-theme="dark"] .mobile-nav{background:rgba(19,28,46,.96);border-top-color:var(--border)}
[data-theme="dark"] .post-card,
[data-theme="dark"] .side-card,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .welcome-banner,
[data-theme="dark"] .profile-header-card{background:var(--surface);border-color:var(--border)}
[data-theme="dark"] .post-card--read{background:var(--surface-2);opacity:.85}
[data-theme="dark"] .post-card--read .post-title{color:var(--muted)}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select{background:var(--surface-2);color:var(--text);border-color:var(--border)}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder{color:var(--soft)}
[data-theme="dark"] .admin-search{background:var(--surface-2);border-color:var(--border)}
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .mini-btn,
[data-theme="dark"] .icon-action{background:var(--surface-2);border-color:var(--border);color:var(--text)}
[data-theme="dark"] .filter-tab{background:var(--surface);border-color:var(--border);color:var(--muted)}
[data-theme="dark"] .admin-table th,
[data-theme="dark"] .admin-table td{border-bottom-color:var(--border-soft)}
[data-theme="dark"] .status-published,
[data-theme="dark"] .status-pill--active,
[data-theme="dark"] .rate-good,
[data-theme="dark"] .pill-graduated{background:#14532d;color:#86efac}
[data-theme="dark"] .status-draft,
[data-theme="dark"] .status-pill--disabled{background:#1e293b;color:#94a3b8}
[data-theme="dark"] .status-pill--admin,
[data-theme="dark"] .pill-admin{background:color-mix(in srgb,var(--accent) 25%,transparent);color:var(--accent)}
[data-theme="dark"] .auth-status--error{background:#450a0a;color:#fca5a5;border-color:#7f1d1d}
[data-theme="dark"] .auth-status--ok{background:#052e16;color:#86efac;border-color:#14532d}
[data-theme="dark"] .auth-status--info{background:#172554;color:#93c5fd;border-color:#1e3a8a}
[data-theme="dark"] .modal-card{background:var(--surface)}
[data-theme="dark"] .dropdown-menu{background:var(--surface);border-color:var(--border);box-shadow:0 12px 32px rgba(0,0,0,.5)}
[data-theme="dark"] .dropdown-item{color:var(--text)}
[data-theme="dark"] .dropdown-item:hover{background:var(--surface-2)}
[data-theme="dark"] .dropdown-user-head,
[data-theme="dark"] .dropdown-head,
[data-theme="dark"] .dropdown-foot{border-color:var(--border-soft)}
[data-theme="dark"] .dropdown-divider{background:var(--border-soft)}
[data-theme="dark"] .badge-new{background:color-mix(in srgb,var(--accent) 22%,transparent);color:var(--accent)}
[data-theme="dark"] .badge-read{background:var(--surface-2);border-color:var(--border);color:var(--soft)}
[data-theme="dark"] .attachment-card{background:var(--surface-2);border-color:var(--border)}
[data-theme="dark"] .auth-card{background:var(--surface);border-color:var(--border)}
[data-theme="dark"] .credit-line{color:var(--soft);border-top-color:var(--border)}

#theme-toggle .theme-icon-sun{display:none!important}
#theme-toggle .theme-icon-moon{display:inline-block!important}
html[data-theme="dark"] #theme-toggle .theme-icon-sun{display:inline-block!important}
html[data-theme="dark"] #theme-toggle .theme-icon-moon{display:none!important}