* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  direction: rtl;
}

body {
  background-color: rgb(240, 244, 248);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Vazirmatn', sans-serif;
}

header {
  display: flex;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  justify-content: flex-start;
  padding: 1rem;
  margin-bottom: 0;
}

header .header-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

header .logo-container {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

header .logo-img {
  height: 40px;
  margin-right: auto;
}

header h1 {
  font-size: 1.8rem;
  color: rgb(30, 136, 229);
  margin: 0;
}

header .header-links {
  margin-top: 0;
}

main {
  flex: 1;
  padding: 20px;
  max-width: 1000px;
  margin: auto;
}

form {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.input__group {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.input__group label {
  margin-bottom: 6px;
  font-weight: bold;
  color: rgb(3, 50, 91);
}

.input__group input,
.input__group select,
.input__group textarea {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background-color: #fff;
  transition: all 0.3s ease;
}

.input__group input:focus,
.input__group select:focus,
.input__group textarea:focus {
  outline: none;
  border-color: rgb(30, 136, 229);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

/* استایل برای فیلدهای دارای خطا */
.input__group input.error,
.input__group textarea.error,
.input__group select.error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.input__group .error-message {
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
  display: block;
}

.input__group textarea {
  resize: vertical;
  min-height: 80px;
}

#submitBtn {
  margin-top: 20px;
  background-color: #4caf50;
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
  font-size: 16px;
  font-weight: bold;
}

#submitBtn:hover {
  background-color: #388e3c;
}

footer {
  background-color: rgb(227, 242, 253);
  text-align: center;
  padding: 15px;
  font-size: 0.9rem;
  color: rgb(30, 136, 229);
  border-top: 1px solid rgb(227, 242, 253);
  margin-top: auto;
}

/* کارت لیست سفارشات داخل main مثل فرم و جزئیات */
.order-details {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  max-width: 1000px;
  margin: 20px auto;
}

/* انیمیشن ساده */
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

/* ============================================
   استایل‌های حرفه‌ای برای تقویم شمسی
   ============================================ */

/* استایل کلی تقویم */
.pdp-container {
  border-radius: 16px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
  border: none !important;
  overflow: hidden !important;
  font-family: 'Vazirmatn', sans-serif !important;
  background: #fff !important;
  z-index: 9999 !important;
  animation: calendarSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes calendarSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* هدر تقویم */
.pdp-header {
  background: linear-gradient(135deg, #1e88e5 0%, #0b4a80 100%) !important;
  color: white !important;
  padding: 20px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-radius: 0 !important;
}

.pdp-header-title {
  font-weight: 700 !important;
  font-size: 18px !important;
  letter-spacing: 0.5px !important;
}

.pdp-header-nav {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  border: none !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  font-size: 16px !important;
  font-weight: bold !important;
}

.pdp-header-nav:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.1);
}

/* بدنه تقویم */
.pdp-body {
  padding: 20px !important;
  background: #fff !important;
}

/* روزهای هفته */
.pdp-weekdays {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
  padding: 12px 0 !important;
  background: linear-gradient(to bottom, #f5f7fa 0%, #e8ecf1 100%) !important;
  border-radius: 10px !important;
}

.pdp-weekday {
  text-align: center !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  color: #1e88e5 !important;
  padding: 8px !important;
}

/* روزهای ماه */
.pdp-days {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 6px !important;
}

.pdp-day {
  aspect-ratio: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  color: #333 !important;
  background: transparent !important;
}

.pdp-day:hover {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
  transform: scale(1.1) !important;
  z-index: 1 !important;
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.2) !important;
}

/* روز انتخاب شده */
.pdp-day.pdp-selected {
  background: linear-gradient(135deg, #1e88e5 0%, #0b4a80 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4) !important;
  transform: scale(1.05) !important;
}

.pdp-day.pdp-selected:hover {
  background: linear-gradient(135deg, #0b4a80 0%, #1e88e5 100%) !important;
  transform: scale(1.1) !important;
}

/* روز امروز */
.pdp-day.pdp-today {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%) !important;
  color: #e65100 !important;
  font-weight: 700 !important;
  border: 2px solid #ff9800 !important;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3) !important;
}

.pdp-day.pdp-today:hover {
  background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%) !important;
  border-color: #f57c00 !important;
}

/* روزهای ماه قبل/بعد */
.pdp-day.pdp-other-month {
  color: #bbb !important;
  opacity: 0.4 !important;
}

.pdp-day.pdp-other-month:hover {
  opacity: 0.6 !important;
  background: #f5f5f5 !important;
}

/* فوتر تقویم */
.pdp-footer {
  background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%) !important;
  padding: 15px 20px !important;
  border-top: 1px solid #dee2e6 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-radius: 0 0 16px 16px !important;
}

.pdp-footer-today {
  background: linear-gradient(135deg, #1e88e5 0%, #0b4a80 100%) !important;
  color: white !important;
  padding: 10px 20px !important;
  border-radius: 8px !important;
  border: none !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: all 0.3s ease !important;
  font-family: 'Vazirmatn', sans-serif !important;
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3) !important;
}

.pdp-footer-today:hover {
  background: linear-gradient(135deg, #0b4a80 0%, #1e88e5 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4) !important;
}

.pdp-footer-today:active {
  transform: translateY(0) !important;
}

.pdp-footer-gregorian {
  color: #495057 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

/* استایل فیلد تاریخ */
.input__group input.datepicker {
  cursor: pointer !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231e88e5' stroke-width='2' stroke-linecap='round' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 10px center !important;
  padding-left: 40px !important;
}

.input__group input.datepicker:focus {
  border-color: #1e88e5 !important;
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15) !important;
}

/* ریسپانسیو */
/* استایل جدول لیست سفارشات */
.table-container {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  overflow-x: auto;
  margin-bottom: 20px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Vazirmatn', sans-serif !important;
}

.orders-table thead {
  background: linear-gradient(135deg, rgb(30, 136, 229) 0%, rgb(11, 74, 128) 100%);
  color: white;
}

.orders-table th {
  padding: 15px;
  text-align: right;
  font-weight: 600;
  font-size: 14px;
  border: none;
  font-family: 'Vazirmatn', sans-serif !important;
}

.orders-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e0e0e0;
  text-align: right;
  font-size: 14px;
  font-family: 'Vazirmatn', sans-serif !important;
}

.orders-table tbody tr {
  transition: all 0.2s ease;
}

.orders-table tbody tr:hover {
  background-color: rgb(240, 244, 248);
}

.orders-table tbody tr:last-child td {
  border-bottom: none;
}

/* دکمه مشاهده */
.btn-view {
  display: inline-block;
  padding: 6px 12px;
  background-color: rgb(30, 136, 229);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.3s ease;
  font-family: 'Vazirmatn', sans-serif !important;
}

.btn-view:hover {
  background-color: rgb(11, 74, 128);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(30, 136, 229, 0.3);
}

/* دکمه ایجاد سفارش جدید */
.actions {
  text-align: center;
  margin-top: 30px;
}

.btn-new-order {
  display: inline-block;
  background-color: #4caf50;
  color: white;
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  font-family: 'Vazirmatn', sans-serif !important;
}

.btn-new-order:hover {
  background-color: #388e3c;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* حالت خالی */
.empty-state {
  background-color: #ffffff;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  text-align: center;
  color: #666;
  font-size: 16px;
  font-family: 'Vazirmatn', sans-serif !important;
}

/* استایل صفحه جزئیات سفارش */
.order-details {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.detail-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

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

.detail-section h2 {
  color: rgb(30, 136, 229);
  font-size: 18px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgb(227, 242, 253);
  font-family: 'Vazirmatn', sans-serif !important;
}

.detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.detail-item {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: 'Vazirmatn', sans-serif !important;
}

.detail-item.full-width {
  flex: 1 1 100%;
}

.detail-item label {
  font-weight: bold;
  color: rgb(3, 50, 91);
  font-size: 13px;
  font-family: 'Vazirmatn', sans-serif !important;
}

.detail-item span {
  color: #333;
  font-size: 14px;
  padding: 8px;
  background-color: rgb(240, 244, 248);
  border-radius: 6px;
  min-height: 20px;
  font-family: 'Vazirmatn', sans-serif !important;
}

/* استایل آکاردئون سفارشات برای موبایل (کپی از Metronic 8 Demo 9) */
.orders-accordion {
  direction: rtl;
}

.orders-accordion .accordion-item {
  background-color: #fff;
  border: 1px solid #e4e6ef !important;
  border-radius: 0.475rem;
  overflow: hidden;
}

.orders-accordion .accordion-button {
  background-color: #fff;
  border: none;
  box-shadow: none;
  padding: 1rem;
  font-size: 1.5rem;
  text-align: right;
  direction: rtl;
}

.orders-accordion .accordion-button:not(.collapsed) {
  background-color: #f8f9fa;
  color: inherit;
}

.orders-accordion .accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}

.orders-accordion .accordion-button::after {
  display: none;
}

.accordion-toggle-label {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background-color: #1e88e5;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  border: none;
}

.accordion-toggle-label:hover {
  background-color: #0b4a80;
}

.orders-accordion .accordion-button .svg-icon {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.orders-accordion .accordion-button:not(.collapsed) .svg-icon {
  transform: rotate(180deg);
}

.orders-accordion .accordion-collapse {
  transition: height 0.35s ease;
}

.orders-accordion .accordion-body {
  background-color: #f8f9fa;
  padding: 1rem;
  border-top: 1px solid #e4e6ef;
  font-size: 1.4rem;
}

.orders-accordion .accordion-body .border-bottom {
  border-color: #e4e6ef !important;
}

/* در موبایل لیست سفارشات تمام عرض شود */
@media (max-width: 768px) {
  .order-details {
    max-width: 100%;
    border-radius: 0;
    margin: 0;
  }
}

/* ============================================ استایل تقویم شمسی جدولی ============================================ */
.date-picker-group {
  position: relative;
}

.calendar-container {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 5px;
  z-index: 1000;
  display: none;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: calendarSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-wrapper {
  min-width: 280px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e4e6ef;
}

.calendar-nav-btn {
  background: transparent;
  border: none;
  color: #495057;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.calendar-nav-btn:hover {
  background: #e9ecef;
  color: #1e88e5;
}

.calendar-title {
  font-weight: 600;
  font-size: 15px;
  color: #212529;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.calendar-table thead {
  background: #f8f9fa;
}

.calendar-table th {
  padding: 8px 4px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: #6c757d;
  border-bottom: 1px solid #e4e6ef;
}

.calendar-table td {
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 400;
  color: #212529;
  width: 14.28%;
  height: 36px;
}

.calendar-table td:hover:not(.other-month):not(.selected) {
  background: #e3f2fd;
  border-radius: 4px;
}

.calendar-table td.other-month {
  color: #adb5bd;
  cursor: default;
}

.calendar-table td.other-month:hover {
  background: transparent;
}

.calendar-table td.today {
  background: #1e88e5;
  color: white;
  font-weight: 600;
  border-radius: 4px;
}

.calendar-table td.today:hover {
  background: #1976d2;
}

.calendar-table td.selected {
  background: #1e88e5;
  color: white;
  font-weight: 600;
  border-radius: 4px;
}

.calendar-table td.selected:hover {
  background: #1976d2;
}

.calendar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #f8f9fa;
  border-top: 1px solid #e4e6ef;
}

.calendar-today-btn {
  color: #1e88e5;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.calendar-today-btn:hover {
  color: #1976d2;
  text-decoration: underline;
}

.calendar-gregorian {
  color: #6c757d;
  font-size: 13px;
}

/* ریسپانسیو برای تقویم */
@media (max-width: 768px) {
  .calendar-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 350px;
  }
  
  .calendar-wrapper {
    min-width: auto;
  }
  
  .calendar-table td {
    padding: 8px 4px;
    font-size: 12px;
  }
}

@media (max-width: 992px) {
  .input__group {
    flex: 1 1 100%;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .input__group label {
    width: 100px;
    margin-bottom: 0;
  }

  .input__group input {
    flex: 1;
  }

  .pdp-container {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 0 auto !important;
  }

  .pdp-day {
    font-size: 12px !important;
    padding: 4px !important;
  }

  .pdp-header {
    padding: 15px !important;
  }

  .pdp-header-title {
    font-size: 16px !important;
  }

  /* در عرض‌های کوچک و تبلت، Bootstrap خودش با d-none d-md-block و d-block d-md-none مدیریت می‌کند */
  /* استایل‌های اضافی برای آکاردئون در موبایل */
  .orders-accordion .accordion-button {
    padding: 1rem;
    font-size: 1.5rem;
  }
  
  .orders-accordion .accordion-button .fw-bold {
    font-size: 1.6rem !important;
  }
  
  .orders-accordion .accordion-button .fs-7 {
    font-size: 1.4rem !important;
  }
  
  .orders-accordion .accordion-button .fs-6 {
    font-size: 1.5rem !important;
  }
  
  .orders-accordion .accordion-body {
    padding: 1rem;
    font-size: 1.4rem;
  }
  
  .orders-accordion .accordion-body .fs-7 {
    font-size: 1.3rem !important;
  }
  
  .orders-accordion .accordion-body .fw-semibold {
    font-size: 1.4rem !important;
  }
}
