/* Hajj IPC 1447 - Clean white theme only */
* { box-sizing: border-box; }
html, body {
  font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
body { direction: rtl; }

/* Layout */
.container-app { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* Top Bar */
.topbar {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  color: white;
  padding: 14px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; }
.topbar p { margin: 2px 0 0; font-size: 13px; opacity: 0.9; }

/* Nav */
.navbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 49;
}
.nav-list { display: flex; gap: 0; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-right: none;
  border-left: none;
}
.nav-link:hover { color: #047857; background: #f0fdf4; }
.nav-link.active { color: #047857; border-bottom-color: #047857; background: #f0fdf4; }

/* Cards */
.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.card-title { font-size: 17px; font-weight: 700; color: #0f172a; margin: 0; }

/* Stat Tiles */
.stat-tile {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-tile .stat-label { font-size: 13px; color: #64748b; margin: 0 0 4px; }
.stat-tile .stat-value { font-size: 24px; font-weight: 700; color: #0f172a; line-height: 1; }
.stat-tile .stat-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* Form Elements */
label.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: white;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #047857;
  box-shadow: 0 0 0 3px rgba(4,120,87,0.15);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #047857; color: white; }
.btn-primary:hover:not(:disabled) { background: #065f46; }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover:not(:disabled) { background: #cbd5e1; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-outline { background: white; color: #047857; border: 1px solid #047857; }
.btn-outline:hover:not(:disabled) { background: #f0fdf4; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Section Accordion */
.section-block {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 12px;
  background: white;
  overflow: hidden;
}
.section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f8fafc;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  font-family: inherit;
  text-align: right;
}
.section-header:hover { background: #f1f5f9; }
.section-header.is-open { background: #f0fdf4; border-bottom-color: #d1fae5; }
.section-title-text { font-size: 15px; font-weight: 700; color: #0f172a; }
.section-meta { font-size: 12px; color: #64748b; display: flex; gap: 10px; align-items: center; }
.section-progress { width: 80px; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.section-progress-bar { height: 100%; background: #10b981; transition: width 0.2s; }

.section-body { padding: 12px 18px; display: none; }
.section-block.open .section-body { display: block; }

/* Item Row */
.item-row-wrap {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.item-row-wrap:last-child { border-bottom: none; }
.item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.item-note-wrap {
  margin-top: 8px;
  padding-right: 62px;
}
.item-note-input {
  font-size: 13px !important;
  padding: 7px 10px !important;
  background: #fafafa !important;
}
.item-note-input:focus { background: white !important; }
.item-code {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  background: #f0fdf4;
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 50px;
  text-align: center;
}
.item-text { flex: 1; font-size: 14px; line-height: 1.6; color: #1e293b; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.ans-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: white;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.ans-btn:hover { background: #f1f5f9; }
.ans-btn.active-yes { background: #10b981; color: white; border-color: #10b981; }
.ans-btn.active-no { background: #ef4444; color: white; border-color: #ef4444; }
.ans-btn.active-na { background: #64748b; color: white; border-color: #64748b; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: right;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 700;
  color: #334155;
  font-size: 13px;
}
.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.tbl tr:hover td { background: #f8fafc; }

/* Toast */
#toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #047857;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  font-size: 14px;
}
#toast.toast-error { background: #dc2626; }

/* Loader */
.loader {
  display: inline-block;
  width: 28px; height: 28px;
  border: 3px solid #e2e8f0;
  border-top-color: #047857;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid #e2e8f0;
  background: white;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

/* Print */
@media print {
  .topbar, .navbar, .footer, .no-print { display: none !important; }
  body { background: white !important; }
  .card { border: 1px solid #ccc; box-shadow: none; }
}
