/* ==========================================================================
   Trips page (PremiumTripList.vue, .pp-trips) — fixes from the Trips frontend audit.
   Base Trips rules live in pie-premium.css ("Trips page" section); this file loads after it.
   ========================================================================== */

/* Requests tab: its list (received_trip_request_list.vue) has no toolbar search, so it keeps the
   table's own search box, as in the classic look. pie-premium.css hides it for the trips table,
   which has the toolbar search instead. */
html.pie-premium .pp-shell .pp-trips .received-trip-request-list-section .vgt-global-search {
    display: flex;
    border-bottom: 1px solid var(--pp-line);
}

/* Column-search row on every tab (Requests, Upcoming, Traveling, Returned…), as in the classic
   look. pie-premium.css hides it unless a field holds text, which left no way to start a column
   search. Same selector so this later file wins. */
html.pie-premium .pp-shell .pp-trips table.vgt-table thead tr:has(> th.filter-th):not(:has(.vgt-input:not(:placeholder-shown))) {
    display: table-row;
}

/* My trips / All trips / In-house trips / ICs trips: one line that scrolls sideways inside its
   capsule on narrow screens (like the status tabs above it) instead of wrapping to two rows */
html.pie-premium .pp-shell .pp-trips .tasks-block {
    min-width: 0; /* lets the bar below shrink and scroll instead of pushing its row wider */
}

html.pie-premium .pp-shell .pp-trips .tasks-filter {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

html.pie-premium .pp-shell .pp-trips .tasks-filter::-webkit-scrollbar {
    display: none;
}

html.pie-premium .pp-shell .pp-trips .tasks-filter li {
    flex: none;
    white-space: nowrap;
}

/* Row gear menu (b-popover is rendered in <body>, outside .pp-shell): the design's popover list,
   only while the Trips page is open. Same recipe as forms.css / booking-confirmations.css */
html.pie-premium body:has(.pp-shell .pp-trips) .popover.popover-reservation-settings {
    padding: 6px;
    border: 0 !important;
    border-radius: 14px;
    background: var(--pp-panel);
    box-shadow: 0 30px 70px -24px rgba(17, 17, 26, .35), 0 0 0 1px var(--pp-line);
    font-family: var(--pp-sans);
}

html.pie-premium body:has(.pp-shell .pp-trips) .popover.popover-reservation-settings .popover-arrow {
    display: none;
}

html.pie-premium body:has(.pp-shell .pp-trips) .popover.popover-reservation-settings .popover-body {
    padding: 0;
}

html.pie-premium body:has(.pp-shell .pp-trips) .popover.popover-reservation-settings .popover-body a {
    display: flex !important;
    align-items: center;
    gap: 4px;
    margin: 0 !important;
    padding: 4px 12px 4px 4px;
    border-radius: 9px;
    color: var(--pp-ink-2) !important;
    font-size: 13px;
    text-decoration: none;
}

html.pie-premium body:has(.pp-shell .pp-trips) .popover.popover-reservation-settings .popover-body a:hover {
    background: var(--pp-panel-2);
    color: var(--pp-ink) !important;
}

/* Trips Import (TripImport.vue, full-screen so the mapping/preview step has room): new-look
   header, file picker and buttons */
html.pie-premium .pp-shell .pp-trips #trip-upload .modal-header {
    padding: 22px 32px;
    border-bottom: 1px solid var(--pp-line);
}

html.pie-premium .pp-shell .pp-trips #trip-upload .modal-title {
    color: var(--pp-ink);
    font: 20px/1.2 var(--pp-bold);
    letter-spacing: -.01em;
}

html.pie-premium .pp-shell .pp-trips #trip-upload .modal-body {
    padding: 24px 32px;
}

html.pie-premium .pp-shell .pp-trips #trip-upload .csv-import-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    max-width: 640px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px dashed var(--pp-line-2);
    border-radius: 14px;
    background: var(--pp-panel-2);
    color: var(--pp-ink-3);
    font: 13.5px var(--pp-sans);
}

/* CustomImportCsv.vue renders a second, empty .csv-import-file block */
html.pie-premium .pp-shell .pp-trips #trip-upload .csv-import-file:not(:has(> *)) {
    display: none;
}

html.pie-premium .pp-shell .pp-trips #trip-upload .csv-import-file .small_text {
    margin: 0;
    padding: 0;
    color: var(--pp-ink-3);
    font: 13.5px var(--pp-sans);
}

