.jalali-picker {
  position: relative;
  display: block;
  width: 100%;
  max-width: 200px;
  flex: 0 0 auto;
  z-index: 5;
}

.jalali-picker.jalali-picker-range {
  max-width: 320px;
}

.jalali-picker .jalali-display {
  width: 100%;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236d28d9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px !important;
  padding-left: 12px !important;
  text-align: right;
}

.jc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(31, 22, 53, 0.28);
  display: none;
}

.jc-backdrop.open {
  display: block;
}

.jc-popover {
  position: fixed;
  z-index: 9999;
  width: 300px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff;
  border: 1px solid #e8e2f4;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(79, 20, 160, 0.18);
  padding: 12px;
  display: none;
  box-sizing: border-box;
  direction: rtl;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  color: #1f1635;
}

.jc-popover.open {
  display: block;
  animation: jcIn 0.16s ease;
}

@keyframes jcIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.jc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.jc-title {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #6d28d9;
  line-height: 1.3;
}

.jc-selectors {
  flex: 1;
  display: flex;
  gap: 6px;
  justify-content: center;
}

.jc-select {
  border: 1px solid #e8e2f4;
  background: #fcfbff;
  border-radius: 10px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.85rem;
  color: #1f1635;
  max-width: 120px;
}

.jc-nav {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
}

.jc-nav:hover {
  background: #6d28d9;
  color: #fff;
}

.jc-week,
.jc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  direction: rtl;
}

.jc-weekday {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b6280;
}

.jc-day {
  width: 100% !important;
  height: 36px !important;
  min-width: 0 !important;
  aspect-ratio: auto !important;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #1f1635;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.jc-day:hover:not(.empty) {
  background: #ede9fe;
  color: #6d28d9;
}

.jc-day.empty {
  cursor: default;
  pointer-events: none;
  visibility: hidden;
}

.jc-day.today {
  box-shadow: inset 0 0 0 2px #6d28d9;
}

.jc-day.selected {
  background: #6d28d9 !important;
  color: #fff !important;
  box-shadow: none;
}

.jc-day.holiday,
.jc-day.friday {
  background: #fff1f2;
  color: #be123c;
}

.jc-day.holiday:hover,
.jc-day.friday:hover {
  background: #ffe4e6;
  color: #9f1239;
}

.jc-day.selected.holiday,
.jc-day.selected.friday {
  background: #be123c !important;
  color: #fff !important;
}

.jc-day.disabled,
.jc-day:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background: #f3f4f6 !important;
  color: #9ca3af !important;
  box-shadow: none !important;
}

/* ظرفیت نوبت — اگر پزشک در جمعه/تعطیل هم باشد، سبز/خاکستری بر قرمز غلبه می‌کند */
.jc-day.slot-free:not(.selected):not(.disabled) {
  background: #d1fae5 !important;
  color: #047857 !important;
  font-weight: 700;
  text-decoration: none;
}

.jc-day.slot-free:hover:not(.selected):not(.disabled) {
  background: #a7f3d0 !important;
  color: #065f46 !important;
}

.jc-day.slot-full:not(.selected):not(.disabled) {
  background: #e5e7eb !important;
  color: #6b7280 !important;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.jc-day.slot-full:hover:not(.selected):not(.disabled) {
  background: #d1d5db !important;
  color: #4b5563 !important;
}

/* جمعه/تعطیل با حضور پزشک: گوشه قرمز کوچک */
.jc-day.works-holiday:not(.selected):not(.disabled) {
  box-shadow: inset -3px 0 0 #be123c;
}

/* بدون حضور عادی: آبی */
.jc-day.slot-none,
.jc-day.slot-none:disabled {
  background: #e0f2fe !important;
  color: #7dd3fc !important;
  opacity: 0.85;
  text-decoration: none;
}

/* تعطیل/جمعه بدون حضور: قرمز و قفل */
.jc-day.holiday:disabled:not(.slot-free):not(.slot-full),
.jc-day.friday:disabled:not(.slot-free):not(.slot-full) {
  background: #fff1f2 !important;
  color: #fda4af !important;
  opacity: 0.75;
}

.jc-legend .dot.disabled {
  background: #d1d5db;
}

.jc-legend .dot.slot-free {
  background: #10b981;
}

.jc-legend .dot.slot-full {
  background: #9ca3af;
}

.jc-legend .dot.slot-none {
  background: #0ea5e9;
}

.jc-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.72rem;
  color: #6b6280;
}

.jc-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}

.jc-legend .dot.holiday {
  background: #be123c;
}

.jc-legend .dot.today {
  background: #6d28d9;
}

.jc-footer {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.jc-today-btn {
  border: none;
  background: #ede9fe;
  color: #6d28d9;
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.jc-today-btn:hover {
  background: #6d28d9;
  color: #fff;
}

.jc-today-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.jc-months {
  display: block;
}

.jc-months-wide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .jc-months-wide {
    grid-template-columns: 1fr;
  }
}

.jc-month-panel {
  min-width: 0;
}

.jc-month-title {
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #6d28d9;
  margin-bottom: 8px;
}

.jc-day.in-range {
  background: #ede9fe !important;
  color: #5b21b6 !important;
  border-radius: 0;
}

.jc-day.in-range.selected {
  background: #6d28d9 !important;
  color: #fff !important;
  border-radius: 10px;
}

.jc-legend .dot.range {
  background: #c4b5fd;
}

.jc-range-hint {
  width: 100%;
  text-align: center;
  font-size: 0.78rem;
  color: #6b6280;
  margin-bottom: 8px;
}

.jc-footer {
  flex-wrap: wrap;
  gap: 8px;
}

.filters,
.panel {
  overflow: visible;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
