/* === Modern form card layout for nobordersTable detail/edit pages === */

/* ---- Design tokens ---- */
:root {
    --rl-card-max-width: 860px;
    --rl-card-wide-max-width: 1200px;
    --rl-card-padding: 24px 28px;
    --rl-card-radius: 10px;
    --rl-card-bg: #fff;
    --rl-card-margin: 10px auto;
}

/* ---- Utility classes for card width variants ---- */
.card--wide  { max-width: var(--rl-card-wide-max-width) !important; }
.card--full  { max-width: none !important; width: 100% !important; }

/* Force outer layout tables to expand when they contain a modernFormContainer */
table.mainContainer:has(.modernFormContainer),
table.dsR12:has(.modernFormContainer) {
    width: 100%;
}

/* ---- Common container: groups filter pane + data table + legend at same width ---- */
.modernFormContainer {
    background: var(--rl-card-bg);
    border-radius: var(--rl-card-radius);
    box-shadow: none;
    padding: var(--rl-card-padding);
    margin: var(--rl-card-margin);
    overflow: hidden;
}
/* When nobordersTable is inside a container, strip its own card styling */
.modernFormContainer > table.nobordersTable {
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    max-width: none;
    width: 100%;
    overflow: hidden;
    float: none;
}
/* Keep filter fields compact (left-aligned) even at full container width */
.modernFormContainer > table.nobordersTable > tbody > tr {
    justify-content: flex-start;
}
/* Prevent value cells from stretching to fill wide containers */
.modernFormContainer > table.nobordersTable > tbody > tr > td.tdViewInput,
.modernFormContainer > table.nobordersTable > tbody > tr > td.tdEditInput {
    flex: 0 1 auto;
}
/* Data table inside container: stretch to full container width */
.modernFormContainer > table:not(.nobordersTable) {
    width: 100%;
}
/* formTable (data grids) inside container: stretch to full width */
.modernFormContainer table.formTable {
    width: 100% !important;
    display: table;
}
/* outerscrollable (scrolltable data grids) inside container: stretch to full width */
.modernFormContainer table.outerscrollable {
    width: 100% !important;
    display: table;
}
/* Legend inside container: left-align instead of center */
.modernFormContainer > center {
    text-align: left;
}
/* Legend's inner nobordersTable: reset card styling so it looks like a plain table */
.modernFormContainer > center table.nobordersTable {
    display: table;
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 10px;
    max-width: none;
    overflow: visible;
}
.modernFormContainer > center table.nobordersTable > tbody {
    display: table-row-group;
}
.modernFormContainer > center table.nobordersTable > tbody > tr {
    display: table-row;
}
.modernFormContainer > center table.nobordersTable > tbody > tr > td {
    display: table-cell;
    width: auto !important;
}
.modernFormContainer > center table.nobordersTable > tbody > tr > td.tdLabel {
    text-align: left;
    white-space: normal;
    flex: unset;
}

/* Card container */
table.nobordersTable {
    display: block;
    max-width: var(--rl-card-max-width);
    background: var(--rl-card-bg);
    border-radius: var(--rl-card-radius);
    box-shadow: none;
    padding: var(--rl-card-padding);
    margin: var(--rl-card-margin);
    overflow: visible;
}
table.nobordersTable > tbody {
    display: block;
}

/* Preserve all nested tables */
table.nobordersTable table { display: table; }
table.nobordersTable table tbody { display: table-row-group; }
table.nobordersTable table tr { display: table-row; }
table.nobordersTable table td,
table.nobordersTable table th { display: table-cell; }

/* Default row: flex layout */
table.nobordersTable > tbody > tr {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0 8px;
    padding: 4px 0;
}

/* Override HTML width attributes so flex/grid controls sizing */
table.nobordersTable > tbody > tr > td,
table.nobordersTable > tbody > tr > th {
    width: auto !important;
    box-sizing: border-box;
}

/* ---- Labels ---- */

/* Label cells (no colspan): preferred 140px, shrinkable for rows with many cells */
table.nobordersTable > tbody > tr > td.tdLabel:not([colspan]) {
    flex: 0 1 140px;
    text-align: right;
    padding-right: 10px;
    font-weight: 600;
    font-size: 12.5px;
    color: #444;
    white-space: nowrap;
}

/* Label cells with colspan (button rows, spacers): grow to fill, shrink when sharing row */
table.nobordersTable > tbody > tr > td.tdLabel[colspan] {
    flex: 1 1 auto;
    text-align: left;
    min-width: 0;
}

/* ---- Value cells ---- */

