/* ── DATE RANGE TRIGGER ──────────────────────────────────────── */
.date-range-wrap {
  position: relative;
}

.date-range-trigger {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  height: 100%;
  min-height: 44px;
}
.date-range-trigger:hover,
.date-range-trigger.open {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}

.dr-col {
  flex: 1;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.dr-col + .dr-col {
  border-left: 1px solid #e2e8f0;
}
.dr-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin-bottom: 1px;
}
.dr-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dr-val.placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* ── POPUP ───────────────────────────────────────────────────── */
.dp-popup {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  z-index: 9999;
  width: 720px;
  max-width: 99vw;
  padding: 20px 20px 0;
  display: none;
  animation: dpFadeIn 0.15s ease;
}
.dp-popup.active { display: block; }

@keyframes dpFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── NAV ROW (arrows + two months) ───────────────────────────── */
.dp-nav-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.dp-navbtn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.12s;
  line-height: 1;
}
.dp-navbtn:hover { background: #f1f5f9; border-color: #94a3b8; }
.dp-navbtn:disabled { opacity: 0.25; cursor: not-allowed; }

/* ── MONTHS ──────────────────────────────────────────────────── */
.dp-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  flex: 1;
}

.dp-mtitle {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

/* ── GRID ────────────────────────────────────────────────────── */
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}

.dp-dh {
  font-size: 0.7rem;
  font-weight: 500;
  color: #94a3b8;
  text-align: center;
  padding: 2px 0 8px;
}

.dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.dp-day.dp-empty { cursor: default; pointer-events: none; }
.dp-day.dp-past  { cursor: not-allowed; pointer-events: none; }
.dp-day.dp-past .dp-dnum { color: #cbd5e1; }

/* ── NUMBER CIRCLE ───────────────────────────────────────────── */
.dp-dnum {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 400;
  color: #0f172a;
  transition: background 0.1s, color 0.1s;
}

/* Hover circle */
.dp-day:not(.dp-past):not(.dp-empty):not(.dp-checkin):not(.dp-checkout):hover .dp-dnum {
  background: #e8f4fd;
  color: #1d4ed8;
}

/* ── RANGE BACKGROUND (behind circle) ───────────────────────── */
.dp-day::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  right: 0;
  background: transparent;
  z-index: 0;
}

.dp-day.dp-inrange::before {
  background: #dbeafe;
}

/* Check-in: range fills right half of cell */
.dp-day.dp-checkin::before {
  background: linear-gradient(to right, transparent 50%, #dbeafe 50%);
}

/* Check-out: range fills left half of cell */
.dp-day.dp-checkout::before {
  background: linear-gradient(to left, transparent 50%, #dbeafe 50%);
}

/* Same-day selection: no range background */
.dp-day.dp-checkin.dp-checkout::before {
  background: transparent;
}

/* ── SELECTED CIRCLES ────────────────────────────────────────── */
.dp-day.dp-checkin .dp-dnum,
.dp-day.dp-checkout .dp-dnum {
  background: #1b3a6b !important;
  color: #fff !important;
  font-weight: 700;
}

/* ── TODAY ───────────────────────────────────────────────────── */
.dp-day.dp-today:not(.dp-checkin):not(.dp-checkout) .dp-dnum {
  border: 1.5px solid #2563eb;
  font-weight: 600;
  color: #2563eb;
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.dp-footer {
  margin-top: 16px;
  padding: 14px 4px 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dp-info {
  color: #94a3b8;
  font-size: 1.15rem;
  cursor: default;
  line-height: 1;
}

.dp-apply {
  background: #1b3a6b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 36px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  letter-spacing: 0.01em;
}
.dp-apply:hover:not(:disabled) { background: #2563eb; }
.dp-apply:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* ── OVERLAY ─────────────────────────────────────────────────── */
.dp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
}
.dp-overlay.active { display: block; }

/* ── MOBILE ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .dp-popup {
    width: 100vw;
    left: 0;
    transform: none;
    border-radius: 16px 16px 0 0;
    position: fixed;
    top: auto;
    bottom: 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
    max-height: 92vh;
    overflow-y: auto;
    animation: dpSlideUp 0.2s ease;
  }
  @keyframes dpSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .dp-months { grid-template-columns: 1fr; }
  .dp-navbtn { margin-top: 0; }
}
