/* Custom CSS for Dash Property Management App */

/* ─────────────────────────────────────────────────────────────────────
   GLOBAL STYLES
   ───────────────────────────────────────────────────────────────────── */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #eef1f5;
}

/* ─────────────────────────────────────────────────────────────────────
   NAVBAR CUSTOMIZATION
   ───────────────────────────────────────────────────────────────────── */

.navbar-brand {
    font-weight: 700 !important;
    font-size: 1.3rem !important;
}

/* Logo and navbar layout */
.navbar .d-flex.align-items-center {
    flex-grow: 1;
}

.navbar .d-flex.align-items-center img {
    /* No filter needed - logo is already white */
    transition: all 0.2s ease;
    opacity: 0.9;
}

.navbar .d-flex.align-items-center img:hover {
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.4));
    opacity: 1;
    transform: scale(1.05);
}

.navbar .d-flex.align-items-center span {
    margin-left: 0.75rem;
    letter-spacing: 0.5px;
}

/* ─────────────────────────────────────────────────────────────────────
   SIDEBAR — Frontier theme
   ─────────────────────────────────────────────────────────────────────
   The offcanvas drawer is the table-of-contents page of the operations
   ledger. It uses the same ivory surface as the page, with Instrument
   Serif section headings to mark chapter divisions and a 2px amber
   left rule for the active page.
   ───────────────────────────────────────────────────────────────────── */

.fr-sidebar.offcanvas,
.offcanvas {
    background-color: var(--fr-bg) !important;
    color: var(--fr-ink) !important;
    border-right: 1px solid var(--fr-hairline-strong) !important;
    font-family: var(--fr-font-sans);
    padding: 22px 22px 24px;
}

/* Hide bootstrap's default offcanvas header bar — we render our own. */
.fr-sidebar .offcanvas-header {
    padding: 0;
    border-bottom: 0;
}
.fr-sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0;
}
.fr-sidebar .btn-close {
    color: var(--fr-ink-3);
    opacity: 0.6;
    background-size: 0.8em;
}
.fr-sidebar .btn-close:hover { opacity: 1; }

/* ── Top strip: wordmark + datestamp ────────────────────────────────── */
.fr-sidebar-strip {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--fr-hairline);
}
.fr-sidebar-wordmark {
    font-family: var(--fr-font-serif);
    font-size: 24px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--fr-ink);
    line-height: 1;
}
.fr-sidebar-stamp {
    font-family: var(--fr-font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fr-ink-3);
    margin-top: 8px;
}

/* ── Section eyebrows (Property, Mode, etc.) ────────────────────────── */
.fr-sidebar-section-eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fr-ink-3);
    margin: 0 0 8px;
    font-weight: 500;
}

/* ── Property block ─────────────────────────────────────────────────── */
.fr-sidebar-prop-block { display: flex; flex-direction: column; }

/* ── Mode block + segmented control ─────────────────────────────────── */
.fr-sidebar-mode-block { display: flex; flex-direction: column; }

.fr-sidebar-segmented {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: var(--fr-surface);
    border: 1px solid var(--fr-hairline-strong);
    border-radius: var(--fr-r-md);
    overflow: hidden;
    padding: 0;
}
.fr-sidebar-segmented .form-check {
    margin: 0;
    padding: 0;
    position: relative;
    border-right: 1px solid var(--fr-hairline);
    min-height: unset;
}
.fr-sidebar-segmented .form-check:last-child { border-right: 0; }
.fr-sidebar-segmented .form-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 100%; height: 100%;
    margin: 0;
}
.fr-sidebar-segmented .form-check-label {
    display: block;
    text-align: center;
    padding: 9px 8px;
    font-size: 13px;
    color: var(--fr-ink-2);
    cursor: pointer;
    user-select: none;
    transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
    line-height: 1.2;
}
.fr-sidebar-segmented .form-check:hover .form-check-label {
    background: rgba(20, 24, 29, 0.03);
    color: var(--fr-ink);
}
.fr-sidebar-segmented .form-check-input:checked + .form-check-label {
    background: var(--fr-accent-soft);
    color: var(--fr-accent-strong);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--fr-accent);
}

