/* ==========================================================================
   Mirage Floors · LME dealer brand presence audit — mockup
   Tokens follow the dealer portal / BI platform light editorial system:
   warm paper canvas, ink typography, restrained gold, fine hairlines.
   ========================================================================== */

* { box-sizing: border-box; }

:root {
    --canvas: #faf8f2;
    --paper: #ffffff;
    --inset: #f4f0e4;
    --ink: #191816;
    --navy: #455970;
    --muted: rgba(25, 24, 22, 0.62);
    --faint: rgba(25, 24, 22, 0.42);
    --line: rgba(25, 24, 22, 0.12);
    --line-strong: rgba(25, 24, 22, 0.24);
    --gold: #b29f55;
    --gold-deep: #a18f5f;
    --gold-pale: #f4f0df;
    --teal: #5f7f7c;
    --green: #27ae60;
    --green-pale: #e6f5ec;
    --amber: #c98a1a;
    --amber-pale: #fbf1dc;
    --red: #b8433c;
    --red-pale: #f8e6e4;
    --shadow: 0 18px 50px rgba(43, 40, 31, 0.10);
    --shadow-sm: 0 6px 18px rgba(43, 40, 31, 0.06);
    --radius: 4px;
    --font: 'Poppins', 'Avenir Next', Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--canvas);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    font-size: 14px;
}

a { color: inherit; }
button, select, input { font: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0; }

.container { width: min(1240px, calc(100% - 3rem)); margin: 0 auto; }

/* --------------------------------------------------------------------------
   Header / footer
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 10;
    background: rgba(250, 248, 242, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; }
.brand-logo { height: 30px; width: auto; }
.brand-name { font-size: 0.9rem; color: var(--muted); }
.brand-name b { color: var(--ink); font-weight: 600; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.nav-link { font-size: 0.82rem; text-decoration: none; color: var(--muted); padding: 0.35rem 0; border-bottom: 1px solid transparent; }
.nav-link.active { color: var(--ink); border-bottom-color: var(--gold); }
.mock-pill {
    font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 0.25rem 0.6rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted);
}
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 1.5rem 0 2.5rem; color: var(--faint); font-size: 0.78rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Page hero
   -------------------------------------------------------------------------- */
.hero { padding: 2.75rem 0 1.5rem; }
.eyebrow { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; margin-bottom: 0.6rem; }
.hero h1 { font-size: 2rem; line-height: 1.15; font-weight: 500; max-width: 720px; }
.hero .lede { color: var(--muted); max-width: 720px; margin-top: 0.75rem; font-size: 0.95rem; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 1.5rem; color: var(--muted); font-size: 0.8rem; }
.hero-meta b { display: block; color: var(--ink); font-size: 1.05rem; font-weight: 500; }

/* --------------------------------------------------------------------------
   Buttons / toolbar
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 0.95rem; border-radius: var(--radius); border: 1px solid var(--line-strong);
    background: var(--paper); color: var(--ink); text-decoration: none; font-size: 0.82rem; cursor: pointer;
}
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn.sm { padding: 0.35rem 0.7rem; font-size: 0.76rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
    padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
    font-size: 0.78rem; color: var(--muted); cursor: pointer;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { display: flex; align-items: center; gap: 0.5rem; border: 1px solid var(--line); background: var(--paper); padding: 0.45rem 0.8rem; border-radius: var(--radius); min-width: 240px; color: var(--faint); font-size: 0.82rem; }

/* --------------------------------------------------------------------------
   Stat tiles
   -------------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-top: 1.75rem; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }
.tile .label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tile .value { font-size: 1.9rem; font-weight: 500; line-height: 1.1; margin-top: 0.35rem; }
.tile .value small { font-size: 0.9rem; color: var(--faint); font-weight: 400; margin-left: 0.2rem; }
.tile .sub { font-size: 0.76rem; color: var(--muted); margin-top: 0.35rem; }
.tile.accent { border-top: 3px solid var(--gold); }
.tile.good .value { color: var(--green); }
.tile.warn .value { color: var(--amber); }
.tile.bad .value { color: var(--red); }

/* --------------------------------------------------------------------------
   Sections / panels
   -------------------------------------------------------------------------- */