/* Value cells: take remaining space */
table.nobordersTable > tbody > tr > td.tdViewInput,
table.nobordersTable > tbody > tr > td.tdEditInput {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---- Full-width elements ---- */

/* Error messages */
table.nobordersTable > tbody > tr > td.errorMessage {
    flex: 1 0 100%;
}

/* Page headers */
table.nobordersTable > tbody > tr > td.headerPage {
    flex: 1 0 100%;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    padding-bottom: 8px;
}

/* Section headers (th elements) */
table.nobordersTable > tbody > tr > th {
    flex: 1 0 100%;
    text-align: left;
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

/* Button rows */
table.nobordersTable > tbody > tr > td.tdButton {
    flex: 1 0 100%;
}

/* Solo cells (only child in row) are always full-width */
table.nobordersTable > tbody > tr > td:only-child {
    flex: 1 0 100%;
}

/* ---- Nested label styling (inner tables) ---- */

table.nobordersTable td td.tdLabel {
    text-align: right;
    padding-right: 8px;
    white-space: nowrap;
    font-weight: 600;
    font-size: 12.5px;
    color: #444;
}

/* ---- Date picker grouping ---- */
/* Keep date input + calendar icon as a single inline unit */
table.nobordersTable > tbody > tr > td.tdViewInput > .calendarClass,
table.nobordersTable > tbody > tr > td.tdEditInput > .calendarClass {
    flex: 0 0 auto;
}
table.nobordersTable > tbody > tr > td.tdViewInput:has(.calendarClass),
table.nobordersTable > tbody > tr > td.tdEditInput:has(.calendarClass) {
    display: flex;
    align-items: center;
    gap: 4px;
}
table.nobordersTable > tbody > tr > td:has(.calendarClass) > input[type="text"] {
    flex: 1 1 auto;
    min-width: 60px;
    max-width: 140px;
}

/* ---- Shared form controls (all card types) ---- */

/* Text inputs, passwords, and single-selects.
   Use td > to scope to direct-child controls and avoid bleeding into
   OC-rendered MUI inputs that sit deeper in the DOM. */
table.nobordersTable td > input[type="text"],
table.nobordersTable td > input[type="password"],
table.nobordersTable td > select:not([multiple]):not([size]),
table.detailTable input[type="text"],
table.detailTable input[type="password"],
table.detailTable select:not([multiple]):not([size]),
.modernFormContainer input[type="text"],
.modernFormContainer input[type="password"],
.modernFormContainer select:not([multiple]):not([size]) {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12.5px;
    outline: none;
}
table.nobordersTable td > input[type="text"]:focus,
table.nobordersTable td > input[type="password"]:focus,
table.nobordersTable td > select:not([multiple]):not([size]):focus,
table.detailTable input[type="text"]:focus,
table.detailTable input[type="password"]:focus,
table.detailTable select:not([multiple]):not([size]):focus,
.modernFormContainer input[type="text"]:focus,
.modernFormContainer input[type="password"]:focus,
.modernFormContainer select:not([multiple]):not([size]):focus {
    border-color: var(--gl-theme-color-primary-100);
    box-shadow: 0 0 0 2px var(--gl-theme-color-primary-15);
}

/* Checkboxes: size only — color comes from basic_new.css theme */
table.nobordersTable input[type="checkbox"],
table.detailTable input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Buttons: layout only — color comes from basic_new.css .button class */
table.nobordersTable input[type="submit"],
table.nobordersTable input[type="button"],
table.detailTable input[type="submit"],
table.detailTable input[type="button"],
table.detailTable button.button {
    border: none;
    border-radius: 5px;
    padding: 6px 16px;
    font-size: 12.5px;
    cursor: pointer;
}

/* Secondary button — outlined, no fill */
.button-secondary {
    background: transparent !important;
    color: var(--gl-theme-color-primary-100) !important;
    border: 1px solid var(--gl-theme-color-primary-100) !important;
}
.button-secondary:hover {
    background: var(--gl-theme-color-primary-15) !important;
}

/* ---- Scrolltable inside card ---- */
/* Color comes from basic_new.css theme — only add spacing here */

table.nobordersTable .scrolltable thead td,
table.nobordersTable .scrolltable th {
    font-weight: 600;
    font-size: 12px;
    padding: 8px 12px;
}

/* ---- Error message ---- */

table.nobordersTable .errorMessage {
    color: #dc2626;
    font-size: 12px;
}


/* ---- Merge consecutive nobordersTable siblings inside a form ---- */
/* When a form contains multiple nobordersTable elements (e.g. reports.jsp),
   merge them visually into one card by making the form the card wrapper. */
form:has(> table.nobordersTable + br + br + table.nobordersTable),
form:has(> table.nobordersTable + table.nobordersTable) {
    background: var(--rl-card-bg);
    border-radius: var(--rl-card-radius);
    box-shadow: none;
    padding: var(--rl-card-padding);
    margin: var(--rl-card-margin);
    max-width: var(--rl-card-max-width);
    overflow: visible;
}
/* Strip card styling from individual nobordersTable when form is the card */
form:has(> table.nobordersTable + br + br + table.nobordersTable) > table.nobordersTable,
form:has(> table.nobordersTable + table.nobordersTable) > table.nobordersTable {
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    max-width: none;
}
/* Hide the <br><br> spacers between tables inside merged form cards */
form:has(> table.nobordersTable + br + br + table.nobordersTable) > br {
    display: none;
}

/* ---- Dashboard multi-select overflow fix ---- */
/* Constrain multi-select boxes so they don't overflow card boundaries */
table.nobordersTable select[multiple],
table.nobordersTable select[size] {
    max-width: 220px;
    max-height: 120px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12.5px;
}

/* ---- Scrollable data table containers ---- */
/* Data grids (scrolltable divs) inside cards should stretch full width */
table.nobordersTable div[class*="scroll"],
table.nobordersTable div[style*="overflow"] {
    width: 100%;
    max-width: none;
}

/* ---- fieldset inside card ---- */
/* Fieldsets (e.g. Dashboard KPI summary) should have clean styling.
   Exclude MUI's notchedOutline fieldset used by OutlinedInput in OC embeds. */
table.nobordersTable fieldset:not([class*="MuiOutlinedInput"]),
form:has(> table.nobordersTable) fieldset:not([class*="MuiOutlinedInput"]) {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 10px 0;
}

/* ---- Center elements inside cards ---- */
/* Centered elements (like KPI links) should have reasonable spacing */
table.nobordersTable center {
    padding: 4px 0;
}

/* ---- Dashboard: collapse hidden advanced-filter panel ---- */
/* The advFilterSection uses visibility:hidden (preserves space) by default;
   override to display:none so the card doesn't have a huge blank gap. */
#advFilterSection[style*="hidden"] {
    display: none;
}

/* ---- KPI link row: tighten 1000px inner table ---- */
table.nobordersTable center > table[width="1000px"] {
    width: auto !important;
}

/* ==========================================================================
   layout-native — exempt pages from the card/flex system
   Pages like Dashboard and Monitoring use native HTML table layout with
   percentage-based column widths. Adding .layout-native to the <body>
   reverts nobordersTable to its browser-default table rendering so we
   don't need per-form !important overrides.
   ========================================================================== */

.layout-native table.nobordersTable {
    display: table;
    background: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: none;
    border-radius: 0;
}
.layout-native table.nobordersTable > tbody {
    display: table-row-group;
}
.layout-native table.nobordersTable > tbody > tr {
    display: table-row;
    padding: 0;
}
.layout-native table.nobordersTable > tbody > tr > td,
.layout-native table.nobordersTable > tbody > tr > th {
    width: unset; /* let HTML width="50%" etc. work */
}
/* Forms inside layout-native pages: no card wrapper */
.layout-native form:has(> table.nobordersTable + br + br + table.nobordersTable),
.layout-native form:has(> table.nobordersTable + table.nobordersTable) {
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    max-width: none;
}

/* ==========================================================================
   Rate Plan Details / Edit — wider card to fit dual-list and multi-column rows
   (kept as fallback; prefer adding class="card--full" on the JSP element)
   ========================================================================== */

form#rateCodes > table.nobordersTable {
    max-width: none;
    width: 100%;
}

