  :root {
    --bg: #F7F8F9;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --ink: #0C1417;
    --muted: #6B7280;
    --accent: #5F98B3;
    --accent2: #4A7E99;
    --danger: #DC2626;
    --warn: #CA8A04;
    --ok: #16A34A;
    --purple: #7C3AED;
    --orange: #EA580C;
    --sky: #0284C7;
    --pink: #DB2777;
  }

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

  body {
    font-family: 'Figtree', sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
  }

  /* ─── TOPBAR ─── */
  .topbar-right { display:flex; align-items:center; gap:16px; }
  .dash-toggle {
    display: flex;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
  }
  .dash-tab {
    padding: 7px 18px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.65);
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
  }
  .dash-tab:hover { color: #fff; background: rgba(255,255,255,0.1); }
  .dash-tab.active { background: #fff; color: var(--ink); }

  .sidebar-panel { width: 100%; }
  
  .topbar {
    background: var(--ink);
    color: #fff;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(3,15,20,0.25);
  }
  .topbar h1 {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
  }
  .topbar h1 span { color: var(--accent2); }

  /* ─── APP FOOTER ─── data freshness + JV easter-egg link
     Lives outside .shell so the sticky sidebar does not overlap it. */
  .app-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 32px 20px;
    border-top: 1px solid var(--border);
    margin-top: 28px;
    font-family: 'Figtree', sans-serif;
    font-size: 0.76rem; color: var(--muted);
    background: transparent;
  }
  .app-footer .footer-left { letter-spacing: 0.2px; }
  .app-footer #footer-updated { color: #4B5563; font-weight: 600; }
  .app-footer #jv-link {
    color: var(--muted); text-decoration: none;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.4px;
    opacity: 0.55; transition: opacity 0.15s, color 0.15s;
    padding: 2px 6px; border-radius: 4px;
  }
  .app-footer #jv-link:hover { opacity: 1; color: var(--ink); }
  body.jv-on .app-footer #jv-link {
    color: #5F98B3; opacity: 1;
    background: rgba(95,152,179,0.12);
  }

  /* ─── MAIN LAYOUT ─── */
  .shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 56px);
  }

  /* ─── SIDEBAR ─── */
  .sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
  }

  .filter-section { display: flex; flex-direction: column; gap: 10px; }
  .filter-label {
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }

  /* Retailer toggles */
  .retailer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .ret-btn {
    padding: 9px 6px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-family: 'Figtree', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
  }
  .ret-btn:hover { border-color: var(--ink); color: var(--ink); }
  .ret-btn.active[data-ret="Petco"]    { background: #1D4ED8; border-color: #1D4ED8; color: #fff; }
  .ret-btn.active[data-ret="PetSmart"] { background: #DC2626; border-color: #DC2626; color: #fff; }
  .ret-btn.active[data-ret="PSP"]      { background: #16A34A; border-color: #16A34A; color: #fff; }
  .ret-btn.active[data-ret="Amazon"]   { background: #D97706; border-color: #D97706; color: #fff; }

  /* Category pills */
  .cat-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .cat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
  }
  .cat-pill .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .cat-pill:hover { border-color: var(--ink); color: var(--ink); }
  .cat-pill.active { border-color: currentColor; color: var(--ink); background: #F9FAFB; }
  .cat-pill[data-cat="Wellness"]     .dot { background: #7C3AED; }
  .cat-pill[data-cat="Grooming"]     .dot { background: #0284C7; }
  .cat-pill[data-cat="Stain & Odor"] .dot { background: #16A34A; }
  .cat-pill[data-cat="Flea + Tick"]  .dot { background: #EA580C; }
  .cat-pill[data-cat="Training Aids"]     .dot { background: #DB2777; }
  .cat-pill[data-cat="Oral Care"]    .dot { background: #CA8A04; }
  .cat-pill[data-cat="Cleaning"]     .dot { background: #16A34A; }
  .cat-pill[data-cat="Training Aids"] .dot { background: #DB2777; }
  .cat-pill[data-cat="N/A"]          .dot { background: #9CA3AF; }

  /* Compare date pill (legacy, kept for sidebar pill compat) */
  .compare-toggle-pill { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
  .compare-toggle-pill.active { background: #1D4ED8; color: #fff; border-color: #1D4ED8; }
  /* SKU search */
  .sku-search-wrap { position: relative; }
  .sku-search {
    width: 100%;
    padding: 8px 10px 8px 30px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Figtree', sans-serif;
    font-size: 0.85rem;
    background: #F9FAFB;
    color: var(--ink);
  }
  .sku-search:focus { outline: none; border-color: var(--ink); background: #fff; }
  .sku-search-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 13px;
    pointer-events: none;
  }
  .sku-cat-header {
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    padding: 10px 6px 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
  }
  .sku-retailer-dots {
    display: flex;
    gap: 3px;
    margin-top: 2px;
  }
  .sku-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    margin-top: 4px;
  }
  .sku-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.1s;
  }
  .sku-item:last-child { border-bottom: none; }
  .sku-item:hover { background: #F9FAFB; }
  .sku-item input[type="checkbox"] { flex-shrink: 0; accent-color: var(--ink); }
  .sku-item .sku-code { font-weight: 700; color: var(--ink); font-size: 0.75rem; }
  .sku-item .sku-name { color: var(--muted); font-size: 0.73rem; line-height: 1.2; }

  .sidebar-btn-row { display: flex; gap: 6px; }
  .sbtn {
    flex: 1;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Figtree', sans-serif;
    transition: all 0.15s;
  }
  .sbtn:hover { background: #F3F4F6; color: var(--ink); }
  .sbtn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }

  /* ─── MAIN CONTENT ─── */
  .main { padding: 28px 32px; overflow: auto; }

  /* ─── KPI ROW ─── */
  .kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
  }
  .kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    overflow: hidden;
  }
  .kpi::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
  }
  .kpi.blue::before   { background: #1D4ED8; }
  .kpi.red::before    { background: #DC2626; }
  .kpi.green::before  { background: #16A34A; }
  .kpi.amber::before  { background: #D97706; }
  .kpi-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 8px; }
  .kpi-val { font-family: 'Merriweather', serif; font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 6px; }
  .kpi-sub { font-size: 0.78rem; color: var(--muted); }
  .kpi-sub .up   { color: var(--ok); font-weight: 700; }
  .kpi-sub .down { color: var(--danger); font-weight: 700; }

  /* ─── CHART SECTION ─── */
  .charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
  }
  .chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }
  .card-header {
    background: var(--ink);
    color: #fff;
    padding: 14px 20px;
    font-family: 'Merriweather', serif;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .card-header .subtitle { font-size: 0.75rem; color: rgba(255,255,255,0.6); font-family: 'Figtree', sans-serif; font-weight: 400; }
  .card-body { padding: 20px; }
  .chart-wrap { height: 300px; position: relative; }
  .chart-wrap.sm { height: 220px; }

  /* ─── TABLE SECTION ─── */
  .table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
  }
  .tbl-controls {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: #F9FAFB;
    gap: 12px;
    flex-wrap: wrap;
  }
  .tbl-title { font-family: 'Merriweather', serif; font-size: 1rem; font-weight: 700; }
  .view-tabs { display: flex; gap: 4px; }
  .vtab {
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Figtree', sans-serif;
    transition: all 0.15s;
  }
  .vtab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
  .sort-sel {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-family: 'Figtree', sans-serif;
    font-size: 0.78rem;
    background: #fff;
    cursor: pointer;
  }

  .tbl-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; }
  thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--muted);
    background: #F9FAFB;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
  }
  thead th:hover { color: var(--ink); }
  thead th .sort-arrow { margin-left: 4px; opacity: 0.4; }
  thead th.sorted .sort-arrow { opacity: 1; }
  tbody tr { border-bottom: 1px solid #F3F4F6; transition: background 0.1s; }
  tbody tr:hover { background: #F9FAFB; }
  tbody tr:last-child { border-bottom: none; }
  td { padding: 11px 14px; font-size: 0.85rem; vertical-align: middle; }
  .sku-cell .code { font-weight: 800; font-size: 0.82rem; color: var(--ink); }
  .sku-cell .name { font-size: 0.75rem; color: var(--muted); margin-top: 1px; }
  .cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
  }
  .turn-cell { font-family: 'Merriweather', serif; font-weight: 700; }
  .turn-cell.high  { color: #16A34A; }
  .turn-cell.mid   { color: #D97706; }
  .turn-cell.low   { color: #DC2626; }
  .trend-spark { display: flex; align-items: flex-end; gap: 2px; height: 24px; }
  .spark-bar { width: 6px; border-radius: 2px 2px 0 0; background: #E5E7EB; transition: background 0.15s; }
  .retailer-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 4px;
  }
  .r-Petco    { background: #1D4ED8; }
  .r-PetSmart { background: #DC2626; }
  .r-PSP      { background: #16A34A; }
  .r-Amazon   { background: #D97706; }

  /* weekly heat columns */
  .heat-cell { width: 48px; text-align: center; font-size: 0.78rem; font-weight: 600; padding: 6px 4px; }

  /* ─── BOTTOM GRID ─── */
  .bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

  /* ─── EMPTY STATE ─── */
  .empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
  }
  .empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; }

  /* ─── SCROLLBAR ─── */
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }



  /* ─── YEAR TOGGLE ─── */
  .year-toggle-wrap {
    display: flex;
    background: #F3F4F6;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
  }
  .year-btn {
    flex: 1;
    padding: 7px 10px;
    border: none;
    border-radius: 6px;
    font-family: 'Figtree', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    transition: all 0.15s;
    letter-spacing: 0.3px;
  }
  .year-btn:hover { color: var(--ink); }
  .year-btn.active {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 1px 4px rgba(3,15,20,0.2);
  }
  .year-btn.y2025.active { background: #7C3AED; }
  .compare-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    margin-left: 5px;
    vertical-align: middle;
  }
  .badge-up   { background: #DCFCE7; color: #166534; }
  .badge-down { background: #FEE2E2; color: #991B1B; }
  .badge-flat { background: #FEF3C7; color: #92400E; }

  /* YoY overlay indicator in chart card header */
  .yoy-label {
    font-size: 0.7rem;
    font-family: 'Figtree', sans-serif;
    font-weight: 400;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 4px;
  }

  /* ─── DATE RANGE TRIGGER (sidebar) ─── */
  .drp-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    cursor: pointer;
    font-family: 'Figtree', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    transition: border-color 0.15s;
    width: 100%;
    text-align: left;
    line-height: 1.4;
  }
  .drp-trigger:hover { border-color: var(--ink); }
  .drp-trigger.active { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(3,15,20,0.08); }
  .drp-trigger .cal-icon { display: none; }
  .drp-trigger .drp-text { flex: 1; }
  .drp-trigger .drp-caret { color: var(--muted); font-size: 10px; }
  .gadp-trigger-preset {
    display: inline-block;
    background: #F3F4F6;
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.72rem;
    margin-right: 4px;
    color: var(--ink);
  }

  /* ─── GA-STYLE DATE PICKER POPOVER ─── */
  .gadp-popover {
    position: fixed;
    z-index: 999;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(3,15,20,0.18);
    display: none;
    width: 620px;
    overflow: hidden;
  }
  .gadp-popover.open { display: flex; flex-direction: column; }

  .gadp-body {
    display: flex;
    flex: 1;
    min-height: 0;
  }

  /* Left: presets column */
  .gadp-presets {
    width: 170px;
    flex-shrink: 0;
    padding: 10px 0;
    border-right: 1px solid var(--border);
    background: #FAFAFA;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  .gadp-preset-btn {
    padding: 7px 16px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #5F6368;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    font-family: 'Figtree', sans-serif;
    transition: background 0.1s;
    white-space: nowrap;
  }
  .gadp-preset-btn:hover { background: #F0F0F0; color: var(--ink); }
  .gadp-preset-btn.active { color: #1A73E8; font-weight: 700; background: #E8F0FE; }
  .gadp-divider { height: 1px; background: #E5E7EB; margin: 6px 0; }

  .gadp-compare-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
  }
  .gadp-cmp-cb {
    width: 14px; height: 14px;
    accent-color: #1A73E8;
    cursor: pointer;
    margin: 0;
  }
  .gadp-compare-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: #5F6368;
    cursor: pointer;
    font-family: 'Figtree', sans-serif;
  }
  .gadp-compare-presets { padding-left: 12px; }

  /* Right: date fields + calendar + footer */
  .gadp-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  /* Date fields row */
  .gadp-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #F0F0F0;
  }
  .gadp-field {
    flex: 1;
  }
  .gadp-field-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #80868B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    font-family: 'Figtree', sans-serif;
  }
  .gadp-date-display {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #80868B;
    font-family: 'Figtree', sans-serif;
    background: #fff;
    min-width: 120px;
    white-space: nowrap;
  }
  .gadp-date-display.has-value { color: var(--ink); }
  .gadp-field-sep {
    color: #80868B;
    font-weight: 600;
    padding-top: 16px;
  }

  /* Compare fields */
  .gadp-compare-section { border-bottom: 1px solid #F0F0F0; }
  .gadp-cmp-fields { padding-top: 4px; padding-bottom: 10px; }
  .gadp-field-label-inline {
    font-size: 0.7rem;
    font-weight: 700;
    color: #5F6368;
    padding-top: 16px;
    white-space: nowrap;
    margin-right: 4px;
    font-family: 'Figtree', sans-serif;
  }

  /* Scrolling calendar */
  .gadp-cal-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 16px 4px;
  }
  .gadp-month {
    margin-bottom: 12px;
  }
  .gadp-month-header {
    font-size: 0.72rem;
    font-weight: 700;
    color: #5F6368;
    padding: 8px 0 6px;
    font-family: 'Figtree', sans-serif;
    letter-spacing: 0.5px;
  }
  .gadp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 2px;
  }
  .gadp-weekdays span {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #80868B;
    padding: 2px 0;
    font-family: 'Figtree', sans-serif;
  }
  .gadp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
  }
  .gadp-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--ink);
    position: relative;
    border: none;
    background: transparent;
    font-family: 'Figtree', sans-serif;
    border-radius: 0;
    transition: background 0.08s;
  }
  .gadp-day:hover:not(.empty):not(.disabled) { background: #F3F4F6; border-radius: 50%; }
  .gadp-day.empty { cursor: default; }
  .gadp-day.disabled { color: #D1D5DB; cursor: default; }
  .gadp-day.no-data { color: #C4C4C4; }

  .gadp-day.today {
    font-weight: 800;
    color: #1A73E8;
  }
  .gadp-day.today::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 2px solid #1A73E8;
    border-radius: 50%;
    pointer-events: none;
  }

  .gadp-day.in-range {
    background: #E8F0FE;
    border-radius: 0;
    color: #1A73E8;
  }
  .gadp-day.range-start,
  .gadp-day.range-end {
    background: #1A73E8 !important;
    color: #fff !important;
    border-radius: 50% !important;
    font-weight: 700;
    z-index: 1;
  }
  .gadp-day.range-start.range-end { border-radius: 50% !important; }

  /* Compare range highlighting */
  .gadp-day.cmp-in-range { background: #FEF3C7; border-radius: 0; }
  .gadp-day.cmp-range-start,
  .gadp-day.cmp-range-end {
    background: #F59E0B !important;
    color: #fff !important;
    border-radius: 50% !important;
    font-weight: 700;
    z-index: 1;
  }

  /* Footer */
  .gadp-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .gadp-cancel {
    padding: 7px 18px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #1A73E8;
    font-family: 'Figtree', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.1s;
  }
  .gadp-cancel:hover { background: #E8F0FE; }
  .gadp-apply {
    padding: 7px 18px;
    border: none;
    border-radius: 5px;
    background: #1A73E8;
    color: #fff;
    font-family: 'Figtree', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.1s;
  }
  .gadp-apply:hover { background: #1557B0; }
  .gadp-apply:disabled { opacity: 0.4; cursor: default; }


  /* ─── RESPONSIVE ─── */
  @media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; max-height: none; }
    .kpi-row { grid-template-columns: 1fr 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .bottom-grid { grid-template-columns: 1fr; }
  }

  /* ── Ecomm Dashboard ── */
  .ecomm-subnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
  }
  .ecomm-view-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
  .evtab {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #D1D5DB;
    background: #fff;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.85em;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.15s;
  }
  .evtab:hover { border-color: var(--ink); color: var(--ink); }
  .evtab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
  .evtab.signal-tab.active { background: #7C3AED; border-color: #7C3AED; }
  .ecomm-period-label { font-size: 0.8em; color: #9CA3AF; font-weight: 600; }
  .eview-panel { display: block; }
  .signal-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
  }
  .signal-intro h3 { margin: 0 0 8px; font-family: var(--font-head); color: #030F14; font-size: 1em; }
  .signal-intro p  { margin: 0; font-size: 0.85em; color: #374151; max-width: 360px; line-height: 1.5; }
  .signal-controls { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
  .signal-ctrl-group { display: flex; flex-direction: column; gap: 4px; }
  .signal-ctrl-group label { font-size: 0.75em; font-weight: 700; color: #6B7280; text-transform: uppercase; }
  .ret-btn[data-echan="amazon"].active { background: #D97706; border-color: #D97706; color: #fff; }
  .ret-btn[data-echan="shopify"].active { background: #96BF48; border-color: #96BF48; color: #fff; }

  #signal-corr-table { width:100%; border-collapse:collapse; }
  #signal-corr-table th, #signal-corr-table td { padding:10px 12px; border-bottom:1px solid #F3F4F6; text-align:left; font-size:0.88em; }
  #signal-corr-table th { background:#F9FAFB; font-weight:700; font-size:0.78em; text-transform:uppercase; color:#6B7280; }
  #signal-corr-table tr:hover { background:#F9FAFB; }

  .amod-btn, .a-ret-btn, .a-cat-btn {
    width:100%; text-align:left; padding:9px 12px; border-radius:6px;
    border:1px solid var(--border); background:var(--surface);
    color:var(--muted); font-size:0.82rem; font-weight:600; cursor:pointer;
    transition:all 0.15s ease; font-family:inherit;
  }
  .amod-btn:hover, .a-ret-btn:hover, .a-cat-btn:hover { border-color:var(--ink); color:var(--ink); }
  .amod-btn.active { background:var(--ink); color:#fff; border-color:var(--ink); }
  .a-ret-btn.active, .a-cat-btn.active { background:var(--ink); color:#fff; border-color:var(--ink); }

  .amod-panel { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:24px 28px; margin-bottom:24px; }
  .amod-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:20px; }
  .amod-title { font-family:'Merriweather',serif; font-size:1.25rem; font-weight:700; color:var(--ink); }
  .amod-sub { font-size:0.83rem; color:var(--muted); margin-top:4px; }
  .quad-legend { display:flex; gap:20px; flex-wrap:wrap; margin-top:12px; font-size:0.82rem; font-weight:600; }
  .quad-q { }
  .distrib-zone { padding:12px 14px; border-radius:8px; }

    .amod-btn {
      width: 100%;
      text-align: left;
      padding: 8px 12px;
      border: 1px solid var(--border, #E5E7EB);
      border-radius: 6px;
      background: var(--surface, #fff);
      color: var(--text, #111);
      font-size: 0.83rem;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
    }
    .amod-btn:hover { background: var(--surface-2, #F3F4F6); }
    .amod-btn.active { background: var(--accent, #030F14); color: #fff; border-color: var(--accent, #030F14); }
    .a-ret-btn, .a-cat-btn {
      padding: 5px 10px;
      border: 1px solid var(--border, #E5E7EB);
      border-radius: 6px;
      background: var(--surface, #fff);
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
    }
    .a-ret-btn.active, .a-cat-btn.active { background: var(--accent, #030F14); color: #fff; border-color: var(--accent, #030F14); }

    
/* ══════════════════════════════════
   MMM MODULES SCOPED STYLES
   ══════════════════════════════════ */
#panel-mmm .filter-bar {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
#panel-mmm .filter-bar label {
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6B7280;
}
#panel-mmm .filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#panel-mmm .filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#panel-mmm .pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  font-family: 'Figtree', sans-serif;
  font-weight: 600;
  font-size: 0.82em;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.15s;
}
#panel-mmm .pill.active { border-color: #030F14; background: #030F14; color: #fff; }
#panel-mmm .pill:hover:not(.active) { border-color: #030F14; color: #030F14; }
#panel-mmm .modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
#panel-mmm .module-full { grid-column: 1 / -1; }
#panel-mmm .module-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(3,15,20,0.06);
}
#panel-mmm .module-header {
  background: #030F14;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
#panel-mmm .module-header-left h2 {
  font-family: 'Merriweather', serif;
  color: #fff;
  font-size: 1.1em;
  font-weight: 800;
  letter-spacing: -0.2px;
}
#panel-mmm .module-number {
  font-size: 0.7em;
  color: rgba(255,255,255,0.45);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
#panel-mmm .module-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72em;
  font-weight: 700;
  background: rgba(255,255,255,0.15);
  color: #fff;
  white-space: nowrap;
}
#panel-mmm .module-body { padding: 24px; }
#panel-mmm .chart-wrap { position: relative; height: 380px; }
#panel-mmm .chart-wrap-tall { position: relative; height: 460px; }
#panel-mmm .chart-wrap-sm { position: relative; height: 280px; }
#panel-mmm .quadrant-container { position: relative; }
#panel-mmm .quadrant-labels {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 5;
}
#panel-mmm .qlabel {
  position: absolute; font-size: 0.7em; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  opacity: 0.55; padding: 6px 10px; border-radius: 4px;
}
#panel-mmm .qlabel.hero { top: 10px; right: 10px; color: #16A34A; background: #DCFCE7; }
#panel-mmm .qlabel.mature { bottom: 10px; right: 10px; color: #CA8A04; background: #FEF3C7; }
#panel-mmm .qlabel.breakout { top: 10px; left: 10px; color: #2563EB; background: #DBEAFE; }
#panel-mmm .qlabel.underperform { bottom: 10px; left: 10px; color: #DC2626; background: #FEE2E2; }
#panel-mmm .insight-box {
  background: #FFFBEB; border-left: 3px solid #CA8A04;
  padding: 14px 18px; border-radius: 6px; margin-top: 16px; font-size: 0.88em;
}
#panel-mmm .insight-box strong {
  display: block; color: #92400E; font-family: 'Merriweather', serif;
  margin-bottom: 5px; font-size: 0.95em;
}
#panel-mmm .insight-info {
  background: #EFF6FF; border-left: 3px solid #2563EB;
  padding: 14px 18px; border-radius: 6px; margin-top: 16px; font-size: 0.88em;
}
#panel-mmm .insight-info strong {
  display: block; color: #1E40AF; font-family: 'Merriweather', serif;
  margin-bottom: 5px; font-size: 0.95em;
}
#panel-mmm .legend-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
#panel-mmm .legend-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8em; font-weight: 600; color: #4B5563;
}
#panel-mmm .legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
#panel-mmm .legend-sq { width: 12px; height: 10px; border-radius: 2px; flex-shrink: 0; }
#panel-mmm .module-controls { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
#panel-mmm .ctrl-btn {
  padding: 6px 14px; border-radius: 6px; border: 1px solid #E5E7EB;
  background: #fff; font-family: 'Figtree', sans-serif; font-weight: 600;
  font-size: 0.8em; color: #6B7280; cursor: pointer; transition: all 0.15s;
}
#panel-mmm .ctrl-btn.active { background: #030F14; color: #fff; border-color: #030F14; }
#panel-mmm .ctrl-btn:hover:not(.active) { border-color: #030F14; color: #030F14; }
#panel-mmm .stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px;
}
#panel-mmm .stat-mini {
  background: #F9FAFB; border-radius: 8px; padding: 14px 16px; border: 1px solid #E5E7EB;
}
#panel-mmm .stat-mini .label {
  font-size: 0.72em; color: #9CA3AF; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px;
}
#panel-mmm .stat-mini .value {
  font-family: 'Merriweather', serif; font-size: 1.6em; font-weight: 700; color: #030F14; line-height: 1;
}
#panel-mmm .stat-mini .delta { font-size: 0.78em; font-weight: 600; margin-top: 3px; }
#panel-mmm .delta-up { color: #16A34A; }
#panel-mmm .delta-down { color: #DC2626; }
#panel-mmm .lag-correlation-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#panel-mmm .lag-label { font-size: 0.82em; font-weight: 600; color: #6B7280; width: 70px; flex-shrink: 0; }
#panel-mmm .lag-value { font-family: 'Merriweather', serif; font-size: 1em; font-weight: 700; width: 50px; flex-shrink: 0; }
@media (max-width: 1100px) {
  #panel-mmm .modules-grid { grid-template-columns: 1fr; }
  #panel-mmm .module-full { grid-column: 1; }
  #panel-mmm .stats-row { grid-template-columns: repeat(2,1fr); }
}


/* ── PAID MEDIA TAB ─────────────────────────────── */
#panel-paid {
  font-family: 'Figtree', sans-serif;
  color: #030F14;
}
#panel-paid .pm-header-banner {
  background: linear-gradient(135deg, #030F14 0%, #1a3a4a 100%);
  color: #fff;
  border-radius: 10px;
  padding: 20px 28px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#panel-paid .pm-header-banner h2 {
  font-family: 'Merriweather', serif;
  font-size: 1.5em;
  font-weight: 800;
  margin: 0 0 4px;
}
#panel-paid .pm-header-banner p { margin:0; font-size:0.88em; opacity:0.75; }
#panel-paid .pm-period-badge {
  background: rgba(255,255,255,0.12);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82em;
  font-weight: 600;
}
#panel-paid .kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
#panel-paid .kpi-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 18px 20px;
}
#panel-paid .kpi-card .kpi-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6B7280;
  font-weight: 700;
  margin-bottom: 6px;
}
#panel-paid .kpi-card .kpi-val {
  font-family: 'Merriweather', serif;
  font-size: 2em;
  font-weight: 800;
  color: #030F14;
  line-height: 1;
  margin-bottom: 4px;
}
#panel-paid .kpi-card .kpi-sub {
  font-size: 0.8em;
  color: #6B7280;
}
#panel-paid .kpi-card.meta { border-top: 3px solid #1877F2; }
#panel-paid .kpi-card.google { border-top: 3px solid #EA4335; }
#panel-paid .kpi-card.total { border-top: 3px solid #030F14; }
#panel-paid .pm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
#panel-paid .pm-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
#panel-paid .pm-grid-wide {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
#panel-paid .pm-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  overflow: hidden;
}
#panel-paid .pm-card-header {
  background: #030F14;
  color: #fff;
  padding: 14px 20px;
  font-family: 'Merriweather', serif;
  font-size: 1em;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#panel-paid .pm-card-body { padding: 20px; }
#panel-paid .pm-chart-wrap { position: relative; height: 300px; }
#panel-paid .pm-chart-wrap-sm { position: relative; height: 220px; }
#panel-paid .pm-chart-wrap-lg { position: relative; height: 360px; }
#panel-paid .pm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}
#panel-paid .pm-table th {
  background: #F9FAFB;
  padding: 9px 10px;
  text-align: left;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  color: #030F14;
  border-bottom: 1px solid #E5E7EB;
}
#panel-paid .pm-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #F3F4F6;
  color: #374151;
  vertical-align: middle;
}
#panel-paid .pm-table tr:hover td { background: #F9FAFB; }
#panel-paid .pm-table .val { font-family: 'Merriweather', serif; font-weight: 700; color: #030F14; }
#panel-paid .platform-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
#panel-paid .dot-meta { background: #1877F2; }
#panel-paid .dot-google { background: #EA4335; }
#panel-paid .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 700;
}
#panel-paid .badge-tof { background: #DBEAFE; color: #1D4ED8; }
#panel-paid .badge-mof { background: #FEF3C7; color: #92400E; }
#panel-paid .badge-bof { background: #DCFCE7; color: #166534; }
#panel-paid .badge-brand { background: #F3F4F6; color: #374151; }
#panel-paid .badge-sku { background: #EDE9FE; color: #5B21B6; }
#panel-paid .badge-aon { background: #FEE2E2; color: #991B1B; }
/* MMM Bridge */
#panel-paid .bridge-row {
  display: grid;
  grid-template-columns: 130px 1fr 1fr 70px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #F3F4F6;
}
#panel-paid .bridge-row:last-child { border-bottom: none; }
#panel-paid .bridge-label { font-weight: 700; font-size: 0.88em; color: #030F14; }
#panel-paid .bridge-bar-wrap {
  position: relative;
  height: 20px;
  background: #F3F4F6;
  border-radius: 4px;
  overflow: visible;
}
#panel-paid .bridge-bar-spend {
  position: absolute;
  top: 0; left: 0; height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 0.75em;
  font-weight: 700;
  color: #fff;
  min-width: 30px;
}
#panel-paid .bridge-bar-units {
  position: absolute;
  top: 0; left: 0; height: 100%;
  border-radius: 4px;
  opacity: 0.7;
}
#panel-paid .bridge-gap {
  font-family: 'Merriweather', serif;
  font-weight: 800;
  font-size: 0.95em;
  text-align: right;
}
#panel-paid .gap-pos { color: #16A34A; }
#panel-paid .gap-neg { color: #DC2626; }
#panel-paid .gap-neutral { color: #CA8A04; }
#panel-paid .bridge-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  font-size: 0.82em;
}
#panel-paid .bridge-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #374151;
}
#panel-paid .bl-dot {
  width: 12px; height: 12px;
  border-radius: 2px;
}
#panel-paid .insight-callout {
  background: #FFFBEB;
  border-left: 3px solid #CA8A04;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 14px;
  font-size: 0.88em;
}
#panel-paid .insight-callout strong { color: #92400E; display: block; margin-bottom: 4px; font-family: 'Merriweather', serif; }
#panel-paid .insight-callout.green { background: #F0FDF4; border-color: #16A34A; }
#panel-paid .insight-callout.green strong { color: #166534; }
#panel-paid .insight-callout.red { background: #FEF2F2; border-color: #DC2626; }
#panel-paid .insight-callout.red strong { color: #991B1B; }
#panel-paid .tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
#panel-paid .pm-tab {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid #D1D5DB;
  background: #fff;
  font-size: 0.82em;
  font-weight: 700;
  color: #6B7280;
  cursor: pointer;
}
#panel-paid .pm-tab.active { background: #030F14; color: #fff; border-color: #030F14; }
#panel-paid .pm-table-scroll { max-height: 340px; overflow-y: auto; }


  @keyframes spin { to { transform: rotate(360deg); } }


