/* ============================================================
   Report Modern — shell, left-rail nav, breadcrumb bar
   Used in conjunction with body.report-flat (which switches
   report surfaces from glass to solid white).
   ============================================================ */

:root {
    --rm-rail-width: 220px;
    --rm-card-bg: #ffffff;
    --rm-card-border: rgba(15, 23, 42, 0.06);
    --rm-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                      0 4px 12px -6px rgba(15, 23, 42, 0.10);
    --rm-card-radius: 14px;
    --rm-accent: #1e3a5f;
    --rm-accent-tint: rgba(30, 58, 95, 0.08);
    --rm-text-primary: #0f172a;
    --rm-text-muted: #64748b;
    --rm-text-faint:  #94a3b8;
    --rm-border: rgba(15, 23, 42, 0.08);
}

/* ----------------------------------------------------------------
   Sticky breadcrumb header
   ---------------------------------------------------------------- */
.report-breadcrumb {
    position: sticky;
    top: 0;
    z-index: 25;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
            backdrop-filter: blur(16px) saturate(170%);
    border-bottom: 1px solid var(--rm-border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.report-breadcrumb__crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--rm-text-muted);
    min-width: 0;
}

.report-breadcrumb__crumbs a {
    color: #2563eb;
    text-decoration: none;
}
.report-breadcrumb__crumbs a:hover { text-decoration: underline; }

.report-breadcrumb__sep {
    color: #cbd5e1;
    font-size: 12px;
}

.report-breadcrumb__current {
    color: var(--rm-text-primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60ch;
}

.report-breadcrumb__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.report-breadcrumb__btn {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid var(--rm-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #475569;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}
.report-breadcrumb__btn:hover {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.14);
    color: var(--rm-text-primary);
}

/* ----------------------------------------------------------------
   Shell layout: rail + main
   ---------------------------------------------------------------- */
.report-shell {
    display: grid;
    grid-template-columns: var(--rm-rail-width) 1fr;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    gap: 24px;
    align-items: start;
}

/* ----------------------------------------------------------------
   Left rail nav
   ---------------------------------------------------------------- */
.report-rail {
    position: sticky;
    top: 60px; /* sits just below the ~56px breadcrumb bar */
    background: var(--rm-card-bg);
    border: 1px solid var(--rm-card-border);
    border-radius: var(--rm-card-radius);
    box-shadow: var(--rm-card-shadow);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
}

.report-rail__heading {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rm-text-faint);
    padding: 10px 12px 6px;
}

.report-rail__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
    text-align: left;
    width: 100%;
    font-family: inherit;
    position: relative;
}

.report-rail__item:hover {
    background: var(--rm-accent-tint);
    color: var(--rm-text-primary);
}

.report-rail__item.active {
    background: var(--rm-accent-tint);
    color: var(--rm-accent);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--rm-accent);
}

.report-rail__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 1.75;
}

.report-rail__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----------------------------------------------------------------
   Main content column
   ---------------------------------------------------------------- */
.report-main {
    min-width: 0;
}

/* ----------------------------------------------------------------
   Mobile: collapse rail to horizontal scroll strip
   ---------------------------------------------------------------- */