/* ==========================================================================
   LOS Rules filter — widen to match the data table below
   (kept as fallback; prefer adding class="card--full" on the JSP element)
   ========================================================================== */
form[name="losRulesForm"] > table.nobordersTable {
    max-width: 100%;
}

/* ==========================================================================
   detailTable — card styling for edit/config pages
   (e.g. Channel Interface Config, Channel Conversion edit pages)
   ========================================================================== */

table.detailTable {
    max-width: var(--rl-card-max-width);
    background: var(--rl-card-bg);
    border-radius: var(--rl-card-radius);
    box-shadow: none;
    padding: var(--rl-card-padding);
    margin: var(--rl-card-margin);
    border-collapse: separate;
    border-spacing: 0;
}

/* Force outer layout table to stretch when it contains a detailTable */
table.dsR12:has(table.detailTable) {
    width: 100%;
}

/* Section headers (th with hr dividers) — modern styled separator */
table.detailTable th.tdLabel {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    padding: 16px 5px 6px;
    border-bottom: none;
}
table.detailTable th.tdLabel hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 6px 0 0;
}
/* First section header: no extra top padding */
table.detailTable > tbody > tr:first-child > th.tdLabel,
table.detailTable > tbody > tr:nth-child(2) > th.tdLabel {
    padding-top: 0;
}

