/* ===== متغيرات التصميم المحدثة ===== */
:root {
  /* نظام ألوان حديث وعصري */
  --bg: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --card: #16213e;
  --card-hover: #1f2a4e;
  --primary: #6c63ff;
  --primary-light: #8a84ff;
  --primary-dark: #554fd8;
  --accent: #00b894;
  --accent-light: #00d9a5;
  --accent-dark: #009975;
  --text: #e2e2e2;
  --text-secondary: #a0a0b0;
  --text-muted: #6c6c7d;
  --border: rgba(108, 99, 255, 0.15);
  --border-light: rgba(255, 255, 255, 0.05);
  
  /* ألوان الحالة */
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #ff7675;
  --info: #74b9ff;
  --success-light: rgba(0, 184, 148, 0.15);
  --warning-light: rgba(253, 203, 110, 0.15);
  --danger-light: rgba(255, 118, 117, 0.15);
  --info-light: rgba(116, 185, 255, 0.15);
  
  /* الأبعاد والمسافات */
  --sidebar-width: 280px;
  --header-height: 70px;
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --border-radius-lg: 20px;
  
  /* الظلال المحسنة */
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.4);
  --shadow-primary: 0 8px 24px rgba(108, 99, 255, 0.2);
  --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.1);
  
  /* التحولات والحركات */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* التدرجات */
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-dark));
  --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent-dark));
  --gradient-card: linear-gradient(145deg, #16213e, #1a1a2e);
  --gradient-sidebar: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 100%);
}

/* ===== إعدادات عامة محسنة ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary, 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* خلفية حديثة بتأثيرات متقدمة */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 15% 50%, rgba(108, 99, 255, 0.05) 0%, transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 184, 148, 0.05) 0%, transparent 25%),
    radial-gradient(circle at 50% 80%, rgba(26, 26, 46, 0.8) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* نمط شبكي حديث */
.grid-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.02;
  pointer-events: none;
  z-index: -1;
  background-image: 
    linear-gradient(rgba(108, 99, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 99, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* الروابط المحسنة */
a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

a:hover {
  color: var(--primary-light);
}

/* العناوين المحدثة */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75em;
  color: var(--text);
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--text), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
  color: var(--text);
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1.1rem;
}
label{
  color: var(--text);
}

/* النصوص المحسنة */
p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-accent {
  color: var(--accent) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

/* ===== تخطيط لوحة التحكم المحسن ===== */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: var(--bg);
}

/* الشريط الجانبي المحدث */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gradient-sidebar);
  border-left: 1px solid var(--border);
  padding: 0;
  position: fixed;
  height: 100vh;
  height: -webkit-fill-available;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  right: 0;
  top: 0;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(10px);
}

.sidebar-header {
  padding: 30px 25px 25px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 10px;
  padding-top: calc(20px + var(--safe-area-inset-top));
  background: rgba(15, 15, 26, 0.8);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.sidebar-logo img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: var(--shadow-primary);
}

.sidebar-logo span {
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-menu {
  list-style: none;
  padding: 0 15px;
}

.sidebar-menu li {
  margin-bottom: 4px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border-radius: var(--border-radius-sm);
  position: relative;
  font-weight: 500;
  gap: 12px;
}

.sidebar-menu a:hover, 
.sidebar-menu a.active {
  background: rgba(108, 99, 255, 0.1);
  color: var(--primary);
  transform: translateX(-4px);
}

.sidebar-menu a.active {
  background: rgba(108, 99, 255, 0.15);
  border-left: 3px solid var(--primary);
}

.sidebar-menu i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

.menu-label {
  padding: 20px 16px 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 10px;
}

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(0, 0, 0, 0.2);
  margin: 0 -15px;
  padding: 0 15px;
}

.submenu.active {
  max-height: 500px;
}

.submenu a {
  padding-right: 40px;
  font-size: 0.9rem;
  padding: 12px 16px 12px 48px;
}

.has-submenu {
  position: relative;
}

.has-submenu::after {
  content: "\f107";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 20px;
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.has-submenu.active::after {
  transform: rotate(180deg);
  color: var(--primary);
}

/* المحتوى الرئيسي المحدث */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  padding: 30px;
  padding-top: calc(var(--header-height) + 30px);
  transition: var(--transition);
  width: 100%;
  background: var(--bg);
}

