/* ══════════════════════════════════════════════════════════════════════
   RENEWALS PAGE — editorial Frontier vocabulary
   ----------------------------------------------------------------------
   Per-unit-type cards (e.g. "1x1", "2x1") and their inner renewal tables,
   plus the page-level controls (expiration window picker + quick-jump
   pills + unit-type dropdown). Replaces the legacy bright-blue gradient
   .card-header / dark-navy table header chrome with a calm cream surface
   that matches Reports / Executive Summary / Preview modals.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Page-level controls (expiration window + unit type) ───────────── */
.fr-renewal-controls {
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline);
    border-radius: var(--fr-r-lg);
    padding: 14px 18px;
    margin-bottom: 14px;
    box-shadow: 0 1px 0 rgba(20, 24, 29, 0.02);
}
.fr-renewal-controls-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}
.fr-renewal-controls-label {
    font-family: var(--fr-font-sans);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--fr-ink-3);
    margin: 0;
    align-self: center;
}
/* ── Resident filter (Expiring / Expiring + MTM / MTM Only) ─────────────
   dcc.RadioItems styled as a segmented pill control to match .fr-seg
   (the Cards|Rows toggle on New Leases). The native radio input is
   hidden; the checked state styles its parent label via :has(). */
.fr-renewal-resident-label {
    margin-left: 10px;
}
.fr-renewal-seg {
    display: inline-flex;
    background: var(--fr-bg);
    border: 1px solid var(--fr-hairline-strong);
    border-radius: 100px;
    padding: 3px;
    gap: 2px;
}
.fr-renewal-seg label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-family: var(--fr-font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fr-ink-3);
    padding: 6px 14px;
    border-radius: 100px;
    margin: 0;
    white-space: nowrap;
    transition: background 140ms ease, color 140ms ease;
}
.fr-renewal-seg label:hover {
    color: var(--fr-ink-2);
}
.fr-renewal-seg label:has(input:checked) {
    background: var(--fr-surface);
    color: var(--fr-accent-strong);
    box-shadow: 0 1px 2px rgba(20, 24, 29, 0.10);
}
.fr-renewal-seg input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

/* DatePickerRange inputs — match Reports filter inputs */
.fr-renewal-date-range .DateInput_input {
    font-family: var(--fr-font-sans) !important;
    font-size: 13px !important;
    color: var(--fr-ink) !important;
    padding: 6px 10px !important;
    background: var(--fr-bg) !important;
    border: 1px solid var(--fr-hairline-strong) !important;
    border-radius: var(--fr-r-sm) !important;
}
.fr-renewal-date-range .DateInput_input__focused {
    border-color: var(--fr-accent) !important;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.10) !important;
}
.fr-renewal-date-range .DateRangePickerInput {
    background: transparent !important;
    border: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.fr-renewal-date-range .DateRangePickerInput_arrow_svg {
    fill: var(--fr-ink-3) !important;
    width: 16px;
    height: 16px;
}

/* Unit-type dropdown — sits in its own row below the controls card */
.fr-renewal-ut-wrap {
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline);
    border-radius: var(--fr-r-lg);
    padding: 14px 18px 16px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 0 rgba(20, 24, 29, 0.02);
}
.fr-renewal-ut-dropdown .Select-control,
.fr-renewal-ut-dropdown .Select-control:hover {
    border: 1px solid var(--fr-hairline-strong) !important;
    border-radius: var(--fr-r-sm) !important;
    background: var(--fr-bg) !important;
    box-shadow: none !important;
    font-family: var(--fr-font-sans) !important;
    font-size: 13px !important;
    color: var(--fr-ink) !important;
    min-height: 36px !important;
}
.fr-renewal-ut-dropdown.is-focused:not(.is-open) > .Select-control {
    border-color: var(--fr-accent) !important;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.10) !important;
}
.fr-renewal-ut-dropdown .Select-placeholder,
.fr-renewal-ut-dropdown .Select-value-label {
    font-family: var(--fr-font-sans) !important;
    color: var(--fr-ink) !important;
}
.fr-renewal-ut-dropdown .Select-arrow-zone {
    color: var(--fr-ink-3) !important;
}

