/* ===================================================================
   اللوحة الاستراتيجية — MOI Strategic Board
   Design canvas: 15360 x 5450 (video wall), scaled to fit any preview
   Dark command-center theme · Arabic RTL · colorblind-safe
   =================================================================== */

@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-arabic-400.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-arabic-500.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-arabic-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-latin-400.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-latin-500.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF; }

:root {
  /* surfaces */
  --page: #0a0e15;
  --surface: #141a24;        /* validated chart surface */
  --surface-2: #1b2331;
  --surface-3: #232d3f;
  /* ink */
  --ink: #f4f6f9;
  --ink-2: #b6bfcc;
  --muted: #7d8798;
  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  /* identity */
  --gold: #c9a45c;
  --gold-bright: #e6c88a;
  --gold-dim: rgba(201,164,92,0.28);
  /* categorical series — validated dark set on --surface */
  --s1: #3987e5;  /* blue */
  --s2: #d95926;  /* orange */
  --s3: #199e70;  /* aqua-green */
  --s4: #c98500;  /* yellow */
  --s5: #d55181;  /* magenta */
  --s6: #008300;  /* green */
  --s7: #9085e9;  /* violet */
  --s8: #e66767;  /* red */
  /* status — fixed, never themed */
  --st-good: #0ca30c;
  --st-warn: #fab219;
  --st-serious: #ec835a;
  --st-critical: #d03b3b;
  /* stage geometry */
  --stage-w: 15360px;
  --stage-h: 5450px;
  --topbar-h: 220px;
  --ticker-h: 160px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }

body {
  font-family: 'Plex Arabic', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
}

/* ---------- stage scaling + pan/zoom الكلي ---------- */
#stage-wrap { position: fixed; inset: 0; overflow: hidden; background: #000; cursor: grab; }
#stage-wrap.grabbing { cursor: grabbing; }
#stage-mover { position: absolute; top: 0; left: 0; }
#stage {
  width: var(--stage-w); height: var(--stage-h);
  background:
    radial-gradient(ellipse 60% 80% at 50% -10%, rgba(57,135,229,0.07), transparent 60%),
    radial-gradient(ellipse 45% 60% at 88% 110%, rgba(201,164,92,0.05), transparent 60%),
    var(--page);
  position: relative;
  transform-origin: center center;
  flex: none;
  overflow: hidden;
}

#keys-hint {
  position: fixed; bottom: 10px; inset-inline-start: 14px; z-index: 99;
  font-size: 12px; color: #667; font-family: 'Plex Arabic', sans-serif;
  opacity: .7; pointer-events: none;
}

/* ---------- top bar ---------- */
#topbar {
  position: absolute; top: 0; right: 0; left: 0; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 80px; gap: 60px;
  border-bottom: 2px solid var(--line);
  background: linear-gradient(180deg, rgba(20,26,36,0.95), rgba(20,26,36,0.6));
}
.tb-brand { display: flex; align-items: center; gap: 44px; min-width: 3000px; }
.tb-emblem { height: 150px; width: auto; filter: drop-shadow(0 0 24px rgba(201,164,92,0.35)); }
.tb-ministry { font-size: 44px; font-weight: 500; color: var(--gold-bright); letter-spacing: 0.5px; }
.tb-board { font-size: 66px; font-weight: 700; margin-top: 6px; }

.tb-tabs { display: flex; gap: 28px; }
.tb-tab {
  font-family: inherit; cursor: pointer; text-align: right;
  background: var(--surface); color: var(--ink-2);
  border: 2px solid var(--line); border-radius: 20px;
  padding: 22px 44px; font-size: 42px; font-weight: 500;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .3s, background .3s, color .3s;
}
.tb-tab .tab-num {
  display: inline-block; font-size: 30px; color: var(--muted);
  border: 1.5px solid var(--line-2); border-radius: 10px; padding: 0 14px; margin-inline-end: 10px;
}
.tb-tab .tab-sub { font-size: 27px; font-weight: 400; color: var(--muted); }
.tb-tab.active { border-color: var(--gold); background: var(--surface-2); color: var(--ink); box-shadow: 0 0 60px rgba(201,164,92,0.12); }
.tb-tab.active .tab-num { color: var(--gold); border-color: var(--gold-dim); }

