/* ============================================================
   dash-apple.css — إعادة تنسيق الداشبورد بأسلوب Apple
   يُحمّل أخيراً ويعيد ضبط المتغيرات والمكوّنات (بدون لمس الـ JS)
   ============================================================ */

/* ---------- إعادة ضبط المتغيرات ---------- */
:root{
  /* من style.css */
  --bg:#000000; --bg2:#060608; --card:#0c0c0f; --card-hover:#141418;
  --gold:#7c5cff; --gold-light:#9d86ff; --gold-dark:#5b3fd6; --gold-glow:rgba(124,92,255,.4);
  --primary:#7c5cff; --primary-hover:#9d86ff; --accent:#9d86ff;
  --text:#f5f5f7; --text-muted:#a1a1a6; --success:#30d158; --danger:#ff5f57;
  --radius:18px; --border:1px solid rgba(255,255,255,.07); --border-strong:1px solid rgba(124,92,255,.35);

  /* من dash.css */
  --ds-bg:#000000; --ds-side:#070709; --ds-surface:#0c0c0f; --ds-surface-2:#0a0a0d;
  --ds-border:rgba(255,255,255,.07); --ds-border-gold:rgba(124,92,255,.4);
  --ds-text:#f5f5f7; --ds-muted:#a1a1a6; --ds-muted-2:#6e6e73;
  --ds-gold:#7c5cff; --ds-gold-l:#9d86ff; --ds-gold-soft:rgba(124,92,255,.12);
  --ds-green:#30d158; --ds-red:#ff5f57; --ds-r:16px; --danger:#ff5f57;

  /* من dash-glass.css */
  --gl-brd:rgba(255,255,255,.10); --gl-brd-soft:rgba(255,255,255,.06); --gl-brd-glow:rgba(124,92,255,.45);
  --gl-iris:#7c5cff; --gl-iris-2:#6f4fff; --gl-pink:#9d86ff;
}

/* ---------- الخطوط ---------- */
body,button,input,select,textarea{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Readex Pro","Segoe UI",system-ui,sans-serif !important;
  letter-spacing:-.01em;
}
body{background:#000 !important;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4,.panel-title,.side-brand{font-family:"Alexandria",-apple-system,system-ui,sans-serif !important;letter-spacing:-.02em}

/* ---------- شريط علوي ---------- */
nav{
  background:rgba(6,6,8,.72) !important;backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);
  border-bottom:1px solid rgba(255,255,255,.06) !important;
}
nav .logo,nav .gold-text{letter-spacing:-.02em}