/* ── Per-unit-type card ─────────────────────────────────────────────── */
.fr-renewal-card {
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline-strong);
    border-top: 3px solid var(--fr-accent);
    border-left: 3px solid var(--fr-accent);
    border-radius: var(--fr-r-md);
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(20, 24, 29, 0.04);
    transition: border-color 120ms ease, box-shadow 140ms ease;
}
.fr-renewal-card:hover {
    border-top-color: var(--fr-accent-strong);
    border-left-color: var(--fr-accent-strong);
}
.fr-renewal-card-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 22px 13px;
    background: var(--fr-bg);
    border-bottom: 1px solid var(--fr-hairline-strong);
    cursor: pointer;
    user-select: none;
    transition: background 120ms ease, border-color 120ms ease;
}
.fr-renewal-card-head:hover {
    background: #FBF9F4;
}
.fr-renewal-card-head.is-collapsed {
    border-bottom-color: transparent;
}
.fr-renewal-card-chevron {
    margin-left: auto;
    align-self: center;
    font-size: 16px;
    line-height: 1;
    color: var(--fr-ink-3);
    transition: transform 180ms ease;
}
.fr-renewal-card-head.is-collapsed .fr-renewal-card-chevron {
    transform: rotate(-90deg);
}
.fr-renewal-card-code {
    font-family: var(--fr-font-sans);
    font-size: 22px;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--fr-ink);
    font-weight: 700;
}
.fr-renewal-card-meta {
    font-family: var(--fr-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 11.5px;
    color: var(--fr-ink-3);
    padding-left: 14px;
    border-left: 1px solid var(--fr-hairline);
    margin-left: 2px;
}
.fr-renewal-card-body {
    padding: 14px 18px 16px;
}

/* ── Renewal per-unit-type summary strip ────────────────────────────────
   At-a-glance metrics row inside each unit-type card, framed around the
   renewal decision: Cohort Now · New-Lease Ask · Loss to Lease · Avg
   Renewal. Lives outside the collapsible body so it stays visible when the
   table is folded. fr-rs-* namespace. */
.fr-renewal-summary {
    /* Flex (not stretched-grid) so the four stats cluster left in a tight
       ~620px band — the eye doesn't travel the full page width to read them. */
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;
    padding: 11px 22px 12px;
    background: #FBFAF6;
    border-bottom: 1px solid var(--fr-hairline-strong);
}
.fr-rs-stat {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 155px;
    padding: 0 18px;
    border-left: 1px solid var(--fr-hairline);
}
.fr-rs-stat:first-child {
    border-left: none;
    padding-left: 0;
}
/* Workman vocabulary — matches the New Leases unit-type card stats
   (.ut-rent-stats): sans numerals with weight, mono sub-captions. */
.fr-rs-label {
    font-family: var(--fr-font-sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fr-ink-3);
}
.fr-rs-value {
    font-family: var(--fr-font-sans);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--fr-ink);
    font-variant-numeric: tabular-nums;
}
.fr-rs-sub {
    font-family: var(--fr-font-mono);
    font-size: 10px;
    letter-spacing: -0.01em;
    color: var(--fr-ink-3);
    min-height: 13px;
}
.fr-rs-hero {
    font-variant-numeric: tabular-nums;
}
.fr-rs-hero-sub {
    font-weight: 600;
}
.fr-rs-delta {
    font-family: var(--fr-font-sans);
    font-weight: 700;
    font-size: 11px;
}
.fr-rs-info {
    margin-left: 4px;
    color: var(--fr-ink-3);
    cursor: pointer;
    font-size: 9px;
    font-family: var(--fr-font-sans);
}
.fr-rs-hero.is-up,
.fr-rs-hero-sub.is-up,
.fr-rs-delta.is-up {
    color: var(--fr-positive);
}
.fr-rs-hero.is-down,
.fr-rs-hero-sub.is-down,
.fr-rs-delta.is-down {
    color: var(--fr-negative);
}
.fr-rs-hero.is-warn,
.fr-rs-hero-sub.is-warn,
.fr-rs-delta.is-warn {
    color: var(--fr-warning-deep);
}
.fr-rs-hero.is-flat,
.fr-rs-hero-sub.is-flat,
.fr-rs-delta.is-flat {
    color: var(--fr-ink-3);
}

