.form-group,
.form-row,
.field-wrapper {
  overflow: hidden;
  min-width: 0;
}

.iran-plate {
  min-width: 0;
}

------------------------- .autocomplete-list {
  border: 1px solid #ddd;
  max-height: 200px;
  overflow: auto;
  background: rgb(0, 0, 0);
}

.autocomplete-list .item {
  padding: 8px;
  cursor: pointer;
}

.autocomplete-list .item:hover {
  background: #000000;
}

.primary-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  height: 36px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.primary-btn:hover {
  background: #1d4ed8;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.back {
  background: #334155;
  color: #fff;
  padding: 10px 14px;
  border: 1px, solid, white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

/* temporary */

.temp {
  background: #475569;
  color: #fff;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.temp:hover {
  background: #334155;
}

/* final */

.final {
  background: #22c55e;
  color: #fff;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.final:hover {
  background: #16a34a;
}

/* splash */

.splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.splash-content {
  text-align: center;
}

.splash-logo {
  width: 90px;
  margin: auto;
  margin-bottom: 20px;
}

.loading-text {
  margin-bottom: 15px;
  font-size: 14px;
  color: #cbd5f5;
}

/* progress */

.progress {
  width: 220px;
  height: 6px;
  background: #1e293b;
  border-radius: 10px;
  overflow: hidden;
  margin: auto;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #3b82f6);
  transition: 0.2s;
}

/* login */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #111827;
  padding: 40px 30px;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.login-card h2 {
  margin-bottom: 25px;
  font-size: 22px;
}

.form-group {
  margin-bottom: 18px;
  text-align: right;
}

.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: #cbd5f5;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #020617;
  color: white;
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}

.form-group input:focus {
  border-color: #3b82f6;
}

.login-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 8px;
  background: linear-gradient(45deg, #06b6d4, #3b82f6);
  color: white;
  font-size: 15px;
}

.login-btn:hover {
  opacity: 0.9;
}

.error {
  background: #7f1d1d;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 15px;
}
/* cards */

.cards {
  display: flex;
  flex-wrap: wrap; /* برای رفتن به سطر بعد در موبایل */
  gap: 20px;
  justify-content: flex-start; /* کارت‌ها از سمت راست شروع شوند */
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 30px;
  text-align: center;
}

.card {
  /* background: #020617; */
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 20px;
}
/* استایل عمومی هر کارت */
.stat-card {
  flex: 1 1 180px; /* این خط معجزه می‌کند! عرض مساوی به همه می‌دهد */
  min-height: 140px; /* حداقل ارتفاع ثابت برای همه */
  display: flex;
  flex-direction: column; /* چیدمان ستونی (متن بالا، عدد پایین) */
  justify-content: center; /* عمودی وسط‌چین */
  align-items: center; /* افقی وسط‌چین */
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #edf2f7;
  transition: transform 0.2s;
}

/* --- استایل اختصاصی کلاس‌های مختلف کارت‌ها --- */

/* ۱. کل سفارشات (آبی ملایم) */
.stat-card.total {
  background-color: #ebf8ff;
  border: 1px solid #bee3f8;
}
.stat-card.total span {
  color: #2b6cb0;
}
.stat-card.total h3 {
  color: #2b6cb0;
}
.stat-card.total i {
  color: #3182ce;
}

/* ۲. دریافت شده / خاتمه یافته (سبز ملایم) */
.stat-card.success {
  background-color: #f0fff4;
  border: 1px solid #c6f6d5;
}
.stat-card.success span {
  color: #2f855a;
}
.stat-card.success h3 {
  color: #2f855a;
}
.stat-card.success i {
  color: #38a169;
}

/* ۳. در حال ارسال / رزرو کالا (نارنجی ملایم) */
.stat-card.warning {
  background-color: #fffaf0;
  border: 1px solid #feebc8;
}
.stat-card.warning span {
  color: #dd6b20;
}
.stat-card.warning h3 {
  color: #dd6b20;
}
.stat-card.warning i {
  color: #ed8936;
}

/* ۴. تایید حسابداری / پیش فاکتور (بنفش یا فیروزه‌ای ملایم) */
.stat-card.info {
  background-color: #ebf8ff; /* یا e6fffa برای فیروزه‌ای */
  border: 1px solid #b2f5ea;
}
.stat-card.info span {
  color: #319795;
}
.stat-card.info h3 {
  color: #319795;
}
.stat-card.info i {
  color: #319795;
}