/* Label cells */
table.detailTable td.tdLabel {
    text-align: right;
    padding-right: 10px;
    font-weight: 600;
    font-size: 12.5px;
    color: #444;
    white-space: nowrap;
    vertical-align: middle;
}

/* Value cells */
table.detailTable td.tdViewInput {
    text-align: left;
    vertical-align: middle;
}

/* Textarea — detailTable specific (only pattern that uses textarea) */
table.detailTable textarea {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    font-size: 12.5px;
    outline: none;
    width: 100%;
    max-width: 400px;
    min-height: 80px;
    resize: vertical;
}
table.detailTable textarea:focus {
    border-color: var(--gl-theme-color-primary-100);
    box-shadow: 0 0 0 2px var(--gl-theme-color-primary-15);
}

/* =====================================================
   Interface Config (Connection Settings) — ifc-* layout
   ===================================================== */

/* Coordinates bar — visually distinct top section */
.ifc-coordinates {
    background: var(--gl-theme-color-primary-5);
    border: 1px solid var(--gl-theme-color-primary-15);
    border-radius: 10px;
    padding: 18px 24px 14px;
    margin: 0 0 16px;
}

.ifc-coord-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px 24px;
    align-items: end;
}

/* Connection toolbar — Add/Remove/Transfer buttons */
.ifc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gl-theme-color-primary-15, #e0e0e0);
}

/* Section card */
.ifc-section {
    background: var(--rl-card-bg);
    border-radius: var(--rl-card-radius);
    box-shadow: none;
    padding: var(--rl-card-padding);
    margin: 0 0 16px;
}

.ifc-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gl-theme-color-primary-100, #333);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gl-theme-color-primary-15, #e0e0e0);
}

/* Form grid — 2-column responsive layout */
.ifc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px 24px;
    align-items: start;
}

/* Header row inside form grid — Interface Name + Enabled always on their own line */
.ifc-form-grid-header {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px 24px;
}

/* Individual field */
.ifc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ifc-field--wide {
    display: flex;
    flex-direction: column;
    gap: 4px;
    grid-column: 1 / -1;
}

.ifc-field--check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.ifc-field--check .ifc-label {
    margin-bottom: 0;
    font-weight: 500;
}

/* Label */
.ifc-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 2px;
}

/* Inputs inside ifc-field inherit styling */
.ifc-field input[type="text"],
.ifc-field input[type="password"],
.ifc-field select,
.ifc-field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Action buttons footer */
.ifc-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0 8px;
    margin-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.ifc-actions-secondary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ifc-actions-primary {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* Status messages */
.ifc-status-msg {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 10px 16px;
    margin: 8px 0;
    font-size: 13px;
    color: #166534;
}

/* Errors / messages */
.ifc-errors:empty,
.ifc-messages:empty {
    display: none;
}

.ifc-errors {
    color: #dc2626;
    margin-bottom: 8px;
}

.ifc-messages {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #1e40af;
}

/* =====================================================
   Shared modal styles
   (consolidated from channelsSetup, distributionNotification,
    editChannelInterfaceConfig JSPs)
   ===================================================== */

.rl-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.rl-modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.rl-modal-content .warning-text {
    color: #cc0000;
    margin-bottom: 15px;
}

.rl-modal-content .modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

/* Generic close button for modals */
.rl-modal-content .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.rl-modal-content .close:hover {
    color: #000;
}

/* =====================================================
   Page-specific styles (migrated from inline <style> blocks)
   ===================================================== */

/* ---- rateAccessCodeDetails ---- */
.page-rateAccessDetails table.dsR12 {
    float: none;           /* override HTML align="left" which generates float:left */
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.page-rateAccessDetails table.nobordersTable > tbody > tr {
    display: grid;
    grid-template-columns: 140px 1fr 140px 1fr;
    gap: 0 8px;
    padding: 4px 0;
}

/* Full-width rows (section headers, buttons, messages) */
.page-rateAccessDetails table.nobordersTable > tbody > tr.row-full {
    grid-template-columns: 1fr;
}
.page-rateAccessDetails table.nobordersTable > tbody > tr.row-full > td {
    grid-column: 1 / -1;
}

/* Two-cell rows (label + wide value) */
.page-rateAccessDetails table.nobordersTable > tbody > tr.row-wide {
    grid-template-columns: 140px 1fr;
}

/* Input sizing */
.page-rateAccessDetails .selectMedium {
    width: 220px;
}
.page-rateAccessDetails .inputMedium {
    width: 220px;
}

/* Cancel button as secondary */
.page-rateAccessDetails input[value="Cancel"] {
    background: transparent;
    color: var(--gl-theme-color-primary-100);
    border: 1px solid var(--gl-theme-color-primary-100);
}
.page-rateAccessDetails input[value="Cancel"]:hover {
    background: var(--gl-theme-color-primary-15);
}

/* ---- bwFXLevels ---- */
.page-bwFXLevels input[type='text'].inputSmall2 {
    font-size: 11px;
}

/* ---- hotelManagement ---- */
.page-hotelManagement .warning-cell {
    color: #cc0000;
    font-weight: bold;
}
.page-hotelManagement [title] {
    cursor: help;
}

/* ---- companyRatesListing ---- */
.page-companyRates .companyRatesTable {
    border: 0;
    width: 100%;
}
.page-companyRates .companyRatesTable td {
    border-bottom: 1px dotted #DDE3ED;
    padding: 4px;
}
.page-companyRates .companyRatesTable td.head_color {
    border-bottom: 1px dotted #DDE3ED;
}

/* ---- copyRateCategory ---- */
.page-copyRateCategory .errMessage {
    display: none;
    color: #ff0000;
}

/* ---- roomConfigurationDetails ---- */
.page-roomConfig .overwriteClassicStyle {
    margin: 0;
    padding: 0;
}

/* ---- logDetailsMessagesError ---- */
.page-logError body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}
.page-logError hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}
.page-logError div {
    margin-bottom: 10px;
}

