/* ================================================================
   06_toolbar.css
   Historical prices toolbar: pill controls, segmented controls,
   off-market toggle, filter buttons, episodes filters
   (Merged from z_historical_buttons.css + z_historical_toolbar.css)
   ================================================================ */

/* ─────────────────────────────────────────────────────────────────────
   32‑px tall action buttons & switches
   (✓ works with any prefix: eg “price‑metric‑aip‑btn”, “atc‑offcanvas‑open”…)
   ───────────────────────────────────────────────────────────────────── */
[id$="-aip-btn"],
[id$="-aup-btn"],
[id$="-adv-toggle-btn"],
[id$="-offcanvas-open"],
[id$="-advanced-date-offcanvas-open"] {
    height: 32px !important;
    min-height: 32px !important;      /* guard against Bootstrap overrides  */
    line-height: 30px !important;     /* keeps the label vertically centred */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* The “Off‑Market” toggle is a Checklist, not a <button>,
   so we style both the wrapper and the <input> inside it. */
[id$="-offmarket-switch"],
[id$="-offmarket-switch"] .form-check-input {
    height: 32px !important;
    min-height: 32px !important;
}

/* If the element itself is the <button> (most cases) this will suffice.
   But if you ever nest a .btn *inside* the wrapper, clamp that too. */
[id$="-aip-btn"] .btn,
[id$="-aup-btn"] .btn,
[id$="-adv-toggle-btn"].btn,
[id$="-offcanvas-open"].btn,
[id$="-advanced-date-offcanvas-open"].btn {
    height: 32px !important;
    line-height: 30px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.filter-label,
.filter-button,
.clear-filters,
.metric-label-btn,
#adv-toggle-btn,
[id$="-label"],          /* off‑market toggle label, etc.            */
[id$="-background"],     /* off‑market toggle bg cell                */
[id$="-offcanvas-open"]  /* covers all prefix-offcanvas-open buttons */
{
    height: 32px !important;
    min-height: 32px !important;
    line-height: 30px !important;   /* keeps text vertically centred   */
    padding-top: 0 !important;      /* trims extra space               */
    padding-bottom: 0 !important;
}

/* If the wrapper (InputGroup) itself was fixed at 39 px: */
.offmarket-toggle-container,
.filter-switch,
.input-group[style*="height: 39px"] {
    height: 32px !important;
}
/* ============================================================================
   Pill‑style filter controls
   ───────────────────────────────────────────────────────────────────────── */

/* The TEXT half (left) – fully rounded on its outside edge only */
/*  ────────────────────────────────────────────────────────────────
    Excel‑like pill filter
    – matches colour / roundness / elevation of .export-button
   ─────────────────────────────────────────────────────────────── */
/*  ────────────────────────────────────────────────────────────────
    Design tokens – re‑use the exact same values your Export button
   ─────────────────────────────────────────────────────────────── */
/*  ────────────────────────────────────────────────────────────────
    Filter‑pill  (label + icon)
    • shares typography / colours with .export-button
    • uses DISTINCT 8 px radius on the two exposed corners only
   ─────────────────────────────────────────────────────────────── */

/* 1. Design tokens – reuse your global blue + corner radius values */
:root {
    --filter-blue:  #00509e;   /* same blue as .export-button           */
    --filter-radius: 8px;      /* ≈ corner radius in your screenshot    */
}

/* 2. Shared typography / sizing for BOTH halves */
.pill-left,
.pill-right {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: normal;
    height: 32px;              /* matches toolbar height                */
    padding: 0 0.7rem;

    border: 0.5px solid var(--filter-blue);
    transition: background-color .3s ease, color .3s ease;
}

/* 3. LEFT half – white fill, blue text, rounded outer edge only */
.pill-left {
    color: var(--filter-blue);
    background: #fff;

    border-right: 0;                 /* weld to the icon half          */
    border-top-left-radius:  var(--filter-radius) !important;
    border-bottom-left-radius: var(--filter-radius) !important;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
/* 4 ▸ RIGHT‑hand half  –  fixed blue in ALL states
   ────────────────────────────────────────────────────────────── */
.pill-right{
    /* base look */
    background: var(--filter-blue) !important;
    color: #fff !important;
    border: 0.5px solid var(--filter-blue) !important;

    /* stop Bootstrap from substituting a darker tint */
    --bs-btn-bg:           var(--filter-blue);
    --bs-btn-border-color: var(--filter-blue);
    --bs-btn-hover-bg:     var(--filter-blue);
    --bs-btn-active-bg:    var(--filter-blue);
    --bs-btn-hover-border-color:  var(--filter-blue);
    --bs-btn-active-border-color: var(--filter-blue);

    /* remove the darkening vignette some themes add */
    box-shadow: none !important;
    filter: none !important;
}

/* same colour on hover / active / focus */
.pill-right:hover,
.pill-right:active,
.pill-right.active,
.pill-right:focus,
.pill-right:focus-visible{
    background: var(--filter-blue) !important;
    border-color: var(--filter-blue) !important;
    color: #fff !important;
    box-shadow: none !important;   /* no inset‑shadow */
    filter: none !important;       /* no brightness() tweak */
}

/* if the component also carries the .btn class, catch that too */
.pill-right.btn,
.pill-right.btn:hover,
.pill-right.btn:active,
.pill-right.btn.active{
    background: var(--filter-blue) !important;
    border-color: var(--filter-blue) !important;
    color: #fff !important;
}
.clear-filters:active{
    background: var(--filter-blue) !important;
    border-color: var(--filter-blue) !important;
    color: #fff !important;
    filter: brightness(0.95);
}
/* 5. Hover / active – both halves become blue with white text   */
.pill-left:hover,
.pill-right:hover,
.pill-left:active,
.pill-right:active,
.pill-left.active,
.pill-right.active {
    background: #00509e;
    color: #fff;
}

/* 6. Undo Bootstrap’s radius‑reset inside InputGroup            */
.pill-control > .pill-left,
.pill-control > .pill-right { border-radius: 0; }

.pill-control > .pill-left  {
    border-top-left-radius:  var(--filter-radius) !important;
    border-bottom-left-radius: var(--filter-radius) !important;
}
.pill-control > .pill-right {
    border-top-right-radius:  var(--filter-radius) !important;
    border-bottom-right-radius: var(--filter-radius) !important;
}
:root {
    --filter-blue: #00509e;   /* master brand blue                       */
    --filter-radius: 6px;
}

/* ─────────────────────────────────────────────────────────────
   DATE‑picker right half
   ───────────────────────────────────────────────────────────── */
.date-right,
.date-right:hover,
.date-right:focus,
.date-right:active {
    background: var(--filter-blue) !important;
    border: 0.5px solid var(--filter-blue) !important;
    color: #fff !important;          /* icon inherits currentColor         */

    border-top-right-radius:  var(--filter-radius) !important;
    border-bottom-right-radius:  var(--filter-radius) !important;
}
.date-right svg,
.date-right .iconify {          /* Iconify wraps the svg in <span class="iconify"> */
    position: relative;
    top: -2px;                  /* ↑ move up; use -2px if you want a bit more */
    /* or: transform: translateY(-1px);  — identical visual result */
}
/* ─────────────────────────────────────────────────────────────
   OFF‑MARKET toggle right half
   ───────────────────────────────────────────────────────────── */
.toggle-right,
.toggle-right:hover,
.toggle-right:focus,
.toggle-right:active {
    background: var(--filter-blue) !important;
    border: 0.5px solid var(--filter-blue) !important;
    color: #fff !important;
        border-top-right-radius:  var(--filter-radius) !important;
    border-bottom-right-radius:  var(--filter-radius) !important;
}

/* NEW: vertical nudge */
.toggle-right .form-check-input {
    /*margin: 0;                 /* you already have this – keep it        */
    /*position: relative;        /* Bootstrap already sets this, but safe  */
    top: 2px;                  /* ↓ move the whole toggle 2 px down      */
    /* or: transform: translateY(2px);  ← same visual result             */
}
.toggle-right .form-check-input,
.toggle-right .form-check-input:checked {
    background-color: #fff;          /* white track                         */
    border-color: #fff;
}
.toggle-right .form-check-input:checked::before {
    background-color: var(--filter-blue);   /* blue thumb on white track     */
}

.ag-theme-alpine .ag-overlay-no-rows-center {
  color: var(--gray-700);
  font-weight: 500;
  background: linear-gradient(0deg, var(--blue-050), transparent);
  border: 1px dashed color-mix(in srgb, var(--blue-500) 35%, transparent);
  border-radius: 2px;
  padding: .6rem .9rem;
}

.ag-header-cell-label .ag-sort-order {
  display: none !important;
}

.custom-ag-grid.grid-hidden {
  opacity: 0;
  pointer-events: none;
}
.custom-ag-grid.grid-visible {
  opacity: 1;
  transition: opacity .12s ease-in !important;
}
/* Hide the hamburger by default; reveal on hover/focus only */

.custom-ag-grid.grid-visible .ag-header-cell:hover .ag-icon-menu,
.custom-ag-grid.grid-visible .ag-header-cell.ag-header-cell-focus .ag-icon-menu {
  opacity: 1;
}


.timeline-pill{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Optional: progressively tighten on smaller screens */
@media (max-width: 1200px){
  #packs-chosen-display, #date-selection-display { max-width: 200px; }
}
@media (max-width: 1100px){
  #packs-chosen-display, #date-selection-display { max-width: 170px; }
}
@media (max-width: 992px){
  /* hide the date pill on very narrow screens to avoid overflow */
  #date-selection-display { display: none; }
}

._dash-loading, #_dash-loading { display: none !important; }


.dropdown-menu-dark .dropdown-item.active,
.dropdown-menu-dark .dropdown-item:active {
  background-color: rgba(255,255,255,.10) !important;
  color: #fff !important;
}
.dropdown-menu-dark .dropdown-item:hover {
  background-color: rgba(255,255,255,.06);
}


.ag-link-cell { white-space: nowrap; text-decoration: underline; cursor: pointer; }

#filters-card .aligned-radios .form-check {
  padding-left: 0;      /* remove Bootstrap’s default indent */
  margin-bottom: 0;
}
#filters-card .aligned-radios .form-check-input {
  margin-left: 0;       /* bullet starts at x = 0 */
  margin-right: .4rem;  /* small space before label text */
}
#filters-card .aligned-radios.form-check-inline,
#filters-card .aligned-radios .form-check-inline {
  margin-right: 1rem;   /* even gap between options */
}

/* === Filters – brand styling =================================================
   Uses project tokens defined in :root (blue/gray scale + semantic colors)
   Safe to paste after Bootstrap; only targets the left filter card.
============================================================================= */

/* Card header + section titles */
#filters-card .custom-card-header {
  background: var(--blue-050);
  color: var(--blue-700);
  border-bottom: 1px solid var(--gray-200);
}
#filters-card .section-title { font-weight: 600; color: var(--blue-700); }
#filters-card .filters-divider { border-top: 1px solid var(--gray-200); margin: .35rem 0 .5rem; }

