/* ============================================================
   Palestine NDC 3.0 – Agricultural Climate Finance Tool
   Ministry of Agriculture – Professional Theme
   ============================================================ */

:root {
  --primary: #006633;
  --primary-dark: #004d26;
  --primary-light: #00944a;
  --secondary: #c8a000;
  --accent: #e74c3c;
  --bg: #f0f4f0;
  --surface: #ffffff;
  --surface2: #f7faf7;
  --border: #d0ddd0;
  --text: #1a2e1a;
  --text-muted: #5a7a5a;
  --text-light: #8fa88f;
  --shadow: 0 2px 12px rgba(0,102,51,0.10);
  --shadow-lg: 0 8px 32px rgba(0,102,51,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --header-h: 64px;
  --transition: all 0.25s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --primary: #00b85a;
  --primary-dark: #008a42;
  --primary-light: #00e070;
  --secondary: #f0c000;
  --bg: #0d1a0d;
  --surface: #1a2e1a;
  --surface2: #152515;
  --border: #2a4a2a;
  --text: #e8f5e8;
  --text-muted: #8fb88f;
  --text-light: #5a7a5a;
  --shadow: 0 2px 12px rgba(0,0,0,0.40);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.50);
}

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

body {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: var(--transition);
  min-height: 100vh;
  overflow-x: hidden;
}

[dir="rtl"] body, [dir="rtl"] * {
  font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  overflow-y: auto;
}

[dir="rtl"] .sidebar { left: auto; right: 0; }

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  text-align: center;
}

.sidebar-logo .logo-icon {
  width: 56px; height: 56px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  font-size: 24px;
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
}

