/* Theme system: light / dark / auto + sidebar accents */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{background:#0b1220!important;color:#e5e7eb!important}
html[data-theme="dark"] .admin-layout{background:#0b1220!important}
html[data-theme="dark"] .admin-main{background:#0b1220!important;color:#e5e7eb!important}
html[data-theme="dark"] .admin-topbar{background:#0f172a!important;border-bottom-color:#1f2937!important;color:#e5e7eb!important}
html[data-theme="dark"] .page-title{color:#e5e7eb!important}
html[data-theme="dark"] .lang-switcher-btn,html[data-theme="dark"] .role-switcher-btn{background:#111c31!important;color:#cbd5e1!important;border-color:#26334a!important}
html[data-theme="dark"] .admin-page [class$="-card"],html[data-theme="dark"] .admin-page .admin-card{background:#0f172a!important;border-color:#1f2937!important;color:#e5e7eb!important}
html[data-theme="dark"] .admin-page input,html[data-theme="dark"] .admin-page select,html[data-theme="dark"] .admin-page textarea{background:#0b1220!important;border-color:#26334a!important;color:#e5e7eb!important}
html[data-theme="dark"] .admin-page table{background:#0f172a!important;color:#e5e7eb!important}
html[data-theme="dark"] .admin-page table th{background:#111c31!important;color:#94a3b8!important}
html[data-theme="dark"] .admin-page table td{border-color:#1f2937!important}
html[data-theme="dark"] .az-modal,html[data-theme="dark"] .usr-modal,html[data-theme="dark"] .ses-dialog,html[data-theme="dark"] .asg-card,html[data-theme="dark"] .qq-dialog{background:#0f172a!important;color:#e5e7eb!important}
html[data-theme="dark"] .az-modal .az-body,html[data-theme="dark"] .qq-dialog-body,html[data-theme="dark"] .ses-dialog-body,html[data-theme="dark"] .asg-body{background:#0f172a!important}
/* sidebar accents */
html[data-accent="graphite"] .admin-sidebar{background:linear-gradient(180deg,#1e293b,#0f172a)!important}
html[data-accent="emerald"] .admin-sidebar{background:linear-gradient(180deg,#064e3b,#022c22)!important}
html[data-accent="ocean"] .admin-sidebar{background:linear-gradient(180deg,#0c4a6e,#082f49)!important}
html[data-accent="violet"] .admin-sidebar{background:linear-gradient(180deg,#4c1d95,#2e1065)!important}
html[data-accent="rose"] .admin-sidebar{background:linear-gradient(180deg,#881337,#4c0519)!important}
html[data-accent="amber"] .admin-sidebar{background:linear-gradient(180deg,#78350f,#451a03)!important}
html[data-accent="white"] .admin-sidebar{background:linear-gradient(180deg,#ffffff,#f1f5f9)!important;color:#0f172a!important;box-shadow:-2px 0 18px rgba(15,23,42,.08)!important}
html[data-accent="white"] .admin-sidebar .sidebar-header{background:linear-gradient(135deg,#eef2ff,#f8fafc)!important;color:#1e293b!important}
html[data-accent="white"] .admin-sidebar a,html[data-accent="white"] .admin-sidebar button{color:#334155!important}
html[data-accent="white"] .admin-sidebar .active a,html[data-accent="white"] .admin-sidebar a.active{color:#4338ca!important}
/* picker */
.az-theme-picker{position:relative;display:inline-flex}
.az-theme-btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:31px;border:1px solid var(--border,#e5e7eb);background:var(--bg,#f3f4f6);border-radius:9px;cursor:pointer;color:var(--text-light,#475569);font-size:13px;transition:.15s ease}.az-theme-btn:hover{background:#fff;color:#4f46e5}
.az-theme-menu{position:absolute;top:calc(100% + 8px);left:0;z-index:70000;background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 18px 48px rgba(15,23,42,.2);padding:12px;width:240px;display:none}
.az-theme-menu.on{display:block}
.az-theme-menu b{display:block;font-size:11px;color:#64748b;margin:0 0 6px}
.az-theme-row{display:flex;gap:6px;margin-bottom:12px}
.az-theme-row button{border:1px solid #e2e8f0;background:#fff;border-radius:9px;width:36px;height:32px;font-size:13px;cursor:pointer;color:#475569}
.az-theme-row button.on{border-color:#6366f1;color:#4338ca;background:#eef2ff}
.az-swatches{display:flex;gap:8px;flex-wrap:wrap}
.az-swatch{width:26px;height:26px;border-radius:50%;border:2px solid transparent;cursor:pointer}
.az-swatch.on{border-color:#0f172a;box-shadow:0 0 0 2px #fff inset}
html[data-theme="dark"] .az-theme-btn{background:#111c31;border-color:#26334a;color:#cbd5e1}
html[data-theme="dark"] .az-theme-menu{background:#0f172a;border-color:#26334a}
html[data-theme="dark"] .az-theme-menu b,html[data-theme="dark"] .az-theme-row button{color:#cbd5e1}
html[data-theme="dark"] .az-theme-row button{background:#111c31;border-color:#26334a}

.admin-sidebar{background:var(--az-sidebar-bg, linear-gradient(180deg,#1e293b 0%,#0f172a 100%))!important}

html[data-theme="dark"] .admin-page [class*="-stat"],
html[data-theme="dark"] .admin-page [class*="-filters"],
html[data-theme="dark"] .admin-page [class*="-toolbar"],
html[data-theme="dark"] .admin-page [class*="-table-wrap"],
html[data-theme="dark"] .admin-page [class*="-panel"],
html[data-theme="dark"] .admin-page [class*="-box"]{background:#0f172a!important;border-color:#1f2937!important;color:#e5e7eb!important}
html[data-theme="dark"] .admin-page [class*="-stat"] b,
html[data-theme="dark"] .admin-page [class*="-stat"] strong{color:#f8fafc!important}
html[data-theme="dark"] .admin-page [class*="-stat"] span,
html[data-theme="dark"] .admin-page [class*="-stat"] small{color:#94a3b8!important}
html[data-theme="dark"] .admin-page .db-filters{background:#0f172a!important;border-color:#1f2937!important}
html[data-theme="dark"] .admin-page .db-filter span{color:#94a3b8!important}
html[data-theme="dark"] .admin-page .db-filter input,
html[data-theme="dark"] .admin-page .db-filter select{background:#0b1220!important;border-color:#26334a!important;color:#e5e7eb!important}
html[data-theme="dark"] .admin-page [style*="background:#fff"],html[data-theme="dark"] .admin-page [style*="background: #fff"]{background:#0f172a!important;color:#e5e7eb!important}


@media(max-width:768px){
.az-theme-picker{display:inline-flex!important;visibility:visible!important}
.az-theme-btn{width:36px!important;height:34px!important;display:inline-flex!important;background:#eef2f7!important;border-color:#dbe3ef!important;color:#4338ca!important}
.az-theme-menu{position:fixed!important;top:62px!important;right:8px!important;left:auto!important;width:min(260px,calc(100vw - 16px))!important;z-index:99999!important;box-shadow:0 18px 48px rgba(15,23,42,.28)!important}
.az-theme-row{justify-content:center}
}