/* ==============================================================================
   مبادرات — Custom CSS
   RTL Arabic UI, Omani green palette, clean stepper wizard
   ============================================================================== */

* { box-sizing: border-box; }

html, body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  direction: rtl;
  text-align: right;
  background: #f5f7f9;
  color: #2d3338;
  margin: 0;
  padding: 0;
}

.container-fluid { padding: 0 !important; }

/* ---------- Header ---------- */
.app-header {
  background: linear-gradient(135deg, #1a5f3f 0%, #2d8659 100%);
  color: white;
  padding: 1.5rem 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.header-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.brand {
  margin: 0;
  font-weight: 900;
  font-size: 2.2rem;
  letter-spacing: -0.5px;
}
.tagline {
  display: block;
  opacity: 0.92;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}
.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.header-btn {
  background: rgba(255,255,255,0.15) !important;
  color: white !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  padding: 0.55rem 1.2rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  font-family: inherit;
  display: inline-block;
}
.header-btn:hover {
  background: rgba(255,255,255,0.28) !important;
  color: white !important;
  transform: translateY(-1px);
}
.load-btn { margin: 0; }

/* ---------- Stepper ---------- */
.stepper-container {
  background: white;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid #e3e7eb;
}
.stepper {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  position: relative;
  gap: 0.5rem;
}
/* Horizontal connecting line behind circles */
.stepper::before {
  content: '';
  position: absolute;
  top: 24px;
  right: 40px;
  left: 40px;
  height: 3px;
  background: #e3e7eb;
  z-index: 0;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
  flex: 1;
  transition: all 0.25s;
}
.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e3e7eb;
  color: #8a94a0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  transition: all 0.25s;
  border: 3px solid white;
  box-shadow: 0 0 0 3px #e3e7eb;
}
.step-item.active .step-circle {
  background: #1a5f3f;
  color: white;
  transform: scale(1.12);
  box-shadow: 0 0 0 3px #1a5f3f, 0 6px 16px rgba(26,95,63,0.35);
}
.step-item.completed .step-circle {
  background: #2d8659;
  color: white;
  box-shadow: 0 0 0 3px #2d8659;
}
.step-item.completed .step-circle::after {
  content: '✓';
  position: absolute;
  margin-top: -2px;
  font-size: 1.3rem;
}
.step-item.completed .step-circle { font-size: 0; }
.step-label {
  font-size: 0.88rem;
  color: #6b7680;
  text-align: center;
  font-weight: 600;
  max-width: 110px;
  line-height: 1.3;
}
.step-item.active .step-label { color: #1a5f3f; }
.step-item.completed .step-label { color: #2d8659; }
.step-item:hover .step-circle { transform: scale(1.08); }

/* ---------- Content area ---------- */
.content-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}
.content-container > .tab-content,
.content-container > div {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.05);
  min-height: 450px;
}

.module { padding: 2.5rem 3rem; }
.module-header { margin-bottom: 2rem; }
.module-title {
  color: #1a5f3f;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #1a5f3f;
  display: inline-block;
}
.module-desc {
  color: #5a6670;
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 0;
  max-width: 800px;
}

/* ---------- Placeholder card (during development) ---------- */
.placeholder {
  padding: 3.5rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, #f7faf8 0%, #eaf4ef 100%);
  border: 2px dashed #9dbfad;
  border-radius: 12px;
  color: #5a6670;
}
.placeholder-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}
.placeholder h4 {
  color: #1a5f3f;
  margin-bottom: 0.75rem;
  font-weight: 700;
}
.placeholder-sub {
  font-size: 0.92rem;
  color: #7a848e;
  margin-top: 0.5rem;
  max-width: 600px;
  margin-right: auto;
  margin-left: auto;
}

