/* ============================================================
   لوحة الأداء الاستراتيجي — Executive Bold Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg:        #0c1020;
  --bg-2:      #131929;
  --surface:   #1a2340;
  --surface-2: #21294d;
  --surface-3: #2c3a5e;

  --border:    rgba(255,255,255,0.10);
  --border-2:  rgba(255,255,255,0.20);

  --text-1: #ffffff;
  --text-2: #dde5f4;
  --text-3: #a8b8d4;
  --text-4: #6b7fa0;

  --green:  #2ecc9a;
  --red:    #ff6b6b;
  --orange: #ffb830;
  --blue:   #5b9cf6;
  --purple: #a78bfa;

  --green-dim:  rgba(46,204,154,0.14);
  --red-dim:    rgba(255,107,107,0.14);
  --orange-dim: rgba(255,184,48,0.14);
  --blue-dim:   rgba(91,156,246,0.14);

  --radius:    14px;
  --radius-lg: 20px;

  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --header-h: 80px;
  --font: 'Tajawal', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: hidden; }

body {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  direction: rtl;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  background: var(--bg-2);
  border-bottom: 2px solid rgba(91,156,246,0.40);
  box-shadow: 0 2px 32px rgba(0,0,0,0.6);
}

.topbar-brand { display: flex; align-items: center; gap: 16px; }

.topbar-logo { height: 52px; width: auto; }

.topbar-brand-text { display: flex; flex-direction: column; gap: 2px; }

.topbar-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: 0.02em;
}

.topbar-center { display: flex; align-items: center; justify-content: center; gap: 12px; }

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  direction: ltr;
}

.topbar-clock {
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
  line-height: 1;
  letter-spacing: 2px;
  direction: ltr;
  font-family: Arial, sans-serif;
}

.topbar-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-4);
  direction: rtl;
}

/* SLIDE DOTS */
.dot {
  display: inline-block;
  width: 32px;
  height: 7px;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}
.dot.active { background: var(--blue); width: 42px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.page-body { padding: 24px 32px 48px; min-height: calc(100vh - var(--header-h)); }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border-2);
}

.section-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.section-dot.blue   { background: var(--blue); }
.section-dot.green  { background: var(--green); }
.section-dot.red    { background: var(--red); }
.section-dot.orange { background: var(--orange); }

/* ============================================================
   INSIGHT CARDS — top row
   ============================================================ */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.insight-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 5px; height: 100%;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.insight-card.green { border-color: rgba(46,204,154,0.35); }
.insight-card.green::after  { background: var(--green); }
.insight-card.red   { border-color: rgba(255,107,107,0.35); }
.insight-card.red::after    { background: var(--red); }
.insight-card.blue  { border-color: rgba(91,156,246,0.35); }
.insight-card.blue::after   { background: var(--blue); }
.insight-card.orange { border-color: rgba(255,184,48,0.35); }
.insight-card.orange::after { background: var(--orange); }

.insight-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.insight-number {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  font-family: Arial, sans-serif;
}
.insight-number.green  { color: var(--green); }
.insight-number.red    { color: var(--red); }
.insight-number.blue   { color: var(--blue); }
.insight-number.orange { color: var(--orange); }

.insight-label {
  font-size: 17px;
  color: var(--text-3);
  font-weight: 500;
}

.insight-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-1);
}

/* ============================================================
   PILLS
   ============================================================ */
.pills-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pill.green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(46,204,154,0.35); }
.pill.red    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(255,107,107,0.35); }
.pill.orange { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(255,184,48,0.35); }
.pill.blue   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(91,156,246,0.35); }

/* ============================================================
   RISK BARS
   ============================================================ */
.risk-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.risk-bar-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.risk-bar-label { color: var(--text-3); width: 32px; text-align: right; flex-shrink: 0; }
.risk-bar-track { flex: 1; height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.risk-bar-fill  { height: 100%; border-radius: 4px; }
.risk-bar-count { color: var(--text-1); font-weight: 700; width: 24px; text-align: left; flex-shrink: 0; font-family: Arial, sans-serif; }

/* ============================================================
   ATTENTION GRID
   ============================================================ */
.attention-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.attention-card {
  background: var(--surface);
  border: 1px solid rgba(255,107,107,0.32);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.attention-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 5px; height: 100%;
  background: var(--red);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.attention-card .project-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 10px;
  line-height: 1.4;
}
.attention-card .project-meta {
  font-size: 16px;
  color: var(--text-3);
  margin-bottom: 5px;
}
.delayed-count {
  font-size: 16px;
  color: var(--red);
  font-weight: 700;
  margin-top: 8px;
}

/* ============================================================
   MINI GAUGE WRAP
   ============================================================ */
.mini-gauge-wrap { display: flex; align-items: center; justify-content: center; margin: 8px 0; }

/* ============================================================
   KPI GAUGE CARD
   ============================================================ */
.kpi-gauge-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
}
.kpi-gauge-card .kpi-name {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: var(--text-2);
  line-height: 1.4;
}
.kpi-gauge-card.on-target  { border-color: rgba(46,204,154,0.35); }
.kpi-gauge-card.off-target { border-color: rgba(255,107,107,0.35); }
.kpi-gauge-card.no-reading { opacity: 0.5; }

/* ============================================================
   OBJECTIVES LAYOUT
   ============================================================ */
.objectives-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
  height: calc(100vh - var(--header-h) - 60px);
}
.objectives-col { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }

.obj-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.obj-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.obj-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
  flex: 1;
}
.kpi-badge {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(91,156,246,0.35);
  white-space: nowrap;
}
.obj-kpi-bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.obj-kpi-bar-fill { height: 100%; border-radius: 3px; }

.kpi-gauges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-content: start;
}

/* ============================================================
   ATTENTION SLIDE
   ============================================================ */
.attention-layout { display: grid; grid-template-rows: auto auto; gap: 24px; }

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.milestone-card {
  background: var(--surface);
  border: 1px solid rgba(255,107,107,0.30);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.milestone-card .ms-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
  line-height: 1.4;
}
.milestone-card .ms-project {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.overdue-days {
  font-size: 46px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-family: Arial, sans-serif;
}
.overdue-label { font-size: 14px; color: var(--text-4); margin-top: 4px; }
.ms-due {
  font-size: 13px;
  color: var(--text-4);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,107,107,0.20);
}

/* RISK LIST */
.risk-list { display: flex; flex-direction: column; gap: 10px; }
.risk-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.risk-level-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.risk-level-dot.high   { background: var(--red); }
.risk-level-dot.medium { background: var(--orange); }
.risk-level-dot.low    { background: var(--blue); }
.risk-title   { font-size: 17px; font-weight: 700; color: var(--text-1); flex: 1; }
.risk-project { font-size: 14px; color: var(--text-3); }

/* OK CARD */
.ok-card {
  background: rgba(46,204,154,0.08);
  border: 1px solid rgba(46,204,154,0.30);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
}

/* ============================================================
   COMPLETION BAR
   ============================================================ */
.completion-bar-wrap { height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin: 6px 0 2px; }
.completion-bar { height: 100%; border-radius: 4px; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.completed  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(46,204,154,0.35); }
.badge.ontrack    { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(91,156,246,0.35); }
.badge.delayed    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(255,107,107,0.35); }
.badge.notstarted { background: rgba(120,130,150,0.12); color: var(--text-3); border: 1px solid rgba(120,130,150,0.25); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
