/* ══════════════════════════════════════════════════════════════════════
   REPORTS
   ----------------------------------------------------------------------
   Data-analysis surface — three reports (Publishing History, Lease
   Compliance, Submission Audit) each rendered as a dash_table.DataTable.
   The DataTable provides native sort/filter/paginate/row-click; we
   override its rendering via style_* props (in Python) and a few CSS
   hooks here for things style_* can't reach (filter row internals, sort
   arrow color, dropdown wrappers).

   Editorial chrome (page title, filter card eyebrows) matches the rest
   of the app; the table itself is workman — small-caps headers,
   hairline gridlines, mono numerals, soft signal colors.

   Page is capped at 1440px (wider than Review Dashboard's 1280px because
   9-column tables need more lateral room).
   ══════════════════════════════════════════════════════════════════════ */

.reports-page {
    max-width: 1440px;
    margin: 0 auto;
    font-family: var(--fr-font-sans);
    color: var(--fr-ink);
}

/* ── Editorial header ───────────────────────────────────────────────── */
.fr-reports-header {
    margin: 4px 4px 22px;
}
.fr-reports-title {
    font-family: var(--fr-font-serif);
    font-size: 32px;
    font-weight: 400;
    letter-spacing: -0.005em;
    color: var(--fr-ink);
    line-height: 1;
    margin: 0 0 6px;
}
.fr-reports-subtitle {
    font-family: var(--fr-font-serif);
    font-style: italic;
    font-size: 15px;
    color: var(--fr-ink-2);
    margin: 0;
    line-height: 1.4;
    letter-spacing: 0.005em;
}

/* ── Selector row (Property + Report) ───────────────────────────────── */
.fr-reports-selectors {
    display: flex;
    gap: 18px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.fr-reports-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 240px;
}
.fr-reports-selector--wide { min-width: 320px; max-width: 400px; }

/* The Report selector holds the longest labels on the page ("Submission Audit
   - Renewals"). At the base 240px they wrapped to two lines inside the menu,
   and react-select's option height does not grow with the wrap, so the second
   line overlapped the option below it. Widening the control is the fix; the
   menu inherits the control's width. The nowrap + ellipsis below is a floor,
   so a longer label added later degrades to a truncation instead of an
   overlap. */
.fr-reports-selector--report { min-width: 300px; }
.fr-reports-selector--report .Select-option,
.fr-reports-selector--report .Select-value-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Small-caps eyebrow label shared by selectors AND filter card fields */
.fr-reports-eyebrow {
    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);
    line-height: 1;
}

/* ── Filter card ────────────────────────────────────────────────────── */
.fr-reports-filters {
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline);
    border-radius: var(--fr-r-lg);
    box-shadow: 0 1px 0 rgba(20, 24, 29, 0.02), 0 1px 2px rgba(20, 24, 29, 0.03);
    padding: 18px 22px 20px;
    margin-bottom: 18px;
}
.fr-reports-filters-title {
    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 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.fr-reports-filters-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--fr-hairline);
}
.fr-reports-filters-row {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.fr-reports-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Date pickers + text input — match the navbar/leasing-search aesthetic */
.fr-reports-field .DateInput,
.fr-reports-field .DateInput_input {
    width: 130px !important;
    background: var(--fr-surface) !important;
}
.fr-reports-field .DateInput_input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--fr-hairline-strong);
    border-radius: var(--fr-r-md);
    font-family: var(--fr-font-sans);
    font-size: 13.5px;
    color: var(--fr-ink);
    box-shadow: none;
    font-weight: 400;
}
.fr-reports-field .DateInput_input:focus {
    border-color: var(--fr-accent);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.10);
    outline: none;
}
/* Drop the underline that dash's DateInput uses for "active" — replaced by border-color */
.fr-reports-field .DateInput_input__focused {
    border-bottom: 1px solid var(--fr-accent) !important;
}
.fr-reports-field input[type="text"].fr-reports-input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--fr-hairline-strong);
    border-radius: var(--fr-r-md);
    font-family: var(--fr-font-sans);
    font-size: 13.5px;
    color: var(--fr-ink);
    background: var(--fr-surface);
    width: 130px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.fr-reports-field input[type="text"].fr-reports-input:focus {
    border-color: var(--fr-accent);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.10);
    outline: none;
}
.fr-reports-field input[type="text"].fr-reports-input::placeholder {
    color: #B5B2A8;
    font-style: italic;
}

/* Generate button — amber primary, matches navbar Publish Rates */
.fr-reports-generate {
    height: 40px;
    padding: 0 18px;
    background: var(--fr-accent) !important;
    border: 1px solid var(--fr-accent) !important;
    color: #FFFFFF !important;
    font-family: var(--fr-font-sans) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em;
    border-radius: var(--fr-r-md) !important;
    box-shadow: 0 1px 0 rgba(20, 24, 29, 0.04),
                0 1px 3px rgba(180, 83, 9, 0.22) !important;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
    cursor: pointer;
    align-self: flex-end;
}
.fr-reports-generate:hover {
    background: var(--fr-accent-strong) !important;
    border-color: var(--fr-accent-strong) !important;
}