/* ── Renewal table chrome ───────────────────────────────────────────── */
.fr-renewal-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--fr-hairline);
    border-radius: var(--fr-r-md);
    background: var(--fr-surface);
}
.fr-renewal-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--fr-font-sans);
    font-size: 13px;
    color: var(--fr-ink);
    background: var(--fr-surface);
}
/* Header band — cream + small-caps gray label, matches Reports headers.
   Header text AND cell values are both centered: the eye doesn't have to
   bridge a gap between a left-aligned label and a right-aligned number,
   which is what made the mixed-alignment first pass read as unfinished.
   This is intentional for a card-grid dashboard with tight 4-digit money
   values; the canonical "right-align numbers" rule is for tables with
   wildly varying digit counts where you scan totals down the column. */
.fr-renewal-table .fr-renewal-th {
    background: #FBFAF6;
    color: var(--fr-ink-3);
    font-family: var(--fr-font-sans);
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 12px 14px;
    text-align: center;
    border-top: 0;
    border-left: 0;
    border-right: 1px solid var(--fr-hairline);
    border-bottom: 1px solid var(--fr-hairline);
    vertical-align: middle;
    white-space: nowrap;
}
.fr-renewal-table .fr-renewal-th:last-child { border-right: 0; }
.fr-renewal-th-trigger {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fr-renewal-th-trigger:hover { color: var(--fr-accent); }
.fr-renewal-th-sort {
    font-size: 0.85em;
    margin-left: 2px;
    color: var(--fr-ink-3);
}
/* Body cells — center-aligned to match the headers. Mono+tabular-nums
   applied per-column below so dollar values and percentages still stack
   neatly digit-over-digit even though we're not right-aligning. */
.fr-renewal-table tbody td {
    padding: 10px 14px;
    font-family: var(--fr-font-sans);
    font-size: 13px;
    color: var(--fr-ink);
    border-right: 1px solid var(--fr-hairline);
    border-bottom: 1px solid var(--fr-hairline);
    vertical-align: middle;
    text-align: center;
}
.fr-renewal-table tbody td:last-child { border-right: 0; }
.fr-renewal-table tbody tr:nth-of-type(even) td { background: #FCFBF7; }
.fr-renewal-table tbody tr.terms-collapse-row td { background: #FBFAF6; border-right: 0; }
.fr-renewal-terms-collapse-body {
    padding: 14px 18px 12px;
    background: #FBFAF6;
}

/* Per-column treatment for the outer renewal table. Money/numeric cells
   get JetBrains Mono + tabular-nums so the digits line up vertically
   across rows (the visual rhythm you'd normally get from right-aligning,
   without the header-far-from-value gap). Status / Notes / Show Terms
   inherit the centered default; their contained widgets (pill, icon,
   button) center themselves naturally. */
.fr-renewal-table tbody td.fr-cell-money,
.fr-renewal-table tbody td.fr-cell-num {
    font-family: var(--fr-font-mono);
    font-variant-numeric: tabular-nums;
}
/* Unit cell — regular weight. Matches the New Leases pricing-table
   hierarchy where the rents pop and the unit ID stays quiet. The class
   is kept (rather than removed) as a stable hook for future variants
   (e.g. flagging an unpublished or stale unit). */
.fr-renewal-table tbody td.fr-cell-unit {
    font-family: var(--fr-font-mono);
    font-variant-numeric: tabular-nums;
}

/* ── Status pill ────────────────────────────────────────────────────── */
.fr-renewal-status-pill {
    display: inline-block;
    padding: 3px 10px 4px;
    border-radius: 100px;
    font-family: var(--fr-font-sans);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    line-height: 1.4;
    white-space: nowrap;
}
.fr-renewal-status-pill.is-original {
    background: var(--fr-bg);
    color: var(--fr-ink-3);
    border: 1px solid var(--fr-hairline-strong);
}
.fr-renewal-status-pill.is-reviewed {
    background: var(--fr-warning-tint);
    color: var(--fr-warning-deep);
    border: 1px solid rgba(181, 112, 31, 0.30);
}
.fr-renewal-status-pill.is-published {
    background: var(--fr-positive-tint-2);
    color: var(--fr-positive-deep);
    border: 1px solid rgba(31, 122, 77, 0.22);
}

/* ── Review & BPO inputs ────────────────────────────────────────────── */
/* Wider than the original 100px so the box doesn't look lost inside a
   200px column. The increase % indicator sits to the right of the input
   via inline-flex (handled in the Python wrapper), and the whole group
   is centered in the cell by the parent td's text-align: center.
   Width tuned so input(120) + gap(4) + indicator(~50) leaves balanced
   white-space inside a 200px column. */
.fr-renewal-review-input,
.fr-renewal-bpo-input {
    width: 120px;
    text-align: center;
    border-radius: var(--fr-r-sm);
    padding: 6px 10px;
    font-family: var(--fr-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--fr-ink);
    -moz-appearance: textfield;
}
.fr-renewal-review-input {
    background: var(--fr-positive-tint);
    border: 1px solid rgba(31, 122, 77, 0.30);
}
.fr-renewal-bpo-input {
    background: var(--fr-bg);
    border: 1px solid var(--fr-hairline-strong);
}
.fr-renewal-review-input:focus,
.fr-renewal-bpo-input:focus {
    border-color: var(--fr-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.10);
}
.fr-renewal-review-input.is-disabled,
.fr-renewal-review-input:disabled {
    background: #F1EFE8;
    color: var(--fr-ink-3);
    border-color: var(--fr-hairline-strong);
    cursor: not-allowed;
}

/* ── Buttons (Accept Recommended + Show Terms) ──────────────────────── */
/* Bulk action sits at the top-left of the card body, beneath the unit
   type label in the head strip — matches the New Leases pricing table
   layout (Hold Current Advertised / Accept Recommended on the left,
   above the table). */
.fr-bulk-accept-btn-wrap {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}
.fr-bulk-accept-btn {
    height: 32px;
    padding: 0 14px;
    background: var(--fr-accent-soft);
    border: 1px solid rgba(180, 83, 9, 0.30);
    border-radius: var(--fr-r-md);
    font-family: var(--fr-font-sans);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--fr-accent-strong);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.fr-bulk-accept-btn:hover {
    background: var(--fr-accent);
    color: var(--fr-surface);
    border-color: var(--fr-accent-strong);
}
.fr-bulk-accept-btn:focus,
.fr-bulk-accept-btn:active {
    outline: none;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.18);
}

.fr-renewal-show-terms-btn {
    height: 30px;
    padding: 0 12px;
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline-strong);
    border-radius: var(--fr-r-sm);
    font-family: var(--fr-font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--fr-ink-2);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fr-renewal-show-terms-btn:hover {
    background: #FBF9F4;
    color: var(--fr-ink);
    border-color: #C9C5B8;
}
.fr-renewal-show-terms-btn:focus,
.fr-renewal-show-terms-btn:active {
    outline: none;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

/* ── Nested Terms breakdown table ───────────────────────────────────── */
.fr-renewal-terms-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--fr-font-sans);
    font-size: 12.5px;
    color: var(--fr-ink);
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline);
    border-radius: var(--fr-r-sm);
    overflow: hidden;
    margin: 8px 0;
}
.fr-renewal-terms-th {
    background: #FBFAF6;
    color: var(--fr-ink-3);
    font-family: var(--fr-font-sans);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 10px 12px;
    text-align: center;
    border-right: 1px solid var(--fr-hairline);
    border-bottom: 1px solid var(--fr-hairline);
    white-space: nowrap;
}
.fr-renewal-terms-th:last-child { border-right: 0; }
.fr-renewal-terms-table tbody td {
    padding: 8px 12px;
    font-family: var(--fr-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
    color: var(--fr-ink);
    border-right: 1px solid var(--fr-hairline);
    border-bottom: 1px solid var(--fr-hairline);
    text-align: center;
    vertical-align: middle;
}
.fr-renewal-terms-table tbody td:first-child {
    /* Lease Term (Months) — short integer; keep mono for column-rhythm but
       no special left-align (everything's centered in this table). */
    font-weight: 600;
}
.fr-renewal-terms-table tbody td:last-child { border-right: 0; }
.fr-renewal-terms-table tbody tr:last-child td { border-bottom: 0; }
.fr-renewal-terms-table tbody tr:nth-of-type(even) td { background: #FCFBF7; }
.fr-renewal-terms-table tbody td.is-total { font-weight: 700; color: var(--fr-ink); }

/* ══════════════════════════════════════════════════════════════════════
   END RENEWALS PAGE
   ══════════════════════════════════════════════════════════════════════ */