/* الهيدر العلوي المحدث */
.top-header {
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  position: fixed;
  top: 0;
  right: var(--sidebar-width);
  left: 0;
  z-index: 900;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  padding-left: calc(30px + var(--safe-area-inset-left));
  padding-right: calc(30px + var(--safe-area-inset-right));
  padding-top: var(--safe-area-inset-top);
  height: calc(var(--header-height) + var(--safe-area-inset-top));
}

.page-title {
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--text), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* شريط البحث المحدث */
.search-box {
  position: relative;
}

.search-box input {
  background: rgba(26, 26, 46, 0.8);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px 12px 40px;
  color: var(--text);
  width: 280px;
  transition: var(--transition);
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
  width: 320px;
  background: rgba(26, 26, 46, 0.95);
}

.search-box i {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: var(--transition);
}

.search-box input:focus + i {
  color: var(--primary);
}

/* قائمة المستخدم المحدثة */
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 12px;
  transition: var(--transition);
  background: rgba(26, 26, 46, 0.8);
  border: 1px solid transparent;
}

.user-menu:hover {
  background: rgba(108, 99, 255, 0.1);
  border-color: var(--border);
  transform: translateY(-1px);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow-primary);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.user-role {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* زر الإشعارات المحدث */
.notification-btn {
  position: relative;
  background: rgba(26, 26, 46, 0.8);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.notification-btn:hover {
  color: var(--primary);
  background: rgba(108, 99, 255, 0.1);
  border-color: var(--border);
  transform: translateY(-1px);
}

.notification-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 184, 148, 0.3);
}

/* زر القائمة للجوال */
.menu-toggle {
  display: none;
  background: rgba(26, 26, 46, 0.8);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition);
  position: fixed;
  left: calc(20px + var(--safe-area-inset-left));
  top: calc(20px + var(--safe-area-inset-top));
  z-index: 950;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.menu-toggle:hover {
  background: rgba(108, 99, 255, 0.1);
  transform: translateY(-1px);
}

/* الظل للقائمة الجانبية */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ===== المكونات العامة المحدثة ===== */

/* البطاقات المحدثة */
.card {
  background: var(--gradient-card);
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(108, 99, 255, 0.3);
  transform: translateY(-2px);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.card-body {
  padding: 10px 0;
}

.card-footer {
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
}

/* البطاقات الإحصائية المحدثة */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--gradient-card);
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(108, 99, 255, 0.3);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(108, 99, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 1.4rem;
  transition: var(--transition);
}

.stat-card:hover .stat-icon {
  background: rgba(108, 99, 255, 0.2);
  transform: scale(1.05);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.2;
}

.stat-title {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 12px;
  font-weight: 500;
}

.stat-change {
  display: flex;
  align-items: center;
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.change-up {
  color: var(--accent);
}

.change-down {
  color: var(--danger);
}

/* الأزرار المحدثة */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gradient-primary);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-primary);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition-slow);
}

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

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(108, 99, 255, 0.1);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), var(--accent-dark));
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #f39c12);
  color: #000;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #e74c3c);
}