/* ── Status / row count + Export button row ─────────────────────────── */
.fr-reports-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 6px 4px 12px;
    flex-wrap: wrap;
}
.fr-reports-status {
    font-family: var(--fr-font-sans);
    font-size: 13px;
    color: var(--fr-ink-2);
}
.fr-reports-status .count {
    font-family: var(--fr-font-mono);
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
    color: var(--fr-ink);
    font-weight: 500;
}
.fr-reports-status .sep {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--fr-ink-3);
    margin: 0 8px;
    vertical-align: middle;
    opacity: 0.6;
}
.fr-reports-status .pos { color: var(--fr-positive-deep); }
.fr-reports-status .warn { color: var(--fr-warning-deep); }
.fr-reports-status .neg  { color: var(--fr-negative); }
.fr-reports-status .muted { color: var(--fr-ink-3); }

/* Export to Excel — ghost button (positive-tinted for "data out") */
.fr-reports-export {
    height: 34px;
    padding: 0 14px;
    background: var(--fr-surface) !important;
    border: 1px solid var(--fr-hairline-strong) !important;
    color: var(--fr-positive-deep) !important;
    font-family: var(--fr-font-sans) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.14em !important;
    border-radius: var(--fr-r-md) !important;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.fr-reports-export:hover {
    background: var(--fr-positive-tint-2) !important;
    border-color: rgba(31, 122, 77, 0.25) !important;
    color: var(--fr-positive-deep) !important;
}

/* ── Empty state (no results) ───────────────────────────────────────── */
.fr-reports-empty {
    padding: 48px 22px;
    text-align: center;
    color: var(--fr-ink-3);
    font-family: var(--fr-font-sans);
    font-size: 13.5px;
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline);
    border-radius: var(--fr-r-lg);
}
.fr-reports-empty .title {
    font-family: var(--fr-font-serif);
    font-style: italic;
    font-size: 18px;
    color: var(--fr-ink-2);
    margin-bottom: 4px;
}

/* ── DataTable wrapper ──────────────────────────────────────────────── */
.fr-reports-table-wrap {
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline);
    border-radius: var(--fr-r-lg);
    box-shadow: 0 1px 0 rgba(20, 24, 29, 0.02), 0 1px 2px rgba(20, 24, 29, 0.03);
    overflow: hidden;
    padding: 0;
}

/* ── DataTable internal overrides (Plotly Dash dash_table) ──
   style_header/style_cell/style_data props handle the bulk of styling
   inline; these rules cover the bits those props can't reach: the
   filter-row input chrome, sort arrows, and rounded corners. */
.fr-reports-table-wrap .dash-spreadsheet-container,
.fr-reports-table-wrap .dash-spreadsheet,
.fr-reports-table-wrap .dash-spreadsheet-inner {
    border: 0 !important;
    font-family: var(--fr-font-sans) !important;
}

/* Sort indicator (the diamond icons in screenshot) — quiet them down */
.fr-reports-table-wrap .column-header--sort {
    color: var(--fr-ink-3) !important;
    margin-right: 4px;
}
.fr-reports-table-wrap .column-header--sort:hover {
    color: var(--fr-accent) !important;
}

/* Native filter row — make its inputs match the rest of the page */
.fr-reports-table-wrap .dash-filter input,
.fr-reports-table-wrap input.dash-filter--case {
    font-family: var(--fr-font-sans) !important;
    font-size: 12px !important;
    color: var(--fr-ink) !important;
    background: var(--fr-surface) !important;
    border: 1px solid var(--fr-hairline) !important;
    border-radius: 4px !important;
    padding: 3px 8px !important;
    font-style: normal !important;
}
.fr-reports-table-wrap .dash-filter input::placeholder {
    color: var(--fr-ink-3) !important;
    font-style: italic !important;
}
.fr-reports-table-wrap .dash-filter input:focus {
    border-color: var(--fr-accent) !important;
    outline: none !important;
}
/* The filter row's background should match a header band, not white */
.fr-reports-table-wrap .dash-filter {
    background: #FBFAF6 !important;
    border-bottom: 1px solid var(--fr-hairline) !important;
}
/* The native filter trigger icon */
.fr-reports-table-wrap .dash-filter--case {
    color: var(--fr-ink-3) !important;
}