/* Sticky area: subtle fade separator */
#filters-card .sticky-top-block::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,.06), transparent);
  pointer-events: none;
}

/* Buttons & badges in header */
#filters-card .clear-filters.btn {
  --btn-border: var(--gray-200);
  --btn-hover-bg: var(--blue-050);
  --btn-hover-border: var(--blue-600);
  font-size: .8rem; padding: .15rem .5rem; border-color: var(--btn-border);
}
#filters-card .clear-filters.btn:hover { background: var(--btn-hover-bg); border-color: var(--btn-hover-border); }
#filters-card .badge.bg-primary,
#filters-card .badge.text-bg-primary,
#filters-card .badge.badge-primary {
  background: var(--blue-600);
}

/* Links (e.g., “More product filters”) */
#filters-card .btn-link { color: var(--blue-600); }
#filters-card .btn-link:hover { color: var(--blue-700); text-decoration: none; }

/* Compact dropdowns (dcc.Dropdown – react-select DOM) */
#filters-card .dd-compact .Select-control {
  min-height: 32px; height: 32px; border-color: var(--gray-200);
}
#filters-card .dd-compact .Select-input { height: 30px; }
#filters-card .dd-compact .Select-placeholder,
#filters-card .dd-compact .Select--single > .Select-control .Select-value {
  line-height: 30px; padding-left: 6px; padding-right: 6px;
}
#filters-card .dd-compact .Select-value-label { font-size: .9rem; }
#filters-card .Select-control:hover { border-color: var(--blue-600); }
#filters-card .is-focused:not(.is-open) > .Select-control {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 .15rem rgba(0,80,158,.20); /* blue-600 focus ring */
}
#filters-card .Select-menu-outer { border-color: var(--blue-600); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
#filters-card .Select-option.is-focused { background: var(--blue-050); color: var(--gray-900); }
#filters-card .Select-option.is-selected { background: var(--blue-100); color: var(--blue-700); }

