/* ============================================================
   ELHASSANE STUDIO - AI Construction Manager
   الملف: public/css/client-portal.css - أنماط بوابة العميل
   ============================================================ */

/* ============================================================
   بطاقة إحصائيات العميل
   ============================================================ */

.cp-stat-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-right: 4px solid #3b82f6;
}

.dark .cp-stat-card {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cp-stat-card .num {
  font-size: 1.75rem;
  font-weight: 800;
  color: #111827;
}

.dark .cp-stat-card .num {
  color: #f9fafb;
}

.cp-stat-card .lbl {
  font-size: 0.75rem;
  color: #6b7280;
}

.dark .cp-stat-card .lbl {
  color: #9ca3af;
}

/* ============================================================
   بطاقة مشروع العميل
   ============================================================ */

.cp-project-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dark .cp-project-card {
  background: #1f2937;
  border-color: #374151;
}

.cp-project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.cp-status-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
  white-space: nowrap;
}

.cp-status-active { background: #dbeafe; color: #1d4ed8; }
.cp-status-in_progress { background: #dbeafe; color: #1d4ed8; }
.cp-status-done { background: #d1fae5; color: #047857; }
.cp-status-completed { background: #d1fae5; color: #047857; }
.cp-status-on_hold { background: #fef3c7; color: #b45309; }
.cp-status-cancelled { background: #fee2e2; color: #b91c1c; }

/* ============================================================
   شريط التقدم
   ============================================================ */

.cp-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.dark .cp-progress-bar {
  background: #374151;
}

.cp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* ============================================================
   أزرار تبويبات الواجهة
   ============================================================ */

.cp-tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.dark .cp-tab-btn {
  color: #9ca3af;
}

.cp-tab-btn:hover {
  color: #2563eb;
}

.cp-tab-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

/* ============================================================
   صفوف الجداول والبطاقات الداخلية
   ============================================================ */

.cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
}

.cp-row:nth-child(odd) {
  background: #f9fafb;
}

.dark .cp-row:nth-child(odd) {
  background: #374151;
}

.cp-muted {
  color: #6b7280;
  font-size: 0.75rem;
}

.dark .cp-muted {
  color: #9ca3af;
}

.cp-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}

.cp-badge-green { background: #d1fae5; color: #047857; }
.cp-badge-red { background: #fee2e2; color: #b91c1c; }
.cp-badge-amber { background: #fef3c7; color: #b45309; }
.cp-badge-blue { background: #dbeafe; color: #1d4ed8; }

/* ============================================================
   نجوم التقييم
   ============================================================ */

.cp-stars {
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.2rem;
}

.cp-star {
  cursor: pointer;
  color: #d1d5db;
  transition: color 0.15s;
}

.cp-star.selected {
  color: #f59e0b;
}

/* ============================================================
   لوحة دخول العميل (الوضع المستقل)
   ============================================================ */

.cp-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #3730a3, #581c87);
  padding: 1rem;
}

.cp-login-card {
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 2rem;
  width: 100%;
  max-width: 24rem;
}

.dark .cp-login-card {
  background: #1f2937;
}

/* ============================================================
   معالم المشروع / الجدول الزمني
   ============================================================ */

.cp-timeline {
  position: relative;
  padding-right: 1.5rem;
}

.cp-timeline::before {
  content: '';
  position: absolute;
  right: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #e5e7eb;
}

.dark .cp-timeline::before {
  background: #374151;
}

.cp-timeline-item {
  position: relative;
  padding-bottom: 1rem;
}

.cp-timeline-item::before {
  content: '';
  position: absolute;
  right: -1.55rem;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: #3b82f6;
  border: 2px solid #fff;
}

.dark .cp-timeline-item::before {
  border-color: #1f2937;
}

.cp-timeline-item.done::before {
  background: #10b981;
}

.cp-timeline-item.pending::before {
  background: #9ca3af;
}

/* ============================================================
   أنماط المواصفات الأصلية (متوافقة مع ملفات المواصفات)
   ============================================================ */

.client-project-card {
  transition: all 0.3s ease;
}

.client-project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.client-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.client-stat-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.dark .client-stat-item {
  background: #1a1a2e;
  border-color: #374151;
}

.client-stat-item .number {
  font-size: 28px;
  font-weight: 800;
  color: #1a365d;
}

.dark .client-stat-item .number {
  color: #e2e8f0;
}

.client-stat-item .label {
  font-size: 12px;
  color: #718096;
}

.dark .client-stat-item .label {
  color: #94a3b8;
}

.client-login-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 100%;
}

.dark .client-login-box {
  background: #1e1e3a;
}

.client-token-input {
  text-align: center;
  font-size: 18px;
  letter-spacing: 2px;
  font-family: monospace;
}
