/* =========================================================================
   Dashboard Portage & Food — Feuille de style unique
   Direction visuelle : warm editorial / terre chaude
   ------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Layout */
    --sidebar-w: 232px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;

    /* Surfaces — palette terre / crème */
    --bg:           #efece4;   /* fond page : sable très pâle */
    --bg-deep:     #e8e4d8;   /* fond sous-section / hover */
    --card:        #faf8f2;   /* cards : crème laiteuse */
    --card-edge:   #ebe6d8;   /* contour discret */
    --rule:        #d8d2c0;   /* règles épaisses */
    --hairline:    #e4ddc8;   /* hairlines */

    /* Texte */
    --ink:         #221f1b;   /* texte principal */
    --ink-soft:    #3a352d;
    --muted:       #7a7060;   /* texte secondaire chaud */
    --muted-2:     #a89e8a;   /* meta, hints */

    /* Accents système */
    --sage:        #4a5d3a;   /* positif neutre / signature */
    --sage-soft:   #e6e8d8;
    --rust:        #a23d2e;   /* négatif */
    --rust-soft:   #f0dcd2;
    --honey:       #b88b1f;   /* warning */
    --honey-soft:  #f4e8c8;

    /* Équipe — Portage : encre profonde */
    --portage:        #22386b;
    --portage-deep:   #182852;
    --portage-soft:   #dde2ec;
    --portage-glow:   rgba(34,56,107,0.08);

    /* Équipe — Food : terracotta */
    --food:           #b85c38;
    --food-deep:      #8e4225;
    --food-soft:      #f1dccd;
    --food-glow:      rgba(184,92,56,0.10);

    /* Sidebar */
    --side-bg:     #221f1b;
    --side-edge:   #2e2b25;
    --side-text:   #c9c3b3;
    --side-meta:   #807966;

    /* Ombres très légères */
    --shadow-card: 0 1px 0 rgba(34,31,27,.04), 0 1px 2px rgba(34,31,27,.04);
    --shadow-pop:  0 12px 32px rgba(34,31,27,.12), 0 2px 6px rgba(34,31,27,.08);

    /* Typo */
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
            Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    display: flex;
    min-height: 100vh;
    line-height: 1.5;
    font-size: 14px;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle paper grain — drawn in CSS, no asset needed */
body::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(rgba(34,31,27,.025) 1px, transparent 1px),
        radial-gradient(rgba(34,31,27,.018) 1px, transparent 1px);
    background-size: 24px 24px, 11px 11px;
    background-position: 0 0, 6px 6px;
    mix-blend-mode: multiply;
    opacity: .6;
    z-index: 0;
}

/* =========================================================================
   Sidebar
   ------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--side-bg);
    color: var(--side-text);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    border-right: 1px solid var(--side-edge);
}

.sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid var(--side-edge);
    display: flex;
    justify-content: center;
    align-items: center;
}
.brand-mark {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .02em;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.brand-logo {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}
.brand-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.1;
}
.brand-tag {
    display: block;
    font-size: 10.5px;
    color: var(--side-meta);
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-top: 2px;
}

.nav-section-block {
    padding: 14px 12px 6px;
}
.nav-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 8px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-weight: 700;
    color: var(--side-meta);
}
.nav-section-label .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--portage);
}
.nav-section-food .nav-section-label .dot { background: var(--food); }

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: var(--side-text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    transition: background .12s ease, color .12s ease;
}
.nav-list a:hover {
    background: rgba(255,255,255,.05);
    color: #fff;
}
.nav-list a .nav-tag {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--side-meta);
    letter-spacing: .04em;
}
.nav-list li.active a {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.nav-list li.active a::before {
    content: "";
    position: absolute;
    left: -4px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--portage);
    border-radius: 2px;
}
.nav-section-food .nav-list li.active a::before { background: var(--food); }

.sidebar-footer {
    margin-top: auto;
    padding: 14px 16px 18px;
    border-top: 1px solid var(--side-edge);
    font-size: 11px;
    color: var(--side-meta);
    line-height: 1.5;
}
.sidebar-footer .data-source {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--side-text);
}
.sidebar-footer .data-source::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--sage);
    box-shadow: 0 0 0 3px rgba(74,93,58,.18);
}

/* =========================================================================
   Contenu principal
   ------------------------------------------------------------------------- */
