/* RoomRequests.css -- Front Office cross-department guest room requests (TLP-050).
   Sub-tab nav uses SegmentedControl; rows reuse ExpandablePanel +
   ExpandableRowHeader; detail rows reuse DetailRow. Only the page wrapper,
   sub-tab spacing, and the expanded-detail grid live here. All values from
   design tokens -- no hardcoded colours, spacing, or radii. */

.room-requests-module {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    flex: 1;          /* fill the tab content slot (flex column) -- full-height board */
    min-height: 0;
}

/* Scroll region below the sub-tab bar. The board's columns fill it; the list
   tabs scroll within it. */
.room-requests-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Sub-tab bar: SegmentedControl (left) + Create Task action (right), mirroring
   the Inbox's sub-tab bar placement. */
.room-requests-sub-tab-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.room-requests-sub-tabs {
    display: flex;
    min-width: 0;
}

.room-requests-sub-tab-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

/* Expanded request detail -- 2-col identity grid, mirrors the Inbox detail. */
.room-requests-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.room-requests-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2) var(--space-4);
}

.room-requests-detail-cell {
    min-width: 0;
}

.room-requests-detail-cell-full {
    grid-column: 1 / -1;
}

/* "Request Details" block -- separated from identity with a subtle top rule. */
.room-requests-detail-section {
    padding-top: var(--space-3);
    border-top: var(--border-width-1) solid var(--border-subtle);
}


@media (max-width: 768px) {
    .room-requests-detail-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Late Checkout day-board (columns = days). Layout mirrors the
   BookingColumns organism, minus the slot capacity bar.
   ============================================================ */

.room-requests-daycols {
    display: flex;
    gap: var(--space-2);
    flex: 1;            /* fill the content region -- full-height columns */
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.room-requests-daycol {
    flex: 1 0 180px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    background: var(--bg-layer-3);
    border: var(--border-width-1) solid var(--border-default);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.room-requests-daycol-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-layer-3);
    border-bottom: var(--border-width-1) solid var(--border-default);
}

.room-requests-daycol-date {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.room-requests-daycol-count {
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
}

/* "+" sits at the right edge of the column header (mirrors .bkcol-title-row). */
.room-requests-daycol-header .btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* TLP-1095: the Pending approval column is the board's fixed first column -- not a
   day, and never squeezed by the day columns beside it. Its groups are headed with
   the Availability strip's day header (.as-day-*), so there is one kind of date
   heading on the platform, not two.

   320px, not the 220px it opened at. The day columns beside it are flex: 1 0 180px --
   180 is their FLOOR and they grow into whatever is left, so they measured 181px at
   1280, 213px at 1440 and 309px at 1920. This column grows with nothing: it was 220px
   on every screen, which made the busiest part of the board -- everything waiting and
   everything refused -- the narrowest thing on it at the very widths where there was
   most room to spare. The fixed basis is what stops the day columns squeezing it, and
   a larger fixed basis does that job exactly as well. At 1440 the day columns absorb
   the extra and still land clear of their floor; below about 1350 the board scrolled
   horizontally, which is what overflow-x on .room-requests-daycols is already for.
   TLP-1473: the board now draws three days, not five -- about 325px a day at 1440 and
   270px at 1280, where it fits without scrolling. */
.room-requests-pendingcol {
    flex: 0 0 320px;
    min-width: 320px;
    background: var(--bg-layer-2);
}

.room-requests-pending-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}


.room-requests-daycol-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2);
}

.room-requests-daycol-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-xs);
    padding: var(--space-4) var(--space-2);
}

.room-requests-lc-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-2);
    background: var(--bg-layer-2);
    /* Firmer edge + hover lift (KanbanBoard precedent) so day-board cards stand
       out from their column without resting shadows cluttering a dense board. */
    border: var(--border-width-1) solid var(--border-default);
    border-radius: var(--border-radius-md);
    transition: box-shadow var(--duration-150) var(--easing-out);
}

.room-requests-lc-card:hover {
    box-shadow: var(--shadow-sm);
}