/* ─── INSIGHTS PANEL ─── see js/insights.js for rules */
.insights-panel { padding: 0; }
.insights-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: #FAFBFC;
}
.insights-title { font-family: 'Merriweather', serif; font-weight: 800; font-size: 1.02em; color: var(--ink); }
.insights-chips { display: flex; align-items: center; gap: 8px; }
.insights-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.insights-chip:hover { border-color: var(--ink); color: var(--ink); }
.insights-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.insights-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.insights-chip .dot.win { background: #16A34A; }
.insights-chip .dot.high { background: #DC2626; }
.insights-chip .dot.medium { background: #D97706; }
.insights-chip .dot.watch { background: #2563EB; }
.insights-actions { display: flex; gap: 8px; }
.insights-copy-btn {
  padding: 6px 14px; border: 1px solid var(--ink); background: var(--ink); color: #fff;
  border-radius: 6px; font-family: 'Figtree', sans-serif; font-weight: 700; font-size: 0.78rem;
  cursor: pointer; transition: opacity 0.15s;
}
.insights-copy-btn:hover { opacity: 0.85; }
.insights-copy-btn.copied { background: #16A34A; border-color: #16A34A; }
.insights-body { padding: 8px 0; max-height: 560px; overflow-y: auto; }
.insight-row {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: start;
  padding: 10px 20px; border-bottom: 1px solid #F3F4F6;
  cursor: pointer; transition: background 0.1s;
}
.insight-row:hover { background: #F9FAFB; }
.insight-row:last-child { border-bottom: none; }
.insight-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.insight-dot.win { background: #16A34A; }
.insight-dot.high { background: #DC2626; }
.insight-dot.medium { background: #D97706; }
.insight-dot.watch { background: #2563EB; }
.insight-body { min-width: 0; }
.insight-title { font-weight: 700; font-size: 0.86rem; color: var(--ink); margin-bottom: 2px; }
.insight-summary { font-size: 0.80rem; color: #4B5563; line-height: 1.5; }
.insight-meta {
  display: inline-flex; gap: 8px; margin-left: 8px; font-size: 0.72rem; color: var(--muted); font-weight: 600;
}
.insight-meta .rep { color: #7C3AED; }
.insight-impact {
  font-size: 0.74rem; color: var(--muted); font-weight: 700; white-space: nowrap; margin-top: 4px;
}
.insights-empty {
  padding: 40px 20px; text-align: center; color: var(--muted); font-size: 0.85rem;
}
.insights-show-more {
  display: block; width: 100%; padding: 10px 20px; text-align: center;
  background: #FAFBFC; border: none; border-top: 1px solid var(--border);
  font-family: 'Figtree', sans-serif; font-weight: 700; font-size: 0.78rem;
  color: var(--ink); cursor: pointer;
}
.insights-show-more:hover { background: #F3F4F6; }


/* ─── BRIEFING STRIP ─── rendered by js/insights.js renderBriefingStrip() */
.briefing-strip {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 20px 0 24px;
  padding: 0;
  box-shadow: 0 1px 0 rgba(3,15,20,0.02);
}
.briefing-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
}
.briefing-eyebrow {
  font-family: 'Figtree', sans-serif;
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted);
}
.briefing-headline {
  font-family: 'Merriweather', serif;
  font-size: 1.18rem; font-weight: 800; color: var(--ink);
  margin-top: 2px;
}
.briefing-actions { display: flex; align-items: center; gap: 8px; }
.briefing-action-btn {
  padding: 6px 14px; border-radius: 6px; font-family: 'Figtree', sans-serif;
  font-weight: 700; font-size: 0.78rem; cursor: pointer; transition: all 0.15s;
  border: 1px solid var(--border); background: #fff; color: var(--ink);
}
.briefing-action-btn:hover { border-color: var(--ink); }
.briefing-action-btn.primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.briefing-action-btn.primary:hover { opacity: 0.85; }
.briefing-action-btn.copied { background: #16A34A !important; border-color: #16A34A !important; color: #fff !important; }
.briefing-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
}
.briefing-card {
  padding: 18px 22px 20px; border-right: 1px solid var(--border);
  position: relative; cursor: pointer; transition: background 0.12s;
}
.briefing-card:last-child { border-right: none; }
.briefing-card:hover { background: #FAFBFC; }
.briefing-card::before {
  content: ''; position: absolute; top: 0; left: 22px; right: 22px; height: 3px;
}
.briefing-card.sev-win::before    { background: #16A34A; }
.briefing-card.sev-high::before   { background: #DC2626; }
.briefing-card.sev-medium::before { background: #D97706; }
.briefing-card.sev-watch::before  { background: #2563EB; }
.briefing-card-label {
  font-family: 'Figtree', sans-serif;
  font-size: 0.66rem; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase;
  margin-bottom: 8px;
}
.briefing-card.sev-win    .briefing-card-label { color: #16A34A; }
.briefing-card.sev-high   .briefing-card-label { color: #DC2626; }
.briefing-card.sev-medium .briefing-card-label { color: #D97706; }
.briefing-card.sev-watch  .briefing-card-label { color: #2563EB; }
.briefing-card-title {
  font-family: 'Merriweather', serif;
  font-size: 0.95rem; font-weight: 700; color: var(--ink);
  line-height: 1.35; margin-bottom: 6px;
}
.briefing-card-body {
  font-size: 0.82rem; color: #4B5563; line-height: 1.55;
}
.briefing-card-meta {
  margin-top: 10px; font-size: 0.72rem; color: var(--muted); font-weight: 700;
  display: flex; gap: 10px;
}
.briefing-empty {
  padding: 26px 22px; text-align: center; color: var(--muted); font-size: 0.85rem;
}
@media (max-width: 900px) {
  .briefing-cards { grid-template-columns: 1fr; }
  .briefing-card { border-right: none; border-bottom: 1px solid var(--border); }
  .briefing-card:last-child { border-bottom: none; }
}

/* ─── INSIGHTS OVERLAY (full list modal) ─── */
.insights-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(3,15,20,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 20px;
  overflow-y: auto;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.insights-overlay-box {
  background: #fff; border-radius: 12px; width: 100%; max-width: 900px;
  box-shadow: 0 24px 80px rgba(3,15,20,0.25);
  overflow: hidden;
}
.insights-overlay-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.insights-overlay-title {
  font-family: 'Merriweather', serif; font-size: 1.22rem; font-weight: 800; color: var(--ink);
}
.insights-overlay-sub { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.insights-overlay-close {
  background: none; border: none; font-size: 1.6rem; color: var(--muted);
  cursor: pointer; padding: 0 4px; line-height: 1; transition: color 0.12s;
}
.insights-overlay-close:hover { color: var(--ink); }

/* ─── INLINE SEVERITY DOTS on SKU Performance table ─── */
.sku-flag-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle;
  cursor: help;
}
.sku-flag-dot.win    { background: #16A34A; }
.sku-flag-dot.high   { background: #DC2626; }
.sku-flag-dot.medium { background: #D97706; }
.sku-flag-dot.watch  { background: #2563EB; }
.sku-flag-dot-spacer { display: inline-block; width: 8px; margin-right: 8px; }

/* ─── Flag filter segmented control (All / Concerns / Wins) ─── */
.tbl-flag-seg {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
  overflow: hidden;
}
.tbl-flag-btn {
  appearance: none; border: none; background: transparent;
  padding: 5px 11px; margin: 0;
  font-family: 'Figtree', sans-serif; font-size: 0.76rem; font-weight: 700;
  color: var(--muted); cursor: pointer; transition: all 0.12s;
  border-right: 1px solid var(--border);
}
.tbl-flag-btn:last-of-type { border-right: none; }
.tbl-flag-btn:hover { color: var(--ink); }
.tbl-flag-btn.active { background: var(--ink); color: #fff; }
.tbl-flag-count {
  display: inline-block; margin-left: 10px;
  font-family: 'Figtree', sans-serif; font-size: 0.74rem; font-weight: 700;
  color: var(--muted);
  opacity: 0; transition: opacity 0.15s;
}


/* ─── PORTFOLIO HEALTH headline (rendered above the briefing strip) ─── */
.portfolio-health {
  margin: 16px 0 12px;
}
.portfolio-health-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 12px 22px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ph-headline { display: inline-flex; align-items: baseline; gap: 12px; min-width: 0; }
.ph-pct {
  font-family: 'Merriweather', serif;
  font-size: 1.8rem; font-weight: 900; letter-spacing: -0.5px;
  line-height: 1;
}
.ph-pct.ph-green { color: #16A34A; }
.ph-pct.ph-amber { color: #D97706; }
.ph-pct.ph-red   { color: #DC2626; }
.ph-copy {
  font-family: 'Figtree', sans-serif;
  font-size: 0.84rem; color: #4B5563; font-weight: 500;
}
.ph-breakdown {
  display: inline-block; margin-left: 6px;
  color: var(--muted); font-size: 0.76rem; font-weight: 600;
}
.ph-signal {
  font-family: 'Figtree', sans-serif;
  font-size: 0.78rem; color: var(--muted); font-weight: 700;
  letter-spacing: 0.2px;
}
.ph-empty {
  padding: 14px 22px; border: 1px dashed var(--border); border-radius: 10px;
  color: var(--muted); font-size: 0.82rem; text-align: center;
}
