/* الصفحة الرئيسية — «هل شركتي بخير اليوم؟ وما الذي ينتظرني؟»
   ثلاثة أسئلة بالترتيب: أين أموالي · هل نكسب · ما ينتظر قراري. والحركة دائمة لكل مستخدم بقرار المالك. */

.hm-shell {
  --hm-navy: #0b3d91;
  --hm-navy-d: #071b44;
  --hm-ink: #0f1b33;
  --hm-muted: #5b677a;
  --hm-line: #e3e9f3;
  --hm-card: #ffffff;
  --hm-bg: #f4f7fb;
  --hm-copper: #b78642;
  --hm-cyan: #0891b2;
  --hm-green: #0f9d63;
  --hm-red: #d93636;
  --hm-amber: #d97706;
  --hm-violet: #6d4ed8;
  --hm-ease: cubic-bezier(.22, 1, .36, 1);
  display: grid;
  gap: 1.25rem;
  padding: 1rem 1.25rem 2rem;
  color: var(--hm-ink);
}

/* ── الظهور المتتابع ───────────────────────────────────────────── */
.hm-reveal {
  opacity: 0;
  transform: translateY(18px) scale(.985);
  animation: hm-rise .8s var(--hm-ease) forwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}

@keyframes hm-rise {
  to { opacity: 1; transform: none; }
}

/* ── الواجهة العلوية ───────────────────────────────────────────── */
.hm-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  min-height: 236px;
  padding: 1.9rem 2.1rem;
  border-radius: 20px;
  color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #123f9c 0%, #0a2a6b 42%, var(--hm-navy-d) 100%);
  box-shadow: 0 24px 60px -28px rgba(7, 27, 68, .75), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.hm-aurora { position: absolute; inset: 0; z-index: -2; filter: blur(46px) saturate(1.3); }
