/* Shared skin for the Informal-Agreement "schedule" tables so the Proposals dialog and the Submit
   Amendment dialog render an IDENTICAL surface from a SINGLE source of truth instead of two parallel
   stylesheets that can drift. Apply the `proposal-schedule-table` class to each table.

   The Proposals dialog builds its tables with MudBlazor <MudTable> (DOM: .mud-table-head /
   .mud-table-body / .mud-table-cell), while the Submit Amendment dialog uses <MudSimpleTable> (raw
   <thead>/<th>/<tbody>/<td>). Every rule below therefore targets BOTH shapes so the two match exactly.

   This is a global (non-isolated) stylesheet linked from index.html, so it is NOT scoped to a single
   component — that is deliberate: it is the shared contract both dialogs opt into via the class. */

/* Pin the app's Montserrat stack explicitly (the MudTheme Default family). MudTable cells get this
   via MudText/typography, but MudSimpleTable's raw <table>/<th>/<td> markup only inherits it — which
   is fragile (e.g. before the web font loads). Setting it here keeps both tables on the same font. */
.proposal-schedule-table,
.proposal-schedule-table th,
.proposal-schedule-table td,
.proposal-schedule-table .mud-table-cell {
    font-family: var(--mud-typography-default-family, "Montserrat", Arial, sans-serif);
}

/* Elevated white card. */
.proposal-schedule-table {
    background: #fff;
    box-shadow: var(--mud-elevation-4);
    -webkit-border-radius: 2px;
    -moz-border-radius: 0 2px;
    border-radius: 0 2px;
}

.proposal-schedule-table tbody,
.proposal-schedule-table .mud-table tbody {
    background: #fff;
}

/* Navy header bar with white 600-weight headings. !important overrides MudBlazor's sticky-header
   default, which paints header cells the surface (white) colour at equal specificity. */
.proposal-schedule-table .mud-table-head,
.proposal-schedule-table .mud-table-head .mud-table-cell,
.proposal-schedule-table thead th {
    background-color: var(--mud-palette-secondary) !important;
}

.proposal-schedule-table .mud-table-head span,
.proposal-schedule-table thead th {
    text-wrap: nowrap;
    white-space: nowrap;
    font-weight: 600;
    color: #fff;
}

/* Body cells read navy + semibold. */
.proposal-schedule-table .mud-table-body .mud-table-cell,
.proposal-schedule-table tbody td {
    color: var(--mud-palette-secondary);
    font-weight: 600;
}

/* Dense cell padding (6px 16px) + square, borderless header cells. */
.proposal-schedule-table .mud-table-dense * .mud-table-row .mud-table-cell,
.proposal-schedule-table th,
.proposal-schedule-table td {
    padding: 6px 16px;
    min-width: auto;
    height: 42px;
}

.proposal-schedule-table .mud-table-dense * .mud-table-row th.mud-table-cell {
    border-radius: 0px;
    border-bottom: 0px;
    white-space: nowrap;
}

.proposal-schedule-table .mud-table-cell > p,
.proposal-schedule-table .mud-table-cell > a {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 200px;
    font-size: 14px;
    display: block;
}

/* Right-aligned money columns (.currency = MudTable markup, .amount = MudSimpleTable markup). */
.proposal-schedule-table .currency,
.proposal-schedule-table .amount {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Labelled fee rows and reconciled totals read in primary. Covers the Proposals dialog's footer rows
   (.mud-table-foot) and inline .fee cells, plus the Submit Amendment dialog's .fee-row / .total-row. */
.proposal-schedule-table .mud-table-foot *,
.proposal-schedule-table .mud-table-body .mud-table-cell.fee *,
.proposal-schedule-table tr.fee-row td,
.proposal-schedule-table tr.total-row td {
    color: var(--mud-palette-primary) !important; /* override MudText's hard-coded colors */
}

/* Excluded creditor rows read in error (Proposals dialog markup). */
.proposal-schedule-table .mud-table-body .mud-table-cell.excluded * {
    color: var(--mud-palette-error);
}

/* CC5 (DEV-3899): Proposals-dialog footer-parity tint + table scrollbar colour. These used to live in the
   Proposals dialog's scoped .razor.css anchored on `.content-container`, but after the primitive migration
   that class sits on the shared StackLayout's own <div> (StackLayout's scope id, not the dialog's), so a
   scoped `::deep` would no longer match. Keyed here on the always-present `.proposal-schedule-table` /
   `.light-footer` / `.grey-footer` classes the dialog puts on the inner MudTable, so they reliably apply.
   The footer TEXT colour is the `.proposal-schedule-table .mud-table-foot` rule above; this is only the
   alternating background tint (by proposal-count parity) + the navy webkit scrollbar. */
.proposal-schedule-table.light-footer .mud-table-foot {
    background-color: #fff;
}

.proposal-schedule-table.grey-footer .mud-table-foot {
    background-color: #f7f7f7;
}

.proposal-schedule-table .mud-table-container::-webkit-scrollbar-track {
    background-color: #c4c4c4;
}

.proposal-schedule-table .mud-table-container::-webkit-scrollbar-thumb {
    background-color: var(--mud-palette-secondary);
    border-radius: 100px;
}

/* CC5 (DEV-3899): the Proposals dialog migrated onto the shared ModalShell, which caps its header + white
   body card at 960px via --shell-max-width. The Creditor Proposals schedule is far wider than that, so
   restore the pre-migration near-viewport width through ModalShell's sanctioned sizing hook (mirrors the old
   .content-container max-width:95vw). The schedule's own horizontal scroll keeps the wide table inside the
   card. --shell-bottom-offset is left at the primitive's 24px default. This is a global rule because the
   MudDialog ModalShell renders into the overlay layer, outside the consuming component's CSS scope. */
.proposals-modal-shell {
    --shell-max-width: 95vw;
}

/* CC5 (DEV-3889): the Submit Amendment confirmation stacks OVER the Proposals dialog, and the six-column
   creditor schedule overflows the shell's 960px default card. Widen through the sanctioned sizing hook —
   capped rather than 95vw because this is a focused confirmation, not the full proposals workspace. Global
   rule for the same reason as .proposals-modal-shell above (the shell renders into the overlay layer). */
.submit-amendment-modal-shell {
    --shell-max-width: min(1320px, 95vw);
}

/* CC5 (DEV-3889): opt-in dense scrim for a ModalShell STACKED over another dialog (ModalShell.BackdropClass →
   DialogOptions.BackgroundClass, so the class lands on MudDialog's own .mud-overlay element). The standard
   scrim (site.css `.mud-overlay .mud-overlay-scrim.mud-overlay-dark`, rgba 0.7125) leaves the parent dialog
   too legible behind the child. The selector repeats .mud-overlay + .mud-overlay-dark deliberately: it must
   outrank that site.css rule on specificity or the standard scrim wins. */
.mud-overlay.modal-shell-backdrop-dense .mud-overlay-scrim.mud-overlay-dark {
    background-color: rgba(23, 30, 54, 0.9);
}

/* CC5 (DEV-3889): while a dense-backdrop shell is stacked on top, HIDE the parent shell's floating header
   (title + close). No scrim alpha fully kills the bleed — the parent's tertiary-yellow title stays legible
   through even a near-opaque scrim and collides with the child's title at the same viewport position, and
   the parent's floating close button would otherwise invite closing the WRONG dialog. Pure-CSS :has() keyed
   on the stacked dense overlay, so the header restores itself the moment the child closes. */
.mud-dialog-container:has(~ .mud-dialog-container .mud-overlay.modal-shell-backdrop-dense) .modal-shell-header {
    visibility: hidden;
}