/* Segmented radios (dbc.RadioItems) */
#filters-card .aligned-radios .form-check-inline { margin-right: .25rem; }
#filters-card .aligned-radios .form-check-input { position: absolute; opacity: 0; }
#filters-card .aligned-radios .form-check-label {
  display: inline-block; padding: .15rem .6rem; border: 1px solid var(--gray-200);
  border-radius: 9999px; cursor: pointer; user-select: none; transition: all .12s ease-in-out;
  background: #fff; color: var(--gray-700);
}
#filters-card .aligned-radios .form-check-label:hover { background: var(--blue-050); border-color: var(--blue-600); }
#filters-card .aligned-radios .form-check-input:focus + .form-check-label {
  box-shadow: 0 0 0 .15rem rgba(0,80,158,.20);
  border-color: var(--blue-600);
}
#filters-card .aligned-radios .form-check-input:checked + .form-check-label {
  background: var(--blue-100);
  border-color: var(--blue-600);
  color: var(--blue-600);
}
#filters-card .aligned-radios .form-check-input:disabled + .form-check-label {
  color: var(--gray-500); background: var(--gray-050); border-color: var(--gray-200); cursor: not-allowed;
}

/* Label and helper text colors */
#filters-card small.text-muted { color: var(--gray-700) !important; opacity: .85; }

/* Card body background for contrast against page grid */
#filters-card .card-body { background: #fff; }

/* Optional: unify DataTable header inside filters (if you add any tables later) */
#filters-card .dash-table-container .dash-header {
  background: var(--blue-050); color: var(--blue-700);
}

/* Prefer reduced motion: remove transitions if the user asks */
@media (prefers-reduced-motion: reduce) {
  #filters-card .aligned-radios .form-check-label { transition: none; }
}
/* Equal‑width segmented radio buttons (works for 2 or more options) */
#filters-card .aligned-radios{
  display: flex;             /* lay items in one row */
  gap: .375rem;              /* spacing between pills */
  align-items: stretch;
  flex-wrap: nowrap;
}
#filters-card .aligned-radios .form-check-label{
  border-radius: var(--bs-border-radius, .375rem) !important; /* matches Bootstrap btn radius */
}

.btn.segmented:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}
#filters-card .aligned-radios .form-check-inline{
  margin-right: 0 !important;/* override Bootstrap inline spacing */
  flex: 1 1 0;               /* make all options share the width evenly */
  display: flex;             /* so the label can fill the item */
}