/* ── Nav (chapter headings + items) ─────────────────────────────────── */
.fr-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-group-header {
    font-family: var(--fr-font-serif);
    font-size: 19px;
    line-height: 1;
    color: var(--fr-ink);
    letter-spacing: 0.005em;
    padding: 14px 0 8px;
    margin-top: 16px;
    border-top: 1px solid var(--fr-hairline-strong);
    background: transparent;
    border-radius: 0;
    border-left: 0;
}
/* First chapter sits flush — no extra rule above. */
.sidebar-nav-group-header:first-child {
    margin-top: 4px;
    padding-top: 14px;
}

.sidebar-nav-item {
    position: relative;
    padding: 8px 12px 8px 16px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--fr-ink-2);
    font-size: 14px;
    line-height: 1.25;
    cursor: pointer;
    user-select: none;
    border-radius: 0 var(--fr-r-sm) var(--fr-r-sm) 0;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.sidebar-nav-item::before {
    content: "›";
    color: var(--fr-ink-3);
    font-family: var(--fr-font-serif);
    font-size: 14px;
    line-height: 1;
    margin-right: 10px;
    vertical-align: 1px;
    transition: color 120ms ease;
}
.sidebar-nav-item:hover {
    background: rgba(180, 83, 9, 0.05);
    color: var(--fr-ink);
}
.sidebar-nav-item:hover::before { color: var(--fr-accent); }
.sidebar-nav-item.active {
    background: var(--fr-accent-soft);
    color: var(--fr-ink);
    border-left-color: var(--fr-accent);
    font-weight: 600;
}
.sidebar-nav-item.active::before { color: var(--fr-accent); }

/* ── Property dropdown inside the sidebar ───────────────────────────── */
.fr-sidebar .fr-sidebar-dropdown .Select-control,
.fr-sidebar .Select-control {
    background-color: var(--fr-surface) !important;
    border: 1px solid var(--fr-hairline-strong) !important;
    border-radius: var(--fr-r-md) !important;
    min-height: 42px !important;
    height: 42px !important;
    box-shadow: none !important;
}
.fr-sidebar .Select-control:hover { border-color: var(--fr-ink-3) !important; }
.fr-sidebar .Select.is-focused:not(.is-open) > .Select-control {
    border-color: var(--fr-accent) !important;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12) !important;
}
.fr-sidebar .Select-value-label,
.fr-sidebar .Select-value .Select-value-label,
.fr-sidebar .Select-value-label * {
    color: var(--fr-ink) !important;
    font-family: var(--fr-font-sans) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
}
.fr-sidebar .Select-placeholder { color: var(--fr-ink-3) !important; }
.fr-sidebar .Select-input > input { color: var(--fr-ink) !important; }
.fr-sidebar .Select-arrow {
    border-color: var(--fr-ink-3) transparent transparent !important;
}
.fr-sidebar .Select.is-open .Select-arrow {
    border-color: transparent transparent var(--fr-ink-3) !important;
}
.fr-sidebar .Select-menu-outer {
    background-color: var(--fr-surface) !important;
    border: 1px solid var(--fr-hairline-strong) !important;
    border-radius: var(--fr-r-md) !important;
    box-shadow: 0 8px 24px rgba(20, 24, 29, 0.10) !important;
    margin-top: 4px !important;
    overflow: hidden;
}
.fr-sidebar .Select-option {
    background-color: var(--fr-surface) !important;
    color: var(--fr-ink) !important;
    font-family: var(--fr-font-sans) !important;
    padding: 9px 14px !important;
}
.fr-sidebar .Select-option:hover,
.fr-sidebar .Select-option.is-focused {
    background-color: var(--fr-accent-soft) !important;
    color: var(--fr-accent-strong) !important;
}
.fr-sidebar .Select-option.is-selected {
    background-color: var(--fr-accent-soft) !important;
    color: var(--fr-accent-strong) !important;
    font-weight: 600 !important;
}