/* ---- unacknowledgeFilter ---- */
.page-unacknowledge .longSelect {
    min-width: 250px;
}
.page-unacknowledge .longTableRow td:first-child {
    min-width: 180px;
}

/* ---- ratepriceoverview (open-component embed) ---- */
.page-ratePriceOverview .form-table {
    width: 100%;
    border-collapse: collapse;
}
.page-ratePriceOverview #oc-content {
    margin-top: 10px;
}
.page-ratePriceOverview .oc-wrapper {
    width: 100%;
}

/* ---- dashboard ---- */
.page-dashboard .rowsToHide {
    display: none;
}
.page-dashboard .datesReadOnly input[type='text'] {
    border: none;
    background: transparent;
}

/* ---- logOverview (monitoring) ---- */
.page-logOverview #mholder {
    position: relative;
}
.page-logOverview .messageHeight {
    max-height: 30px;
    overflow: hidden;
}
.page-logOverview #uholder {
    margin-top: 10px;
}

/* ==========================================================================
   page-content-centered — constrain full-width pages to a max width and
   center them horizontally. Applied via body class on pages that currently
   stretch across the full viewport width.
   ========================================================================== */
.page-content-centered table.dsR12,
.page-content-centered table.mainContainer {
    float: none;           /* override HTML align="left" which generates float:left */
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}
/* Inside centered pages the nobordersTable filter card should NOT be
   restricted to 860px — it must match the width of sibling sections
   (data tables, pagination bar, etc.) so everything lines up. */
.page-content-centered table.nobordersTable {
    max-width: none;
}
/* Data tables (formTable) inside centered pages should stretch to fill
   the available width instead of shrinking to content width. */
.page-content-centered table.formTable {
    width: 100%;
    border: none;              /* remove legacy dotted border from basic1.css */
    border-collapse: collapse;
}

/* ==========================================================================
   Room Blocks — stacked layout with centered content. Both dsR12 tables
   stack vertically; page-content-centered handles float:none + centering.
   ========================================================================== */

/* ==========================================================================
   Rooms Per Day / Rates Per Day — align filter card with data tables
   These pages use outerscrollable tables with inline margin-left:0 and
   fixed pixel widths. The filter card (nobordersTable) must stretch to
   match instead of being constrained to 860 px.
   ========================================================================== */