#filters-card .aligned-radios .form-check-label{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;   /* center the text */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 34px;          /* consistent height */
  padding: 0 .75rem;         /* consistent horizontal padding */
  border-radius: 9999px;     /* keep pill look */
}


/* ───────────────────────────────────────────────────────────────
   TOP TOOLBAR — square-ish segmented buttons with small spacing
   (override the previous pill style)
   ─────────────────────────────────────────────────────────────── */
/* ───────────────────────────────────────────────────────────────
   TOP TOOLBAR — segmented buttons styled like the left-rail radios
   (keeps buttons for logic, but copies the radio pill visuals)
   ─────────────────────────────────────────────────────────────── */
#top-toolbar .segmented-group .btn {
  height: 32px;                /* same vertical rhythm */
  line-height: 30px;
  padding: 0 .65rem;           /* compact text fit     */
  font-size: .92rem;
  font-weight: 500;
  border-radius: 9999px;       /* pill endcaps */
  box-shadow: none !important;
}

/* tighten the seam between segments */
#top-toolbar .segmented-group .btn + .btn { margin-left: -1px; }

/* make the segments share the endcaps */
#top-toolbar .segmented-group .btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
#top-toolbar .segmented-group .btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* INACTIVE segment — white bg, gray border, blue text (like radios) */
#top-toolbar .segmented-group .btn-outline-primary:not(.active) {
  background: #fff !important;
  color: var(--blue-600) !important;       /* radio label color */
  border-color: var(--gray-200) !important;
}

/* HOVER (inactive) – subtle, like radios */
#top-toolbar .segmented-group .btn-outline-primary:not(.active):hover {
  background: var(--blue-050) !important;
  border-color: var(--blue-600) !important;
  color: var(--blue-600) !important;
}

/* ACTIVE segment — light-blue bg, blue text/border (like radios) */
#top-toolbar .segmented-group .btn-outline-primary.active {
  background: var(--blue-100) !important;
  color: var(--blue-600) !important;
  border-color: var(--blue-600) !important;
}

/* Focus ring matches your left-rail radios */
#top-toolbar .segmented-group .btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 .15rem rgba(0,80,158,.20) !important;
}

#top-toolbar .segmented-group{
  /* knobs */
  --seg-gap: .375rem;                            /* space between buttons    */
  --seg-radius: var(--filter-radius, 6px);       /* same square-ish radius   */

  display: inline-flex;                          /* ensure gap works         */
  gap: var(--seg-gap);                           /* modern browsers          */
}

/* square-ish ends on every segment */
#top-toolbar .segmented-group .btn{
  border-radius: var(--seg-radius) !important;
}

/* kill Bootstrap’s weld and our earlier -1px rule, add real spacing */
#top-toolbar .segmented-group .btn + .btn{
  margin-left: var(--seg-gap) !important;
}

/* optional: make the outline a touch calmer to match the rest */
#top-toolbar .segmented-group .btn-outline-primary{
  border-color: var(--gray-300, var(--gray-200)) !important;
}
/* ──────────────────────────────────────────────────────────────────
   TOP TOOLBAR — snappier segmented controls + correct text centering
   (square‑ish corners and a small gap between options)
   ────────────────────────────────────────────────────────────────── */

#top-toolbar .segmented-group,
#top-toolbar .aligned-radios{
  /* layout */
  display: flex;
  align-items: center;
  gap: .375rem;                       /* small separation between items   */
  flex-wrap: nowrap;
}

/* Reset Bootstrap’s spacing inside each item */
#top-toolbar .aligned-radios .form-check{
  padding-left: 0;
  margin-bottom: 0;
}

/* Hide the actual radio and drive styles from its label */
#top-toolbar .aligned-radios .form-check-input{
  position: absolute;
  opacity: 0;
}

/* Square‑ish buttons: exact height + centered label, no transition lag */
#top-toolbar .segmented-group .btn,
#top-toolbar .aligned-radios .form-check-label{
  height: 32px;
  min-height: 32px;
  padding: 0 .75rem;
  border-radius: 6px !important;      /* more square to match other UI    */
  display: inline-flex;               /* vertical centering for the text  */
  align-items: center;
  justify-content: center;
  line-height: 1;                     /* rely on flex for centering       */

  /* remove the “press delay” from Bootstrap transitions */
  transition: none !important;
  -webkit-transition: none !important;
}

/* Base / hover / checked states (keep your palette) */
#top-toolbar .aligned-radios .form-check-label{
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-300, var(--gray-200));
}
#top-toolbar .aligned-radios .form-check-label:hover{
  background: var(--blue-050);
  border-color: var(--blue-600);
}
#top-toolbar .aligned-radios .form-check-input:checked + .form-check-label{
  background: var(--blue-100);
  color: var(--blue-700);
  border-color: var(--blue-600);
}

/* Optional: calmer focus ring to match the rest of the UI */
#top-toolbar .aligned-radios .form-check-input:focus + .form-check-label{
  box-shadow: 0 0 0 .15rem rgba(0,80,158,.20);
  border-color: var(--blue-600);
}

