/* ==========================================================================
   واحة الستريم — نظام التصميم
   لوحة ألوان صحراوية: رمال، كثبان ليلية، وهج ذهبي، واحة خضراء
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@200;300;400;500;600;700&family=Rakkas&display=swap');

:root {
  /* ── الأساس: طبقات الليل الصحراوي ── */
  --void:        #08060A;
  --night:       #0C0A0E;
  --dune-deep:   #12100F;
  --dune:        #17141A;
  --dune-soft:   #1E1A20;
  --dune-lift:   #262029;

  /* ── الرمال والذهب ── */
  --gold:        #E3B04B;
  --gold-bright: #F5C96B;
  --gold-deep:   #B8862F;
  --amber-glow:  #FF9D3C;
  --sand:        #D9C3A0;
  --sand-dim:    #A08D74;
  --clay:        #9A5B3B;

  /* ── الواحة ── */
  --oasis:       #2E9E7E;
  --oasis-dim:   #1F6B56;
  --palm:        #3D7A5A;
  --water:       #3AA6C4;

  /* ── نصوص ── */
  --ink:         #F4EDE2;
  --ink-soft:    #C9BCA8;
  --ink-dim:     #8A7E6E;
  --ink-faint:   #5C5449;

  /* ── حالات ── */
  --ok:          #46A96B;
  --warn:        #D9922E;
  --danger:      #C4523E;
  --info:        #3E86B8;

  /* ── خطوط رفيعة ── */
  --line:        rgba(227, 176, 75, 0.13);
  --line-soft:   rgba(227, 176, 75, 0.07);
  --line-strong: rgba(227, 176, 75, 0.26);
  --line-cool:   rgba(244, 237, 226, 0.06);

  /* ── ظلال ── */
  --sh-sm:  0 1px 2px rgba(0,0,0,.4);
  --sh-md:  0 4px 20px -6px rgba(0,0,0,.55);
  --sh-lg:  0 18px 50px -18px rgba(0,0,0,.75);
  --sh-glow: 0 0 34px -8px rgba(227,176,75,.32);

  /* ── تنسيق ── */
  --r-xs: 3px;
  --r-sm: 5px;
  --r:    8px;
  --r-lg: 13px;
  --r-xl: 20px;

  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Rakkas', 'IBM Plex Sans Arabic', serif;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  --nav-h: 68px;
  --wrap: 1280px;
}

/* ── إعادة ضبط ── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
  background: var(--night);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* نسيج رملي دقيق فوق الخلفية */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .28;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(227,176,75,.055) 0%, transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(154,91,59,.05) 0%, transparent 46%),
    radial-gradient(circle at 50% 100%, rgba(46,158,126,.03) 0%, transparent 55%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── طباعة ── */
h1, h2, h3, h4, h5 {
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 4vw, 3.1rem); font-weight: 400; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2.1rem); font-weight: 400; }
h3 { font-size: 1.18rem; }
h4 { font-size: 1rem; font-weight: 500; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25;
}

a { color: inherit; text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--gold); }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }

::selection { background: rgba(227,176,75,.26); color: var(--ink); }

/* شريط التمرير */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--gold-deep), var(--clay));
  border-radius: 20px;
  border: 2px solid var(--void);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ==========================================================================
   تخطيط
   ========================================================================== */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 22px;
  position: relative;
  z-index: 3;
}
.wrap-narrow { max-width: 880px; }
.wrap-wide   { max-width: 1560px; }

main { flex: 1; position: relative; z-index: 3; }

.section { padding-block: clamp(56px, 8vw, 104px); position: relative; }
.section-sm { padding-block: clamp(38px, 5vw, 62px); }

/* عنوان القسم */
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 42px;
  flex-wrap: wrap;
}
.sec-head__text { max-width: 620px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 13px;
}
.eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.sec-head h2 { margin-bottom: 9px; }
.sec-head p { color: var(--ink-dim); font-size: .93rem; max-width: 60ch; }

