/* ==========================================================
   app.css — لوحة القائد: الشريط الجانبي · البانر · الصفحة الرئيسية
   ========================================================== */
#app { background: var(--page); color: var(--ink); min-height: 100vh; }
.shell { display: flex; direction: ltr; min-height: 100vh; }
.shell > * { direction: rtl; }
.main { flex: 1; min-width: 0; }

/* ---------- الشريط الجانبي ---------- */
.side {
  width: 264px; color: var(--cream); padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; overflow: auto;
  background: linear-gradient(180deg, #2a160c 50%, rgba(42,22,12,.55)), url('side-bg.jpg') bottom / cover #2a160c;
}
#sidelogo { width: 84px; margin: 12px auto 4px; display: block; }
.side .cn { text-align: center; color: #e3d0b2; font-size: 22px; margin: 6px 0 22px; }
.side a {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 12px;
  cursor: pointer; color: #e3d0b2; margin-bottom: 8px; font-size: 17px; border: 1px solid transparent;
}
.side a span { color: var(--gold); width: 22px; }
.side a:hover { background: rgba(227,181,116,.1); }
.side a.on { background: rgba(227,181,116,.16); border-color: rgba(227,181,116,.4); box-shadow: inset 3px 0 var(--gold); }
.side .out { margin-top: auto; background: rgba(0,0,0,.35); color: #d6bf9f; padding: 12px; border-radius: 10px; }
.sel { width: 100%; margin: 0 0 14px; padding: 9px; border-radius: 8px; background: #2a170c; color: #f1dfc3; border: 1px solid rgba(227,181,116,.4); font: 14px 'Almarai', sans-serif; }

/* ---------- البانر (صورة التصميم كاملة بدون قص) ---------- */
.banner {
  position: relative; overflow: hidden; aspect-ratio: 1600 / 533;
  background: #1b0f08 url('banner.jpg') center / 100% 100% no-repeat;
}
.banner .t { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: center; padding: 0 3.5%; }
.banner h1 { font-size: clamp(24px, 3.5vw, 54px); line-height: 1.5; color: #f3e3c8; margin-bottom: 22px; }
.banner h1 b { color: var(--gold); font-weight: 700; }
.banner h1 small { display: block; margin-top: 16px; font-size: .58em; line-height: 1.5; }
.banner p { color: #e6d3b6; font-size: clamp(14px, 1.6vw, 21px); line-height: 1.8; }

.pg { padding: 22px 2% 40px; }

/* ---------- بطاقات الإحصائيات ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.sc {
  background: url('stat-bg.png') left bottom / auto 55% no-repeat, var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.sc h4 { font-weight: 500; font-size: 16px; }
.sc .n { font-size: 42px; font-weight: 700; line-height: 1.1; }
.sc small { color: var(--mut); }
.sc .ic { color: var(--mut); }
.sc .ic svg.i { width: 34px; height: 34px; }

/* ---------- صفوف الصفحة الرئيسية ---------- */
.row { display: grid; gap: 16px; margin-bottom: 16px; }
.row .card { margin: 0; }
.r2 { grid-template-columns: 1fr 2.5fr; }
.r3 { grid-template-columns: 1fr 1.5fr 1.25fr; }
.pj { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14.5px; }
.pj img { width: 42px; height: 36px; border-radius: 5px; object-fit: cover; }

/* أجندة الأسبوع والتنبيهات والملفات */
.wk { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--mut); gap: 4px; margin: 8px 0 12px; }
.wk b { display: grid; place-items: center; width: 30px; height: 30px; margin: 4px auto 0; border-radius: 50%; font-size: 14px; color: var(--ink); cursor: pointer; font-weight: 500; }
.wk b:hover { background: #eadcc6; }
.wk b.s { background: #4a2a17; color: #fff; }
.wk b.td { box-shadow: 0 0 0 1.5px var(--gold2); }
.ev, .al { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.ev { padding: 9px 0; }
.al { padding: 10px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.ev:before, .al:before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #a8743b); margin-top: 7px; flex-shrink: 0; }
.ev small, .al small { color: var(--mut); display: block; font-size: 12px; }
.fi { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; gap: 8px; }
.fi i { font-style: normal; font-size: 11px; color: #fff; padding: 2px 5px; border-radius: 4px; background: var(--c, #a8743b); }

/* الإجراءات السريعة */
.qa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa button { background: #f0e3cd; border: 1px solid var(--line); border-radius: 10px; padding: 16px 4px; font-size: 13px; color: var(--ink); }
.qa button:hover { background: #ead9bd; }
.qa b { display: block; color: #7a5231; font-weight: 400; }
.qa b svg.i { width: 26px; height: 26px; }

/* بطاقات الأدوات / الأقسام */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; cursor: pointer; color: var(--ink); }
.tool:hover { border-color: var(--gold2); }
.tool b { display: block; font-size: 17px; margin-bottom: 6px; }
.tool .ic { color: var(--gold2); margin-bottom: 10px; }
.tool .ic svg.i { width: 28px; height: 28px; }
.tool small { color: var(--mut); }

/* التقويم الشهري */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal .h { color: var(--mut); font-size: 13px; padding: 6px; }
.cal .d { min-height: 76px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; font-size: 13px; background: #fffdf8; text-align: right; }
.cal .d.t { background: var(--ink); color: var(--cream); }
.cal .d span { display: block; background: var(--gold); color: #2a160a; border-radius: 6px; font-size: 11px; padding: 2px 4px; margin-top: 3px; }

/* ==========================================================
   الجوال والتابلت (أقل من 980px)
   - الشريط الجانبي يتحول إلى شريط علوي ثابت: شعار + اسم اللجنة + خروج، تحته أزرار التنقل تُسحب جانبياً
   - البانر: الصورة في الأعلى والترحيب تحتها بدل ما يتداخلان
   - الأقسام: بطاقتان في الصف بدل بطاقة كبيرة لكل قسم
   ========================================================== */
@media (max-width: 980px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .r2, .r3 { grid-template-columns: 1fr; }
  .shell { flex-direction: column; }

  .side {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 30; overflow: visible;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px;
    background: #2a160c; box-shadow: 0 2px 14px rgba(0,0,0,.35);
  }
  #sidelogo { width: 34px; margin: 0; order: 1; }
  .side .cn { order: 2; flex: 1; margin: 0; font-size: 16px; text-align: right; }
  .side .out { order: 3; margin: 0; padding: 6px 12px; font-size: 13px; background: rgba(255,255,255,.08); }
  .side #sw { order: 4; flex-basis: 100%; }
  .side .sel { margin: 0; }
  .side #menu { order: 5; flex-basis: 100%; display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
  .side #menu::-webkit-scrollbar { display: none; }
  .side a { flex: 0 0 auto; margin: 0; padding: 8px 14px; font-size: 14px; gap: 8px; white-space: nowrap; border-radius: 999px; background: rgba(255,255,255,.06); }
  .side a span svg.i { width: 17px; height: 17px; }
  .side a.on { box-shadow: none; background: rgba(227,181,116,.25); border-color: rgba(227,181,116,.5); }

  .pg { padding: 16px 12px 30px; }
}

@media (max-width: 700px) {
  /* البانر: صورة أعلاه، والنص تحتها على خلفية بنية متصلة بالصورة */
  .banner { aspect-ratio: auto; background: linear-gradient(180deg, rgba(58,26,14,0) calc(33.3vw - 36px), #3a1a0e 33.3vw), url('banner.jpg') top / 100% auto no-repeat, #3a1a0e; }
  .banner .t { position: relative; inset: auto; padding: calc(33.3vw - 6px) 18px 20px; }
  .banner h1 { font-size: 24px; margin-bottom: 10px; }
  .banner h1 small { margin-top: 6px; font-size: .8em; }
  .banner p { font-size: 14px; }

  .sc { padding: 14px; }
  .sc .n { font-size: 32px; }
  .sc h4 { font-size: 14px; }
  .sc .ic svg.i { width: 26px; height: 26px; }
  .card { padding: 14px; }
  .ch h3 { font-size: 18px; }
  .tb h2 { font-size: 24px; }
  .tb > div { width: 100%; }
  .tb > div .sm { flex: 1 1 auto; text-align: center; }
  .tabs button { padding: 8px 14px; font-size: 13px; }
  .qa { grid-template-columns: repeat(2, 1fr); }
  .tools { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool { padding: 14px; }
  .tool b { font-size: 14.5px; line-height: 1.5; }
  .tool .ic svg.i { width: 22px; height: 22px; }
  .tool small { font-size: 12px; }
  .cal .d { min-height: 54px; padding: 3px; font-size: 11px; }
  .cal .d span { font-size: 9px; padding: 1px 2px; }
  .cal .h { font-size: 10px; padding: 3px 0; }
  .grp { font-size: 17px; }
  table { font-size: 12.5px; }
  td, th { padding: 8px 6px; }
}

