/* آريا — الثيم الأسود AMOLED (يعتمد على الوضع الداكن ويُسوّده) + قائمة اختيار الثيم */

/* ── اللوحات (إداري/أستاذ/طالب) ── */
html[data-aria-theme="amoled"] body[class*=role-]{
  --bg:#000;--bg2:#050506;--white:#0B0B0D;--border:rgba(255,255,255,.08);--line:rgba(255,255,255,.08);
  --text:#ECECEF;--muted:#8B8B95;--glass:rgba(0,0,0,.82);--sb-bg:#000;
  background:radial-gradient(900px 500px at 85% -10%,color-mix(in srgb,var(--a1) 7%,transparent),transparent 60%),#000 fixed}
html[data-aria-theme="amoled"] body[class*=role-] .sidebar{
  background:radial-gradient(420px 260px at 85% -4%,color-mix(in srgb,var(--a1) 15%,transparent),transparent 70%),#000!important;
  border-color:rgba(255,255,255,.08)!important;box-shadow:0 0 0 1px rgba(255,255,255,.03)!important}
html[data-aria-theme="amoled"] .sb-user-card,html[data-aria-theme="amoled"] .sb-search input,html[data-aria-theme="amoled"] .sb-fold{background:#0B0B0D!important}
html[data-aria-theme="amoled"] #notifPanel,html[data-aria-theme="amoled"] #a27-cmd .p{background:#0B0B0D!important}
html[data-aria-theme="amoled"] .card,html[data-aria-theme="amoled"] .stat-card,html[data-aria-theme="amoled"] .table-wrap{border-color:rgba(255,255,255,.08)}

/* ── الصفحة الرئيسية ── */
html[data-aria-theme="amoled"]{--bg:#000;--bg2:#000;--bg3:#070708;--bg4:#040405;--surface:#0D0D0F;--surface2:#141416}
html[data-aria-theme="amoled"] body{background-color:#000}

/* ── الدخول والتسجيل ── */
html[data-aria-theme="amoled"] .blob{opacity:.26}
html[data-aria-theme="amoled"] .blob.b3{opacity:.12}
html[data-aria-theme="amoled"] .grid{opacity:.3}

/* ── قائمة اختيار الثيم ── */
#a27-theme{font-size:18px}
.atm{position:fixed;z-index:5000;width:min(292px,calc(100vw - 16px));padding:8px;border-radius:20px;
  background:var(--white,#fff);color:var(--text,#0F172A);border:1px solid var(--line,rgba(0,0,0,.1));
  box-shadow:0 30px 80px -20px rgba(0,0,0,.55);animation:atmIn .2s cubic-bezier(.22,1,.36,1);font-family:inherit}
html[data-theme="dark"] .atm{background:#121A31}
html[data-aria-theme="amoled"] .atm{background:#0B0B0D;border-color:rgba(255,255,255,.12)}
@keyframes atmIn{from{opacity:0;transform:translateY(-6px) scale(.97)}}
.atm-t{font-size:11px;font-weight:800;opacity:.55;padding:6px 10px 4px}
.atm-i{display:flex;align-items:center;gap:12px;width:100%;min-height:54px;padding:8px 10px;border:0;border-radius:14px;background:none;color:inherit;
  font:inherit;text-align:right;cursor:pointer;transition:background .15s}
.atm-i:hover{background:rgba(127,127,127,.12)}
.atm-i.on{background:rgba(127,127,127,.16)}
.atm-ic{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;font-size:17px;flex:none;border:1px solid rgba(127,127,127,.25)}
.atm-light{background:#F4F6FC}.atm-dark{background:#10172B}.atm-amoled{background:#000}
.atm-tx{display:flex;flex-direction:column;flex:1;min-width:0}
.atm-tx b{font-size:13.5px;font-weight:800}.atm-tx small{font-size:11px;opacity:.6;line-height:1.5}
.atm-i i{font-style:normal;font-weight:900;color:var(--a1,#00D4A1);opacity:0}.atm-i.on i{opacity:1}
.atm-i:focus-visible{outline:2px solid var(--a1,#00D4A1);outline-offset:1px}

/* ═══════════════════════════════════════════════════════════
   طبقة aria-ui (ترويسة includes/header.php — أغلب صفحات الإداري)
   الوضع الداكن + الأسود. يُطبَّق على كل ما ليس "فاتحاً".
   ═══════════════════════════════════════════════════════════ */
.ui-theme{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:13px;cursor:pointer;font-size:17px;line-height:1;
  border:1px solid var(--ui-line,rgba(15,23,42,.07));background:rgba(255,255,255,.75);color:var(--muted,#64748B);transition:all .3s cubic-bezier(.22,1,.36,1)}
.ui-theme:hover{transform:translateY(-2px) rotate(12deg);border-color:var(--ui-a1,#00D4A1);box-shadow:0 10px 24px -12px var(--ui-a1,#00D4A1)}
.ui-theme:focus-visible{outline:2px solid var(--ui-a1,#00D4A1);outline-offset:2px}

html[data-theme="dark"]{--ui-bg:#0A0F1E}
html[data-aria-theme="amoled"]{--ui-bg:#000}
html[data-theme="dark"] body[class*=role-]{
  --bg:#0A0F1E;--bg2:#10172B;--white:#121A31;--border:rgba(255,255,255,.09);--text:#E8ECF8;--muted:#8F9BB8;
  --ui-glass:rgba(18,26,49,.78);--ui-line:rgba(255,255,255,.09);
  --ui-shadow:0 1px 2px rgba(0,0,0,.3),0 14px 36px -16px rgba(0,0,0,.7);--ui-shadow-hi:0 2px 4px rgba(0,0,0,.35),0 26px 56px -18px rgba(0,0,0,.8);
  color-scheme:dark}
html[data-aria-theme="amoled"] body[class*=role-]{--ui-glass:rgba(8,8,10,.84);--ui-line:rgba(255,255,255,.08)}

html[data-theme="dark"] body::after{background-image:radial-gradient(rgba(255,255,255,.05) 1px,transparent 1px)}
html[data-aria-theme="amoled"] body::before{opacity:.4}

/* الشريط العلوي والعناصر الزجاجية */
html[data-theme="dark"] body .topbar{border-color:var(--ui-line)!important;border-bottom-color:var(--ui-line)!important}
html[data-theme="dark"] body:has(nav.sidebar) .topbar{border:1px solid var(--ui-line)!important}
html[data-theme="dark"] .topbar-clock,html[data-theme="dark"] .topbar-notif,html[data-theme="dark"] .user-pill,
html[data-theme="dark"] .ui-cmd,html[data-theme="dark"] .ui-fold,html[data-theme="dark"] .ui-theme{background:rgba(255,255,255,.06)!important;color:var(--text)}
html[data-theme="dark"] .ui-cmd kbd{background:rgba(255,255,255,.08)}
html[data-theme="dark"] .user-avatar{box-shadow:0 0 0 2px #121A31,0 0 0 4px color-mix(in srgb,var(--ui-a1) 50%,transparent)!important}
html[data-theme="dark"] img.user-avatar{background:#121A31!important}
html[data-theme="dark"] .user-pill *,html[data-theme="dark"] .topbar-clock{color:var(--text)}
html[data-aria-theme="amoled"] .topbar-clock,html[data-aria-theme="amoled"] .topbar-notif,html[data-aria-theme="amoled"] .user-pill,
html[data-aria-theme="amoled"] .ui-cmd,html[data-aria-theme="amoled"] .ui-fold,html[data-aria-theme="amoled"] .ui-theme{background:#0B0B0D!important}

/* البطاقات والجداول والنماذج */
html[data-theme="dark"] .card,html[data-theme="dark"] .stat-card,html[data-theme="dark"] .table-wrap{border-color:var(--ui-line)!important;color:var(--text)}
html[data-theme="dark"] .card:hover,html[data-theme="dark"] .table-wrap:hover{border-color:color-mix(in srgb,var(--ui-a1) 40%,transparent)!important}
html[data-theme="dark"] .table-head{background:rgba(255,255,255,.04)!important}
html[data-theme="dark"] th{background:rgba(255,255,255,.05)!important;color:#9AA6C2!important}
html[data-theme="dark"] td{color:var(--text);border-color:var(--ui-line)}
html[data-theme="dark"] tr:hover td{background:color-mix(in srgb,var(--ui-a1) 9%,#121A31)!important}
html[data-theme="dark"] .btn-ghost{background:rgba(255,255,255,.07)!important;color:var(--text)!important;border-color:var(--ui-line)!important}
html[data-theme="dark"] .form-control,html[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=range]),
html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:rgba(255,255,255,.06)!important;color:var(--text)!important;border-color:var(--ui-line)!important}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#6F7B99}
html[data-theme="dark"] select option{background:#121A31;color:#E8ECF8}
html[data-theme="dark"] .tabs-nav{background:rgba(255,255,255,.05)!important}
html[data-theme="dark"] .tab-btn:not(.active){color:var(--muted)}
html[data-theme="dark"] #notifPanel{background:var(--ui-glass)!important;border-color:var(--ui-line)!important;color:var(--text)}
html[data-theme="dark"] #ui-cmd .p{background:rgba(14,20,38,.96);border-color:var(--ui-line)}
html[data-theme="dark"] .ui-dock{background:rgba(18,26,49,.86);border-color:var(--ui-line)}
html[data-aria-theme="amoled"] #ui-cmd .p{background:rgba(6,6,8,.97)}
html[data-aria-theme="amoled"] .ui-dock{background:rgba(6,6,8,.88)}
html[data-aria-theme="amoled"] body[class*=role-] .card,html[data-aria-theme="amoled"] body[class*=role-] .stat-card,html[data-aria-theme="amoled"] body[class*=role-] .table-wrap{background:var(--ui-glass)!important}
html[data-theme="dark"] .page-header:not(.ui-hero) h1,html[data-theme="dark"] .card-title,html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3{color:var(--text)}

/* ألوان فاتحة مكتوبة مباشرة داخل صفحات (style="background:#fff" ...) → تتبع الثيم */
html[data-theme="dark"] body[class*=role-] [style*="background:#fff" i],
html[data-theme="dark"] body[class*=role-] [style*="background: #fff" i],
html[data-theme="dark"] body[class*=role-] [style*="background:#ffffff" i],
html[data-theme="dark"] body[class*=role-] [style*="background:white" i],
html[data-theme="dark"] body[class*=role-] [style*="background-color:#fff" i]{background:var(--white)!important;color:var(--text)}
html[data-theme="dark"] body[class*=role-] [style*="background:#f8fafc" i],
html[data-theme="dark"] body[class*=role-] [style*="background:#f1f5f9" i],
html[data-theme="dark"] body[class*=role-] [style*="background:#f0f2f8" i],
html[data-theme="dark"] body[class*=role-] [style*="background: #f8fafc" i]{background:var(--bg2)!important;color:var(--text)}
html[data-theme="dark"] body[class*=role-] [style*="color:#0f172a" i],
html[data-theme="dark"] body[class*=role-] [style*="color:#1e293b" i],
html[data-theme="dark"] body[class*=role-] [style*="color:#334155" i]{color:var(--text)!important}