/* Pagination footer */
.fr-reports-table-wrap .previous-next-container,
.fr-reports-table-wrap .dash-spreadsheet-menu {
    font-family: var(--fr-font-sans) !important;
    color: var(--fr-ink-2) !important;
    padding: 10px 14px !important;
}
.fr-reports-table-wrap .previous-next-container button {
    background: var(--fr-surface) !important;
    border: 1px solid var(--fr-hairline-strong) !important;
    color: var(--fr-ink-2) !important;
    border-radius: var(--fr-r-sm) !important;
    padding: 4px 10px !important;
    font-family: var(--fr-font-sans) !important;
    font-size: 12px !important;
}
.fr-reports-table-wrap .previous-next-container button:hover {
    background: var(--fr-bg) !important;
    border-color: #C9C5B8 !important;
    color: var(--fr-ink) !important;
}
.fr-reports-table-wrap input.current-page {
    border: 1px solid var(--fr-hairline-strong) !important;
    border-radius: var(--fr-r-sm) !important;
    background: var(--fr-surface) !important;
    font-family: var(--fr-font-sans) !important;
    font-size: 12px !important;
    color: var(--fr-ink) !important;
}

/* Drilldown panel (Submission Audit) */
.fr-reports-drilldown-title {
    font-family: var(--fr-font-serif);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.005em;
    color: var(--fr-ink);
    margin: 28px 0 4px;
}
.fr-reports-drilldown-meta {
    font-family: var(--fr-font-sans);
    font-size: 12.5px;
    color: var(--fr-ink-3);
    margin-bottom: 10px;
}

/* Lease Trade Out - the two Include checkboxes.
   Stacked so the pair occupies one filter-row slot at the same height as every
   control beside it. The gap between a box and its own text is set inline on
   the component (inputStyle), because Dash renders the input INSIDE the label
   and a flex gap here would compete with it. */
.fr-reports-checklist {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding-right: 4px;
}
.fr-reports-checklabel {
    font-family: var(--fr-font-sans);
    font-size: 12.5px;
    color: var(--fr-ink-2);
    cursor: pointer;
}
.fr-reports-checkbox {
    width: 13px;
    height: 13px;
    vertical-align: -1px;
    accent-color: var(--fr-accent);
    cursor: pointer;
}


/* ══════════════════════════════════════════════════════════════════════
   LEASE TRADE OUT — summary band above the detail rows
   ══════════════════════════════════════════════════════════════════════ */

.fr-tradeout-summary {
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline);
    border-radius: var(--fr-r-md);
    padding: 20px 24px;
    margin-bottom: 18px;
}

/* auto-fit rather than a fixed 4 columns: the band sits inside the same
   scrollable page as a 13-column table, and a hard 4-up overflows on a laptop. */
.fr-tradeout-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 4px 0;
}

.fr-tradeout-tile {
    padding: 2px 24px;
    border-left: 1px solid var(--fr-hairline);
}
.fr-tradeout-tile:first-child {
    padding-left: 0;
    border-left: 0;
}

.fr-tradeout-tile-label {
    font-family: var(--fr-font-sans);
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--fr-ink-3);
    margin-bottom: 8px;
}

/* Proportional figures on purpose. tabular-nums pads every digit to the width
   of a 0, which reads loose at this size; it belongs in the columns below,
   where digits have to line up. */
.fr-tradeout-tile-value {
    font-family: var(--fr-font-sans);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--fr-ink);
}
.fr-tradeout-tile-value.is-pos {
    color: var(--fr-positive-deep);
}
.fr-tradeout-tile-value.is-neg {
    color: var(--fr-negative);
}

.fr-tradeout-tile-sub {
    font-family: var(--fr-font-sans);
    font-size: 12px;
    color: var(--fr-ink-3);
    margin-top: 6px;
}

/* ── Per-lease-type breakdown ── */

.fr-tradeout-breakdown {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--fr-hairline);
}

.fr-tradeout-bd-row {
    display: grid;
    grid-template-columns: minmax(110px, 1.4fr) repeat(4, minmax(72px, 1fr));
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--fr-hairline);
}
.fr-tradeout-bd-row:last-child {
    border-bottom: 0;
}

.fr-tradeout-bd-row.is-head {
    padding-bottom: 8px;
}
.fr-tradeout-bd-row.is-head .fr-tradeout-bd-cell {
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--fr-ink-3);
    font-family: var(--fr-font-sans);
}

/* Numbers align down the column here, so these DO take tabular figures. */
.fr-tradeout-bd-cell {
    font-family: var(--fr-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--fr-ink);
    text-align: right;
}
.fr-tradeout-bd-cell.is-label {
    font-family: var(--fr-font-sans);
    font-variant-numeric: normal;
    text-align: left;
    color: var(--fr-ink-2);
}
.fr-tradeout-bd-cell.is-pos {
    color: var(--fr-positive-deep);
    font-weight: 600;
}
.fr-tradeout-bd-cell.is-neg {
    color: var(--fr-negative);
    font-weight: 600;
}

/* ── Footnote: what the averages do not speak for ── */

.fr-tradeout-note {
    font-family: var(--fr-font-sans);
    font-size: 12px;
    line-height: 1.5;
    color: var(--fr-ink-3);
    margin-top: 14px;
    padding-left: 12px;
    border-left: 2px solid var(--fr-hairline-strong);
}

/* ══════════════════════════════════════════════════════════════════════
   END REPORTS
   ══════════════════════════════════════════════════════════════════════ */