/* ---------- السايدبار ---------- */
.sidebar{background:var(--ds-side) !important;border-inline-start:1px solid rgba(255,255,255,.05) !important}
.side-item{border-radius:12px !important;font-weight:600;transition:.18s !important}
.side-item:hover{background:rgba(255,255,255,.05) !important;color:var(--ds-text) !important}
.side-item.active{
  background:linear-gradient(135deg,rgba(124,92,255,.22),rgba(124,92,255,.08)) !important;
  color:#fff !important;box-shadow:inset 0 0 0 1px rgba(124,92,255,.3);
}
.side-search input{border-radius:12px !important}
.sidebar::-webkit-scrollbar-thumb{background:#2a2a30 !important;border-radius:20px}

/* ---------- البطاقات واللوحات ---------- */
.panel,.card{
  background:var(--ds-surface) !important;border:1px solid rgba(255,255,255,.06) !important;
  border-radius:20px !important;box-shadow:0 1px 0 rgba(255,255,255,.02) inset;
  transition:border-color .3s,transform .3s !important;
}
.panel:hover{border-color:rgba(255,255,255,.10) !important}
.panel h2,.panel h3,.panel-title{letter-spacing:-.02em}

/* ---------- الأزرار (كبسولة Apple) ---------- */
.btn{border-radius:999px !important;font-weight:600 !important;letter-spacing:0;transition:transform .25s cubic-bezier(.22,1,.36,1),background .2s,box-shadow .3s !important}
.btn:active{transform:scale(.97)}
.btn-primary{background:var(--gold) !important;color:#fff !important;border:0 !important;box-shadow:0 6px 22px rgba(124,92,255,.35) !important}
.btn-primary:hover{background:var(--gold-light) !important;transform:translateY(-1px);box-shadow:0 10px 30px rgba(124,92,255,.45) !important}
.btn-outline,.btn-ghost{border:1px solid rgba(255,255,255,.12) !important;background:rgba(255,255,255,.04) !important;color:var(--ds-text) !important}
.btn-outline:hover,.btn-ghost:hover{background:rgba(255,255,255,.1) !important;transform:translateY(-1px)}
.btn-danger{background:#ff5f57 !important;color:#fff !important;border:0 !important}

/* ---------- الحقول ---------- */
input,select,textarea{
  background:var(--ds-surface-2) !important;border:1px solid rgba(255,255,255,.09) !important;
  border-radius:12px !important;color:var(--ds-text) !important;transition:.2s !important;
}
input:focus,select:focus,textarea:focus{
  outline:none !important;border-color:rgba(124,92,255,.55) !important;box-shadow:0 0 0 4px rgba(124,92,255,.14) !important;
}
.field label{color:var(--ds-muted) !important;font-weight:600;letter-spacing:-.01em}

/* ---------- سويتش ---------- */
.switch-row{border-radius:14px !important;transition:.2s}
.switch-row:hover{background:rgba(255,255,255,.03) !important}
.slider{border-radius:999px !important}
input:checked + .slider,.switch input:checked + .slider{background:var(--gold) !important;box-shadow:0 0 14px rgba(124,92,255,.5)}

/* ---------- التوست ---------- */
.toast{
  background:rgba(14,14,18,.92) !important;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
  border:1px solid rgba(255,255,255,.1) !important;border-radius:14px !important;color:#f5f5f7 !important;
  box-shadow:0 18px 50px rgba(0,0,0,.5) !important;
}

/* ---------- شريط تمرير عام ---------- */
::-webkit-scrollbar{width:10px}
::-webkit-scrollbar-thumb{background:#2a2a30;border-radius:20px;border:2px solid #000}
::-webkit-scrollbar-thumb:hover{background:#3a3a42}

/* ---------- الشارات/الحبوب ---------- */
.badge,.pill,.chip{border-radius:999px !important}
::selection{background:#7c5cff;color:#fff}

/* ============ حارس الرومات — رسالة التحذير ============ */
.cg-notice{
  border-top:1px solid rgba(255,255,255,.07);
  margin-top:18px;padding-top:16px;
}
.cg-notice-head{
  display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:14px;
}
.cg-notice-head b{font-size:.95rem}
.cg-presets{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:14px}

.cg-row2{display:grid;grid-template-columns:210px 1fr;gap:13px}
@media(max-width:720px){.cg-row2{grid-template-columns:1fr}}
.cg-color-wrap{display:flex;gap:8px;align-items:center}
.cg-color-wrap input[type=color]{
  width:52px !important;height:38px !important;padding:3px !important;
  border-radius:10px !important;cursor:pointer;flex-shrink:0;
}

/* معاينة الإمبد (شكل ديسكورد) */
.cg-preview{margin-top:4px}
.cg-embed{
  background:#2b2d31;border-radius:6px;
  border-inline-start:4px solid #ed4245;
  padding:13px 16px;max-width:520px;
  font-family:-apple-system,"Readex Pro",system-ui,sans-serif;
}
.cg-embed-title{color:#fff;font-weight:700;font-size:1rem;margin-bottom:7px;line-height:1.35}
.cg-embed-body{color:#dbdee1;font-size:.88rem;line-height:1.6;white-space:pre-wrap}
.cg-embed-field{margin-top:11px}
.cg-embed-field span{display:block;color:#fff;font-weight:700;font-size:.79rem;margin-bottom:2px}
.cg-embed-field b{color:#dbdee1;font-weight:400;font-size:.85rem}
.cg-embed-img{max-width:100%;border-radius:5px;margin-top:11px;display:block}
.cg-embed-foot{color:#949ba4;font-size:.72rem;margin-top:11px}

/* ============================================================
   تنظيم المسافات — إيقاع موحّد لكل الكروت والبانلات (8px rhythm)
   ============================================================ */

/* --- البانل الرئيسي: تنفّس أوسع وثابت --- */
.panel{
  padding:26px 28px !important;
  margin-bottom:20px !important;
}
.panel:last-child{margin-bottom:0 !important}
.panel h3{
  margin:0 0 20px !important;
  padding-bottom:14px !important;
  border-bottom:1px solid rgba(255,255,255,.06);
}
/* بانل جوّا بانل (كروت فرعية) — ما ياخد نفس الحواف الكبيرة */
.panel .panel,.sub-card{
  padding:18px 20px !important;
  margin-bottom:14px !important;
  border-radius:16px !important;
}

/* --- رأس الصفحة --- */
.page-head{margin-bottom:28px !important;padding-bottom:20px !important}
.page-head p{margin-top:8px !important}

/* --- الحقول: إيقاع ثابت --- */
.field{margin-bottom:18px !important}
.field:last-child{margin-bottom:0 !important}
.field label{margin-bottom:8px !important;display:block}
.field .hint,.hint{margin-top:8px !important;line-height:1.8 !important}

/* --- الشبكات: فجوات موحّدة --- */
.ov-grid,.wl-grid2,.cg-row2{gap:16px !important;margin-bottom:18px !important}
.ov-grid:last-child,.wl-grid2:last-child{margin-bottom:0 !important}
.ov-grid .field,.wl-grid2 .field,.cg-row2 .field{margin-bottom:0 !important}

/* --- صفوف السويتش: تباعد مريح ومتساوٍ --- */
.switch-row{
  padding:14px 12px !important;
  margin:0 -12px !important;          /* يوسّع منطقة الهوفر بدون كسر المحاذاة */
  border-bottom:1px solid rgba(255,255,255,.05) !important;
  gap:16px;
}
.switch-row:last-child,.switch-row:last-of-type{border-bottom:none !important}
.sw-label{line-height:1.5}
.sw-desc{margin-top:3px;line-height:1.7}

/* --- أزرار متجاورة: فجوة تلقائية --- */
.panel .btn + .btn{margin-inline-start:8px}

/* --- قسم رسالة التحذير (حارس الرومات) --- */
.cg-notice{margin-top:22px !important;padding-top:20px !important}
.cg-notice-head{margin-bottom:16px !important}
.cg-presets{margin-bottom:16px !important}
.cg-preview{margin-top:8px !important}

/* --- كروت الإحصائيات (ov-card) --- */
.ov-card{padding:18px 20px !important;border-radius:16px !important}

/* --- صفوف القوائم (srv/switch) داخل البانلات --- */
.panel > .srv:first-of-type{padding-top:0}
.panel > .srv:last-of-type{border-bottom:none;padding-bottom:0}

/* --- شريط الحفظ السفلي: مسافة عن آخر بانل --- */
.save-bar,.savebar{margin-top:24px !important}

/* --- الموبايل: حواف أنعم --- */
@media(max-width:720px){
  .panel{padding:20px 18px !important;border-radius:16px !important}
  .page-head{margin-bottom:22px !important}
  .switch-row{margin:0 -6px !important;padding:13px 6px !important}
}
