/* ===== WASLA — الألوان الرسمية ===== */
:root {
  --navy: #0B2545;
  --sky: #00A8E8;
  --orange: #FF7A00;
  --bg: #F5F9FC;
  --surface: #FFFFFF;
  --surface-2: #EAF3FA;
  --text: #0B2545;
  --muted: #5A6E84;
  --border: #D6E4F0;
  --shadow: 0 10px 30px -12px rgba(11, 37, 69, .25);
  --radius: 16px;
  --danger: #C0392B;
  --ok: #1E8E5A;
  --wave-opacity: .16;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #07172D;
  --surface: #0E2340;
  --surface-2: #13305A;
  --text: #EAF4FF;
  --muted: #9FB6CE;
  --border: #1F3F66;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --wave-opacity: .10;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07172D; --surface: #0E2340; --surface-2: #13305A;
    --text: #EAF4FF; --muted: #9FB6CE; --border: #1F3F66;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    --wave-opacity: .10; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}
/* خلفية مائية خفيفة مستوحاة من الشعار */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--wave-opacity);
  background:
    url("assets/background.png") center 38%/min(900px, 90vw) auto no-repeat,
    radial-gradient(circle at 15% 20%, var(--sky) 0 2px, transparent 3px) 0 0/60px 60px,
    radial-gradient(ellipse 320px 140px at 80% 10%, var(--sky), transparent 70%),
    radial-gradient(ellipse 420px 180px at 10% 90%, var(--navy), transparent 70%),
    radial-gradient(ellipse 200px 90px at 90% 80%, var(--orange), transparent 70%);
}
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

h1, h2, h3 { color: var(--text); line-height: 1.3; margin: .4em 0; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: 1.35rem; }
p { margin: .4em 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

/* ===== شاشة التحميل ===== */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: linear-gradient(160deg, var(--navy), #113a6b 60%, #0c3a63);
  transition: opacity .5s ease, visibility .5s;
}
.splash.done { opacity: 0; visibility: hidden; }
.splash-logo { width: min(280px, 64vw); background: #fff; border-radius: 28px; padding: 14px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.5); animation: pulse 1.6s ease-in-out infinite; }
.splash-dots { display: flex; gap: 8px; }
.splash-dots span {
  width: 10px; height: 10px; border-radius: 50%; background: var(--sky);
  animation: bounce 1s infinite ease-in-out;
}
.splash-dots span:nth-child(2) { animation-delay: .15s; background: var(--orange); }
.splash-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* ===== الشريط العلوي ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 52px; width: auto; background: #fff; border-radius: 12px; padding: 4px 6px; }
.brand-text { font-weight: 800; font-size: 1.4rem; color: var(--navy); }
:root[data-theme="dark"] .brand-text { color: var(--text); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--text); padding: 8px 12px; border-radius: 10px; font-weight: 600;
}
.nav a:hover, .nav a.active { background: var(--surface-2); text-decoration: none; color: var(--sky); }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search input {
  width: min(240px, 40vw); padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 7px 12px; cursor: pointer; font: inherit; font-weight: 700;
}
.icon-btn:hover { border-color: var(--sky); }
.nav-toggle { display: none; }

.auth-area { display: flex; gap: 8px; align-items: center; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 600;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--sky), var(--navy));
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800;
}
.avatar.lg { width: 96px; height: 96px; font-size: 2rem; }

/* ===== المحتوى ===== */
.container { width: min(1180px, 100% - 32px); margin-inline: auto; padding: 28px 0 40px; flex: 1; outline: none; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.hero {
  position: relative; overflow: hidden;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--navy) 0%, #12407a 55%, var(--sky) 130%);
  color: #fff; box-shadow: var(--shadow);
}
.hero h1, .hero p { color: #fff; }
.hero .muted { color: #cfe6f5; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero::after {
  content: ""; position: absolute; inset-inline-end: -80px; top: -80px; width: 320px; height: 320px;
  border-radius: 50%; border: 40px solid rgba(255,255,255,.08);
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 22px 0; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.stat strong { display: block; font-size: 1.8rem; color: var(--sky); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
  color: var(--text);
}
.card:hover { transform: translateY(-2px); transition: transform .2s; text-decoration: none; }
.card-thumb { aspect-ratio: 4/3; border-radius: 12px; background: var(--surface-2); object-fit: cover; width: 100%; }
.card h3 { font-size: 1.05rem; margin: 0; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--surface-2); color: var(--navy);
}
:root[data-theme="dark"] .badge { color: var(--text); }
.badge.pending { background: #FFF1E0; color: #8A4300; }
.badge.approved, .badge.active, .badge.open { background: #E0F5EC; color: var(--ok); }
.badge.rejected, .badge.closed, .badge.banned, .badge.suspended { background: #FBE3E0; color: var(--danger); }
.price { font-weight: 800; color: var(--orange); }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow);
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600;
}
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
:root[data-theme="dark"] .tabs button.on { background: var(--sky); border-color: var(--sky); }

/* ===== النماذج والأزرار ===== */
form.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .95rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px rgba(0,168,232,.2); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--sky); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none !important; transition: transform .1s, opacity .2s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.navy { background: var(--navy); }
.btn.orange { background: var(--orange); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: .88rem; border-radius: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.error { color: var(--danger); font-weight: 600; }
.success { color: var(--ok); font-weight: 600; }

.contact-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.contact-bar .btn.wa { background: #25D366; }
.contact-bar .btn.tg { background: #229ED9; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.table th { color: var(--muted); font-size: .9rem; }

.chat { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 6px; }
.bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2);
  align-self: flex-start; word-wrap: break-word; white-space: pre-wrap;
}
.bubble.me { background: var(--sky); color: #fff; align-self: flex-end; }
.bubble .time { display: block; font-size: .72rem; opacity: .7; }

.detail { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery img { border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }

.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 20px 0; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-links, .footer-ah13 { display: flex; gap: 12px; flex-wrap: wrap; }

.toast {
  position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(50%) translateY(120px);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  transition: transform .3s; z-index: 200; max-width: min(90vw, 420px); text-align: center;
}
:root[dir="ltr"] .toast, html[dir="ltr"] .toast { transform: translateX(-50%) translateY(120px); }
.toast.show { transform: translateX(50%) translateY(0); }
html[dir="ltr"] .toast.show { transform: translateX(-50%) translateY(0); }

.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

/* ===== الهاتف ===== */
@media (max-width: 900px) {
  .nav { display: none; width: 100%; flex-direction: column; }
  .nav.open { display: flex; }
  .nav-toggle { display: inline-block; }
  .search input { width: 100%; }
  .topbar-actions { width: 100%; margin-inline-start: 0; }
  .search { flex: 1; min-width: 160px; }
}

/* ===== الوضع المختصر للحركة ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== الاتجاه LTR ===== */
/* الاتجاهات تعتمد على خصائص منطقية (inline-start/end) لذا لا حاجة لقواعد LTR منفصلة */
