/* ==========================================================
   الصفحة الرئيسية (.hm-)
   الهوية فوق خلفية بيضاء نظيفة، ثم الترحيب، لوحة الأرقام، دليل المقيّم،
   لمحة المؤشرات، والوصول السريع.
   ========================================================== */

.hm { overflow-wrap: anywhere; }
.hm-block { padding-block: 44px; }
.hm-block-last { padding-bottom: 56px; }
@media (min-width: 768px) { .hm-block { padding-block: 64px; } .hm-block-last { padding-bottom: 72px; } }
.hm-band { padding-block: 44px; }
@media (min-width: 768px) { .hm-band { padding-block: 64px; } }

/* ---------- الواجهة ---------- */
.hm-hero { position: relative; overflow: hidden; background: #fff; padding-block: 32px 40px; border-bottom: 1px solid var(--line); }
/* توهج تركوازي خفيف أسفل الواجهة — بعيد عن الشعار */
.hm-hero::after {
  content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 58%; pointer-events: none;
  background: radial-gradient(70% 100% at 50% 100%, var(--brand-50) 0%, rgba(242, 249, 248, .6) 45%, rgba(255, 255, 255, 0) 75%);
}
@media (min-width: 768px) { .hm-hero { padding-block: 44px 56px; } }
.hm-hero-in { position: relative; z-index: 1; display: grid; justify-items: center; gap: 30px; }
@media (min-width: 768px) { .hm-hero-in { gap: 40px; } }

.hm-id { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 780px; min-width: 0; }
/* الشعار كما هو: بلا قص ولا تغيير للنسبة، ومساحة بيضاء حوله */
.hm-logo { background: #fff; padding: 10px 18px; margin-bottom: 14px; border-radius: var(--radius); }
.hm-logo img { display: block; width: clamp(168px, 44vw, 244px); height: auto; aspect-ratio: 536 / 294; object-fit: contain; }
.hm-name { font-size: clamp(2.05rem, 1.55rem + 2.3vw, 3.1rem); line-height: 1.25; color: var(--brand-800); font-weight: 700; }
.hm-sub { margin-top: 6px; font-size: clamp(1.05rem, .98rem + .45vw, 1.35rem); font-weight: 500; color: var(--ink-2); line-height: 1.6; }
.hm-rule { display: block; width: 56px; height: 3px; border-radius: 3px; margin-block: 18px 16px; background: linear-gradient(90deg, var(--brand-300), var(--brand-600)); }
.hm-school { display: inline-flex; align-items: center; gap: 8px; font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem); font-weight: 700; color: var(--ink); line-height: 1.5; }
.hm-school .i { color: var(--brand-600); }
.hm-plan {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 7px; padding: 4px 14px; border-radius: 999px;
  background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-800); font-weight: 600; font-size: .95rem; line-height: 1.6;
}
.hm-people { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0; font-size: .95rem; color: var(--ink); }
.hm-people p { padding-inline: 14px; }
.hm-people p + p { border-inline-start: 1px solid var(--line-2); }
.hm-people-lbl { color: var(--ink-3); }
.hm-people strong { font-weight: 600; }
@media (max-width: 560px) {
  .hm-people { flex-direction: column; gap: 2px; }
  .hm-people p + p { border-inline-start: 0; }
}
.hm-tagline {
  margin-top: 18px; padding: 9px 20px; border-radius: 14px; background: #fff; border: 1px solid var(--brand-200);
  color: var(--brand-700); font-weight: 600; font-size: clamp(1rem, .95rem + .35vw, 1.18rem); line-height: 1.7; box-shadow: var(--shadow-sm);
  text-wrap: balance; max-width: 100%;
}