.btn-info {
  background: linear-gradient(135deg, var(--info), #3498db);
}

.btn-light {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.btn-light:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-group {
  display: inline-flex;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.btn-group .btn {
  border-radius: 0;
  margin: 0;
  box-shadow: none;
}

.btn-group .btn:first-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.btn-group .btn:last-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

/* النماذج والإدخالات المحدثة - تم التعديل لتحسين رؤية النص */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text); /* تأكد من أن لون النص واضح */
  transition: var(--transition);
  font-family: inherit;
  font-size: 0.95rem;
  backdrop-filter: blur(10px);
}

.form-control:focus {
  color: var(--text);
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
  background: rgba(26, 26, 46, 0.95);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  width: 100%;
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 14px 45px;
  color: var(--text); /* تأكد من أن لون النص واضح */
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 15l-4.243-4.243 1.415-1.414L12 12.172l2.828-2.829 1.415 1.414z' fill='%236c63ff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  backdrop-filter: blur(10px);
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
  background: rgba(26, 26, 46, 0.95);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.form-check-input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.form-check-label {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.form-text {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.input-group {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.input-group .form-control {
  border-radius: 0;
  flex: 1;
  border: none;
}

.input-group .btn {
  border-radius: 0;
  box-shadow: none;
}

.input-group .form-control:first-child,
.input-group .btn:first-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.input-group .form-control:last-child,
.input-group .btn:last-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

/* الحالة المحدثة */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.status-completed {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(0, 184, 148, 0.3);
}

.status-pending {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(253, 203, 110, 0.3);
}

.status-canceled {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(255, 118, 117, 0.3);
}

.status-info {
  background: var(--info-light);
  color: var(--info);
  border: 1px solid rgba(116, 185, 255, 0.3);
}

/* الجداول المحدثة */
.table-responsive {
  overflow-x: auto;
  width: 100%;
  border-radius: var(--border-radius);
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow);
  background: var(--gradient-card);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

th, td {
  padding: 16px 20px;
  text-align: right;
  border-bottom: 1px solid var(--border-light);
}

th {
  color: var(--text);
  font-weight: 600;
  background: rgba(26, 26, 46, 0.8);
  white-space: nowrap;
  font-size: 0.9rem;
  border-bottom: 2px solid var(--border);
}

tr {
  transition: var(--transition);
}

tr:hover {
  background: rgba(108, 99, 255, 0.05);
}

.action-btn {
  background: rgba(108, 99, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(108, 99, 255, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  margin-left: 6px;
  font-weight: 500;
}

.action-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-primary);
}

/* التقدم والتحميل المحدث */
.progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0;
  backdrop-filter: blur(10px);
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.progress-success {
  background: linear-gradient(135deg, var(--success), var(--accent-dark));
}

.progress-warning {
  background: linear-gradient(135deg, var(--warning), #f39c12);
}

.progress-danger {
  background: linear-gradient(135deg, var(--danger), #e74c3c);
}

/* ===== وسائط الاستجابة المحدثة ===== */
@media (max-width: 1200px) {
  .sidebar {
    width: 260px;
  }
  
  .main-content {
    margin-right: 260px;
  }
  
  .top-header {
    right: 260px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(100%);
    width: 85%;
    max-width: 320px;
  }
  
  .sidebar.active {
    transform: translateX(0);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  }
  
  .main-content {
    margin-right: 0;
    padding: 20px;
    padding-top: calc(var(--header-height) + 20px);
  }
  
  .top-header {
    right: 0;
    padding-left: calc(70px + var(--safe-area-inset-left));
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .search-box input {
    width: 200px;
  }
  
  .search-box input:focus {
    width: 240px;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .header-actions {
    gap: 12px;
  }
  
  .user-info {
    display: none;
  }
  
  .search-box {
    display: none;
  }
}

@media (max-width: 576px) {
  :root {
    --header-height: 60px;
  }
  
  .main-content {
    padding: 15px;
    padding-top: calc(var(--header-height) + 15px);
  }
  
  .card {
    padding: 20px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .sidebar {
    width: 90%;
  }
  
  .page-title {
    font-size: 1.3rem;
  }
  
  .btn-group {
    flex-direction: column;
    border-radius: 12px;
  }
  
  .btn-group .btn {
    border-radius: 0;
  }
  
  .btn-group .btn:first-child {
    border-radius: 12px 12px 0 0;
  }
  
  .btn-group .btn:last-child {
    border-radius: 0 0 12px 12px;
  }
}

/* تأثيرات خاصة مضافة */
.glass-effect {
  background: rgba(26, 26, 46, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hover-lift {
  transition: var(--transition);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* تحسينات شريط التمرير */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(108, 99, 255, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(108, 99, 255, 0.5);
}

/* تحسينات للأجهزة التي تعمل باللمس */
@media (hover: none) {
  .hover-lift:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .card:hover {
    transform: none;
  }
}

/* تحسينات الأداء */
.will-change {
  will-change: transform;
}

/* تأثيرات الظهور المتحسن */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.zoom-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* طبقات المساعدة المحدثة */
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }

.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }

.items-start { align-items: flex-start !important; }
.items-center { align-items: center !important; }
.items-end { align-items: flex-end !important; }

.gap-1 { gap: 0.5rem !important; }
.gap-2 { gap: 1rem !important; }
.gap-3 { gap: 1.5rem !important; }
.gap-4 { gap: 2rem !important; }

.w-full { width: 100% !important; }
.h-full { height: 100% !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 1rem !important; }
.p-3 { padding: 1.5rem !important; }
.p-4 { padding: 2rem !important; }

.rounded { border-radius: var(--border-radius) !important; }
.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.rounded-full { border-radius: 50% !important; }

.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-hover) !important; }
.shadow-primary { box-shadow: var(--shadow-primary) !important; }

/* تأثيرات متقدمة */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 2s infinite;
}

/* تحسينات الوضع الداكن */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a14;
    --bg-secondary: #151525;
    --card: #13132b;
  }
}

/* تحسينات خاصة لـ Safari */
@supports (-webkit-touch-callout: none) {
  .dashboard-container {
    height: -webkit-fill-available;
  }
  
  .sidebar {
    height: -webkit-fill-available;
  }
}

/* طبقة safe area للشاشات الحديثة */
@supports (padding: max(0px)) {
  .main-content {
    padding-left: max(30px, env(safe-area-inset-left));
    padding-right: max(30px, env(safe-area-inset-right));
  }
  
  .sidebar {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* ===== تخصيص DataTables ===== */
.dataTables_wrapper {
  background: var(--gradient-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 24px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
  color: var(--text) !important;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  transition: var(--transition);
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text) !important;
  background: rgba(26, 26, 46, 0.8) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  margin: 0 2px !important;
  transition: var(--transition) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: rgba(108, 99, 255, 0.1) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  color: var(--text-muted) !important;
  background: rgba(26, 26, 46, 0.5) !important;
  border-color: var(--border) !important;
}

/* تخصيص كل جداول ال DataTables في النظام */
table.dataTable {
  width: 100% !important;
  border-collapse: collapse;
}

/* رأس الجدول */
table.dataTable thead th {
  background: rgba(26, 26, 46, 0.9) !important;
  color: var(--text) !important;
  font-weight: 600;
  border-bottom: 2px solid var(--border) !important;
  padding: 16px 12px !important;
  text-align: right;
}

/* خلايا الجسم */
table.dataTable tbody td {
  background: var(--card) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border-light) !important;
  padding: 14px 12px !important;
  text-align: right;
}

/* السطر */
table.dataTable tbody tr {
  transition: var(--transition);
}

/* الهوفر على السطر */
table.dataTable tbody tr:hover {
  background: rgba(108, 99, 255, 0.05) !important;
}

/* ===== ترويسة DataTable ===== */
.datatable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.datatable-title {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.datatable-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== أدوات DataTable ===== */
.datatable-tools {
  background: var(--gradient-card);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.datatable-search {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.datatable-search input {
  width: 100%;
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 45px 12px 16px;
  color: var(--text);
  transition: var(--transition);
  font-size: 0.95rem;
}

.datatable-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.datatable-search i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.datatable-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== تخصيص SweetAlert ===== */
.swal2-popup {
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%) !important;
  border: 1px solid #6c63ff !important;
  border-radius: 15px !important;
  color: #e9ecef !important;
  box-shadow: 0 10px 30px rgba(108, 99, 255, 0.3) !important;
}

/* تخصيص العنوان */
.swal2-title {
  color: #6c63ff !important;
  font-weight: 700 !important;
  font-size: 1.5rem !important;
  border-bottom: 2px solid #6c63ff !important;
  padding-bottom: 0.5rem !important;
  margin-bottom: 1rem !important;
}

/* تخصيص محتوى النص */
.swal2-html-container {
  color: #e9ecef !important;
}

/* تخصيص الأزرار */
.swal2-confirm {
  background: linear-gradient(135deg, #6c63ff 0%, #5a52d5 100%) !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0.5rem 2rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

.swal2-confirm:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4) !important;
}

/* زر الإلغاء */
.swal2-cancel {
  background: transparent !important;
  border: 1px solid #6c63ff !important;
  color: #6c63ff !important;
  border-radius: 8px !important;
  padding: 0.5rem 2rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

.swal2-cancel:hover {
  background: rgba(108, 99, 255, 0.1) !important;
  transform: translateY(-2px) !important;
}

/* تخصيص زر الإغلاق */
.swal2-close {
  color: #6c63ff !important;
  transition: all 0.3s ease !important;
}

.swal2-close:hover {
  color: #ff6b6b !important;
  transform: scale(1.1) !important;
}

/* تخصيص الأيقونات */
.swal2-icon {
  border-color: #6c63ff !important;
  color: #6c63ff !important;
}

/* تخصيص شريط التمرير */
.swal2-popup ::-webkit-scrollbar {
  width: 6px !important;
}

.swal2-popup ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 3px !important;
}

.swal2-popup ::-webkit-scrollbar-thumb {
  background: #6c63ff !important;
  border-radius: 3px !important;
}

.swal2-popup ::-webkit-scrollbar-thumb:hover {
  background: #5a52d5 !important;
}

/* صفحة تسجيل الدخول */

/* تأثيرات الخلفية */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 20s infinite linear;
}

.bg-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    right: 5%;
    animation-delay: 0s;
}

.bg-circle:nth-child(2) {
    width: 150px;
    height: 150px;
    bottom: 15%;
    left: 10%;
    animation-delay: -5s;
    animation-duration: 15s;
}

.bg-circle:nth-child(3) {
    width: 200px;
    height: 200px;
    bottom: 25%;
    right: 15%;
    animation-delay: -10s;
    animation-duration: 25s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 1;
    }
}

/* صفحة تسجيل الدخول */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: radial-gradient(circle at 20% 20%, rgba(108,99,255,0.08), transparent 30%), radial-gradient(circle at 80% 80%, rgba(0,212,255,0.08), transparent 35%), #0b1020;
}

/* الحاوية الرئيسية */
.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
}

/* بطاقة الدخول */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 50px 40px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: var(--transition);
}

.login-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* الهيدر */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
}

.logo-icon {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    position: relative;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}

.logo-icon::after {
    content: '';
    position: absolute;
    width: 110%;
    height: 110%;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.2);
    animation: ripple 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--gray);
    font-size: 16px;
    font-weight: 500;
}