/* شبكات */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr)); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.items-center { align-items: center; }
.gap-1 { gap: 6px; } .gap-2 { gap: 11px; } .gap-3 { gap: 17px; } .gap-4 { gap: 24px; }
.wrap-flex { flex-wrap: wrap; }
.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:20px}.mt-4{margin-top:32px}.mt-5{margin-top:48px}
.mb-1{margin-bottom:6px}.mb-2{margin-bottom:12px}.mb-3{margin-bottom:20px}.mb-4{margin-bottom:32px}
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-dim { color: var(--ink-dim); }
.text-soft { color: var(--ink-soft); }
.text-sm { font-size: .84rem; }
.text-xs { font-size: .74rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ==========================================================================
   أزرار — رفيعة وأنيقة، لا شيء سميك
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  height: 42px;
  font-size: .87rem;
  font-weight: 500;
  letter-spacing: .01em;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .3s var(--ease);
  white-space: nowrap;
  background: none;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.btn i, .btn svg { font-size: .92em; opacity: .85; }
.btn:disabled { opacity: .42; cursor: not-allowed; pointer-events: none; }

/* الأساسي — ذهبي متدرج بخط رفيع */
.btn-primary {
  background: linear-gradient(160deg, var(--gold-bright) 0%, var(--gold) 45%, var(--gold-deep) 100%);
  color: #1A1206;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 4px 18px -8px rgba(227,176,75,.6);
}
.btn-primary:hover {
  color: #1A1206;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 8px 26px -8px rgba(227,176,75,.75);
  filter: brightness(1.06);
}
.btn-primary:active { transform: translateY(0); }

/* الثانوي — حدود رفيعة */
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(227,176,75,.03);
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(227,176,75,.07);
}

.btn-line {
  border-color: var(--line-cool);
  color: var(--ink-soft);
}
.btn-line:hover { border-color: var(--line-strong); color: var(--ink); background: rgba(255,255,255,.02); }

.btn-oasis {
  background: linear-gradient(160deg, var(--oasis), var(--oasis-dim));
  color: #EAFBF5;
  box-shadow: 0 4px 18px -8px rgba(46,158,126,.6);
}
.btn-oasis:hover { filter: brightness(1.1); transform: translateY(-1px); color: #fff; }

.btn-danger { border: 1px solid rgba(196,82,62,.4); color: #E08272; background: rgba(196,82,62,.07); }
.btn-danger:hover { background: rgba(196,82,62,.15); border-color: var(--danger); color: #F09A8A; }

.btn-plain { color: var(--ink-dim); padding-inline: 12px; }
.btn-plain:hover { color: var(--gold); background: rgba(227,176,75,.05); }

.btn-sm { height: 33px; padding-inline: 15px; font-size: .78rem; border-radius: var(--r-xs); }
.btn-lg { height: 50px; padding-inline: 32px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; height: 38px; }
.btn-icon.btn-sm { width: 31px; height: 31px; }

/* ==========================================================================
   بطاقات
   ========================================================================== */
.card {
  background: linear-gradient(168deg, rgba(30,26,32,.72), rgba(18,16,15,.82));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  position: relative;
  transition: border-color .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
  backdrop-filter: blur(10px);
}
.card:hover { border-color: var(--line); }
.card-pad { padding: 24px; }
.card-pad-sm { padding: 16px; }

.panel {
  background: rgba(18,16,15,.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 26px;
  backdrop-filter: blur(8px);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.panel-head h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 10px; }
.panel-head h3 i { color: var(--gold); font-size: .9em; }

/* ==========================================================================
   شارات
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .02em;
  border-radius: 20px;
  border: 1px solid;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-gold   { color: var(--gold);       border-color: rgba(227,176,75,.32);  background: rgba(227,176,75,.08); }
.badge-green  { color: #5FC58A;           border-color: rgba(70,169,107,.32);  background: rgba(70,169,107,.09); }
.badge-blue   { color: #6BAEDB;           border-color: rgba(62,134,184,.32);  background: rgba(62,134,184,.09); }
.badge-amber  { color: #E5AB55;           border-color: rgba(217,146,46,.32);  background: rgba(217,146,46,.09); }
.badge-red    { color: #E08272;           border-color: rgba(196,82,62,.32);   background: rgba(196,82,62,.09); }
.badge-gray   { color: var(--ink-dim);    border-color: var(--line-cool);      background: rgba(255,255,255,.03); }
.badge-oasis  { color: #4FCCA6;           border-color: rgba(46,158,126,.34);  background: rgba(46,158,126,.1); }

.badge-dot::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 6px currentColor;
}

/* ==========================================================================
   نماذج
   ========================================================================== */
.field { margin-bottom: 18px; }
.label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 7px;
  letter-spacing: .01em;
}
.label .req { color: var(--clay); margin-inline-start: 3px; }
.hint { font-size: .74rem; color: var(--ink-faint); margin-top: 6px; line-height: 1.6; }

.input, .select, .textarea {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: rgba(8,6,10,.55);
  border: 1px solid var(--line-cool);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 300;
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
  outline: none;
}
.textarea { height: auto; min-height: 112px; padding: 12px 14px; resize: vertical; line-height: 1.75; }
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); font-weight: 300; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(244,237,226,.12); }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(227,176,75,.5);
  background: rgba(8,6,10,.75);
  box-shadow: 0 0 0 3px rgba(227,176,75,.08);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='%238A7E6E' d='M5.5 7L0 0h11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
  cursor: pointer;
}
.select option { background: var(--dune); color: var(--ink); }

