/* ============================================================================
   HotelTRS money panels

   Three modals - GuestFolioModal, ReceiptItemsModal, ReceiptComposeModal - each
   carried its own copy of the same "labels on the left, figures on the right,
   rule above the total" panel, under three different prefixes: folio-*,
   receipt-items-* and receipt-summary-*. The declarations were identical down
   to the .35rem margin above the total. They are one pattern, so they are one
   set of classes here: trs-money-*.

   Anything genuinely specific to one modal keeps its own name and lives at the
   bottom of this file.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   TABLE

   The header row is dark, so its own cell borders have to lighten or they
   vanish into it and the columns stop lining up with the body below.
   ---------------------------------------------------------------------------- */

.trs-money-table {
    margin-bottom: 0;
}

.trs-money-table th,
.trs-money-table td {
    vertical-align: middle;
    border-color: var(--trs-border);
}

.trs-money-table thead th {
    border-color: rgba(255, 255, 255, .25);
    white-space: nowrap;
}

.trs-money-table .form-control,
.trs-money-table .form-select {
    margin-bottom: 0;
}

/* ----------------------------------------------------------------------------
   PANEL

   A bounded panel rather than figures floating at the right edge, so labels and
   amounts align against each other instead of against the page.
   ---------------------------------------------------------------------------- */

.trs-money-panel {
    display: flex;
    flex-direction: column;
    padding: .85rem var(--trs-space-4);
    border: 1px solid var(--trs-border);
    border-radius: var(--trs-radius-sm);
    background-color: var(--trs-surface-sunken);
}

.trs-money-totals {
    min-width: 20rem;
}

/* The compose modal's summary is the only one that sits alone on its row, so it
   pushes itself right; the others sit in a flex row that already places them. */
.trs-money-panel-right {
    min-width: 22rem;
    max-width: 100%;
    margin-left: auto;
}

.trs-money-panel-title {
    font-size: var(--trs-text-sm);
    font-weight: var(--trs-weight-medium);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--trs-text-secondary);
    margin-bottom: var(--trs-space-2);
}

/* ----------------------------------------------------------------------------
   ROWS AND TOTALS
   ---------------------------------------------------------------------------- */

.trs-money-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--trs-space-4);
    min-height: 1.9rem;
    font-size: var(--trs-text-md);
}

.trs-money-row > span:first-child {
    color: var(--trs-text-secondary);
}

.trs-money-row span:last-child,
.trs-money-total span:last-child {
    font-variant-numeric: tabular-nums;
}

.trs-money-total {
    margin-top: .35rem;
    padding-top: var(--trs-space-2);
    border-top: 1px solid var(--trs-border);
    font-size: var(--trs-text-lg);
    font-weight: var(--trs-weight-medium);
}

/* The total's label is the one row that is not secondary - it is the figure
   staff are looking for. */
.trs-money-total > span:first-child {
    color: inherit;
}

/* ----------------------------------------------------------------------------
   RECAP TABLE

   A quiet header, not the dark contrast the main table uses: inside a tinted
   panel a solid band reads as a second, competing table.
   ---------------------------------------------------------------------------- */

.trs-money-recap {
    margin-bottom: 0;
    font-size: var(--trs-text-base);
}

.trs-money-recap th {
    padding: var(--trs-space-1) var(--trs-space-2);
    font-weight: var(--trs-weight-medium);
    color: var(--trs-text-secondary);
    background: transparent;
    border-bottom: 1px solid var(--trs-border);
    white-space: nowrap;
}

.trs-money-recap td {
    padding: var(--trs-space-1) var(--trs-space-2);
    border-bottom: 0;
    font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------------------
   EMPTY STATE
   ---------------------------------------------------------------------------- */

.trs-money-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .6rem;
    padding: 3rem var(--trs-space-6);
    max-width: 34rem;
    margin: 0 auto;
}

/* Was opacity .35, which on the muted text colour landed around 2:1. The icon
   carries no information the text does not, but it should still look drawn
   rather than half-erased. */
.trs-money-empty-icon {
    font-size: 2.25rem;
    color: var(--trs-text-muted);
    opacity: .7;
}

/* ============================================================================
   GUEST FOLIO - the parts with no counterpart in the receipt modals
   ============================================================================ */

.folio-card {
    border: 1px solid var(--trs-border);
    border-radius: var(--trs-radius-sm);
    padding: var(--trs-space-4);
    margin-bottom: var(--trs-space-4);
}

.folio-card:last-child {
    margin-bottom: 0;
}

.folio-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--trs-space-4);
    flex-wrap: wrap;
    margin-bottom: var(--trs-space-2);
}

/* The balance is the number staff are looking for, so it sits opposite the
   state badge rather than at the bottom of a column of totals. */
.folio-head-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.folio-head-total-label {
    font-size: var(--trs-text-xs);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--trs-text-secondary);
}

.folio-head-total-value {
    font-size: var(--trs-text-xl);
    font-weight: var(--trs-weight-medium);
    font-variant-numeric: tabular-nums;
}

.folio-description {
    margin-bottom: var(--trs-space-3);
    font-size: var(--trs-text-md);
}

.folio-group {
    margin-bottom: var(--trs-space-4);
}

.folio-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--trs-space-4);
    padding: .35rem .1rem;
}

/* Deliberately quieter than the totals panel and dashed rather than solid: it
   is not part of the bill, and it must not read as though it is. */
.folio-pending {
    margin-top: var(--trs-space-4);
    padding: .85rem var(--trs-space-4);
    border: 1px dashed var(--trs-border-strong);
    border-radius: var(--trs-radius-sm);
    background-color: transparent;
}

.folio-pending-head {
    display: flex;
    align-items: center;
    font-size: var(--trs-text-sm);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--trs-text-secondary);
    margin-bottom: .35rem;
}

.folio-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--trs-space-4);
    flex-wrap: wrap;
    margin-top: var(--trs-space-4);
    padding-top: var(--trs-space-4);
    border-top: 1px solid var(--trs-border);
}

.folio-issue-note {
    flex: 1 1 22rem;
    margin-bottom: 0;
}

/* ============================================================================
   RECEIPT COMPOSE - line-item editing
   ============================================================================ */

/* ReceiptComposeModal carried two rules that are not here on purpose:

   `.modal-header { justify-content: center }` - components.css already sets
   exactly this app-wide, and the modal renders no <ModalHeader> of its own, so
   the rule was a duplicate of a global that reached only other modals' headers.
   Verified in the browser: headers still centre, from components.css.

   `.modal-body-holder > div { padding-bottom: 1em }` - likewise already an
   app-wide convention in components.css. The markup keeps the class. */

.trs-line-total-was {
    text-decoration: line-through;
    opacity: .55;
    font-size: var(--trs-text-sm);
    margin-right: .4rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.trs-line-total-now {
    font-weight: var(--trs-weight-medium);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