@media (max-width: 767px) {
    .report-shell {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
    .report-rail {
        position: sticky;
        top: 56px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
        padding: 6px;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .report-rail__heading { display: none; }
    .report-rail__item {
        white-space: nowrap;
        flex-shrink: 0;
    }
    .report-rail__item.active {
        background: var(--rm-accent);
        color: #ffffff;
        box-shadow: none;
    }
}

/* ----------------------------------------------------------------
   Dark mode
   ---------------------------------------------------------------- */
html.dark .report-breadcrumb {
    background: rgba(15, 23, 42, 0.85);
    border-bottom-color: #334155;
}
html.dark .report-breadcrumb__crumbs { color: #94a3b8; }
html.dark .report-breadcrumb__crumbs a { color: #60a5fa; }
html.dark .report-breadcrumb__current { color: #f1f5f9; }
html.dark .report-breadcrumb__sep { color: #475569; }
html.dark .report-breadcrumb__btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: #334155;
    color: #cbd5e1;
}
html.dark .report-breadcrumb__btn:hover {
    background: #334155;
    color: #f1f5f9;
}

html.dark .report-rail {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 2px rgba(0,0,0,0.30), 0 6px 18px -6px rgba(0,0,0,0.40);
}
html.dark .report-rail__item { color: #cbd5e1; }
html.dark .report-rail__item:hover {
    background: #334155;
    color: #f1f5f9;
}
html.dark .report-rail__item.active {
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
    box-shadow: inset 3px 0 0 #60a5fa;
}
html.dark .report-rail__heading { color: #64748b; }

/* ================================================================
   M2 — Hero stat tiles + 3-up panel row + chains split + demo snapshot
   Used inside body.report-flat for the redesigned overview.
   ================================================================ */

/* ---------- Hero stat tiles (4-up grid) ---------- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.stat-row--2 { grid-template-columns: repeat(2, 1fr); }
.stat-row--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1023px) {
    .stat-row,
    .stat-row--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .stat-row,
    .stat-row--2,
    .stat-row--3 { grid-template-columns: 1fr; }
}

.stat-tile {
    background: var(--rm-card-bg);
    border: 1px solid var(--rm-card-border);
    border-radius: var(--rm-card-radius);
    box-shadow: var(--rm-card-shadow);
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: box-shadow .25s ease, transform .25s ease;
}
.stat-tile:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 12px 24px -10px rgba(15, 23, 42, 0.18);
}

.stat-tile__chip {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 4px;
}
.stat-tile__chip svg { width: 18px; height: 18px; }

.stat-tile__value {
    font-family: 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--rm-text-primary);
}

.stat-tile__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--rm-text-muted);
}

.stat-tile__sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--rm-text-faint);
    margin-top: 2px;
}

/* Pastel tones — pastel chip background, deeper foreground for icon */
.stat-tile[data-tone="indigo"]  .stat-tile__chip { background: #EEF0FE; color: #4F46E5; }
.stat-tile[data-tone="amber"]   .stat-tile__chip { background: #FEF3C7; color: #B45309; }
.stat-tile[data-tone="teal"]    .stat-tile__chip { background: #CCFBF1; color: #0F766E; }
.stat-tile[data-tone="emerald"] .stat-tile__chip { background: #D1FAE5; color: #047857; }
.stat-tile[data-tone="rose"]    .stat-tile__chip { background: #FFE4E6; color: #BE123C; }
.stat-tile[data-tone="sky"]     .stat-tile__chip { background: #E0F2FE; color: #0369A1; }
.stat-tile[data-tone="violet"]  .stat-tile__chip { background: #EDE9FE; color: #6D28D9; }

/* Optional delta chip (M4 ready, unused for now) */
.stat-tile__delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    width: max-content;
}
.stat-tile__delta--up   { background: #D1FAE5; color: #047857; }
.stat-tile__delta--down { background: #FEE2E2; color: #B91C1C; }

/* ---------- 3-up panel row ---------- */
.panel-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 1280px) {
    .panel-row { grid-template-columns: repeat(2, 1fr); }
    .panel-row > .panel:first-child { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
    .panel-row { grid-template-columns: 1fr; }
    .panel-row > .panel:first-child { grid-column: auto; }
}

/* Panel polish (used inside .report-flat) */
body.report-flat .panel {
    border-radius: var(--rm-card-radius) !important;
    margin-bottom: 0; /* row gap handles spacing in panel-row */
}
body.report-flat .panel-row .panel {
    display: flex;
    flex-direction: column;
}
body.report-flat .panel-row .panel-body {
    flex: 1;
}
body.report-flat .panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--rm-card-border) !important;
}
body.report-flat .panel-title h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--rm-text-primary);
    letter-spacing: -0.01em;
}
body.report-flat .panel-title .subtitle {
    font-size: 12px;
    color: var(--rm-text-faint);
    font-weight: 500;
    margin-left: 0;
    display: block;
    margin-top: 2px;
}
body.report-flat .panel-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

/* ---------- Top Categories (catBars restyle) ---------- */
body.report-flat #catBars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
body.report-flat .cat-bar-row {
    display: grid;
    grid-template-columns: 130px 1fr 36px;
    align-items: center;
    gap: 10px;
}
body.report-flat .cat-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--rm-text-primary) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.report-flat .cat-bar-outer {
    height: 8px;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
body.report-flat .cat-bar-inner {
    height: 100%;
    border-radius: 999px;
    transition: width .6s cubic-bezier(.4, 0, .2, 1);
}
body.report-flat .cat-bar-count {
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--rm-text-primary);
    text-align: right;
}

/* ---------- Chains vs Independents split ---------- */
.chains-split {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.chains-split__bar {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.06);
}
.chains-split__seg {
    height: 100%;
    transition: width .6s cubic-bezier(.4, 0, .2, 1);
    min-width: 4px;
}
.chains-split__seg--chain { background: #4F46E5; }
.chains-split__seg--indie { background: #14B8A6; }

.chains-split__legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.chains-split__leg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(79, 70, 229, 0.04);
    border-radius: 10px;
}
.chains-split__leg--indie {
    background: rgba(20, 184, 166, 0.06);
}
.chains-split__leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}
.chains-split__leg-dot--chain { background: #4F46E5; }
.chains-split__leg-dot--indie { background: #14B8A6; }
.chains-split__leg-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--rm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.chains-split__leg-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--rm-text-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.chains-split__leg-pct {
    font-size: 11px;
    color: var(--rm-text-faint);
    font-weight: 500;
}
.chains-split__ratio {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 8px;
    border-top: 1px solid var(--rm-card-border);
    font-size: 12px;
    color: var(--rm-text-muted);
}
.chains-split__ratio b {
    color: var(--rm-text-primary);
    font-weight: 700;
}

/* ---------- Demographics snapshot ---------- */
.demo-snapshot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.demo-snapshot__cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.demo-snapshot__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--rm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.demo-snapshot__value {
    font-size: 22px;
    font-weight: 800;
    color: var(--rm-text-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.demo-snapshot__sub {
    font-size: 11px;
    color: var(--rm-text-faint);
    font-weight: 500;
}

/* ---------- Dark-mode tone overrides ---------- */
html.dark .stat-tile {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 2px rgba(0,0,0,0.30), 0 6px 18px -6px rgba(0,0,0,0.40);
}
html.dark .stat-tile__value,
html.dark .demo-snapshot__value,
html.dark .chains-split__leg-value,
html.dark .chains-split__ratio b { color: #f1f5f9; }
html.dark .stat-tile__label,
html.dark .chains-split__leg-label,
html.dark .demo-snapshot__label,
html.dark .chains-split__ratio { color: #94a3b8; }
html.dark body.report-flat .cat-bar-outer { background: rgba(255,255,255,0.08); }
html.dark body.report-flat .cat-bar-label,
html.dark body.report-flat .cat-bar-count { color: #e2e8f0 !important; }
html.dark body.report-flat .panel-title h3 { color: #f1f5f9; }
html.dark body.report-flat .panel-title .subtitle,
html.dark .demo-snapshot__sub,
html.dark .chains-split__leg-pct { color: #64748b; }
html.dark .chains-split__bar { background: rgba(255,255,255,0.08); }
html.dark .chains-split__leg { background: rgba(99, 102, 241, 0.10); }
html.dark .chains-split__leg--indie { background: rgba(20, 184, 166, 0.10); }
html.dark .chains-split__ratio { border-top-color: #334155; }

/* Tone chip dark-mode */
html.dark .stat-tile[data-tone="indigo"]  .stat-tile__chip { background: rgba(79, 70, 229, 0.18); color: #a5b4fc; }
html.dark .stat-tile[data-tone="amber"]   .stat-tile__chip { background: rgba(180, 83, 9, 0.20);  color: #fcd34d; }
html.dark .stat-tile[data-tone="teal"]    .stat-tile__chip { background: rgba(15, 118, 110, 0.20); color: #5eead4; }
html.dark .stat-tile[data-tone="emerald"] .stat-tile__chip { background: rgba(4, 120, 87, 0.20);  color: #6ee7b7; }
html.dark .stat-tile[data-tone="rose"]    .stat-tile__chip { background: rgba(190, 18, 60, 0.20); color: #fda4af; }
html.dark .stat-tile[data-tone="sky"]     .stat-tile__chip { background: rgba(3, 105, 161, 0.20); color: #7dd3fc; }
html.dark .stat-tile[data-tone="violet"]  .stat-tile__chip { background: rgba(109, 40, 217, 0.20); color: #c4b5fd; }

/* ================================================================
   M3 — chart-box polish + chart palette tokens
   Used inside body.report-flat for all remaining tabs.
   ================================================================ */

/* ---------- Chart palette (CSS custom props consumed by JS) ---------- */
:root {
    --rm-chart-1: #4F46E5; /* indigo */
    --rm-chart-2: #14B8A6; /* teal */
    --rm-chart-3: #F59E0B; /* amber */
    --rm-chart-4: #EC4899; /* pink */
    --rm-chart-5: #0EA5E9; /* sky */
    --rm-chart-6: #84CC16; /* lime */
    --rm-chart-grid: rgba(15, 23, 42, 0.06);
    --rm-chart-axis: #94a3b8;
}

html.dark {
    --rm-chart-grid: rgba(255, 255, 255, 0.08);
    --rm-chart-axis: #64748b;
}

/* ---------- chart-box polished as a panel card in flat mode ---------- */
body.report-flat .chart-box {
    background: var(--rm-card-bg);
    border: 1px solid var(--rm-card-border);
    border-radius: var(--rm-card-radius);
    box-shadow: var(--rm-card-shadow);
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.report-flat .chart-box h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--rm-text-primary);
    letter-spacing: -0.01em;
    margin: 0;
}

body.report-flat .chart-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 768px) {
    body.report-flat .chart-row { grid-template-columns: 1fr; }
}

body.report-flat .chart-container {
    height: 240px;
    position: relative;
}

/* Dark-mode chart-box */
html.dark body.report-flat .chart-box {
    background: #1e293b;
    border-color: #334155;
}
html.dark body.report-flat .chart-box h4 { color: #f1f5f9; }

/* ================================================================
   Settings + Admin pages — card hover lift on section panels
   ================================================================ */
body.page-settings .bg-white.rounded-xl,
body.page-admin .bg-white.rounded-xl {
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
body.page-settings .bg-white.rounded-xl:hover,
body.page-admin .bg-white.rounded-xl:hover {
    transform: translateY(-1px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 12px 24px -10px rgba(15, 23, 42, 0.16);
    border-color: rgba(15, 23, 42, 0.10);
}
/* Skip lift for modals (which use rounded-2xl, not rounded-xl) — already not matched */

/* ================================================================
   reports.html launcher — card hover lift + cleaner pastel chips
   ================================================================ */
body.reports-launcher .grid > .bg-white {
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
body.reports-launcher .grid > .bg-white:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 16px 32px -12px rgba(15, 23, 42, 0.18);
    border-color: rgba(15, 23, 42, 0.10);
}

/* ================================================================
   Unified report tab layout — single-column vertical rhythm.

   Every tab across all report types (property, office, retail,
   commercial) stacks its blocks full-width with ONE consistent gap.
   Full-width cards + internally multi-column data grids give the
   spacious, uniform "presentation" look — and eliminate the uneven
   whitespace a forced 2-col grid produces when a short panel sits
   next to a tall table.

   Paired 2-column layouts are opt-in via `.panel-row` / `.chart-row`
   (self-contained internal grids of similarly-sized children), so
   they still work without leaving orphan gaps.
   ================================================================ */
body.report-property .tab-section.active,
body.report-office .tab-section.active,
body.report-retail .tab-section.active,
body.report-commercial .tab-section.active {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}

/* Every direct child fills the full content width, gap owns spacing */
body.report-property .tab-section.active > *,
body.report-office .tab-section.active > *,
body.report-retail .tab-section.active > *,
body.report-commercial .tab-section.active > * {
    width: 100%;
    max-width: 100%;
    margin: 0;
    grid-column: auto;
}

/* Reset any legacy per-panel margins — the flex gap is the single
   source of vertical spacing so every block is evenly separated */
body.report-property .tab-section.active .panel,
body.report-office .tab-section.active .panel,
body.report-retail .tab-section.active .panel,
body.report-commercial .tab-section.active .panel,
body.report-property .tab-section.active .drag-block,
body.report-office .tab-section.active .drag-block,
body.report-retail .tab-section.active .drag-block,
body.report-commercial .tab-section.active .drag-block {
    margin-bottom: 0 !important;
}

/* ================================================================
   Dashboard — pulsing "Live" indicator dot for real-time stat tiles
   ================================================================ */
.dashboard-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #10B981;
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    animation: dashboard-live-pulse 2.2s ease-out infinite;
    vertical-align: 1px;
}

@keyframes dashboard-live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
    70%  { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-live-dot { animation: none; }
}

/* ================================================================
   Hero-stat upgrade (Item 2) — applies to existing .hero-stat blocks
   across Property/Office/Retail/Commercial reports without HTML changes.
   Renders them with stat-tile-grade typography + hover lift in flat mode.
   ================================================================ */
body.report-flat .hero-stat {
    padding: 18px 20px 20px !important;
    border-radius: 14px !important;
    transition: box-shadow .25s ease, transform .25s ease;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
}
body.report-flat .hero-stat:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 12px 24px -10px rgba(15, 23, 42, 0.18) !important;
}
body.report-flat .hero-stat-value {
    font-size: 28px !important;
    font-weight: 800 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    letter-spacing: -0.02em !important;
    color: var(--rm-text-primary, #0f172a) !important;
    line-height: 1.08 !important;
    margin-top: 2px;
}
body.report-flat .hero-stat-label {
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    color: var(--rm-text-muted, #64748b) !important;
    letter-spacing: 0.06em !important;
    margin-bottom: 0 !important;
}

/* Color accent reflects existing dcv-* utility classes used on the value */
body.report-flat .hero-stat:has(.dcv-blue)      { box-shadow: var(--rm-card-shadow), inset 3px 0 0 #4F46E5 !important; }
body.report-flat .hero-stat:has(.dcv-green)     { box-shadow: var(--rm-card-shadow), inset 3px 0 0 #10B981 !important; }
body.report-flat .hero-stat:has(.dcv-amber)     { box-shadow: var(--rm-card-shadow), inset 3px 0 0 #F59E0B !important; }
body.report-flat .hero-stat:has(.dcv-highlight) { box-shadow: var(--rm-card-shadow), inset 3px 0 0 #14B8A6 !important; }

html.dark body.report-flat .hero-stat-value { color: #f1f5f9 !important; }
html.dark body.report-flat .hero-stat-label { color: #94a3b8 !important; }

/* ================================================================
   M4 — empty state component
   ================================================================ */
.panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 20px;
    color: var(--rm-text-faint);
    gap: 8px;
}
.panel-empty__icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.05);
    color: var(--rm-text-muted);
}
.panel-empty__icon svg { width: 18px; height: 18px; }
.panel-empty__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--rm-text-muted);
}
.panel-empty__msg {
    font-size: 12px;
    color: var(--rm-text-faint);
    max-width: 32ch;
    line-height: 1.5;
}
html.dark .panel-empty__icon { background: rgba(255, 255, 255, 0.06); color: #94a3b8; }
html.dark .panel-empty__title { color: #cbd5e1; }
html.dark .panel-empty__msg { color: #64748b; }

/* ================================================================
   M4 — breadcrumb actions: Share button copy-feedback state
   ================================================================ */
.report-breadcrumb__btn {
    display: inline-flex;
    align-items: center;
}
.report-breadcrumb__btn svg { flex-shrink: 0; }

/* ================================================================
   M4 — PROFESSIONAL PDF PRINT STYLESHEET
   Renders every report as a beautiful, presentation-quality PDF
   when the user chooses File → Print → Save as PDF.
   ================================================================ */

/* ── Page setup ── */
@page {
    size: letter portrait;
    margin: 18mm 16mm 20mm 16mm;
    @bottom-center {
        content: "American Real Estate Centers  ·  Confidential  ·  Page " counter(page) " of " counter(pages);
        font-size: 8pt;
        color: #94a3b8;
        font-family: 'Inter', Arial, sans-serif;
    }
}
@page :first {
    margin-top: 0;
}

@media print {
    /* ── Reset ambient chrome ── */
    *,
    *::before,
    *::after { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

    /* ── Hide all interactive / navigation chrome ── */
    .no-print,
    .report-rail,
    .report-breadcrumb,
    .drag-handle,
    .template-toolbar,
    .footer-btn,
    .map-expand-btn,
    .nri-map-expand-btn,
    .nri-map-close-btn,
    .crime-map-expand-btn,
    .crime-map-close-btn,
    .prop-crime-map-expand-btn,
    .prop-crime-map-close-btn,
    .map-toggle-bar,
    .popup-run-report-row,
    .ai-badge,
    header,
    aside.sidebar,
    #loadingOverlay,
    #reportNameModal,
    [id*="Modal"],
    [id*="modal"],
    [id*="Overlay"],
    [id*="overlay"],
    #toastContainer { display: none !important; }

    /* ── Body / page canvas ── */
    html, body {
        background: #ffffff !important;
        color: #0f172a !important;
        font-size: 11pt !important;
        line-height: 1.5 !important;
        animation: none !important;
    }
    body::before, body::after { display: none !important; }

    /* ── Layout — collapse shell to full-width single column ── */
    .report-shell {
        display: block !important;
        padding: 0 !important;
        max-width: 100% !important;
        gap: 0 !important;
    }
    .report-main { min-width: 0 !important; width: 100% !important; }
    .flex, .flex-col, .flex-1 { display: block !important; }
    .sticky { position: static !important; }
    .overflow-y-auto, .overflow-hidden { overflow: visible !important; }

    /* ── COVER PAGE — print-only banner at very top ── */
    .print-cover {
        display: block !important;
        page-break-after: always;
        break-after: page;
        text-align: center;
        padding: 80px 40px 60px;
        background: linear-gradient(160deg, #1e3a5f 0%, #2563eb 60%, #0ea5e9 100%) !important;
        color: #ffffff !important;
        min-height: 100vh;
        box-sizing: border-box;
        position: relative;
    }
    .print-cover::after {
        content: '';
        position: absolute;
        bottom: 0; left: 0; right: 0; height: 6px;
        background: linear-gradient(90deg, #b3882f, #d8bc72, #b3882f);
    }

    /* ── All tabs: force visible for print ── */
    .tab-section { display: block !important; animation: none !important; }

    /* ── Section breaks between tabs ── */
    .tab-section + .tab-section {
        page-break-before: always;
        break-before: page;
        padding-top: 0 !important;
    }

    /* ── Section heading strip ── */
    .tab-section::before {
        content: attr(data-print-title);
        display: block;
        font-size: 9pt;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #1e3a5f !important;
        border-bottom: 2px solid #1e3a5f;
        padding-bottom: 5px;
        margin-bottom: 18px;
    }

    /* ── Cards / panels ── */
    .panel,
    .chart-box,
    .bg-white,
    [class*="rounded-xl"],
    [class*="rounded-lg"] {
        page-break-inside: avoid;
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #d1d9e8 !important;
        border-radius: 6px !important;
        margin-bottom: 14px !important;
        background: #ffffff !important;
    }

    /* ── Stat / exec rows ── */
    .stat-row,
    .stat-row--2,
    .stat-row--3,
    .exec-grid,
    .hero-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        page-break-inside: avoid;
    }
    .stat-tile,
    .exec-card,
    .hero-stat {
        box-shadow: none !important;
        border: 1px solid #d1d9e8 !important;
        background: #f8fafc !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .stat-tile__chip { display: none !important; }
    .stat-tile__value,
    .exec-val { font-size: 18pt !important; }
    .exec-label, .stat-tile__label { font-size: 8pt !important; color: #64748b !important; }

    /* ── Panel rows / multi-column grids ── */
    .panel-row,
    .chart-row,
    .grid-cols-2,
    [class*="grid-cols"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* ── Data grids ── */
    .data-grid {
        background: #cbd5e1 !important;
        border-radius: 6px !important;
        page-break-inside: avoid;
    }
    .data-cell { background: #ffffff !important; }
    .data-cell-label { color: #64748b !important; }
    .data-cell-value { color: #0f172a !important; }

    /* ── Charts: fixed print height so they render ── */
    .chart-container,
    canvas {
        height: 180px !important;
        max-height: 180px !important;
        page-break-inside: avoid;
    }

    /* ── AI insights panel: keep it visible but flatten ── */
    .ai-insights {
        background: #1e3a5f !important;
        color: #ffffff !important;
        border-radius: 6px !important;
        page-break-inside: avoid;
    }
    .ai-highlights { grid-template-columns: 1fr 1fr !important; }
    .ai-highlight { background: rgba(0,0,0,0.18) !important; }

    /* ── Tables ── */
    .data-table {
        font-size: 9pt !important;
        page-break-inside: auto;
    }
    .data-table thead th {
        background: #f1f5f9 !important;
        color: #1e293b !important;
        border-bottom: 2px solid #cbd5e1 !important;
    }
    .data-table tbody td { border-bottom: 1px solid #e2e8f0 !important; }
    .data-table tbody tr:nth-child(even) td { background: #f8fafc !important; }

    /* ── Equity / progress bars ── */
    .equity-bar-fill,
    .data-bar-fill {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }

    /* ── Risk items ── */
    .risk-item { background: #f8fafc !important; }
    .risk-item.low { border-left-color: #10b981 !important; }
    .risk-item.medium { border-left-color: #f59e0b !important; }
    .risk-item.high { border-left-color: #ef4444 !important; }

    /* ── Maps: fix height for print (satellite tiles do render in PDF) ── */
    .map-section,
    .area-map-section,
    .nri-map-wrap,
    .crime-map-wrap,
    .prop-crime-map-wrap {
        height: 280px !important;
        max-height: 280px !important;
        page-break-inside: avoid;
        overflow: hidden !important;
    }

    /* ── Grade ring / score ring ── */
    .grade-ring { width: 90px !important; height: 90px !important; }
    .grade-letter { font-size: 30px !important; }

    /* ── Headings ── */
    h1 { font-size: 20pt !important; color: #1e3a5f !important; }
    h2 { font-size: 15pt !important; color: #1e3a5f !important; }
    h3 { font-size: 12pt !important; color: #1e3a5f !important; }
    h4 { font-size: 10pt !important; color: #334155 !important; }

    /* ── Portal links: show URLs in parentheses ── */
    .portal-link::after { content: ''; }
    a[href]::after { content: none; }

    /* ── Dark mode: force light for print ── */
    html.dark body,
    html.dark .panel,
    html.dark .chart-box,
    html.dark .data-cell,
    html.dark .exec-card,
    html.dark .hero-stat,
    html.dark .stat-tile {
        background: #ffffff !important;
        color: #0f172a !important;
        border-color: #d1d9e8 !important;
    }
    html.dark h1, html.dark h2, html.dark h3, html.dark h4 { color: #1e3a5f !important; }
    html.dark .data-cell-label, html.dark .exec-label { color: #64748b !important; }
    html.dark .data-cell-value, html.dark .exec-val { color: #0f172a !important; }
}

/* ============================================================
   TAB TRANSITION ANIMATIONS
   ============================================================ */
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tab-section.active {
    animation: tabFadeIn 180ms ease;
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.skeleton-cell {
    border-radius: 6px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    min-height: 18px;
}

.skeleton-cell.skeleton-label {
    width: 55%;
    min-height: 14px;
    margin-bottom: 4px;
}

.skeleton-cell.skeleton-value {
    width: 35%;
    min-height: 22px;
}

.skeleton-cell.skeleton-row {
    width: 100%;
    min-height: 36px;
    margin-bottom: 6px;
}

/* Dark mode skeletons */
html.dark .skeleton-cell {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 600px 100%;
}

/* ============================================================
   MICRO-INTERACTIONS — exec cards, hero stats, panels
   ============================================================ */
.exec-card {
    transition: transform 150ms ease, box-shadow 150ms ease !important;
}
.exec-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.13) !important;
}

.hero-stat {
    transition: transform 150ms ease, box-shadow 150ms ease !important;
}
.hero-stat:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.10) !important;
}

/* stat-tile already has hover via report-modern core; re-affirm with token */
.stat-tile {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast) !important;
}

/* ============================================================
   BREADCRUMB SCROLL STATE
   Adds a stronger bottom border only when user has scrolled
   past the top sentinel. JS adds .is-scrolled via
   IntersectionObserver on #scroll-sentinel.
   ============================================================ */
.report-breadcrumb {
    transition: border-bottom-color 200ms ease, box-shadow 200ms ease;
}
.report-breadcrumb.is-scrolled {
    border-bottom-color: rgba(15,23,42,0.14) !important;
    box-shadow: 0 2px 12px rgba(15,23,42,0.08);
}
html.dark .report-breadcrumb.is-scrolled {
    border-bottom-color: #475569 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

/* ============================================================
   MOBILE RAIL DRAWER
   On narrow screens the horizontal strip is replaced by a
   hamburger button + slide-in overlay drawer.
   ============================================================ */
.rail-drawer-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--rm-border);
    border-radius: 8px;
    background: rgba(255,255,255,0.7);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 150ms ease;
}
.rail-drawer-toggle:hover { background: #ffffff; }
html.dark .rail-drawer-toggle {
    background: rgba(30,41,59,0.7);
    border-color: #334155;
    color: #cbd5e1;
}
html.dark .rail-drawer-toggle:hover { background: #334155; }

.rail-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0,0,0,0.4);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: backdropFadeIn 200ms ease;
}
@keyframes backdropFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.rail-drawer-backdrop.open { display: block; }

.rail-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 41;
    width: 260px;
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 250ms cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    padding: 16px 10px;
}
html.dark .rail-drawer {
    background: #1e293b;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
}
.rail-drawer.open { transform: translateX(0); }

.rail-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 14px;
    border-bottom: 1px solid var(--rm-border);
    margin-bottom: 8px;
}
html.dark .rail-drawer__header { border-bottom-color: #334155; }
.rail-drawer__title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rm-text-faint);
}
.rail-drawer__close {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 150ms ease, color 150ms ease;
}
.rail-drawer__close:hover { background: #f1f5f9; color: #0f172a; }
html.dark .rail-drawer__close:hover { background: #334155; color: #f1f5f9; }

@media (max-width: 767px) {
    .rail-drawer-toggle { display: flex; }
    .report-rail { display: none !important; }
}

/* ============================================================
   DELTA INDICATORS — colored +/- badges on data-cell values
   ============================================================ */
.delta-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}
.delta-badge--pos {
    background: #dcfce7;
    color: #15803d;
}
.delta-badge--neg {
    background: #fee2e2;
    color: #b91c1c;
}
html.dark .delta-badge--pos { background: #14532d; color: #86efac; }
html.dark .delta-badge--neg { background: #7f1d1d; color: #fca5a5; }

/* ============================================================
   EMPTY STATE ILLUSTRATIONS
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    gap: 12px;
    text-align: center;
    color: var(--rm-text-faint);
}
.empty-state__icon {
    width: 48px;
    height: 48px;
    opacity: 0.35;
}
.empty-state__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--rm-text-muted);
}
.empty-state__sub {
    font-size: 12px;
    color: var(--rm-text-faint);
    max-width: 240px;
    line-height: 1.5;
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
body {
    animation: pageFadeIn 220ms ease;
}
body.page-exit {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}

/* ============================================================
   TYPOGRAPHY SCALE — utility classes that mirror design-token vars
   ============================================================ */
.text-display    { font-size: clamp(28px, 4vw, 48px);  font-weight: 800; line-height: 1.1;  letter-spacing: -0.02em; }
.text-heading    { font-size: clamp(20px, 3vw, 32px);  font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.text-subheading { font-size: clamp(16px, 2vw, 22px);  font-weight: 600; line-height: 1.3;  }
.text-body       { font-size: 14px;  font-weight: 400; line-height: 1.55; }
.text-caption    { font-size: 12px;  font-weight: 500; line-height: 1.4;  color: var(--rm-text-muted); }
.text-micro      { font-size: 10px;  font-weight: 600; line-height: 1.3;  letter-spacing: 0.08em; text-transform: uppercase; color: var(--rm-text-faint); }