/* ---------- Navigation buttons ---------- */
.nav-buttons {
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-btn {
  padding: 0.75rem 2rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  min-width: 160px;
  border-radius: 10px !important;
}
.step-indicator {
  color: #6b7680;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.app-footer {
  background: #2d3338;
  color: #c0c8d0;
  padding: 2.5rem 2rem;
  text-align: center;
  margin-top: 3rem;
}
.footer-content { max-width: 800px; margin: 0 auto; }
.footer-main {
  font-size: 1.05rem;
  margin: 0 0 0.4rem 0;
  color: white;
}
.footer-sub {
  font-size: 0.95rem;
  margin: 0 0 1rem 0;
  color: #c0c8d0;
}
.footer-copy {
  font-size: 0.85rem;
  color: #8a94a0;
  margin: 0;
}
.app-footer a {
  color: #5ec88f;
  text-decoration: none;
  font-weight: 600;
}
.app-footer a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .header-content { flex-direction: column; align-items: flex-start; }
  .stepper { gap: 0.25rem; }
  .step-circle { width: 40px; height: 40px; font-size: 1rem; }
  .step-label { font-size: 0.75rem; max-width: 70px; }
  .module { padding: 1.5rem; }
  .nav-btn { min-width: 120px; padding: 0.6rem 1rem !important; }
}

/* ---------- Shiny notification tweaks for RTL ---------- */
.shiny-notification {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  text-align: right;
}

/* ==============================================================================
   SECTION CARDS (used inside modules to group related fields)
   ============================================================================== */
.section-card {
  background: #fafbfc;
  border: 1px solid #e3e7eb;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.section-card:hover {
  border-color: #c5d4cc;
  box-shadow: 0 2px 12px rgba(26,95,63,0.06);
}
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e3e7eb;
}
.section-icon {
  font-size: 1.75rem;
  line-height: 1;
}
.section-title {
  margin: 0;
  color: #1a5f3f;
  font-weight: 700;
  font-size: 1.25rem;
}
.section-title-en {
  color: #8a94a0;
  font-weight: 400;
  font-size: 0.9rem;
}
.section-body {
  /* Form inputs inside live here — standard Bootstrap styling applies */
}
.section-body .form-group { margin-bottom: 1rem; }
.section-body .form-group:last-child { margin-bottom: 0; }

/* ==============================================================================
   BILINGUAL FIELD LABELS
   ============================================================================== */
.control-label .field-ar,
label .field-ar {
  font-weight: 600;
  color: #2d3338;
}
.control-label .field-en,
label .field-en {
  color: #8a94a0;
  font-weight: 400;
  font-size: 0.85em;
}
.control-label .field-required,
label .field-required {
  color: #d63939;
  font-weight: 700;
  margin-right: 2px;
}