/* If you render real <Button>s instead of RadioItems, keep them consistent */
#top-toolbar .segmented-group .btn-outline-primary{
  border-color: var(--gray-300, var(--gray-200)) !important;
}
#top-toolbar .segmented-group .btn,
#top-toolbar .segmented-group .btn:hover,
#top-toolbar .segmented-group .btn:active,
#top-toolbar .segmented-group .btn.active{
  transition: none !important;        /* instant state change             */
  box-shadow: none;                    /* avoid press “lag” shadow         */
}
/* Filters header: number-first active counter */
/* Slightly larger, calm pill (unchanged from before) */
/* Make the "1 Active" block align on the middle */
#filters-card .filters-active{
  display: inline-flex;      /* ← key change */
  align-items: center;       /* vertical centering */
}

/* The hairline divider */
#filters-card .filters-active::before{
  content: "";
  display: block;            /* as a flex item */
  width: 1px;
  height: 1em;               /* tie to text size for perfect centering */
  background: rgba(0,0,0,.12);
  margin: 0 .5rem 0 .625rem; /* space from “Filters” and the pill */
  border-radius: 1px;
}

/* (unchanged) the count pill style you already have */
#filters-card .count-pill{
  background-color: var(--blue-050) !important;
  color: var(--blue-700) !important;
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.05;
  min-width: 1.35rem;
  text-align: center;
  padding: .05rem .50rem;
}
#filters-card .count-pill--lead{ font-size: .95rem; }


/* ──────────────────────────────────────────────────────────────────────────
   Episodes quick filters: segmented buttons + compact dropdown
   File: assets/shortages_historical.css
   ────────────────────────────────────────────────────────────────────────── */

/* Accent + neutrals (matches your COL_HIGHLIGHT #1557a2) */
:root {
  --cp-accent: #1557a2;                  /* highlight */
  --cp-accent-tint: rgba(21,87,162,.12); /* chip-like background */
  --cp-accent-brd:  rgba(21,87,162,.35);
  --cp-fg:   #334155;                    /* slate-700 */
  --cp-bg:   #f8fafc;                    /* slate-50 */
  --cp-bg-h: #f1f5f9;                    /* slate-100 */
  --cp-brd:  #cbd5e1;                    /* slate-300 */
  --cp-brd-h:#b6c0ce;                    /* hover border */
  --cp-focus: 0 0 0 2px rgba(21,87,162,.35);
}

/* Quick-filter buttons */
.epf-btn {
  --btn-h: 32px;
  height: var(--btn-h);
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--cp-brd) !important;
  background: var(--cp-bg) !important;
  color: var(--cp-fg) !important;
  line-height: calc(var(--btn-h) - 2px);
  font-weight: 600;
  font-size: .875rem;
  box-shadow: none !important;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.epf-btn:hover {
  background: var(--cp-bg-h) !important;
  border-color: var(--cp-brd-h) !important;
}

.epf-btn:active {
  background: #e2e8f0 !important;       /* slate-200 */
}

.epf-btn:focus-visible {
  outline: 0;
  box-shadow: var(--cp-focus) !important;
  border-color: var(--cp-accent) !important;
}

/* Selected/pressed look */
.epf-btn--selected,
.epf-btn[aria-pressed="true"] {
  background: var(--cp-accent-tint) !important;
  border-color: var(--cp-accent-brd) !important;
  color: var(--cp-accent) !important;
}

/* Keep pills comfortably spaced when adjacent (optional) */
#sh_hist-ep-filter-btns .epf-btn + .epf-btn { margin-left: 6px; }

/* Compact dcc.Dropdown (react-select v1) */
.dd-compact .Select-control {
  min-height: 32px;
  height: 32px;
  border-radius: 8px;
  border-color: var(--cp-brd);
  box-shadow: none;
}

.dd-compact.Select.is-focused > .Select-control {
  border-color: var(--cp-accent);
  box-shadow: var(--cp-focus);
}

.dd-compact .Select-placeholder,
.dd-compact .Select-value-label {
  line-height: 30px;                     /* 32px minus borders */
  font-size: .875rem;
  color: #475569;                        /* slate-600 */
}

.dd-compact .Select-input { height: 30px; }

.dd-compact .Select-arrow-zone { padding-right: 8px; }
.dd-compact .Select-arrow {
  border-top-color: var(--cp-fg) !important; /* darker arrow */
}

/* Menu / options */
.dd-compact .Select-menu-outer {
  border: 1px solid var(--cp-brd);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 10050;                        /* above offcanvas, etc. */
}

.dd-compact .Select-option {
  padding: 6px 10px;
  font-size: .875rem;
}

.dd-compact .Select-option.is-focused {
  background: var(--cp-accent-tint);
}

.dd-compact .Select-option.is-selected {
  background: rgba(21,87,162,.16);
  color: var(--cp-accent);
}

/* Multi-select niceties (harmless if not used) */
.dd-compact.Select--multi .Select-control { height: auto; min-height: 32px; }
.dd-compact.Select--multi .Select-value   { margin-top: 2px; margin-bottom: 2px; }
.dd-compact.Select--multi .Select-value-icon { color: var(--cp-accent); }
/* Sticky control bar in the episodes offcanvas */
.sh-epbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  padding: 8px 6px 10px;
  border-bottom: 1px solid #e9ecef;
}

