/* Gregorian date picker with Hijri hint — Work order follow */
.am-date {
  position: relative;
  width: 100%;
  min-width: 0;
}

.am-date-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  clip: rect(0 0 0 0);
}

.am-date-trigger {
  position: relative;
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  padding-inline-start: 2.45rem;
  border-radius: 12px;
  border: 1px solid #d5dee6;
  background:
    linear-gradient(180deg, #fff 0%, #f7fbfb 100%);
  color: #12324f;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: start;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.am-date.has-clear .am-date-trigger {
  padding-inline-end: 2.15rem;
}

.sr-search-row .am-date-trigger {
  border-radius: 8px;
  min-height: 44px;
}

.am-date-trigger:hover {
  border-color: color-mix(in srgb, #0e7c8a 40%, #d5dee6);
  background: #fff;
}

.am-date.is-open .am-date-trigger,
.am-date-trigger:focus-visible {
  outline: none;
  border-color: #0e7c8a;
  box-shadow: 0 0 0 3px rgba(14, 124, 138, 0.16);
  background: #fff;
}

.am-date.is-locked .am-date-trigger {
  background: #f1f5f9;
  color: #64748b;
  cursor: default;
  box-shadow: none;
}

.am-date-ico {
  position: absolute;
  inset-inline-start: 0.72rem;
  top: 50%;
  width: 16px;
  height: 16px;
  display: block;
  transform: translateY(-50%);
  color: #0e7c8a;
  pointer-events: none;
}

.am-date.is-locked .am-date-ico { color: #94a3b8; }

.am-date-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.am-date-label.is-empty {
  color: #94a3b8;
  font-weight: 600;
}

.am-date-clear {
  position: absolute;
  inset-inline-end: 0.4rem;
  top: 50%;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #eef2f6;
  color: #64748b;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
}

.am-date-clear:hover { background: #e2e8f0; color: #0f172a; }

.am-date-pop {
  position: fixed;
  z-index: 20000;
  width: min(92vw, 332px);
  background: #fff;
  border-radius: 22px;
  border: 1px solid rgba(215, 224, 234, 0.95);
  box-shadow: 0 24px 60px rgba(15, 39, 68, 0.22);
  padding: 0.7rem;
  direction: rtl;
  color: #12324f;
  animation: amDateIn 0.18s ease both;
}

.am-date-pop[hidden] { display: none !important; }

@keyframes amDateIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.am-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
  padding: 0.55rem 0.45rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.2), transparent 46%),
    linear-gradient(120deg, #12324f 0%, #0e7c8a 100%);
  color: #fff;
}

.am-date-nav {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.am-date-nav:hover { background: rgba(255, 255, 255, 0.28); }

.am-date-nav svg {
  width: 16px;
  height: 16px;
  display: block;
}

.am-date-title {
  flex: 1 1 auto;
  text-align: center;
  min-width: 0;
}

.am-date-title strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff;
}

.am-date-title small {
  display: inline-block;
  margin-top: 0.18rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.am-date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.55rem;
}

.am-date-preset {
  border: 0;
  border-radius: 999px;
  background: #f4f7fb;
  color: #334155;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.28rem 0.65rem;
  cursor: pointer;
}

.am-date-preset:hover { background: #e6f4f5; color: #0e7c8a; }

.am-date-week,
.am-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.am-date-week span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  padding: 0.25rem 0 0.35rem;
}

.am-date-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #12324f;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.am-date-day:hover { background: #eef6f7; }

.am-date-day.is-out { color: #cbd5e1; }

.am-date-day.is-today {
  box-shadow: inset 0 0 0 1.5px #0e7c8a;
  color: #0e7c8a;
}

.am-date-day.is-inrange {
  background: rgba(14, 124, 138, 0.12);
  border-radius: 8px;
}

.am-date-day.is-selected,
.am-date-day.is-selected:hover {
  background: linear-gradient(145deg, #12324f, #0e7c8a);
  color: #fff;
  box-shadow: 0 6px 14px rgba(14, 124, 138, 0.35);
}

.am-date-day.is-mate {
  background: rgba(14, 124, 138, 0.16);
  box-shadow: inset 0 0 0 1.5px #0e7c8a;
}

.am-date-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eef2f6;
}

.am-date-foot button {
  border: 0;
  border-radius: 999px;
  background: #f4fbfb;
  color: #0e7c8a;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
}

.am-date-foot button:hover { background: #e6f4f5; }

.bld-field .am-date {
  flex: 1 1 auto;
  min-width: 0;
}

.bld-field .am-date-trigger {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 44px;
  padding: 0.55rem 0;
  border-radius: 0;
}

.bld-field .am-date-ico { display: none; }

.bld-field .am-date.is-open .am-date-trigger,
.bld-field .am-date-trigger:focus-visible {
  box-shadow: none;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .am-date-pop { animation: none; }
}
