/* ==========================================================================
   مجتمع أمومة — الهوية البصرية الرسمية لتطبيق أمومة
   (بنفسجي #815B99، وردي #C783AA، كريمي #FDFAF6، خط Cairo)
   ========================================================================== */

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/cairo-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/cairo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --purple: #815B99;
  --purple-dark: #54336C;
  --purple-deep: #54336C;
  --lilac: #9B78B0;
  --rose: #C783AA;
  --blush: #EEC6E8;
  --cream: #FDFAF6;
  --soft: #F7F1F4;
  --surface: #FFFFFF;
  --ink: #54336C;
  --text: #546270;
  --muted: #7C8794;
  --line: #E5D5EF;
  --line-strong: #D9C2E6;
  --success: #8FB996;
  --success-bg: #EDF6F0;
  --danger: #D94545;
  --danger-bg: #FDECEC;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(94, 63, 114, 0.08);
  --shadow-lg: 0 24px 60px rgba(62, 42, 77, 0.18);
  --font: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.8;
  background: var(--cream);
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--rose); text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(155, 120, 176, 0.55); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--blush); color: var(--purple-deep); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; top: -60px; inset-inline-start: 16px; z-index: 100;
  background: var(--purple); color: #fff; padding: 10px 18px; border-radius: 10px;
}
.skip:focus { top: 12px; }

/* --------------------------------- التخطيط -------------------------------- */
.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 20px; }
main.wrap { padding-block: 28px 64px; min-height: 60vh; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 26px; align-items: start; }
.stack { display: grid; gap: 18px; }
.stack-sm { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); border: 0; margin-block: 4px; }