html.pie-premium .pp-shell .pp-trips #trip-upload .csv-import-file input[type=file] {
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pp-ink-2);
    font: 13.5px var(--pp-sans);
}

html.pie-premium .pp-shell .pp-trips #trip-upload .csv-import-file input[type=file]::file-selector-button {
    height: 40px;
    margin-right: 12px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(30, 38, 32, .05), 0 6px 16px -10px rgba(30, 40, 32, .25), 0 0 0 1px var(--pp-line);
    color: var(--pp-ink);
    font: 13.5px var(--pp-bold);
    cursor: pointer;
}

html.pie-premium .pp-shell .pp-trips #trip-upload .csv-import-file input[type=file]::file-selector-button:hover {
    background: color-mix(in srgb, var(--pp-acc) 8%, #fff);
}

html.pie-premium .pp-shell .pp-trips #trip-upload .csv-import-file a {
    color: var(--pp-acc);
    font-family: var(--pp-bold);
}

html.pie-premium .pp-shell .pp-trips #trip-upload .btn.btn-primary {
    height: 40px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0)), var(--pp-acc);
    box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--pp-acc) 80%, #000);
    color: #fff;
    font: 13.5px var(--pp-bold);
    letter-spacing: 0;
}

/* Trip status filter: option list the width of its field, soft card, statuses in sentence case
   like the status pills in the table ("NEW REQUEST" -> "New request") */