.tb-status { display: flex; align-items: center; gap: 56px; min-width: 1500px; justify-content: flex-end; }
.tb-sound {
  font-family: inherit; cursor: pointer; font-size: 34px; font-weight: 500;
  color: var(--ink-2); background: var(--surface); border: 2px solid var(--line-2);
  border-radius: 999px; padding: 14px 36px; transition: color .3s, border-color .3s;
}
.tb-sound.on { color: var(--gold-bright); border-color: var(--gold); background: rgba(201,164,92,0.10); }
.tb-live { display: flex; align-items: center; gap: 18px; font-size: 40px; font-weight: 500; color: var(--st-critical); }
.live-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--st-critical); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(208,59,59,0.5);} 50% { opacity: .55; box-shadow: 0 0 0 18px rgba(208,59,59,0);} }
.tb-clock { font-size: 76px; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.tb-date { font-size: 36px; color: var(--ink-2); }

/* ---------- views ---------- */
.view {
  position: absolute; right: 0; left: 0;
  top: var(--topbar-h); bottom: var(--ticker-h);
  display: none; padding: 40px; gap: 40px;
}
.view.active { display: flex; }

.panel {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 28px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 34px 48px; border-bottom: 2px solid var(--line); flex: none;
}
.panel-head h2 { font-size: 52px; font-weight: 700; }
.panel-tag {
  font-size: 32px; color: var(--gold-bright); background: rgba(201,164,92,0.10);
  border: 1.5px solid var(--gold-dim); padding: 10px 28px; border-radius: 999px; font-weight: 500;
}
.panel-legend { display: flex; gap: 40px; }
.lg-item { display: flex; align-items: center; gap: 14px; font-size: 30px; color: var(--ink-2); }
.lg-swatch { width: 30px; height: 30px; border-radius: 50%; }
.lg-active { background: var(--gold); box-shadow: 0 0 18px var(--gold); }
.lg-done { background: transparent; border: 4px solid var(--st-good); }
.lg-idle { background: var(--surface-3); border: 2px solid var(--line-2); }

/* ---------- view 1 layout ---------- */
#view-scenario { flex-direction: row; }
#panel-map   { width: 4530px; flex: none; position: relative; }
#panel-graph { flex: 1; }
#panel-kpi   { width: 2620px; flex: none; }

#map { flex: 1; background: #0c1118; }
.leaflet-container { background: #0c1118; font-family: inherit; }

/* case card overlay on map */
.case-card {
  position: absolute; bottom: 48px; right: 48px; left: 48px; z-index: 900;
  background: rgba(20,26,36,0.92); border: 2px solid var(--gold-dim); border-radius: 24px;
  padding: 36px 44px; backdrop-filter: blur(6px);
  transition: opacity .5s, transform .5s;
}
.case-card.hidden { opacity: 0; transform: translateY(40px); pointer-events: none; }
.cc-head { display: flex; justify-content: space-between; margin-bottom: 14px; }
.cc-id { font-size: 36px; font-weight: 700; color: var(--gold-bright); direction: ltr; }
.cc-clock { font-size: 36px; font-variant-numeric: tabular-nums; color: var(--ink-2); direction: ltr; }
.cc-title { font-size: 46px; font-weight: 700; margin-bottom: 8px; }
.cc-desc { font-size: 33px; color: var(--ink-2); line-height: 1.5; }

/* سطر الحوار المنطوق (ترجمة فورية) */
.cc-quote {
  display: none; margin-top: 18px; padding: 18px 26px;
  background: rgba(201,164,92,0.10); border-inline-start: 6px solid var(--gold);
  border-radius: 12px; font-size: 34px; line-height: 1.55; color: var(--ink);
}
.cc-quote.show { display: block; }
.cc-quote .cc-speaker {
  display: inline-block; color: var(--gold-bright); font-weight: 700; margin-inline-end: 12px;
}

/* شريحة «يتحدث الآن» فوق علامة الخريطة */
.mk-speak {
  display: none; position: absolute; bottom: 106%; right: 50%; transform: translateX(50%);
  align-items: center; gap: 10px; color: #0a0e15;
  background: var(--gold-bright); border-radius: 999px; padding: 8px 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45); white-space: nowrap;
}
.mk-badge.speaking .mk-speak { display: flex; }
.mk-speak svg { width: 30px; height: 30px; }
.sp-bars { display: inline-flex; align-items: flex-end; gap: 4px; height: 26px; }
.sp-bars i { width: 6px; background: #0a0e15; border-radius: 3px; animation: spbar 0.9s infinite ease-in-out; }
.sp-bars i:nth-child(1) { animation-delay: 0s; }
.sp-bars i:nth-child(2) { animation-delay: 0.25s; }
.sp-bars i:nth-child(3) { animation-delay: 0.5s; }
@keyframes spbar { 0%, 100% { height: 8px; } 50% { height: 26px; } }
.mk-badge.speaking .mk-ring { box-shadow: 0 0 0 8px rgba(230,200,138,0.45), 0 6px 30px rgba(0,0,0,0.6); }

/* map marker badges */
.mk-badge { display: grid; place-items: center; }
.mk-badge .mk-ring {
  width: 100%; height: 100%; border-radius: 50%;
  background: #fbfaf7; border: 5px solid var(--gold);
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 6px 30px rgba(0,0,0,0.6);
}
.mk-badge img { width: 72%; height: 72%; object-fit: contain; }
.mk-badge .mk-label {
  position: absolute; top: 104%; right: 50%; transform: translateX(50%);
  white-space: nowrap; font-size: 26px; font-weight: 500; color: #fff;
  background: rgba(10,14,21,0.85); padding: 4px 18px; border-radius: 999px;
  border: 1px solid var(--line-2);
}
.mk-pulse::after {
  content: ''; position: absolute; inset: -12px; border-radius: 50%;
  border: 4px solid var(--gold); animation: mkpulse 1.8s infinite; pointer-events: none;
}
@keyframes mkpulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.mk-critical .mk-ring { border-color: var(--st-critical); }
.mk-critical.mk-pulse::after { border-color: var(--st-critical); }
.mk-good .mk-ring { border-color: var(--st-good); }

/* call wave rings at citizen */
.call-wave { position: relative; }
.call-wave::before, .call-wave::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 5px solid rgba(230,200,138,0.9); animation: wave 2.2s infinite;
}
.call-wave::after { animation-delay: 1.1s; }
@keyframes wave { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }

/* ---------- network graph ---------- */
#graphHost { flex: 1; position: relative; }
#graphHost svg { width: 100%; height: 100%; display: block; }

.gnode { cursor: default; }
.gnode .gn-circle {
  fill: var(--surface-2); stroke: var(--line-2); stroke-width: 3;
  transition: stroke .4s, filter .4s;
}
.gnode.idle { opacity: .55; }
.gnode.active .gn-circle { stroke: var(--gold); stroke-width: 7; filter: drop-shadow(0 0 34px rgba(201,164,92,0.65)); }
.gnode.done .gn-circle { stroke: var(--st-good); stroke-width: 5; }
.gnode.idle, .gnode.active, .gnode.done { transition: opacity .5s; }
.gn-name { fill: var(--ink); font-size: 40px; font-weight: 700; text-anchor: middle; }
.gn-entity { fill: var(--gold-bright); font-size: 29px; font-weight: 500; text-anchor: middle; }
.gn-count { fill: var(--ink-2); font-size: 31px; font-weight: 500; text-anchor: middle; font-variant-numeric: tabular-nums; }
.gn-status-ic { opacity: 0; transition: opacity .4s; }
.gnode.done .gn-status-ic { opacity: 1; }

.gedge { stroke: var(--line-2); stroke-width: 4; fill: none; transition: stroke .5s; }
.gedge.feed { stroke-dasharray: 4 14; opacity: .45; }
.gedge.lit { stroke: var(--gold); stroke-width: 6; filter: drop-shadow(0 0 12px rgba(201,164,92,0.5)); }
.gedge.passed { stroke: rgba(12,163,12,0.65); }

.gparticle { fill: var(--gold-bright); }

.gcluster { fill: rgba(255,255,255,0.022); stroke: var(--line); stroke-width: 2; rx: 40; }
.gcluster-label { fill: var(--muted); font-size: 34px; font-weight: 500; }
.gcluster-label .num { fill: var(--gold); font-weight: 700; }

/* زر الصوت ينبض حتى يُفعَّل */
.tb-sound:not(.on) { animation: soundPulse 2s infinite; }
@keyframes soundPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,164,92,0.45); border-color: var(--gold); }
  50% { box-shadow: 0 0 0 16px rgba(201,164,92,0); }
}