/* ── Action buttons (Refresh data / Check new units) ────────────────── */
.fr-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--fr-hairline);
}

/* dbc.Button defaults to color="primary" which paints Bootstrap blue —
   we have to override background-color, background-image (the gradient),
   color, and border-color with !important to dislodge it. CSS variable
   overrides are kept as a secondary layer for Bootstrap 5.2+ themes. */
.fr-sidebar-btn.btn,
.fr-sidebar-btn {
    --bs-btn-color:               var(--fr-ink);
    --bs-btn-bg:                  var(--fr-surface);
    --bs-btn-border-color:        var(--fr-hairline-strong);
    --bs-btn-hover-color:         var(--fr-ink);
    --bs-btn-hover-bg:            var(--fr-surface);
    --bs-btn-hover-border-color:  var(--fr-ink-3);
    --bs-btn-focus-shadow-rgb:    180, 83, 9;

    appearance: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background-color: var(--fr-surface) !important;
    background-image: none !important;
    border: 1px solid var(--fr-hairline-strong) !important;
    color: var(--fr-ink) !important;
    border-radius: var(--fr-r-md) !important;
    padding: 10px 14px !important;
    font-family: var(--fr-font-sans) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
    text-decoration: none !important;
    box-shadow: none !important;
}
.fr-sidebar-btn:hover,
.fr-sidebar-btn:focus,
.fr-sidebar-btn:active,
.fr-sidebar-btn:focus-visible {
    background-color: var(--fr-surface) !important;
    background-image: none !important;
    border-color: var(--fr-ink-3) !important;
    color: var(--fr-ink) !important;
    outline: none !important;
}
.fr-sidebar-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.18) !important;
}
.fr-sidebar-btn-icon {
    color: var(--fr-ink-3);
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    width: 12px;
    text-align: center;
}

/* Primary — burnt amber */
.fr-sidebar-btn.fr-sidebar-btn-primary,
.fr-sidebar-btn.fr-sidebar-btn-primary.btn {
    background-color: var(--fr-accent) !important;
    background-image: none !important;
    border-color: var(--fr-accent) !important;
    color: #FDF8EE !important;
}
.fr-sidebar-btn.fr-sidebar-btn-primary:hover,
.fr-sidebar-btn.fr-sidebar-btn-primary:focus,
.fr-sidebar-btn.fr-sidebar-btn-primary:active {
    background-color: var(--fr-accent-strong) !important;
    background-image: none !important;
    border-color: var(--fr-accent-strong) !important;
    color: #FDF8EE !important;
}
.fr-sidebar-btn-primary .fr-sidebar-btn-icon { color: rgba(253, 248, 238, 0.75); }

/* Ghost — explicit surface (same as base, kept for clarity / future overrides) */
.fr-sidebar-btn.fr-sidebar-btn-ghost {
    background-color: var(--fr-surface) !important;
    background-image: none !important;
    border-color: var(--fr-hairline-strong) !important;
    color: var(--fr-ink) !important;
}

/* ── Footer (user + logout) ─────────────────────────────────────────── */
.fr-sidebar-footer {
    margin-top: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--fr-hairline);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fr-sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
}
.fr-sidebar-user-name {
    font-size: 13px;
    color: var(--fr-ink-2);
    font-weight: 500;
}
.fr-sidebar-btn.fr-sidebar-btn-quiet,
.fr-sidebar-btn.fr-sidebar-btn-quiet.btn {
    background-color: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    color: var(--fr-ink-3) !important;
}
.fr-sidebar-btn.fr-sidebar-btn-quiet:hover,
.fr-sidebar-btn.fr-sidebar-btn-quiet:focus,
.fr-sidebar-btn.fr-sidebar-btn-quiet:active {
    background-color: rgba(20, 24, 29, 0.05) !important;
    background-image: none !important;
    border-color: transparent !important;
    color: var(--fr-ink) !important;
}