.page-roomPerDay table.dsR12:first-of-type,
.page-ratesPerDay table.dsR12:first-of-type {
    float: none;           /* override HTML align="left" */
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}
.page-roomPerDay > table.dsR12:first-of-type {
    table-layout: fixed;
    width: 100% !important;
    max-width: 100vw;
}
.page-roomPerDay > table.dsR12:first-of-type > tbody > tr > td {
    overflow: hidden;
}
.page-roomPerDay > table.dsR12:first-of-type table.nobordersTable {
    display: table;
    width: fit-content !important;
    max-width: fit-content !important;
}
.page-roomPerDay > table.dsR12:first-of-type table.nobordersTable > tbody {
    display: table-row-group;
}
.page-roomPerDay > table.dsR12:first-of-type table.nobordersTable > tbody > tr {
    display: table-row;
    padding: 0;
}
.page-roomPerDay > table.dsR12:first-of-type table.nobordersTable > tbody > tr > td {
    display: table-cell;
    width: auto !important;
}
.page-ratesPerDay table.nobordersTable {
    max-width: none;       /* match width of sibling data tables */
}
.page-roomPerDay table.outerscrollable,
.page-ratesPerDay table.outerscrollable {
    /* inline style="margin-left:0" on the JSP needs !important to override */
    margin-left: 0 !important;
    margin-right: auto;
    /* override HTML width="1000px" attribute so the table stretches to container */
    width: 100% !important;
}
/* Key legend: center horizontally within the page and give it a white background */
.page-roomPerDay table[style*="width: 1000px"]:not(.outerscrollable):not(.nobordersTable):not(.dsR12),
.page-roomPerDay table[style*="width:1000px"]:not(.outerscrollable):not(.nobordersTable):not(.dsR12),
.page-ratesPerDay table[style*="width: 1000px"]:not(.outerscrollable):not(.nobordersTable):not(.dsR12),
.page-ratesPerDay table[style*="width:1000px"]:not(.outerscrollable):not(.nobordersTable):not(.dsR12) {
    margin-left: auto !important;
    margin-right: auto !important;
    background: #fff;
}
/* Key legend inner nobordersTable: reset card/flex styling to plain table layout */
.page-roomPerDay table[style*="width: 1000px"] table.nobordersTable,
.page-roomPerDay table[style*="width:1000px"] table.nobordersTable,
.page-ratesPerDay table[style*="width: 1000px"] table.nobordersTable,
.page-ratesPerDay table[style*="width:1000px"] table.nobordersTable {
    display: table;
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 10px;
    max-width: none;
    overflow: visible;
}
.page-roomPerDay table[style*="width: 1000px"] table.nobordersTable > tbody,
.page-roomPerDay table[style*="width:1000px"] table.nobordersTable > tbody,
.page-ratesPerDay table[style*="width: 1000px"] table.nobordersTable > tbody,
.page-ratesPerDay table[style*="width:1000px"] table.nobordersTable > tbody {
    display: table-row-group;
}
.page-roomPerDay table[style*="width: 1000px"] table.nobordersTable > tbody > tr,
.page-roomPerDay table[style*="width:1000px"] table.nobordersTable > tbody > tr,
.page-ratesPerDay table[style*="width: 1000px"] table.nobordersTable > tbody > tr,
.page-ratesPerDay table[style*="width:1000px"] table.nobordersTable > tbody > tr {
    display: table-row;
    padding: 0;
}
.page-roomPerDay table[style*="width: 1000px"] table.nobordersTable > tbody > tr > td,
.page-roomPerDay table[style*="width:1000px"] table.nobordersTable > tbody > tr > td,
.page-ratesPerDay table[style*="width: 1000px"] table.nobordersTable > tbody > tr > td,
.page-ratesPerDay table[style*="width:1000px"] table.nobordersTable > tbody > tr > td {
    display: table-cell;
    width: auto !important;
}
.page-roomPerDay table[style*="width: 1000px"] table.nobordersTable > tbody > tr > td.tdLabel,
.page-roomPerDay table[style*="width:1000px"] table.nobordersTable > tbody > tr > td.tdLabel,
.page-ratesPerDay table[style*="width: 1000px"] table.nobordersTable > tbody > tr > td.tdLabel,
.page-ratesPerDay table[style*="width:1000px"] table.nobordersTable > tbody > tr > td.tdLabel {
    text-align: left;
    white-space: normal;
    flex: unset;
}

/* ==========================================================================
   Room Block Per Day — centered page layout matching Room Per Day.
   The filter card stays compact; the data table can use full width.
   ========================================================================== */
.page-roomBlockPerDay table.dsR12:first-of-type {
    float: none;
    display: block;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}
/* Make intermediate table structure block-level so the 1400px width
   constraint propagates down to the form and scroll wrapper. */
.page-roomBlockPerDay table.dsR12:first-of-type > tbody,
.page-roomBlockPerDay table.dsR12:first-of-type > tbody > tr,
.page-roomBlockPerDay table.dsR12:first-of-type > tbody > tr > td,
.page-roomBlockPerDay table.dsR12:first-of-type > tbody > tr > td > table,
.page-roomBlockPerDay table.dsR12:first-of-type > tbody > tr > td > table > tbody,
.page-roomBlockPerDay table.dsR12:first-of-type > tbody > tr > td > table > tbody > tr,
.page-roomBlockPerDay table.dsR12:first-of-type > tbody > tr > td > table > tbody > tr > td {
    display: block;
}
/* The form is the single card container — header info, data grid, and
   Cancel button all live inside one white card. */
.page-roomBlockPerDay form[name="roomBlocksForm"] {
    background: var(--rl-card-bg);
    border-radius: var(--rl-card-radius);
    padding: var(--rl-card-padding);
    margin: var(--rl-card-margin);
}
/* Remove individual card styling from nobordersTable children since the
   form is now the card wrapper. */