/* ۵. کنسل شده (قرمز ملایم) */
.stat-card.danger {
  background-color: #fff5f5;
  border: 1px solid #fed7d7;
}
.stat-card.danger span {
  color: #c53030;
}
.stat-card.danger h3 {
  color: #c53030;
}
.stat-card.danger i {
  color: #e53e3e;
}

/* تنظیم متن و عدد داخل کارت */
.stat-card span {
  font-size: 14px;
  color: #718096;
  margin-bottom: 10px;
}

.stat-card h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: #2d3748;
}
.stat-card span {
  font-size: 13px;
  color: #94a3b8;
}

.stat-card h3 {
  margin-top: 8px;
  font-size: 26px;
  color: #38bdf8;
}
@media (max-width: 768px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.clickable {
  cursor: pointer;
  transition: 0.2s;
}

.clickable:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* chart */

.chart-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
}

/* orders header */

.orders-header {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #020617;
  color: white;
}

/* order card */

.order-card {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: 0.2s;
}

.order-card:hover {
  border-color: #38bdf8;
}

.order-card.selected {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}

/* order grid */

.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: center;
}

/* phone icon */

.phone {
  display: flex;
  align-items: center;
  gap: 10px; /* فاصله بین شماره و آیکون */
}

.phone-number {
  font-weight: 500;
  letter-spacing: 0.5px;
}
/* ======================
   PRODUCT HEADER
====================== */
#productSearch {
  width: 100%;
  box-sizing: border-box;

  background-color: #ffffff !important;
  color: #1f2937 !important;

  border: 1px solid #d1d5db;
  border-radius: 10px;

  padding: 10px 12px;

  font-family: inherit;
  font-size: 14px;

  outline: none;
}
#productSearch::placeholder {
  color: #9ca3af !important;
  opacity: 1;
}
#productSearch:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 25px 0 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.products-title {
  font-size: 18px;
  font-weight: 600;
}

.add-product-btn {
  background: #0ea5e9;
  color: white;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.add-product-btn-Secendry {
  background: #c4c4c4;
  color: white;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.add-product-btn:hover {
  background: #0284c7;
}

#searchResults {
  position: absolute;
  width: 100%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 999;
}

#searchResults .item {
  padding: 10px 12px;
  cursor: pointer;
  color: #1f2937 !important;
  background: #ffffff !important;
  font-size: 14px;
}

#searchResults .item:hover {
  background: #f3f4f6;
}

/* ======================
   TABLE
====================== */

.products table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.products th,
.products td {
  padding: 10px;
  border-bottom: 1px solid #1e293b;
  text-align: center;
}

.products th {
  color: #94a3b8;
  font-weight: 500;
}

/* ======================
   SPIN INPUT
====================== */

.spin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.spin button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: #1e293b;
  color: white;
  cursor: pointer;
  font-size: 16px;
}

.spin button:hover {
  background: #334155;
}

.spin input {
  width: 45px;
  text-align: center;
  border: none;
  background: #020617;
  color: white;
}

/* ======================
   LOAD SWITCH
====================== */

.complete-cell {
  text-align: center;
  vertical-align: middle;
  min-width: 80px;
}

.load-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  margin: 0;
  vertical-align: middle;
}

.load-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.load-switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background-color: #475569;
  border-radius: 999px;
  transition:
    background-color 0.25s ease,
    box-shadow 0.25s ease;
  box-sizing: border-box;
}

.load-switch-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  right: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.load-switch-input:checked + .load-switch-slider {
  background-color: #22c55e;
}

.load-switch-input:checked + .load-switch-slider::before {
  transform: translateX(-24px);
}