/* ─────────────────────────────────────────────────────────────────────
   PROPERTY HEADER CARD
   ───────────────────────────────────────────────────────────────────── */

/* Dropdown menu must sit above unit type cards */
#property-header-card .Select-menu-outer {
    z-index: 1050 !important;
}

/* Student Lease-Up Tracker — the filter card holds cycle/compare/unit
   dropdowns above the YoY chart and tier-progress cards below it. Same
   pattern as `.executed-rents-filter-card`: lift the whole card into a
   higher stacking context AND defeat dbc.Card's default overflow:hidden
   so the dropdown menus aren't clipped by the card boundary when they
   open. The Select-menu-outer rule wins against the Plotly chart's own
   stacking context.

   CEILING: these z-indexes must stay BELOW the navigation drawer
   (`.offcanvas` = Bootstrap default 1045) and modals (backdrop 1050,
   modal 1055), otherwise the row paints on top of the expanded sidebar.
   In-page content here (charts, tables, cards) sits at the default
   stacking level, so a small lift is all that's needed. */
.student-tracker-filter-card,
.student-tracker-filter-card .card-body {
    position: relative;
    z-index: 50;
    overflow: visible !important;
}
#student-tracker-cycle-year .Select-menu-outer,
#student-tracker-compare-years .Select-menu-outer,
#student-tracker-unit-filter .Select-menu-outer {
    z-index: 60 !important;
}

/* Student Rate Manager — same dropdown-clipping fix as the Tracker filter
   card so the cycle / benchmark dropdowns float over the rate table.
   Same z-index ceiling applies (must stay below the sidebar drawer). */
.student-rate-mgr-filter-card,
.student-rate-mgr-filter-card .card-body {
    position: relative;
    z-index: 50;
    overflow: visible !important;
}
#student-rate-mgr-cycle-year .Select-menu-outer,
#student-rate-mgr-compare-years .Select-menu-outer {
    z-index: 60 !important;
}

/* Executive Dashboard / Executed Rents tab — dropdowns must float over
   the Plotly chart, table, and KPI cards rendered below the filter strip.
   Plotly graphs create their own stacking context, so a z-index on the
   Select-menu-outer alone isn't enough — we have to lift the entire
   filter card AND each dropdown wrapper into a higher stacking context
   first. .executed-rents-dropdown is set on each dcc.Dropdown; the
   filter Card wears .executed-rents-filter-card. */
.executed-rents-filter-card,
.executed-rents-filter-card .card-body {
    position: relative;
    z-index: 1100;
    overflow: visible !important;  /* defeat any default Card / CardBody overflow:hidden */
}

.executed-rents-dropdown {
    position: relative;
    z-index: 1100;
}

.executed-rents-dropdown .Select-menu-outer,
.executed-rents-dropdown .VirtualizedSelectFocusedOption,
.executed-rents-dropdown .VirtualizedSelectOption {
    z-index: 9999 !important;
}

/* Make the selected property name bold and prominent */
#property-header-card .Select-value-label,
#property-header-card .Select-value .Select-value-label {
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    color: #2c3e50 !important;
}

/* Match the dropdown control to the forecast pill style */
#property-header-card .Select-control {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    height: auto !important;
    min-height: 46px !important;
}

#property-header-card .Select-control:hover {
    border-color: #3498db !important;
}

/* Style the search input */
#property-header-card .Select-input > input {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

/* Style the dropdown placeholder */
#property-header-card .Select-placeholder {
    font-size: 1.1rem !important;
    line-height: 46px !important;
}

/* Vertically center the selected value within the control */
#property-header-card .Select-control .Select-value {
    top: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
}

/* Prevent the property header card from hovering/lifting */
#property-header-card:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06) !important;
}

/* ─────────────────────────────────────────────────────────────────────
   CARD STYLES
   ───────────────────────────────────────────────────────────────────── */

