/* ==============================================================================
   متابعة — Monitoring Dashboard CSS
   Blue theme (vs green for مبادرات planning app)
   ============================================================================== */

* { box-sizing: border-box; }
html, body {
  font-family: 'Cairo', sans-serif;
  direction: rtl; text-align: right;
  background: #f0f2f5; color: #2d3338; margin: 0; padding: 0;
}
.container-fluid { padding: 0 !important; }

/* Header */
.app-header {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
  color: white; padding: 1.5rem 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.header-content { max-width: 1300px; 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; }
.tagline { display: block; opacity: 0.9; font-size: 0.95rem; margin-top: 0.2rem; }
.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;
  border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.95rem;
  font-family: inherit; transition: all 0.2s; display: inline-block; }
.header-btn:hover { background: rgba(255,255,255,0.28) !important; }

/* Content */
.content-container { max-width: 1300px; margin: 1.5rem auto; padding: 0 1.5rem; }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; background: white;
  border-radius: 14px; box-shadow: 0 2px 16px rgba(0,0,0,0.05); }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h2 { color: #0d47a1; margin-bottom: 0.75rem; }
.empty-state p { color: #546e7a; max-width: 500px; margin: 0.5rem auto; }
.empty-hint { font-size: 0.9rem; color: #90a4ae; }
.empty-link a { color: #1565c0; text-decoration: none; font-weight: 600; }

/* Plan banner */
.plan-banner { background: linear-gradient(135deg, #0d47a1, #1976d2);
  color: white; padding: 1.25rem 2rem; border-radius: 12px; margin-bottom: 1rem; }
.plan-banner h2 { margin: 0 0 0.3rem 0; font-size: 1.5rem; }
.plan-banner p { margin: 0; opacity: 0.9; font-size: 0.95rem; }

/* Week selector */
.week-selector { background: white; padding: 1rem 1.5rem; border-radius: 10px;
  margin-bottom: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }

/* Tabs */
.nav-tabs .nav-link { font-weight: 600; font-size: 0.95rem; }
.nav-tabs .nav-link.active { color: #0d47a1; border-bottom: 3px solid #0d47a1; }
.tab-content-inner { padding: 1.5rem 0; }
.tab-content-inner h3 { color: #0d47a1; font-weight: 700; margin-bottom: 0.5rem; }
.tab-desc { color: #546e7a; font-size: 0.95rem; margin-bottom: 1.5rem; }

/* Progress cards */
.progress-card {
  background: white; border: 1.5px solid #e3e7eb; border-radius: 12px;
  padding: 1.25rem 1.5rem; margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.progress-card:hover { border-color: #90caf9; box-shadow: 0 2px 10px rgba(13,71,161,0.08); }
.progress-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid #f0f2f4; }
.task-num { background: #0d47a1; color: white; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.task-name { font-weight: 700; color: #2d3338; font-size: 1.05rem; flex: 1; }
.task-duration { font-size: 0.85rem; color: #90a4ae; }

/* Task status box */
.task-status-box { padding: 0.75rem; border-radius: 10px; text-align: center; margin-top: 1.5rem; }
.status-waiting { background: #f5f5f5; color: #9e9e9e; }
.status-done { background: #e8f5e9; color: #2e7d32; }
.status-ontime { background: #e8f5e9; color: #2e7d32; }
.status-ahead { background: #e3f2fd; color: #1565c0; }
.status-late { background: #fce4ec; color: #c62828; }
.status-icon { font-size: 1.5rem; }
.status-text { font-weight: 700; font-size: 1rem; margin: 0.25rem 0; }
.crit-warning { font-size: 0.82rem; color: #e65100; font-weight: 600; }
.status-detail { font-size: 0.8rem; color: #90a4ae; margin-top: 0.25rem; }

/* ==== GANTT ==== */
.gantt-container { direction: ltr; padding: 0.5rem 0; }
.gantt-row { display: flex; align-items: center; margin-bottom: 0.75rem; min-height: 40px; }
.gantt-label { width: 200px; text-align: right; direction: rtl; font-size: 0.88rem;
  font-weight: 600; padding-left: 1rem; color: #2d3338; }
.gantt-label-crit { color: #c62828; }
.crit-badge { background: #c62828; color: white; font-size: 0.68rem; padding: 0.1rem 0.4rem;
  border-radius: 3px; margin-right: 0.4rem; }
.gantt-track { flex: 1; height: 32px; position: relative; background: #f0f2f5; border-radius: 6px; overflow: visible; }
.gantt-planned { position: absolute; top: 0; height: 100%; background: #e0e0e0;
  border-radius: 6px; border: 2px dashed #bdbdbd; opacity: 0.7; }
.gantt-actual { position: absolute; top: 2px; height: calc(100% - 4px); border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.78rem; font-weight: 700; min-width: 5px;
  transition: width 0.5s ease, background 0.3s; }
.week-marker { position: absolute; top: -6px; bottom: -6px; width: 3px;
  background: #0d47a1; z-index: 10; }
.week-marker::after { content: attr(data-label); position: absolute; top: -22px; left: 50%;
  transform: translateX(-50%); font-size: 9px; color: #0d47a1; font-weight: 700;
  white-space: nowrap; background: white; padding: 1px 4px; border-radius: 3px;
  border: 1px solid #0d47a1; }
.gantt-axis { display: flex; justify-content: space-between;
  padding: 0.5rem 0 0 200px; font-size: 0.8rem; color: #90a4ae;
  border-top: 1px solid #e3e7eb; margin-top: 0.5rem; }

/* Legend dots */
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  margin-left: 0.3rem; vertical-align: middle; }
.green-dot { background: #2e7d32; }
.yellow-dot { background: #f9a825; }
.red-dot { background: #c62828; }
.grey-dot { background: #bdbdbd; border: 2px dashed #9e9e9e; }
.legend-line { display: inline-block; width: 16px; height: 3px; background: #0d47a1;
  vertical-align: middle; margin-left: 0.3rem; border-radius: 2px; }

/* Project summary */
.project-summary, .budget-overview {
  display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; }
.sum-card { flex: 1; min-width: 140px; text-align: center; background: white;
  border: 1px solid #e3e7eb; border-radius: 10px; padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.sum-val { font-size: 1.8rem; font-weight: 700; color: #0d47a1; }
.sum-lbl { font-size: 0.85rem; color: #546e7a; margin-top: 0.2rem; }
.sum-green { color: #2e7d32 !important; }
.sum-yellow { color: #f9a825 !important; }
.sum-red { color: #c62828 !important; }
.sum-grey { color: #9e9e9e !important; }

/* ==== EVM Budget Cards ==== */
.evm-card { background: white; border: 1.5px solid #e3e7eb; border-radius: 12px;
  padding: 1.25rem; margin-bottom: 1rem; }
.evm-header { margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #f0f2f4; }
.evm-name { font-weight: 700; font-size: 1rem; color: #2d3338; }
.evm-bars { margin-bottom: 0.75rem; }
.evm-bar-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; }
.evm-bar-label { min-width: 60px; font-size: 0.85rem; font-weight: 600; color: #546e7a; text-align: right; }
.evm-bar-track { flex: 1; height: 24px; background: #f0f2f5; border-radius: 5px; overflow: hidden; }
.evm-bar-fill { height: 100%; border-radius: 5px; display: flex; align-items: center;
  justify-content: center; color: white; font-size: 0.78rem; font-weight: 700;
  min-width: 30px; transition: width 0.4s; }
.evm-status { display: flex; gap: 1.5rem; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }
.evm-numbers { font-size: 0.82rem; color: #90a4ae; }

/* ==== What-If ==== */
.whatif-ok { text-align: center; padding: 3rem; background: #e8f5e9; border-radius: 12px; }
.whatif-ok h3 { color: #2e7d32; }
.whatif-card { background: white; border: 1.5px solid #e3e7eb; border-radius: 12px;
  padding: 1.25rem; margin-bottom: 1rem; }
.whatif-critical { border-right: 5px solid #c62828; }
.whatif-warn { border-right: 5px solid #f9a825; }
.whatif-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.whatif-name { font-weight: 700; font-size: 1rem; }
.whatif-crit { background: #c62828; color: white; font-size: 0.75rem;
  padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 700; }
.whatif-impact { font-weight: 700; font-size: 0.95rem; margin-top: 0.5rem; }
.whatif-action { background: #e3f2fd; color: #0d47a1; padding: 0.75rem;
  border-radius: 8px; margin-top: 0.5rem; font-weight: 600; font-size: 0.9rem; }

/* Footer */
.app-footer { background: #263238; color: #b0bec5; padding: 2rem; text-align: center; margin-top: 2rem; }
.footer-main { font-size: 1rem; color: white; margin: 0 0 0.3rem; }
.footer-sub { font-size: 0.9rem; margin: 0 0 0.75rem; }
.footer-copy { font-size: 0.82rem; color: #78909c; margin: 0; }
.app-footer a { color: #42a5f5; text-decoration: none; font-weight: 600; }

/* EVM danger alert */
.evm-danger { background: #fce4ec; color: #c62828; padding: 0.6rem 0.8rem; border-radius: 8px;
  font-weight: 700; font-size: 0.9rem; margin: 0.5rem 0; border-right: 4px solid #c62828; }

/* History panel */
.history-entry { background: white; border: 1.5px solid #e3e7eb; border-radius: 12px;
  padding: 1.25rem; margin-bottom: 1rem; }
.history-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid #f0f2f4; }
.hw-badge { background: #0d47a1; color: white; padding: 0.3rem 0.8rem; border-radius: 6px;
  font-weight: 700; font-size: 0.9rem; }
.hw-date { color: #90a4ae; font-size: 0.85rem; }
.history-task { display: flex; align-items: center; gap: 0.75rem; padding: 0.35rem 0;
  border-bottom: 1px solid #f5f5f5; }
.history-task:last-child { border-bottom: none; }
.ht-name { min-width: 180px; font-size: 0.88rem; font-weight: 600; color: #2d3338; text-align: right; }
.ht-bar-track { flex: 1; height: 20px; background: #f0f2f5; border-radius: 4px; overflow: hidden; }
.ht-bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center;
  justify-content: center; color: white; font-size: 0.72rem; font-weight: 700; min-width: 25px; }
.ht-notes { font-size: 0.8rem; color: #90a4ae; max-width: 150px; }

/* Today's date display */
.today-date { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem;
  padding: 0.6rem 1rem; background: #e3f2fd; border-radius: 8px; }
.today-icon { font-size: 1.2rem; }
.today-text { font-size: 0.95rem; font-weight: 600; color: #0d47a1; }

/* Big save section at bottom of progress tab */
.save-section {
  margin-top: 2rem; padding: 1.5rem; background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 2px solid #66bb6a; border-radius: 14px; text-align: center;
}
.save-info { margin-bottom: 1rem; }
.save-date { font-size: 1rem; font-weight: 600; color: #2e7d32; margin: 0 0 0.3rem; }
.save-filename { font-size: 0.9rem; color: #1b5e20; margin: 0; }
.save-big-btn {
  font-size: 1.2rem !important; padding: 0.85rem 3rem !important;
  border-radius: 12px !important; font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(46,125,50,0.3) !important;
  background: #2e7d32 !important; border-color: #2e7d32 !important;
}
.save-big-btn:hover {
  background: #1b5e20 !important; transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46,125,50,0.4) !important;
}
.save-hint { font-size: 0.85rem; color: #558b2f; margin: 0.75rem 0 0; font-style: italic; }

/* Org section */
.org-section { background: white; padding: 1rem 1.5rem; border-radius: 10px;
  margin-bottom: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }

/* Report preview */
.report-preview { background: white; border: 1.5px solid #e3e7eb; border-radius: 12px;
  padding: 1.5rem; margin-bottom: 1.5rem; }
.report-warn { background: #fff3e0; color: #e65100; padding: 0.6rem 1rem; border-radius: 8px;
  font-weight: 600; margin-bottom: 1rem; border-right: 4px solid #e65100; }
.report-summary-preview h4 { color: #0d47a1; margin: 0 0 0.75rem; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1.5rem; }
.preview-item { display: flex; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px solid #f0f2f4;
  font-size: 0.9rem; }
.pi-label { font-weight: 700; color: #0d47a1; min-width: 130px; }
.pv-green { color: #2e7d32; font-weight: 700; }
.pv-yellow { color: #f9a825; font-weight: 700; }
.pv-red { color: #c62828; font-weight: 700; }

/* Responsive */
@media (max-width: 768px) {
  .project-summary, .budget-overview { flex-direction: column; }
  .gantt-label { width: 120px; font-size: 0.8rem; }
  .gantt-axis { padding-left: 120px; }
}

/* Form tweaks */
.form-control, input[type="number"] {
  border-radius: 8px !important; border: 1.5px solid #d8dde2 !important;
  font-family: 'Cairo', sans-serif !important;
}
.form-control:focus, input:focus {
  border-color: #0d47a1 !important;
  box-shadow: 0 0 0 3px rgba(13,71,161,0.12) !important;
}
.irs--shiny .irs-bar { background: #0d47a1; }
.irs--shiny .irs-handle { border-color: #0d47a1; }
.irs--shiny .irs-single { background: #0d47a1; }