/* Pill buttons: subtle segmented-control look */
.epf-btn{
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  color: #2b3035;
  padding: .38rem .85rem;
  line-height: 1.1;
  transition: background-color .15s ease, box-shadow .15s ease, color .15s ease, border-color .15s ease;
}
.epf-btn:hover{
  background: #eef5fd;
  border-color: #cfe1f9;
}
.epf-btn.epf-btn--selected{
  background: #eef5fd;
  color: #1557a2;
  border-color: #cfe1f9;
  box-shadow: 0 0 0 2px rgba(21,87,162,.08) inset;
}

/* Compact, rounded dropdown to match pill height */
.ep-sort .Select-control{
  min-height: 36px;
  border-radius: 12px;
  border-color: #dbe4f0;
  box-shadow: none !important;
}
.ep-sort .Select-placeholder,
.ep-sort .Select-value{
  line-height: 34px;
  padding-left: 10px;
}
.ep-sort .Select-menu-outer{
  border-radius: 10px;
  border-color: #dbe4f0;
}
.ep-sort .Select-option.is-focused{
  background: #eef5fd;
}

/* ── Historic Toolbar Overrides (was: z_historical_toolbar.css) ─ */
/* ==========================================================================
   Historic Toolbar — FULL CSS (targets your exact Python markup)
   ========================================================================== */

/* ---------- Tokens -------------------------------------------------------- */
:root{
  --brand:        #00509e;
  --brand-600:    #004487;
  --surface:      #ffffff;

  --control-h:    32px;               /* control height */
  --radius:       8px;                /* squarish corners */
  --focus-ring:   0 0 0 3px rgba(0,80,158,.25);

  /* Off‑market knob fine‑tuning (positive pushes the switch DOWN) */
  --switch-y-offset: 0px;

  /* More‑filters badge fine‑tuning (positive pushes the badge DOWN) */
  --adv-badge-y: 2px;

  /* Shared effects */
  --hover-shadow: 0 2px 8px rgba(0,80,158,.18);
  --press-inset:  inset 0 1px 3px rgba(0,0,0,.12);
}

/* Normalize heights across the bar */
#historic-toolbar .btn,
#historic-toolbar .input-group-text{
  height: var(--control-h);
  display: inline-flex;
  align-items: center;
  line-height: calc(var(--control-h) - 2px);
}

/* ==========================================================================
   Generic pill (label + right piece)
   ========================================================================== */
.pill-control{
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-radius: var(--radius);
  background: var(--surface);
}

.pill-control .pill-left{
  border-radius: var(--radius) 0 0 var(--radius) !important;
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
  font-weight: 600;
  padding: 0 .70rem;
}

.pill-control .pill-right{
  border-radius: 0 var(--radius) var(--radius) 0 !important;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-left: 0;
  padding: 0 .60rem;
  transition: background-color .12s ease, box-shadow .15s ease, transform .06s ease;
}
/* Hover/press ONLY on the right tile (wrapper stays still) */
.pill-control .pill-right:hover{
  background: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: var(--hover-shadow);
}
.pill-control .pill-right:active{
  transform: translateY(0);
  box-shadow: var(--press-inset);
}
.pill-control .pill-right:focus-visible{
  outline: 0;
  box-shadow: var(--focus-ring);
}

/* ==========================================================================
   OFF‑MARKET — blue right tile + true vertical centering
   ========================================================================== */
#offmarket-background.toggle-socket{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  min-width: 3.2rem;
  padding: 0;
  border-left: 0;
  border: 1px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0 !important;
  background: var(--brand);
  color: #fff;
  overflow: visible;
}

#offmarket-background .offmarket-switch-input{ width:100%; height:100%; }
#offmarket-background .offmarket-switch-input .form-check{
  margin:0 !important; padding:0 !important;
  width:100%; height:100%;
}
#offmarket-background .offmarket-switch-input .form-switch{ padding-left:0 !important; }

#offmarket-background input.form-check-input{
  position: absolute !important;
  top: calc(50% + var(--switch-y-offset)) !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  float: none !important;
  width: 2.5rem;
  height: 1.4rem;
  box-shadow: none;
}
#offmarket-background input.form-check-input:checked{
  background-color: var(--brand);
  border-color: var(--brand);
}
#offmarket-background input.form-check-input:focus{
  box-shadow: var(--focus-ring);
}

/* ==========================================================================
   PRICE TYPE — segmented control (group lifts; segments stay put)
   ========================================================================== */
.control--seg{
  display: inline-flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  overflow: hidden;
  height: var(--control-h);
  min-height: var(--control-h);
  box-sizing: border-box;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease;
}

/* Group hover/press → match Clear all */
.control--seg:hover{
  transform: translateY(-1px);
  box-shadow: var(--hover-shadow);
}
.control--seg:active{
  transform: translateY(-1px);          /* no downward jump */
  box-shadow: var(--press-inset);
}

/* Label */
.control--seg .control-label{
  display: inline-flex;
  align-items: center;
  height: var(--control-h);
  min-height: var(--control-h);
  box-sizing: border-box;
  padding: 0 .65rem;
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  border: 0;
}

/* Segment wrapper (keeps the internal divider) */
.control--seg .seg-wrap{
  display: inline-flex;
  align-items: stretch;
  border-left: 1px solid var(--brand);  /* seam next to the label */
  background: #fff;
}

