/* Google Analytics–style date range picker (dual calendar + presets) */

.adrp {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.adrp__trigger {
  align-items: center;
  max-width: min(100%, 22rem);
}

.adrp__trigger-icon {
  flex-shrink: 0;
}

.adrp__trigger-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  flex: 1 1 auto;
  margin: 0 6px;
  text-align: left;
}

.adrp__trigger-text {
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.adrp__trigger-preset {
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.2;
  color: #70757a;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.adrp.is-disabled .button {
  opacity: 0.65;
  cursor: not-allowed;
}

.adrp__menu.dropdown-menu {
  min-width: 0;
  width: auto;
  max-width: calc(100vw - 24px);
  padding-top: 0;
  z-index: 40;
  /* Horizontal nudge from JS when near viewport edges; keep top alignment stable */
  transform-origin: top left;
}

.dropdown.is-right .adrp__menu.dropdown-menu {
  transform-origin: top right;
}

.adrp__panel {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(32, 33, 36, 0.18);
  overflow: hidden;
}

.adrp__presets {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid #e8eaed;
  padding: 8px 0;
  background: #fafafa;
}

.adrp__preset-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: #3c4043;
  cursor: pointer;
  line-height: 1.3;
}

.adrp__preset-btn:hover {
  background: #e8f0fe;
  color: #1967d2;
}

.adrp__preset-btn.is-active {
  background: #e8f0fe;
  color: #1967d2;
  font-weight: 600;
}

.adrp__cal-wrap {
  padding: 12px 14px 14px;
  flex: 1;
  min-width: 0;
}

.adrp__range-error {
  font-size: 0.75rem;
  color: #d93025;
  margin: 0 0 8px;
  min-height: 1.2em;
}

.adrp__months {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  justify-content: center;
}

.adrp__month {
  width: 252px;
  flex-shrink: 0;
}

.adrp__month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.adrp__month-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #3c4043;
}

.adrp__nav-btn {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: #5f6368;
  padding: 0;
  line-height: 1;
}

.adrp__nav-btn:hover {
  background: #f1f3f4;
  color: #202124;
}

.adrp__nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.adrp__dow-row {
  display: grid;
  grid-template-columns: repeat(7, 36px);
  gap: 0;
  margin-bottom: 4px;
}

.adrp__dow {
  font-size: 0.65rem;
  font-weight: 600;
  color: #70757a;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.adrp__grid {
  display: grid;
  grid-template-columns: repeat(7, 36px);
  grid-template-rows: repeat(6, 32px);
  gap: 0;
}

.adrp__day {
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  color: #3c4043;
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  padding: 0;
  position: relative;
  z-index: 1;
}

.adrp__day:hover:not(:disabled) {
  background: #f1f3f4;
}

.adrp__day--muted {
  color: #bdc1c6;
}

.adrp__day--today {
  font-weight: 700;
  color: #1967d2;
}

.adrp__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  position: relative;
}

.adrp__cell--mid {
  background: #e8f0fe;
}

.adrp__day--middle {
  background: transparent;
  border-radius: 0;
  width: 100%;
  max-width: 36px;
}

.adrp__day--middle:hover:not(:disabled) {
  background: #d3e3fd !important;
}

.adrp__day--range-start,
.adrp__day--range-end {
  background: #1967d2 !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 50%;
  width: 32px;
  max-width: 32px;
}

.adrp__footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8eaed;
  font-size: 0.8125rem;
  color: #5f6368;
  text-align: center;
}

.adrp__hint {
  font-size: 0.75rem;
  color: #80868b;
  margin-top: 6px;
}

@media (max-width: 768px) {
  .adrp__panel {
    flex-direction: column;
  }

  .adrp__presets {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    flex-wrap: wrap;
    padding: 6px;
    gap: 4px;
  }

  .adrp__preset-btn {
    width: auto;
    padding: 8px 12px;
    border-radius: 6px;
  }
}