.sidebar-logo .logo-title {
  color: white;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.sidebar-logo .logo-subtitle {
  color: rgba(255,255,255,0.75);
  font-size: 10px;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section-title {
  color: rgba(255,255,255,0.5);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 10px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

[dir="rtl"] .nav-item { border-left: none; border-right: 3px solid transparent; }

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  border-left-color: var(--secondary);
}

[dir="rtl"] .nav-item:hover, [dir="rtl"] .nav-item.active {
  border-left-color: transparent;
  border-right-color: var(--secondary);
}

.nav-item i { width: 20px; text-align: center; font-size: 14px; }

.nav-badge {
  margin-left: auto;
  background: var(--secondary);
  color: #1a2e1a;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

[dir="rtl"] .nav-badge { margin-left: 0; margin-right: auto; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.sidebar-footer .version {
  color: rgba(255,255,255,0.45);
  font-size: 10px;
  text-align: center;
}

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

[dir="rtl"] .main-content { margin-left: 0; margin-right: var(--sidebar-w); }

/* ─── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  font-size: 14px;
}

.topbar-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.lang-btn {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  color: var(--text-muted);
}

.lang-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0,102,51,0.3);
}

/* ─── PAGE CONTENT ───────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.section { display: none; }
.section.active { display: block; }

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, var(--surface2), var(--surface));
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { font-size: 16px; }

.card-body { padding: 20px; }

/* ─── STAT CARDS ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--primary);
}

.stat-card.green::before { background: linear-gradient(90deg, #00b85a, #00e070); }
.stat-card.blue::before { background: linear-gradient(90deg, #0066cc, #0099ff); }
.stat-card.orange::before { background: linear-gradient(90deg, #e67e22, #f39c12); }
.stat-card.red::before { background: linear-gradient(90deg, #e74c3c, #ff6b6b); }
.stat-card.purple::before { background: linear-gradient(90deg, #8e44ad, #b56fde); }
.stat-card.yellow::before { background: linear-gradient(90deg, #c8a000, #f0c000); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-icon.green { background: rgba(0,184,90,0.12); color: #00b85a; }
.stat-icon.blue { background: rgba(0,102,204,0.12); color: #0066cc; }
.stat-icon.orange { background: rgba(230,126,34,0.12); color: #e67e22; }
.stat-icon.red { background: rgba(231,76,60,0.12); color: #e74c3c; }
.stat-icon.purple { background: rgba(142,68,173,0.12); color: #8e44ad; }
.stat-icon.yellow { background: rgba(200,160,0,0.12); color: #c8a000; }

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-change {
  font-size: 11px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: #00b85a; }
.stat-change.down { color: #e74c3c; }

/* ─── GRID ───────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; margin-right: 0 !important; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0,102,51,0.25);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 16px rgba(0,102,51,0.35); }

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary); color: white; }

.btn-danger {
  background: #e74c3c;
  color: white;
}
.btn-danger:hover { background: #c0392b; }

.btn-success {
  background: #00b85a;
  color: white;
}
.btn-success:hover { background: #008a42; }

.btn-warning {
  background: #f39c12;
  color: white;
}
.btn-warning:hover { background: #d68910; }

.btn-info {
  background: #0066cc;
  color: white;
}
.btn-info:hover { background: #004d99; }

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }

/* ─── FORMS ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,102,51,0.1);
}

.form-control:read-only {
  background: var(--surface2);
  color: var(--text-muted);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

@media (max-width: 768px) {
  .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
}

/* ─── TABLES ─────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead tr {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: white;
}

thead th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

[dir="rtl"] thead th { text-align: right; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

tbody tr:hover { background: var(--surface2); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 11px 14px;
  color: var(--text);
  vertical-align: middle;
}

.table-actions { display: flex; gap: 4px; align-items: center; }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-adaptation { background: rgba(0,102,204,0.12); color: #0066cc; }
.badge-mitigation { background: rgba(0,184,90,0.12); color: #00944a; }
.badge-crosscutting { background: rgba(142,68,173,0.12); color: #8e44ad; }
.badge-ready { background: rgba(0,184,90,0.15); color: #00944a; }
.badge-prep { background: rgba(243,156,18,0.15); color: #d68910; }
.badge-concept { background: rgba(231,76,60,0.12); color: #c0392b; }
.badge-high { background: rgba(231,76,60,0.12); color: #e74c3c; }
.badge-medium { background: rgba(243,156,18,0.12); color: #f39c12; }
.badge-low { background: rgba(0,184,90,0.12); color: #00944a; }
.badge-crops { background: rgba(200,160,0,0.12); color: #c8a000; }
.badge-livestock { background: rgba(230,126,34,0.12); color: #e67e22; }
.badge-water { background: rgba(0,102,204,0.12); color: #0066cc; }

/* ─── TABS ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: linear-gradient(180deg, transparent 70%, rgba(0,102,51,0.05) 100%);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s;
}

.modal-overlay.open .modal { transform: scale(1); }
.modal-lg { max-width: 1000px; }
.modal-sm { max-width: 480px; }

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: white;
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}

.modal-close:hover { background: rgba(255,255,255,0.25); }

.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface2);
}

/* ─── PROGRESS & SLIDERS ─────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-fill.orange { background: linear-gradient(90deg, #e67e22, #f39c12); }
.progress-fill.red { background: linear-gradient(90deg, #e74c3c, #ff6b6b); }
.progress-fill.blue { background: linear-gradient(90deg, #0066cc, #0099ff); }
.progress-fill.purple { background: linear-gradient(90deg, #8e44ad, #b56fde); }

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}

/* ─── SCORE DISPLAY ──────────────────────────────────────── */
.score-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 800;
  background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--border) 0);
  position: relative;
}

.score-inner {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.star-rating { display: flex; gap: 2px; }
.star { font-size: 14px; color: var(--border); cursor: pointer; transition: var(--transition); }
.star.filled { color: var(--secondary); }

/* ─── HEAT MAP ───────────────────────────────────────────── */
.heat-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.heat-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.heat-1 { background: rgba(0,184,90,0.15); color: #00944a; }
.heat-2 { background: rgba(0,184,90,0.35); color: #00944a; }
.heat-3 { background: rgba(243,156,18,0.35); color: #d68910; }
.heat-4 { background: rgba(231,76,60,0.35); color: #c0392b; }
.heat-5 { background: rgba(231,76,60,0.70); color: white; }

/* ─── RISK MATRIX ────────────────────────────────────────── */
.risk-matrix {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* ─── NOTIFICATION / TOAST ───────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[dir="rtl"] .toast-container { right: auto; left: 20px; }

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  min-width: 280px;
  animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid #00b85a; }
.toast.error { border-left: 4px solid #e74c3c; }
.toast.info { border-left: 4px solid #0066cc; }
.toast.warning { border-left: 4px solid #f39c12; }

[dir="rtl"] .toast.success { border-left: none; border-right: 4px solid #00b85a; }
[dir="rtl"] .toast.error { border-left: none; border-right: 4px solid #e74c3c; }
[dir="rtl"] .toast.info { border-left: none; border-right: 4px solid #0066cc; }
[dir="rtl"] .toast.warning { border-left: none; border-right: 4px solid #f39c12; }

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

[dir="rtl"] @keyframes slideIn {
  from { transform: translateX(-100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── CHART CONTAINER ────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas { width: 100% !important; }

/* ─── SECTION HEADER ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p { font-size: 13px; margin-bottom: 16px; }

/* ─── SEARCH BAR ─────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,102,51,0.1);
}

.search-bar i { color: var(--text-muted); font-size: 13px; }
.search-bar input { border: none; background: transparent; color: var(--text); font-size: 13px; outline: none; padding: 9px 0; min-width: 200px; }

/* ─── INFO BOX ───────────────────────────────────────────── */
.info-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.info-box.info { background: rgba(0,102,204,0.08); border: 1px solid rgba(0,102,204,0.2); color: #0066cc; }
.info-box.warning { background: rgba(243,156,18,0.08); border: 1px solid rgba(243,156,18,0.2); color: #d68910; }
.info-box.success { background: rgba(0,184,90,0.08); border: 1px solid rgba(0,184,90,0.2); color: #00944a; }
.info-box.danger { background: rgba(231,76,60,0.08); border: 1px solid rgba(231,76,60,0.2); color: #c0392b; }

/* ─── LOADING ────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── AI CHAT ────────────────────────────────────────────── */
.ai-chat {
  height: 400px;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-msg.user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg.ai {
  background: var(--surface);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

[dir="rtl"] .chat-msg.user { border-bottom-right-radius: 12px; border-bottom-left-radius: 4px; }
[dir="rtl"] .chat-msg.ai { border-bottom-left-radius: 12px; border-bottom-right-radius: 4px; }

.chat-input-area {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ─── SIMULATOR ──────────────────────────────────────────── */
.simulator-panel {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.simulator-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.simulator-title i { font-size: 24px; }

.simulator-subtitle {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 20px;
}

.simulator-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 768px) {
  .simulator-sliders { grid-template-columns: 1fr; }
}

.sim-slider-group { }
.sim-slider-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.sim-slider-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--secondary);
}

input[type="range"].sim-range {
  background: rgba(255,255,255,0.3);
}
input[type="range"].sim-range::-webkit-slider-thumb {
  background: var(--secondary);
  border-color: rgba(255,255,255,0.5);
}

.simulator-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .simulator-results { grid-template-columns: 1fr; }
}

.sim-result-card {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.sim-result-value { font-size: 22px; font-weight: 800; color: var(--secondary); }
.sim-result-label { font-size: 11px; opacity: 0.8; margin-top: 4px; }

/* ─── NDC FLAG ───────────────────────────────────────────── */
.palestine-flag-bar {
  background: linear-gradient(90deg,
    #000000 0%, #000000 25%,
    #009736 25%, #009736 50%,
    #ffffff 50%, #ffffff 75%,
    #ef0606 75%, #ef0606 100%
  );
  height: 4px;
  width: 100%;
}

.flag-triangle {
  width: 0;
  height: 0;
  border-top: 32px solid transparent;
  border-bottom: 32px solid transparent;
  border-left: 40px solid #ef0606;
  display: inline-block;
}

/* ─── MISC ───────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 11px; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Courier New', monospace; }
.text-primary { color: var(--primary); }
.text-success { color: #00b85a; }
.text-danger { color: #e74c3c; }
.text-warning { color: #f39c12; }
.d-flex { display: flex; align-items: center; gap: 8px; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-100 { width: 100%; }
.mb-16 { margin-bottom: 16px; }

.tooltip {
  position: relative;
  cursor: help;
}
.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a2e1a;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section.active { animation: fadeIn 0.3s ease; }

/* ─── PRINT ──────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .section-actions, .modal-overlay { display: none !important; }
  .main-content { margin: 0 !important; }
  .card { break-inside: avoid; }
}
