:root {
  --logo-x: 0px;
  --logo-y: 0px;
  --bg-color: #fff;
  --text-color: #000;
  --navbar-bg: #e0f1ff;
  --navbar-title-main: #000;
  --navbar-title-io: #1e90ff;
  --card-bg: #fff;
  --btn-bg: #fff;
  --btn-border: #1e90ff;
  --btn-text: #1e90ff;
  --btn-hover-bg: #e0f1ff;
  --btn-hover-text: #1e90ff;
  --input-bg: #f7fbff;
  --input-border: #b6d8f6;
  --input-focus: #1e90ff;
  --error-bg: #ffeaea;
  --error-text: #d32f2f;
  --shadow: 0 4px 24px rgba(30,144,255,0.07);
  --radius: 1.1rem;
  --transition: 0.25s cubic-bezier(.68,-0.55,.27,1.55);
  --crosshair-color: #1e90ff;
  --sidebar-bg: #e0f1ff;
  --sidebar-dark-bg: #111a2c;
  --sidebar-accent: #1e90ff;
  --sidebar-hover: #b6d8f6;
  --sidebar-text: #222;
  --sidebar-dark-text: #fff;
  --sidebar-shadow: 0 8px 32px 0 rgba(30,144,255,0.13);
  --sidebar-radius: 1.2rem;
  --sidebar-width: 270px;
  --sidebar-blur: 12px;
  --sidebar-item-radius: 0.8rem;
  --sidebar-item-active: #1e90ff22;
  --sidebar-item-hover: #1e90ff18;
  --sidebar-transition: 0.45s cubic-bezier(.68,-0.55,.27,1.55);
}
body.dark-mode {
  --bg-color: #0d0d0d;
  --text-color: #fff;
  --navbar-bg: #111a2c;
  --navbar-title-main: #fff;
  --navbar-title-io: #00d1ff;
  --card-bg: #181a1a;
  --btn-bg: rgba(255,255,255,0.04);
  --btn-border: #00d1ff;
  --btn-text: #00d1ff;
  --btn-hover-bg: #111a2c;
  --btn-hover-text: #00d1ff;
  --input-bg: #181a1a;
  --input-border: #222b3a;
  --input-focus: #00d1ff;
  --error-bg: #2c1a1a;
  --error-text: #ff6b6b;
  --shadow: 0 4px 24px rgba(0,209,255,0.09);
  --crosshair-color: #00d1ff;
  --sidebar-bg: #111a2c;
  --sidebar-dark-bg: #181a1a;
  --sidebar-accent: #00d1ff;
  --sidebar-hover: #222b3a;
  --sidebar-text: #fff;
  --sidebar-dark-text: #fff;
  --sidebar-shadow: 0 8px 32px 0 rgba(0,209,255,0.13);
  --sidebar-item-active: #00d1ff22;
  --sidebar-item-hover: #00d1ff18;
}

/* ==========================
   أساسيات الصفحة
========================== */