.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* En-tête éditorial */
.page-head {
    padding: 28px 36px 18px;
    border-bottom: 1px solid var(--hairline);
    background: var(--bg);
}
.crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.crumb .sep { color: var(--muted-2); }
.crumb .current { color: var(--ink); font-weight: 500; }

.page-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.page-eyebrow {
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 6px;
}
.page-eyebrow .team-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--portage);
    margin-right: 8px;
    vertical-align: 1px;
}
.page-eyebrow.team-food .team-dot { background: var(--food); }

.page-title-block h1 {
    font-size: 30px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.025em;
}
.page-title-block .page-lede {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
    max-width: 620px;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--hairline);
    font-size: 12.5px;
    color: var(--muted);
}
.page-meta dt {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 10.5px;
    color: var(--muted-2);
    margin-right: 6px;
    font-weight: 600;
}
.page-meta dd { display: inline-block; color: var(--ink-soft); font-weight: 500; }
.page-meta .group { display: inline-flex; align-items: baseline; gap: 4px; }
.page-meta .freshness {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--sage);
    font-weight: 600;
}
.page-meta .freshness::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--sage);
    box-shadow: 0 0 0 3px rgba(74,93,58,.15);
}

/* Toolbar (filtres + exports) */
.page-toolbar {
    margin: 0;
    padding: 14px 36px;
    background: var(--bg);
    border-bottom: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(6px);
}
.page-toolbar::after {
    /* ribbon under sticky bar so it doesn't visually float */
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px; height: 1px;
    background: var(--hairline);
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted);
    font-weight: 600;
    margin-right: 4px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--card);
    border: 1px solid var(--card-edge);
    cursor: pointer;
    transition: all .12s ease;
    font-feature-settings: "tnum";
    text-decoration: none;
    font-family: inherit;
}
.chip:hover { color: var(--ink-soft); }
.chip.active:hover { color: #fff; }

/* Chip-select: <select> styled like a chip (for long lists like comptes) */
.chip-select {
    display: inline-flex;
    align-items: center;
    padding: 5px 28px 5px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--card) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path fill="%237a7060" d="M5 6L0 0h10z"/></svg>') no-repeat right 11px center;
    border: 1px solid var(--card-edge);
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    max-width: 280px;
}
.chip-select:hover { background-color: var(--bg-deep); }
.chip-select:focus { outline: 2px solid var(--food); outline-offset: 2px; }
[data-team="portage"] .chip-select:focus { outline-color: var(--portage); }
.chip-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--food-soft);
    color: var(--food-deep);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
}
.chip-clear:hover { background: var(--food); color: #fff; }
.chip:hover { background: var(--bg-deep); }
.chip.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.chip.team-portage.active { background: var(--portage); border-color: var(--portage); }
.chip.team-food.active { background: var(--food); border-color: var(--food); }

.toolbar-spacer { flex: 1; }

.search-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 12px;
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: 8px;
    min-width: 220px;
}
.search-inline svg { color: var(--muted); flex-shrink: 0; }
.search-inline input {
    border: 0;
    background: transparent;
    outline: none;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    flex: 1;
    min-width: 0;
}
.search-inline input::placeholder { color: var(--muted-2); }

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 8px;
    font: 500 13px var(--sans);
    line-height: 1.2;
    cursor: pointer;
    border: 1px solid var(--card-edge);
    background: var(--card);
    color: var(--ink);
    transition: all .12s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--bg-deep); border-color: var(--rule); }
.btn-primary {
    background: var(--ink);
    color: #fbf8f0;
    border-color: var(--ink);
}
.btn-primary:hover { background: #000; border-color: #000; }
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}
.btn-ghost:hover { color: var(--ink); background: var(--bg-deep); }
.btn-icon { padding: 7px; }
.btn svg { width: 14px; height: 14px; }

