/**
 * RAC Bookings Grid Frontend CSS
 *
 * CHANGELOG
 * v0.3.13
 * - Removed fixed per-column widths so every frontend table column sizes to its actual content.

 * v0.3.6
 * - Frontend R/A links now open in a new browser tab.
 * - Status column width now shrinks to the content width instead of staying overly wide.

 * v0.3.0
 * - Reduced table body cell height approximately by half for a denser grid.
 * - Reduced vertical padding and status badge height to match the shorter rows.

 * v0.2.9
 * - Centered the status pills row.
 * - Made the table header sticky on page scroll while keeping horizontal scroll.
 * - Forced no-wrap inside the table cells and headers.

 * v0.2.7
 * - Removed the top Status multi-select from the frontend toolbar; pills remain the only status control.

 * v0.2.6
 * - Table links now inherit text color and remain underline-only.
 * - Status filter styled for centered multi-selection list with requested defaults.
 *
 * v0.2.3
 * - Tighter frontend visual pass with stricter table geometry.
 * - Only the Status column stays colored; all other cells remain white with dark gray text.
 * - Removed hover emphasis and tightened borders/spacing to match the requested board style more closely.
 */

.rbg-frontend {
    margin: 6px 0 18px;
    color: #4b4b4b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.28;
}

.rbg-frontend * {
    box-sizing: border-box;
}

.rbg-shell {
    width: 100%;
}

.rbg-frontend-header {
    margin: 0 0 6px;
    text-align: center;
}

.rbg-frontend-title {
    margin: 0;
    color: #3e8fd4;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .01em;
}

.rbg-toolbar,
.rbg-status-pills,
.rbg-table-wrap,
.rbg-pagination,
.rbg-debug-box,
.rbg-active-filters-row {
    margin-top: 8px;
}

.rbg-toolbar {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

.rbg-filters-form {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.rbg-filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 132px;
}

.rbg-filter-group--search {
    min-width: 230px;
}

.rbg-filter-group--month,
.rbg-filter-group--status {
    min-width: 220px;
}

.rbg-filter-group label {
    color: #3d8ed4;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.rbg-filter-group input,
.rbg-filter-group select {
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid #cfcfcf;
    border-radius: 7px;
    background: #fff;
    color: #666;
    font-size: 12px;
    box-shadow: 0 1px 0 rgba(0,0,0,.04) inset;
}

.rbg-filter-group select[multiple] {
    min-height: 186px;
    padding: 6px 8px;
    overflow-y: auto;
    text-align: left;
}

.rbg-filter-group select[multiple] option {
    padding: 5px 8px;
}

.rbg-filter-group input:focus,
.rbg-filter-group select:focus {
    outline: none;
    border-color: #4e9ae6;
    box-shadow: 0 0 0 2px rgba(78,154,230,.12);
}

.rbg-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rbg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 7px;
    text-decoration: none;
    border: 1px solid #d85b55;
    background: #fff;
    color: #d85b55;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.rbg-btn:hover {
    opacity: .96;
}

.rbg-btn-primary {
    background: #ef5a4d;
    border-color: #ef5a4d;
    color: #fff;
}

.rbg-btn-new-booking {
    min-height: 40px;
    padding: 0 22px;
    border-radius: 12px;
    background: linear-gradient(180deg, #2085f3, #126fd0);
    border-color: #126fd0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(18,111,208,.28);
}

.rbg-summary-compact {
    flex: 0 0 auto;
    min-width: 235px;
    text-align: right;
    padding-top: 2px;
}

.rbg-summary-line {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.rbg-summary-line + .rbg-summary-line {
    margin-top: 2px;
}

.rbg-summary-line--warning {
    color: #f3a12a;
}

.rbg-summary-line--success {
    color: #648e28;
}

.rbg-active-filters-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
}

.rbg-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #777;
    font-size: 12px;
}

.rbg-active-filters__label {
    color: #58a2de;
    font-weight: 700;
}

.rbg-active-filter-item {
    color: #666;
}

.rbg-active-filter-sep {
    color: #888;
    font-weight: 700;
}

.rbg-clear-filters-link {
    color: #d66c78;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border: 1px solid #f1b9c2;
    border-radius: 999px;
    background: #fff;
}

.rbg-clear-filters-link:hover {
    color: #cc5564;
}

.rbg-status-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 7px;
    padding-top: 2px;
}

.rbg-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 29px;
    padding: 0 12px;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 10px;
    background: #fff;
    color: #3f3f3f;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0,0,0,.06) inset;
}

.rbg-status-pill__check {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.22);
    position: relative;
    flex: 0 0 14px;
}

.rbg-status-pill.is-active .rbg-status-pill__check::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid rgba(0,0,0,.64);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.rbg-status-pill__count {
    font-weight: 700;
}

.rbg-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    background: #fff;
    border: 1px solid #bfbfbf;
    border-top: 5px solid #000;
}

.rbg-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.rbg-table th,
.rbg-table td {
    width: auto;
    min-width: 0;
}

.rbg-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #d9d9d9;
    color: #505050;
    text-align: center;
    border: 1px solid #bdbdbd;
    padding: 6px 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
}

