/* Global: Date Filter Popup (range) */

.date-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(55, 53, 47, 0.1);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #37352f;
  box-shadow: none;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.date-btn:hover {
  background: rgba(55, 53, 47, 0.06);
  border-color: transparent;
}

.date-popup {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 90px 14px 14px;
}

.date-popup.is-open {
  display: flex;
}

.date-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 18, 20, 0.45);
}

.date-card {
  position: relative;
  width: min(680px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--r) + 2px);
  box-shadow: var(--admin-shadow);
  overflow: hidden;
}

.date-card-h {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--admin-border);
  background: #fff;
}

.date-card-body {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 380px;
}

.date-card-f {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--admin-border);
  background: #fff;
}

.date-left {
  background: #fff;
  border-right: 1px solid rgba(55, 53, 47, 0.09);
  display: flex;
  flex-direction: column;
}

.date-presets {
  display: grid;
  gap: 2px;
  padding: 12px 10px 12px 12px;
  background: transparent;
}

.date-right {
  padding: 14px;
  background: var(--admin-bg);
  min-width: 0;
  min-height: 0;
}

.date-content-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  align-content: start;
  min-width: 0;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--r) + 2px);
  background: #fff;
  box-sizing: border-box;
}

.date-presets .date-preset {
  width: 100%;
  text-align: left;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: #37352f;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.date-presets .date-preset:hover {
  background: rgba(55, 53, 47, 0.06);
}

.date-presets .date-preset.is-active {
  background: rgba(55, 53, 47, 0.08);
  border-color: transparent;
  color: #37352f;
}

/* Date range display (read-only) */

.date-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.date-range-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 10px;
  border: 1px solid rgba(96, 100, 108, 0.16);
  border-radius: calc(var(--r) + 2px);
  background: #f7f7fa;
  min-width: 0;
}

.date-range-k {
  font-size: 11px;
  color: var(--admin-muted);
  font-weight: 700;
  line-height: 1.1;
}

.date-range-v {
  font-size: 13px;
  color: var(--admin-text);
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-cal {
  margin-top: 0;
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  justify-self: start;
}

.date-cal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.date-cal-title {
  font-weight: 750;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-cal-nav {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.date-cal-btn {
  padding: 6px 10px;
  border-radius: var(--r);
  border: 1px solid rgba(96, 100, 108, 0.16);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.date-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--r) + 2px);
  background: #fff;
}

.date-cal-dow {
  font-size: 11px;
  color: var(--admin-muted);
  font-weight: 800;
  text-align: center;
}

.date-cal-day {
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(96, 100, 108, 0.14);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.date-cal-day.is-today {
  background: #f1f1f3;
  border-color: rgba(96, 100, 108, 0.24);
}

.date-cal-day.is-inrange {
  background: var(--admin-accent-weak);
  border-color: var(--admin-accent-weak-border);
}

.date-cal-day.is-start,
.date-cal-day.is-end {
  background: var(--admin-accent);
  border-color: var(--admin-accent);
  color: var(--admin-accent-contrast);
}