.load-switch-input:focus + .load-switch-slider {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

/* ======================
   ACTION BUTTONS
====================== */

.actions {
  margin-top: 25px;
  display: flex;
  gap: 12px;
}

.temp {
  background: #475569;
  color: white;
}

.final {
  background: #22c55e;
  color: white;
}

/* ======================
   MODAL
====================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #020617;
  padding: 25px;
  border-radius: 12px;
  width: 350px;
  max-width: 95%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #1e293b;
}

.modal-content input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #020617;
  color: white;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* ======================
   AUTOCOMPLETE
====================== */

.autocomplete {
  position: relative;
}

.suggestions {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: #020617;
  border: 1px solid #1e293b;
  border-top: none;
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
}

.suggestions div {
  padding: 8px 10px;
  cursor: pointer;
}

.suggestions div:hover {
  background: #1e293b;
}

/* ======================
   TOAST
====================== */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #22c55e;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

.toast.show {
  opacity: 1;
}

/* ======================
   DRIVER INFO FORM
====================== */

.driver-card {
  max-width: 700px;
  margin: 30px auto;
  padding: 25px;
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1e293b;
}

.driver-card h2 {
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

.driver-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  color: #94a3b8;
}

.form-group input,
.form-group select {
  height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #020617;
  color: white;
  font-family: Vazirmatn;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #0ea5e9;
}

/* وقتی فیلد باید کل عرض را بگیرد */

.full {
  grid-column: 1 / -1;
}

/* ======================
   DRIVER ACTIONS
====================== */

.driver-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.driver-submit {
  background: #22c55e;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.driver-submit:hover {
  background: #16a34a;
}

.driver-cancel {
  background: #475569;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.driver-cancel:hover {
  background: #334155;
}
/* ======================
   DATE PICKER ACTIONS
====================== */

.date-box {
  font-family: Vazirmatn;
  width: 90%;
}

.date-box label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.date-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-field {
  position: relative;
}

.date-field input {
  width: 200px;
  height: 38px;
  padding: 10px 38px 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-family: Vazirmatn;
  font-size: 14px;
  background: #fff;
}

.date-input-wrapper .primary-btn {
  height: 38px;
  padding: 0 16px;
  white-space: nowrap;
}

/* #date {
  width: 100%;
  padding: 10px 38px 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-family: Vazirmatn;
  font-size: 14px;
  background: #fff;
  transition: all 0.2s ease;
} */

#date:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.calendar-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #64748b;
  pointer-events: none;
}

.quick-date {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.quick-date button {
  border: none;
  background: #f1f5f9;
  color: #334155;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: Vazirmatn;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-date button:hover {
  background: #3b82f6;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.quick-date button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* =================================================== */

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  margin-top: 50px;
}

.modal-content {
  background: #ffffff;
  width: 90%;
  max-width: 900px;
  margin: 5% auto;
  border-radius: 10px;
  overflow: hidden;
}

.modal-header {
  padding: 12px 16px;
  background: #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 15px;
  max-height: 500px;
  overflow: auto;
}

.close {
  font-size: 22px;
  cursor: pointer;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid #eee;
  padding: 8px;
  text-align: center;
}

.clickable {
  cursor: pointer;
  transition: 0.2s ease;
}

.clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.old-pending-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.old-pending-table th,
.old-pending-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
  white-space: nowrap;
}

.old-pending-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.old-pending-table tr:hover {
  background: #f9fafb;
}

.table-action-btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.table-action-btn:hover {
  background: #1d4ed8;
}

/* ============================   فرم تغییر پسورد    ==================================== */
.back-btn {
  display: block;
  margin-top: 15px;
  text-align: center;
  padding: 10px;
  background: #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
}

.back-btn:hover {
  background: #d5d5d5;
}

.success {
  background: #e6f9f0;
  border: 1px solid #2ecc71;
  color: #1e7e4d;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  animation: fadeSuccess 0.4s ease;
}

/* .success::before {
  content: "✔";
  background: #2ecc71;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
} */

@keyframes fadeSuccess {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------   نمایش فلش متن   ----------------------------------------- */
.dashboard-announcement {
  width: 100%;
  background: #1e293b;
  color: #fff;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  direction: rtl;
}

.announcement-track {
  white-space: nowrap;
  overflow: hidden;
}

.announcement-content {
  display: inline-block;
  padding: 10px 0;
  animation: scroll-rtl 25s linear infinite;
  padding-top: 30px;
}

.dashboard-announcement:hover .announcement-content {
  animation-play-state: paused;
}

.announcement-content a {
  color: #38bdf8;
  text-decoration: none;
  margin: 0 15px;
  font-weight: 500;
}

.announcement-content a:hover {
  text-decoration: underline;
}

.sep {
  color: #94a3b8;
  margin: 0 10px;
}

@keyframes scroll-rtl {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

/* جستجو کالا برای نماینده ها  */
.search-result {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  max-height: 300px;
  overflow: auto;
  z-index: 999;
  display: none;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.search-item {
  padding: 12px;
  border-bottom: 1px solid #f1f1f1;
  cursor: pointer;
  transition: 0.2s;
}

.search-item:hover {
  background: #f5f7fb;
}

.search-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.search-meta {
  font-size: 12px;
  color: #777;
}