html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: 'Poppins', 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background 0.5s, color 0.3s;
  overflow-x: hidden;
  box-sizing: border-box;
}

 
/* الحاوية الرئيسية */
.main-container {
  width: 100%;
  max-width: 600px;
  padding: 20px;
  border-radius: 8px;
  background: var(--container-bg, #fff);
  margin: 0 auto;
  box-shadow: 0 0 15px rgba(0,0,0,0.05);
}

/* موبايل */
@media (max-width: 768px) {
  .main-container {
    padding: 15px;
    border-radius: 6px;
  }
}


.container {
  display: flex;
  justify-content: center;      /* توسيط أفقي فقط */
  /* align-items: center; */    /* احذف أو عطل هذا السطر */
  /* min-height: 100vh; */      /* احذف أو عطل هذا السطر */
  padding: 1rem;
  box-sizing: border-box;
  margin-top: 3rem;             /* مسافة بين الشعار والبطاقة */
}
/* موبايل */
@media (max-width: 768px) {
  .container {
    margin-top: 2rem;           /* مسافة أقل للجوال */
    padding: 0.5rem;
  }
}
.card {
  max-width: 420px;
  width: 100%;
  padding: 2.5rem 2rem 2rem 2rem;
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  box-sizing: border-box;
  border: 1.5px solid var(--input-border);
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 1.2s var(--transition) both;
}
@keyframes cardFadeIn {
  0% { opacity:0; transform:translateY(40px) scale(0.95);}
  100% { opacity:1; transform:translateY(0) scale(1);}
}
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.form-control {
  width: 100%;
  height: 48px;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 0.7rem;
  border: 1.5px solid var(--input-border);
  font-size: 1.08rem;
  background: var(--input-bg);
  color: var(--text-color);
  padding-right: 1.1rem;
  padding-left: 1.1rem;
  margin-bottom: 0; 
  transition: border-color 0.3s, box-shadow 0.3s;
  font-family: inherit;
  display: block;
}

/* Removed duplicate .input-field-wrapper and .input-field-wrapper .form-control to avoid conflicts. */

 

/* responsive adjustments */
@media (max-width: 768px) {
  .form-control {
    height: 42px;
    font-size: 0.98rem;
    padding-left: 1.1rem;
    padding-right: 0.9rem;
  }
  .input-field-wrapper.password-wrapper .form-control {
    padding-left: 2.2rem;
  }
  .toggle-password-btn {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1em;
    left: 0.3rem;
  }
}
@media (max-width: 420px) {
  .form-control {
    height: 38px;
    font-size: 0.93rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
  .input-field-wrapper.password-wrapper .form-control {
    padding-left: 2rem;
  }
  .toggle-password-btn {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.95em;
    left: 0.2rem;
  }
}
.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  width: 100%;
  padding: 0.85rem 0;
  border: 2px solid var(--btn-border);
  border-radius: 0.7rem;
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.2s, box-shadow 0.3s;
  margin-top: 1.5rem;
  box-shadow: 0 2px 12px #1e90ff11;
  letter-spacing: 1px;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  transform: scale(1.04);
  box-shadow: 0 4px 24px #1e90ff22;
}
.form-wrapper {
  position: relative;
}

.error-container {
   display: flex;
  align-items: center;
  justify-content: center;
}

.error-message {
  background-color: var(--error-bg, #ffe6e6); 
  color: var(--error-text, #d8000c);
  padding: 1rem;
  border-radius: 0.7rem;
  margin-bottom: 0;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 0 10px #ff6b6b22;
  letter-spacing: 0.5px;
  font-size: 1.05rem;
  width: 100%;
  max-width: 100%;
  transition: all 0.3s ease;
}
.welcome-message {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  letter-spacing: 0.5px;
  color: var(--btn-text);
  text-shadow: 0 1px 8px #fff2;
}
.wave-hand {
  font-size: 2rem;
  animation: wave 2s infinite ease-in-out;
  transform-origin: 70% 70%;
  display: inline-block;
}



@keyframes wave {
  0% { transform: rotate(0deg);}
  15% { transform: rotate(15deg);}
  30% { transform: rotate(-10deg);}
  45% { transform: rotate(12deg);}
  60% { transform: rotate(-8deg);}
  75% { transform: rotate(10deg);}
  100% { transform: rotate(0deg);}
}

@keyframes flame {
  0%, 100% {
    color: #ff4500;
    text-shadow:
      0 0 5px #ff4500,
      0 0 10px #ff6347,
      0 0 15px #ff4500,
      0 0 20px #ff6347,
      0 0 25px #ffa07a;
    transform: translateY(0) scale(1);
  }
  50% {
    color: #ff6347;
    text-shadow:
      0 0 8px #ff6347,
      0 0 18px #ff4500,
      0 0 22px #ff6347,
      0 0 28px #ff4500,
      0 0 35px #ffa07a;
    transform: translateY(-3px) scale(1.1);
  }
}

.flame {
  animation: flame 1.5s infinite ease-in-out;
  display: inline-block;
  user-select: none;
  font-weight: bold;
  font-size: 1.3em;
  line-height: 1;
}






.no-account {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 15px;
  color: #555;
}
.create-account-btn {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 10px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 10px;
  border: 2px solid var(--btn-border);
  transition: all 0.3s;
  box-shadow: 0 2px 12px #1e90ff22;
  letter-spacing: 0.5px;
}
.create-account-btn:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  transform: scale(1.07) translateY(-2px);
  box-shadow: 0 4px 24px #1e90ff33;
}
.g-recaptcha {
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
}
.theme-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  background: var(--navbar-bg);
  border: 2.5px solid var(--btn-border);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 6px 24px #1e90ff11;
  transition: all 0.3s;
  z-index: 1000;
  backdrop-filter: blur(6px);
}
.theme-toggle i {
  font-size: 1.5rem;
  transition: transform 0.6s, color 0.3s;
  color: var(--btn-border);
}
.theme-toggle i.rotate {
  transform: rotate(360deg);
}
body.dark-mode .theme-toggle i {
  color: var(--btn-border);
  transform: rotate(180deg);
}


/* --- Responsive Navbar & Title --- */
.navbar {
  width: 100vw;                /* غطِ العرض بالكامل */
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  position: relative;
  min-height: 70px;
  padding: 1.2rem 2.5rem;      /* padding داخلي يمين ويسار */
  margin-bottom: 0;            /* أزل أي مسافة سفلية هنا */
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--navbar-bg, #111);
  box-shadow: var(--shadow, 0 2px 10px rgba(0,0,0,0.3));
  border-bottom-left-radius: var(--radius, 0.5rem);
  border-bottom-right-radius: var(--radius, 0.5rem);

  direction: rtl;

  z-index: 10;
  overflow: hidden;

  animation: navbarFadeIn 1.5s ease forwards;
}

@keyframes navbarFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.crosshair-icon {
  width: 2.2em;
  height: 2.2em;
  min-width: 32px;
  min-height: 32px;
  margin-left: 0.5em;
  margin-right: 0.1em;
  transform: scaleX(-1);
  animation: crosshairBounce 1.3s cubic-bezier(.68,-0.55,.27,1.55) forwards;
  flex-shrink: 0;
}

@keyframes crosshairBounce {
  0% {
    opacity: 0;
    transform: scaleX(-1) scale(0.6) rotate(-40deg);
  }
  60% {
    opacity: 1;
    transform: scaleX(-1) scale(1.2) rotate(15deg);
  }
  100% {
    opacity: 1;
    transform: scaleX(-1) scale(1) rotate(0deg);
  }
}

.site-title-wrapper {
  display: flex;
  align-items: baseline;
  gap: 0.25em;
  font-family: 'Poppins', 'Cairo', sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  white-space: nowrap;
}

.site-title-main {
  font-size: clamp(2.2em, 2.5vw, 2em);
  color: var(--navbar-title-main, #00aaff);
  text-shadow: 0 2px 16px #fff2, 0 1px 0 #fff;
  animation: slideInLeft 1.2s ease forwards;
  letter-spacing: 1px;
  margin-inline-start: 0.1em;
}

.site-title-io {
  font-size: clamp(2.2em, 2vw, 1.5em);
  color: var(--navbar-title-io, #0077cc);
  text-shadow: 0 2px 16px #1e90ff88, 0 1px 0 #fff;
  animation: slideInRight 1.2s ease forwards;
  animation-delay: 0.3s;
  letter-spacing: 0.5px;
  position: relative;
  user-select: none;
  cursor: default;
}

/* أنيميشن الدخول */
@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-60px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(60px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Responsive */

@media (max-width: 768px) {
  .navbar {
    min-height: 56px;
    padding: 1rem 1rem;
  }
  .container {
    margin-top: 1.2rem;
  }
}
@media (max-width: 480px) {
  .navbar {
    min-height: 48px;
    padding: 0.7rem 0.5rem;
  }
  .container {
    margin-top: 0.7rem;
  }
}

.crosshair-icon {
  width: 1.7em;
  height: 1.7em;
  min-width: 24px;
  min-height: 24px;
  margin-left: 0.3em;
}

@media (max-width: 420px) {
  .navbar {
    min-height: 48px;
    padding-left: 0.5vw;
    padding-right: 0.5vw;
  }
  .site-title-main {
    font-size: clamp(1.5em, 4vw, 1.3em);
  }
  .site-title-io {
    font-size: clamp(1.5em, 4vw, 1em);
  }
  .crosshair-icon {
    width: 1.2em;
    height: 1.2em;
    min-width: 18px;
    min-height: 18px;
  }
}


/* Password field wrapper for eye icon toggle */
.password-field-wrapper {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.7rem;
  direction: ltr; /* Always layout LTR for icon positioning */
}

/* Password input field styling */
.password-field-wrapper .form-control {
  width: 100%;
  height: 48px;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 0.7rem;
  border: 1.5px solid var(--input-border);
  font-size: 1.08rem;
  background: var(--input-bg);
  color: var(--text-color);
  padding-right: 2.7rem; /* space for eye icon */
  padding-left: 1.1rem;
  margin-bottom: 0;
  transition: border-color 0.3s, box-shadow 0.3s;
  font-family: inherit;
  direction: inherit; /* Inherit direction for text */
  position: relative;
  /* Remove margin-bottom here to avoid extra space below input */
}

/* Eye icon button INSIDE the input field */
.toggle-password-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--input-border);
  font-size: 1.25rem;
  transition: color 0.2s;
  z-index: 10;
  right: 1rem;
  left: auto;
  pointer-events: auto;
}

/* Ensure the wrapper is relative and does not add extra margin */
.password-field-wrapper {
  position: relative !important;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Remove margin-bottom from input itself */
.password-field-wrapper .form-control {
  margin-bottom: 0 !important;
  padding-right: 2.7rem !important;
  padding-left: 1.1rem !important;
}

/* RTL support: move icon to left if parent is RTL */
[dir="rtl"] .password-field-wrapper {
  direction: rtl;
}
[dir="rtl"] .password-field-wrapper .form-control {
  padding-left: 2.7rem !important;
  padding-right: 1.1rem !important;
}
[dir="rtl"] .toggle-password-btn {
  left: 1rem;
  right: auto;
}

.toggle-password-btn:hover,
.toggle-password-btn:focus {
  color: var(--input-focus);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .password-field-wrapper .form-control {
    height: 42px !important;
    font-size: 0.98rem !important;
    padding-left: 1.1rem !important;
    padding-right: 2.2rem !important;
  }
  [dir="rtl"] .password-field-wrapper .form-control {
    padding-left: 2.2rem !important;
    padding-right: 1.1rem !important;
  }
  .toggle-password-btn {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1.1rem;
    right: 0.5rem;
    left: auto;
  }
  [dir="rtl"] .toggle-password-btn {
    left: 0.5rem;
    right: auto;
  }
}
@media (max-width: 420px) {
  .password-field-wrapper .form-control {
    height: 38px !important;
    font-size: 0.93rem !important;
    padding-left: 0.7rem !important;
    padding-right: 2rem !important;
  }
  [dir="rtl"] .password-field-wrapper .form-control {
    padding-left: 2rem !important;
    padding-right: 0.7rem !important;
  }
  .toggle-password-btn {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 1rem;
    right: 0.3rem;
    left: auto;
  }
  [dir="rtl"] .toggle-password-btn {
    left: 0.3rem;
    right: auto;
  }
}

.social-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.2em 0 1.2em 0;
  width: 100%;
  color: #888;
  font-family: 'Poppins', sans-serif;
  font-size: 1.04em;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0.85;
}
.social-divider::before,
.social-divider::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #bbb, transparent);
  margin: 0 0.8em;
  border-radius: 1em;
  opacity: 0.5;
}

.social-circles {
  display: flex;
  justify-content: center;
  gap: 1.1em;
  margin-bottom: 1.5em;
}

.circle-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.55em;
  background: #fff;
  color: #222;
  border: 2px solid #eee;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  transition: 
    background 0.18s,
    color 0.18s,
    border 0.18s,
    box-shadow 0.18s,
    transform 0.16s;
  position: relative;
  overflow: hidden;
  outline: none;
}
.circle-btn i {
  z-index: 1;
  transition: color 0.18s;
}