/* بطاقة تفاصيل العقدة (تمرير/نقر) */
.node-detail {
  position: absolute; z-index: 60; width: 760px;
  background: rgba(20,26,36,0.97); border: 2px solid var(--gold-dim); border-radius: 24px;
  padding: 30px 36px; opacity: 0; pointer-events: none;
  transition: opacity .25s; box-shadow: 0 20px 80px rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}
.node-detail.show { opacity: 1; }
.nd-head { display: flex; align-items: center; gap: 24px; border-bottom: 1.5px solid var(--line); padding-bottom: 20px; margin-bottom: 20px; }
.nd-num {
  flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(201,164,92,0.12); border: 2px solid var(--gold-dim);
  color: var(--gold-bright); font-size: 36px; font-weight: 700;
}
.nd-name { font-size: 42px; font-weight: 700; }
.nd-ent { font-size: 28px; color: var(--gold-bright); margin-top: 4px; }
.nd-pin { margin-inline-start: auto; font-size: 24px; color: var(--muted); }
.nd-kpis { display: flex; gap: 20px; margin-bottom: 20px; }
.nd-kpi { flex: 1; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 16px; padding: 18px 24px; }
.nd-kv { font-size: 52px; font-weight: 700; }
.nd-kl { font-size: 25px; color: var(--muted); margin-top: 2px; }
.nd-sec h5 { font-size: 28px; color: var(--gold-bright); font-weight: 700; margin-bottom: 10px; }
.nd-sec { margin-bottom: 14px; }
.nd-chart { height: 330px; }
.nd-sec .ho-row { font-size: 26px; }

