/* ===== المتغيرات الأساسية ===== */
:root {
  --primary: #7c3aed;
  --primary-light: #9d5cf6;
  --primary-dark: #5b21b6;
  --secondary: #06b6d4;
  --secondary-light: #22d3ee;
  --accent: #f59e0b;

  --bg-base: #070714;
  --bg-surface: #0e0e26;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(20, 20, 50, 0.6);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(124, 58, 237, 0.5);

  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --cyan: #06b6d4;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --glow: 0 0 30px rgba(124, 58, 237, 0.3);
}

/* ===== إعادة التهيئة ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== الجسيمات ===== */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  animation: float linear infinite;
}

.particle:nth-child(odd) { background: var(--secondary); }
.particle:nth-child(3n) { background: var(--accent); }

@keyframes float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* ===== خلفية متدرجة ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 10%, rgba(124,58,237,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 600px 500px at 80% 80%, rgba(6,182,212,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 50% 50%, rgba(124,58,237,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== Glassmorphism Card ===== */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== أنيميشن الظهور ===== */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.5s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes slideUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== صفحة الدخول ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: slideUp 0.6s ease both;
}

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

.logo-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(6,182,212,0.2));
  border: 1px solid var(--border);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: var(--glow);
  animation: pulse-glow 3s ease-in-out infinite;
}

.logo-icon.small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  margin: 0;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(124,58,237,0.3); }
  50% { box-shadow: 0 0 40px rgba(124,58,237,0.6), 0 0 60px rgba(6,182,212,0.2); }
}

.logo-text {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.logo-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.login-card {
  width: 100%;
  padding: 36px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

/* ===== Form Elements ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  right: 14px;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.input-wrapper input[type="text"],
.input-wrapper input[type="password"] {
  padding-right: 44px;
  padding-left: 44px;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.05);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

input::placeholder { color: var(--text-muted); }

.toggle-password {
  position: absolute;
  left: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 4px;
  transition: opacity 0.2s;
}

.toggle-password:hover { opacity: 0.7; }

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

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 0.875rem;
  color: #fca5a5;
}

/* ===== Buttons ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover::before { opacity: 1; }

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary.btn-full { width: 100%; justify-content: center; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

.btn-secondary.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* ===== الهيدر ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-brand {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.green {
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--green);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* ===== المحتوى الرئيسي ===== */
.main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ===== بطاقات الإحصائيات ===== */
.stats-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.purple { background: rgba(124,58,237,0.2); border: 1px solid rgba(124,58,237,0.3); }
.stat-icon.green  { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); }
.stat-icon.red    { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.3); }
.stat-icon.cyan   { background: rgba(6,182,212,0.15);  border: 1px solid rgba(6,182,212,0.3); }

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== شريط الأدوات ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
}

/* ===== شبكة البوتات ===== */
.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ===== بطاقة البوت ===== */
.bot-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  animation: slideUp 0.4s ease both;
}

.bot-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(0,0,0,0.5);
  border-color: rgba(124, 58, 237, 0.25);
}

.bot-card.running {
  border-color: rgba(34, 197, 94, 0.25);
}

.bot-card.error {
  border-color: rgba(239, 68, 68, 0.25);
}

/* رأس البطاقة */
.bot-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.bot-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(6,182,212,0.3));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bot-info {
  flex: 1;
  min-width: 0;
}

.bot-name {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-username {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* شارة الحالة */
.bot-status-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

.bot-status-badge.running {
  background: rgba(34,197,94,0.15);
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.3);
}

.bot-status-badge.stopped {
  background: rgba(148,163,184,0.1);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.bot-status-badge.error {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
}

.bot-status-badge.restarting {
  background: rgba(245,158,11,0.15);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,0.3);
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* معلومات البوت */
.bot-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.bot-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* أزرار التحكم */
.bot-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bot-btn {
  flex: 1;
  min-width: 70px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  color: var(--text-secondary);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.bot-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.bot-btn.start:hover { border-color: rgba(34,197,94,0.4); color: #86efac; }
.bot-btn.stop:hover  { border-color: rgba(239,68,68,0.4);  color: #fca5a5; }
.bot-btn.restart:hover { border-color: rgba(245,158,11,0.4); color: #fcd34d; }
.bot-btn.files:hover   { border-color: rgba(6,182,212,0.4);  color: #67e8f9; }
.bot-btn.logs:hover    { border-color: rgba(124,58,237,0.4); color: #c4b5fd; }
.bot-btn.edit:hover    { border-color: rgba(255,255,255,0.2); }
.bot-btn.delete:hover  { border-color: rgba(239,68,68,0.4); color: #fca5a5; }

/* ===== الحالة الفارغة ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-icon {
  font-size: 5rem;
  opacity: 0.3;
  animation: float-icon 4s ease-in-out infinite;
}

@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.empty-state h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 320px;
}

/* ===== المودالات ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  animation: slideUp 0.3s ease both;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal.modal-wide { max-width: 680px; }
.modal.modal-sm   { max-width: 420px; }

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.confirm-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.7;
}

/* ===== رفع الملفات ===== */
.files-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 32px;
  text-align: center;
  margin-bottom: 20px;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.files-upload-zone:hover,
.files-upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.05);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}

.upload-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
}

.file-icon { font-size: 1.1rem; }
.file-name { flex: 1; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 0.78rem; color: var(--text-muted); }

.file-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}

.file-delete:hover { color: #fca5a5; background: rgba(239,68,68,0.1); }

/* ===== اللوجز ===== */
.logs-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 300px;
  max-height: 420px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.8;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.log-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 0.75rem;
}

.log-msg { flex: 1; word-break: break-word; }
.log-msg.info  { color: var(--text-secondary); }
.log-msg.error { color: #fca5a5; }
.log-msg.warn  { color: #fcd34d; }

.logs-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-family: 'Tajawal', sans-serif;
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 260px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn 0.3s ease both;
  box-shadow: var(--shadow);
}

.toast.success { border-right: 3px solid var(--green); }
.toast.error   { border-right: 3px solid var(--red); }
.toast.warning { border-right: 3px solid var(--yellow); }
.toast.info    { border-right: 3px solid var(--primary); }

.toast.hiding { animation: toastOut 0.3s ease both; }

@keyframes toastIn {
  from { transform: translateX(-20px); opacity: 0; }
  to   { transform: translateX(0);      opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0);      opacity: 1; }
  to   { transform: translateX(-20px);  opacity: 0; }
}

/* ===== مساعدات ===== */
.hidden { display: none !important; }

/* اهتزاز عند الخطأ */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.shake { animation: shake 0.4s ease; }

/* ===== استجابة للشاشات الصغيرة ===== */
@media (max-width: 900px) {
  .stats-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .header-inner { padding: 12px 16px; }
  .main { padding: 20px 16px; }
  .stats-section { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 14px; }
  .stat-num { font-size: 1.5rem; }
  .bots-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px 20px; }
  .modal { padding: 20px 18px; }
}