/* تأثير لمعة عند المرور */
.circle-btn::after {
  content: "";
  position: absolute;
  left: -60%;
  top: -60%;
  width: 220%;
  height: 220%;
  background: linear-gradient(120deg,rgba(255,255,255,0.18) 0%,rgba(255,255,255,0.04) 100%);
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.18s;
}
.circle-btn:hover, .circle-btn:focus-visible {
  box-shadow: 0 6px 24px 0 rgba(0,0,0,0.13), 0 0 0 2px #fff2;
  transform: translateY(-2px) scale(1.07);
}
.circle-btn:hover::after, .circle-btn:focus-visible::after {
  opacity: 1;
  animation: shine 0.7s linear;
}
@keyframes shine {
  0% { opacity: 0; left: -60%; }
  50% { opacity: 1; left: 20%; }
  100% { opacity: 0; left: 100%; }
}

.circle-btn.twitter {
  background: #fff;
  color: #1DA1F2;
  border-color: #1DA1F2;
}
.circle-btn.twitter:hover, .circle-btn.twitter:focus-visible {
  background: #1DA1F2;
  color: #fff;
}

/* Telegram */
.circle-btn.telegram {
  background: #fff;
  color: #229ED9;
  border-color: #229ED9;
}
.circle-btn.telegram:hover, .circle-btn.telegram:focus-visible {
  background: #229ED9;
  color: #fff;
}

/* Discord */
.circle-btn.discord {
  background: #fff;
  color: #5865F2;
  border-color: #5865F2;
}
.circle-btn.discord:hover, .circle-btn.discord:focus-visible {
  background: #5865F2;
  color: #fff;
}