.rbg-table thead th a {
    color: inherit;
    text-decoration: none;
}

.rbg-table th,
.rbg-table td {
    border: 1px solid #c7c7c7;
    padding: 3px 6px;
    vertical-align: middle;
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
}

.rbg-table td {
    text-align: center;
    background: #fff;
    color: #4d4d4d;
}

.rbg-table tbody tr,
.rbg-table tbody tr:hover,
.rbg-table tbody tr:nth-child(even) {
    background: transparent !important;
}

.rbg-table tbody tr td:not(.rbg-cell-status) {
    background: #fff !important;
    color: #4d4d4d !important;
}

.rbg-table tbody tr:hover td:not(.rbg-cell-status),
.rbg-table tbody tr:nth-child(even) td:not(.rbg-cell-status) {
    background: #fff !important;
    color: #4d4d4d !important;
}

.rbg-table tbody td {
    height: 27px;
}

.rbg-table td a,
.rbg-table td a:visited,
.rbg-table td a:hover,
.rbg-table td a:focus,
.rbg-table td a:active {
    color: inherit !important;
    text-decoration: underline !important;
    font-weight: 400 !important;
    opacity: 1 !important;
}

.rbg-table .rbg-cell-id,
.rbg-table .rbg-cell-customer,
.rbg-table .rbg-cell-plate {
    text-align: left;
}

.rbg-table .rbg-cell-id strong {
    font-weight: 700;
}

.rbg-table .rbg-cell-status {
    padding: 0 !important;
    width: 1%;
    min-width: 0;
    max-width: none;
}

.rbg-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    min-height: 27px;
    padding: 2px 8px;
    border-radius: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}

.rbg-balance-cell {
    font-weight: 700;
    color: #4c4c4c;
}

.rbg-sort-indicator {
    margin-left: 3px;
    font-size: 10px;
}

/* column widths now follow actual content */


.rbg-status-badge.rbg-status-new,
.rbg-status-pill.rbg-status-new { background: #2f9af2; color: #fff; }
.rbg-status-badge.rbg-status-pen,
.rbg-status-pill.rbg-status-pen { background: #d7b37a; color: #4a3c24; }
.rbg-status-badge.rbg-status-res,
.rbg-status-pill.rbg-status-res { background: #e8a10a; color: #fff; }
.rbg-status-badge.rbg-status-pre-run,
.rbg-status-pill.rbg-status-pre-run { background: #9be03b; color: #214700; }
.rbg-status-badge.rbg-status-alert,
.rbg-status-pill.rbg-status-alert { background: #f3e20a; color: #1f1f1f; }
.rbg-status-badge.rbg-status-run,
.rbg-status-pill.rbg-status-run { background: #0a8905; color: #fff; }
.rbg-status-badge.rbg-status-ret,
.rbg-status-pill.rbg-status-ret { background: #d197e2; color: #47314d; }
.rbg-status-badge.rbg-status-in,
.rbg-status-pill.rbg-status-in { background: #7340cd; color: #fff; }
.rbg-status-badge.rbg-status-wait,
.rbg-status-pill.rbg-status-wait { background: #565656; color: #fff; }
.rbg-status-badge.rbg-status-srv,
.rbg-status-pill.rbg-status-srv { background: #7a7a7a; color: #fff; }
.rbg-status-badge.rbg-status-cxx,
.rbg-status-pill.rbg-status-cxx { background: #ea3a26; color: #fff; }

.rbg-pagination {
    display: flex;
    justify-content: center;
}

.rbg-pagination .page-numbers {
    display: inline-flex;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 5px;
    flex-wrap: wrap;
}

.rbg-pagination .page-numbers li {
    margin: 0;
}

.rbg-pagination .page-numbers a,
.rbg-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
    color: #585858;
    font-size: 12px;
}

.rbg-debug-box {
    background: #fff4f4;
    border: 1px solid #f1b4b4;
    border-radius: 12px;
    padding: 14px 16px;
}

.rbg-frontend-locked {
    padding: 16px;
    border: 1px solid #d9dde3;
    border-radius: 12px;
    background: #fff;
}

@media (max-width: 1200px) {
    .rbg-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .rbg-summary-compact {
        text-align: left;
    }

    .rbg-summary-line {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .rbg-filters-form {
        justify-content: flex-start;
        gap: 12px;
    }

    .rbg-filter-group,
    .rbg-filter-group--search,
    .rbg-filter-group--month,
    .rbg-filter-group--status {
        min-width: 100%;
    }

    .rbg-filter-actions {
        width: 100%;
    }

    .rbg-btn-new-booking {
        width: 100%;
    }

    .rbg-active-filters-row {
        justify-content: flex-start;
    }
}

@media print {
    .rbg-toolbar,
    .rbg-pagination,
    .rbg-status-pills,
    .rbg-active-filters-row {
        display: none !important;
    }

    .rbg-table-wrap {
        overflow: visible;
        border: 0;
        border-top: 3px solid #000;
    }

    .rbg-table {
        min-width: 0;
    }

    .rbg-table thead th {
        position: static;
    }
}
