/* Date-range picker popover (static/js/range-picker.js).
   Theme through --rp-* tokens; they fall back to the main app's palette so
   the popover matches the logged-in UI with no extra setup. The intake page
   overrides the tokens with its own glass/red scheme. */
.rp-pop {
    --_bg: var(--rp-bg, var(--bg-primary, #1a1a2e));
    --_border: var(--rp-border, var(--border, #0f3460));
    --_text: var(--rp-text, var(--text-primary, #e0e0e0));
    --_muted: var(--rp-muted, var(--text-muted, #666));
    --_accent: var(--rp-accent, var(--accent, #3a7bd5));
    --_accent-text: var(--rp-accent-text, #fff);
    --_range: var(--rp-range, color-mix(in srgb, var(--_accent) 22%, transparent));
    --_hover: var(--rp-hover, var(--bg-hover, rgba(255,255,255,0.06)));
    position: fixed; z-index: 10001;
    display: none;
    background: var(--_bg);
    color: var(--_text);
    border: 1px solid var(--_border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    padding: 12px 12px 10px;
    font-size: 13px;
    user-select: none;
    -webkit-user-select: none;
}
.rp-pop.rp-open { display: block; }
.rp-months { display: flex; gap: 20px; }
.rp-month { width: 224px; }
.rp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.rp-title { font-weight: 600; font-size: 13px; }
.rp-nav {
    width: 26px; height: 26px; border-radius: 6px;
    border: 1px solid transparent; background: transparent;
    color: var(--_text); font-size: 18px; line-height: 1; cursor: pointer;
    font-family: inherit;
}
.rp-nav:hover { background: var(--_hover); border-color: var(--_border); }
.rp-nav-hidden { visibility: hidden; }
.rp-dow, .rp-grid { display: grid; grid-template-columns: repeat(7, 32px); }
.rp-dow span { text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--_muted); padding: 2px 0 4px; }
.rp-cell { height: 32px; }
.rp-day {
    border: none; background: transparent; color: var(--_text);
    font: inherit; font-size: 13px; cursor: pointer; border-radius: 6px;
    padding: 0; margin: 0;
}
.rp-day:hover { background: var(--_hover); }
.rp-day.rp-today { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
/* The blue band between the two ends: square edges so cells read as one bar,
   rounded only at the start/end caps. */
.rp-day.rp-in-range { background: var(--_range); border-radius: 0; }
.rp-day.rp-start, .rp-day.rp-end, .rp-day.rp-preview {
    background: var(--_accent); color: var(--_accent-text); font-weight: 600;
}
.rp-day.rp-start:not(.rp-end):not(.rp-preview) { border-radius: 6px 0 0 6px; }
.rp-day.rp-end, .rp-day.rp-preview:not(.rp-start) { border-radius: 0 6px 6px 0; }
.rp-day.rp-start.rp-preview, .rp-day.rp-start.rp-end { border-radius: 6px; }
.rp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--_border); }
.rp-hint { color: var(--_muted); font-size: 12px; }
.rp-foot-btns { display: flex; gap: 6px; }
.rp-btn {
    padding: 5px 11px; border-radius: 6px; font: inherit; font-size: 12px; cursor: pointer;
    border: 1px solid var(--_border); background: transparent; color: var(--_text);
}
.rp-btn:hover { background: var(--_hover); }
.rp-btn-primary { background: var(--_accent); border-color: var(--_accent); color: var(--_accent-text); }
.rp-btn-primary:hover { filter: brightness(1.1); background: var(--_accent); }
/* The field the next click will fill gets the accent border, like the
   From/To tabs on a travel site. */
.rp-active-field { border-color: var(--_accent, var(--accent, #3a7bd5)) !important; box-shadow: 0 0 0 2px var(--rp-range, color-mix(in srgb, var(--accent, #3a7bd5) 25%, transparent)); }

/* Standalone overlay (overlayPair) for pages without app-core's .dt-wrap CSS. */
.rp-wrap { position: relative; display: block; }
.rp-wrap .dt-display { width: 100%; box-sizing: border-box; cursor: pointer; }
.rp-wrap .dt-hidden { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }

/* Phones: one month, anchored to the bottom of the screen. */
@media (max-width: 640px) {
    .rp-pop.rp-sheet {
        left: 0 !important; right: 0; bottom: 0; top: auto !important;
        border-radius: 14px 14px 0 0;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    .rp-pop.rp-sheet .rp-month { width: 100%; }
    .rp-pop.rp-sheet .rp-dow, .rp-pop.rp-sheet .rp-grid { grid-template-columns: repeat(7, 1fr); }
    .rp-pop.rp-sheet .rp-cell { height: 40px; font-size: 15px; }
}