/* handoff popup */
.handoff {
  position: absolute; z-index: 50; pointer-events: none;
  background: rgba(27,35,49,0.97); border: 2px solid var(--gold-dim); border-radius: 20px;
  padding: 22px 32px; transform: translate(50%, -50%) scale(.8); opacity: 0;
  transition: opacity .4s, transform .4s; min-width: 520px;
}
.handoff.show { opacity: 1; transform: translate(50%, -50%) scale(1); }
.handoff h4 { font-size: 30px; color: var(--gold-bright); margin-bottom: 12px; font-weight: 700; }
.ho-row { display: flex; justify-content: space-between; gap: 30px; font-size: 29px; padding: 5px 0; }
.ho-row .ho-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.ho-flow  .ho-kind { color: var(--s1); }
.ho-wait  .ho-kind { color: var(--s4); }
.ho-hold  .ho-kind { color: var(--s5); }
.ho-kind::before { content: '◆ '; font-size: 22px; }
.ho-wait .ho-kind::before { content: '▲ '; }
.ho-hold .ho-kind::before { content: '■ '; }

/* ---------- KPI rail ---------- */
#kpiRail { flex: 1; display: flex; flex-direction: column; gap: 26px; padding: 36px; overflow: hidden; }
.kpi-tile {
  background: var(--surface-2); border: 2px solid var(--line); border-radius: 22px;
  padding: 30px 38px; transition: border-color .5s, box-shadow .5s;
}
.kpi-tile.hot { border-color: var(--gold); box-shadow: 0 0 40px rgba(201,164,92,0.15); }
.kpi-label { font-size: 33px; color: var(--ink-2); font-weight: 500; }
.kpi-value { font-size: 88px; font-weight: 700; line-height: 1.15; }
.kpi-value .unit { font-size: 38px; color: var(--muted); font-weight: 500; }
.kpi-sub { font-size: 28px; color: var(--muted); margin-top: 4px; }
.kpi-sub .delta-good { color: var(--st-good); }
.kpi-sub .delta-bad { color: var(--st-critical); }
.kpi-hero { border-color: var(--gold-dim); background: linear-gradient(160deg, rgba(201,164,92,0.10), var(--surface-2) 55%); }
.kpi-hero .kpi-value { font-size: 132px; color: var(--gold-bright); direction: ltr; text-align: right; }