/* Form controls — general polish */
.form-control,
.shiny-input-container input[type="text"],
.shiny-input-container textarea,
.shiny-input-container input[type="number"] {
  border-radius: 8px !important;
  border: 1.5px solid #d8dde2 !important;
  padding: 0.6rem 0.85rem !important;
  font-family: 'Cairo', sans-serif !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus,
.shiny-input-container input:focus,
.shiny-input-container textarea:focus {
  border-color: #1a5f3f !important;
  box-shadow: 0 0 0 3px rgba(26,95,63,0.12) !important;
  outline: none !important;
}
.form-control::placeholder,
textarea::placeholder,
input::placeholder {
  color: #b0b8c0 !important;
  opacity: 1;
  font-size: 0.93em;
}
textarea.form-control { line-height: 1.6; }

/* DateInput (bootstrap-datepicker) — align with other inputs */
.shiny-date-input .input-daterange input,
.shiny-date-input input {
  border-radius: 8px !important;
}

/* ==============================================================================
   COMPLETION INDICATOR (live progress bar inside a module)
   ============================================================================== */
.completion-indicator {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: #f7faf8;
  border: 1px solid #e3e7eb;
  border-radius: 10px;
}
.completion-track {
  height: 10px;
  background: #e3e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.completion-fill {
  height: 100%;
  background: linear-gradient(90deg, #2d8659 0%, #1a5f3f 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.completion-label {
  font-size: 0.92rem;
  color: #5a6670;
  font-weight: 600;
}
.completion-indicator.complete .completion-fill {
  background: linear-gradient(90deg, #2d8659 0%, #1a5f3f 100%);
}
.completion-indicator.partial .completion-fill {
  background: linear-gradient(90deg, #f0a848 0%, #d88a30 100%);
}
.completion-indicator.minimal .completion-fill {
  background: linear-gradient(90deg, #d8dde2 0%, #b8c0c8 100%);
}
.completion-indicator.complete .completion-label { color: #1a5f3f; }
.completion-indicator.partial  .completion-label { color: #a06820; }

/* ==============================================================================
   STEP 2: CRITERIA COMPARISONS + RESULTS
   ============================================================================== */

/* Criteria checkbox list polish */
.criteria-chk-ar { font-weight: 600; color: #2d3338; }
.criteria-chk-en { color: #8a94a0; font-size: 0.85em; }

/* Criteria count message */
.criteria-msg { padding: 0.6rem 1rem; border-radius: 8px; font-size: 0.95rem; font-weight: 600; margin-top: 0.75rem; }
.criteria-msg.ok   { background: #e8f5e9; color: #1a5f3f; }
.criteria-msg.warn { background: #fff8e1; color: #a06820; }

/* Help text inside sections */
.section-help { color: #5a6670; font-size: 0.95rem; margin-bottom: 1rem; line-height: 1.7; }

/* ---- Comparison cards ---- */
.comparison-card {
  background: white;
  border: 1.5px solid #e3e7eb;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.comparison-card:hover {
  border-color: #c5d4cc;
  box-shadow: 0 2px 10px rgba(26,95,63,0.06);
}
.comparison-num {
  font-size: 0.82rem;
  color: #8a94a0;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.comparison-q {
  font-size: 1.08rem;
  font-weight: 700;
  color: #1a5f3f;
  margin-bottom: 1rem;
}

/* Radio buttons inside comparison cards */
.comparison-card .shiny-input-radiogroup .radio { margin-bottom: 0.35rem; }
.comparison-card .shiny-input-radiogroup label {
  font-size: 0.98rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  display: block;
  cursor: pointer;
  transition: background 0.15s;
}
.comparison-card .shiny-input-radiogroup label:hover { background: #f0f4f2; }
.comparison-card .shiny-input-radiogroup input[type="radio"]:checked + span,
.comparison-card .shiny-input-radiogroup input[type="radio"]:checked ~ .radio-equal {
  font-weight: 700;
}
.radio-equal { color: #5a6670; }

/* ---- Results: weight bar chart ---- */
.results-sub {
  color: #1a5f3f;
  font-weight: 700;
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
}
.weights-chart { margin-bottom: 1.5rem; }
.weight-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.7rem;
}
.weight-name {
  min-width: 200px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: right;
}
.weight-en { color: #8a94a0; font-weight: 400; }
.weight-bar-track {
  flex: 1;
  height: 28px;
  background: #e8ecef;
  border-radius: 6px;
  overflow: hidden;
}
.weight-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2d8659, #1a5f3f);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  color: white;
  font-size: 0.88rem;
  font-weight: 700;
  min-width: 42px;
  transition: width 0.5s ease;
}

/* ---- Traffic light (consistency indicator) ---- */
.traffic-light {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-top: 0.5rem;
}
.tl-icon  { font-size: 1.6rem; }
.tl-txt   { font-size: 1rem; font-weight: 600; }
.tl-detail { color: #8a94a0; font-size: 0.85rem; margin-right: 0.5rem; }

.tl-green  { background: #e8f5e9; color: #1a5f3f; }
.tl-yellow { background: #fff8e1; color: #a06820; }
.tl-red    { background: #fce4e4; color: #c62828; }

/* Placeholder inside sections when data is missing */
.comparison-placeholder,
.results-placeholder {
  text-align: center;
  padding: 2rem;
  color: #8a94a0;
  font-size: 1rem;
}

/* Responsive tweaks for comparisons */
@media (max-width: 768px) {
  .weight-row { flex-direction: column; align-items: stretch; gap: 0.3rem; }
  .weight-name { min-width: auto; text-align: right; }
}

/* ---- Slider comparisons (Step 2 v2) ---- */
.slider-endpoints {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
  direction: rtl;
}
.ep-left  { font-weight: 700; color: #2d8659; }
.ep-center { color: #8a94a0; font-size: 0.82rem; }
.ep-right { font-weight: 700; color: #c62828; }

.comparison-card .irs--shiny .irs-bar { background: linear-gradient(90deg, #2d8659, #1a5f3f); }
.comparison-card .irs--shiny .irs-handle { border-color: #1a5f3f; }
.comparison-card .irs--shiny .irs-single { background: #1a5f3f; }

/* Slider feedback messages */
.slider-feedback {
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.25rem;
}
.fb-equal { background: #f0f2f4; color: #5a6670; }
.fb-left  { background: #e8f5e9; color: #1a5f3f; }
.fb-right { background: #fce4e4; color: #c62828; }

/* Custom criteria area */
.custom-criteria-area {
  margin-top: 1rem;
  padding: 1rem;
  background: #f7faf8;
  border: 1px dashed #c5d4cc;
  border-radius: 8px;
}
.custom-title { color: #1a5f3f; font-weight: 600; margin-bottom: 0.5rem; }

/* ---- AHP diagnostic hints ---- */
.hints-box {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: #fff8f0;
  border: 1.5px solid #f0c89a;
  border-radius: 10px;
  border-right: 4px solid #e65100;
}
.hints-box h5 { color: #e65100; font-weight: 700; margin: 0 0 0.75rem 0; }
.hint-circular, .hint-deviation, .hint-advice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0e0d0;
  direction: rtl;
}
.hint-circular:last-child, .hint-deviation:last-child, .hint-advice:last-child { border-bottom: none; }
.hint-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }
.hint-text { font-size: 0.93rem; color: #5a3a20; line-height: 1.6; }
.hint-circular .hint-text { color: #c62828; font-weight: 600; }
.hint-advice .hint-text { color: #1a5f3f; font-style: italic; }

/* ==============================================================================
   STEP 3: BUDGET ALLOCATION
   ============================================================================== */
.budget-box { padding: 1rem 1.25rem; border-radius: 8px; font-size: 1.05rem; font-weight: 600; }
.budget-box.ok   { background: #e8f5e9; color: #1a5f3f; }
.budget-box.warn { background: #fff8e1; color: #a06820; }
.act-header { padding: 0.5rem 0; border-bottom: 2px solid #e3e7eb; margin-bottom: 0.5rem; font-size: 0.9rem; color: #5a6670; }
.act-row { padding: 0.3rem 0; border-bottom: 1px solid #f0f2f4; }
.act-row:hover { background: #fafbfc; }

/* Allocation results */
.alloc-summary { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.sum-card { flex: 1; min-width: 140px; text-align: center; background: #f7faf8; border: 1px solid #e3e7eb; border-radius: 10px; padding: 1rem; }
.sum-val { font-size: 1.6rem; font-weight: 700; color: #1a5f3f; }
.sum-lbl { font-size: 0.85rem; color: #5a6670; margin-top: 0.25rem; }
.alloc-list { border: 1px solid #e3e7eb; border-radius: 10px; overflow: hidden; }
.alloc-row { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1rem; border-bottom: 1px solid #f0f2f4; }
.alloc-row:last-child { border-bottom: none; }
.alloc-row.funded { background: #f0faf4; }
.alloc-row.not-funded { background: #fafafa; color: #999; }
.badge-yes { background: #2e7d32; color: #fff; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 700; }
.badge-no  { background: #ccc; color: #666; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.8rem; }
.alloc-name  { flex: 1; font-weight: 600; }
.alloc-cost  { font-size: 0.9rem; color: #5a6670; }
.alloc-score { font-size: 0.85rem; color: #8a94a0; }
.alloc-note { font-size: 0.88rem; color: #5a6670; padding: 0.75rem 1rem; margin-top: 0.75rem; background: #f7faf8; border-radius: 8px; border-right: 3px solid #1a5f3f; }

/* ---- Activity cards with criterion scoring (Step 3 v2) ---- */
.activity-card {
  background: #fafbfc;
  border: 1.5px solid #e3e7eb;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.activity-card:hover { border-color: #c5d4cc; }
.activity-header { margin-bottom: 0.5rem; }
.activity-scores { padding-top: 0.5rem; border-top: 1px dashed #e3e7eb; }
.scores-label { font-size: 0.88rem; color: #5a6670; font-weight: 600; margin-bottom: 0.5rem; }
.scores-grid { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.crit-score-row { display: flex; align-items: center; gap: 0.5rem; min-width: 250px; }
.crit-score-label { font-size: 0.85rem; color: #2d3338; font-weight: 600; min-width: 150px; text-align: right; }
.crit-score-row .shiny-input-container { margin-bottom: 0 !important; }
.crit-score-row select { padding: 0.3rem 0.5rem !important; font-size: 0.88rem !important; }
.wscore-badge { display: inline-block; color: #fff; padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 1.1rem; font-weight: 700; text-align: center; margin-top: 1.5rem; }

/* Criteria reference tags */
.criteria-ref { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.crit-tag { background: #e8f5e9; color: #1a5f3f; padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.82rem; font-weight: 600; }

/* Funded activities reference (Steps 4 & 5) */
.funded-ref-box { background: #f0faf4; padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid #c5d4cc; }
.funded-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.funded-tag { background: #2d8659; color: #fff; padding: 0.25rem 0.7rem; border-radius: 6px; font-size: 0.85rem; font-weight: 600; }

@media (max-width: 768px) {
  .scores-grid { flex-direction: column; }
  .crit-score-row { min-width: auto; }
}

/* ==============================================================================
   STEP 4: RISK MATRIX / HEATMAP
   ============================================================================== */
.risk-header { padding: 0.5rem 0; border-bottom: 2px solid #e3e7eb; margin-bottom: 0.5rem; font-size: 0.9rem; color: #5a6670; }
.risk-row { padding: 0.3rem 0; border-bottom: 1px solid #f0f2f4; }
.risk-badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 4px; font-size: 0.8rem; font-weight: 700; color: #fff; }
.risk-badge.critical { background: #c62828; }
.risk-badge.high     { background: #e65100; }
.risk-badge.medium   { background: #f9a825; color: #333; }
.risk-badge.low      { background: #2e7d32; }

/* Heatmap */
.heatmap-wrap { overflow-x: auto; margin: 0.5rem 0; }
.heatmap-table { border-collapse: collapse; width: 100%; min-width: 500px; direction: ltr; }
.heatmap-table th, .heatmap-table td { padding: 0.5rem; text-align: center; border: 1px solid #e3e7eb; font-size: 0.82rem; }
.hm-corner { background: #f5f7f9; font-weight: 700; min-width: 120px; text-align: right !important; direction: rtl; }
.hm-col-label { background: #f5f7f9; font-weight: 600; font-size: 0.78rem; }
.hm-label { background: #f5f7f9; font-weight: 600; font-size: 0.78rem; text-align: right !important; direction: rtl; min-width: 100px; }
.hm-cell { min-width: 70px; min-height: 40px; vertical-align: middle; transition: transform 0.15s; }
.hm-dot { display: inline-block; background: rgba(255,255,255,0.85); color: #333; padding: 0.1rem 0.3rem; border-radius: 4px; font-size: 0.72rem; margin: 1px; direction: rtl; }
.hm-legend { display: flex; gap: 1rem; justify-content: center; margin-top: 0.75rem; }
.leg { padding: 0.3rem 0.75rem; border-radius: 4px; font-size: 0.85rem; font-weight: 600; color: #fff; }
.leg.low      { background: #2e7d32; }
.leg.medium   { background: #f9a825; color: #333; }
.leg.high     { background: #e65100; }
.leg.critical { background: #c62828; }

/* Mitigation */
.mit-item { padding: 0.75rem 1rem; border-bottom: 1px solid #f0f2f4; }
.mit-item:last-child { border-bottom: none; }
.mit-name { font-weight: 600; margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.5rem; }
.mit-advice { font-size: 0.92rem; color: #5a6670; padding-right: 1.5rem; }

/* ==============================================================================
   STEP 5: GANTT CHART + CPM
   ============================================================================== */
.task-row { padding: 0.3rem 0; border-bottom: 1px solid #f0f2f4; }
.task-row-labels { font-size: 0.82rem; color: #8a94a0; padding: 0.25rem 0 0.5rem; border-bottom: 2px solid #e3e7eb; }

/* Gantt chart (always LTR for time axis) */
.gantt-container { direction: ltr; padding: 0.5rem 0; }
.gantt-row { display: flex; align-items: center; margin-bottom: 0.5rem; min-height: 36px; }
.gantt-label { width: 180px; text-align: right; direction: rtl; font-size: 0.9rem; font-weight: 600; padding-left: 1rem; color: #2d3338; }
.gantt-crit-badge { background: #c62828; color: #fff; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 3px; margin-right: 0.4rem; }
.gantt-track { flex: 1; background: #f0f2f4; border-radius: 4px; height: 28px; position: relative; }
.gantt-bar { height: 100%; background: linear-gradient(90deg, #2d8659, #1a5f3f); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.8rem; font-weight: 700; min-width: 30px; transition: width 0.4s; }
.gantt-critical .gantt-bar { background: linear-gradient(90deg, #e53935, #c62828); }
.gantt-critical .gantt-label { color: #c62828; }
.gantt-axis { display: flex; justify-content: space-between; padding: 0.25rem 0 0 180px; font-size: 0.8rem; color: #8a94a0; border-top: 1px solid #e3e7eb; margin-top: 0.5rem; }

/* CPM summary */
.cpm-summary { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cpm-warning { background: #fff3e0; color: #e65100; padding: 1rem; border-radius: 8px; border-right: 4px solid #e65100; font-size: 0.95rem; line-height: 1.7; }

/* ==============================================================================
   STEP 6: REPORT & DOWNLOADS
   ============================================================================== */
.review-header h3 { color: #1a5f3f; margin-bottom: 0.25rem; }
.review-committee { color: #5a6670; font-size: 0.95rem; }
.review-checklist { margin-top: 1rem; }
.review-checklist h4 { margin-bottom: 0.5rem; color: #2d3338; }
.review-check { padding: 0.4rem 0; font-size: 1rem; }
.review-check.check-ok { color: #2e7d32; font-weight: 600; }
.review-check.check-no { color: #999; }
.review-warning { background: #fff8e1; color: #a06820; padding: 0.75rem 1rem; border-radius: 8px; margin-top: 1rem; font-weight: 600; }

.download-area { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.download-card { flex: 1; min-width: 260px; background: #f7faf8; border: 1.5px solid #e3e7eb; border-radius: 12px; padding: 1.5rem; text-align: center; }
.download-card h4 { margin-bottom: 0.5rem; color: #1a5f3f; }
.download-card p { font-size: 0.9rem; color: #5a6670; margin-bottom: 1rem; }
.download-card .btn { width: 100%; }

@media (max-width: 768px) {
  .alloc-summary, .cpm-summary { flex-direction: column; }
  .download-area { flex-direction: column; }
  .gantt-label { width: 120px; font-size: 0.8rem; }
  .gantt-axis { padding-left: 120px; }
}
