/* Custom date range popup: presets on the left, two-month calendar, Cancel / Apply.
   Used on the dashboard and the admin Influencers/UGC pages. */

.range-custom {
    position: relative;
}
.range-custom > summary {
    list-style: none;
    cursor: pointer;
}
.range-custom > summary::-webkit-details-marker {
    display: none;
}

.range-custom .range-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    display: flex;
    width: max-content;
    max-width: calc(100vw - 32px);
    font-family: inherit;
    color: #000;
    background: #fff;
    border: 1px solid #d0d2d3;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
    overflow: hidden;
}

/* presets */
.range-presets {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 170px;
    margin: 0;
    padding: 14px 0;
    list-style: none;
    border-right: 1px solid #d0d2d3;
}
.range-presets a,
.range-presets span {
    display: block;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(0, 0, 0, .6);
    text-decoration: none;
}
.range-presets a:hover {
    color: #000;
    background: #f6f6f6;
}
.range-presets .is-active {
    color: #000;
    background: #f3e7fd;
    box-shadow: inset 3px 0 0 #8933e6;
}
.range-presets-custom {
    margin-top: auto;
}

/* calendar + footer */
.range-custom .range-form {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0;
    margin: 0;
    white-space: normal;
}
.range-cal {
    display: flex;
}
.range-cal-month {
    width: 286px;
    padding: 18px 20px 12px;
}
.range-cal-month + .range-cal-month {
    border-left: 1px solid #d0d2d3;
}
.range-cal-head {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    margin-bottom: 10px;
}
.range-cal-title {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}
.range-cal-nav {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    color: #000;
    background: #fff;
    border: 1px solid #d0d2d3;
    border-radius: 8px;
    cursor: pointer;
}
.range-cal-nav:hover {
    background: #f6f6f6;
}
.range-cal-next-small {
    display: none;
}
.range-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 4px;
}
.range-cal-dow {
    padding: 6px 0;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: rgba(0, 0, 0, .6);
}
.range-cal-day {
    position: relative;
    height: 34px;
    padding: 0;
    font: inherit;
    font-size: 13px;
    color: #000;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
.range-cal-day:hover:not(:disabled):not(.is-edge) {
    background: #f6f6f6;
}
.range-cal-day.is-outside {
    color: rgba(0, 0, 0, .35);
}
.range-cal-day.is-in {
    background: #f6f6f6;
    border-radius: 0;
}
.range-cal-day.is-edge {
    color: #fff;
    background: #8933e6;
    border-radius: 8px;
}
.range-cal-day.is-today::after {
    position: absolute;
    bottom: 3px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    content: "";
    background: #8933e6;
    border-radius: 50%;
}
.range-cal-day.is-edge.is-today::after {
    background: #fff;
}
.range-cal-day:disabled {
    color: rgba(0, 0, 0, .2);
    cursor: default;
}

.range-form-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #d0d2d3;
}
.range-custom .range-form-foot input[type="date"] {
    width: 150px;
    height: 38px;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    color: #000;
    background: #fff;
    border: 1px solid #d0d2d3;
    border-radius: 8px;
}
.range-form-dash {
    color: rgba(0, 0, 0, .45);
}
.range-form-buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}
.range-custom .range-form-buttons button {
    height: 38px;
    padding: 0 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}
.range-custom .range-cancel {
    color: #000;
    background: #fff;
    border: 1px solid #d0d2d3;
}
.range-custom .range-cancel:hover {
    background: #f6f6f6;
}
.range-custom .range-apply {
    color: #fff;
    background: #8933e6;
    border: 1px solid #8933e6;
}

/* small screens: one month, presets on top */
@media (max-width: 820px) {
    .range-custom .range-popup {
        position: fixed;
        top: 16px;
        left: 16px;
        right: 16px;
        flex-direction: column;
        width: auto;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
    .range-presets {
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
        padding: 8px;
        border-right: 0;
        border-bottom: 1px solid #d0d2d3;
    }
    .range-presets a,
    .range-presets span {
        padding: 8px 12px;
        border-radius: 8px;
    }
    .range-presets .is-active {
        box-shadow: none;
    }
    .range-presets-custom {
        margin-top: 0;
    }
    .range-cal-month {
        width: auto;
        flex: 1;
    }
    .range-cal-month + .range-cal-month {
        display: none;
    }
    .range-cal-next-small {
        display: block;
    }
    .range-custom .range-form-foot input[type="date"] {
        flex: 1;
        width: auto;
        min-width: 0;
    }
    .range-form-buttons {
        width: 100%;
    }
    .range-form-buttons button {
        flex: 1;
    }
}

.range-form-foot .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