.kpi-score { display: flex; align-items: center; gap: 36px; }
.kpi-score svg { flex: none; }
.score-track { stroke: var(--surface-3); stroke-width: 16; fill: none; }
.score-fill { stroke: var(--st-good); stroke-width: 16; fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.2s ease; }
.score-num { fill: var(--ink); font-size: 74px; font-weight: 700; text-anchor: middle; }

/* ---------- لوحة رؤى الذكاء الاصطناعي (عمود المؤشرات، أسفل) ---------- */
#kpiRail { flex: 1.1; }
#aiPanel {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  border-top: 2px solid var(--line); background: rgba(201,164,92,0.03);
}
.ai-head { display: flex; align-items: center; gap: 20px; padding: 26px 40px; border-bottom: 1.5px solid var(--line); flex: none; }
.ai-head h3 { font-size: 38px; font-weight: 700; color: var(--gold-bright); }
.ai-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); animation: pulse 2s infinite; flex: none; }
#aiFeed { flex: 1; overflow: hidden; padding: 26px 32px; display: flex; flex-direction: column; gap: 22px; }
.ai-card {
  background: var(--surface-2); border: 2px solid var(--line); border-radius: 18px;
  padding: 24px 30px; animation: aiIn .5s ease;
}
@keyframes aiIn { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }
.ai-card-head { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; flex-wrap: wrap; }
.ai-chip { font-size: 26px; font-weight: 700; padding: 4px 18px; border-radius: 999px; border: 2px solid; }
.ai-bad   { border-color: rgba(236,131,90,0.5); }
.ai-bad   .ai-chip { color: var(--st-serious); border-color: var(--st-serious); }
.ai-warn  .ai-chip { color: var(--st-warn); border-color: var(--st-warn); }
.ai-good  .ai-chip { color: var(--st-good); border-color: var(--st-good); }
.ai-final { border-color: var(--gold-dim); background: rgba(201,164,92,0.08); }
.ai-final .ai-chip { color: var(--gold-bright); border-color: var(--gold); }
.ai-node { font-size: 26px; color: var(--muted); }
.ai-title { font-size: 33px; font-weight: 700; margin-bottom: 8px; }
.ai-why { font-size: 27px; color: var(--ink-2); line-height: 1.5; }
.ai-rec { font-size: 27px; margin-top: 10px; line-height: 1.5; }
.ai-rec span { color: var(--gold-bright); font-weight: 700; }