.section { margin-top: 2.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.section-head h2 { font-size: 1.15rem; }
.section-head p { color: var(--muted); font-size: 0.85rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-body { padding: 1.25rem 1.4rem; }
.panel-head { padding: 0.9rem 1.4rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.panel-head h3 { font-size: 0.95rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }

/* --------------------------------------------------------------------------
   Roster table
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.roster { width: 100%; border-collapse: collapse; font-size: 0.83rem; min-width: 960px; }
.roster th { text-align: left; font-weight: 500; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.roster td { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.roster tr:hover td { background: var(--inset); }
.roster .dealer-cell a { text-decoration: none; font-weight: 500; }
.roster .dealer-cell small { display: block; color: var(--faint); font-family: var(--mono); font-size: 0.7rem; margin-top: 0.15rem; }
.territory { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.score { display: inline-flex; align-items: center; gap: 0.45rem; font-variant-numeric: tabular-nums; }
.bar { width: 64px; height: 6px; border-radius: 3px; background: var(--inset); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.bar.warn i { background: var(--amber); }
.bar.bad i { background: var(--red); }
.total { font-weight: 600; font-size: 0.95rem; }
.total.good { color: var(--green); }
.total.warn { color: var(--amber); }
.total.bad { color: var(--red); }
.flag { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.35rem; }
.flag.good { background: var(--green); }
.flag.warn { background: var(--amber); }
.flag.bad { background: var(--red); }
.flag.na { background: var(--line-strong); }

/* --------------------------------------------------------------------------
   Status badges
   -------------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.7rem; font-weight: 500; white-space: nowrap; }
.badge.good { background: var(--green-pale); color: #1c7a44; }
.badge.warn { background: var(--amber-pale); color: #8f6210; }
.badge.bad { background: var(--red-pale); color: #8e2f2a; }
.badge.na { background: var(--inset); color: var(--muted); }
.badge.gold { background: var(--gold-pale); color: var(--gold-deep); }

/* --------------------------------------------------------------------------
   Pillar cards (methodology)
   -------------------------------------------------------------------------- */
.pillar { padding: 1.25rem 1.4rem; }
.pillar .num { font-family: var(--mono); font-size: 0.72rem; color: var(--gold-deep); }
.pillar h3 { font-size: 1rem; margin-top: 0.35rem; }
.pillar p { color: var(--muted); font-size: 0.82rem; margin-top: 0.5rem; }
.pillar ul { margin: 0.75rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.8rem; }
.pillar li { margin: 0.2rem 0; }
.pillar .weight { margin-top: 0.9rem; font-size: 0.72rem; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }

/* --------------------------------------------------------------------------
   Handoff flow (Mirage → dealer)
   -------------------------------------------------------------------------- */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; align-items: stretch; }
.flow-step { position: relative; padding: 1.1rem 1.1rem 1.1rem 1.25rem; border-right: 1px dashed var(--line-strong); }
.flow-step:last-child { border-right: 0; }
.flow-step .k { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.flow-step h4 { font-size: 0.9rem; margin-top: 0.3rem; }
.flow-step p { color: var(--muted); font-size: 0.78rem; margin-top: 0.35rem; }
.flow-step .badge { margin-top: 0.75rem; }
.flow-step::after {
    content: ""; position: absolute; right: -6px; top: 50%; width: 10px; height: 10px;
    border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong);
    transform: translateY(-50%) rotate(45deg); background: var(--paper);
}
.flow-step:last-child::after { display: none; }
@media (max-width: 900px) {
    .flow { grid-template-columns: 1fr; }
    .flow-step { border-right: 0; border-bottom: 1px dashed var(--line-strong); }
    .flow-step::after { display: none; }
}

/* --------------------------------------------------------------------------
   Dealer page
   -------------------------------------------------------------------------- */
.crumbs { font-size: 0.78rem; color: var(--faint); padding-top: 1.5rem; }
.crumbs a { text-decoration: none; color: var(--muted); }
.dealer-head { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; padding: 1.25rem 0 1.75rem; }
.dealer-head h1 { font-size: 1.85rem; }
.dealer-facts { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 0.75rem; color: var(--muted); font-size: 0.82rem; }
.dealer-facts span b { color: var(--ink); font-weight: 500; }
.ring-wrap { display: flex; align-items: center; gap: 1.25rem; }
.ring { width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--amber) 0 var(--pct), var(--inset) var(--pct) 100%); }
.ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; text-align: center; }
.ring .n { font-size: 1.7rem; font-weight: 500; line-height: 1; }
.ring .d { font-size: 0.66rem; color: var(--faint); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 0.15rem; }
.ring-legend { font-size: 0.78rem; color: var(--muted); }
.ring-legend b { display: block; color: var(--ink); font-weight: 500; font-size: 0.95rem; }
@media (max-width: 760px) { .dealer-head { grid-template-columns: 1fr; } }