/* Export dropdown */
.export-wrap { position: relative; }
.export-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: 10px;
    box-shadow: var(--shadow-pop);
    padding: 6px;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
    z-index: 50;
}
.export-wrap.open .export-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.export-menu .menu-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted-2);
    font-weight: 600;
    padding: 8px 10px 4px;
}
.export-menu button {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border: 0;
    background: transparent;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    color: var(--ink);
}
.export-menu button:hover { background: var(--bg-deep); }
.export-menu .ico {
    width: 22px; height: 22px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    color: #fff;
}
.export-menu .ico.pdf { background: #a23d2e; }
.export-menu .ico.xls { background: #4a5d3a; }
.export-menu .ico.csv { background: #6b6357; }
.export-menu .ico.prn { background: #22386b; }
.export-menu button > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.export-menu .ttl { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.export-menu .sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.export-menu .sep { height: 1px; background: var(--hairline); margin: 4px 6px; }

/* =========================================================================
   Body sections
   ------------------------------------------------------------------------- */
.content-body {
    padding: 24px 36px 56px;
    max-width: 1480px;
}

/* Section title (éditorial : small caps + tickmark) */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 28px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule);
}
.section-head:first-of-type { margin-top: 0; }
.section-head h2 {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-head h2::before {
    content: "";
    width: 14px; height: 1px;
    background: var(--ink);
}
.section-head .section-meta {
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
}

/* =========================================================================
   Hero KPI
   ------------------------------------------------------------------------- */
.hero-kpi {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.hero-kpi::before {
    /* signature stripe */
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--portage);
}
.hero-kpi.team-food::before { background: var(--food); }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1.4fr) repeat(3, minmax(120px, 1fr));
    gap: 28px 36px;
    align-items: stretch;
}

.hero-main .hero-eyebrow {
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}
.hero-main .hero-number {
    font-size: 68px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--ink);
    font-variant-numeric: tabular-nums slashed-zero;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.hero-main .hero-number .unit {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--muted);
    font-variant-numeric: normal;
}
.hero-main .hero-delta {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px 5px 9px;
    background: var(--sage-soft);
    color: var(--sage);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.hero-main .hero-delta.down { background: var(--rust-soft); color: var(--rust); }
.hero-main .hero-delta .arrow { font-family: var(--mono); font-size: 13px; }
.hero-main .hero-context {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    max-width: 420px;
}

.hero-stat {
    padding-left: 24px;
    border-left: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.hero-stat .stat-label {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 8px;
}
.hero-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.hero-stat .stat-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    font-style: italic;
}

/* =========================================================================
   Cards & grilles
   ------------------------------------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-card);
}

.card-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.card-head .card-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.005em;
}
.card-head .card-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    font-style: italic;
}
.card-head .card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
.grid-asym {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* =========================================================================
   Charts
   ------------------------------------------------------------------------- */
.chart-container { position: relative; width: 100%; }
.chart-container.chart-lg { height: 360px; }
.chart-container.chart-md { height: 280px; }
.chart-container.chart-sm { height: 220px; }
.chart-container.chart-xs { height: 160px; }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--muted);
}
.chart-legend .lg-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-feature-settings: "tnum";
}
.chart-legend .swatch {
    width: 10px; height: 10px;
    border-radius: 2px;
    background: var(--portage);
    display: inline-block;
}
.chart-legend .swatch.line {
    height: 2px;
    border-radius: 0;
}
.chart-legend .lg-val {
    color: var(--ink);
    font-weight: 600;
}