/* Segments (PPP / PRP) — static height, no translate on hover */
.control--seg .segmented .seg-btn{
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  height: var(--control-h);
  min-height: var(--control-h);
  line-height: calc(var(--control-h) - 2px);
  box-shadow: none;
  padding: 0 .70rem;
  transition: background-color .12s ease, color .12s ease, box-shadow .12s ease; /* no transform */
}

/* Divider between PPP and PRP */
.control--seg .segmented .seg-btn + .seg-btn{
  border-left: 1px solid var(--brand);
}
/* Slightly darken the divider on group hover (keeps it crisp) */
.control--seg:hover .segmented .seg-btn + .seg-btn{
  border-left-color: var(--brand-600);
}

/* Active segment */
.control--seg .segmented .seg-btn.is-active{
  background: var(--brand);
  color: #fff;
}
/* Keep a visible seam when right segment is active */
.control--seg .segmented .seg-btn.is-active:nth-child(2){
  box-shadow: -1px 0 0 var(--brand-600) inset;
}

/* No lift or glow on segment hover/press (prevents tiny wobble) */
.control--seg .segmented .seg-btn:hover,
.control--seg .segmented .seg-btn:active{
  transform: none !important;
  box-shadow: none !important;
}
.control--seg .segmented .seg-btn:focus-visible{
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ==========================================================================
   Extras: Export styles
   ========================================================================== */
.clear-filters[disabled]{ opacity:.45; cursor:not-allowed; }

#historic-controls-card .export-button.btn{
  border-color: var(--brand);
  color: var(--brand);
}
#historic-controls-card .export-button.btn:hover{
  background: var(--brand);
  color:#fff;
}

/* Export spinner only (scoped by id) */
#loading-export .dash-spinner-container{ background-color: transparent !important; pointer-events: none; }
#grid-wrapper .dash-spinner-container{ background-color: transparent !important; }

/* AG Grid visibility helpers */
.custom-ag-grid.grid-hidden .ag-root-wrapper{ visibility: hidden; }
.custom-ag-grid.grid-visible .ag-root-wrapper{ visibility: visible; }

/* Brand spinner on export (unique id from Dash) */
#pi-cs__loading_export__8b2a3 .dash-spinner-container{
  background-color: transparent !important;
  pointer-events: none !important;
  z-index: 2000 !important;
}

/* ==========================================================================
   32‑px tall action buttons & switches
   ========================================================================== */
[id$="-aip-btn"],
[id$="-aup-btn"],
[id$="-offcanvas-open"],
[id$="-advanced-date-offcanvas-open"],
.clear-filters,
.metric-label-btn,
#adv-toggle-btn,
[id$="-label"],
[id$="-background"]{
  height: var(--control-h) !important;
  min-height: var(--control-h) !important;
  line-height: 30px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.offmarket-toggle-container,
.filter-switch,
.input-group[style*="height: 39px"]{ height: var(--control-h) !important; }

/* ==========================================================================
   Icon‑only filter triggers
   ========================================================================== */
.pill-right[id$="-offcanvas-open"]{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; min-width: 32px; height: 32px;
  padding: 0;
}
.pill-right[id$="-offcanvas-open"] :is(.iconify, iconify-icon, svg){
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  font-size: 16px !important;      /* so 1em = 16px */
  color: #fff !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}
.pill-right[id$="-offcanvas-open"] > :not(.iconify):not(iconify-icon):not(svg){ display: none !important; }
.pill-right[id$="-offcanvas-open"]::before,
.pill-right[id$="-offcanvas-open"]::after{ content: none !important; background: none !important; }

/* ==========================================================================
   Minor UI polish for AG Grid / DataTable
   ========================================================================== */
.ag-theme-alpine .ag-overlay-no-rows-center{
  color: var(--gray-700);
  font-weight: 500;
  background: linear-gradient(0deg, var(--blue-050), transparent);
  border: 1px dashed color-mix(in srgb, var(--blue-500) 35%, transparent);
  border-radius: 2px;
  padding: .6rem .9rem;
}
.ag-header-cell-label .ag-sort-order{ display: none !important; }
.custom-ag-grid.grid-hidden{ opacity: 0; pointer-events: none; }
.custom-ag-grid.grid-visible{ opacity: 1; transition: opacity .12s ease-in !important; }


/* Small responsive tweaks for chip row */
.timeline-pill{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1200px){ #packs-chosen-display, #date-selection-display { max-width: 200px; } }
@media (max-width: 1100px){ #packs-chosen-display, #date-selection-display { max-width: 170px; } }
@media (max-width: 992px){ #date-selection-display { display: none; } }

/* Dash global loader off */
._dash-loading, #_dash-loading { display: none !important; }

/* Dropdown palette alignments (optional) */
.dropdown-menu-dark .dropdown-item.active,
.dropdown-menu-dark .dropdown-item:active{ background-color: rgba(255,255,255,.10) !important; color: #fff !important; }
.dropdown-menu-dark .dropdown-item:hover{ background-color: rgba(255,255,255,.06); }

.ag-link-cell{ white-space: nowrap; text-decoration: underline; cursor: pointer; }

/* --- Advanced filters usage indicator (badge) ----------------------------- */
.hist-toolbar #adv-active-count{
  display: none;               /* shown by callback when >0 */
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 .3rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.1rem;
  background: var(--brand) !important;
  color: #fff !important;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   “More filters” — consistent with Clear all (fills on hover)
   ========================================================================== */

/* Keep outline-secondary in brand blue in ALL states (base) */
#historic-toolbar .hist-btn.btn-outline-secondary{
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: var(--brand);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-color: var(--brand);
  --bs-btn-active-bg: #fff;
  --bs-btn-active-border-color: var(--brand-600);

  color: var(--brand);
  border-color: var(--brand);
  background-color: #fff;
}

/* Base look for the More filters button */
#historic-toolbar #adv-toggle-btn{
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: none;
  transition: transform .08s ease, box-shadow .12s ease,
              background-color .12s ease, color .12s ease, border-color .12s ease;

  /* ensure identical vertical sizing to pill controls */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: var(--control-h) !important;
  min-height: var(--control-h) !important;
  line-height: calc(var(--control-h) - 2px) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box;
}

/* Hover (fill + lift) */
#historic-toolbar #adv-toggle-btn:hover,
#historic-toolbar #adv-toggle-btn.is-open:hover{
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: var(--hover-shadow);
}

/* Focus (no halo) */
#historic-toolbar #adv-toggle-btn:focus,
#historic-toolbar #adv-toggle-btn:focus-visible,
#historic-toolbar #adv-toggle-btn:active:focus{
  outline: 0; box-shadow: none;
}

/* Pressed: keep at hover height (no downward jump) */
#historic-toolbar #adv-toggle-btn:active{
  transform: translateY(-1px) !important;
  background: var(--brand-600);
  color: #fff;
  border-color: var(--brand-600);
  box-shadow: var(--press-inset);
}

/* Open state baseline remains identical to closed */
#historic-toolbar #adv-toggle-btn.is-open{
  background: #fff; color: var(--brand); border-color: var(--brand); box-shadow: none;
}

