/* ===== DATE RANGE PICKER ===== */

/* Trigger Button */
.drp-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--color-text);
  font-family: inherit;
  white-space: nowrap;
  min-width: 200px;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
}
.drp-trigger:hover,
.drp-trigger.drp-trigger-open {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(8,128,64,0.12);
}
.drp-icon { font-size: 1rem; }
.drp-label-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.drp-preset-name {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--color-text);
  line-height: 1.2;
}
.drp-range-text {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  line-height: 1.2;
}
.drp-caret {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  transition: transform var(--transition);
}
.drp-trigger-open .drp-caret { transform: rotate(180deg); }

/* Panel */
.drp-panel {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid var(--color-border);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  min-width: 560px;
}
.drp-panel.drp-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.drp-inner {
  display: flex;
  min-height: 320px;
}

/* Sidebar with presets */
.drp-sidebar {
  width: 160px;
  border-right: 1px solid var(--color-border);
  padding: 14px 10px;
  flex-shrink: 0;
  background: #fafbfc;
  overflow-y: auto;
}
.drp-sidebar-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 2px 8px 10px;
}
.drp-preset-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  background: none;
  border-radius: 7px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition);
  font-family: inherit;
  margin-bottom: 1px;
}
.drp-preset-btn:hover { background: #e8ecf0; color: var(--color-text); }
.drp-preset-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 700;
}

/* Calendar area */
.drp-cal-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.drp-calendars {
  flex: 1;
  display: flex;
  gap: 0;
  padding: 14px 16px;
}

/* Single month */
.drp-calendar {
  flex: 1;
  min-width: 200px;
}
.drp-cal-left  { border-right: 1px solid #f0f4f8; padding-right: 14px; margin-right: 14px; }
.drp-cal-right { }

.drp-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.drp-cal-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-text);
}
.drp-nav {
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  color: var(--color-text-secondary);
}
.drp-nav:hover { background: var(--color-bg); border-color: var(--color-primary); color: var(--color-primary); }
.drp-nav-hidden { opacity: 0; pointer-events: none; }

/* Calendar grid */
.drp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.drp-dow {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.drp-day {
  text-align: center;
  padding: 6px 2px;
  font-size: 0.82rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 80ms ease, color 80ms ease;
  color: var(--color-text);
  position: relative;
  user-select: none;
}
.drp-day:hover:not(.drp-day-future):not(.drp-day-empty) {
  background: var(--color-primary);
  color: white;
}
.drp-day-empty { cursor: default; }
.drp-day-future { color: var(--color-text-muted); cursor: not-allowed; opacity: 0.45; }
.drp-day-today:not(.drp-day-start):not(.drp-day-end) {
  font-weight: 800;
  color: var(--color-primary);
}
.drp-day-today::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--color-primary);
}
.drp-day-start.drp-day-today::after,
.drp-day-end.drp-day-today::after { display: none; }

.drp-day-start,
.drp-day-end {
  background: var(--color-primary) !important;
  color: white !important;
  font-weight: 700;
  border-radius: 6px;
}
.drp-day-mid {
  background: rgba(8,128,64,0.12);
  color: var(--color-primary);
  border-radius: 0;
}
.drp-day-start + .drp-day-mid,
.drp-day-mid + .drp-day-end { border-radius: 0; }
/* Round start-end of range row */
.drp-day-start { border-radius: 6px 0 0 6px; }
.drp-day-end   { border-radius: 0 6px 6px 0; }
.drp-day-single { border-radius: 6px !important; }

.drp-day-hover-range {
  background: rgba(8,128,64,0.08) !important;
  color: var(--color-primary) !important;
  border-radius: 0 !important;
}
.drp-day-hover-end {
  background: rgba(8,128,64,0.55) !important;
  color: white !important;
  border-radius: 0 6px 6px 0 !important;
}

/* Footer */
.drp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: #fafbfc;
  gap: 12px;
  flex-wrap: wrap;
}
.drp-selected-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.drp-sel-from, .drp-sel-to { color: var(--color-text); }
.drp-sel-sep   { color: var(--color-text-muted); }
.drp-sel-hint  { color: var(--color-text-muted); font-style: italic; }

.drp-footer-actions { display: flex; gap: 8px; flex-shrink: 0; }
.drp-cancel {
  padding: 7px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 7px;
  background: white;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-family: inherit;
  transition: all var(--transition);
}
.drp-cancel:hover { border-color: var(--color-danger); color: var(--color-danger); }
.drp-apply {
  padding: 7px 18px;
  border: none;
  border-radius: 7px;
  background: var(--color-primary);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.drp-apply:hover:not(:disabled) { background: var(--color-primary-dark); transform: translateY(-1px); }
.drp-apply.disabled, .drp-apply:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .drp-panel { min-width: calc(100vw - 20px) !important; width: calc(100vw - 20px) !important; }
  .drp-inner { flex-direction: column; }
  .drp-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--color-border); display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  .drp-sidebar-title { display: none; }
  .drp-preset-btn { width: auto; padding: 4px 10px; font-size: 0.75rem; border: 1px solid var(--color-border); border-radius: 20px; }
  .drp-preset-btn.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
  .drp-calendars { flex-direction: column; gap: 16px; }
  .drp-cal-left { border-right: none; padding-right: 0; margin-right: 0; border-bottom: 1px solid #f0f4f8; padding-bottom: 16px; margin-bottom: 0; }
}