.card {
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06) !important;
    border-radius: 10px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    background-color: #ffffff !important;
}

.card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14), 0 4px 8px rgba(0,0,0,0.08) !important;
}

.card-header {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 700 !important;
    padding: 14px 20px !important;
}

.card-header h5 {
    margin: 0 !important;
    font-size: 1.5rem !important;
    letter-spacing: 0.02em !important;
}

/* Zero-availability unit type cards - more subtle appearance */
.card-zero-availability {
    opacity: 0.8 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
}

.card-zero-availability:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    opacity: 0.9 !important;
}

.card-zero-availability .card-header {
    background: linear-gradient(135deg, #6c8ea8, #5a7a94) !important;
}

.card-zero-availability .card-body {
    padding-bottom: 12px !important;
}

/* Legacy .unit-type-card styles removed — superseded by .ut-card vocabulary
   appended at the end of this file (search "UNIT TYPE PRICING CARD"). */

/* ─────────────────────────────────────────────────────────────────────
   BUTTON STYLES
   ───────────────────────────────────────────────────────────────────── */

.btn {
    border-radius: 6px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    border-color: #2980b9 !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d) !important;
    border-color: #1f618d !important;
    transform: translateY(-1px) !important;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954) !important;
    border-color: #229954 !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954, #1e8449) !important;
    border-color: #1e8449 !important;
    transform: translateY(-1px) !important;
}

.btn-outline-primary {
    border-color: #3498db !important;
    color: #3498db !important;
}

.btn-outline-primary:hover {
    background-color: #3498db !important;
    border-color: #3498db !important;
    color: white !important;
    transform: translateY(-1px) !important;
}

/* ─────────────────────────────────────────────────────────────────────
   TABLE STYLES
   ───────────────────────────────────────────────────────────────────── */