/* A day column is 180px wide and this row carries up to four badges (the Guest app
   origin, the work progress, and the Alternative + Approved verdict pair). Badges
   keep their own width and wrap onto a second line rather than being squeezed over
   the room number; the room number takes what is left. */
.room-requests-lc-card-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
}

.room-requests-lc-card-top > .badge,
.room-requests-lc-verdict {
    flex: 0 0 auto;
    max-width: 100%;
}

/* TLP-1104: the verdict travels as ONE item. A grant on other terms wears two pills
   -- Alternative then Approved -- and they are a single statement, so a wrap that
   left "Alternative" at the end of one line and "Approved" at the start of the next
   would read as two decisions on one card. */
.room-requests-lc-verdict {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.room-requests-lc-room {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

/* Edit/Delete action SVGs -- card footer row, right-aligned. */
.room-requests-lc-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* TLP-1459: the guest's surname, a dot, then the time asked for. The surname wears the
   room-change card's guest ink (.room-requests-rc-cardguest) and is the half that gives
   way: a long name truncates before "until 17:00" ever does, because the time is the ask. */
.room-requests-lc-card-meta {
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
    min-width: 0;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.room-requests-lc-cardguest {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.room-requests-lc-cardtime {
    flex: 0 0 auto;
}

/* TLP-1104: what an alternative grant changed, on the card. One pair per line in the
   SAME from->to idiom as the move card above -- muted ask, muted arrow, emphasised
   given -- because a 180px day column cannot hold the panel's fuller phrasing and a
   label/value pair that wraps mid-value reads as two unrelated things. No new colour:
   the same two text tokens the from->to already uses. */

.room-requests-alt {
    padding-top: var(--space-1);
    border-top: var(--border-width-1) solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.room-requests-alt-pair {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--space-1);
    font-size: var(--text-xs);
}

.room-requests-alt-asked,
.room-requests-alt-arrow {
    color: var(--text-muted);
}

.room-requests-alt-given {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    font-variant-numeric: tabular-nums;
}

/* ---- Request Late Checkout modal (two-column: form + helper panel) ----
   The right rail uses the Modal organism's .modal-body-helper chrome and the
   shared repairs-helper-* / DetailRow / state molecules -- no bespoke panel CSS. */

.room-requests-lc-modal {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Room number input + "Look up guest" button on one full-width row (mirrors
   .ra-mode-row): the room field grows to fill, the button stays fixed right. */
.room-requests-lc-room-row {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
}

.room-requests-lc-room-row > :first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.room-requests-lc-room-row input {
    width: 100%;
}

.room-requests-lc-room-row .btn {
    flex-shrink: 0;
}

.room-requests-lc-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* Contain the guest-lookup states WITHIN the helper rail so swapping them
   (prompt -> looking up -> guest summary + charge) never resizes the modal. The
   rail's content is pinned to fill it and scrolls internally if needed, so the
   modal height is driven by the form column (+ the modal's base min-height),
   never by the helper. Desktop only -- on mobile the columns stack and flow. */
@media (min-width: 769px) {
    #late-checkout-modal .modal-body-helper,
    #room-change-modal .modal-body-helper {
        position: relative;
        overflow: hidden;
    }
    #late-checkout-modal .modal-body-helper > *,
    #room-change-modal .modal-body-helper > * {
        position: absolute;
        top: var(--space-3);
        right: var(--space-3);
        bottom: var(--space-3);
        left: var(--space-3);
        overflow-y: auto;
    }
}

/* ---- Room Change board (two-axis: submission day -> approved move day) ----
   Reuses the day-column + card layout above; only a few extras are bespoke. */

/* Row 2 -- the room types, as their codes (TLP-1473; the names it carried made it the
   longest thing on the card). It still WRAPS at the arrow rather than demanding a
   width. Same compact from-to shape as the late-checkout card's alternative lines
   (.room-requests-alt-pair) -- one way of saying "this became that". */
.room-requests-rc-typerow {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 var(--space-1);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
.room-requests-rc-type {
    flex: 0 1 auto;
    min-width: 0;
}
.room-requests-rc-type-arrow {
    color: var(--text-muted);
}
/* The Opera code -- what the desk types -- carries the weight. */
.room-requests-rc-typecode {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

/* Row 3 -- who is being moved, and why. The surname and the pax pills are ONE item
   (.room-requests-rc-party): a wrap that left the name on one line and its occupancy
   on the next would read as two guests. The reason is the separate fact, so the
   reason is what gives way when the column runs out. */
.room-requests-rc-partyrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
}
.room-requests-rc-party {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    flex: 0 1 auto;
    min-width: 0;
}
.room-requests-rc-pax {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    flex: 0 0 auto;
}
.room-requests-rc-reason {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
}

/* TLP-1473: when the move happens, after the surname -- the late-checkout card's
   "surname, dot, time" reading (.room-requests-lc-card-meta), in the same muted ink.
   The time never gives way; the surname beside it is the half that truncates. */
.room-requests-rc-dot,
.room-requests-rc-cardtime {
    flex: 0 0 auto;
    color: var(--text-muted);
}
.room-requests-rc-cardtime {
    white-space: nowrap;
}

/* TLP-582: the single move-day card. A dashed edge marks it as the fulfilment card;
   clicking opens the checklist modal. */
.room-requests-rc-movecard {
    border-style: dashed;
    cursor: pointer;
}

/* A completed room change stays on the board, marked done (solid success edge). */
.room-requests-rc-complete {
    border-style: solid;
    border-color: var(--color-success);
    background: var(--color-success-light);
}

/* Guest name beside the room on the room-change card top row: lighter + smaller,
   truncates before the status badge (which stays pinned right). The room keeps its
   natural width; only the guest shrinks. */
.room-requests-rc-card .room-requests-lc-room {
    flex: 0 0 auto;
}
.room-requests-rc-cardguest {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
/* No leading separator any more: the surname used to trail the room number on the top
   row, where a dot divided them. It now OPENS its own row, and a row that starts with
   a stray dot reads as a bullet list of one. */
.room-requests-rc-card .room-requests-lc-card-top > :last-child {
    margin-left: auto;
}

/* TLP-582: the move card states the physical move as from-room -> to-room. The
   room numbers lead (operational); the type labels sit beneath as context. */
.room-requests-rc-fromto {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    flex: 0 0 auto;
}
.room-requests-rc-fromto-room {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.room-requests-rc-fromto-arrow {
    color: var(--text-muted);
}
.room-requests-rc-fromto-tbd {
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
    font-style: italic;
}

/* The read-only fulfilment checklist mirrored onto the move card -- tighter than the
   modal list, divided from the header by a hairline. Each step is a compact
   tick/clock + title that truncates to the narrow day column (the full who/when
   detail stays in the fulfilment modal). */
.room-requests-cardsteps {
    gap: var(--space-1);
    padding-top: var(--space-1);
    border-top: var(--border-width-1) solid var(--border-subtle);
}
.room-requests-cardstep {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
.room-requests-cardstep.is-done {
    color: var(--text-primary);
}
.room-requests-cardstep-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Move-day fulfilment modal (4-step checklist + payment) ---- */

.room-requests-fulfil {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.room-requests-fulfil-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* TLP-583: the fulfilment checklist is a free-tick checkbox list. Each step is a
   Checkbox atom (done = checked+disabled). For a done step the captured note + who/when
   sit on a muted second line, indented under the checkbox label. */
.room-requests-fulfil-step {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.room-requests-fulfil-step-detail {
    margin-left: var(--space-6);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.room-requests-fulfil-pay {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-top: var(--space-2);
    border-top: var(--border-width-1) solid var(--border-subtle);
}

/* TLP-1195: the Team note -- the box, then who saved it last beside its Save. */
.room-requests-fulfil-note {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.room-requests-fulfil-note-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.room-requests-fulfil-note-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* TLP-1459: the team note ON the card -- three lines, then an ellipsis, the Logbook fold
   (TLP-601, Logbook.css); Manage holds the whole note. It replaced a marker in the action
   row whose tooltip carried the text (TLP-1195): a tablet never shows a tooltip, and the
   action row is hidden from a read-only desk, so they never learned a note existed. The
   bubble leads the row as its label -- the glyph the desk already reads as "team note" --
   top-aligned so it sits on the first line of a tall note, never floating mid-block. */
.room-requests-cardnote {
    display: flex;
    align-items: flex-start;
    gap: var(--space-1);
    padding-top: var(--space-1);
    border-top: var(--border-width-1) solid var(--border-subtle);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.room-requests-cardnote-text {
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

/* Late Checkout charge block in the modal helper rail: the selected-time charge
   (blue box), or the manual room-type picker fallback. */
.room-requests-lc-price {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.room-requests-lc-price-note {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* Payment-capture row: Paid + Amount + How as standard FormFields. Paid is
   auto-width; amount + method share the rest. Bottoms align with the inputs. */
.room-requests-lc-pay {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: var(--space-3);
    align-items: end;
}

/* Card footer: payment status (Paid/Unpaid) bottom-left on the late-checkout card;
   the indicative charge and the edit/delete actions on the room-change card. */
.room-requests-lc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

/* The late-checkout card's ONE action row, in the modal footer's order: the
   dangerous action (cancel by guest) alone on the left, a spacer, then Manage, edit
   and delete closing it on the right. The card itself is not a click target, so
   everything that can be done to it is a named control in here. */
.room-requests-lc-card-actionbar {
    display: flex;
    align-items: center;
    /* The tightest gap on the card: four controls have to sit in a 180px column at its
       narrowest. Manage is a 40px icon pill (TLP-1459) -- with its word the row was
       196px against a 1440 screen's 195px column and folded on every card. The
       pencil/bin pair keeps the usual space-2 between them, inside
       .room-requests-lc-card-actions. */
    gap: var(--space-1);
    /* The room-change card puts what is owed in this row, which is a fifth item and the
       only one whose width is content ("Unpaid - EUR 300"). At 181px that cannot share
       a line with Manage and the icons, so the row folds -- the badge riding up with
       the cancel glyph and the levers keeping the line below. Nothing is ever squeezed
       or truncated; it wraps or it does not need to. */
    flex-wrap: wrap;
    row-gap: var(--space-1);
}
.room-requests-lc-card-actionbar > .badge {
    flex: 0 0 auto;
}

/* The lead slot keeps its width whether or not it holds an X, so Manage begins at the
   same place on every card in a column -- a row that reflows per card is the opposite
   of predictable. */
.room-requests-lc-card-actionbar-lead {
    display: flex;
    align-items: center;
    /* Cancel by guest is the one WIDE control in the row: its glyph is a sentence --
       the guest, an arrow, a bin -- on a 40x16 viewBox rather than the square 16 every
       other icon uses. 40:16 is exactly 2.5:1, so at icon height it wants 2.5x the
       width and nothing is letterboxed. The slot reserves that plus the padding
       .icon-clickable adds, so Manage starts in the same place whether or not the card
       has a cancel action (both measured). */
    flex: 0 0 calc(var(--icon-size-md) * 2.5 + var(--space-1));
}

/* Scoped to the row, never the bare atom class: this is the only wide glyph. */
.room-requests-lc-card-actionbar-lead .icon-md {
    width: calc(var(--icon-size-md) * 2.5);
}

/* Manage + the trailing icons are ONE flex item, so a fold puts the lead and the charge
   on the line above and leaves the controls together, in their learned order, below.
   Free wrapping tore them apart instead: measured on stage at 1280, a granted card came
   out as cancel+bin, then the charge, then Manage+pencil, over three lines. */
.room-requests-lc-card-controls {
    display: flex;
    align-items: center;
    /* TLP-1459: the controls hug the right -- the modal footer's own shape, danger alone
       on the left, a spacer, the rest. Manage used to stretch across the gap as a worded
       button; a lone glyph stretched over 170px at 1920 reads as an empty bar. */
    justify-content: flex-end;
    gap: var(--space-1);
    flex: 1 1 auto;
    min-width: 0;
}

/* The Manage pill keeps its natural width: a glyph is never squeezed or stretched. */
.room-requests-lc-card-controls > .btn {
    flex: 0 0 auto;
}

.room-requests-lc-card-controls > .room-requests-lc-card-actions {
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .room-requests-daycols { flex-direction: column; }
}