/* Badge inside the button: blue, centered, and nudged DOWN slightly */
#historic-toolbar #adv-toggle-btn .badge,
#historic-toolbar #adv-toggle-btn #adv-active-count{
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  height: 1.15rem !important;
  min-width: 1.15rem !important;
  padding: 0 .35rem !important;
  line-height: 1.15rem !important;
  font-size: .75rem !important;
  font-weight: 600 !important;

  background: var(--brand) !important;
  color: #fff !important;
  border: 0 !important;

  vertical-align: middle !important;
}

/* Unify small action buttons (Clear/More/Export) */
#historic-toolbar .hist-btn.btn{
  --bs-btn-padding-y: 0rem;
  --bs-btn-padding-x: .60rem;
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--radius);

  height: var(--control-h);
  min-height: var(--control-h);

  padding: 0 var(--bs-btn-padding-x);
  font-weight: 600;

  transition: background-color .12s ease,
              border-color .12s ease,
              box-shadow .15s ease,
              transform .06s ease;
}

/* Global hover lift and soft shadow for hist buttons only */
#historic-toolbar .hist-btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--hover-shadow);
}

/* Pressed */
#historic-toolbar .hist-btn:active,
#historic-toolbar .hist-btn.active{
  transform: translateY(0);
  box-shadow: var(--press-inset);
  font-weight: 600;
}
/* ──────────────────────────────────────────────────────────────
   Price type segmented control — NO hover/press lift on group
   (PPP/PRP already have no per-button lift)
   Place AFTER existing rules.
   ────────────────────────────────────────────────────────────── */

/* Stop the group from lifting or showing a shadow on hover/press */
#historic-toolbar .control--seg,
#historic-toolbar .control--seg:hover,
#historic-toolbar .control--seg:active {
  transform: none !important;
  box-shadow: none !important;
}

/* Keep the internal divider stable (prevents the faint line change) */
#historic-toolbar .control--seg .segmented .seg-btn + .seg-btn,
#historic-toolbar .control--seg:hover .segmented .seg-btn + .seg-btn {
  border-left-color: var(--brand) !important;
}

/* Segments remain fixed height and shadowless (defensive) */
#historic-toolbar .control--seg .segmented .seg-btn:hover,
#historic-toolbar .control--seg .segmented .seg-btn:active {
  transform: none !important;
  box-shadow: none !important;
}

/* ── Compact pills inside the historical toolbar so everything fits one row ── */
.hist-toolbar .pill-left,
.hist-toolbar .pill-right {
  font-size: 0.92rem;
  padding: 0 0.5rem;
}
.hist-toolbar .hist-btn.clear-filters {
  font-size: 0.92rem;
  padding: 0 0.5rem !important;
}
.hist-toolbar .export-button {
  font-size: 0.92rem;
}
.hist-toolbar .control--seg .segmented .seg-btn {
  font-size: 0.85rem;
  padding: 0 0.45rem;
}

/* match your theme class if different */
.ag-theme-alpine.custom-ag-grid .ag-cell.effective-win {
  background-color: rgba(0, 158, 143, 0.15) !important; /* same tint as COL_POS_TINT */
}

/* ==========================================================================
   FRONT PAGE — SaaS polish (uniform tiles; no search/CTA/support)
   ========================================================================== */

