/* date-range-picker.css — one control for a whole period, ported from the hedge terminal.
 *
 * The native <input type="date"> is deliberately not used: it renders in the browser's own chrome,
 * ignores the platform palette and looks different on every OS. Same markup and behaviour as the
 * hedge picker, resized for the portal (which reads at 14px, not the terminal's 11px) and mapped
 * onto the portal palette instead of the terminal's CSS variables.
 */

.dpick {
    position: relative;
    display: inline-flex;
    width: 100%;
}

.dpick-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 8px 10px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, color .15s, box-shadow .15s;
}

.dpick-field:hover {
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, .2);
}

.dpick-field.filled {
    color: #fff;
}

.dpick-field.open {
    border-color: #06b6d4;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, .1);
}

.dpick-field i {
    font-size: 15px;
    line-height: 1;
    color: #6b7280;
}

.dpick-pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    width: 268px;
    box-sizing: border-box;
    padding: 10px;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
}

.dpick-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px 8px;
}

.dpick-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.dpick-nav {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 6px;
}

.dpick-nav:hover {
    color: #22d3ee;
    background: rgba(255, 255, 255, .05);
}

.dpick-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dpick-wd {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #4b5563;
}

.dpick-day {
    height: 30px;
    background: none;
    border: none;
    border-radius: 6px;
    color: #d1d5db;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12px;
    cursor: pointer;
    transition: background .1s, color .1s;
}

.dpick-day:hover:not(:disabled) {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.dpick-day.today {
    color: #22d3ee;
}

/* The chosen range reads as one band: solid ends, tinted middle. */
.dpick-day.selected {
    background: #06b6d4;
    color: #04141a;
    font-weight: 700;
}

.dpick-day.selected:hover {
    background: #06b6d4;
}

.dpick-day.range-start {
    border-radius: 6px 0 0 6px;
}

.dpick-day.range-end {
    border-radius: 0 6px 6px 0;
}

.dpick-day.range-start.range-end {
    border-radius: 6px;
}

.dpick-day.in-range {
    background: rgba(6, 182, 212, .16);
    color: #e5e7eb;
    border-radius: 0;
}

.dpick-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .05);
}

.dpick-range {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.dpick-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dpick-apply {
    flex-shrink: 0;
    padding: 5px 13px;
    background: #06b6d4;
    border: 1px solid #06b6d4;
    border-radius: 6px;
    color: #04141a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.dpick-apply:hover {
    filter: brightness(1.08);
}

.dpick-clear {
    flex-shrink: 0;
    padding: 5px 11px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 6px;
    color: #d1d5db;
    font-size: 12px;
    cursor: pointer;
}

.dpick-clear:hover:not(:disabled) {
    background: rgba(255, 255, 255, .05);
    color: #fff;
    border-color: rgba(255, 255, 255, .2);
}

.dpick-clear:disabled {
    opacity: .4;
    cursor: default;
}

/* Dropdowns. A native <select> draws its option list in operating-system chrome — appearance:none
 * restyles the closed control and nothing else, so the open list stays foreign to the platform.
 * The list is therefore ours, built on the same menu the hedge terminal uses.
 */
.pf-select {
    position: relative;
    width: 100%;
}

.pf-select-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.pf-select-field:hover {
    border-color: rgba(255, 255, 255, .2);
}

.pf-select-field.open {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, .1);
}

.pf-select-field .caret {
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
    flex: none;
    transition: transform .15s;
}

.pf-select-field.open .caret {
    transform: rotate(180deg);
}

.pf-select-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    padding: 6px;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
    max-height: 280px;
    overflow-y: auto;
}

.pf-menu-up {
    top: auto;
    bottom: calc(100% + 6px);
}

.pf-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    background: none;
    border: none;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.pf-menu-item:hover {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.pf-menu-item.selected {
    color: #22d3ee;
}

.pf-menu-item .tick {
    color: #22d3ee;
    font-size: 14px;
}

/* Admin filter bars read a step smaller than the portal — same control, tighter scale, so a row of
 * them lines up with the chips and pills next to it instead of towering over them. */
.pf-select-sm .pf-select-field {
    padding: 6px 9px;
    font-size: 12.5px;
    border-radius: 7px;
}

.pf-select-sm .pf-select-field .caret {
    font-size: 14px;
}

.pf-select-sm .pf-menu-item {
    padding: 6px 8px;
    font-size: 12.5px;
}

.dpick-sm .dpick-field {
    padding: 6px 9px;
    font-size: 12.5px;
    border-radius: 7px;
}

/* The picker is positioned by its own wrapper so a filter bar can size it like any other field. */
.dpick-wrap {
    position: relative;
    width: 100%;
}

/* A filter bar made of chips wants its dropdowns to read as chips too — same height, same radius,
 * so the row is one row of controls rather than two shapes sharing a line. */
.pf-select-chip .pf-select-field,
.dpick-chip .dpick-field {
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    background: transparent;
    color: #9ca3af;
}

.pf-select-chip .pf-select-field:hover,
.dpick-chip .dpick-field:hover {
    color: #fff;
    background: rgba(255, 255, 255, .04);
}

.pf-select-chip .pf-select-field.open,
.pf-select-chip .pf-select-field.filled,
.dpick-chip .dpick-field.open,
.dpick-chip .dpick-field.filled {
    background: rgba(6, 182, 212, .15);
    border-color: rgba(6, 182, 212, .4);
    color: #67e8f9;
    box-shadow: none;
}

.pf-select-chip .pf-menu-item {
    padding: 6px 8px;
    font-size: 12.5px;
}

.pf-select-chip .pf-menu,
.dpick-chip .dpick-pop {
    min-width: 200px;
}

/* A grouped list needs its headers to read as headers, not as options one cannot pick. */
.pf-menu-group {
    padding: 8px 8px 4px;
    color: #6b7280;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Visible but dead: a control the page cannot honour yet still shows what it would offer. */
.pf-select-field:disabled {
    opacity: .55;
    cursor: not-allowed;
}