.hm-aurora i { position: absolute; display: block; border-radius: 50%; opacity: .55; mix-blend-mode: screen; }
.hm-aurora i:nth-child(1) { width: 46%; height: 120%; top: -40%; inset-inline-start: -8%; background: #0891b2; animation: hm-drift-a 14s ease-in-out infinite alternate; }
.hm-aurora i:nth-child(2) { width: 38%; height: 110%; bottom: -55%; inset-inline-start: 30%; background: #6d4ed8; animation: hm-drift-b 17s ease-in-out infinite alternate; }
.hm-aurora i:nth-child(3) { width: 30%; height: 90%; top: -30%; inset-inline-end: 4%; background: #b78642; opacity: .42; animation: hm-drift-c 12s ease-in-out infinite alternate; }

@keyframes hm-drift-a { to { transform: translate(22%, 18%) scale(1.15); } }
@keyframes hm-drift-b { to { transform: translate(-18%, -24%) scale(1.25); } }
@keyframes hm-drift-c { to { transform: translate(-26%, 22%) scale(.9); } }

.hm-hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(70% 90% at 50% 40%, #000 30%, transparent 80%);
  animation: hm-grid-pan 30s linear infinite;
}

@keyframes hm-grid-pan { to { background-position: 34px 34px, 34px 34px; } }

.hm-hero-mark {
  position: absolute;
  inset-inline-end: 14%;
  bottom: -28px;
  width: 210px;
  opacity: .07;
  z-index: -1;
  animation: hm-float 9s ease-in-out infinite alternate;
}

@keyframes hm-float { to { transform: translateY(-14px) rotate(-3deg); } }

.hm-eyebrow { display: inline-flex; align-items: center; gap: .55rem; font-size: .9rem; color: rgba(255, 255, 255, .78); }

.hm-live {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-inline: 4px;
  background: #34d399;
  box-shadow: 0 0 12px #34d399;
}

.hm-live::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid #34d399;
  animation: hm-ping 1.8s var(--hm-ease) infinite;
}

@keyframes hm-ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.hm-hero h1 {
  margin: .45rem 0 .5rem;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.01em;
  background: linear-gradient(90deg, #fff 0%, #cfe8ff 40%, #ffe2b8 60%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hm-shine 6s linear infinite;
}

@keyframes hm-shine { to { background-position: -220% 0; } }

.hm-hero p { margin: 0 0 1rem; max-width: 640px; color: rgba(255, 255, 255, .82); font-size: 1rem; }

.hm-hero-pills { display: flex; flex-wrap: wrap; gap: .5rem; }

.hm-hero-pills span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .8rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(6px);
  font-size: .82rem;
}

/* حلقة الترحيل */
.hm-ring {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .4rem;
  padding: 1rem 1.3rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
  backdrop-filter: blur(10px);
  color: #fff;
  text-decoration: none;
  transition: transform .3s var(--hm-ease), background .3s;
}

.hm-ring:hover { color: #fff; transform: translateY(-3px); background: rgba(255, 255, 255, .12); }
.hm-ring svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.hm-ring circle { fill: none; stroke-width: 11; }
.hm-ring-track { stroke: rgba(255, 255, 255, .12); }

.hm-ring-bar {
  stroke: #34d399;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  filter: drop-shadow(0 0 8px rgba(52, 211, 153, .7));
  transition: stroke-dashoffset 1.8s var(--hm-ease) .35s;
}

.hm-ring.is-risk .hm-ring-bar { stroke: #fbbf24; filter: drop-shadow(0 0 8px rgba(251, 191, 36, .7)); }
.hm-ring-value { direction: ltr; position: absolute; top: calc(1rem + 66px); transform: translateY(-50%); display: flex; align-items: baseline; gap: 2px; }
.hm-ring-value strong { font-size: 2.1rem; font-weight: 800; }
.hm-ring-value small { font-size: 1rem; opacity: .8; }
.hm-ring-caption { display: grid; justify-items: center; font-size: .85rem; opacity: .92; }
.hm-ring-caption em { font-style: normal; font-size: .78rem; opacity: .85; }
/* البند 152: سنة بلا قيد — لا صفر ولا لون مخاطر */
.hm-ring.is-empty .hm-ring-bar { stroke: transparent; filter: none; }
.hm-ring-value.is-empty strong { opacity: .7; }

/* البند 152: حلقة الترحيل وبطاقة غير المرحّل جنباً إلى جنب */
.hm-hero-side { display: flex; align-items: stretch; gap: .75rem; }
.hm-hero-pills span.is-warn { border-color: rgba(251, 191, 36, .65); background: rgba(251, 191, 36, .16); color: #ffe7a8; }

.hm-unposted {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .35rem;
  min-width: 190px;
  max-width: 230px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
  backdrop-filter: blur(10px);
  color: #fff;
  text-align: center;
  text-decoration: none;
  transition: transform .3s var(--hm-ease), background .3s;
}

.hm-unposted:hover { color: #fff; transform: translateY(-3px); background: rgba(255, 255, 255, .12); }
.hm-unposted.is-static { cursor: default; }
.hm-unposted.is-static:hover { transform: none; background: rgba(255, 255, 255, .07); }
.hm-unposted-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; opacity: .92; }
.hm-unposted strong { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.hm-unposted.has-items strong { color: #fde68a; }
.hm-unposted-sub { font-size: .82rem; opacity: .9; }
.hm-unposted-sub small { opacity: .8; }
.hm-unposted-note { font-size: .72rem; opacity: .7; line-height: 1.45; }

/* ── رسالة تعذّر ───────────────────────────────────────────────── */
.hm-alert {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: 1rem 1.2rem;
  border: 1px solid #f3c2c2;
  border-radius: 14px;
  background: #fff5f5;
  color: #8a1c1c;
}

.hm-alert > i { font-size: 1.5rem; }
.hm-alert div { display: grid; gap: .2rem; }

/* ── الأقسام ───────────────────────────────────────────────────── */
.hm-section { display: grid; gap: .8rem; }
.hm-section-head h2, .hm-panel-head h2 { margin: .1rem 0 0; font-size: 1.2rem; font-weight: 800; color: var(--hm-ink); }
/* النحاسي الأغمق: نحاس الهوية #b78642 تباينه 3.2 على الأبيض بهذا المقاس الصغير، وهذا 5.3 (حدّ AA هو 4.5) */
.hm-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .04em; color: #8a5f24; }

.hm-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.hm-kpi {
  --tone: var(--hm-navy);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon label" "value value" "sub sub" "viz viz";
  align-items: center;
  column-gap: .7rem;
  row-gap: .35rem;
  min-height: 178px;
  padding: 1.1rem 1.15rem .9rem;
  border: 1px solid var(--hm-line);
  border-radius: 18px;
  background: var(--hm-card);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 27, 51, .04), 0 10px 26px -18px rgba(15, 27, 51, .35);
  transition: transform .35s var(--hm-ease), box-shadow .35s var(--hm-ease), border-color .35s;
}

.hm-kpi::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tone), transparent);
}

.hm-kpi::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  inset-inline-end: -70px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tone) 18%, transparent), transparent 70%);
  transition: transform .6s var(--hm-ease);
}