.input-group { position: relative; }
.input-group .input { padding-inline-start: 40px; }
.input-group__icon {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: .85rem;
  pointer-events: none;
}

.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--ink-soft);
  user-select: none;
  line-height: 1.6;
}
.check input { display: none; }
.check__box {
  flex-shrink: 0;
  width: 17px; height: 17px;
  margin-top: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  transition: all .22s var(--ease);
}
.check__box::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: .55rem;
  color: #1A1206;
  opacity: 0;
  transform: scale(.5);
  transition: all .22s var(--ease);
}
.check input:checked + .check__box { background: var(--gold); border-color: var(--gold); }
.check input:checked + .check__box::after { opacity: 1; transform: scale(1); }

/* مفتاح تبديل */
.switch { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; font-size: .85rem; }
.switch input { display: none; }
.switch__track {
  width: 38px; height: 21px;
  border-radius: 20px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line-cool);
  position: relative;
  transition: all .3s var(--ease);
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 2px; inset-inline-end: 2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--ink-dim);
  transition: all .3s var(--ease);
}
.switch input:checked + .switch__track { background: rgba(227,176,75,.22); border-color: rgba(227,176,75,.45); }
.switch input:checked + .switch__track::after { inset-inline-end: 19px; background: var(--gold); box-shadow: 0 0 8px rgba(227,176,75,.6); }

/* ==========================================================================
   تنبيهات
   ========================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r);
  border: 1px solid;
  font-size: .86rem;
  line-height: 1.65;
  margin-bottom: 20px;
}
.alert i { margin-top: 3px; font-size: .95em; flex-shrink: 0; }
.alert-success { background: rgba(70,169,107,.07);  border-color: rgba(70,169,107,.28);  color: #7FCF9E; }
.alert-error   { background: rgba(196,82,62,.07);   border-color: rgba(196,82,62,.28);   color: #E5988A; }
.alert-warn    { background: rgba(217,146,46,.07);  border-color: rgba(217,146,46,.28);  color: #E8B76D; }
.alert-info    { background: rgba(62,134,184,.07);  border-color: rgba(62,134,184,.28);  color: #8CC0E4; }

/* ==========================================================================
   جداول
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: rgba(18,16,15,.5);
}
.table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 640px; }
.table thead th {
  padding: 13px 16px;
  text-align: right;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: rgba(8,6,10,.5);
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(244,237,226,.035);
  color: var(--ink-soft);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .22s var(--ease); }
.table tbody tr:hover { background: rgba(227,176,75,.028); }
.table .num { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   حالة فارغة
   ========================================================================== */
.empty {
  text-align: center;
  padding: 62px 24px;
  color: var(--ink-dim);
}
.empty__icon {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: var(--gold-deep);
  background: radial-gradient(circle, rgba(227,176,75,.09), transparent 70%);
  border: 1px solid var(--line-soft);
}
.empty h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--ink-soft); }
.empty p { font-size: .87rem; max-width: 42ch; margin: 0 auto 20px; }

/* ==========================================================================
   ترقيم الصفحات
   ========================================================================== */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 44px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 36px; height: 36px;
  display: grid; place-items: center;
  padding-inline: 11px;
  font-size: .83rem;
  border: 1px solid var(--line-cool);
  border-radius: var(--r-xs);
  color: var(--ink-dim);
  transition: all .25s var(--ease);
}
.pager a:hover { border-color: var(--line-strong); color: var(--gold); }
.pager .active { background: rgba(227,176,75,.11); border-color: rgba(227,176,75,.4); color: var(--gold); font-weight: 500; }
.pager .disabled { opacity: .3; pointer-events: none; }

/* ==========================================================================
   فواصل زخرفية
   ========================================================================== */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin-block: 34px;
  border: none;
}
.divider-ornate {
  display: flex; align-items: center; gap: 16px;
  margin-block: 40px;
  color: var(--gold-deep);
}
.divider-ornate::before, .divider-ornate::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.divider-ornate i { font-size: .7rem; opacity: .65; }

/* ==========================================================================
   حركات
   ========================================================================== */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer  { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes floaty   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes pulseGlow{ 0%,100% { opacity: .45; } 50% { opacity: .95; } }
@keyframes spin     { to { transform: rotate(360deg); } }

.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1 !important; transform: none !important; } }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(227,176,75,.22);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

/* ==========================================================================
   أدوات
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.07) 50%, rgba(255,255,255,.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.num { font-variant-numeric: tabular-nums; }

/* شريط تمرير مخفي */
.scroll-x {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { scroll-snap-align: start; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
