/* Transfer price grids - /transferprice, /partnertransferprice and
   /PartnerOrganisationPrices all render the same QuickGrid and need the same
   column widths, wrapping headers and toolbar.

   Loaded after avis.css so these rules win the ties against its .table rules;
   the wrapper qualified selectors are there because ".table thead th" is more
   specific than ".tp-grid th" on its own. */

/* Add New Row and Export share one right aligned toolbar on the filter row. */
.tp-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* The grid has to fit the card without a horizontal scrollbar, with the two
   model dropdowns wide enough to read the full vehicle name. Fixed layout lets
   the percentage widths below hold instead of the browser sizing to content. */
.tp-grid-wrap {
    overflow-x: visible;
}

.tp-grid {
    table-layout: fixed;
    width: 100%;
}

    .tp-grid-wrap .tp-grid th, .tp-grid-wrap .tp-grid td {
        padding: 6px 8px;
        vertical-align: middle;
        word-break: break-word;
    }

    /* QuickGrid truncates header text with an ellipsis by default - let the
       narrow price columns wrap onto a second line instead of hiding the title. */
    /* avis.css styles ".table thead th" - a more specific selector than ".tp-grid th" -
       so the header rules have to be qualified with the wrapper to take effect. */
    /* Fixed header height so the row looks identical for airport, local and
       outstation - the airport titles wrap onto two lines, the others do not. */
    .tp-grid-wrap .tp-grid thead th {
        white-space: normal;
        height: 40px;
        vertical-align: middle;
        font-size: 9px;
        letter-spacing: 0.2px;
        padding: 0 6px;
    }

        .tp-grid-wrap .tp-grid thead th .col-title,
        .tp-grid-wrap .tp-grid thead th .col-title-text {
            font-size: 9px;
            align-items: center;
            overflow: visible;
            text-overflow: clip;
            white-space: normal;
            word-break: normal;
            overflow-wrap: anywhere;
            line-height: 1.2;
            max-width: none;
        }

    /* Actions is the narrowest column - keep its header and the delete button centred
       inside the cell so neither spills over the table edge. */
    .tp-grid-wrap .tp-grid th:last-child, .tp-grid-wrap .tp-grid td:last-child {
        text-align: center;
        padding-left: 2px;
        padding-right: 2px;
    }

        /* The theme gives .btn a border and its own padding, which drew a box around the
           delete icon and pushed it off centre - reset it to a plain centred glyph. */
        .tp-grid-wrap .tp-grid td:last-child .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            padding: 0;
            margin: 0;
            border: 0;
            background: none;
            box-shadow: none;
            line-height: 1;
        }

            .tp-grid-wrap .tp-grid td:last-child .btn i {
                line-height: 1;
                vertical-align: middle;
            }

            .tp-grid-wrap .tp-grid td:last-child .btn:hover,
            .tp-grid-wrap .tp-grid td:last-child .btn:focus {
                color: #dc3545;
                background: none;
                cursor: pointer;
            }

    .tp-grid input.form-control, .tp-grid select.form-control {
        width: 100%;
        min-width: 0;
        padding-left: 8px;
        padding-right: 8px;
    }

/* 7 columns - every transfer type except airport */
.tp-grid th:nth-child(1), .tp-grid td:nth-child(1) { width: 27%; }
.tp-grid th:nth-child(2), .tp-grid td:nth-child(2) { width: 11%; }
.tp-grid th:nth-child(3), .tp-grid td:nth-child(3) { width: 24%; }
.tp-grid th:nth-child(4), .tp-grid td:nth-child(4) { width: 11%; }
.tp-grid th:nth-child(5), .tp-grid td:nth-child(5) { width: 11%; }
.tp-grid th:nth-child(6), .tp-grid td:nth-child(6) { width: 10%; }
.tp-grid th:nth-child(7), .tp-grid td:nth-child(7) { width: 7%; }

/* 8 columns - airport adds the 20 KM retail price */
.tp-airport .tp-grid th:nth-child(1), .tp-airport .tp-grid td:nth-child(1) { width: 23%; }
.tp-airport .tp-grid th:nth-child(2), .tp-airport .tp-grid td:nth-child(2) { width: 10%; }
.tp-airport .tp-grid th:nth-child(3), .tp-airport .tp-grid td:nth-child(3) { width: 10%; }
.tp-airport .tp-grid th:nth-child(4), .tp-airport .tp-grid td:nth-child(4) { width: 20%; }
.tp-airport .tp-grid th:nth-child(5), .tp-airport .tp-grid td:nth-child(5) { width: 10%; }
.tp-airport .tp-grid th:nth-child(6), .tp-airport .tp-grid td:nth-child(6) { width: 10%; }
.tp-airport .tp-grid th:nth-child(7), .tp-airport .tp-grid td:nth-child(7) { width: 10%; }
.tp-airport .tp-grid th:nth-child(8), .tp-airport .tp-grid td:nth-child(8) { width: 7%; }
