body {
  background-color: #f0f1f5;
  direction: rtl;
  text-align: right;
  font-family: Tahoma, sans-serif;
  margin: 0;
  padding: 0;
  padding-bottom: 70px;
}



/* نوار بالای صفحه (Top Bar) */
.top-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 60px;
  background-color: #f0f1f5;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1040;    /* این خط مهم است! */
  padding: 0 30px;
  font-family: Tahoma, sans-serif;
  font-size: 15px;
  box-sizing: border-box;
}

.custom-recaptcha {
    transform: scale(0.85);
    transform-origin: 0 0;
}


/* سمت راست بالا: تاریخ و مناسبت */
.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: #444;
}
.topbar-right .today {
  font-weight: bold;
  color: #333;
  font-size: 1rem;
  margin-bottom: 2px;
}
.topbar-right .event {
  color:#1B2631;
  font-size: 0.95rem;
}

/* خط جداکننده بین راست و چپ topbar */
.top-bar-divider {
  width: 1px;
  height: 38px;
  background: #e0e0e0;
  margin: 0 22px;
  display: block;
}

/* سمت چپ بالا: آیکن خروج + نام کاربر + آیکن کاربر */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
}
.topbar-left .user-name {
  font-weight: bold;
  color: #555;
  display: flex;
  align-items: center;
  font-size: 1rem;
}
.logout-link {
  color: #d32f2f;
  font-size: 1.3rem;
  margin-left: 10px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}
.logout-link:hover {
  color: #b71c1c;
  text-decoration: none;
}

@media (max-width: 991px) {
  .top-bar {
    padding: 0 10px;
    height: 56px;
    font-size: 14px;
  }
  .top-bar-divider {
    margin: 0 8px;
    height: 32px;
  }
}

/* سایدبار دسکتاپ */
.side-nav {
  position: fixed;
  background-color: #f0f1f5;
  z-index: 998;    /* حتماً کمتر از تاپ‌بار باشد */
}


/* فقط دسکتاپ */
@media (min-width: 992px) {
  .side-nav-desktop {
    display: flex;
    top: 80px;
    left: 0;
    width: 60px;
    height: calc(100vh - 60px);
    flex-direction: column;
    align-items: center;
    padding-top: 22px;
    gap: 24px;
    /* border-right: 1px solid #ddd; */
  }
  .side-nav-mobile {
    display: none;
  }
}

/* فقط موبایل و تبلت */
@media (max-width: 991px) {
  .side-nav-mobile {
    display: flex;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #ddd;
    background-color: #f0f1f5;
  }
  .side-nav-desktop {
    display: none;
  }
}

.side-nav a {
  color: #7d7d86;
  font-size: 22px;
  transition: color 0.3s;
  text-align: center;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none; /* حذف خط زیر آیکن‌ها */
}
.side-nav a:hover {
  color: #007bff;
}

/* برای جلوگیری از چسبیدن محتوا به بالای صفحه به خاطر top-bar */
.main-content {
  padding-top: 70px;
  padding-right: 10px;
  padding-left: 10px;
}
@media (min-width: 992px) {
  .main-content {
    padding-right: 80px;
    padding-left: 30px;
    padding-top: 72px;
  }
}

.side-nav {
  /* ... بقیه استایل‌ها ... */
  z-index: 998;    /* کمتر از top-bar */
}

.form-upload {
  flex-direction: row;
}

.upload-btn {
  white-space: nowrap;
}

.upload_box{
  margin-top: 100px!important;
}