/* النموذج */
.login-page .login-form {
    margin-bottom: 30px;
}

.login-page .form-group {
    margin-bottom: 25px;
    position: relative;
}

.login-page .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
    transition: var(--transition);
}

.login-card .login-input-group {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: var(--transition);
    background: radial-gradient(circle at 20% 20%, rgba(108, 99, 255, 0.08), transparent 30%), radial-gradient(circle at 80% 80%, rgba(0, 212, 255, 0.08), transparent 35%), #0b1020;
}

.login-card .login-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.login-card .login-input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 18px;
    z-index: 1;
    transition: var(--transition);
}

.login-card .login-input-group:focus-within .login-input-icon {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.login-card .login-input {
    width: 100%;
    padding: 18px 60px 18px 20px;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--dark);
    background: transparent;
    transition: var(--transition);
}

.login-card .login-input:focus {
    outline: none;
}

.login-card .login-input::placeholder {
    color: var(--gray);
    opacity: 0.7;
}

/* زر إظهار/إخفاء كلمة المرور */
.login-card .login-password-toggle {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
    z-index: 2;
}

.login-card .password-toggle:hover {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

/* زر الدخول */
.login-page .btn-login {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.login-page .btn-login:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.login-page .btn-login:active {
    transform: translateY(-1px);
}

.login-page .btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}

.login-page .btn-login:hover::before {
    left: 100%;
}

.login-page .btn-login i {
    font-size: 20px;
    transition: var(--transition);
}

.login-page .btn-login:hover i {
    transform: translateX(5px);
}

/* روابط إضافية */
.login-page .login-footer {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.login-page .forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.login-page .forgot-password:hover {
    color: var(--primary-dark);
    gap: 12px;
}

/* إطار الأمان */
.login-page .security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 214, 143, 0.1), rgba(102, 126, 234, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(0, 214, 143, 0.2);
    color: var(--success);
    font-size: 14px;
    font-weight: 600;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(0, 214, 143, 0.2);
    }
    to {
        box-shadow: 0 0 20px rgba(0, 214, 143, 0.4);
    }
}