/* Dark mode support */
body.dark-mode .social-divider {
  color: #bbb;
}
body.dark-mode .social-divider::before,
body.dark-mode .social-divider::after {
  background: linear-gradient(90deg, transparent, #444, transparent);
}

body.dark-mode .circle-btn {
  background: #181a1a;
  color: #eee;
  border-color: #333;
  box-shadow: 0 2px 10px rgba(0,209,255,0.07);
}
body.dark-mode .circle-btn.twitter {
  background: #181a1a;
  color: #1DA1F2;
  border-color: #1DA1F2;
}
body.dark-mode .circle-btn.twitter:hover,
body.dark-mode .circle-btn.twitter:focus-visible {
  background: #1DA1F2;
  color: #181a1a;
}

body.dark-mode .circle-btn.telegram {
  background: #181a1a;
  color: #229ED9;
  border-color: #229ED9;
}
body.dark-mode .circle-btn.telegram:hover,
body.dark-mode .circle-btn.telegram:focus-visible {
  background: #229ED9;
  color: #181a1a;
}

body.dark-mode .circle-btn.discord {
  background: #181a1a;
  color: #5865F2;
  border-color: #5865F2;
}
body.dark-mode .circle-btn.discord:hover,
body.dark-mode .circle-btn.discord:focus-visible {
  background: #5865F2;
  color: #181a1a;
}

/* Toast Notification System - 4 Types (Error, Success, Info, Warning) */
.toastx-container {
  position: fixed;
  z-index: 99999;
  top: 2.2em;
  right: 2.2em;
  left: auto;
  display: flex;
  flex-direction: column;
  gap: 1em;
  pointer-events: none;
  direction: rtl;
  transition: right 0.3s, left 0.3s;
}
html[dir="ltr"] .toastx-container, body[dir="ltr"] .toastx-container {
  right: auto;
  left: 2.2em;
  direction: ltr;
}
.toastx {
  min-width: 340px;
  max-width: 96vw;
  background: #fff;
  border-radius: 1.4em;
  box-shadow: 0 10px 40px 0 rgba(0,0,0,0.13), 0 2px 8px 0 rgba(0,0,0,0.07);
  display: flex;
  align-items: flex-start;
  gap: 1.1em;
  font-family: 'Poppins', 'Cairo', 'Tajawal', Arial, sans-serif;
  font-size: 1.09em;
  font-weight: 900;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(-40px) scale(0.97);
  transition: opacity 0.45s cubic-bezier(.4,0,.2,1), transform 0.6s cubic-bezier(.4,0,.2,1);
  border: 2.5px solid transparent;
  position: relative;
  overflow: hidden;
  padding: 1.2em 2.1em 1.2em 1.7em;
}
.toastx.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toastx .toastx-icon {
  width: 2.3em;
  height: 2.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  flex-shrink: 0;
  border-radius: 50%;
  margin-inline-end: 0.7em;
  margin-top: 0.1em;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.07);
  animation: toast-pop 0.7s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes toast-pop {
  0% { transform: scale(0.6) rotate(-10deg);}
  60% { transform: scale(1.15) rotate(2deg);}
  100% { transform: scale(1) rotate(0);}
}
.toastx .toastx-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.18em;
  min-width: 0;
}
.toastx .toastx-title {
  font-size: 1.08em;
  font-weight: 900;
  margin-bottom: 0.1em;
  color: inherit;
  text-shadow: 0 1px 0 #fff, 0 0 6px #fff2;
  line-height: 1.3;
}
.toastx .toastx-desc {
  font-size: 0.98em;
  font-weight: 600;
  color: #222;
  opacity: 0.93;
  line-height: 1.5;
  word-break: break-word;
}
.toastx .toastx-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5em;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2;
  margin-inline-start: 0.5em;
  margin-inline-end: -0.7em;
  line-height: 1;
  position: absolute;
  top: 0.7em;
  inset-inline-end: 1.1em;
}
.toastx .toastx-close:hover {
  opacity: 1;
  transform: scale(1.15) rotate(8deg);
}
.toastx .toastx-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  border-radius: 0 0 1.5em 1.5em;
  background: rgba(0,0,0,0.07);
  overflow: hidden;
}
.toastx .toastx-progress-bar {
  height: 100%;
  width: 100%;
  transition: none;
  will-change: transform;
  background: #2196F3;
  transform-origin: left;
}
html[dir="rtl"] .toastx .toastx-progress-bar,
body[dir="rtl"] .toastx .toastx-progress-bar {
  transform-origin: right;
}
.toastx.success {
  background: linear-gradient(135deg, #e8f5e9 0%, #b9f6ca 100%);
  border-color: #4CAF50;
  color: #256029;
}
.toastx.success .toastx-icon { background: #4CAF50; color: #fff; }
.toastx.success .toastx-progress-bar { background: #4CAF50; }
.toastx.error {
  background: linear-gradient(135deg, #fff6f6 0%, #fbe9e7 100%);
  border-color: #f44336;
  color: #b71c1c;
}
.toastx.error .toastx-icon { background: #f44336; color: #fff; }
.toastx.error .toastx-progress-bar { background: #f44336; }
.toastx.info {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #2196F3;
  color: #0d47a1;
}
.toastx.info .toastx-icon { background: #2196F3; color: #fff; }
.toastx.info .toastx-progress-bar { background: #2196F3; }
.toastx.warning {
  background: linear-gradient(135deg, #fffde7 0%, #ffe082 100%);
  border-color: #FF9800;
  color: #ff6f00;
}
.toastx.warning .toastx-icon { background: #FF9800; color: #fff; }
.toastx.warning .toastx-progress-bar { background: #FF9800; }
@media (max-width: 600px) {
  .toastx-container {
    top: 0.7em;
    right: 0.7em;
    left: auto;
  }
  html[dir="ltr"] .toastx-container, body[dir="ltr"] .toastx-container {
    left: 0.7em;
    right: auto;
  }
  .toastx {
    min-width: 0;
    max-width: 99vw;
    font-size: 1em;
    padding: 1em 1.1em 1em 0.9em;
    border-radius: 1.1em;
  }
  .toastx .toastx-icon {
    width: 1.7em;
    height: 1.7em;
    font-size: 1.3em;
  }
}
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.7em;
  border-radius: 0.85em;
  font-family: 'Poppins', 'Cairo', 'Tajawal', Arial, sans-serif;
  font-size: 0.98em;
  font-weight: 600;
  margin: 1em 0 0.5em 0;
  padding: 0.7em 1.1em 0.7em 0.9em;
  box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.10), 0 1px 4px 0 rgba(0, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px) scale(0.94);
  transition:
    opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.55s cubic-bezier(0.22, 1.08, 0.36, 1.03),
    filter 0.45s ease-in-out;
  direction: inherit;
  position: relative;
  border: none;
  background: var(--alert-bg, #fff);
  color: var(--alert-color, #222);
  max-width: 420px;
  margin-inline: auto;
  animation: none;
  min-height: 0;
  min-width: 0;
}

.form-alert.slowmotion {
  animation: alert-slowmotion-in 1.15s cubic-bezier(0.22, 1.2, 0.36, 1.05) both;
}

@keyframes alert-slowmotion-in {
  0% {
    opacity: 0;
    transform: scale(0.68) rotate(-10deg) translateY(-55px);
    filter: blur(6px);
  }
  40% {
    opacity: 0.8;
    transform: scale(1.06) rotate(4deg) translateY(15px);
    filter: blur(1px);
  }
  75% {
    transform: scale(0.98) rotate(-1deg) translateY(-2px);
    filter: blur(0.2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0) translateY(0);
    filter: blur(0);
  }
}
.form-alert.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.form-alert .alert-icon {
  font-size: 1.18em;
  margin-inline-end: 0.4em;
  margin-top: 0.05em;
  flex-shrink: 0;
  line-height: 1;
  width: 1.6em;
  height: 1.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--alert-icon-bg, #eee);
  color: var(--alert-icon-color, #222);
  box-shadow: 0 1px 4px 0 rgba(0,0,0,0.04);
}
.form-alert .alert-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05em;
}
.form-alert .alert-title {
  font-weight: 800;
  font-size: 1em;
  margin-bottom: 0.05em;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.form-alert .alert-message {
  font-weight: 500;
  font-size: 0.96em;
  opacity: 0.93;
  line-height: 1.5;
  word-break: break-word;
}
.form-alert .alert-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.18em;
  cursor: pointer;
  opacity: 0.5;
  margin-inline-start: 0.4em;
  margin-top: 0.05em;
  transition: opacity 0.2s, transform 0.2s;
  position: absolute;
  top: 0.6em;
  inset-inline-end: 0.8em;
  line-height: 1;
  padding: 0 0.15em;
  border-radius: 50%;
}
.form-alert .alert-close:hover {
  opacity: 1;
  background: rgba(0,0,0,0.08);
  transform: scale(1.13) rotate(8deg);
}

.form-alert.success {
  --alert-bg: linear-gradient(90deg,#e8fff3 0%,#d0f5e8 100%);
  --alert-color: #176b3f;
  --alert-icon-bg: #2ecc71;
  --alert-icon-color: #fff;
}
.form-alert.error {
  --alert-bg: linear-gradient(90deg,#fff2f2 0%,#ffe3e3 100%);
  --alert-color: #a82323;
  --alert-icon-bg: #f44336;
  --alert-icon-color: #fff;
}
.form-alert.info {
  --alert-bg: linear-gradient(90deg,#e3f2fd 0%,#ede7f6 100%);
  --alert-color: #283593;
  --alert-icon-bg: #2196f3;
  --alert-icon-color: #fff;
}
.form-alert.warning {
  --alert-bg: linear-gradient(90deg,#fffde7 0%,#ffe082 100%);
  --alert-color: #ff6f00;
  --alert-icon-bg: #ff9800;
  --alert-icon-color: #fff;
}

@media (prefers-color-scheme: dark) {
  .form-alert {
    --alert-bg: #23272f;
    --alert-color: #e3e3e3;
    background: var(--alert-bg, #23272f);
    color: var(--alert-color, #e3e3e3);
    box-shadow: 0 2px 16px 0 rgba(0,0,0,0.22), 0 1px 4px 0 rgba(0,0,0,0.18);
  }
  .form-alert.success {
    --alert-bg: linear-gradient(90deg,#1b2e23 0%,#1c3a2e 100%);
    --alert-color: #b9f6ca;
    --alert-icon-bg: #388e3c;
    --alert-icon-color: #fff;
  }
  .form-alert.error {
    --alert-bg: linear-gradient(90deg,#2d1b1b 0%,#3a2323 100%);
    --alert-color: #ffcdd2;
    --alert-icon-bg: #c62828;
    --alert-icon-color: #fff;
  }
  .form-alert.info {
    --alert-bg: linear-gradient(90deg,#1a2236 0%,#23294a 100%);
    --alert-color: #bbdefb;
    --alert-icon-bg: #1976d2;
    --alert-icon-color: #fff;
  }
  .form-alert.warning {
    --alert-bg: linear-gradient(90deg,#332a13 0%,#4a3a1a 100%);
    --alert-color: #ffe082;
    --alert-icon-bg: #ffb300;
    --alert-icon-color: #fff;
  }
}

.input-field-wrapper.has-error .form-control,
.input-field-wrapper.has-error input,
.input-field-wrapper.has-error textarea {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 2px #ff525233 inset;
  outline: none;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field-wrapper.has-error .field-error-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 0.9em;
  left: auto;
  color: #d32f2f;
  font-size: 1.1em;
  pointer-events: none;
  z-index: 2;
}
html[dir="ltr"] .input-field-wrapper.has-error .field-error-icon {
  left: 0.9em;
  right: auto;
}
.field-error {
  color: #d32f2f;
  font-size: 0.93em;
  margin-top: 0.18em;
  display: flex;
  align-items: center;
  gap: 0.3em;
  font-weight: 600;
  direction: inherit;
  min-height: 1.5em;
  line-height: 1.5;
  opacity: 1;
  transform: translateY(-6px);
  transition: opacity 0.25s, transform 0.25s;
}
.input-field-wrapper.has-error .field-error {
  opacity: 1;
  transform: translateY(0);
}
.field-error svg {
  width: 1.1em;
  height: 1.1em;
  margin-inline-end: 0.2em;
  flex-shrink: 0;
  color: #d32f2f;
}

.btn-primary:disabled,
.btn-primary.btn-disabled,
button[name="login_user"]:disabled,
button[name="login_user"].btn-disabled {
  background: #ffdddd !important;    /* أحمر فاتح جدا */
  color: #b71c1c !important;         /* أحمر غامق للنص */
  filter: brightness(1.18) grayscale(0.18) !important;
  opacity: 0.62 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  border-color: #ffb3b3 !important;
  transition: filter 0.3s, opacity 0.3s, background 0.3s, color 0.3s, border-color 0.3s;
}
.btn-primary:disabled,
.btn-primary.btn-disabled,
button[name="register_user"]:disabled,
button[name="register_user"].btn-disabled {
  background: #ffdddd !important;    /* أحمر فاتح جدا */
  color: #b71c1c !important;         /* أحمر غامق للنص */
  filter: brightness(1.18) grayscale(0.18) !important;
  opacity: 0.62 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  border-color: #ffb3b3 !important;
  transition: filter 0.3s, opacity 0.3s, background 0.3s, color 0.3s, border-color 0.3s;
}



body.theme-transition {
  transition:
    background-color 0.75s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.75s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.75s ease;
  transform-origin: center;
  animation: slowzoom 0.6s ease-out;
}

@keyframes slowzoom {
  0% {
    transform: scale(1.015);
    filter: blur(1.3px) brightness(1.1);
  }
  50% {
    transform: scale(0.99);
    filter: blur(0.4px);
  }
  100% {
    transform: scale(1);
    filter: blur(0) brightness(1);
  }
}

.login-center {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* تأكد أن .navbar و .container بعرض 100% */
.login-center .navbar,
.login-center .container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.container {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
  box-sizing: border-box;
}
@media (max-width: 480px) {
  .login-center {
    max-width: 99vw;
  }
  .container {
    margin-top: 1.5rem;
    padding: 0 0.3rem;
  }
}
.sidebar {
      position: fixed;
      top: 0;
      left: 0;
      height: 100vh;
      width: var(--sidebar-width);
      background: var(--sidebar-bg);
      color: var(--sidebar-text);
      box-shadow: var(--sidebar-shadow);
      border-top-right-radius: var(--sidebar-radius);
      border-bottom-right-radius: var(--sidebar-radius);
      z-index: 1001;
      transform: translateX(-110%);
      transition: transform var(--sidebar-transition), box-shadow 0.3s;
      overflow-y: auto;
      padding-top: 140px; /* زِد القيمة لتحريك القائمة للأسفل */
      padding-bottom: 2rem;
      backdrop-filter: blur(var(--sidebar-blur));
      will-change: transform;
      /* سلايموشن */
      box-shadow: 0 8px 32px 0 rgba(30,144,255,0.13), 0 0 0 0 var(--sidebar-accent);
      animation: sidebarSlimeIn 1.1s cubic-bezier(.68,-0.55,.27,1.55) 0s 1 normal both paused;
    }
    .sidebar.active {
      transform: translateX(0);
      animation-play-state: running;
      box-shadow: 0 8px 32px 0 var(--sidebar-accent), 0 0 0 0 var(--sidebar-accent);
    }
    @keyframes sidebarSlimeIn {
      0% { box-shadow: 0 0 0 0 var(--sidebar-accent); }
      60% { box-shadow: 0 0 40px 10px var(--sidebar-accent); }
      100% { box-shadow: 0 8px 32px 0 var(--sidebar-accent); }
    }
    .sidebar-menu {
      list-style: none;
      padding: 0 1.2rem;
      margin: 0;
      font-family: 'Poppins', 'Cairo', sans-serif;
      font-size: 1.08rem;
      font-weight: 600;
      letter-spacing: 0.2px;
    }
    .sidebar-menu > li {
      margin-bottom: 0.7rem;
      position: relative;
    }
    .sidebar-menu a, .sidebar-menu .sidebar-subtitle {
      display: flex;
      align-items: center;
      gap: 0.7em;
      padding: 0.85em 1.1em;
      border-radius: var(--sidebar-item-radius);
      color: var(--sidebar-text);
      text-decoration: none;
      transition: background 0.25s, color 0.18s, box-shadow 0.18s;
      cursor: pointer;
       position: relative;
       background: transparent;
    }
    .sidebar-menu a:hover, .sidebar-menu a:focus {
      background: var(--sidebar-item-hover);
      color: var(--sidebar-accent);
      box-shadow: 0 2px 12px #1e90ff11;
      transform: translateX(4px) scale(1.04);
    }
    .sidebar-menu .active > a,
    .sidebar-menu a.active {
      background: var(--sidebar-item-active);
      color: var(--sidebar-accent);
      font-weight: 900;
      box-shadow: 0 2px 12px #1e90ff22;
    }
    .sidebar-submenu {
      list-style: none;
      padding: 0.2em 0 0.2em 1.2em;
      margin: 0;
      border-right: 2.5px solid var(--sidebar-accent);
      border-radius: 0 0 0.7em 0.7em;
      background: transparent;
      animation: submenuFadeIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
    }
    @keyframes submenuFadeIn {
      0% { opacity: 0; transform: translateY(-10px) scale(0.97);}
      100% { opacity: 1; transform: translateY(0) scale(1);}
    }
    .sidebar-subtitle {
      font-size: 1.08em;
      font-weight: 900;
      color: var(--sidebar-accent);
      margin-top: 1.2em;
      margin-bottom: 0.2em;
      letter-spacing: 0.5px;
      background: transparent;
      cursor: default;
      pointer-events: none;
      user-select: none;
    }

    .sidebar-menu i {
      font-size: 1.18em;
      min-width: 1.5em;
      color: var(--sidebar-accent);
      opacity: 0.93;
      transition: color 0.2s;
    }

    .navbar {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      height: 110px; 
      background: var(--navbar-bg, #e0f1ff);
      box-shadow: var(--shadow, 0 4px 24px rgba(30,144,255,0.07));
      border-bottom-left-radius: var(--radius, 1.1rem);
      border-bottom-right-radius: var(--radius, 1.1rem);
       padding: 0;
    }
   
    @media (max-width: 600px) {
     
    }

    @media (max-width: 900px) {
      :root { --sidebar-width: 210px; }
      .sidebar { padding-top: 70px; }
      .navbar { height: 90px; }
      
    }
    @media (max-width: 600px) {
      :root { --sidebar-width: 90vw; }
      .sidebar { border-radius: 0 1.2rem 1.2rem 0; }
      .navbar { height: 64px; }
       
    }

    body.dark-mode .sidebar {
      background: var(--sidebar-dark-bg);
      color: var(--sidebar-dark-text);
    }
    body.dark-mode .sidebar-menu a, body.dark-mode .sidebar-menu .sidebar-subtitle {
      color: var(--sidebar-dark-text);
    }
    body.dark-mode .sidebar-menu a:hover, body.dark-mode .sidebar-menu a:focus {
      background: var(--sidebar-item-hover);
      color: var(--sidebar-accent);
    }

    .sidebar::-webkit-scrollbar { width: 0; background: transparent; }
    .sidebar { scrollbar-width: none; }

    .navbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px; /* أطول وأكثر وضوحًا */
  background: var(--navbar-bg, #e0f1ff);
  box-shadow: var(--shadow, 0 4px 24px rgba(30,144,255,0.07));
  border-bottom-left-radius: var(--radius, 1.1rem);
  border-bottom-right-radius: var(--radius, 1.1rem);
   padding: 0;
}
.sidebar-toggle {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
 }
.sidebar-toggle i {
  font-size: 2em;
  color: var(--sidebar-accent, #1e90ff);
}
.navbar-center {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  pointer-events: none;
}

.dashboard-stats {
  display: flex;
  gap: 1.2em;
  margin: 2em 0 1.5em 0;
  justify-content: center;
  flex-wrap: wrap;
}
.stat-card {
  background: var(--sidebar-group-bg, #f5faff);
  border-radius: 1em;
  box-shadow: 0 2px 12px #1e90ff11;
  padding: 1.1em 2.1em;
  min-width: 120px;
  text-align: center;
  font-family: 'Poppins', 'Cairo', sans-serif;
  transition: box-shadow 0.2s;
}
.stat-card .stat-title {
  font-size: 1.1em;
  color: var(--sidebar-accent, #1e90ff);
  margin-bottom: 0.3em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5em;
  justify-content: center;
}
.stat-card .stat-value {
  font-size: 2.1em;
  font-weight: 900;
  color: #222;
  letter-spacing: 1px;
}
.growth-card .stat-value {
  font-size: 1.5em;
}
.dashboard-chart {
  background: #fff;
  border-radius: 1.2em;
  box-shadow: 0 2px 12px #1e90ff11;
  padding: 1.5em 1.5em 1em 1.5em;
  margin: 0 auto 2em auto;
  max-width: 600px;
}
body.dark-mode .dashboard-stats .stat-card,
body.dark-mode .dashboard-chart {
  background: #232b3b;
  color: #eaf6ff;
}
body.dark-mode .stat-card .stat-title {
  color: #4fc3f7;
}
body.dark-mode .stat-card .stat-value {
  color: #fff;
}

 
@media (max-width: 600px) {
  .theme-toggle {
    height: 48px;
    width: 48px;
  }
  .theme-toggle i {
    font-size: 1.3em;
  }
}
:root {
  --sidebar-bg: #f5faff;
  --sidebar-text: #222;
  --sidebar-accent: #1e90ff;
  --sidebar-group-bg: #f5faff;
  --sidebar-group-title-bg: #eaf6ff;
  --sidebar-item-hover: #e0f1ff;
}

body.dark-mode {
  --sidebar-bg: #232b3b;
  --sidebar-text: #eaf6ff;
  --sidebar-accent: #4fc3f7;
  --sidebar-group-bg: #232b3b;
  --sidebar-group-title-bg: #1a2233;
  --sidebar-item-hover: #263043;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  max-width: 92vw;
  min-width: 140px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  box-shadow: 0 8px 32px rgba(30,144,255,0.13);
  border-top-right-radius: 1.2rem;
  border-bottom-right-radius: 1.2rem;
  z-index: 1001;
  transform: translateX(-110%);
  transition: transform 0.35s cubic-bezier(.68,-0.55,.27,1.55);
  overflow-y: auto;
  padding: clamp(60px, 10vw, 100px) 0 2rem;
  backdrop-filter: blur(8px);
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar-menu {
  list-style: none;
  padding: 0 1.2rem;
  margin: 0;
  font-family: 'Poppins', 'Cairo', sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
}

.sidebar-group {
  margin-bottom: 1.2em;
  border-radius: 0.7em;
  background: var(--sidebar-group-bg);
  box-shadow: 0 2px 12px #1e90ff08;
  transition: background 0.2s;
}

.sidebar-group-title {
  font-size: 1.13em;
  font-weight: 900;
  color: var(--sidebar-accent);
  padding: 0.9em 1.1em;
  cursor: pointer;
  background: var(--sidebar-group-title-bg);
  border-radius: 0.7em 0.7em 0 0;
  display: flex;
  align-items: center;
  gap: 0.7em;
  user-select: none;
  transition: background 0.2s, color 0.2s;
}

.sidebar-group-title:hover,
.sidebar-group.open .sidebar-group-title {
  background: var(--sidebar-accent);
  color: #fff;
}

.sidebar-submenu {
  display: none;
  padding-bottom: 0.7em;
  border-radius: 0 0 0.7em 0.7em;
}

.sidebar-group.open .sidebar-submenu {
  display: block;
  animation: submenuFadeIn 0.5s;
}

@keyframes submenuFadeIn {
  0% { opacity: 0; transform: translateY(-10px) scale(0.97);}
  100% { opacity: 1; transform: translateY(0) scale(1);}
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.85em 1.1em;
  border-radius: 0.5em;
  color: var(--sidebar-text);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.25s, color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.sidebar-menu a:hover,
.sidebar-menu a:focus {
  background: var(--sidebar-item-hover);
  color: var(--sidebar-accent);
  box-shadow: 0 2px 12px #1e90ff11;
  transform: translateX(4px) scale(1.04);
}

.sidebar-menu i {
  font-size: 1.18em;
  min-width: 1.5em;
  color: var(--sidebar-accent);
  opacity: 0.93;
  transition: color 0.2s;
}

body.sidebar-open {
  overflow: hidden !important;
  position: fixed;
  width: 100vw;
}

@media (max-width: 900px) {
  .sidebar {
    width: 200px;
    min-width: 100px;
  }
}

@media (max-width: 600px) {
  .sidebar {
    width: 50vw;
    height: 100vh;
    border-radius: 0 1.2rem 1.2rem 0;
    font-size: 0.97em;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5rem; /* يعطي مساحة تنفس تحت */
  }
  .sidebar-menu {
    font-size: 1em;
    padding: 0 0.5rem;
  }
  .sidebar-group-title,
  .sidebar-menu a {
    padding: 0.7em 0.7em;
    font-size: 0.98em;
  }
}
/* لودينق صغير وشفاف وأنيق */
  .loader-container {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent !important;
    transition: opacity 0.18s cubic-bezier(.4,0,.2,1);
    opacity: 0;
    pointer-events: none;
  }
  .loader-container.show {
    opacity: 1;
    pointer-events: all;
  }
  .sniper-loader-outer {
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 0 8px var(--loader-glow, #38b6ff80));
    animation: loader-glow 1.1s cubic-bezier(.4,0,.2,1) infinite alternate;
  }
  .sniper-loader-crosshair {
    width: 38px;
    height: 38px;
    display: block;
    /* دوران سلس جداً مع نبض خفيف */
    animation:
      sniper-crosshair-spin 0.7s cubic-bezier(.77,0,.18,1) infinite,
      sniper-crosshair-pulse 1.2s cubic-bezier(.4,0,.2,1) infinite alternate;
    transform-origin: 50% 50%;
    will-change: transform, filter;
  }
  @keyframes sniper-crosshair-spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
  }
  @keyframes sniper-crosshair-pulse {
    0% { filter: drop-shadow(0 0 0px var(--crosshair-color, #00aaff)); }
    100% { filter: drop-shadow(0 0 8px var(--crosshair-color, #00aaff)); }
  }
  @media (max-width: 600px) {
    .sniper-loader-outer, .sniper-loader-crosshair { width: 26px; height: 26px; }
  }
  body.dark-theme .loader-container {
    --loader-glow: #0a3a7e99;
  }
  body:not(.dark-theme) .loader-container {
    --loader-glow: #38b6ff80;
  }
  /* لون الشعار حسب الثيم */
  :root {
    --crosshair-color: #00aaff;
  }
  body.dark-theme {
    --crosshair-color: #38b6ff;
  }

  /* شعار جانبي أصغر وأكثر سلاسة وجمالاً ومتجاوب */
  .sidebar-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0 16px 0;
    user-select: none;
    animation: sidebar-logo-fadein 1s cubic-bezier(.4,0,.2,1);
    position: relative;
    z-index: 2;
    /* الشعار العلوي يغطي جزء من الشريط العلوي للموقع */
    top: -22px;
  }
  @keyframes sidebar-logo-fadein {
    0% { opacity: 0; transform: translateY(-18px) scale(0.7);}
    100% { opacity: 1; transform: translateY(0) scale(1);}
  }
  .sidebar-logo-outer-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 54px; height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--crosshair-color, #00aaff) 0%, #38b6ff00 80%);
    filter: blur(10px) brightness(1.2);
    opacity: 0.33;
    z-index: 1;
    animation: sidebar-logo-glow-pulse 2.2s cubic-bezier(.4,0,.2,1) infinite alternate;
    pointer-events: none;
  }
  @keyframes sidebar-logo-glow-pulse {
    0% { opacity: 0.18; filter: blur(6px) brightness(1.05);}
    100% { opacity: 0.38; filter: blur(16px) brightness(1.3);}
  }
  .sidebar-logo-svg {
    width: 38px;
    height: 38px;
    display: block;
    margin-bottom: 6px;
    z-index: 2;
    position: relative;
    filter: drop-shadow(0 0 7px var(--crosshair-color, #00aaff44));
    animation:
      sidebar-logo-spin 3.8s linear infinite,
      sidebar-logo-bounce 1.7s cubic-bezier(.4,0,.2,1) infinite alternate;
    will-change: transform, filter;
    transition: width 0.2s, height 0.2s;
  }
  @keyframes sidebar-logo-spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
  }
  @keyframes sidebar-logo-bounce {
    0% { filter: drop-shadow(0 0 7px var(--crosshair-color, #00aaff44)); }
    100% { filter: drop-shadow(0 0 18px var(--crosshair-color, #38b6ffbb)); }
  }
  .sidebar-logo-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: 1.2px;
    color: var(--crosshair-color, #00aaff);
    text-shadow: 0 2px 8px #38b6ff33, 0 1px 0 #fff8;
    text-align: center;
    line-height: 1.1;
    margin-top: 1px;
    position: relative;
    z-index: 2;
    animation: sidebar-logo-title-fade 1.8s cubic-bezier(.4,0,.2,1) infinite alternate;
  }
  @keyframes sidebar-logo-title-fade {
    0% { opacity: 0.8; letter-spacing: 1.2px;}
    100% { opacity: 1; letter-spacing: 2px;}
  }
  .sidebar-logo-flare {
    position: absolute;
    left: 50%; top: 50%;
    width: 62px; height: 62px;
    pointer-events: none;
    transform: translate(-50%,-50%) scale(1);
    z-index: 0;
    opacity: 0.13;
    animation: sidebar-logo-flare-anim 2.8s linear infinite;
  }
  @keyframes sidebar-logo-flare-anim {
    0% { opacity: 0.13; transform: translate(-50%,-50%) scale(1);}
    50% { opacity: 0.22; transform: translate(-50%,-50%) scale(1.08);}
    100% { opacity: 0.13; transform: translate(-50%,-50%) scale(1);}
  }
  @media (max-width: 600px) {
    .sidebar-logo-svg { width: 28px; height: 28px; }
    .sidebar-logo-outer-glow, .sidebar-logo-flare { width: 38px; height: 38px; }
    .sidebar-logo-title { font-size: 0.82rem; }
    .sidebar-logo-container { margin: 0 0 10px 0; top: -12px; }
  }