/* ---------- ticker ---------- */
#ticker {
  position: absolute; bottom: 0; right: 0; left: 0; height: var(--ticker-h);
  display: flex; align-items: stretch; border-top: 2px solid var(--line);
  background: var(--surface);
}
.ticker-label {
  flex: none; display: grid; place-items: center; padding: 0 64px;
  font-size: 42px; font-weight: 700; color: var(--gold-bright);
  border-inline-end: 2px solid var(--line); background: var(--surface-2);
}
.ticker-track { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker-inner { display: flex; gap: 120px; white-space: nowrap; will-change: transform; }
.tk-item { display: flex; align-items: center; gap: 24px; font-size: 38px; color: var(--ink-2); }
.tk-item .tk-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--s3); flex: none; }
.tk-item.tk-new { color: var(--ink); font-weight: 500; }
.tk-item.tk-new .tk-dot { background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.tk-item .tk-id { color: var(--gold-bright); font-weight: 700; direction: ltr; }

/* ---------- view 2 : overview ---------- */
#view-overview { flex-direction: column; }
#ov-kpiband { flex: none; height: 420px; display: flex; gap: 40px; }
.ovk-tile {
  flex: 1; background: var(--surface); border: 2px solid var(--line); border-radius: 26px;
  padding: 40px 56px; display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.ovk-tile .kpi-value { font-size: 118px; }
.ovk-tile.gold .kpi-value { color: var(--gold-bright); }
#ov-main { flex: 1; display: flex; gap: 40px; min-height: 0; }
#ov-map { width: 3350px; flex: none; }
#uaeMapHost { flex: 1; position: relative; }
#ov-stages { flex: 1; display: flex; gap: 32px; min-width: 0; }
.ov-stage-col { flex: 1; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.ov-stage-head {
  flex: none; background: var(--surface-2); border: 2px solid var(--line); border-radius: 20px;
  padding: 22px 30px;
}
.ov-stage-head .st-num { color: var(--gold); font-weight: 700; font-size: 30px; }
.ov-stage-head .st-name { font-size: 38px; font-weight: 700; margin-top: 4px; }
.chart-card {
  flex: 1; background: var(--surface); border: 2px solid var(--line); border-radius: 22px;
  padding: 26px 30px; display: flex; flex-direction: column; min-height: 0;
}
.chart-card h3 { font-size: 33px; font-weight: 700; flex: none; }
.chart-card .ch-sub { font-size: 25px; color: var(--muted); margin-top: 2px; flex: none; }
.chart-card .ch-body { flex: 1; min-height: 0; margin-top: 14px; }
.chart-card svg { width: 100%; height: 100%; display: block; }

/* ---------- view 3 : office ---------- */
#view-office { flex-direction: row; }
#of-inbox { width: 3150px; flex: none; }
#of-agents { flex: 1; position: relative; }
#of-output { width: 3450px; flex: none; }
#of-kpi { width: 2350px; flex: none; }

#inboxStream { flex: 1; padding: 36px; display: flex; flex-direction: column; gap: 26px; overflow: hidden; }
.memo-card {
  background: var(--surface-2); border: 2px solid var(--line); border-radius: 20px;
  padding: 28px 34px; transition: border-color .4s, transform .5s, opacity .5s;
}
.memo-card.processing { border-color: var(--gold); box-shadow: 0 0 30px rgba(201,164,92,0.15); }
.memo-card.dispatched { opacity: .38; }
.memo-card.entering { transform: translateY(-30px); opacity: 0; }
.mc-head { display: flex; justify-content: space-between; margin-bottom: 10px; }
.mc-ref { font-size: 27px; color: var(--gold-bright); font-weight: 700; direction: ltr; }
.mc-from { font-size: 27px; color: var(--muted); }
.mc-subject { font-size: 36px; font-weight: 500; line-height: 1.4; }
.mc-badges { display: flex; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.badge {
  font-size: 25px; padding: 5px 20px; border-radius: 999px; border: 1.5px solid var(--line-2);
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px;
}
.badge.cls-pol { border-color: var(--s7); color: var(--s7); }
.badge.cls-org { border-color: var(--s1); color: var(--s1); }
.badge.cls-ops { border-color: var(--s3); color: var(--s3); }
.badge.pr-1 { border-color: var(--st-critical); color: var(--st-critical); }
.badge.pr-2 { border-color: var(--st-warn); color: var(--st-warn); }
.badge.pr-3 { border-color: var(--st-good); color: var(--st-good); }

#agentsHost { flex: 1; position: relative; }
#agentsHost svg { width: 100%; height: 100%; display: block; }
.agent-node .an-body { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 3; transition: stroke .4s, filter .4s; }
.agent-node.working .an-body { stroke: var(--gold); stroke-width: 6; filter: drop-shadow(0 0 30px rgba(201,164,92,0.5)); }
.an-name { fill: var(--ink); font-size: 58px; font-weight: 700; text-anchor: middle; }
.an-role { fill: var(--ink-2); font-size: 38px; text-anchor: middle; }
.an-out { fill: var(--gold-bright); font-size: 36px; text-anchor: middle; opacity: 0; transition: opacity .4s; }
.agent-node.working .an-out, .agent-node.done-step .an-out { opacity: 1; }

#approvalTrack { flex: none; height: 200px; border-top: 2px solid var(--line); padding: 26px 60px; }
.at-title { font-size: 30px; color: var(--ink-2); margin-bottom: 18px; }
.at-bar { position: relative; height: 60px; background: var(--surface-2); border-radius: 999px; border: 2px solid var(--line); }
.at-win { position: absolute; top: 0; bottom: 0; background: rgba(201,164,92,0.30); border-radius: 999px; }
.at-win span { position: absolute; top: 110%; right: 50%; transform: translateX(50%); font-size: 25px; color: var(--gold-bright); white-space: nowrap; }
.at-now { position: absolute; top: -14px; bottom: -14px; width: 6px; background: var(--st-critical); border-radius: 3px; }
.at-now span { position: absolute; bottom: 110%; right: 50%; transform: translateX(50%); font-size: 25px; color: var(--st-critical); white-space: nowrap; font-weight: 700; }

#onePager { flex: 1; padding: 40px 48px; display: flex; flex-direction: column; gap: 26px; overflow: hidden; }
.op-sheet {
  flex: 1; background: #f7f4ec; color: #21252e; border-radius: 18px; padding: 48px 56px;
  display: flex; flex-direction: column; gap: 26px; position: relative; overflow: hidden;
}
.op-sheet::before {
  content: ''; position: absolute; top: 0; right: 0; left: 0; height: 12px;
  background: linear-gradient(90deg, var(--gold), #8a6d35);
}
.op-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid rgba(0,0,0,0.12); padding-bottom: 22px; }
.op-head img { height: 110px; }
.op-head .op-ref { font-size: 28px; color: #6b6f78; direction: ltr; text-align: left; }
.op-sheet { justify-content: space-between; }
.op-title { font-size: 52px; font-weight: 700; }
.op-sec h5 { font-size: 34px; color: #8a6d35; font-weight: 700; margin-bottom: 12px; }
.op-sec p { font-size: 38px; line-height: 1.7; }
.op-recommend {
  background: rgba(201,164,92,0.14); border: 2px solid rgba(138,109,53,0.35); border-radius: 14px;
  padding: 24px 30px;
}
.op-badges { display: flex; gap: 16px; }
.op-badges .badge { font-size: 27px; border-width: 2px; }
.op-sign { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; }
.op-sign .sig-line { font-size: 27px; color: #6b6f78; }
.typing::after { content: '▌'; animation: blink 1s infinite; color: #8a6d35; }
@keyframes blink { 50% { opacity: 0; } }

#officeKpis { flex: 1; display: flex; flex-direction: column; gap: 26px; padding: 36px; overflow: hidden; }

/* UAE map (overview) — فقاعات البلاغات فوق خريطة حقيقية */
#uaeMapHost { background: #0c1118; }
.ov-bubble { position: relative; display: grid; place-items: center; }
.ov-bubble-fill {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--s1); border: 3px solid #9ec5f4;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
.ov-bubble-num {
  position: relative; z-index: 1; color: #fff; font-weight: 700; font-size: 40px;
  font-variant-numeric: tabular-nums; text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.ov-bubble-name {
  position: absolute; z-index: 1; white-space: nowrap; color: #fff;
  font-size: 32px; font-weight: 500;
  background: rgba(10,14,21,0.85); border: 1px solid var(--line-2);
  padding: 4px 20px; border-radius: 999px;
}
.ov-side-bottom .ov-bubble-name { top: 104%; }
.ov-side-top .ov-bubble-name { bottom: 104%; }
.ov-side-right .ov-bubble-name { right: 104%; }
.ov-side-left .ov-bubble-name { left: 104%; }

/* generic svg chart text */
.ax { fill: var(--muted); font-size: 26px; font-weight: 400; }
.ax-line { stroke: rgba(255,255,255,0.10); stroke-width: 1; }
.val-label { fill: var(--ink-2); font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cat-label { fill: var(--ink-2); font-size: 27px; }