.pillar-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.pillar-score { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; display: block; }
.pillar-score .label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pillar-score .value { font-size: 1.5rem; font-weight: 500; margin-top: 0.25rem; }
.pillar-score .value small { font-size: 0.8rem; color: var(--faint); font-weight: 400; }
.pillar-score .bar { width: 100%; margin-top: 0.6rem; }

.checks { list-style: none; margin: 0; padding: 0; }
.check { display: grid; grid-template-columns: 22px 1fr auto; gap: 0.85rem; padding: 0.85rem 1.4rem; border-bottom: 1px solid var(--line); align-items: start; }
.check:last-child { border-bottom: 0; }
.check .mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 0.68rem; font-weight: 700; color: #fff; margin-top: 2px; }
.check .mark.good { background: var(--green); }
.check .mark.warn { background: var(--amber); }
.check .mark.bad { background: var(--red); }
.check .mark.na { background: var(--line-strong); }
.check .title { font-size: 0.86rem; font-weight: 500; }
.check .detail { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.check .detail code { font-family: var(--mono); font-size: 0.72rem; background: var(--inset); padding: 0.05rem 0.35rem; border-radius: 3px; }
.check .pts { font-family: var(--mono); font-size: 0.74rem; color: var(--faint); white-space: nowrap; margin-top: 3px; }

.evidence { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; padding: 1rem 1.4rem 1.4rem; }
.shot { aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius); background:
    linear-gradient(var(--inset) 0 0) top / 100% 18% no-repeat,
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(25,24,22,0.05) 22px 23px) 0 30% / 100% 70% no-repeat,
    var(--paper);
    position: relative; overflow: hidden;
}
.shot::before { content: ""; position: absolute; left: 10%; top: 28%; width: 38%; height: 8%; background: var(--gold-pale); border-radius: 2px; }
.shot::after { content: attr(data-label); position: absolute; left: 0; right: 0; bottom: 0; padding: 0.35rem 0.6rem; font-size: 0.68rem; color: var(--muted); background: rgba(250,248,242,0.92); border-top: 1px solid var(--line); }

.actions { list-style: none; margin: 0; padding: 0; }
.action { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 0.9rem 1.4rem; border-bottom: 1px solid var(--line); }
.action:last-child { border-bottom: 0; }
.action .prio { font-family: var(--mono); font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 3px; background: var(--inset); color: var(--muted); }
.action .prio.p1 { background: var(--red-pale); color: #8e2f2a; }
.action .prio.p2 { background: var(--amber-pale); color: #8f6210; }
.action .what { font-size: 0.85rem; font-weight: 500; }
.action .why { font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; }
.action .lift { font-size: 0.74rem; color: var(--gold-deep); white-space: nowrap; font-weight: 500; }

.timeline { display: flex; gap: 0.5rem; align-items: flex-end; height: 72px; padding: 0 1.4rem 1rem; }
.timeline span { flex: 1; background: var(--gold-pale); border-radius: 2px 2px 0 0; position: relative; }
.timeline span.hi { background: var(--gold); }
.timeline-labels { display: flex; gap: 0.5rem; padding: 0 1.4rem 1.2rem; font-size: 0.66rem; color: var(--faint); }
.timeline-labels span { flex: 1; text-align: center; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 0.5rem 1rem; font-size: 0.82rem; padding: 1rem 1.4rem 1.25rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv dd code { font-family: var(--mono); font-size: 0.74rem; background: var(--inset); padding: 0.05rem 0.4rem; border-radius: 3px; word-break: break-all; }

.note { background: var(--gold-pale); border-left: 3px solid var(--gold); padding: 0.9rem 1.1rem; font-size: 0.82rem; color: var(--ink); border-radius: 0 var(--radius) var(--radius) 0; }
.note b { font-weight: 600; }

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
    .container { width: calc(100% - 2rem); }
    .header-inner { height: auto; padding: 0.6rem 0; flex-wrap: wrap; }
    .brand-name { display: none; }
    .site-nav { gap: 0.9rem; flex-wrap: wrap; }
    .nav-link { white-space: nowrap; }
    .mock-pill { display: none; }
    .hero h1 { font-size: 1.5rem; }
    .dealer-head h1 { font-size: 1.45rem; }
    .check { grid-template-columns: 22px 1fr; }
    .check .pts { grid-column: 2; margin-top: 0; }
    .action { grid-template-columns: auto 1fr; }
    .action .lift { grid-column: 2; }
    .kv { grid-template-columns: 1fr; gap: 0.15rem 0; }
    .kv dt { margin-top: 0.5rem; }
}