/* بطاقة الترحيب */
.hm-welcome {
  width: 100%; max-width: 980px; text-align: center; padding: 26px 18px; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff 0%, var(--brand-50) 100%); border: 1px solid var(--brand-100); box-shadow: var(--shadow);
}
@media (min-width: 768px) { .hm-welcome { padding: 36px 44px; } }
.hm-welcome-title { font-size: clamp(1.22rem, 1.05rem + .9vw, 1.75rem); color: var(--ink); line-height: 1.5; }
.hm-welcome-text { margin: 12px auto 0; max-width: 70ch; color: var(--ink-2); font-size: clamp(1rem, .96rem + .22vw, 1.1rem); line-height: 1.95; }
.hm-cta { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@media (max-width: 520px) { .hm-cta .btn { width: 100%; } }

/* ---------- لوحة الأرقام ---------- */
.hm-stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .hm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.hm-stat { display: flex; flex-direction: column; gap: 12px; padding: 16px; height: 100%; }
@media (min-width: 900px) { .hm-stat { flex-direction: row; align-items: flex-start; gap: 16px; padding: 22px; } }
.hm-stat-icon {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100);
}
.hm-stat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.hm-stat-label { font-size: .92rem; font-weight: 600; color: var(--ink-3); line-height: 1.55; }
.hm-stat-value { margin-top: auto; font-size: clamp(1.7rem, 1.35rem + 1.2vw, 2.25rem); font-weight: 700; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.hm-stat .progress { margin-top: 8px; }
.hm-stat.is-empty .hm-stat-icon { background: var(--surface-2); color: var(--ink-4); border-color: var(--line); }
.hm-stat.is-empty .hm-stat-value { font-size: 1rem; line-height: 1.5; }
/* «بانتظار تحديث البيانات» كوسم هادئ يلتف بسلاسة في البطاقات الضيقة */
.hm-stat .awaiting { font-size: .78rem; padding: 3px 9px; border-radius: 9px; border-style: dashed; align-items: flex-start; line-height: 1.55; }
.hm-stat .awaiting .i { margin-top: 2px; }
/* الجوال: عمود واحد وبطاقات أفقية مدمجة — «بانتظار تحديث البيانات» في سطر واحد */
@media (max-width: 479px) {
  .hm-stats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hm-stat { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
  .hm-stat-body { gap: 4px; }
  .hm-stat-value { margin-top: 0; font-size: 1.6rem; }
  .hm-stat.is-empty .hm-stat-value { font-size: 1rem; }
}

/* ---------- دليل المقيّم ---------- */
.hm-guide { list-style: none; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .hm-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .hm-guide { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
.hm-q-item { display: flex; min-width: 0; }
.hm-q { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hm-q-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hm-q-num {
  display: inline-grid; place-items: center; min-width: 38px; height: 28px; padding-inline: 8px; border-radius: 999px;
  background: var(--brand-600); color: #fff; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums;
}
.hm-q-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-50); color: var(--brand-700); }
.hm-q-title { font-size: 1.06rem; line-height: 1.6; color: var(--ink); }
.hm-q-facts { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .84rem; color: var(--ink-3); }
.hm-fact { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.hm-fact-val { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.hm-q-facts .awaiting { font-size: .76rem; padding: 1px 8px; }
.hm-q-go {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: .86rem; font-weight: 600; color: var(--brand-700); line-height: 1.5;
}
.hm-q-go .i { flex: none; transition: transform .25s var(--ease); }
.hm-q:hover .hm-q-go .i { transform: translateX(-4px); }

/* ---------- لمحة المؤشرات ---------- */
.hm-board { padding: 0; overflow: hidden; }
.hm-board-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px;
  padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
@media (min-width: 768px) { .hm-board-top { padding: 16px 22px; } }
.hm-board-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding-inline: 6px; border-radius: 999px; background: rgba(255, 255, 255, .75); font-variant-numeric: tabular-nums; }
.hm-board-legend { margin: 0; }
.hm-board-head { display: none; }
.hm-rows { list-style: none; }
.hm-row { padding: 16px; border-bottom: 1px solid var(--line); transition: background .2s; }
@media (min-width: 768px) { .hm-row { padding: 18px 22px; } }
.hm-row:last-child { border-bottom: 0; }
.hm-row-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.hm-row-name { display: flex; align-items: flex-start; gap: 10px; min-width: 0; flex: 1 1 200px; }
.hm-row-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.hm-row-text { display: grid; min-width: 0; line-height: 1.45; }
.hm-row-link { font-weight: 700; color: var(--ink); font-size: 1rem; }
.hm-row-link:hover { color: var(--brand-700); }
.hm-row-dom { font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.hm-row-status { flex: none; max-width: 100%; }
.hm-row-status .badge { white-space: normal; }
.hm-row-vals { margin-top: 12px; display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .hm-row-vals { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hm-row .rv { padding: 8px 10px; gap: 2px; }
.hm-row .rv-label { font-size: .74rem; }
.hm-row .rv-value { font-size: 1.08rem; }
.hm-row .rv-empty .rv-value { font-size: .8rem; }
.hm-row .rv-note { font-size: .74rem; line-height: 1.5; }
.hm-row .rv-empty { background: #fff; }
.hm-row .rv-target.rv-empty { border-color: #f3e2bb; }
.hm-row .rv .awaiting { background: transparent; border: 0; padding: 0; font-size: .76rem; line-height: 1.5; gap: 4px; color: var(--ink-3); }
.hm-row .rv .awaiting .i { width: 13px; height: 13px; }
.hm-row .delta { font-size: .9rem; gap: 4px; }
.hm-row .delta .i { width: 15px; height: 15px; }
/* مؤشر بلا قيم مدخلة: سطر واحد هادئ */
.hm-row-none {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: #fff;
}
.hm-none-roles { font-size: .8rem; color: var(--ink-3); font-weight: 600; min-width: 0; }
.hm-row-none .awaiting { font-size: .78rem; }
@media (max-width: 639px) {
  .hm-row-head { flex-direction: column; align-items: stretch; }
  .hm-row-name { flex: none; }
  .hm-row-status { padding-inline-start: 48px; }
}
.hm-board-note {
  display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px; font-size: .82rem; color: var(--ink-3);
  background: var(--surface-2); border-top: 1px solid var(--line); line-height: 1.7;
}
.hm-board-note .i { margin-top: 3px; color: var(--brand-500); }
@media (min-width: 768px) { .hm-board-note { padding: 12px 22px; } }

/* جدول أفقي على الشاشات الواسعة: رأس ملوّن بأدوار القيم */
@media (min-width: 1024px) {
  .hm-board-legend { display: none; }
  .hm-board-head, .hm-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 4.2fr) 172px; column-gap: 16px; align-items: center; }
  .hm-board-head { padding: 10px 22px; border-bottom: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--ink-3); }
  .hm-head-vals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .hm-head-role { display: inline-flex; align-items: center; gap: 6px; }
  .hm-role-baseline { color: var(--role-baseline); }
  .hm-role-target { color: var(--role-target); }
  .hm-role-actual { color: var(--role-actual); }
  .hm-role-delta { color: var(--role-delta); }
  .hm-sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; }
  .hm-sw-baseline { background: var(--role-baseline-line); }
  .hm-sw-target { background: var(--role-target-bg); border: 2px dashed var(--role-target-line); }
  .hm-sw-actual { background: var(--role-actual-line); }
  .hm-sw-delta { background: var(--role-delta-line); }
  .hm-row-head { display: contents; }
  .hm-row-name { grid-column: 1; grid-row: 1; }
  .hm-row-vals { grid-column: 2; grid-row: 1; margin-top: 0; }
  .hm-row-status { grid-column: 3; grid-row: 1; }
  /* الرأس يحمل التسميات؛ تبقى متاحة لقارئ الشاشة داخل كل خلية */
  .hm-row .rv-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hm-row .rv { min-height: 52px; justify-content: center; }
  .hm-row-none { min-height: 52px; }
  .hm-row.is-none .hm-row-vals { grid-column: 2 / 4; }
  .hm-row:hover { background: var(--surface-2); }
}

/* ---------- وصول سريع ---------- */
.hm-quick { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .hm-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.hm-qa { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
@media (min-width: 768px) { .hm-qa { padding: 26px; } }
.hm-qa-head { display: flex; align-items: flex-start; gap: 14px; }
.hm-qa-text { min-width: 0; flex: 1; }
.hm-qa-icon { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.hm-qa-title { font-size: clamp(1.1rem, 1.02rem + .35vw, 1.28rem); }
.hm-qa-lead { margin-top: 4px; color: var(--ink-2); font-size: .95rem; }
.hm-qa-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* بطاقة التقويم الخارجي (خلفية الهوية) */
.hm-qa-eval .hm-qa-icon { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .22); }
.hm-qa-eval .hm-qa-lead { color: rgba(255, 255, 255, .84); }
.hm-eval-links { list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.hm-eval-links li { min-width: 0; }
.hm-eval-links a {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border-radius: 12px; color: #fff;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); font-weight: 600; font-size: .95rem; line-height: 1.45;
  transition: background .2s, border-color .2s;
}
.hm-eval-links a:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .34); color: #fff; }
.hm-eval-links .i { flex: none; }
.hm-eval-name { flex: 1; min-width: 0; }
.hm-eval-count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding-inline: 6px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: .75rem; font-variant-numeric: tabular-nums; }
.hm-eval-go { opacity: .7; }

/* بطاقة الشواهد */
.hm-qa-ev { border-top: 4px solid var(--brand-500); }
.hm-search { display: flex; gap: 8px; }
.hm-search-field { flex: 1; min-width: 0; }
.hm-search .btn { flex: none; }
.hm-ev-types .chip { font-size: .82rem; }
.hm-ev-types .count-pill { min-width: 20px; height: 20px; }
.hm-qa-state .awaiting { font-size: .8rem; }
@media (max-width: 400px) { .hm-qa-foot .btn { width: 100%; } }