.login-page .security-badge i:first-child {
    animation: lock 2s ease-in-out infinite;
}

@keyframes lock {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* رسائل الخطأ */
.login-page .alert-danger {
    background: linear-gradient(135deg, var(--danger), #ff4757);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: shake 0.5s;
    box-shadow: 0 5px 15px rgba(255, 61, 113, 0.3);
}

.login-page .alert-danger i {
    font-size: 20px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* مؤشر التحميل */
.login-page .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(34, 43, 69, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.login-page .loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

/* تأثير الدخول الناجح */
.login-page .login-success {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.login-page .success-content {
    text-align: center;
    color: white;
    animation: fadeInUp 0.6s;
}

.login-page .success-icon {
    font-size: 100px;
    color: var(--success);
    margin-bottom: 30px;
    animation: bounce 1s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* التجاوب */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .login-card {
        padding: 40px 30px;
    }
    
    .logo-container {
        width: 80px;
        height: 80px;
    }
    
    .logo-icon {
        font-size: 32px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .login-header p {
        font-size: 15px;
    }
    
    .form-control {
        padding: 16px 50px 16px 20px;
        font-size: 15px;
    }
    
    .btn-login {
        padding: 16px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .logo-container {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .logo-icon {
        font-size: 28px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
    
    .form-control {
        padding: 14px 45px 14px 20px;
    }
    
    .security-badge {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        font-size: 13px;
    }
    
    .bg-circle {
        display: none;
    }
}

/* تأثيرات الدخول */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* تأخير الدخول للعناصر */
.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.btn-login { animation-delay: 0.3s; }
.login-footer { animation-delay: 0.4s; }
.security-badge { animation-delay: 0.5s; }

/* تأثيرات خاصة للأجهزة التي تدعم hover */
@media (hover: hover) {
    .btn-login:hover i {
        animation: arrowMove 0.6s;
    }
    
    @keyframes arrowMove {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(5px); }
    }
}

/* الدعم القديم */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* الألوان المظلمة */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #f7f9fc;
        --light: #222b45;
        --gray: #8f9bb3;
        --border: #2e3a59;
    }
    
    .login-card {
        background: rgba(34, 43, 69, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .input-group {
        background: #1a2138;
        border-color: #2e3a59;
    }
    
    .input-group:focus-within {
        border-color: var(--primary);
    }
}

/* ===== تخصيص صفحة الإعدادات ===== */
.settings-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(108, 99, 255, 0.2);
}

.settings-section:last-child {
  border-bottom: none;
}

.section-title {
  color: #6c63ff;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(108, 99, 255, 0.3);
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(108, 99, 255, 0.2);
}

.form-actions .btn {
  min-width: 150px;
}

.alert-info {
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.3);
  color: #e9ecef;
}

.input-group-text {
  background: rgba(108, 99, 255, 0.2);
  border: 1px solid rgba(108, 99, 255, 0.3);
  color: #6c63ff;
}

.preview-img {
  border: 1px solid #444;
  padding: 6px;
  border-radius: 8px;
  background: #111;
}

.settings-section {
  padding: 15px;
  background: rgba(20, 20, 40, 0.85);
  border-radius: 12px;
  border: 1px solid #333;
  margin-bottom: 20px;
}

.settings-section .section-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #6c63ff;
}

.settings-section .form-group {
  margin-bottom: 15px;
}

.form-row {
  display: flex;
  gap: 15px;
}
.form-row .form-group {
  flex: 1;
}

/* ===== مكونات إضافية للتأكد من اكتمال التصميم ===== */

/* تبويبات التنقل */
.nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.nav-tabs .nav-link {
  padding: 12px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-weight: 500;
  cursor: pointer;
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(108, 99, 255, 0.05);
}

.nav-tabs .nav-link:hover:not(.active) {
  color: var(--primary-light);
  background: rgba(108, 99, 255, 0.02);
}

/* الرسوم البيانية والحاويات */
.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.chart-card {
  background: var(--gradient-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  transition: var(--transition);
}

.chart-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(108, 99, 255, 0.3);
}

.chart-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* تنبيهات وإشعارات */
.alert {
  padding: 16px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border-left: 4px solid;
  backdrop-filter: blur(10px);
}

.alert-success {
  background: var(--success-light);
  border-left-color: var(--success);
  color: var(--success);
}

.alert-warning {
  background: var(--warning-light);
  border-left-color: var(--warning);
  color: var(--warning);
}

.alert-danger {
  background: var(--danger-light);
  border-left-color: var(--danger);
  color: var(--danger);
}

.alert-info {
  background: var(--info-light);
  border-left-color: var(--info);
  color: var(--info);
}

/* راديو وبوتونات التبديل المحسنة */
.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--primary);
  border-color: var(--primary);
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
  background-color: white;
  transform: translateX(0.75rem);
}

/* تحسينات إضافية للاستجابة */
@media (max-width: 480px) {
  .datatable-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .datatable-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .charts-container {
    grid-template-columns: 1fr;
  }
  
  .chart-card {
    padding: 16px;
  }
}

/* تحسينات الوصول */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* تحسينات الطباعة */
@media print {
  .sidebar,
  .top-header,
  .menu-toggle {
    display: none !important;
  }
  
  .main-content {
    margin-right: 0 !important;
    padding: 0 !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}


/* ===== تخصيصات المودال ===== */
.modal-content {
    background: var(--gradient-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-hover);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}

.modal-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.modal-body {
    background: var(--card);
    max-height: 70vh;
    overflow-y: auto;
}

/* ===== تخصيصات الحقول ===== */
.form-container {
    padding: 0.5rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .form-control {
    padding-right: 45px;
    padding-left: 45px;
}

.input-with-icon .input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ===== تخصيصات قائمة الأيقونات ===== */
.icons-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(15, 15, 26, 0.5);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
}

.icon-item {
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    padding: 10px;
}

.icon-item:hover {
    background: rgba(108, 99, 255, 0.1);
    border-color: var(--border);
    transform: translateY(-2px);
}

.icon-item.selected {
    background: rgba(108, 99, 255, 0.2);
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

.icon-item i {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.icon-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== تخصيصات شريط البحث ===== */
.icon-search {
    max-width: 200px;
}

.icon-search .form-control {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    padding: 8px 12px;
}

.icon-search .form-control:focus {
    background: rgba(26, 26, 46, 0.95);
}

/* ===== تخصيصات تصنيفات الأيقونات ===== */
.icon-categories .btn-light.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== تخصيصات التنقل ===== */
.icons-pagination .page-link {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid var(--border);
    color: var(--text);
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.icons-pagination .page-link:hover {
    background: rgba(108, 99, 255, 0.1);
    border-color: var(--primary);
}

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

/* ===== تخصيصات زر التحميل ===== */
.loading-icons {
    grid-column: 1 / -1;
}

/* ===== تخصيصات شريط التمرير ===== */
.icons-container::-webkit-scrollbar {
    width: 6px;
}

.icons-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.icons-container::-webkit-scrollbar-thumb {
    background: rgba(108, 99, 255, 0.3);
    border-radius: 3px;
}

.icons-container::-webkit-scrollbar-thumb:hover {
    background: rgba(108, 99, 255, 0.5);
}

/* ===== وسائط الاستجابة للمودال ===== */
@media (max-width: 768px) {
    .icons-container {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        max-height: 250px;
    }
    
    .icon-item {
        width: 50px;
        height: 50px;
    }
    
    .icon-item i {
        font-size: 1.1rem;
    }
    
    .modal-body {
        max-height: 80vh;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 20px !important;
    }
    
    .icons-container {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 8px;
        padding: 10px;
    }
    
    .icon-item {
        width: 45px;
        height: 45px;
    }
    
    .form-actions .d-flex {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}


/* علامة مائية */
.site-watermark {
    position: fixed;
    inset: auto 12px 12px auto;
    padding: 8px 12px;
    background: rgba(0,0,0,0.18);
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    letter-spacing: 0.5px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 99999;
    text-transform: uppercase;
    font-weight: 700;
}
.site-watermark a {
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
}

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