/* ===== المرصد السكني الوطني — أنماط الهوية البصرية ===== */
:root {
  --nhc-900: #0a3d2c;
  --nhc-700: #155c42;
  --nhc-600: #1f6b4f;
  --nhc-gold: #caa75a;
}

* { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* تمرير مخصص */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #e6ede9; }
::-webkit-scrollbar-thumb { background: var(--nhc-600); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--nhc-700); }

/* عناوين الأقسام */
.section-title {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.15rem; font-weight: 700; color: var(--nhc-900);
}

/* البطاقات */
.card {
  background: #fff;
  border: 1px solid #e3ebe7;
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(10,61,44,.06), 0 8px 24px -12px rgba(10,61,44,.12);
  transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: 0 4px 8px rgba(10,61,44,.08), 0 16px 40px -16px rgba(10,61,44,.22); }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; color: var(--nhc-900); font-size: .92rem;
  margin-bottom: .9rem; padding-bottom: .7rem;
  border-bottom: 1px solid #eef3f0;
}

.badge {
  font-size: .65rem; font-weight: 600; color: var(--nhc-700);
  background: #e8f2ec; padding: .15rem .55rem; border-radius: 999px;
}
.badge-ai { background: linear-gradient(135deg, var(--nhc-gold), #e3cf9a); color: var(--nhc-900); }

/* بطاقة KPI */
.kpi {
  background: #fff; border: 1px solid #e3ebe7; border-radius: 1rem;
  padding: 1rem 1.1rem; position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -14px rgba(10,61,44,.3); }
.kpi::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
  width: 4px; background: linear-gradient(var(--nhc-600), var(--nhc-gold));
}
.kpi-icon {
  width: 38px; height: 38px; border-radius: .7rem;
  display: flex; align-items: center; justify-content: center;
  background: #e8f2ec; color: var(--nhc-600); font-size: 1rem;
}
.kpi-val { font-size: 1.55rem; font-weight: 700; color: var(--nhc-900); line-height: 1.1; }
.kpi-label { font-size: .72rem; color: #6b8278; margin-top: .15rem; }
.kpi-delta { font-size: .68rem; font-weight: 600; }
.kpi-up { color: #15803d; }
.kpi-down { color: #b91c1c; }

/* التنبيهات */
.alert-card {
  background: #fff; border-radius: .9rem; padding: .9rem 1rem;
  border-inline-start: 4px solid; box-shadow: 0 4px 14px -8px rgba(10,61,44,.18);
}
.alert-high { border-color: #dc2626; }
.alert-medium { border-color: #d97706; }
.alert-low { border-color: #16a34a; }

/* شريط التقدم للمشاريع */
.progress-track { height: 7px; background: #e6ede9; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--nhc-600), var(--nhc-400, #4ba883)); }

/* صفوف ترتيب المناطق */
.rank-row {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .65rem; border-radius: .7rem; cursor: pointer;
  transition: background .15s;
}
.rank-row:hover { background: #eef5f1; }
.rank-bar { height: 6px; border-radius: 999px; background: var(--nhc-500, #2e8b67); }

/* رسائل المساعد */
.msg { max-width: 85%; padding: .6rem .85rem; border-radius: 1rem; font-size: .82rem; line-height: 1.6; }
.msg-bot { background: #fff; border: 1px solid #e3ebe7; align-self: flex-start; border-top-right-radius: .25rem; }
.msg-user { background: var(--nhc-600); color: #fff; align-self: flex-end; border-top-left-radius: .25rem; margin-inline-start: auto; }
.suggestion-chip {
  font-size: .7rem; background: #e8f2ec; color: var(--nhc-700);
  padding: .3rem .7rem; border-radius: 999px; cursor: pointer;
  border: 1px solid #d4e6dc; transition: background .15s;
}
.suggestion-chip:hover { background: #d4e6dc; }

/* تأثير الظهور */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .5s ease both; }

.typing span {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--nhc-500, #2e8b67); margin: 0 1px; animation: bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* شريط المؤشرات المتحرك */
#ticker { position: relative; }
.ticker-track { animation: ticker 38s linear infinite; padding-inline-end: 2rem; }
#ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(100%); } }

/* sparkline داخل بطاقة KPI */
.kpi-spark { width: 100% !important; height: 34px !important; }

/* الوضع الليلي */
body.dark { background: #0a1512; color: #d7e5de; }
body.dark .card, body.dark .kpi, body.dark .alert-card { background: #11211b; border-color: #1d352b; }
body.dark .card-head { color: #e6f0ea; border-color: #1d352b; }
body.dark .section-title { color: #e6f0ea; }
body.dark .kpi-val, body.dark h4 { color: #f0f6f3 !important; }
body.dark .progress-track, body.dark .rank-bar { background: #1d352b; }
body.dark .rank-row:hover { background: #16271f; }
body.dark .msg-bot { background: #11211b; border-color: #1d352b; color: #d7e5de; }
body.dark #ai-messages, body.dark #drawer-panel, body.dark #region-drawer { background: #0a1512; }
body.dark .bg-white { background: #11211b !important; }
body.dark select { background: #11211b; color: #d7e5de; }

/* ============================================================
   الخريطة التفاعلية (Leaflet)
   ============================================================ */
#map-leaflet { background: #eef3f1; }
.leaflet-container { font-family: 'IBM Plex Sans Arabic', sans-serif; }

/* الوسم الدائم على كل منطقة */
.map-tip {
  background: rgba(255,255,255,.95); border: 1px solid rgba(31,107,79,.25);
  border-radius: 8px; box-shadow: 0 2px 8px rgba(10,61,44,.15);
  padding: 3px 8px; color: var(--nhc-900); font-size: 11px; line-height: 1.3;
}
.map-tip::before { display: none; }
.map-tip-label { font-weight: 700; }
.map-tip-val { color: var(--nhc-600); font-weight: 600; font-size: 10.5px; }
.map-tip-critical { border-color: rgba(224,122,63,.55); box-shadow: 0 2px 10px rgba(224,122,63,.3); }
.map-tip-crit { display: inline-block; margin-right: 5px; background: #e07a3f; color: #fff; font-size: 8.5px; font-weight: 700; padding: 1px 5px; border-radius: 6px; }

/* نبض المناطق الحرجة (فجوة تملّك مرتفعة) */
.map-pulse-icon { background: transparent; border: none; }
.map-pulse { display: block; border-radius: 50%; border: 2px solid #e07a3f; background: rgba(224,122,63,.18); animation: mapPulse 2s ease-out infinite; }
@keyframes mapPulse {
  0%   { transform: scale(.55); opacity: .9; }
  70%  { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .map-pulse { animation: none; opacity: .35; } }

/* النافذة المنبثقة الإحصائية */
.map-pop-wrap .leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 10px 30px rgba(10,61,44,.25); padding: 0; overflow: hidden; }
.map-pop-wrap .leaflet-popup-content { margin: 0; width: 258px !important; }
.map-pop-wrap .leaflet-popup-tip { background: var(--nhc-900); }
.map-pop-head {
  background: linear-gradient(135deg, var(--nhc-900), var(--nhc-700)); color: #fff;
  padding: 11px 14px; font-weight: 800; font-size: 15px; display: flex; align-items: baseline; gap: 7px;
}
.map-pop-head span { font-size: 11px; font-weight: 400; color: var(--nhc-goldlt); }
.map-pop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(31,107,79,.1); }
.map-pop-grid > div { background: #fff; padding: 9px 11px; display: flex; flex-direction: column; }
.map-pop-grid i { color: var(--nhc-gold); font-size: 12px; margin-bottom: 3px; }
.map-pop-grid b { font-size: 14px; color: var(--nhc-900); font-weight: 700; }
.map-pop-grid span { font-size: 10px; color: #6b7c73; }
.map-pop-btn {
  width: 100%; background: var(--nhc-600); color: #fff; border: none; padding: 9px;
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.map-pop-btn:hover { background: var(--nhc-900); }

/* وسيلة الإيضاح */
.map-legend {
  position: absolute; bottom: 14px; left: 14px; z-index: 500;
  background: rgba(255,255,255,.95); border: 1px solid rgba(31,107,79,.18);
  border-radius: 12px; padding: 10px 12px; box-shadow: 0 4px 14px rgba(10,61,44,.15);
  min-width: 150px; backdrop-filter: blur(4px);
}
.map-legend-title { font-size: 11.5px; font-weight: 700; color: var(--nhc-900); margin-bottom: 7px; }
.map-legend-bar { height: 10px; border-radius: 5px; margin-bottom: 5px; }
.map-legend-scale { display: flex; justify-content: space-between; font-size: 9.5px; color: #6b7c73; }
.map-legend-note { font-size: 9.5px; color: #8a988f; margin-top: 7px; display: flex; align-items: center; gap: 4px; }
.map-legend-note i { color: var(--nhc-600); }
body.dark .map-legend { background: rgba(17,33,27,.95); border-color: #1d352b; }
body.dark .map-legend-title { color: #e6f0ea; }
body.dark .map-tip { background: rgba(17,33,27,.95); border-color: #1d352b; color: #e6f0ea; }
body.dark .map-tip-val { color: #9fd4ba; }

/* ============================================================
   التقرير التحليلي (PropTech)
   ============================================================ */
.rep-toc-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 10px; color: #5a6b62; text-decoration: none;
  transition: all .2s; border-right: 3px solid transparent;
}
.rep-toc-link i { width: 18px; text-align: center; color: var(--nhc-gold); font-size: 13px; }
.rep-toc-link:hover { background: rgba(31,107,79,.08); color: var(--nhc-900); }
.rep-toc-link.active { background: rgba(31,107,79,.12); color: var(--nhc-900); font-weight: 700; border-right-color: var(--nhc-gold); }
body.dark .rep-toc-link { color: #9fb4aa; }
body.dark .rep-toc-link:hover, body.dark .rep-toc-link.active { background: #16271f; color: #f0f6f3; }

.rep-cover {
  background: linear-gradient(135deg, var(--nhc-900), var(--nhc-700));
  color: #fff; border-radius: 16px; padding: 28px 26px; margin-bottom: 26px;
  position: relative; overflow: hidden;
}
.rep-cover::after {
  content: ''; position: absolute; left: -40px; bottom: -40px; width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(202,167,90,.35), transparent 70%); border-radius: 50%;
}
.rep-cover-badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
  background: rgba(202,167,90,.2); color: #e3cf9a; padding: 5px 12px; border-radius: 999px; margin-bottom: 12px;
}
.rep-title { font-size: 26px; font-weight: 800; margin: 0 0 8px; line-height: 1.4; }
.rep-subtitle { font-size: 14px; color: #cfe0d7; line-height: 1.9; max-width: 760px; margin: 0 0 16px; }
.rep-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rep-tag { font-size: 11px; background: rgba(255,255,255,.12); color: #e6f0ea; padding: 4px 11px; border-radius: 999px; }
.rep-date { font-size: 12px; color: var(--nhc-gold); font-weight: 600; }

.rep-section { margin-bottom: 30px; }
.rep-section-title {
  display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800;
  color: var(--nhc-900); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid rgba(202,167,90,.35);
}
.rep-section-title i { color: var(--nhc-gold); }
body.dark .rep-section-title { color: #f0f6f3; }

.rep-p { font-size: 14.5px; line-height: 2; color: #3a4a42; margin: 0 0 14px; }
body.dark .rep-p { color: #c2d3ca; }
.rep-h { display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 700; color: var(--nhc-700); margin: 18px 0 12px; }
.rep-h-bar { width: 5px; height: 18px; border-radius: 3px; background: var(--nhc-gold); }
body.dark .rep-h { color: #9fd4ba; }

.rep-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 9px; }
.rep-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.9; color: #3a4a42; }
.rep-list li i { color: var(--nhc-600); background: rgba(31,107,79,.1); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; flex-shrink: 0; margin-top: 3px; }
body.dark .rep-list li { color: #c2d3ca; }

.rep-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin: 4px 0 18px; }
.rep-stat { background: rgba(31,107,79,.05); border: 1px solid rgba(31,107,79,.12); border-radius: 12px; padding: 16px 14px; text-align: center; }
.rep-stat-val { font-size: 24px; font-weight: 800; color: var(--nhc-700); }
.rep-stat-label { font-size: 12.5px; color: #5a6b62; margin-top: 4px; font-weight: 600; }
.rep-stat-note { font-size: 11px; color: var(--nhc-gold); margin-top: 4px; }
body.dark .rep-stat { background: #16271f; border-color: #1d352b; }
body.dark .rep-stat-val { color: #9fd4ba; }
body.dark .rep-stat-label { color: #9fb4aa; }

.rep-callout { display: flex; gap: 13px; border-radius: 12px; padding: 15px 16px; margin: 6px 0 18px; border: 1px solid; }
.rep-callout-icon { font-size: 20px; flex-shrink: 0; }
.rep-callout-title { font-weight: 800; font-size: 14.5px; margin-bottom: 4px; }
.rep-callout-text { font-size: 13.5px; line-height: 1.85; }
.rep-info { background: rgba(31,107,79,.07); border-color: rgba(31,107,79,.2); }
.rep-info .rep-callout-icon, .rep-info .rep-callout-title { color: var(--nhc-700); }
.rep-info .rep-callout-text { color: #3a4a42; }
.rep-success { background: rgba(34,160,90,.08); border-color: rgba(34,160,90,.25); }
.rep-success .rep-callout-icon, .rep-success .rep-callout-title { color: #1a7a44; }
.rep-success .rep-callout-text { color: #2c5840; }
.rep-warning { background: rgba(214,158,46,.1); border-color: rgba(214,158,46,.3); }
.rep-warning .rep-callout-icon, .rep-warning .rep-callout-title { color: #b07d12; }
.rep-warning .rep-callout-text { color: #6b5210; }
body.dark .rep-callout-text { color: #c2d3ca !important; }

.rep-table-wrap { overflow-x: auto; margin: 6px 0 18px; border-radius: 12px; border: 1px solid rgba(31,107,79,.15); }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rep-table th { background: var(--nhc-900); color: #fff; padding: 11px 13px; text-align: right; font-weight: 700; }
.rep-table td { padding: 11px 13px; border-bottom: 1px solid rgba(31,107,79,.1); color: #3a4a42; }
.rep-table tr:last-child td { border-bottom: none; }
.rep-table tr:nth-child(even) td { background: rgba(31,107,79,.03); }
.rep-td-key { font-weight: 700; color: var(--nhc-700); }
body.dark .rep-table td { color: #c2d3ca; border-color: #1d352b; }
body.dark .rep-table tr:nth-child(even) td { background: #16271f; }
body.dark .rep-td-key { color: #9fd4ba; }

.rep-foot { text-align: center; color: var(--nhc-gold); font-size: 13px; font-weight: 600; padding: 20px 0 6px; border-top: 1px solid rgba(202,167,90,.25); margin-top: 10px; }
.rep-foot i { margin-left: 6px; }

/* ============================================================
   نظام التبويبات (SPA Tabs)
   ============================================================ */
.tab-panel { display: none; }
.tab-panel.tab-active { display: block; animation: tabFade .45s cubic-bezier(.4,0,.2,1); }
@keyframes tabFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* تمييز الرابط النشط في شريط التنقل */
.nav-link.tab-link-active { background: var(--nhc-gold); color: var(--nhc-900) !important; font-weight: 700; }
.mobile-link.tab-link-active { background: var(--nhc-gold); color: var(--nhc-900) !important; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .tab-panel.tab-active { animation: none; }
}

/* ============================================================
   محرّك المحاكاة «ماذا لو؟»
   ============================================================ */
.sim-wrap { padding: 22px; }
.sim-intro { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(135deg, rgba(10,61,44,.05), rgba(202,167,90,.09));
  border: 1px solid rgba(202,167,90,.3); border-radius: 14px; padding: 16px 18px; margin-bottom: 22px; }
.sim-intro i { font-size: 22px; color: var(--nhc-gold); margin-top: 2px; flex: none; }
.sim-intro p { font-size: 13.5px; line-height: 1.8; color: #44544c; margin: 0; }
body.dark .sim-intro { background: #13241d; border-color: #2a4438; }
body.dark .sim-intro p { color: #c2d3ca; }
.sim-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 26px; }
@media (max-width: 900px) { .sim-grid { grid-template-columns: 1fr; } }

.sim-ctrl { margin-bottom: 20px; }
.sim-ctrl-head { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--nhc-900); margin-bottom: 8px; }
body.dark .sim-ctrl-head { color: #eaf4ef; }
.sim-val { background: var(--nhc-900); color: #fff; font-weight: 700; font-size: 12.5px; padding: 3px 12px; border-radius: 999px; min-width: 70px; text-align: center; }
body.dark .sim-val { background: var(--nhc-gold); color: var(--nhc-900); }
.sim-hint { font-size: 11.5px; color: #94a3a0; margin-top: 6px; }
.sim-range { -webkit-appearance: none; appearance: none; width: 100%; height: 7px; border-radius: 999px;
  background: linear-gradient(90deg, var(--nhc-600), var(--nhc-gold)); outline: none; cursor: pointer; }
.sim-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--nhc-700); box-shadow: 0 2px 8px rgba(10,61,44,.3); cursor: pointer; transition: transform .15s; }
.sim-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.sim-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--nhc-700); cursor: pointer; }
.sim-reset { margin-top: 6px; background: transparent; border: 1px solid rgba(31,107,79,.3); color: var(--nhc-700); font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 10px; cursor: pointer; transition: .2s; display: inline-flex; align-items: center; gap: 7px; }
.sim-reset:hover { background: var(--nhc-700); color: #fff; }
body.dark .sim-reset { color: #9fd4ba; border-color: #2a4438; }

.sim-results { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; }
.sim-result-card { background: linear-gradient(135deg, #fff, #f7faf8); border: 1px solid rgba(31,107,79,.14); border-radius: 16px; padding: 18px; box-shadow: 0 4px 14px rgba(10,61,44,.05); }
.sim-result-card:first-child { grid-column: 1 / -1; background: linear-gradient(135deg, var(--nhc-900), var(--nhc-600)); color: #fff; border: none; }
body.dark .sim-result-card { background: #11211b; border-color: #1d352b; }
body.dark .sim-result-card:first-child { background: linear-gradient(135deg, #0a3d2c, #1f6b4f); }
.sim-result-label { font-size: 12.5px; font-weight: 600; color: #6b7c74; margin-bottom: 6px; }
.sim-result-card:first-child .sim-result-label { color: rgba(255,255,255,.8); }
body.dark .sim-result-label { color: #9fb3aa; }
.sim-result-val { font-size: 2rem; font-weight: 900; color: var(--nhc-700); line-height: 1; letter-spacing: -.5px; }
.sim-result-card:first-child .sim-result-val { color: #fff; font-size: 2.6rem; }
body.dark .sim-result-val { color: #9fd4ba; }
.sim-unit { font-size: 1.1rem; font-weight: 700; margin-right: 2px; }
.sim-result-sub { font-size: 11px; color: #94a3a0; margin-top: 8px; }
.sim-delta { font-size: 12.5px; font-weight: 700; margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; color: #94a3a0; }
.sim-delta.up { color: #1f8f5f; }
.sim-delta.down { color: #d6543f; }
.sim-result-card:first-child .sim-delta.up { color: #7be0ad; }
.sim-result-card:first-child .sim-delta.down { color: #ffb0a3; }
.sim-bar { position: relative; height: 8px; background: rgba(255,255,255,.18); border-radius: 999px; margin-top: 14px; overflow: visible; }
.sim-bar-fill { height: 100%; background: linear-gradient(90deg, var(--nhc-gold), #ffd98a); border-radius: 999px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.sim-bar-target { position: absolute; top: -4px; bottom: -4px; right: calc((78 - 70) / (78 - 58) * 100%); width: 3px; background: #fff; border-radius: 2px; }
.sim-target-note { font-size: 10.5px; color: rgba(255,255,255,.75); margin-top: 8px; }
.sim-verdict { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; border-radius: 14px; padding: 15px 18px; font-size: 13px; line-height: 1.7; font-weight: 500; }
.sim-verdict i { font-size: 22px; flex: none; }
.sim-verdict.sim-good { background: rgba(31,143,95,.12); border: 1px solid rgba(31,143,95,.35); color: #1a7a51; }
.sim-verdict.sim-mid { background: rgba(202,167,90,.14); border: 1px solid rgba(202,167,90,.4); color: #997720; }
.sim-verdict.sim-warn { background: rgba(214,84,63,.12); border: 1px solid rgba(214,84,63,.35); color: #b8452f; }
body.dark .sim-verdict.sim-good { color: #7be0ad; } body.dark .sim-verdict.sim-mid { color: #e3cf9a; } body.dark .sim-verdict.sim-warn { color: #ffb0a3; }

/* ============================================================
   وضع المقارنة
   ============================================================ */
.compare-pickers { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
  background: linear-gradient(135deg, rgba(10,61,44,.04), rgba(202,167,90,.07)); border-radius: 14px; padding: 16px; }
.compare-picker { display: flex; align-items: center; gap: 8px; }
.compare-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-left: 4px; }
.compare-select { font-size: 14px; font-weight: 700; color: var(--nhc-900); background: #fff; border: 1.5px solid rgba(31,107,79,.25);
  border-radius: 10px; padding: 8px 14px; cursor: pointer; min-width: 150px; }
body.dark .compare-select { background: #11211b; color: #eaf4ef; border-color: #2a4438; }
.compare-vs { font-size: 13px; font-weight: 700; color: var(--nhc-gold); }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cmp-table th { background: linear-gradient(135deg, var(--nhc-900), var(--nhc-600)); color: #fff; padding: 12px; font-weight: 700; text-align: center; }
.cmp-table th:first-child { text-align: right; }
.cmp-table td { padding: 12px; border-bottom: 1px solid rgba(31,107,79,.1); color: #3a4a42; text-align: center; }
.cmp-table td:first-child { text-align: right; }
.cmp-table tr:nth-child(even) td { background: rgba(31,107,79,.03); }
.cmp-key { font-weight: 700; color: var(--nhc-700); }
.cmp-win { font-weight: 800; color: #1a7a51; }
.cmp-win i { color: var(--nhc-gold); font-size: 11px; margin-right: 3px; }
body.dark .cmp-table td { color: #c2d3ca; border-color: #1d352b; }
body.dark .cmp-table tr:nth-child(even) td { background: #16271f; }
body.dark .cmp-key { color: #9fd4ba; } body.dark .cmp-win { color: #7be0ad; }
.cmp-note { font-size: 11.5px; color: #94a3a0; margin-top: 12px; display: flex; align-items: center; gap: 6px; }
.cmp-note i { color: var(--nhc-gold); }

/* ============================================================
   تأثيرات الظهور عند التمرير
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s cubic-bezier(.4,0,.2,1), transform .6s cubic-bezier(.4,0,.2,1); }
.reveal.revealed { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; transition: none !important; } }

/* ============================================================
   المنهجية — تصميم وثيقة استراتيجية بهوية NHC
   ============================================================ */
.meth-doc {
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
  border: 1px solid rgba(31,107,79,.12);
  border-radius: 22px;
  box-shadow: 0 10px 40px rgba(10,61,44,.08);
  overflow: hidden;
}
body.dark .meth-doc { background: linear-gradient(180deg,#0e1c17 0%,#0a1512 100%); border-color: #1d352b; }

/* الغلاف */
.meth-cover {
  position: relative;
  background: linear-gradient(135deg, var(--nhc-900) 0%, #0d4733 45%, var(--nhc-600) 100%);
  color: #fff; padding: 48px 40px; overflow: hidden;
}
.meth-cover-glow { position: absolute; inset: 0; background:
  radial-gradient(420px 280px at 88% -10%, rgba(202,167,90,.28), transparent 60%),
  radial-gradient(360px 260px at 8% 120%, rgba(46,139,103,.4), transparent 60%); }
.meth-cover-inner { position: relative; z-index: 1; max-width: 880px; }
.meth-cover-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.meth-cover-badge i { color: var(--nhc-gold); }
.meth-title { font-size: clamp(1.5rem, 3.2vw, 2.3rem); font-weight: 800; line-height: 1.3; margin: 0 0 10px; }
.meth-subtitle { font-size: 1.02rem; color: #d8e9e1; line-height: 1.7; margin: 0 0 18px; }
.meth-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.meth-tag { font-size: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(202,167,90,.3); color: var(--nhc-gold); padding: 4px 12px; border-radius: 999px; }
.meth-cover-meta { display: flex; flex-wrap: wrap; gap: 22px; font-size: 12.5px; color: #b9d4c8; }
.meth-cover-meta i { color: var(--nhc-gold); margin-left: 6px; }

/* الملخص التنفيذي */
.meth-summary { padding: 34px 40px; border-bottom: 1px solid rgba(31,107,79,.1); }
.meth-summary-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.meth-summary-head h3 { font-size: 1.3rem; font-weight: 800; color: var(--nhc-900); margin: 0; }
body.dark .meth-summary-head h3 { color: #eaf4ef; }
.meth-sec-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--nhc-700), var(--nhc-600)); color: #fff; font-size: 18px; box-shadow: 0 6px 16px rgba(10,61,44,.25); }
.meth-summary-body { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: center; }
.meth-gap-hero { text-align: center; background: linear-gradient(135deg, rgba(10,61,44,.04), rgba(202,167,90,.1));
  border: 1.5px dashed rgba(202,167,90,.5); border-radius: 18px; padding: 26px 18px; }
.meth-gap-num { font-size: 2.6rem; font-weight: 900; color: var(--nhc-700); line-height: 1; letter-spacing: -1px; }
.meth-gap-unit { font-size: .95rem; font-weight: 700; color: var(--nhc-gold); margin-top: 6px; }
.meth-gap-label { font-size: 12px; color: #6b7c74; margin-top: 8px; }
body.dark .meth-gap-num { color: #9fd4ba; }
body.dark .meth-gap-label { color: #9fb3aa; }
.meth-summary-text p { font-size: .95rem; line-height: 1.9; color: #3a4a42; margin: 0 0 12px; text-align: justify; }
.meth-summary-text p:last-child { margin-bottom: 0; }
.meth-summary-text b { color: var(--nhc-700); }
body.dark .meth-summary-text p { color: #c2d3ca; }
body.dark .meth-summary-text b { color: #9fd4ba; }
.meth-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.meth-pillar { display: flex; gap: 13px; align-items: flex-start; background: #fff; border: 1px solid rgba(31,107,79,.12);
  border-radius: 14px; padding: 16px; transition: .25s; }
.meth-pillar:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(10,61,44,.1); border-color: rgba(202,167,90,.4); }
body.dark .meth-pillar { background: #11211b; border-color: #1d352b; }
.meth-pillar-icon { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center;
  background: rgba(202,167,90,.16); color: var(--nhc-700); font-size: 17px; }
body.dark .meth-pillar-icon { color: var(--nhc-gold); }
.meth-pillar-title { font-weight: 700; color: var(--nhc-900); font-size: .95rem; margin-bottom: 3px; }
.meth-pillar-text { font-size: 12.5px; color: #6b7c74; line-height: 1.6; }
body.dark .meth-pillar-title { color: #eaf4ef; }
body.dark .meth-pillar-text { color: #9fb3aa; }

/* الأقسام */
.meth-section { padding: 36px 40px; border-bottom: 1px solid rgba(31,107,79,.08); }
.meth-section:last-of-type { border-bottom: none; }
.meth-sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.meth-sec-num { font-size: 2rem; font-weight: 900; color: rgba(202,167,90,.45); line-height: 1; font-style: italic; }
.meth-sec-head h3 { font-size: 1.35rem; font-weight: 800; color: var(--nhc-900); margin: 0; }
body.dark .meth-sec-head h3 { color: #eaf4ef; }
.meth-lead { font-size: .98rem; line-height: 1.9; color: #3a4a42; margin: 0 0 22px; text-align: justify;
  padding-right: 16px; border-right: 4px solid var(--nhc-gold); }
body.dark .meth-lead { color: #c2d3ca; }
.meth-h { display: flex; align-items: center; gap: 10px; font-size: 1.08rem; font-weight: 700; color: var(--nhc-700); margin: 30px 0 14px; }
.meth-h-bar { width: 8px; height: 8px; border-radius: 50%; background: var(--nhc-gold); box-shadow: 0 0 0 4px rgba(202,167,90,.2); }
body.dark .meth-h { color: #9fd4ba; }
.meth-p { font-size: .94rem; line-height: 1.85; color: #44544c; margin: 0 0 16px; text-align: justify; }
.meth-p b { color: var(--nhc-700); }
body.dark .meth-p { color: #c2d3ca; }
body.dark .meth-p b { color: #9fd4ba; }

/* إحصائيات */
.meth-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 8px 0 24px; }
.meth-stat { background: linear-gradient(135deg, rgba(10,61,44,.03), rgba(202,167,90,.07)); border: 1px solid rgba(31,107,79,.12);
  border-radius: 14px; padding: 18px 14px; text-align: center; }
.meth-stat-val { font-size: 1.5rem; font-weight: 800; color: var(--nhc-700); line-height: 1; }
.meth-stat-label { font-size: 12.5px; color: #44544c; margin-top: 7px; font-weight: 600; }
.meth-stat-note { font-size: 11px; color: var(--nhc-gold); margin-top: 4px; }
body.dark .meth-stat { background: #11211b; border-color: #1d352b; }
body.dark .meth-stat-val { color: #9fd4ba; }
body.dark .meth-stat-label { color: #c2d3ca; }

/* بطاقات الرسوم */
.meth-chart-card { background: #fff; border: 1px solid rgba(31,107,79,.12); border-radius: 16px; padding: 16px 16px 6px; margin: 10px 0 22px; box-shadow: 0 4px 14px rgba(10,61,44,.05); }
body.dark .meth-chart-card { background: #11211b; border-color: #1d352b; }
.meth-chart-title { font-size: .9rem; font-weight: 700; color: var(--nhc-900); margin-bottom: 8px; }
body.dark .meth-chart-title { color: #eaf4ef; }
.meth-chart { width: 100%; height: 360px; }
.meth-chart-tall { height: 440px; }

/* شرائح ديموغرافية */
.meth-segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 6px 0 22px; }
.meth-seg { text-align: center; background: #fff; border: 1px solid rgba(31,107,79,.12); border-top: 4px solid var(--nhc-gold);
  border-radius: 14px; padding: 20px 14px; transition: .25s; }
.meth-seg:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(10,61,44,.1); }
body.dark .meth-seg { background: #11211b; border-color: #1d352b; border-top-color: var(--nhc-gold); }
.meth-seg-pct { font-size: 1.9rem; font-weight: 900; color: var(--nhc-700); line-height: 1; }
.meth-seg-label { font-size: 13px; font-weight: 700; color: var(--nhc-900); margin-top: 8px; }
.meth-seg-units { font-size: 11.5px; color: #6b7c74; margin-top: 4px; }
body.dark .meth-seg-pct { color: #9fd4ba; }
body.dark .meth-seg-label { color: #eaf4ef; }
body.dark .meth-seg-units { color: #9fb3aa; }

/* جدول */
.meth-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid rgba(31,107,79,.12); margin: 8px 0 6px; }
.meth-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.meth-table th { background: linear-gradient(135deg, var(--nhc-900), var(--nhc-600)); color: #fff; padding: 13px 12px; font-weight: 700; text-align: center; }
.meth-table td { padding: 12px; border-bottom: 1px solid rgba(31,107,79,.1); color: #3a4a42; text-align: center; }
.meth-table tr:last-child td { border-bottom: none; }
.meth-table tr:nth-child(even) td { background: rgba(31,107,79,.03); }
.meth-td-key { font-weight: 700; color: var(--nhc-700); }
.meth-neg { color: #c0392b; font-weight: 700; }
.meth-pos { color: #1f8f5f; font-weight: 700; }
body.dark .meth-table td { color: #c2d3ca; border-color: #1d352b; }
body.dark .meth-table tr:nth-child(even) td { background: #16271f; }
body.dark .meth-td-key { color: #9fd4ba; }
body.dark .meth-neg { color: #ff8a7a; }
body.dark .meth-pos { color: #7be0ad; }

/* بطاقات (جاهزية / مواءمة) */
.meth-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 8px; }
.meth-cards-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.meth-card { background: #fff; border: 1px solid rgba(31,107,79,.12); border-top: 4px solid var(--nhc-700); border-radius: 16px;
  padding: 24px 20px; text-align: center; transition: .25s; }
.meth-card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(10,61,44,.12); border-top-color: var(--nhc-gold); }
body.dark .meth-card { background: #11211b; border-color: #1d352b; border-top-color: var(--nhc-700); }
.meth-card-soft { border-top-color: var(--nhc-gold); }
.meth-card-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(202,167,90,.18), rgba(31,107,79,.12)); color: var(--nhc-700); font-size: 28px; }
.meth-card-icon.sm { width: 52px; height: 52px; font-size: 22px; border-radius: 15px; }
body.dark .meth-card-icon { color: var(--nhc-gold); }
.meth-card h5 { font-size: 1.02rem; font-weight: 700; color: var(--nhc-900); margin: 0 0 10px; }
.meth-card p { font-size: 13px; line-height: 1.8; color: #56655d; margin: 0; text-align: justify; }
body.dark .meth-card h5 { color: #eaf4ef; }
body.dark .meth-card p { color: #a9bcb3; }

/* المثال العملي + الخطوات */
.meth-example { background: linear-gradient(135deg, rgba(10,61,44,.04), rgba(202,167,90,.08)); border: 1px solid rgba(202,167,90,.35);
  border-radius: 18px; padding: 24px; margin: 8px 0 24px; }
.meth-example-head { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--nhc-900); font-size: 1.05rem; margin-bottom: 14px; }
.meth-example-head i { color: var(--nhc-gold); }
body.dark .meth-example { background: #13241d; border-color: #2a4438; }
body.dark .meth-example-head { color: #eaf4ef; }
.meth-example-problem { font-size: 13.5px; line-height: 1.8; color: #44544c; background: rgba(255,255,255,.55); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.meth-example-problem b { color: var(--nhc-700); }
body.dark .meth-example-problem { background: rgba(255,255,255,.04); color: #c2d3ca; }
body.dark .meth-example-problem b { color: #9fd4ba; }
.meth-flow-steps { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.meth-step { flex: 1; min-width: 170px; display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid rgba(31,107,79,.12); border-radius: 13px; padding: 15px; }
body.dark .meth-step { background: #11211b; border-color: #1d352b; }
.meth-step-num { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: var(--nhc-700); color: #fff; font-size: 14px; }
.meth-step-actor { font-weight: 700; color: var(--nhc-900); font-size: 13.5px; margin-bottom: 4px; }
.meth-step-action { font-size: 12.5px; color: #56655d; line-height: 1.6; }
body.dark .meth-step-actor { color: #eaf4ef; }
body.dark .meth-step-action { color: #a9bcb3; }
.meth-step-arrow { display: grid; place-items: center; color: var(--nhc-gold); font-size: 18px; flex: none; }

/* الخلاصة */
.meth-conclusion { display: flex; gap: 16px; align-items: center; margin-top: 26px;
  background: linear-gradient(135deg, var(--nhc-900), var(--nhc-600)); color: #fff; border-radius: 18px; padding: 24px 26px; }
.meth-conclusion i { font-size: 30px; color: var(--nhc-gold); flex: none; }
.meth-conclusion p { font-size: .98rem; line-height: 1.85; margin: 0; text-align: justify; }

.meth-foot { text-align: center; color: var(--nhc-gold); font-size: 13px; font-weight: 700; padding: 22px 0; background: rgba(10,61,44,.03); }
.meth-foot i { margin-left: 6px; }
body.dark .meth-foot { background: rgba(255,255,255,.02); }

@media (max-width: 860px) {
  .meth-summary-body { grid-template-columns: 1fr; }
  .meth-pillars, .meth-stats, .meth-segs { grid-template-columns: 1fr 1fr; }
  .meth-cover, .meth-summary, .meth-section { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 540px) {
  .meth-pillars, .meth-stats, .meth-segs { grid-template-columns: 1fr; }
}

/* ============================================================
   التقرير التنفيذي للطباعة / PDF
   ============================================================ */
.pdf-report { display: none; }
.pdf-header { display: flex; align-items: center; gap: 20px; border-bottom: 3px solid #0a3d2c; padding-bottom: 18px; margin-bottom: 22px; }
.pdf-logo { height: 56px; width: auto; object-fit: contain; }
.pdf-titlebox h1 { font-size: 22px; font-weight: 800; color: #0a3d2c; margin: 0; }
.pdf-titlebox h2 { font-size: 15px; font-weight: 600; color: #155c42; margin: 3px 0 0; }
.pdf-titlebox p { font-size: 11px; color: #64748b; margin: 4px 0 0; }
.pdf-section { margin-bottom: 20px; }
.pdf-section h3 { font-size: 15px; font-weight: 800; color: #0a3d2c; border-right: 4px solid #caa75a; padding-right: 10px; margin: 0 0 10px; }
.pdf-section p { font-size: 12.5px; line-height: 2; color: #1f2937; text-align: justify; margin: 0; }
.pdf-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pdf-kpi { border: 1px solid #d6e0db; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; background: #f7faf8; }
.pdf-kpi-l { font-size: 10px; color: #64748b; }
.pdf-kpi-v { font-size: 20px; font-weight: 800; color: #0a3d2c; line-height: 1.1; }
.pdf-kpi-s { font-size: 9.5px; color: #1f6b4f; }
.pdf-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.pdf-table th { background: #0a3d2c; color: #fff; padding: 8px 10px; text-align: right; font-weight: 700; }
.pdf-table td { padding: 7px 10px; border-bottom: 1px solid #e2e8f0; color: #1f2937; }
.pdf-table tr:nth-child(even) td { background: #f7faf8; }
.pdf-table tr.pdf-sep td { border-top: 2px solid #caa75a; }
.pdf-footer { display: flex; justify-content: space-between; border-top: 1px solid #d6e0db; padding-top: 10px; margin-top: 8px; font-size: 9.5px; color: #94a3b8; }

/* الطباعة العادية */
@media print {
  #top-header, #ai-modal, #ai-fab-top, #scroll-progress, #region-drawer, #ticker, #btn-menu, #splash, #kiosk-mode { display: none !important; }
  body { background: #fff; }
  .card, .kpi { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  section { break-inside: avoid; }
  .meth-section, .meth-summary { break-inside: avoid; }
}

/* عند تفعيل تقرير الـ PDF: نُخفي كل شيء ونُظهر التقرير فقط */
@media print {
  body.printing-report > div > *:not(#pdf-report) { display: none !important; }
  body.printing-report .pdf-report { display: block !important; }
  body.printing-report { background: #fff !important; }
  body.printing-report.dark { background: #fff !important; }
  .pdf-section, .pdf-header, .pdf-kpi-grid { break-inside: avoid; }
  @page { margin: 14mm; size: A4; }
}

/* ============================================================
   وضع العرض التنفيذي (Kiosk / Presentation Mode)
   ============================================================ */
html.kiosk-on { overflow: hidden; }
.kiosk-bg { background: radial-gradient(circle at 30% 20%, #155c42 0%, #0a3d2c 45%, #06291d 100%); }
.kiosk-bg::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(202,167,90,.08) 1px, transparent 1px); background-size: 28px 28px; opacity: .6; }
#kiosk-value { text-shadow: 0 8px 40px rgba(202,167,90,.25); }
.kiosk-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.25); border: none; cursor: pointer; transition: all .3s; padding: 0; }
.kiosk-dot.active { background: #caa75a; width: 30px; border-radius: 6px; }
.kiosk-dot:hover { background: rgba(255,255,255,.5); }
@keyframes kioskPop { 0% { opacity: 0; transform: scale(.85) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
#kiosk-icon { animation: kioskIconFloat 3s ease-in-out infinite; }
@keyframes kioskIconFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  #kiosk-value, #kiosk-icon { animation: none !important; }
}

/* ============================================================
   مطابقة العرض والطلب + مؤشر معدل الانحراف (بيانات الوزارة)
   ============================================================ */
.dev-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px; color: #fff;
  background: linear-gradient(120deg, #0a3d2c 0%, #155c42 55%, #1f6b4f 100%); box-shadow: 0 16px 40px rgba(10,61,44,.18); }
.dev-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(202,167,90,.12); filter: blur(8px); }
.dev-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18); padding: 5px 12px; border-radius: 999px; }

/* بطاقات الفجوة الوطنية */
.dev-kpi { border-radius: 16px; padding: 18px; background: #fff; border: 1px solid #e8ede9;
  box-shadow: 0 6px 18px rgba(10,61,44,.05); position: relative; overflow: hidden; }
.dev-kpi-ic { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 10px; background: #eef4f0; color: #1f6b4f; }
.dev-kpi-val { font-size: 26px; font-weight: 800; line-height: 1.1; color: #0a3d2c; }
.dev-kpi-lbl { font-size: 13px; color: #46564f; margin-top: 4px; font-weight: 600; }
.dev-kpi-sub { font-size: 11px; color: #8a978f; margin-top: 2px; }
.dev-kpi-danger { background: linear-gradient(180deg,#fff,#fdf2ef); border-color: #f4d6c9; }
.dev-kpi-danger .dev-kpi-ic { background: #fbe3d8; color: #c2410c; }
.dev-kpi-danger .dev-kpi-val { color: #b91c1c; }
.dev-kpi-warn .dev-kpi-ic { background: #fdf3d9; color: #b7860b; }

/* معادلة + خطوات */
.dev-formula { background: #0a3d2c; color: #e3cf9a; font-weight: 700; text-align: center; padding: 14px 16px;
  border-radius: 12px; margin-bottom: 18px; font-size: 15px; letter-spacing: .2px; }
.dev-formula i { color: #caa75a; margin-left: 8px; }
.dev-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.dev-step { background: #f7faf8; border: 1px solid #e8ede9; border-radius: 14px; padding: 16px; position: relative; }
.dev-step-num { position: absolute; top: 12px; left: 12px; width: 22px; height: 22px; border-radius: 50%;
  background: #caa75a; color: #0a3d2c; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.dev-step-ic { width: 38px; height: 38px; border-radius: 10px; background: #e7f0eb; color: #1f6b4f;
  display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 10px; }
.dev-step-title { font-weight: 700; color: #0a3d2c; margin-bottom: 4px; }
.dev-step-desc { font-size: 12.5px; color: #56655d; line-height: 1.7; }
.dev-insights { margin-top: 18px; background: #fbf9f3; border: 1px dashed #e0d2ad; border-radius: 12px; padding: 16px; }
.dev-insights-h { font-weight: 700; color: #0a3d2c; margin-bottom: 10px; }
.dev-insights ul { display: grid; gap: 8px; }
.dev-insights li { font-size: 13px; color: #46564f; line-height: 1.7; }
.dev-insights li i { color: #1f6b4f; margin-left: 6px; }

/* المنتجات الأربعة */
.dev-products { display: grid; gap: 14px; }
.dev-prod-top { display: flex; justify-content: space-between; font-size: 14px; color: #2a3a33; margin-bottom: 6px; }
.dev-prod-top strong { color: #0a3d2c; }
.dev-prod-bar { height: 12px; background: #eef2f0; border-radius: 999px; overflow: hidden; }
.dev-prod-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#1f6b4f,#4ba883); }
.dev-prod-bar span.weak { background: linear-gradient(90deg,#e07a3f,#f0a468); }
.dev-prod-flag { font-size: 11.5px; color: #c2410c; margin-top: 5px; }
.dev-prod-flag i { margin-left: 4px; }
.dev-note { font-size: 12.5px; color: #6b7a72; margin-top: 14px; line-height: 1.7; background: #f5f7f6;
  padding: 10px 12px; border-radius: 10px; }
.dev-note i { color: #caa75a; margin-left: 6px; }

/* فجوة القدرة الشرائية */
.dev-aff { display: grid; gap: 8px; }
.dev-aff-row { display: flex; justify-content: space-between; font-size: 13px; color: #46564f; }
.dev-aff-bar { height: 14px; background: #eef2f0; border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.dev-aff-bar span { display: block; height: 100%; border-radius: 999px; }
.dev-aff-bar .cap { background: linear-gradient(90deg,#1f6b4f,#4ba883); }
.dev-aff-bar .sup { background: linear-gradient(90deg,#b91c1c,#e07a3f); }
.dev-aff-gap { margin-top: 8px; background: #fdf2ef; border: 1px solid #f4d6c9; color: #b91c1c; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; text-align: center; }
.dev-aff-gap i { margin-left: 6px; }

/* جدول الانحراف */
.dev-table, .dev-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.dev-table th, .dev-table td { padding: 9px 8px; text-align: center; border-bottom: 1px solid #eef2f0; }
.dev-table thead th { background: #0a3d2c; color: #fff; font-weight: 600; font-size: 12px; }
.dev-table thead th:first-child { border-top-right-radius: 8px; }
.dev-table thead th:last-child { border-top-left-radius: 8px; }
.dev-seg { font-weight: 700; color: #0a3d2c; }
.dev-band { font-size: 11.5px; color: #6b7a72; }
.dev-pill { display: inline-block; color: #fff; font-weight: 700; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.dev-table tr.dev-total td, .dev-matrix tr.dev-total td { background: #f0f5f2; font-weight: 800; color: #0a3d2c; }

/* احتمالية الشراء */
.dev-prob { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.dev-prob-ring { width: 130px; height: 130px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(#1f6b4f 0% 30%, #eef2f0 30% 100%); display: flex; align-items: center; justify-content: center; position: relative; }
.dev-prob-ring::after { content: ''; position: absolute; inset: 14px; background: #fff; border-radius: 50%; }
.dev-prob-big { position: relative; z-index: 1; font-size: 30px; font-weight: 800; color: #0a3d2c; }
.dev-prob-cap { position: relative; z-index: 1; font-size: 10.5px; color: #6b7a72; text-align: center; width: 80px; margin-top: 2px; }
.dev-prob-stats { flex: 1; min-width: 200px; display: grid; gap: 8px; }
.dev-prob-stat { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #46564f; }
.dev-prob-stat strong { margin-right: auto; color: #0a3d2c; }
.dev-prob-stat.total { border-top: 1px dashed #d8e0db; padding-top: 8px; font-weight: 700; }
.dev-prob-stat .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

/* مصفوفة الطلب */
.dev-matrix th, .dev-matrix td { padding: 7px 6px; text-align: center; border: 1px solid #eef2f0; }
.dev-matrix thead th { background: #155c42; color: #fff; font-weight: 600; font-size: 11.5px; }
.dev-matrix .mx-fam { font-size: 10px; opacity: .8; font-weight: 400; }
.dev-matrix .mx-cat { text-align: right; background: #f7faf8; min-width: 120px; }
.dev-matrix .mx-band { font-size: 10px; color: #8a978f; font-weight: 400; }
.dev-matrix .mx-total { font-weight: 800; color: #0a3d2c; background: #f0f5f2; }

/* بطاقات المدن */
.dev-city { background: #fff; border: 1px solid #e8ede9; border-radius: 14px; padding: 16px;
  box-shadow: 0 6px 16px rgba(10,61,44,.04); }
.dev-city-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dev-city-name { font-weight: 800; color: #0a3d2c; font-size: 15px; }
.dev-city-dev { font-size: 11px; background: #fdf2ef; color: #b91c1c; padding: 2px 8px; border-radius: 999px; }
.dev-city-gap { font-size: 19px; font-weight: 800; color: #b91c1c; margin-bottom: 6px; }
.dev-city-meta { display: flex; gap: 14px; font-size: 12px; color: #6b7a72; margin-bottom: 8px; }
.dev-city-bar { height: 12px; background: #eef2f0; border-radius: 999px; position: relative; overflow: hidden; margin-bottom: 10px; }
.dev-city-bar span { display: block; height: 100%; background: linear-gradient(90deg,#1f6b4f,#4ba883); border-radius: 999px; }
.dev-city-bar em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-style: normal; color: #0a3d2c; font-weight: 700; }
.dev-city-find { font-size: 12px; color: #56655d; line-height: 1.7; margin-bottom: 6px; }
.dev-city-rec { font-size: 12px; color: #2a3a33; line-height: 1.7; background: #fbf9f3; border-radius: 8px; padding: 7px 9px; }
.dev-city-find i, .dev-city-rec i { margin-left: 5px; }

/* الوضع الليلي */
body.dark .dev-kpi, body.dark .dev-city { background: #102a20; border-color: #1c3a2c; }
body.dark .dev-kpi-val, body.dark .dev-step-title, body.dark .dev-seg, body.dark .dev-city-name,
body.dark .dev-prob-big, body.dark .mx-total, body.dark .dev-insights-h { color: #e3cf9a; }
body.dark .dev-step, body.dark .dev-matrix .mx-cat, body.dark .dev-note, body.dark .dev-city-rec { background: #0c2218; }
body.dark .dev-table td, body.dark .dev-matrix td, body.dark .dev-step { border-color: #1c3a2c; }

/* شريط اختيار المدينة */
.dev-citybar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: linear-gradient(135deg,#0a3d2c,#155c42); border-radius: 14px; padding: 14px 18px;
  margin: 18px 0; box-shadow: 0 8px 22px rgba(10,61,44,.18); }
.dev-citybar-lbl { color: #f2ead7; font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.dev-city-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-city-tab { cursor: pointer; border: 1px solid rgba(202,167,90,.45); background: rgba(255,255,255,.08);
  color: #f4eeDF; font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 999px;
  transition: all .18s ease; backdrop-filter: blur(2px); }
.dev-city-tab:hover { background: rgba(202,167,90,.22); border-color: #caa75a; transform: translateY(-1px); }
.dev-city-tab.active { background: #caa75a; border-color: #caa75a; color: #0a3d2c; font-weight: 800;
  box-shadow: 0 4px 12px rgba(202,167,90,.4); }

/* البطاقات القابلة للنقر */
.dev-city-clickable { cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.dev-city-clickable:hover { transform: translateY(-4px); border-color: #caa75a;
  box-shadow: 0 14px 30px rgba(10,61,44,.14); }
.dev-city-cta { margin-top: 9px; font-size: 11.5px; font-weight: 700; color: #b08a3c;
  display: flex; align-items: center; gap: 6px; }
.dev-city-cta i { font-size: 11px; }

body.dark .dev-city-tab { color: #f4eeDF; }
body.dark .dev-city-cta { color: #e3cf9a; }
body.dark .dev-city-clickable:hover { border-color: #caa75a; }

/* وصف فرعي للبطاقات + شارة ناعمة */
.dev-sub { font-size: 12.5px; color: #6b7a72; line-height: 1.7; margin: 2px 0 12px; }
.badge-soft { background: #f0f5f2; color: #1f6b4f; font-size: 10.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; }
body.dark .dev-sub { color: #93a79c; }
body.dark .badge-soft { background: #0c2218; color: #7cc4a6; }

/* أعلام التنبيه (ضعف الخارطة) */
.dev-flags { margin-top: 10px; }
.dev-flag { font-size: 12px; line-height: 1.7; color: #8a5a16; background: #fdf6e9;
  border: 1px dashed #e0c483; border-radius: 10px; padding: 9px 12px; }
.dev-flag i { color: #caa75a; margin-left: 6px; }
.dev-flag b { color: #b91c1c; }
body.dark .dev-flag { background: #2a2110; border-color: #4a3a1a; color: #e3cf9a; }

/* مؤشر نضج الطلب */
.dev-maturity { display: grid; gap: 12px; margin-top: 6px; }
.dev-mat-row { display: grid; grid-template-columns: 130px 1fr 170px; align-items: center; gap: 12px; }
.dev-mat-name { font-size: 13.5px; font-weight: 700; color: #0a3d2c; }
.dev-mat-name i { color: #caa75a; }
.dev-mat-bar { position: relative; height: 24px; background: #eef2f0; border-radius: 999px; overflow: hidden; }
.dev-mat-fill { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg,#9aa3a0,#b7c0bb); transition: width 1s cubic-bezier(.2,.8,.2,1); width: 0; }
.dev-mat-fill.green { background: linear-gradient(90deg,#1f6b4f,#4ba883); }
.dev-mat-fill.gold { background: linear-gradient(90deg,#a9842f,#e3c074); }
.dev-mat-bar em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 11.5px; font-weight: 800; color: #0a3d2c; }
.dev-mat-meta { font-size: 11.5px; color: #56655d; text-align: left; font-weight: 700; }
.dev-mat-meta span { color: #9aa3a0; font-weight: 400; }
@media (max-width: 640px) {
  .dev-mat-row { grid-template-columns: 1fr; gap: 4px; }
  .dev-mat-meta { text-align: right; }
}
body.dark .dev-mat-name { color: #e3cf9a; }
body.dark .dev-mat-bar { background: #0c2218; }
body.dark .dev-mat-bar em { color: #eaf4ef; }
body.dark .dev-mat-meta { color: #93a79c; }

/* أكورديون إرشادات الوزارة */
.dev-notes-acc { display: grid; gap: 10px; margin-top: 6px; }
.dev-acc { border: 1px solid #e8ede9; border-radius: 12px; overflow: hidden; background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease; }
.dev-acc.open { border-color: #caa75a; box-shadow: 0 6px 18px rgba(10,61,44,.06); }
.dev-acc-head { width: 100%; display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: none; border: none; padding: 14px 16px; text-align: right; font-family: inherit; }
.dev-acc-head:hover { background: #f9fbfa; }
.dev-acc-title { font-size: 14px; font-weight: 800; color: #0a3d2c; flex: 1; }
.dev-acc-tags { display: flex; gap: 6px; }
.dev-acc-tag { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: #fdf2ef; color: #b91c1c; white-space: nowrap; }
.dev-acc-tag.mat { background: #eef7f2; color: #1f6b4f; }
.dev-acc-arrow { color: #9aa3a0; transition: transform .25s ease; }
.dev-acc.open .dev-acc-arrow { transform: rotate(180deg); color: #caa75a; }
.dev-acc-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.dev-acc.open .dev-acc-body { max-height: 700px; }
.dev-acc-list { margin: 0; padding: 4px 30px 10px; counter-reset: note; list-style: none; }
.dev-acc-list li { position: relative; font-size: 12.5px; color: #2a3a33; line-height: 1.85;
  padding: 5px 0 5px 0; border-bottom: 1px dashed #eef2f0; }
.dev-acc-list li:last-child { border-bottom: none; }
.dev-acc-list li::before { counter-increment: note; content: counter(note);
  display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px;
  margin-left: 9px; border-radius: 50%; background: #f0f5f2; color: #1f6b4f;
  font-size: 10.5px; font-weight: 800; vertical-align: middle; }
.dev-acc-cap { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 30px 14px;
  border-top: 1px solid #f0f3f1; }
.dev-acc-cap span { font-size: 11.5px; color: #56655d; line-height: 1.6; }
.dev-acc-cap i { color: #caa75a; margin-left: 5px; }
body.dark .dev-acc { background: #102a20; border-color: #1c3a2c; }
body.dark .dev-acc-head:hover { background: #0c2218; }
body.dark .dev-acc-title { color: #e3cf9a; }
body.dark .dev-acc-list li { color: #c8d6cf; border-color: #1c3a2c; }
body.dark .dev-acc-list li::before { background: #0c2218; color: #7cc4a6; }
body.dark .dev-acc-cap { border-color: #1c3a2c; }
body.dark .dev-acc-cap span { color: #93a79c; }

/* ============================================================
   التبويب الاستراتيجي: صحة السوق + محرّك «أين أبني؟»
   ============================================================ */
.strat-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px;
  background: linear-gradient(125deg, #0a3d2c 0%, #11543c 55%, #0a3d2c 100%);
  color: #fff; box-shadow: 0 14px 36px -16px rgba(10,61,44,.55); }
.strat-hero::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 88% 18%, rgba(202,167,90,.28), transparent 45%);
  pointer-events: none; }
.strat-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px;
  background: rgba(202,167,90,.18); color: #e9d6a6; border: 1px solid rgba(202,167,90,.35);
  padding: 5px 13px; border-radius: 999px; font-weight: 600; }
.strat-sub-hero { color: #cfe0d8; font-size: 13.5px; line-height: 1.9; max-width: 64rem; margin-top: 4px; }
.strat-sub-hero strong { color: #e9d6a6; }

/* بطاقات صحة السوق */
.strat-health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 6px; }
.strat-health-card { border: 1px solid #e3e9e6; border-radius: 16px; padding: 16px 16px 14px;
  background: #fff; border-top: 4px solid var(--tone); box-shadow: 0 6px 18px -12px rgba(10,61,44,.3);
  display: flex; flex-direction: column; gap: 13px; transition: transform .2s, box-shadow .2s; }
.strat-health-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(10,61,44,.4); }
.strat-health-top { display: flex; align-items: center; gap: 12px; }
.strat-rank { font-size: 13px; font-weight: 800; color: #9aa8a1; min-width: 30px; }
.strat-city { flex: 1; }
.strat-city h4 { font-size: 17px; font-weight: 800; color: #0a3d2c; margin: 0 0 4px; }
.strat-grade { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; }
.strat-score-ring { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.strat-score-ring::before { content: ''; position: absolute; inset: 6px; background: #fff; border-radius: 50%; }
.strat-score-ring span { position: relative; font-size: 18px; font-weight: 800; color: var(--tone); }
.strat-dims { display: grid; gap: 8px; }
.strat-dim { display: grid; grid-template-columns: 90px 1fr 28px; align-items: center; gap: 8px; }
.strat-dim-lbl { font-size: 11px; color: #56655d; white-space: nowrap; }
.strat-dim-lbl i { color: var(--tone); margin-left: 4px; font-size: 10px; }
.strat-dim-bar { height: 7px; background: #eef2f0; border-radius: 4px; overflow: hidden; }
.strat-dim-bar b { display: block; height: 100%; border-radius: 4px; transition: width .8s ease; }
.strat-dim-val { font-size: 12px; font-weight: 700; color: #2a3a32; text-align: left; }
.strat-headline { font-size: 11.5px; color: #5a6b62; background: var(--tone-bg); border-radius: 9px;
  padding: 8px 11px; line-height: 1.7; }
.strat-headline i { color: var(--tone); margin-left: 5px; }

/* مصفوفة الفرص */
.strat-matrix-tbl { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 12.5px; }
.strat-matrix-tbl th { background: #0a3d2c; color: #e9d6a6; font-weight: 700; padding: 9px 8px;
  border-radius: 8px; font-size: 11.5px; }
.strat-matrix-tbl th:first-child { background: transparent; color: #56655d; text-align: right; }
.strat-mx-city { font-weight: 700; color: #0a3d2c; background: #f1f5f3; border-radius: 8px;
  padding: 9px 12px; white-space: nowrap; }
.strat-mx-cell { text-align: center; font-weight: 800; color: #fff; border-radius: 8px; padding: 11px 6px;
  cursor: default; transition: transform .15s; }
.strat-mx-cell:hover { transform: scale(1.08); }
.cell-low  { background: #cdd9d3; color: #4a5a52; }
.cell-mid  { background: #7fb89e; }
.cell-high { background: #2f8a63; }
.cell-top  { background: #0a3d2c; box-shadow: inset 0 0 0 2px #caa75a; }
.strat-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 12px; color: #56655d; }
.strat-legend span { display: inline-flex; align-items: center; gap: 6px; }
.strat-dot { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.strat-dot.dot-low { background: #cdd9d3; }
.strat-dot.dot-mid { background: #7fb89e; }
.strat-dot.dot-high { background: #2f8a63; }
.strat-dot.dot-top { background: #0a3d2c; box-shadow: inset 0 0 0 2px #caa75a; }

/* أعلى الفرص */
.strat-opps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 13px; margin-top: 6px; }
.strat-opp { display: flex; gap: 13px; align-items: stretch; border: 1px solid #e3e9e6; border-radius: 14px;
  padding: 13px 14px; background: #fff; border-right: 4px solid var(--tone);
  box-shadow: 0 5px 16px -12px rgba(10,61,44,.3); transition: transform .2s; }
.strat-opp:hover { transform: translateX(-3px); }
.strat-opp-rank { font-size: 20px; font-weight: 800; color: var(--tone); min-width: 30px;
  display: grid; place-items: center; }
.strat-opp-body { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.strat-opp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.strat-opp-head h4 { font-size: 14.5px; font-weight: 700; color: #0a3d2c; margin: 0; }
.strat-opp-cat { color: #1f6b4f; font-weight: 800; }
.strat-opp-prio { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.strat-opp-rationale { font-size: 11.5px; color: #56655d; line-height: 1.7; }
.strat-opp-bar { position: relative; height: 18px; background: #eef2f0; border-radius: 6px; overflow: hidden; }
.strat-opp-bar b { display: block; height: 100%; border-radius: 6px; transition: width .8s ease; }
.strat-opp-bar em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; color: #2a3a32; font-style: normal; }

@media (max-width: 640px) {
  .strat-dim { grid-template-columns: 76px 1fr 24px; }
  .strat-matrix-tbl { font-size: 11px; }
}

/* الوضع الليلي */
body.dark .strat-health-card { background: #102a20; border-color: #1c3a2c; }
body.dark .strat-city h4 { color: #e8f3ee; }
body.dark .strat-dim-lbl { color: #93a79c; }
body.dark .strat-dim-bar { background: #1c3a2c; }
body.dark .strat-dim-val { color: #c8d6cf; }
body.dark .strat-headline { color: #b6c8bf; }
body.dark .strat-score-ring::before { background: #102a20; }
body.dark .strat-matrix-tbl th:first-child { color: #93a79c; }
body.dark .strat-mx-city { background: #0c2218; color: #e3cf9a; }
body.dark .cell-low { background: #2a4438; color: #aebeb5; }
body.dark .strat-legend { color: #93a79c; }
body.dark .strat-opp { background: #102a20; border-color: #1c3a2c; }
body.dark .strat-opp-head h4 { color: #e8f3ee; }
body.dark .strat-opp-rationale { color: #93a79c; }
body.dark .strat-opp-bar { background: #1c3a2c; }
body.dark .strat-opp-bar em { color: #d4e2db; }
