/* Approvals.css -- Front Office Approvals (decision surface for guest/operator
   Late Checkout + Room Change requests). 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. */

.approvals-module {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    flex: 1;
    min-height: 0;
}

/* Scroll region below the sub-tab bar -- the request list scrolls within it. */
.approvals-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Sub-tab bar: SegmentedControl (left) + Export/date/refresh actions (right). */
.approvals-sub-tab-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.approvals-sub-tabs {
    display: flex;
    min-width: 0;
}

/* Export + the named date range + five state pills + refresh. It wraps rather than
   overflowing: the lens went from three pills to five (TLP-1169/TLP-1170) and a narrow
   workspace has to fold the row, not clip the last pill off the end of it. */
.approvals-sub-tab-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Said above the list only when a chosen period is hiding unanswered work
   (TLP-1169). Muted, because it is a caveat on what is on screen and not an error. */
.approvals-outside-period {
    margin: 0 0 var(--space-3) 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* The bin on an expired card (TLP-1170) -- right-aligned, the position a
   single trailing action takes everywhere else on this board. */
.approvals-expired-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-2);
}

/* Lift each request card off the panel background. The base ExpandablePanel is
   flat (subtle border, no shadow) and blends in here, so reuse the Card /
   MetricCard elevation precedent: a firmer border + resting shadow + hover lift. */
.expandable-panel.approvals-row {
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-200) var(--easing-out);
}

.expandable-panel.approvals-row:hover {
    box-shadow: var(--shadow-md);
}

/* Expanded request detail -- compact 3-col identity grid. */
.approvals-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.approvals-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-1) var(--space-4);
}

.approvals-detail-cell {
    min-width: 0;
}

.approvals-detail-cell-full {
    grid-column: 1 / -1;
}

/* Decision area -- separated from identity with a subtle top rule. */
.approvals-detail-section {
    padding-top: var(--space-2);
    border-top: var(--border-width-1) solid var(--border-subtle);
}

@media (max-width: 900px) {
    .approvals-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .approvals-detail-grid { grid-template-columns: 1fr; }
}

/* Inline grant editor (late checkout). Built from molecules (DetailRow,
   SegmentedControl, FormField) -- they style themselves; only the column flow
   and the Price|Comment pairing live here. */
.approvals-grant {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Price + Comment side by side -- Price is just a number (narrow), Comment
   takes the rest. */
.approvals-grant-fields {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: var(--space-3) var(--space-4);
}

/* The default grant has no tier row above it, so its price stepper sits alone in
   the first column and needs room for the minus/value/plus plus its help line.
   Late checkout keeps the tighter 130px because its price reads under the tier
   control that already sets the width. */
.approvals-grant-fields-generic {
    grid-template-columns: 190px minmax(0, 1fr);
}

/* A compact row of pickers, rather than the two-column grid above. The room-change
   move row (-move) carries move day + room type + room number + comment; TLP-1104's
   late-checkout room pair (-rooms) carries just the two room pickers. */
.approvals-grant-fields-move,
.approvals-grant-fields-rooms {
    display: flex;
    flex-wrap: wrap;
}
.approvals-grant-fields-move > *,
.approvals-grant-fields-rooms > * {
    flex: 0 0 160px;
    min-width: 0;
}
/* ONLY the move row ends in a comment, and a comment should take the rest of the
   line. The room pair ends in a room NUMBER, so nothing stretches there -- a 4-digit
   room number in a field a thousand pixels wide is what this rule prevents. */
.approvals-grant-fields-move > *:last-child {
    flex: 1 1 220px;
}

/* The room-change charge row: Charge | Free | Free reason. THREE controls, and it
   was inheriting the two-column grid above -- so the reason select wrapped onto a
   second row into the 130px charge column, on every chargeable room change. The
   class was emitted from the first day and never had a rule.

   Charge takes the wider stepper column the default grant already uses (190px), so its
   "Suggested ..." help reads on two lines rather than three and the row stays short.
   The Free checkbox is its own width. The reason is CAPPED, not stretched: it holds a
   phrase, and this module already refuses to put a short value in a field a thousand
   pixels wide (see the move row above). The rest of the line is deliberately empty. */
.approvals-grant-fields-charge {
    grid-template-columns: 190px max-content 340px;
    /* The leftover belongs at the END of the row, not inside it. An `auto` middle
       track absorbs the free space and throws the reason select against the right
       edge of the card, half a screen from the checkbox it belongs to. */
    justify-content: start;
    align-items: end;
}

/* The checkbox has no label above it, so it would sit at the top of a row whose
   siblings carry a label and a help line. Align it to the controls, not the labels. */
.approvals-grant-fields-charge > *:nth-child(2) {
    padding-bottom: var(--space-2);
}

@media (max-width: 900px) {
    .approvals-grant-fields-charge { grid-template-columns: 130px minmax(0, 1fr); }
    .approvals-grant-fields-charge > *:nth-child(2) { padding-bottom: 0; }
}

/* Payment + actions share the bottom row: payment left, buttons pushed right. */
.approvals-grant-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
}

.approvals-grant-footer .detail-row {
    width: auto;
}

.approvals-grant-actions {
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

@media (max-width: 600px) {
    .approvals-grant-fields { grid-template-columns: 1fr; }
}

