/* Jalali date picker — matches outlined field + calendar popover */
.jdp-field {
  position: relative;
  display: block;
  width: 100%;
}

.jdp-field .jdp-input,
.jdp-field input {
  width: 100%;
  box-sizing: border-box;
  padding-left: 2.4rem !important;
}

.jdp-trigger {
  position: absolute;
  left: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 1.85rem;
  height: 1.85rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0;
  font-size: 0.95rem;
}

.jdp-trigger:hover,
.jdp-trigger:focus-visible {
  color: var(--float-accent, #0f766e);
  outline: none;
  background: color-mix(in srgb, var(--float-accent, #0f766e) 12%, transparent);
}

.jdp-field--compact {
  width: 7.25rem;
  flex: 0 0 auto;
  min-width: 7.25rem;
}

.jdp-field--compact .jdp-input,
.jdp-field--compact input {
  width: 7.25rem !important;
  height: 2rem;
  padding: 0.3rem 0.4rem 0.3rem 1.85rem !important;
  font-size: 0.8rem;
  border: 1px solid var(--cargo-border, #d7dee8);
  border-radius: 5px;
  font-family: inherit;
  background: #fff;
}

.jdp-field--compact .jdp-trigger {
  left: 0.2rem;
  width: 1.55rem;
  height: 1.55rem;
  font-size: 0.8rem;
}

.jdp-popover {
  position: fixed;
  z-index: 10050;
  width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid #e8eef4;
  padding: 0.65rem 0.7rem 0.8rem;
  direction: rtl;
  font-family: inherit;
  color: #0f172a;
}

.jdp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.jdp-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  padding: 0.2rem 0.25rem;
  border-radius: 6px;
}

.jdp-title-btn:hover {
  background: #f1f5f9;
}

.jdp-title-btn i {
  color: #64748b;
  font-size: 0.75rem;
}

.jdp-nav {
  display: inline-flex;
  gap: 0.15rem;
}

.jdp-nav-btn {
  width: 1.85rem;
  height: 1.85rem;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.jdp-nav-btn:hover {
  background: #f1f5f9;
  color: #0f766e;
}

.jdp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
  margin-bottom: 0.25rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.78rem;
}

.jdp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}

.jdp-day {
  height: 2.15rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: #0f172a;
}

.jdp-day.is-empty {
  cursor: default;
  pointer-events: none;
}

.jdp-day:not(.is-empty):hover {
  background: #f1f5f9;
}

.jdp-day.is-selected {
  border-color: #94a3b8;
  background: #fff;
}

.jdp-day.is-today {
  border-color: var(--float-accent, #0f766e);
  color: var(--float-accent, #0f766e);
  font-weight: 700;
  position: relative;
}

.jdp-day.is-today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--float-accent, #0f766e);
}

.jdp-day.is-today.is-selected {
  background: var(--float-accent, #0f766e);
  border-color: var(--float-accent, #0f766e);
  color: #fff;
}

.jdp-day.is-today.is-selected::after {
  background: rgba(255, 255, 255, 0.8);
}

.jdp-years {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.15rem 0.1rem 0.35rem;
}

.jdp-year {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 0.2rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: #0f172a;
}

.jdp-year:hover {
  background: #f1f5f9;
}

.jdp-year.is-selected {
  background: var(--float-accent, #0f766e);
  color: #fff;
}

/* keep filter row single-line with compact date fields */
.cargo-ann-filters .jdp-field--compact {
  width: 7.25rem;
}