.page-roomBlockPerDay table.nobordersTable {
    display: table;
    max-width: none;
    background: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
}
.page-roomBlockPerDay table.nobordersTable > tbody {
    display: table-row-group;
}
.page-roomBlockPerDay table.nobordersTable > tbody > tr {
    display: table-row;
    padding: 0;
}
.page-roomBlockPerDay table.nobordersTable > tbody > tr > td,
.page-roomBlockPerDay table.nobordersTable > tbody > tr > th {
    display: table-cell;
    width: unset;
    vertical-align: middle;
    padding: 4px 8px;
}
.page-roomBlockPerDay table.nobordersTable > tbody > tr > td.tdLabel {
    text-align: right;
    font-weight: 600;
    font-size: 12.5px;
    color: #444;
    white-space: nowrap;
}
/* Selling Mode dropdown needs room for "Block values + Freesale" */
.page-content-centered form[name="roomBlocksByChannelForm"] select.selectMedium {
    width: 200px;
}
/* Nights dropdown needs room for two-digit values */
.page-roomBlockPerDay select.inputSmall2 {
    width: 60px;
}
/* Let the scroll area stretch to the full card width and fit its content height */
.page-roomBlockPerDay .rpd-scroll-wrapper {
    max-width: 100%;
    border: none;
}
.page-roomBlockPerDay .smallScrollArea {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
}
.page-roomBlockPerDay .scrollInnerArea {
    width: 100% !important;
    height: auto !important;
}

/* ==========================================================================
   Rooms Per Day — pure CSS scrollable grid with sticky header + columns.
   Replaces the old JavaScript CreateScrollHeader / ResizeScrollArea approach.
   ========================================================================== */
.rpd-scroll-wrapper {
    overflow: auto;
    max-width: calc(100vw - 40px);
    border: 1px solid #E3E5E9;
}
.rpd-table {
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
    background: #fff;
}
.rpd-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}
.rpd-table thead th.rpd-sticky-col {
    z-index: 3;
}
.rpd-sticky-col {
    position: sticky;
    background: #fff;
}
/* Sticky header cells need an explicit background so content below
   does not show through when scrolling.  Colour comes from the
   v1/v2 theme variable set in basic_new.css. */