.hm-kpi:hover { color: inherit; transform: translateY(-5px); border-color: color-mix(in srgb, var(--tone) 35%, var(--hm-line)); box-shadow: 0 22px 40px -22px color-mix(in srgb, var(--tone) 60%, transparent); }
.hm-kpi:hover::after { transform: scale(1.5); }
/* بطاقة بلا رابط: لا يفتح المستخدم صفحتها */
.hm-kpi.is-static, .hm-ring.is-static { cursor: default; }
.hm-kpi.is-static:hover { transform: none; border-color: var(--hm-line); box-shadow: 0 1px 2px rgba(15, 27, 51, .04), 0 10px 26px -18px rgba(15, 27, 51, .35); }
.hm-kpi.is-static:hover::after { transform: none; }
.hm-ring.is-static:hover { transform: none; background: rgba(255, 255, 255, .07); }

.hm-kpi.is-cash { --tone: var(--hm-navy); }
.hm-kpi.is-revenue { --tone: var(--hm-green); }
.hm-kpi.is-profit { --tone: var(--hm-cyan); }
.hm-kpi.is-loss { --tone: var(--hm-red); }
.hm-kpi.is-ar { --tone: var(--hm-violet); }
.hm-kpi.is-ap { --tone: var(--hm-amber); }
.hm-kpi.is-inv { --tone: var(--hm-copper); }

.hm-kpi-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tone) 12%, #fff);
  color: var(--tone);
  font-size: 1.2rem;
}

.hm-kpi-label { grid-area: label; font-size: .86rem; font-weight: 700; color: var(--hm-muted); }

.hm-kpi-value {
  grid-area: value;
  margin-top: .3rem;
  font-family: 'Inter', 'Tajawal', sans-serif;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--hm-ink);
  direction: ltr;
  text-align: start;
  unicode-bidi: isolate;
}

[dir="rtl"] .hm-kpi-value { text-align: right; }
.hm-kpi-value.is-neg { color: var(--hm-red); }
.hm-kpi-sub { grid-area: sub; font-size: .8rem; color: var(--hm-muted); }
.hm-kpi-sub b { color: var(--hm-ink); font-variant-numeric: tabular-nums; }
.hm-kpi-sub.is-warn b { color: var(--hm-amber); }
/* سطر ثانٍ داخل خانة «sub» نفسها: الدفعات المقدمة تشرح لماذا يزيد المتأخر على الإجمالي */
.hm-kpi-sub-line { display: block; margin-top: .15rem; }
.hm-kpi-sub.is-warn .hm-kpi-sub-line b { color: var(--hm-ink); }

.hm-spark, .hm-minibars, .hm-meter { grid-area: viz; align-self: end; }
.hm-spark { width: 100%; height: 44px; overflow: visible; }
.hm-spark path.line { fill: none; stroke: var(--tone); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hm-spark path.area { fill: color-mix(in srgb, var(--tone) 16%, transparent); opacity: 0; transition: opacity 1s ease .9s; }
.hm-spark.is-drawn path.area { opacity: 1; }
.hm-spark circle { fill: #fff; stroke: var(--tone); stroke-width: 2.4; }

.hm-minibars { display: flex; align-items: flex-end; gap: 5px; height: 40px; }

.hm-minibars i {
  flex: 1;
  height: var(--h, 10%);
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--tone), color-mix(in srgb, var(--tone) 40%, #fff));
  transform-origin: bottom;
  transform: scaleY(0);
  animation: hm-grow-y .9s var(--hm-ease) forwards;
  animation-delay: calc(.4s + var(--j, 0) * 90ms);
}

@keyframes hm-grow-y { to { transform: scaleY(1); } }

.hm-meter { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--tone) 12%, #f1f4f9); overflow: hidden; }
.hm-meter i, .hm-bars-track i, .hm-aging-bar i { display: block; height: 100%; width: var(--w, 0); animation: hm-grow-x 1.4s var(--hm-ease) .5s both; }
.hm-meter i { border-radius: 99px; background: linear-gradient(90deg, var(--tone), var(--hm-amber)); }

@keyframes hm-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

[dir="rtl"] .hm-meter i, [dir="rtl"] .hm-bars-track i, [dir="rtl"] .hm-aging-bar i { transform-origin: right; }
[dir="ltr"] .hm-meter i, [dir="ltr"] .hm-bars-track i, [dir="ltr"] .hm-aging-bar i { transform-origin: left; }

/* ── الأعمدة ───────────────────────────────────────────────────── */
.hm-columns { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.25rem; align-items: start; }
.hm-main, .hm-side { display: grid; gap: 1.25rem; min-width: 0; }
.hm-side { position: sticky; top: calc(var(--topbar-h, 56px) + 1rem); }
.hm-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }

.hm-panel {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--hm-line);
  border-radius: 18px;
  background: var(--hm-card);
  box-shadow: 0 1px 2px rgba(15, 27, 51, .04), 0 12px 30px -22px rgba(15, 27, 51, .3);
}