/* حالت ریسپانسیو برای صفحه‌های باریک */
@media (max-width: 480px) {
  .form-upload {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-btn {
    width: 100%;   /* دکمه تمام عرض */
    margin-top: 14px;
  }
}


/* کاهش اندازه متن تاریخ و مناسبت در موبایل */
@media (max-width: 585px) {
  .topbar-right .today {
    font-size: 0.5rem!important;
  }
  .topbar-right .event {
    
    font-size: 0.75rem;
  }

  /* مخفی کردن نام کاربر */
  .user-name {
    display: none !important;
  }

  /* نمایش فقط آیکن کاربر */
  .topbar-left i.fa-user-gear {
    cursor: pointer;
  }
}

@media (min-width: 586px) {
  .user-sidebar {
    display: none !important;
  }
}

.event.small{
  text-align: right !important;
}

.user-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 260px;
  background-color: #ffffff;
  box-shadow: 2px 0 10px rgba(0,0,0,0.15);
  z-index: 1050;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.user-sidebar.show {
  transform: translateX(0);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #555;
  cursor: pointer;
}

.table-box {
  /* max-width: 900px; */
  /* width: 100%; */
  border-radius: 8px;
  /*overflow: hidden; این خط مهمه تا خمیدگی درست اعمال بشه*/
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  background-color: #fff;
  border: 1px solid #f0f0f0;
}

/* استایل جدول نمادها */
.custom-table {
  border-color: #f0f0f0 !important;
  font-size: 0.94rem;
  margin-bottom: 0;

}

.custom-table th,
.custom-table td {
padding: 12px 16px;
  vertical-align: middle;
  text-align: right;
  border-color: #f0f0f0 !important; /* خطوط جدول کمی کمرنگ‌تر */
  color: #444;
}

/* رنگ پس‌زمینه ردیف هدر */
.custom-table thead th {
 background-color: #eaeaea; 
  color: #333;
  font-weight: 600;
}



.topbar-left a {
  text-decoration: none;
}

.topbar-left a:hover {
  text-decoration: none;
}


/* فقط مخصوص صفحه لاگین */

/* ارتفاع کامل صفحه */
.login-full-height {
  min-height: 100dvh; /* استفاده از واحد جدید و هوشمند */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}


/* محدود کردن عرض فرم */
.login-wrapper {
  max-width: 400px;
}

/* استایل فرم */
.login-form {
  font-size: 1rem;
  background-color: #f8f9fa;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

/* تیتر فرم */
.login-title {
  font-weight: bold;
}

/* ورودی‌ها */
.login-input {
  font-size: 1rem;
}

/* دکمه لاگین */
.login-btn {
  padding: 0.5rem;
  font-size: 1rem;
}

/* ریسپانسیو برای تبلت */
@media (max-width: 768px) {
  .login-form {
    padding: 1.5rem;
    font-size: 0.95rem;
  }

  .login-title {
    font-size: 1.25rem;
  }

  .event.small{
    text-align: right!important;
  }
}

/* ریسپانسیو برای موبایل */
@media (max-width: 576px) {
  .login-form {
    padding: 1rem;
    font-size: 0.9rem;
  }

  .event.small{
    text-align: right!important;
  }

  .login-title {
    font-size: 1.1rem;
  }

  .form-label {
    font-size: 0.9rem;
  }

  .login-btn {
    font-size: 0.95rem;
  }
}

/* مخصوص فرم لاگین بدون اسکرول در موبایل */
.login-container {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  overflow: hidden;
}




html, body {
  height: auto !important;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto !important;  /* ✅ اضافه شده */
}


i, .fa, .fas, .far, .fal, .fab {
    color: #2C3E50 !important;
}


.topbar-left .user-name{
  color:#1B2631;
  font-size:1rem;
  font-weight: 400;
}

/* جدول وسط‌چین با حداقل عرض در دسکتاپ و تمام عرض در موبایل */
.table-wrapper-centered {
  min-width: 900px;
  margin: 0 auto;
  width: auto;
}

/* در حالت موبایل و تبلت */
@media (max-width: 992px) {
  .table-wrapper-centered {
    min-width: 100% !important;
    width: 100% !important;
    margin: 0 auto;
  }
}


.currency-box {
  background-color: #e7f1fb;
  border-radius: 6px;
  padding: 12px 15px;
  max-width: 900px;
  display: flex;
  flex-wrap: wrap; /* اجازه‌ی رفتن به خط بعدی */
  gap: 8px;
  font-size: 1rem;
  margin: 0px auto!important;
}

.currency-box .currency-item {
  white-space: nowrap;
}


@media (max-width: 585px) {
  .currency-box {
    font-size: 0.85rem;
    padding: 6px 10px;

    display: flex;
    justify-content: space-between;
  }
}

/* حالت روشن */
.top-bar {
  background-color: #f8f9fa;
  color: #212529;
  border-bottom: 1px solid #e0e0e0;
}

/* حالت تاریک با رنگ سفارشی */
[data-bs-theme="dark"] .top-bar {
  background-color: #263238!important;  /* رنگ دلخواه تو */
  color: #f1f1f1!important;
  border-bottom: 1px solid #37474f!important;
}

/* آیکن‌ها در حالت تاریک */
[data-bs-theme="dark"] .top-bar i {
  color: #cfd8dc!important;
}

/* نام کاربر هم روشن باشه */
[data-bs-theme="dark"] .top-bar .user-name {
  color: #eceff1 !important;
}

/* جداکننده عمودی */
[data-bs-theme="dark"] .vr {
  background-color: #455a64!important;
}

/* رویداد یا مناسبت */
[data-bs-theme="dark"] .event {
  color: #b0bec5!important;
}

/* تاریخ در حالت تاریک */
[data-bs-theme="dark"] .topbar-right .today {
  color: #eceff1 !important;
}

/* حالت تیره کلی */
html[data-bs-theme='dark'], body[data-bs-theme='dark'] {
  background-color: #121212 !important;
  color: #e0e0e0 !important;
}

/* جدول‌ها */
html[data-bs-theme='dark'] .table-box table {
  background-color: #1f1f1f !important;
  color: #f0f0f0 !important;
}

html[data-bs-theme='dark'] .table-box th,
html[data-bs-theme='dark'] .table-box td {
  border-color: #444!important;
}

/* عنوان‌ها */
html[data-bs-theme='dark'] h4,
html[data-bs-theme='dark'] h5,
html[data-bs-theme='dark'] h6 {
  color: #e0e0e0 !important;
}

/* جعبه دلار */
html[data-bs-theme='dark'] .currency-box {
  background-color: transparent;
  color: #ffffff !important;
}

html[data-bs-theme='dark'] .currency-item {
  background-color: #0d47a1 !important;
  color: #fff !important;
  padding: 6px 12px;
  border-radius: 8px;
  margin: 5px;
  display: inline-block;
}

/* جعبه نمودار */
html[data-bs-theme='dark'] #chart-container > div {
  background-color: #1e1e1e !important;
}

html[data-bs-theme='dark'] .chart-title {
  color: #c0c0c0 !important;
}

/* مودال‌ها */
html[data-bs-theme='dark'] .modal-content {
  background-color: #2a2a2a;
  color: #fff;
}

html[data-bs-theme='dark'] .modal-header,
html[data-bs-theme='dark'] .modal-body,
html[data-bs-theme='dark'] .modal-footer {
  border-color: #444!important;
}

/* هشدارها */
html[data-bs-theme='dark'] .alert-warning {
  background-color: #333 !important;
  border-color: #555 !important;
  color: #ffa726 !important;
}
html[data-bs-theme='light'] .chart-container-inner {
  background-color: #f0f1f5!important;
}

html[data-bs-theme='dark'] .chart-container-inner {
  background-color: #1c1c1c!important;
}

html[data-bs-theme='dark'] .custom-table th,
html[data-bs-theme='dark'] .custom-table td {
  color: #f0f0f0 !important;  /* رنگ نوشته روشن‌تر برای خوانایی بهتر */
  border-color: #444 !important;  /* خط دور جدول کمی تیره‌تر */
  background-color: transparent; /* یا هر رنگ پس‌زمینه‌ای که لازم داری */
}


@media (max-width: 992px) {
  .table-wrapper-centered {
    max-height: 75vh; /* ارتفاع حداکثری در موبایل */
    overflow-y: auto;  /* فعال کردن اسکرول عمودی */
  }

  .table-wrapper-centered table {
    width: 100% !important; /* جلوگیری از بریده شدن جدول */
  }
}