html.pie-premium .pp-shell .pp-trips .trip-list-filter .form-floating > .v-select {
    position: static; /* the menu positions against the whole field card (.form-floating) */
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .vs__dropdown-menu {
    left: 0;
    width: 100%;
    margin-top: 6px;
    padding: 6px;
    border: 0;
    border-radius: 12px;
    background: var(--pp-panel);
    box-shadow: var(--pp-shadow), 0 0 0 1px var(--pp-line);
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .vs__dropdown-option {
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--pp-ink-2);
    font: 13.5px var(--pp-sans);
    text-transform: lowercase;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .vs__dropdown-option::first-letter {
    text-transform: uppercase;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .vs__dropdown-option--highlight {
    background: var(--pp-panel-2);
    color: var(--pp-ink);
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .vs__dropdown-option--selected {
    color: var(--pp-acc);
    font-family: var(--pp-bold);
}

/* Trip start date picker (vue2-daterange-picker): soft card, quiet range list, accent dates,
   Clear as a secondary pill */
html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker {
    margin-top: 10px;
    border: 0;
    border-radius: 14px;
    background: var(--pp-panel);
    box-shadow: 0 30px 70px -24px rgba(17, 17, 26, .35), 0 0 0 1px var(--pp-line);
    font-family: var(--pp-sans);
    overflow: hidden;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker::before,
html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker::after {
    display: none;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker .ranges ul {
    padding: 6px;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker .ranges li {
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--pp-ink-2);
    font-size: 13px;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker .ranges li:hover {
    background: var(--pp-panel-2);
    color: var(--pp-ink);
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker .ranges li.active {
    background: var(--pp-ink);
    color: #fff;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker td.available:hover {
    border-radius: 8px;
    background: var(--pp-hover);
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker td.in-range {
    background: var(--pp-acc-soft);
    color: var(--pp-ink);
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker td.active,
html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker td.active:hover {
    border-radius: 8px;
    background: var(--pp-acc);
    color: #fff;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker .slot {
    padding: 8px 10px 10px;
    border-top: 1px solid var(--pp-line);
}

/* !important: template1.css (.daterangepicker .btn-primary) and pie-premium.css (.btn-primary)
   paint it Bordeaux with !important, which left the Bordeaux "Clear" text unreadable */
html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker .slot .btn {
    height: 34px;
    padding: 0 16px;
    border: 0 !important;
    border-radius: 999px;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(30, 38, 32, .05), 0 6px 16px -10px rgba(30, 40, 32, .25), 0 0 0 1px var(--pp-line);
    color: var(--pp-ink) !important;
    font: 13px/34px var(--pp-bold);
    letter-spacing: 0;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker .slot .btn:hover {
    background: color-mix(in srgb, var(--pp-acc) 8%, #fff) !important;
}

/* Phones: template1.css gives the picker min-width 683px !important, which pushed the page
   sideways. Anchor it to the full-width filter row instead of the small field, fit it to that
   width, and let the calendars scroll inside it */
@media (max-width: 640px) {
    html.pie-premium .pp-shell .pp-trips .trip-list-filter {
        position: relative;
    }

    html.pie-premium .pp-shell .pp-trips .trip-list-filter .form-floating:has(> .vue-daterange-picker),
    html.pie-premium .pp-shell .pp-trips .trip-list-filter .vue-daterange-picker {
        position: static;
    }

    html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker {
        left: 0 !important;
        right: auto !important;
        width: 100%;
        min-width: 0 !important;
        overflow-x: auto;
    }
}

/* Trip status multi-select: selected statuses as spaced soft pills (name + small x) that wrap
   inside the field; the field grows in height and pushes "Remove filters" down instead of
   overlapping it. The width is the same as the other filter fields (template1.css sets 206px). */
html.pie-premium .pp-shell .pp-trips .trip-list-filter .multi-select-box.trip-request-status {
    width: auto;
    height: auto;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .multi-select-box.trip-request-status .form-floating {
    height: auto;
    margin-right: 0 !important;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__selected-options {
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 2px 0 0;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .vuegood-table-info .trip-request-status .vs__selected,
html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__selected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    padding: 2px 6px 2px 9px;
    border: 0;
    border-radius: 999px;
    background: var(--pp-panel-2);
    color: var(--pp-ink-2);
    font: 11.5px/1.5 var(--pp-bold);
    letter-spacing: .02em;
    text-transform: uppercase;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__deselect {
    margin: 0;
    padding: 0;
    fill: var(--pp-muted);
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__deselect:hover {
    fill: var(--pp-acc);
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__search {
    margin: 0;
    padding: 0;
    min-width: 40px;
}

html.pie-premium .pp-shell .pp-trips .applied-filters-wrapper {
    clear: both;
    position: relative;
}

/* template1.css paints the range picker magenta (#A20090 / #FAF2F9) with !important, so the
   Bordeaux soft/accent colours above never applied. Same selectors, !important on colour only. */
html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker td.in-range {
    background-color: var(--pp-acc-soft) !important;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker td.active,
html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker td.active:hover {
    background-color: var(--pp-acc) !important;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker .ranges li.active {
    background-color: var(--pp-ink) !important;
}

/* Compact calendar and range list, like the design (dates 30px cells, 13px text) */
html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker .calendars-container {
    font-size: 13px;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker td,
html.pie-premium .pp-shell .pp-trips .trip-list-filter .daterangepicker th {
    min-width: 30px;
    height: 30px;
    font-size: 13px;
}

/* Trip status: the empty search input wrapped onto its own row under the pills, leaving a blank
   band and pushing the bin off-centre. Let it share a row with the last pill (or sit alone at
   the field's height) so the field is snug and the bin sits at its vertical middle. */
html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__selected-options {
    align-items: center;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__search,
html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__search:focus {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    height: 24px;
    margin: 0;
    padding: 0;
    line-height: 24px;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__selected + .vs__search {
    flex-basis: 0;
}

/* Bin (Advisor / Trip start date / Trip status): a 28px box at the vertical middle of its field,
   icon centred in it. template1.css makes the <i> itself position:absolute with top/right offsets
   (.form-floating a i, .date-select i, .status-select i), which pushed the icon to the box's
   bottom-right corner; put it back in normal flow. Hover uses the box tint, not classic magenta. */
html.pie-premium .pp-shell .pp-trips .trip-list-filter .form-floating > a {
    top: 50%;
    right: 8px;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .form-floating > a i,
html.pie-premium .pp-shell .pp-trips .trip-list-filter .form-floating > a i:hover {
    position: static;
    top: auto;
    right: auto;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit;
    font-size: 15px;
    line-height: 1;
}

/* Trip status: no leftover height under the pills (the field was stretching the select) */
html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .form-floating {
    min-height: 0;
    padding-bottom: 8px;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .v-select,
html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__dropdown-toggle {
    height: auto !important;
    min-height: 0 !important;
    align-items: flex-start;
}

html.pie-premium .pp-shell .pp-trips .trip-list-filter .trip-request-status .vs__actions {
    align-self: flex-start;
    padding: 4px 0 0;
}
