/* ============================================================
   expro — Executive TV Dashboard · Premium Light
   ============================================================ */

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

:root {
  /* Backgrounds — warm off-white, not stark */
  --bg:        #f2f4f7;
  --bg-2:      #ffffff;
  --surface:   #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #e8edf3;

  /* Borders */
  --border:    rgba(0,0,0,0.07);
  --border-2:  rgba(0,0,0,0.11);

  /* Text */
  --text-1: #1a2e27;
  --text-2: #2e4a3e;
  --text-3: #6b8078;
  --text-4: #9ab0a8;

  /* Brand */
  --gold:       #c9940a;
  --gold-light: #e8a910;
  --gold-dim:   rgba(201,148,10,0.10);

  /* Status — rich, not pastel */
  --green:  #0d7a50;
  --red:    #c0392b;
  --orange: #c07a0a;
  --blue:   #1a5fa0;
  --purple: #5c3d8a;

  --green-dim:  rgba(13,122,80,0.08);
  --red-dim:    rgba(192,57,43,0.08);
  --orange-dim: rgba(192,122,10,0.08);
  --blue-dim:   rgba(26,95,160,0.08);

  --radius:    10px;
  --radius-lg: 16px;

  /* Crisp layered shadow for light mode */
  --shadow:    0 1px 2px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 2px 6px rgba(0,0,0,0.07), 0 10px 30px rgba(0,0,0,0.10);

  --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 — white, gold bottom accent
   ============================================================ */
.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 40px;
  background: var(--surface);
  border-bottom: 3px solid #2e5f52;
  box-shadow: 0 2px 20px rgba(0,0,0,0.09);
}

.topbar-brand { display: flex; align-items: center; gap: 14px; }
.topbar-logo { height: 44px; width: auto; }
.topbar-brand-text { display: flex; flex-direction: column; gap: 1px; }

.topbar-title {
  font-size: 22px;
  font-weight: 800;
  color: #2e5f52;
  letter-spacing: 0.01em;
}

.topbar-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* NAV TABS */
.topbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border);
}

.dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.dot:hover { color: var(--text-1); background: var(--surface); box-shadow: var(--shadow); }
.dot.active {
  background: #2e5f52;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(46,95,82,0.35);
}

/* RIGHT — clock */
.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  direction: ltr;
}

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

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

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

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #2e5f52;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-2);
}

.section-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.section-dot.blue   { background: var(--blue); }
.section-dot.green  { background: var(--green); }
.section-dot.red    { background: var(--red); animation: pulse-red 1.8s ease-in-out infinite; }
.section-dot.orange { background: var(--orange); }

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.60); }
  50%       { box-shadow: 0 0 0 6px rgba(192,57,43,0); }
}

/* ============================================================
   INSIGHT CARDS
   ============================================================ */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}
.insight-grid > * { min-height: 0; }

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

/* Top gradient accent line */
.insight-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.insight-card::before       { background: #2e5f52; }
.insight-card.red::before   { background: var(--red); }
.insight-card.orange::before { 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(--gold); }
.insight-number.orange { color: var(--orange); }

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

.insight-title {
  font-size: 16px;
  font-weight: 700;
  color: #2e5f52;
  letter-spacing: 0.02em;
}

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

.pill {
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pill.green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(13,122,80,0.20); }
.pill.red    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(192,57,43,0.20); }
.pill.orange { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(192,122,10,0.20); }
.pill.blue   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(26,95,160,0.20); }
.pill.grey   { background: rgba(74,112,96,0.08); color: var(--text-3); border: 1px solid rgba(74,112,96,0.16); }

/* ============================================================
   RISK BARS
   ============================================================ */
.risk-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.risk-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.risk-bar-label { color: var(--text-3); width: 36px; text-align: right; flex-shrink: 0; font-weight: 600; }
.risk-bar-track { flex: 1; height: 6px; 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: 20px; text-align: left; flex-shrink: 0; font-family: Arial, sans-serif; }

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

.attention-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.attention-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

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

/* ============================================================
   KPI GAUGE CARD
   ============================================================ */
.kpi-gauge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
  justify-content: space-between;
}
.kpi-gauge-card .kpi-name {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--text-2);
  line-height: 1.4;
}
.kpi-gauge-card.on-target  { border-color: rgba(13,122,80,0.25); }
.kpi-gauge-card.off-target { border-color: rgba(192,57,43,0.25); }
.kpi-gauge-card.no-reading { opacity: 0.45; }

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

.obj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.obj-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.obj-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
  flex: 1;
}
.kpi-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(201,148,10,0.22);
  white-space: nowrap;
}
.obj-kpi-bar { height: 5px; 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: 12px;
  align-content: start;
}

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

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.milestone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}
.milestone-card .ms-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
  line-height: 1.4;
}
.milestone-card .ms-project {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.overdue-days {
  font-size: 42px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-family: Arial, sans-serif;
}
.overdue-label { font-size: 12px; color: var(--text-2); margin-top: 3px; font-weight: 600; }
.ms-due {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

/* RISK LIST */
.risk-list { display: flex; flex-direction: column; gap: 8px; }
.risk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
.risk-level-dot { width: 10px; height: 10px; 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: 15px; font-weight: 700; color: var(--text-1); flex: 1; }
.risk-project { font-size: 12px; color: var(--text-3); }

/* OK CARD */
.ok-card {
  background: var(--green-dim);
  border: 1px solid rgba(13,122,80,0.18);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}

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

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.completed  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(13,122,80,0.20); }
.badge.ontrack    { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(26,95,160,0.20); }
.badge.delayed    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(192,57,43,0.20); }
.badge.notstarted { background: rgba(74,112,96,0.08); color: var(--text-3); border: 1px solid rgba(74,112,96,0.15); }

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

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