.dash-table-container {
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.dash-table-container .dash-spreadsheet-container {
    border-radius: 8px !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner {
    border-radius: 8px !important;
}

/* Table header styling */
.dash-table-container .dash-header {
    background: linear-gradient(135deg, #2c3e50, #34495e) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
}

.dash-table-container .dash-header .column-header-name {
    color: white !important;
}

/* Table cell styling */
.dash-table-container .dash-cell {
    border: 1px solid #e3e6f0 !important;
    font-size: 0.9rem !important;
    text-align: center !important;
    padding: 12px 8px !important;
}

.dash-table-container .dash-selected-cell {
    background-color: rgba(52, 152, 219, 0.1) !important;
}

/* Actions column styling */
.dash-table-container .dash-cell[data-dash-column="Actions"] {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    border: 1px solid #2980b9 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.dash-table-container .dash-cell[data-dash-column="Actions"]:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.dash-table-container .dash-cell[data-dash-column="Actions"]:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}

/* ─────────────────────────────────────────────────────────────────────
   ALERT STYLES
   ───────────────────────────────────────────────────────────────────── */

.alert {
    border: none !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
}

.alert-info {
    background: linear-gradient(135deg, #d6eaf8, #aed6f1) !important;
    color: #1b4f72 !important;
}

.alert-success {
    background: linear-gradient(135deg, #d5f4e6, #a3e4d7) !important;
    color: #0d5345 !important;
}

.alert-warning {
    background: linear-gradient(135deg, #fdeaa7, #f9e79f) !important;
    color: #7d6608 !important;
}

.alert-danger {
    background: linear-gradient(135deg, #fadbd8, #f5b7b1) !important;
    color: #922b21 !important;
}

/* ─────────────────────────────────────────────────────────────────────
   INPUT STYLES
   ───────────────────────────────────────────────────────────────────── */

.form-control {
    border-radius: 6px !important;
    border: 1px solid #d5dbdb !important;
    transition: all 0.2s ease !important;
}

.form-control:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25) !important;
}

.input-group-text {
    background-color: #ecf0f1 !important;
    border-color: #d5dbdb !important;
    color: #2c3e50 !important;
    font-weight: 500 !important;
}

/* ─────────────────────────────────────────────────────────────────────
   PLOTLY CHART STYLES
   ───────────────────────────────────────────────────────────────────── */

.js-plotly-plot {
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
    border: 1px solid #e3e6f0 !important;
    background-color: white !important;
    height: 500px !important;
    max-height: 500px !important;
    min-height: 500px !important;
}

/* Force Plotly charts to maintain fixed height */
.js-plotly-plot .plotly {
    height: 500px !important;
    max-height: 500px !important;
    min-height: 500px !important;
}

.js-plotly-plot .plotly .main-svg {
    height: 500px !important;
    max-height: 500px !important;
    min-height: 500px !important;
}

/* Prevent any dynamic resizing of Plotly charts */
.js-plotly-plot,
.js-plotly-plot * {
    transition: none !important;
    animation: none !important;
}

/* Disable Plotly's auto-resize behavior */
.js-plotly-plot .plotly {
    resize: none !important;
}

/* Force fixed dimensions */
#expiration-chart,
#gpr-forecast-chart {
    height: 500px !important;
    max-height: 500px !important;
    min-height: 500px !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Chart container styling to match card theme */
.chart-container {
    background-color: white !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
    border: 1px solid #e3e6f0 !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

/* Chart title styling */
.chart-title {
    color: #2c3e50 !important;
    font-weight: 600 !important;
    font-size: 1.2rem !important;
    text-align: center !important;
    margin-bottom: 15px !important;
}

/* ─────────────────────────────────────────────────────────────────────
   ACCORDION STYLES
   ───────────────────────────────────────────────────────────────────── */

.accordion-button {
    background-color: #34495e !important;
    color: white !important;
    border: none !important;
    font-weight: 500 !important;
}

.accordion-button:not(.collapsed) {
    background-color: #2c3e50 !important;
    color: white !important;
    box-shadow: none !important;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25) !important;
}

.accordion-body {
    background-color: #2c3e50 !important;
    color: white !important;
    border-top: 1px solid #34495e !important;
}

/* ─────────────────────────────────────────────────────────────────────
   SIDEBAR TABLE STYLES (for Pricing Parameters)
   ───────────────────────────────────────────────────────────────────── */

/* Style tables within the sidebar accordion */
.offcanvas .accordion-body table {
    background-color: #34495e !important;
    border-color: #5a6c7d !important;
    color: white !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    margin-bottom: 1rem !important;
}

.offcanvas .accordion-body table th {
    background-color: #2c3e50 !important;
    color: white !important;
    border-color: #5a6c7d !important;
    font-weight: 600 !important;
    padding: 8px 12px !important;
}

.offcanvas .accordion-body table td {
    background-color: #34495e !important;
    color: white !important;
    border-color: #5a6c7d !important;
    padding: 8px 12px !important;
}

.offcanvas .accordion-body table tr:hover td {
    background-color: #3b4a5c !important;
}

/* Style table headers specifically */
.offcanvas .accordion-body table thead th {
    background-color: #2c3e50 !important;
    color: white !important;
    border-bottom: 2px solid #5a6c7d !important;
    font-weight: 600 !important;
}

/* Style table cells */
.offcanvas .accordion-body table tbody td {
    background-color: #34495e !important;
    color: white !important;
    border-color: #5a6c7d !important;
}

/* Ensure all text in tables is white */
.offcanvas .accordion-body table * {
    color: white !important;
}

/* ─────────────────────────────────────────────────────────────────────
   LOADING ANIMATION
   ───────────────────────────────────────────────────────────────────── */

._dash-loading {
    margin: 20px auto !important;
}

._dash-loading-callback {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
}

/* ─────────────────────────────────────────────────────────────────────
   CURRENCY DISPLAY
   ───────────────────────────────────────────────────────────────────── */

.currency {
    font-weight: 600 !important;
    color: #27ae60 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.currency-large {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
}

/* ─────────────────────────────────────────────────────────────────────
   RESPONSIVE DESIGN
   ───────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem !important;
    }
    
    .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .dash-table-container {
        font-size: 0.8rem !important;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   CUSTOM UTILITY CLASSES
   ───────────────────────────────────────────────────────────────────── */

.text-gradient {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-weight: 700 !important;
}

.shadow-soft {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
}

.shadow-hover:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important;
    transform: translateY(-2px) !important;
    transition: all 0.2s ease !important;
}

.border-radius-lg {
    border-radius: 12px !important;
}

/* ─────────────────────────────────────────────────────────────────────
   ANIMATION CLASSES
   ───────────────────────────────────────────────────────────────────── */

.fade-in {
    animation: fadeIn 0.5s ease-in !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out !important;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─────────────────────────────────────────────────────────────────────
   MODAL SCROLL PREVENTION
   ───────────────────────────────────────────────────────────────────── */

/* Prevent page from scrolling to top when modals close */
.modal {
    scroll-behavior: auto !important;
}

.modal-dialog {
    scroll-behavior: auto !important;
}

/* Prevent any automatic scrolling when modals are shown/hidden */
body.modal-open {
    scroll-behavior: auto !important;
}

/* Ensure the page maintains its scroll position */
html, body {
    scroll-behavior: auto !important;
}

/* ─────────────────────────────────────────────────────────────────────
   TOOLTIP STYLES
   ───────────────────────────────────────────────────────────────────── */

/* Simple tooltip styling - just black text, let Dash handle positioning */
.dash-tooltip,
.dash-table-tooltip,
.tooltip,
[role="tooltip"],
.tooltip-inner,
.popover,
.popover-body {
    color: #000000 !important;
    font-size: 14px !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-weight: 600 !important;
    white-space: pre-line !important;
    line-height: 1.6 !important;
    max-width: 400px !important;
    padding: 12px 16px !important;
    border-radius: 6px !important;
}

/* Override Bootstrap default black tooltip background */
.tooltip-inner {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

/* Fix tooltip arrow to match white background */
.tooltip .tooltip-arrow::before,
.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #dee2e6 !important;
}
.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #dee2e6 !important;
}

/* Target all child elements within tooltips */
.dash-tooltip *,
.dash-table-tooltip *,
.tooltip *,
[role="tooltip"] *,
.tooltip-inner *,
.popover *,
.popover-body * {
    color: #000000 !important;
    font-weight: 600 !important;
}

/* Market comparison popover needs more width for the Specials column */
.popover.market-comp-popover {
    max-width: 600px !important;
}

/* ─────────────────────────────────────────────────────────────────────
   BPO INPUT - HIDE SPINNER ARROWS
   ───────────────────────────────────────────────────────────────────── */

/* Hide spinner arrows on BPO number inputs (Chrome, Safari, Edge, Opera) */
.bpo-input-no-spinner::-webkit-outer-spin-button,
.bpo-input-no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Hide spinner arrows on BPO number inputs (Firefox) */
.bpo-input-no-spinner {
    -moz-appearance: textfield;
}

/* ─────────────────────────────────────────────────────────────────────
   BEDROOM GROUP ACCORDION (New Leases grouped view, .ut-card vocabulary)
   Restyled to match the editorial Frontier aesthetic: 3px amber left
   border, serif name, mono availability count, chev-on-circle that
   rotates open. Override Bootstrap's default accordion-* classes.
   ───────────────────────────────────────────────────────────────────── */

.bedroom-group-accordion .accordion-item {
    background: var(--fr-surface) !important;
    border: 1px solid var(--fr-hairline) !important;
    border-left: 3px solid var(--fr-accent) !important;
    border-radius: var(--fr-r-md) !important;
    margin-bottom: 14px !important;
    overflow: hidden !important;
}
/* No hover state — same reasoning as .ut-card: scroll crossings would
   re-rasterize the soft shadow over a wide region per frame. */

.bedroom-group-accordion .accordion-button {
    background: var(--fr-surface) !important;
    color: var(--fr-ink) !important;
    font-family: var(--fr-font-serif) !important;
    font-size: 24px !important;
    font-weight: 400 !important;
    letter-spacing: -0.005em !important;
    padding: 18px 24px !important;
    line-height: 1 !important;
    box-shadow: none !important;
}
.bedroom-group-accordion .accordion-button:focus {
    box-shadow: none !important;
}

.bedroom-group-accordion .accordion-button:not(.collapsed) {
    background: var(--fr-surface) !important;
    color: var(--fr-ink) !important;
    box-shadow: 0 1px 0 rgba(20, 24, 29, 0.04), 0 8px 28px rgba(20, 24, 29, 0.05) !important;
}

/* Replace Bootstrap's default chev with an amber chev-on-circle. */
.bedroom-group-accordion .accordion-button::after {
    width: 30px !important;
    height: 30px !important;
    background-image: none !important;
    background: #FBF9F4 !important;
    border: 1px solid var(--fr-hairline) !important;
    border-radius: 50% !important;
    color: var(--fr-ink-2) !important;
    font-family: var(--fr-font-serif) !important;
    font-size: 18px !important;
    line-height: 28px !important;
    text-align: center !important;
    content: "›" !important;
    transform: rotate(0deg) !important;
    transition: transform 200ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease !important;
}
.bedroom-group-accordion .accordion-button:not(.collapsed)::after {
    transform: rotate(90deg) !important;
    background: var(--fr-accent-soft) !important;
    color: var(--fr-accent-strong) !important;
    border-color: rgba(180, 83, 9, 0.20) !important;
}

.bedroom-group-accordion .accordion-body {
    background: #FBF9F4 !important;
    color: inherit !important;
    border-top: 1px solid var(--fr-hairline) !important;
    padding: 18px !important;
    font-family: var(--fr-font-sans) !important;
}

/* Style the title row inside the accordion-button: serif name, then a small-
   caps unit-types count, then the right-aligned availability count. The Python
   wraps these in a flex container with class `d-flex align-items-center`. */
.bedroom-group-accordion .accordion-button .text-muted {
    color: var(--fr-hairline-strong) !important;
}
.bedroom-group-accordion .accordion-button > div {
    width: 100%;
    font-family: var(--fr-font-sans);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--fr-ink-3);
}
.bedroom-group-accordion .accordion-button > div > span:first-child {
    font-family: var(--fr-font-serif);
    font-size: 24px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.005em;
    color: var(--fr-ink);
}

/* ─────────────────────────────────────────────────────────────────────
   TRAFFIC PERIOD TOGGLE (per-card, default: 7d visible, 30d hidden)
   ───────────────────────────────────────────────────────────────────── */

.traffic-30d {
    display: none !important;
}
.traffic-7d {
    display: inline !important;
}

/* Per-card override: when wrapper has show-30d, swap visibility */
.traffic-show-30d .traffic-7d {
    display: none !important;
}
.traffic-show-30d .traffic-30d {
    display: inline !important;
}

/* ─────────────────────────────────────────────────────────────────────
   REPORTS PAGE
   ───────────────────────────────────────────────────────────────────── */

/* Override blue gradient card-header for the reports filter card */
.reports-filter-card > .card-header {
    background: #f8f9fa !important;
    color: #2c3e50 !important;
    padding: 8px 16px !important;
    border-bottom: 1px solid #dee2e6 !important;
}

/* Prevent hover-lift on the reports filter card */
.reports-filter-card:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06) !important;
}

/* Normalize Dash DatePickerSingle to match other inputs in height */
.reports-date-picker .DateInput_input {
    height: 36px !important;
    padding: 4px 10px !important;
    font-size: 0.85rem !important;
    line-height: 36px !important;
}

.reports-date-picker .SingleDatePickerInput {
    border-radius: 4px !important;
    border: 1px solid #ccc !important;
}

.reports-date-picker .DateInput {
    width: 130px !important;
}