.hm-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.hm-panel-head p { margin: .25rem 0 0; color: var(--hm-muted); font-size: .84rem; }

.hm-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .8rem;
  border-radius: 10px;
  background: #eef4fd;
  color: var(--hm-navy);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.hm-link:hover { background: var(--hm-navy); color: #fff; }

/* شبكة لا كتلة: سفاري يعيد للوحة الكتلية هامشها المحسوب (ما بقي من عرض الحاوية)، فيطرحه Chart.js
   من العرض ويحبس المخطط على عرضه الأول (300). وهامش عنصر الشبكة صفر في المحركات كلها.
   والعمود minmax(0, 1fr) لا auto، وإلا صار عرض المخطط السابق حدّاً أدنى فلا ينكمش مع النافذة */
.hm-chart { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }
.hm-chart--trend { height: 320px; }
.hm-chart--donut { height: 260px; }

.hm-empty { display: grid; justify-items: center; gap: .5rem; padding: 2rem 1rem; color: var(--hm-muted); text-align: center; }
.hm-empty i { font-size: 2rem; opacity: .6; }
.hm-empty.is-clear i { color: var(--hm-green); opacity: 1; animation: hm-pop .7s var(--hm-ease) .6s both; }
.hm-empty.is-error { color: #8a1c1c; }

@keyframes hm-pop { 0% { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.2); } 100% { transform: none; } }

/* أعمار الذمم */
.hm-aging + .hm-aging { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px dashed var(--hm-line); }
.hm-aging-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.hm-aging-head span { font-weight: 800; font-variant-numeric: tabular-nums; }
.hm-aging-head small { color: var(--hm-muted); font-weight: 500; }
.hm-aging-bar { display: flex; gap: 3px; height: 14px; border-radius: 99px; overflow: hidden; background: #f1f4f9; }
.hm-aging-bar i { flex: none; }
.hm-aging-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem 1rem; margin: .7rem 0 0; padding: 0; list-style: none; font-size: .8rem; }
.hm-aging-legend li { display: flex; justify-content: space-between; gap: .5rem; color: var(--hm-muted); }
.hm-aging-legend li::before { content: ""; width: 9px; height: 9px; margin-top: .3rem; border-radius: 3px; background: var(--c); flex: none; }
.hm-aging-legend span { flex: 1; }
.hm-aging-legend b { color: var(--hm-ink); font-variant-numeric: tabular-nums; }
.hm-age-1 { --c: #0f9d63; }
.hm-age-2 { --c: #f2b705; }
.hm-age-3 { --c: #f07b1d; }
.hm-age-4 { --c: #d93636; }
/* الدفعات المقدمة تُخصم من الإجمالي ولا تُرسم في الشريط: سطرٌ كامل العرض بلون محايد */
.hm-age-advance { --c: #8a94a6; grid-column: 1 / -1; }
.hm-aging-bar i { background: var(--c); }

/* أشرطة الحسابات والموازنة */
.hm-bars, .hm-budget { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.hm-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .8rem; font-size: .85rem; }
.hm-bars-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hm-bars b, .hm-budget b { font-variant-numeric: tabular-nums; }
.hm-bars-track { grid-column: 1 / -1; height: 9px; border-radius: 99px; background: #f1f4f9; overflow: hidden; }
.hm-bars-track i { border-radius: 99px; background: linear-gradient(90deg, var(--hm-navy), var(--hm-cyan)); }
.hm-bars li.is-neg b { color: var(--hm-red); }
.hm-bars li.is-neg .hm-bars-track i { background: var(--hm-red); }
.hm-bars li:nth-child(2) .hm-bars-track i, .hm-budget li:nth-child(2) .hm-bars-track i { animation-delay: .62s; }
.hm-bars li:nth-child(3) .hm-bars-track i, .hm-budget li:nth-child(3) .hm-bars-track i { animation-delay: .74s; }
.hm-bars li:nth-child(4) .hm-bars-track i, .hm-budget li:nth-child(4) .hm-bars-track i { animation-delay: .86s; }
.hm-bars li:nth-child(5) .hm-bars-track i, .hm-budget li:nth-child(5) .hm-bars-track i { animation-delay: .98s; }
.hm-budget li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .8rem; font-size: .85rem; }
.hm-budget li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hm-budget li.is-ok .hm-bars-track i { background: linear-gradient(90deg, var(--hm-green), #34d399); }
.hm-budget li.is-near .hm-bars-track i { background: linear-gradient(90deg, #f2b705, var(--hm-amber)); }
.hm-budget li.is-over .hm-bars-track i { background: linear-gradient(90deg, var(--hm-amber), var(--hm-red)); }
.hm-budget li.is-over b { color: var(--hm-red); }
/* وسم الحالة بجانب النسبة: كانت في تلميح الاسم وحده (حلقة الموازنات 2026-11-07) */
.hm-budget-tag { margin-inline-start: .4rem; padding: .05rem .45rem; border-radius: 99px; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.hm-budget li.is-over .hm-budget-tag { background: color-mix(in srgb, var(--hm-red) 12%, #fff); color: var(--hm-red); }
.hm-budget li.is-near .hm-budget-tag { background: color-mix(in srgb, var(--hm-amber) 16%, #fff); color: #9a5b00; }

/* ── ما ينتظر قرارك ────────────────────────────────────────────── */
.hm-panel--inbox { border-top: 4px solid var(--hm-copper); }

.hm-badge {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 .6rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--hm-copper), #d9a560);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 8px 20px -8px rgba(183, 134, 66, .8);
  animation: hm-beat 2.4s ease-in-out 1.6s infinite;
}

@keyframes hm-beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.12); } 24% { transform: scale(1); } }

.hm-inbox-group + .hm-inbox-group { margin-top: .9rem; }
.hm-inbox-group h3 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .45rem; font-size: .82rem; font-weight: 800; color: var(--hm-muted); }
.hm-inbox-group.is-muted { opacity: .8; }

.hm-inbox-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  padding: .6rem .65rem;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: background .25s, transform .25s var(--hm-ease);
}

.hm-inbox-row:hover { background: #f4f7fb; color: inherit; transform: translateX(-3px); }
[dir="ltr"] .hm-inbox-row:hover { transform: translateX(3px); }
.hm-inbox-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #eef4fd; color: var(--hm-navy); }
.hm-inbox-text { display: grid; min-width: 0; }
.hm-inbox-text strong { font-size: .9rem; }
.hm-inbox-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hm-muted); font-size: .76rem; }
.hm-inbox-count { min-width: 34px; padding: .2rem .55rem; border-radius: 99px; background: var(--hm-navy); color: #fff; font-weight: 800; font-size: .85rem; text-align: center; }
.hm-inbox-group.is-muted .hm-inbox-count { background: #cbd5e1; color: var(--hm-ink); }

/* مسارات سريعة */
.hm-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }

.hm-actions a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem .75rem;
  border: 1px solid var(--hm-line);
  border-radius: 12px;
  color: var(--hm-ink);
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .25s, background .25s, transform .25s var(--hm-ease);
}

.hm-actions a i { color: var(--hm-navy); font-size: 1.05rem; }
.hm-actions a:hover { border-color: var(--hm-navy); background: #f4f8ff; transform: translateY(-2px); }
.hm-actions a.is-primary { border-color: transparent; background: linear-gradient(135deg, var(--hm-navy), #1b5fd0); color: #fff; }
.hm-actions a.is-primary i { color: #fff; }

/* ── الشاشات الصغيرة ───────────────────────────────────────────── */
@media (max-width: 1199.98px) {
  .hm-columns { grid-template-columns: 1fr; }
  .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-side { position: static; }
}

@media (max-width: 767.98px) {
  .hm-shell { padding: .75rem .75rem 1.5rem; }
  .hm-hero { grid-template-columns: 1fr; padding: 1.4rem 1.2rem; }
  .hm-ring { justify-self: stretch; }
  .hm-hero-side { flex-direction: column; }
  .hm-unposted { max-width: none; }
  .hm-aging-legend { grid-template-columns: 1fr; }
  .hm-kpis { grid-template-columns: 1fr; }
}