/* =========================================================================
   Tables
   ------------------------------------------------------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--muted);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .14em;
    border-bottom: 1px solid var(--rule);
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
}
.data-table th:hover { color: var(--ink); }
.data-table th.no-sort { cursor: default; }
.data-table th.no-sort:hover { color: var(--muted); }
.data-table th .sort-arrow {
    display: inline-block;
    margin-left: 4px;
    color: var(--muted-2);
    font-size: 10px;
}
.data-table th.sort-asc .sort-arrow,
.data-table th.sort-desc .sort-arrow { color: var(--ink); }

.data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--hairline);
    color: var(--ink);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: rgba(74,93,58,.05); }
.data-table tbody tr.is-highlighted td { background: rgba(34,56,107,.07); }
.team-food .data-table tbody tr.is-highlighted td { background: rgba(184,92,56,.07); }

.data-table .num { text-align: right; }
.data-table .rank {
    width: 36px;
    color: var(--muted);
    font-weight: 600;
    font-family: var(--mono);
    font-size: 12px;
}
.data-table .person-name {
    font-weight: 500;
    color: var(--ink);
}
.data-table .person-name .badge-rank {
    display: inline-block;
    background: var(--sage);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    letter-spacing: .08em;
    text-transform: uppercase;
    vertical-align: 1px;
}

/* progress bars inside tables */
.progress-bar {
    height: 5px;
    background: var(--bg-deep);
    border-radius: 999px;
    overflow: hidden;
    flex: 1;
}
.progress-bar .fill {
    height: 100%;
    background: var(--portage);
    border-radius: 999px;
    transition: width .3s ease;
}
.progress-bar .fill.food-fill { background: var(--food); }
.progress-bar .fill.sage { background: var(--sage); }
.progress-bar .fill.rust { background: var(--rust); }

.share-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}
.share-cell .share-val {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 600;
    width: 38px;
    text-align: right;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
}
.badge-sage    { background: var(--sage-soft); color: var(--sage); }
.badge-rust    { background: var(--rust-soft); color: var(--rust); }
.badge-honey   { background: var(--honey-soft); color: var(--honey); }
.badge-portage { background: var(--portage-soft); color: var(--portage); }
.badge-food    { background: var(--food-soft); color: var(--food-deep); }
.badge-ghost   { background: transparent; color: var(--muted); border: 1px solid var(--hairline); }

.variation {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.variation.up   { color: var(--sage); }
.variation.down { color: var(--rust); }

/* =========================================================================
   Insight boxes (text + number combo)
   ------------------------------------------------------------------------- */
.insight {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    align-items: center;
}
.insight .insight-num {
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    min-width: 64px;
}
.insight .insight-text {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.45;
}
.insight .insight-text strong { color: var(--ink); font-weight: 600; }
.insight.tone-sage .insight-num  { color: var(--sage); }
.insight.tone-rust .insight-num  { color: var(--rust); }
.insight.tone-honey .insight-num { color: var(--honey); }

/* Period rows (peak / slow) */
.period-list {
    display: flex;
    flex-direction: column;
}
.period-list .period-row {
    display: grid;
    grid-template-columns: 28px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--hairline);
}
.period-list .period-row:last-child { border-bottom: 0; }
.period-list .period-row .rk {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted-2);
}
.period-list .period-row .lb { font-weight: 500; color: var(--ink); }
.period-list .period-row .vl {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--ink);
    text-align: right;
    min-width: 56px;
}
.period-list .period-row .delta { min-width: 78px; text-align: right; }

/* =========================================================================
   Print
   ------------------------------------------------------------------------- */
@media print {
    body { background: #fff; }
    body::before { display: none; }
    .sidebar, .page-toolbar, .crumb, .btn, .export-wrap { display: none !important; }
    .content { margin-left: 0; }
    .card, .hero-kpi { box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
    .page-head { padding: 0 0 14px; border-bottom: 1px solid #000; }
    .content-body { padding: 14px 0; max-width: none; }
    @page { margin: 14mm; }
}

/* =========================================================================
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1280px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .hero-main { grid-column: 1 / -1; }
    .hero-stat:first-of-type { padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--hairline); }
    .hero-stat { padding-top: 16px; border-top: 1px solid var(--hairline); }
}
@media (max-width: 960px) {
    .sidebar { display: none; }
    .content { margin-left: 0; }
    .grid-2, .grid-3, .grid-asym { grid-template-columns: 1fr; }
    .page-head, .page-toolbar, .content-body { padding-left: 20px; padding-right: 20px; }
    .hero-grid { grid-template-columns: 1fr 1fr; }
    .hero-main { grid-column: 1 / -1; }
    .hero-main .hero-number { font-size: 52px; }
}