/* --------------------------------- الهيدر --------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: #815B99;
  border-bottom: 1px solid #6A4A7E;
  box-shadow: 0 2px 12px rgba(62, 42, 77, 0.12);
}
.header-inner { min-height: var(--header-h); display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { width: auto; height: 46px; border-radius: 0; box-shadow: none; object-fit: contain; }
.brand-text { display: grid; line-height: 1.25; }
.brand-name { font-weight: 800; font-size: 1.18rem; color: #FFFFFF; }
.brand-tag { font-size: 0.72rem; color: #EEC6E8; font-weight: 600; letter-spacing: 0.2px; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 8px; }
.main-nav a {
  color: #FFFFFF; font-weight: 600; font-size: 0.94rem;
  padding: 8px 12px; border-radius: 10px; white-space: nowrap;
}
.main-nav a:hover { background: rgba(255, 255, 255, 0.14); color: #E5D5EF; text-decoration: none; }
.main-nav a.active { color: #E5D5EF; background: rgba(255, 255, 255, 0.18); }
.header-search { position: relative; flex: 1; max-width: 280px; margin-inline-start: auto; }
.header-search input { width: 100%; height: 42px; padding: 0 40px 0 14px; }
.header-search .search-icon {
  position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; display: inline-flex;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.avatar-link { display: inline-flex; align-items: center; gap: 8px; color: #FFFFFF; font-weight: 700; }
.avatar-link:hover { text-decoration: none; }
.site-header .btn-ghost { color: #FFFFFF; }
.site-header .btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }
.site-header .btn-outline {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.42);
  color: #FFFFFF;
}
.site-header .btn-outline:hover { background: rgba(255, 255, 255, 0.2); }
.site-header .icon-btn { color: #FFFFFF; }
.site-header .icon-btn:hover { background: rgba(255, 255, 255, 0.14); color: #FFFFFF; }

.mobile-nav { display: none; border-top: 1px solid rgba(255, 255, 255, 0.2); overflow-x: auto; gap: 14px; padding-block: 8px; }
.mobile-nav a { color: rgba(255, 255, 255, 0.85); font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.mobile-nav a.active { color: #E5D5EF; }

/* --------------------------------- الأزرار -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 18px; border-radius: 12px;
  border: 1px solid transparent; background: var(--soft); color: var(--ink);
  font-weight: 700; font-size: 0.94rem; line-height: 1.4;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--rose) 100%);
  color: #fff; box-shadow: 0 10px 22px rgba(129, 91, 153, 0.28);
}
.btn-primary:hover { box-shadow: 0 14px 28px rgba(129, 91, 153, 0.36); }
.btn-rose { background: var(--blush); color: var(--purple-deep); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--purple); }
.btn-outline:hover { background: #F7EFFA; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--soft); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #F2CECE; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: 0.85rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--soft); color: var(--purple); }
.link-btn { background: none; border: 0; padding: 0; color: var(--purple); font-weight: 700; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }

/* --------------------------------- البطاقات ------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2, .panel h3 { font-size: 1rem; color: var(--ink); font-weight: 800; }
.sidebar { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 18px; }
.side-list { display: grid; gap: 2px; }
.side-list a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  color: var(--ink); font-weight: 600; font-size: 0.9rem;
}
.side-list a:hover { background: var(--soft); text-decoration: none; color: var(--purple); }
.side-list .count { margin-inline-start: auto; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.emoji-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; font-size: 1.15rem;
  background: var(--soft); flex: none;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  background: var(--soft); color: var(--purple); border: 1px solid var(--line);
}
.pill-rose { background: #FBEFF7; color: #A4567E; border-color: #F3D8E9; }
.pill-green { background: var(--success-bg); color: var(--success); border-color: #CFE7D8; }
.pill-warn { background: var(--warning-bg); color: var(--warning); border-color: #F2E0BC; }
.pill-danger { background: var(--danger-bg); color: var(--danger); border-color: #F2CECE; }

/* ---------------------------------- الهيرو -------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #815B99 0%, #B87AA6 100%);
  color: #fff; border-radius: 26px; padding: 38px 40px;
  box-shadow: 0 24px 50px rgba(94, 63, 114, 0.24);
  margin-bottom: 26px;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.hero::before { width: 340px; height: 340px; background: rgba(255,255,255,.09); inset-inline-start: -90px; top: -140px; }
.hero::after { width: 220px; height: 220px; background: rgba(238,198,232,.18); inset-inline-end: -40px; bottom: -100px; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0,1.35fr) minmax(240px,.65fr); gap: 30px; align-items: center; }
.hero h1 { font-size: clamp(1.6rem, 3vw, 2.35rem); font-weight: 900; line-height: 1.45; margin-bottom: 10px; }
.hero p { color: #F3E4F4; font-size: 1rem; max-width: 58ch; }
.hero .hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero .btn-outline { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.2); }
.hero .btn-rose { box-shadow: 0 10px 24px rgba(62,42,77,.25); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-stat {
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 14px 10px; text-align: center; backdrop-filter: blur(4px);
}
.hero-stat strong { display: block; font-size: 1.45rem; font-weight: 900; line-height: 1.2; }
.hero-stat span { font-size: 0.76rem; color: #EDD9EF; }
.hero-note {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 0.8rem; color: #F0DDF2; background: rgba(0,0,0,.14);
  padding: 5px 12px; border-radius: 999px;
}

/* -------------------------------- شريط المجموعات --------------------------- */
.strip-wrap { margin-bottom: 24px; }
.strip-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.strip-title h2 { font-size: 1.05rem; color: var(--ink); font-weight: 800; }
.strip {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.strip a {
  flex: 0 0 148px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 12px; color: var(--ink);
  display: flex; flex-direction: column; gap: 8px; transition: transform .15s, box-shadow .2s;
}
.strip a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.strip .strip-name { font-weight: 800; font-size: 0.9rem; }
.strip .strip-count { font-size: 0.74rem; color: var(--muted); }

/* --------------------------------- التبويبات ------------------------------ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs {
  display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px;
}
.tabs a { color: var(--muted); padding: 6px 14px; border-radius: 9px; font-size: 0.88rem; font-weight: 700; }
.tabs a:hover { text-decoration: none; color: var(--purple); }
.tabs a[aria-current="page"] { background: #F1E7F6; color: var(--purple); }
.toolbar .spacer { flex: 1; }

/* --------------------------------- المنشورات ------------------------------ */
.posts { display: grid; gap: 14px; }
.post-card {
  display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 14px;
  box-shadow: 0 4px 14px rgba(94,63,114,.04);
  transition: box-shadow .2s, border-color .2s;
}
.post-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.votes { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vote {
  width: 38px; height: 34px; border-radius: 10px; border: 0; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
}
.vote:hover { background: var(--soft); color: var(--purple); }
.vote[aria-pressed="true"] { background: #F1E7F6; color: var(--purple); }
.vote-score { font-weight: 800; font-size: 0.95rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.post-head .who { display: grid; line-height: 1.4; }
.post-head .who a { color: var(--ink); font-weight: 700; font-size: 0.92rem; }
.post-meta { display: flex; gap: 4px 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.78rem; align-items: center; }
.post-meta .community { color: var(--purple); font-weight: 700; }
.post-title { font-size: 1.12rem; font-weight: 800; color: var(--ink); line-height: 1.55; margin-block: 2px 4px; }
.post-title a { color: inherit; }
.post-title a:hover { color: var(--purple); text-decoration: none; }
.post-excerpt { color: var(--text); font-size: 0.93rem; }
.post-image { display: block; margin-top: 12px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.post-image img { width: 100%; max-height: 360px; object-fit: cover; }
.post-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.post-action {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 6px 10px; font-size: 0.82rem; font-weight: 700;
}
.post-action:hover { background: var(--soft); color: var(--purple); text-decoration: none; }
.post-action[aria-pressed="true"] { color: var(--purple); background: #F1E7F6; }
.post-action-danger:hover { color: var(--danger); background: var(--danger-bg); }
.post-action .count { font-variant-numeric: tabular-nums; }

/* --------------------------------- التفاصيل ------------------------------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 0.88rem; margin-bottom: 12px; }
.back-link:hover { color: var(--purple); text-decoration: none; }
.post-full { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 16px; }
.post-full h1 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.55; color: var(--ink); font-weight: 900; margin-block: 4px 10px; }
.post-body { font-size: 1rem; line-height: 2; color: var(--text); overflow-wrap: anywhere; }
.post-body br { line-height: 2; }
.post-image-full img { max-height: none; object-fit: contain; }
.owner-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

.comments { margin-top: 22px; display: grid; gap: 16px; }
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comments-head h2 { font-size: 1.05rem; color: var(--ink); font-weight: 800; }
.comment { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 10px; }
.comment-body { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.comment-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); margin-bottom: 2px; }
.comment-meta a { color: var(--ink); font-weight: 700; }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.93rem; }

/* --------------------------------- النماذج -------------------------------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 700; color: var(--ink); font-size: 0.9rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 10px 14px; min-height: 46px;
  color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
input::placeholder, textarea::placeholder { color: #A9A2B3; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--lilac); box-shadow: 0 0 0 4px rgba(155,120,176,.14); }
.hint { color: var(--muted); font-size: 0.78rem; }
.form-error {
  display: none; background: var(--danger-bg); color: var(--danger);
  border: 1px solid #F2CECE; border-radius: 10px; padding: 8px 12px; font-size: 0.85rem; font-weight: 600;
}
.form-error.show { display: block; }
.form-ok {
  display: none; background: var(--success-bg); color: var(--success);
  border: 1px solid #CFE7D8; border-radius: 10px; padding: 8px 12px; font-size: 0.85rem; font-weight: 600;
}
.form-ok.show { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.86rem; color: var(--text); }
.checkbox-row input[type="checkbox"] { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--purple); flex: none; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-chip { position: relative; }
.radio-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-chip span {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 16px;
  font-size: 0.88rem; font-weight: 700;
}
.radio-chip input:checked + span { background: #F1E7F6; border-color: var(--lilac); color: var(--purple); }
.radio-chip input:focus-visible + span { outline: 3px solid rgba(155,120,176,.4); }

.upload-box {
  border: 2px dashed var(--line-strong); border-radius: 16px; background: #FCF8FD;
  padding: 18px; text-align: center; transition: border-color .2s, background .2s;
}
.upload-box:hover, .upload-box.dragover { border-color: var(--lilac); background: #F7EFFA; }
.upload-box input[type="file"] { display: block; width: 100%; margin-top: 8px; font-size: 0.85rem; }
.upload-preview {
  display: none; margin-top: 12px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); max-width: 100%;
}
.upload-preview.show { display: block; }
.upload-preview img { max-height: 220px; width: 100%; object-fit: contain; }
.upload-name { font-size: 0.8rem; color: var(--muted); margin-top: 6px; word-break: break-all; }

/* --------------------------------- المصادقة ------------------------------- */
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 26px; align-items: start; max-width: 1040px; margin-inline: auto; }
.auth-card { padding: 28px; }
.auth-card h1 { font-size: 1.5rem; font-weight: 900; color: var(--ink); margin-bottom: 4px; }
.auth-side {
  background: linear-gradient(135deg, #815B99 0%, #B87AA6 100%);
  color: #fff; border-radius: 24px; padding: 30px; box-shadow: var(--shadow-lg);
}
.auth-side h2 { font-size: 1.2rem; font-weight: 900; margin-bottom: 8px; }
.auth-side p { color: #F0DFF1; font-size: 0.9rem; }
.auth-side ul { display: grid; gap: 10px; margin-top: 18px; }
.auth-side li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: #F8ECF8; }
.auth-side li svg { flex: none; margin-top: 3px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 0.88rem; margin-top: 14px; }

/* --------------------------------- التنبيهات ------------------------------ */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-radius: 14px; padding: 12px 16px; margin-bottom: 18px;
  border: 1px solid var(--line); background: var(--surface); font-size: 0.88rem;
}
.banner-warn { background: var(--warning-bg); border-color: #F0DFB8; }
.banner-danger { background: var(--danger-bg); border-color: #F2CECE; }
.banner-ok { background: var(--success-bg); border-color: #CFE7D8; }
.banner .banner-text { flex: 1; min-width: 220px; }
.banner strong { color: var(--ink); }

/* -------------------------------- الحالة الفارغة --------------------------- */
.empty { text-align: center; padding: 46px 24px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty .empty-icon { font-size: 2rem; margin-bottom: 8px; }
.empty h2 { color: var(--ink); font-size: 1.05rem; font-weight: 800; margin-bottom: 4px; }
.empty p { color: var(--muted); font-size: 0.9rem; max-width: 46ch; margin-inline: auto; }

/* --------------------------------- المجموعات ------------------------------ */
.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.community-card {
  display: flex; flex-direction: column; gap: 10px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.community-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); text-decoration: none; }
.community-card .community-top { display: flex; align-items: center; gap: 10px; }
.community-card h2 { font-size: 1rem; font-weight: 800; color: var(--ink); }
.community-card p { font-size: 0.85rem; color: var(--muted); flex: 1; }
.community-card .community-foot { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }

/* ------------------------------- الملف الشخصي ------------------------- */
.profile-head {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  padding: 26px; background: linear-gradient(135deg, #F7EFFA, #FDF7F3);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.profile-head .avatar { --size: 76px; font-size: 1.7rem; }
.profile-head h1 { font-size: 1.4rem; color: var(--ink); font-weight: 900; }
.profile-bio { max-width: 62ch; margin-block: 12px; }
.profile-facts { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 0.82rem; }

/* --------------------------------- الحالة -------------------------------- */
.status-hero { text-align: center; padding: 34px 24px; }
.status-icon {
  width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  background: #F1E7F6;
}
.status-hero h1 { font-size: 1.45rem; color: var(--ink); font-weight: 900; margin-bottom: 6px; }
.status-hero p { max-width: 56ch; margin-inline: auto; color: var(--muted); }
.steps { display: grid; gap: 0; margin-top: 24px; text-align: start; max-width: 560px; margin-inline: auto; }
.step { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 12px; padding-bottom: 18px; position: relative; }
.step:not(:last-child)::before {
  content: ''; position: absolute; inset-inline-start: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line);
}
.step-dot {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--muted); font-weight: 800; font-size: 0.85rem; z-index: 1;
}
.step.done .step-dot { background: var(--success-bg); color: var(--success); }
.step.current .step-dot { background: var(--purple); color: #fff; }
.step h2 { font-size: 0.92rem; color: var(--ink); font-weight: 800; }
.step p { font-size: 0.82rem; color: var(--muted); }
.reject-box { background: var(--danger-bg); border: 1px solid #F2CECE; border-radius: 14px; padding: 14px 18px; margin-block: 16px; text-align: start; }
.reject-box strong { color: var(--danger); }

/* --------------------------------- المودال -------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(42, 28, 52, 0.55);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  padding: 18px; animation: fadeIn .15s ease;
}
.modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 24px; animation: popIn .18s ease;
}
.modal.modal-wide { max-width: 780px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-size: 1.1rem; color: var(--ink); font-weight: 900; }
.modal-close { border: 0; background: var(--soft); border-radius: 50%; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.modal-close:hover { background: var(--blush); color: var(--purple-deep); }
.modal-body { display: grid; gap: 14px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; margin-top: 6px; }
.modal .doc-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------- التوست -------------------------------- */
.toast {
  position: fixed; inset-block-end: 22px; inset-inline-start: 22px; z-index: 120;
  max-width: min(420px, calc(100vw - 44px)); padding: 12px 18px; border-radius: 14px;
  background: var(--purple-deep); color: #fff; font-weight: 700; font-size: 0.9rem;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px);
  pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: #8F2F3F; }

/* --------------------------------- التذييل -------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.55); padding-block: 28px; margin-top: 20px; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 10px; align-items: center; max-width: 380px; }
.footer-brand img { width: auto; height: 38px; border-radius: 0; object-fit: contain; }
.footer-brand strong { color: var(--ink); display: block; }
.footer-brand p { font-size: 0.8rem; color: var(--muted); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.84rem; }
.footer-links a { color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--purple); }
.footer-note { width: 100%; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; font-size: 0.76rem; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* --------------------------------- المحتوى -------------------------------- */
.prose { max-width: 72ch; }
.prose h1 { font-size: 1.6rem; color: var(--ink); font-weight: 900; margin-bottom: 10px; }
.prose h2 { font-size: 1.1rem; color: var(--ink); font-weight: 800; margin-block: 22px 6px; }
.prose p, .prose li { font-size: 0.94rem; line-height: 1.95; }
.prose ul, .prose ol { padding-inline-start: 22px; list-style: disc; display: grid; gap: 4px; }
.prose .note { background: var(--warning-bg); border: 1px solid #F0DFB8; border-radius: 12px; padding: 12px 16px; font-size: 0.86rem; margin-top: 16px; }

/* =============================== لوحة الإدارة ============================= */
.admin-body { background: #FDFAF6; }
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-header {
  background: #815B99;
  color: #fff; padding-block: 14px; box-shadow: 0 8px 24px rgba(62,42,77,.25);
}
.admin-header .header-inner { min-height: 56px; }
.admin-header .brand-name { color: #fff; }
.admin-header .brand-tag { color: #E7D4EA; }
.admin-header .main-nav a { color: #EFE2F1; }
.admin-header .main-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.admin-header .main-nav a.active { background: rgba(255,255,255,.18); color: #fff; }
.admin-header .btn-ghost { color: #fff; }
.admin-header .btn-ghost:hover { background: rgba(255,255,255,.14); }
.admin-header .row { margin-inline-start: auto; }
.admin-main { flex: 1; padding-block: 26px 60px; }
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 22px; }
.admin-tabs a {
  white-space: nowrap; padding: 8px 16px; border-radius: 11px; background: var(--surface);
  border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 0.88rem;
}
.admin-tabs a:hover { text-decoration: none; color: var(--purple); border-color: var(--line-strong); }
.admin-tabs a[aria-current="page"] { background: var(--purple); border-color: var(--purple); color: #fff; }
.admin-tabs .bubble { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 0.72rem; margin-inline-start: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 16px 18px; }
.stat span { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.stat strong { display: block; color: var(--ink); font-size: 1.65rem; font-weight: 900; line-height: 1.3; }
.stat.alert { border-color: #F0C9C9; background: linear-gradient(150deg, #FFF7F7, #FBECEC); }
.stat.alert strong { color: var(--danger); }

.queue { display: grid; gap: 14px; }
.queue-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.queue-head { display: flex; align-items: flex-start; gap: 12px; }
.queue-head .queue-id { flex: 1; min-width: 0; }
.queue-head h2 { font-size: 1rem; color: var(--ink); font-weight: 800; }
.queue-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 18px; margin-block: 12px; font-size: 0.84rem; }
.queue-info dt { color: var(--muted); font-size: 0.75rem; }
.queue-info dd { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.id-thumb {
  width: 100%; max-width: 320px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--soft); cursor: zoom-in; max-height: 200px; object-fit: cover;
}
.id-preview { display: grid; gap: 10px; align-content: start; }
.id-placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 120px; border: 1px dashed var(--line-strong); border-radius: 12px;
  color: var(--muted); font-size: 0.82rem; padding: 12px;
}
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.report-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; }
.report-card.open { border-inline-start: 4px solid var(--danger); }
.report-reason { color: var(--danger); font-weight: 800; }
.report-note { background: var(--soft); border-radius: 12px; padding: 10px 14px; font-size: 0.9rem; white-space: pre-wrap; }
.report-post { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 0.86rem; background: #FCFAFC; }
.report-post a { font-weight: 700; }
.report-meta { color: var(--muted); font-size: 0.78rem; display: flex; gap: 12px; flex-wrap: wrap; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.report-actions .resolution-input { max-width: 260px; min-height: 36px; padding: 6px 10px; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 620px; }
.admin-table th, .admin-table td { text-align: start; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { background: #FAF6FB; color: var(--muted); font-size: 0.76rem; font-weight: 800; position: sticky; top: 0; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td.actions { white-space: nowrap; }
.admin-table .small-btn { min-height: 30px; padding: 2px 10px; font-size: 0.78rem; }
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.admin-toolbar input { max-width: 340px; }
.audit-list { display: grid; gap: 0; }
.audit-item { display: flex; gap: 12px; align-items: flex-start; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.audit-item:last-child { border-bottom: 0; }
.audit-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lilac); margin-top: 9px; flex: none; }
.audit-item strong { color: var(--ink); }
.audit-item time { color: var(--muted); font-size: 0.75rem; }
.admin-login { max-width: 420px; margin: 40px auto; }
.admin-login .auth-card { box-shadow: var(--shadow-lg); }
.doc-modal-img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: #1b1420; }

/* --------------------------------- استجابة -------------------------------- */
@media (max-width: 1020px) {
  .header-search { max-width: 200px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
  .auth-layout { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 900px) {
  .header-search { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 22px; }
  .hero { padding: 30px 26px; }
  .hero-stats { max-width: 420px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-side { order: 2; }
}
@media (max-width: 720px) {
  .wrap { padding-inline: 14px; }
  main.wrap { padding-block: 18px 48px; }
  .main-nav { display: none; }
  .mobile-nav { display: flex; }
  .header-actions .hide-mobile { display: none; }
  .brand-tag { display: none; }
  .brand img { width: auto; height: 38px; }
  .hero { border-radius: 20px; padding: 24px 20px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero-stat strong { font-size: 1.15rem; }
  .hero-stat span { font-size: 0.68rem; }
  .post-card { grid-template-columns: 38px minmax(0,1fr); padding: 14px 12px; gap: 10px; }
  .post-full { grid-template-columns: 38px minmax(0,1fr); }
  .vote { width: 34px; }
  .post-card .avatar { --size: 34px; }
  .post-actions { gap: 2px; }
  .post-action { padding: 6px 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 20px; }
  .profile-head { padding: 18px; }
  .profile-head .avatar { --size: 60px; }
  .admin-header .brand-tag { display: none; }
  .footer-inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
