/**
 * ملف CSS الموحد للنظام
 * يحتوي على جميع أنماط التصميم المستخدمة في النظام
 */

:root {
  /* الألوان الرئيسية */
  --primary-color: #1e88e5;
  --primary-dark: #1565c0;
  --primary-light: #64b5f6;
  --secondary-color: #f8b500;
  --secondary-dark: #e6a700;
  --secondary-light: #ffd54f;
  
  /* ألوان الحالات */
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --info-color: #2196f3;
  
  /* ألوان الخلفية والنص */
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --text-color: #333333;
  --text-light: #757575;
  --text-dark: #212121;
  --border-color: #e0e0e0;
  
  /* الخصائص العامة */
  --border-radius: 8px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* إعادة تعيين وأنماط عامة */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  direction: rtl;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

/* تخطيط الصفحة */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100vh;
  background-color: var(--primary-color);
  color: white;
  z-index: 1000;
  transition: var(--transition);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.main-content {
  margin-right: 260px;
  min-height: 100vh;
  transition: var(--transition);
}

/* شعار الشريط الجانبي */
.sidebar-logo {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-image {
  max-width: 120px;
  height: auto;
  margin-bottom: 10px;
}

.company-name {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* قائمة الشريط الجانبي */
.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-item {
  margin: 5px 0;
}

.sidebar-item a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
}

.sidebar-item a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-item.active a {
  background-color: var(--secondary-color);
  color: var(--text-dark);
  font-weight: 500;
}

.sidebar-item i {
  margin-left: 10px;
  width: 20px;
  text-align: center;
}

/* معلومات المستخدم */
.user-info {
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
}

.user-details {
  flex-grow: 1;
  overflow: hidden;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role, .user-branch {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* الشريط العلوي */
.top-bar {
  background-color: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.top-bar-left {
  display: flex;
  align-items: center;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 18px;
  cursor: pointer;
  margin-left: 15px;
  display: none;
}

.page-title {
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}

.user-dropdown {
  position: relative;
}

.user-dropdown-toggle {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  color: var(--text-color);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--border-radius);
}

.user-dropdown-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.user-dropdown-toggle i {
  margin-left: 5px;
}

.user-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 1000;
  display: none;
}

.user-dropdown-menu a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: var(--text-color);
}

.user-dropdown-menu a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.user-dropdown-menu a i {
  margin-left: 10px;
  width: 20px;
  text-align: center;
}

.user-dropdown:hover .user-dropdown-menu {
  display: block;
}

/* محتوى الصفحة */
.page-content {
  padding: 20px;
}

/* تذييل الصفحة */
.footer {
  text-align: center;
  padding: 15px;
  color: var(--text-light);
  font-size: 14px;
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 14px;
}

.btn i {
  margin-left: 8px;
}

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

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

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  color: var(--text-dark);
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: #388e3c;
  color: white;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

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

.btn-warning {
  background-color: var(--warning-color);
  color: white;
}

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

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* الجداول */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: right;
}

.data-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 500;
}

.data-table tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

.data-table tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* شارات الحالة */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background-color: rgba(76, 175, 80, 0.2);
  color: #2e7d32;
}

.status-inactive {
  background-color: rgba(158, 158, 158, 0.2);
  color: #616161;
}

.status-قيد-المعالجة,
.status-pending {
  background-color: rgba(33, 150, 243, 0.2);
  color: #1565c0;
}

.status-قيد-التوصيل,
.status-in-transit {
  background-color: rgba(255, 152, 0, 0.2);
  color: #ef6c00;
}

.status-تم-التسليم,
.status-delivered {
  background-color: rgba(76, 175, 80, 0.2);
  color: #2e7d32;
}

.status-ملغى,
.status-cancelled {
  background-color: rgba(244, 67, 54, 0.2);
  color: #c62828;
}

/* شارات الأدوار */
.role-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.role-admin {
  background-color: rgba(156, 39, 176, 0.2);
  color: #7b1fa2;
}

.role-manager {
  background-color: rgba(33, 150, 243, 0.2);
  color: #1565c0;
}

.role-user {
  background-color: rgba(76, 175, 80, 0.2);
  color: #2e7d32;
}

/* أزرار الإجراءات */
.actions {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transition: var(--transition);
  color: white;
}

.view-btn {
  background-color: var(--info-color);
}

.view-btn:hover {
  background-color: #1976d2;
  color: white;
}

.edit-btn {
  background-color: var(--warning-color);
}

.edit-btn:hover {
  background-color: #f57c00;
  color: white;
}

.delete-btn {
  background-color: var(--danger-color);
}

.delete-btn:hover {
  background-color: #d32f2f;
  color: white;
}

.print-btn {
  background-color: var(--secondary-color);
  color: var(--text-dark);
}

.print-btn:hover {
  background-color: var(--secondary-dark);
  color: var(--text-dark);
}

/* التنبيهات */
.alert {
  padding: 12px 15px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  position: relative;
}

.alert-success {
  background-color: rgba(76, 175, 80, 0.2);
  color: #2e7d32;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.alert-error,
.alert-danger {
  background-color: rgba(244, 67, 54, 0.2);
  color: #c62828;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.alert-warning {
  background-color: rgba(255, 152, 0, 0.2);
  color: #ef6c00;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.alert-info {
  background-color: rgba(33, 150, 243, 0.2);
  color: #1565c0;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.alert-close {
  position: absolute;
  top: 10px;
  left: 10px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

.alert-close:hover {
  opacity: 1;
}

/* النماذج */
.form-container {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.form-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
}

.form-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.form-section {
  margin-bottom: 25px;
}

.section-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 15px;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.section-title i {
  margin-left: 8px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.form-group {
  flex: 1;
  min-width: 250px;
  padding: 0 10px;
  margin-bottom: 15px;
}

.form-group.full-width {
  flex-basis: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.2);
}

.form-text {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 5px;
}

.required {
  color: var(--danger-color);
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* ترقيم الصفحات */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.pagination-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination-item {
  margin: 0 2px;
}

.pagination-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius);
  background-color: white;
  color: var(--text-color);
  transition: var(--transition);
}

.pagination-link:hover {
  background-color: var(--primary-light);
  color: white;
}

.pagination-item.active .pagination-link {
  background-color: var(--primary-color);
  color: white;
}

/* وسائط الاستجابة */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-right: 0;
  }
  
  .sidebar-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .form-group {
    flex-basis: 100%;
  }
}

@media (max-width: 576px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .top-bar-right {
    margin-top: 10px;
    align-self: flex-end;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}