.rpd-table .headerTable,
.rpd-table th.scrolltable_head,
.rpd-table td.scrolltable_head,
.rpd-table tr.scrolltable_head th {
    background: var(--gl-theme-color-primary-100);
    color: white;
}
.rpd-sticky-col1 {
    left: 0;
    min-width: 110px;
    max-width: 110px;
    z-index: 1;
    padding-left: 6px;
}
.rpd-sticky-col2 {
    left: 110px;
    min-width: 110px;
    max-width: 110px;
    z-index: 1;
}
/* Channel name row: spans both sticky columns, bold and prominent */
.rpd-channel-name {
    font-weight: bold;
    font-size: 12px;
    color: var(--gl-theme-color-primary-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    padding-left: 6px;
    min-width: 220px;
    max-width: 220px;
    background: #fff;
}
/* Room type code cells: opaque background for sticky scroll */
.rpd-roomtype-cell {
    background: #fff;
}
.rpd-day-col {
    min-width: 110px;
}
.rpd-action-input-col {
    min-width: 50px;
}
.rpd-action-btn-col {
    min-width: 110px;
}
/* Rates Per Day sticky columns (4 left columns: channel, rate code, room type, guests) */
.rpd-rates-col1 {
    left: 0;
    min-width: 120px;
    max-width: 120px;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rpd-rates-col2 {
    left: 120px;
    min-width: 120px;
    max-width: 120px;
    z-index: 1;
}
.rpd-rates-col3 {
    left: 240px;
    min-width: 110px;
    max-width: 110px;
    z-index: 1;
}
.rpd-rates-col4 {
    left: 350px;
    min-width: 60px;
    max-width: 60px;
    z-index: 1;
}
/* Rate Ceiling Per Day sticky first column */
.rpd-ceiling-col1 {
    left: 0;
    min-width: 110px;
    max-width: 110px;
    z-index: 1;
}
.rpd-ceiling-col-end {
    min-width: 80px;
}
/* Block Per Day / Room Block Per Day sticky columns */
.rpd-block-col1 {
    left: 0;
    min-width: 110px;
    max-width: 110px;
    z-index: 1;
}
.rpd-block-col2 {
    left: 110px;
    min-width: 110px;
    max-width: 110px;
    z-index: 1;
}
/* Weekend header cells */
.rpd-table th.scrolltable_head_weekend,
.rpd-table td.scrolltable_head_weekend {
    background: var(--gl-theme-color-primary-100);
    color: white;
}

/* ==========================================================================
   LOS Rules — the data table should grow with its content up to a max
   height instead of always being a fixed 382px tall.
   ========================================================================== */
.page-losRules .modernFormContainer table.outerscrollable div[style*="height: 382px"],
.page-losRules .modernFormContainer table.outerscrollable div[style*="height: 352px"] {
    height: auto !important;
    max-height: 500px;
}
.page-losRules .modernFormContainer table.outerscrollable tbody[style*="height: 352px"] {
    height: auto !important;
}
.page-losRules .modernFormContainer table.outerscrollable tbody div[style*="height: 352px"] {
    height: auto !important;
    max-height: 450px;
}

/* ==========================================================================
   Conversion Selector — Property & Connection filters inline (side-by-side)
   ========================================================================== */
/* When inside a modernFormContainer the conversionSelectorFilters table should
   use classic table layout so the four cells (Property label, Property select,
   Connection label, Connection select) sit on one row naturally. */
.modernFormContainer > table.conversionSelectorFilters {
    display: table;
    width: auto;
}
.modernFormContainer > table.conversionSelectorFilters > tbody {
    display: table-row-group;
}
.modernFormContainer > table.conversionSelectorFilters > tbody > tr {
    display: table-row;
    padding: 0;
}
.modernFormContainer > table.conversionSelectorFilters > tbody > tr > td {
    display: table-cell;
    width: auto !important;
    padding: 6px 8px;
    white-space: nowrap;
}
.modernFormContainer > table.conversionSelectorFilters > tbody > tr > td.tdLabel {
    text-align: right;
    font-weight: 600;
    font-size: 12.5px;
    color: #444;
}
.modernFormContainer > table.conversionSelectorFilters select.selectMedium {
    width: 280px;
}

/* ==========================================================================
   Restriction Grid / page-content-centered — widen the smallScrollArea and
   scrollInnerArea that are hardcoded to 1020px/1000px in basic1.css so the
   data table stretches to the container width.
   ========================================================================== */
.page-content-centered .smallScrollArea {
    width: 100% !important;
    max-width: none !important;
}
.page-content-centered .scrollInnerArea {
    width: 100% !important;
}

/* ==========================================================================
   Key Performance Reports — remove fixed heights, widths and floats from
   the outerscrollable data tables so they size naturally to their content.
   The scrollTable1.css rules set calc(100vh - 280px/310px) !important on
   overflow divs; we need matching specificity + body scope to override.
   ========================================================================== */
.page-content-centered table.outerscrollable[style*="width: 67%"] {
    width: 100% !important;
    float: none !important;
}
/* Override scrollTable1.css calc(100vh - 280px) on outer overflow div */
.page-content-centered table.outerscrollable > tbody > tr > td > div[style*="overflow"] {
    height: auto !important;
}
/* Override scrollTable1.css calc(100vh - 310px) on inner overflow div */
.page-content-centered table.outerscrollable > tbody > tr > td > div[style*="overflow"] table.scrolltable > tbody > tr > td > div[style*="overflow"] {
    height: auto !important;
}
.page-content-centered table.outerscrollable tbody[style*="height:180px"] {
    height: auto !important;
}

/* ==========================================================================
   OC (OpenComponent) embeds — remove inset shadow from MUI inputs
   The Guestline CDN theme sets --surface-inner-shadow-small which MUI
   picks up as a box-shadow on input bases. Override it so inputs inside
   OC components render without the unwanted inner shadow.
   ========================================================================== */
[class*="oc-"] [class*="MuiInputBase-root"] {
    box-shadow: none !important;
}
[class*="oc-"] [class*="MuiOutlinedInput-root"] {
    box-shadow: none !important;
}

/* ==========================================================================
   Rate Plan Price Details — pricing grid uses classic table layout inside
   the modernFormContainer so Adults/Children/InfantBeds columns align.
   The scrollable data table stretches to the full container width.
   ========================================================================== */
.page-ratePlanPriceDetails .modernFormContainer > table.nobordersTable {
    display: table;
}
.page-ratePlanPriceDetails .modernFormContainer > table.nobordersTable > tbody {
    display: table-row-group;
}
.page-ratePlanPriceDetails .modernFormContainer > table.nobordersTable > tbody > tr {
    display: table-row;
}
.page-ratePlanPriceDetails .modernFormContainer > table.nobordersTable > tbody > tr > td {
    display: table-cell;
    padding: 4px 3px;
}
.page-ratePlanPriceDetails .modernFormContainer > table.nobordersTable > tbody > tr > td.tdLabel {
    text-align: left;
    width: 15% !important;
}
.page-ratePlanPriceDetails .modernFormContainer table.outerscrollable div[style*="max-height"] {
    width: 100% !important;
}
