* {
  font-family: 'Cairo', sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #ee5f06;
  --secondary-color: #f4bf3a;
  --text-color: #333;
  --background-light: #fffaf2;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --error-color: #dc3545;
  --pending-color: #ffc107;
  --confirmed-color: #17a2b8;
  --preparing-color: #fd7e14;
  --delivered-color: #28a745;
  --cancelled-color: #dc3545;
}

body {
  background: linear-gradient(135deg, #fffaf2, #fff2e0);
  min-height: 100vh;
  color: var(--text-color);
}

/* قسم إدخال الـ ID */
.client-id-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  padding: 40px;
  width: 100%;
  max-width: 500px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 10px;
}

.login-header p {
  color: #666;
  font-size: 1.1rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(238, 95, 6, 0.1);
}

.form-hint {
  font-size: 0.9rem;
  color: #666;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-hint i {
  color: var(--primary-color);
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.submit-btn:hover {
  background: #d35400;
  transform: translateY(-2px);
}

.help-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.help-link {
  color: var(--primary-color);
  text-decoration: none;
  text-align: center;
  padding: 10px;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.help-link:hover {
  background: var(--primary-color);
  color: white;
}

/* شريط معلومات العميل */
.client-info-bar {
  background: white;
  padding: 15px 20px;
  border-bottom: 2px solid var(--secondary-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.client-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.client-id-badge {
  background: var(--secondary-color);
  color: var(--text-color);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.refresh-btn, .logout-btn {
  padding: 8px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.refresh-btn {
  background: var(--info-color);
  color: white;
}

.refresh-btn:hover {
  background: #138496;
}

.logout-btn {
  background: none;
  border: 1px solid var(--error-color);
  color: var(--error-color);
}

.logout-btn:hover {
  background: var(--error-color);
  color: white;
}

/* عنوان الصفحة */
.page-header {
  text-align: center;
  margin: 30px 0;
  padding: 0 20px;
}

.page-header h1 {
  color: var(--primary-color);
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.subtitle {
  color: #666;
  font-size: 1.1rem;
}

/* إحصائيات سريعة */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 20px;
  padding: 0 10px;
}

.stat-card {
  background: white;
  padding: 25px 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.stat-icon.pending { background: var(--pending-color); }
.stat-icon.confirmed { background: var(--confirmed-color); }
.stat-icon.delivered { background: var(--delivered-color); }
.stat-icon.total { background: var(--primary-color); }

.stat-info {
  flex: 1;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-color);
  line-height: 1;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
  margin-top: 5px;
}

/* فلترة الطلبات */
.filter-section {
  background: white;
  padding: 20px;
  margin: 20px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
}

.filter-select {
  padding: 8px 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: white;
  color: var(--text-color);
  font-size: 0.9rem;
  min-width: 150px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* التحميل */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.loading i {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.loading p {
  font-size: 1.1rem;
}

/* حاوية الطلبات */
.orders-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* بطاقة الطلب */
.order-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  border-right: 4px solid var(--primary-color);
}

.order-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.order-header {
  background: #f8f9fa;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.order-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-number {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary-color);
}

.order-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #666;
  font-size: 0.9rem;
}

.meta-item i {
  color: var(--primary-color);
}

.order-status {
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-confirmed { background: #d1ecf1; color: #0c5460; }
.status-preparing { background: #ffe5d0; color: #fd7e14; }
.status-delivered { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

/* تفاصيل الطلب */
.order-details {
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
}

.order-items {
  margin-bottom: 15px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f8f9fa;
}

.order-item:last-child {
  border-bottom: none;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-name {
  font-weight: 600;
  color: var(--text-color);
}

.item-meta {
  font-size: 0.85rem;
  color: #666;
}

.item-total {
  font-weight: bold;
  color: var(--primary-color);
}

.order-summary {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}

.summary-row.total {
  border-top: 2px solid var(--primary-color);
  padding-top: 10px;
  margin-top: 5px;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--primary-color);
}

/* توقيت الطلب */
.order-timeline {
  padding: 20px;
  background: #f8f9fa;
}

.timeline-title {
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-color);
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: #666;
}

.timeline-item.active {
  color: var(--primary-color);
  font-weight: 600;
}

.timeline-item.completed {
  color: var(--success-color);
}

.timeline-icon {
  width: 20px;
  text-align: center;
}

/* عدم وجود طلبات */
.no-orders {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  margin: 20px;
}

.no-orders-icon {
  font-size: 4rem;
  color: #ddd;
  margin-bottom: 20px;
}

.no-orders h3 {
  color: var(--text-color);
  margin-bottom: 10px;
}

.no-orders p {
  color: #666;
  margin-bottom: 30px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 25px;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cta-button:hover {
  background: #d35400;
  transform: translateY(-2px);
}

/* روابط الفوتر */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 40px 20px;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid var(--primary-color);
}

.footer-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* النافذة المنبثقة */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.modal-content h2 {
  color: var(--success-color);
  margin-bottom: 15px;
}

.modal-content button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 15px;
}

/* التجاوب */
@media (max-width: 768px) {
  .login-container {
    padding: 30px 20px;
  }
  
  .client-info-bar {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .header-actions {
    width: 100%;
    justify-content: center;
  }
  
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 10px;
  }
  
  .stat-card {
    padding: 20px 15px;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .filter-section {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .filter-group {
    justify-content: space-between;
  }
  
  .order-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .order-meta {
    flex-direction: column;
    gap: 8px;
  }
  
  .footer-links {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .stats-container {
    grid-template-columns: 1fr;
  }
  
  .page-header h1 {
    font-size: 1.8rem;
  }
  
  .order-card {
    margin: 0 10px 20px;
  }
}

/* أنماط الحالات الجديدة */
.status-processing {
    background: #ff9800;
    color: white;
}

.status-shipped {
    background: #2196f3;
    color: white;
}

.status-delivered {
    background: #4caf50;
    color: white;
}

.status-canceled {
    background: #f44336;
    color: white;
}

/* أنماط الخط الزمني */
.timeline-item.processing .timeline-icon {
    background: #ff9800;
}

.timeline-item.shipped .timeline-icon {
    background: #2196f3;
}

.timeline-item.delivered .timeline-icon {
    background: #4caf50;
}

.timeline-item.canceled .timeline-icon {
    background: #f44336;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 25px 0;
    direction: rtl;
}

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* الألوان والأنماط لكل بطاقة */
.stat-card.total::before { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card.pending::before { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card.processing::before { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-card.shipped::before { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.stat-card.delivered::before { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.stat-card.canceled::before { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }

.stat-card.total:hover::before { width: 8px; background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); }
.stat-card.pending:hover::before { width: 8px; background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%); }
.stat-card.processing:hover::before { width: 8px; background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%); }
.stat-card.shipped:hover::before { width: 8px; background: linear-gradient(135deg, #38f9d7 0%, #43e97b 100%); }
.stat-card.delivered:hover::before { width: 8px; background: linear-gradient(135deg, #fee140 0%, #fa709a 100%); }
.stat-card.canceled:hover::before { width: 8px; background: linear-gradient(135deg, #fcb69f 0%, #ffecd2 100%); }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.stat-card.total .stat-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card.pending .stat-icon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card.processing .stat-icon { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-card.shipped .stat-icon { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.stat-card.delivered .stat-icon { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.stat-card.canceled .stat-icon { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); color: #e53e3e; }

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 600;
}

/* العناصر الإضافية */
.stat-trend,
.stat-info,
.stat-success,
.stat-warning {
    font-size: 18px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-trend,
.stat-card:hover .stat-info,
.stat-card:hover .stat-success,
.stat-card:hover .stat-warning {
    opacity: 1;
    transform: scale(1.1);
}

.stat-card.total .stat-trend { color: #667eea; }
.stat-card.shipped .stat-info { color: #43e97b; }
.stat-card.delivered .stat-success { color: #fa709a; }
.stat-card.canceled .stat-warning { color: #e53e3e; }

/* البادجات */
.stat-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* شريط التقدم */
.stat-progress {
    width: 60px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 3px;
    transition: width 1s ease;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* تأثيرات إضافية */
.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.stat-card:hover::after {
    opacity: 1;
    transform: rotate(45deg) translate(50%, 50%);
}