/* Proposta local da Série Histórica, inspirada no Painel de Abastecimento. */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "IBM Plex Sans", var(--font);
  --radius: 18px;
  --accent: #34c995;
  --accent-deep: #16996d;
  --good: #64c99a;
  --shadow-card: 0 1px 2px rgba(6,42,30,.05), 0 4px 14px rgba(6,42,30,.05);
}
:root[data-theme="light"] {
  --bg: #f6faf8;
  --surface: #fff;
  --surface-2: #f3f8f5;
  --surface-3: #e9f4ee;
  --tx: #0f1f1a;
  --tx-2: #405b50;
  --tx-3: #5c6f68;
  --line: #e3ede8;
  --line-strong: #c3dacd;
  --accent: #0d9463;
  --accent-deep: #07563d;
  --good: #449770;
  --info: #0e8997;
  --warn: #cd8a30;
  --on-accent: #fff;
  --bg-glow: rgba(16,185,129,.025);
}
.serie-proposta { font-size: 14px; line-height: 1.55; background: var(--bg); }
.serie-proposta .topbar {
  position: relative;
  top: auto;
  height: auto;
  padding: 28px 24px 26px;
  color: #eaf7f1;
  border: 0;
  box-shadow: none;
  background:
    radial-gradient(900px 420px at 85% 0%, rgba(16,185,129,.22), transparent 60%),
    radial-gradient(700px 420px at 5% 100%, rgba(45,212,191,.15), transparent 55%),
    linear-gradient(150deg, #04170f 0%, #062b1f 45%, #0a4a35 100%);
}
.hero-inner { max-width: none; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 28px; justify-content: space-between; }
.serie-proposta .brand-block { gap: 14px; min-width: 0; }
.serie-proposta .brand-mark { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(135deg,#12b377,#0d9463); box-shadow: 0 8px 20px rgba(18,179,119,.28),inset 0 1px 0 rgba(255,255,255,.25); }
.serie-proposta .brand-mark img { width: 40px; height: 40px; filter: none; }
.serie-proposta .brand-text { gap: 6px; }
.serie-proposta .brand-text .hero-eyebrow { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); color: #a7f3d0; font-size: 10px; letter-spacing: .055em; line-height: 1.4; }
.hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.15); }
.serie-proposta .brand-text h1 { font-family: var(--font-display); color: #fff; font-size: clamp(22px,2.6vw,28px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.serie-proposta .brand-text .brand-sub { color: #b8dccd; font-size: 11px; text-transform: none; letter-spacing: 0; line-height: 1.45; opacity: 1; }
.serie-proposta .topbar-actions { flex-direction: column; align-items: flex-end; gap: 12px; flex-shrink: 0; margin-left: 0; }
.serie-proposta .section-nav { position: static; top: auto; display: flex; flex-wrap: nowrap; gap: 3px; padding: 4px; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; background: rgba(4,23,15,.22); box-shadow: 0 10px 24px rgba(2,20,13,.12); }
.serie-proposta .section-nav a { border-radius: 9px; font-size: 12px; padding: 8px 12px; color: #bad9cc; white-space: nowrap; }
.serie-proposta .section-nav a.active { color: #07563d; background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.13); }
.serie-proposta .section-nav a:hover { background: rgba(255,255,255,.1); color: #fff; transform: none; }
.serie-proposta .section-nav a.active:hover { background: #eaf7f1; color: #07563d; }
.hero-tools { display: flex; align-items: center; gap: 8px; }
.serie-proposta .primary-button { border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #eaf7f1; background: rgba(255,255,255,.09); box-shadow: none; padding: 8px 15px; height: auto; font-size: 11.5px; }
.serie-proposta .primary-button:hover:not(:disabled) { background: rgba(255,255,255,.18); transform: none; filter: none; }
.serie-proposta .theme-toggle { border-radius: 999px; color: #b8dccd; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.2); width: 33px; height: 33px; }
.serie-proposta .workspace { width: 100%; max-width: none; gap: 18px; padding: 58px 20px 60px; }
.recorte-ativo { padding: 13px 16px; background: linear-gradient(180deg,var(--surface),var(--surface-2)); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; box-shadow: var(--shadow-card); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.recorte-text { min-width: 0; }
.recorte-label { display: block; font-size: 10px; font-weight: 700; color: var(--tx-3); letter-spacing: .09em; text-transform: uppercase; margin-bottom: 3px; }
.recorte-resumo { color: var(--tx-2); font-size: 12.5px; line-height: 1.6; font-weight: 500; }
.recorte-resumo strong { color: var(--tx); font-weight: 700; }
.recorte-busca { display: block; color: var(--tx-3); font-size: 11px; }
.recorte-busca:empty { display: none; }
.recorte-editar { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent-deep); padding: 7px 12px; font-size: 11.5px; font-weight: 600; border-radius: 999px; }
.recorte-editar:hover { background: var(--surface-3); border-color: var(--accent); }
.source-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; color: var(--tx-3); font-size: 10.5px; line-height: 1.45; margin-top: -10px; padding: 0 4px; }
.recorte-site:empty { display: none; }
.recorte-site { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: -7px; }
.serie-proposta .status-strip { gap: 14px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.serie-proposta .status-strip:has(#kProdutosWrap:not([hidden])) { grid-template-columns: repeat(4,minmax(0,1fr)); }
.serie-proposta .status-strip .metric { padding: 16px 18px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card); min-width: 0; }
.serie-proposta .status-strip .metric::before { inset: 0 0 auto; width: 100%; height: 3px; background: linear-gradient(90deg,#449770,#12b377); opacity: .85; }
.serie-proposta .status-strip .metric.accent { border-color: var(--line); box-shadow: var(--shadow-card); }
.serie-proposta .status-strip .metric:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: 0 6px 18px rgba(6,42,30,.08); }
.serie-proposta .metric span { color: var(--tx-3); font-size: 10px; font-weight: 700; letter-spacing: .045em; line-height: 1.4; min-height: 28px; }
.serie-proposta .metric strong { color: var(--accent-deep); font-size: clamp(25px,2.3vw,31px); line-height: 1.2; margin: 3px 0 6px; }
.serie-proposta .metric small { display: block; font-size: 10.5px; color: var(--tx-3); line-height: 1.5; }
.serie-proposta .chart-panel { padding: 18px 20px; box-shadow: var(--shadow-card); border-radius: 18px; }
.serie-proposta .chart-head { gap: 12px; margin-bottom: 10px; }
.serie-proposta .chart-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--tx); font-weight: 700; letter-spacing: -.01em; }
.serie-proposta .chart-head h2::before { content: ""; display: block; flex: none; width: 20px; height: 3px; background: #50ad85; border-radius: 2px; }
.serie-proposta .chart-head p { margin-top: 5px; font-size: 11px; line-height: 1.6; color: var(--tx-3); }
.serie-proposta #glossarioMetricas { padding: 11px 16px; }
.serie-proposta #glossarioMetricas > summary { font-family: var(--font-display); font-size: 12px; color: var(--tx-2); }
.serie-proposta .metric-switch { border-radius: 999px; padding: 3px; gap: 3px; }
.serie-proposta .metric-switch button { border-radius: 999px; padding: 6px 11px; }
.serie-proposta .metric-switch button.on { color: var(--accent-deep); background: var(--surface); box-shadow: 0 1px 5px rgba(6,42,30,.09); }
.serie-proposta .bars { height: 240px; padding-top: 15px; }
.serie-proposta .bar-col .bar-stack { box-shadow: none; }
.serie-proposta .bar-col:hover .bar-stack { filter: brightness(1.06); }
.serie-proposta .bar-value { font-size: 11.5px; font-weight: 600; }
.serie-proposta .bar-label { font-size: 11px; font-weight: 500; }
.serie-proposta .legend { font-size: 11px; margin-top: 12px; gap: 12px; }
.serie-proposta .trend-line { stroke-width: 2; filter: none; }
.serie-proposta .trend-dot { width: 6px; height: 6px; box-shadow: none; border-width: 1px; }
.serie-proposta .comp-table { font-size: 11.5px; }
.serie-proposta .comp-table th { color: var(--tx-3); font-size: 9px; padding: 9px 10px; letter-spacing: .05em; background: var(--surface-2); }
.serie-proposta .comp-table td { padding: 9px 10px; }
.serie-proposta .comp-table td:first-child { font-size: 11px; }
.serie-proposta .comp-table tr:hover td { background: var(--surface-2); }
.serie-proposta .global-search { border-radius: 999px; color: var(--tx-3); }
.serie-proposta .global-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(18,179,119,.11); }
.serie-proposta .app-footer { background: var(--surface); border-top-color: var(--line); margin-top: 20px; font-size: 12px; }
.serie-proposta :where(button,a,summary,select,input):focus-visible { outline: 2px solid #12b377; outline-offset: 3px; }

/* A janela recolhida ocupa somente a pílula; cada controle mantém seu ID original. */
.serie-proposta .proposta-open-filters { position: fixed; z-index: 71; top: 0; left: 0; display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #eafaf3; background: #07563d; font-family: var(--font); font-size: 12px; font-weight: 700; box-shadow: 0 10px 24px rgba(4,42,30,.25); touch-action: none; user-select: none; cursor: grab; }
.serie-proposta .proposta-open-filters:hover { background: #0a6c4b; }
.serie-proposta .proposta-open-filters[hidden], .serie-proposta .proposta-filter-window[hidden] { display: none; }
.proposta-open-filters.is-dragging { cursor: grabbing; }
.proposta-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #34d399; color: #04291d; font-size: 10px; }
.proposta-filter-count:empty { display: none; }
.serie-proposta .proposta-filter-window { position: fixed; z-index: 72; top: 0; left: 0; width: min(292px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: 0; background: #053b2b; color: #dff3e9; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; box-shadow: 0 20px 52px rgba(4,42,30,.36),0 2px 8px rgba(4,42,30,.24); overflow: hidden; backdrop-filter: none; }
.proposta-filter-head { display: flex; align-items: center; padding: 10px 12px; gap: 8px; background: rgba(0,0,0,.18); border-bottom: 1px solid rgba(255,255,255,.1); flex: none; }
.proposta-filter-grip { display: flex; align-items: center; gap: 9px; flex: 1; align-self: stretch; padding: 2px 0; min-height: 26px; background: transparent; border: 0; color: #fff; font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: grab; user-select: none; touch-action: none; text-align: left; }
.proposta-filter-grip.is-dragging { cursor: grabbing; }
.proposta-grip-dots { display: grid; grid-template-columns: repeat(2,3px); gap: 3px; opacity: .5; flex: none; }
.proposta-grip-dots i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.proposta-close-filters { width: 25px; height: 25px; border-radius: 50%; border: 1px solid rgba(255,255,255,.26); background: rgba(255,255,255,.1); color: #dff3e9; font-size: 16px; flex: none; line-height: 1; }
.proposta-close-filters:hover { background: rgba(255,255,255,.22); }
.proposta-filter-body { display: flex; flex-direction: column; gap: 7px; padding: 12px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-color: #508b71 #053b2b; }
.proposta-filter-section { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; }
.proposta-filter-section[open] { border-color: #34c995; background: rgba(255,255,255,.1); }
.proposta-filter-section > summary { cursor: pointer; list-style: none; padding: 10px 11px; font-size: 12px; font-weight: 600; color: #eafaf3; display: flex; align-items: center; gap: 7px; border-radius: 12px; }
.proposta-filter-section > summary::-webkit-details-marker { display: none; }
.proposta-filter-section > summary::after { content: "▾"; color: #6ee7b7; font-size: 10px; margin-left: auto; }
.proposta-filter-section[open] > summary::after { content: "▴"; }
.proposta-filter-selection { font-size: 9px; color: #a9d8c1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 134px; margin-left: auto; }
.proposta-filter-options { padding: 0 10px 11px; }
.proposta-field-label { display: block; color: #a9d8c1; font-size: 10px; margin-bottom: 6px; }
.proposta-med-input { display: flex; position: relative; }
.proposta-med-input input { width: 100%; min-width: 0; height: 36px; padding: 0 28px 0 9px; border-radius: 8px; border: 1px solid rgba(255,255,255,.24); color: #eafaf3; background: #0b4b36; font: 11px var(--font); }
.proposta-med-input input::placeholder { color: #a9d8c1; opacity: .8; }
.proposta-med-input input:focus { outline: 2px solid #34c995; outline-offset: 1px; }
.proposta-med-input input:disabled { opacity: .6; }
.proposta-med-input button { position: absolute; right: 4px; top: 6px; height: 24px; width: 24px; background: transparent; border: 0; color: #a9d8c1; font-size: 17px; }
.proposta-med-input button[hidden], .proposta-med-opcoes[hidden] { display: none; }
.proposta-med-opcoes { margin-top: 6px; max-height: 176px; overflow-y: auto; overscroll-behavior: contain; background: #0b4b36; border: 1px solid rgba(255,255,255,.24); border-radius: 8px; }
.proposta-med-opcoes [role="option"] { padding: 8px 9px; color: #eafaf3; font-size: 10.5px; line-height: 1.45; cursor: pointer; overflow-wrap: anywhere; border-bottom: 1px solid rgba(255,255,255,.08); }
.proposta-med-opcoes [role="option"]:last-child { border-bottom: 0; }
.proposta-med-opcoes [role="option"]:hover, .proposta-med-opcoes [aria-selected="true"] { background: #dff7ec; color: #07563d; }
.proposta-field-help, .proposta-field-status { display: block; color: #a9d8c1; font-size: 10px; line-height: 1.45; margin-top: 7px; }
.proposta-field-status:empty { display: none; }
.serie-proposta .proposta-filter-window .chip-group { gap: 5px; }
.serie-proposta .proposta-filter-window .chip { background: rgba(0,0,0,.12); color: #cfe9dd; border: 1px solid rgba(255,255,255,.16); min-height: 29px; height: auto; padding: 5px 9px; font-size: 10.5px; box-shadow: none; line-height: 1.4; }
.serie-proposta .proposta-filter-window .chip:hover { border-color: #34c995; color: #fff; transform: none; }
.serie-proposta .proposta-filter-window .chip.active { background: #dff7ec; border-color: #dff7ec; color: #07563d; font-weight: 700; }
.serie-proposta .proposta-filter-window .chip.active small { color: #07563d; }
.serie-proposta .proposta-filter-window .chip strong { font-size: 10px; }
.serie-proposta .proposta-filter-window .select-group { display: grid; grid-template-columns: 1fr; gap: 6px; }
.serie-proposta .proposta-filter-window .select-group label { font-size: 10px; color: #a9d8c1; }
.serie-proposta .proposta-filter-window select { width: 100%; height: 34px; padding: 0 8px; background: #0b4b36; border: 1px solid rgba(255,255,255,.24); border-radius: 8px; color: #eafaf3; font-size: 11px; color-scheme: dark; }
.serie-proposta .proposta-filter-window select:focus { border-color: #34c995; color: #fff; }
.serie-proposta .proposta-filter-window select option { background: #053b2b; color: #eafaf3; }
.serie-proposta .proposta-filter-window select:disabled { opacity: .6; cursor: wait; }
.serie-proposta .proposta-filter-window #monthChip:not(:empty) { margin-top: 8px; }
.serie-proposta .proposta-filter-window #faixaEtariaStatus { display: block; font-size: 10px !important; color: #a9d8c1 !important; line-height: 1.5; margin-top: 8px; }
.proposta-filter-footer { padding: 0 12px 12px; flex: none; }
.serie-proposta .proposta-filter-window #limparFiltros { width: 100%; display: block; margin: 0; padding: 8px 12px; background: #fff; color: #33564a; font-size: 11.5px; font-weight: 600; border: 1px solid #e3ede8; border-radius: 999px; text-decoration: none; }
.serie-proposta .proposta-filter-window #limparFiltros:disabled { opacity: .65; cursor: default; }
.serie-proposta .proposta-filter-window #limparFiltros:hover:not(:disabled) { color: #07563d; background: #eaf7f1; }
@media (max-width: 1020px) {
  .hero-inner { gap: 16px; }
  .serie-proposta .brand-text h1 { font-size: 24px; }
  .serie-proposta .section-nav a { padding: 7px 9px; font-size: 11px; }
}
@media (max-width: 760px) {
  .serie-proposta .topbar { padding: 23px 18px 20px; }
  .hero-inner { flex-direction: column; align-items: stretch; gap: 18px; }
  .serie-proposta .brand-block { align-items: flex-start; }
  .serie-proposta .brand-mark { width: 43px; height: 43px; }
  .serie-proposta .brand-mark img { width: 35px; height: 35px; }
  .serie-proposta .brand-text h1 { font-size: 23px; }
  .serie-proposta .brand-text .hero-eyebrow { font-size: 9px; }
  .serie-proposta .topbar-actions { flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
  .serie-proposta .section-nav { flex: 1; }
  .serie-proposta .section-nav a { flex: 1; justify-content: center; }
  .serie-proposta .workspace { padding: 58px 14px 40px; gap: 14px; }
  .serie-proposta .status-strip, .serie-proposta .status-strip:has(#kProdutosWrap:not([hidden])) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .serie-proposta .status-strip .metric { padding: 14px 14px 12px; }
  .serie-proposta .metric strong { font-size: 27px; }
  .serie-proposta .metric span { font-size: 9px; min-height: 25px; }
  .serie-proposta .metric small { font-size: 9.5px; }
  .recorte-ativo { align-items: flex-start; padding: 12px 13px; gap: 8px; }
  .recorte-resumo { font-size: 11.5px; }
  .recorte-editar { padding: 7px 9px; font-size: 10px; }
  .recorte-editar svg { display: none; }
  .source-meta { margin-top: -6px; font-size: 9px; }
  .serie-proposta .chart-panel { padding: 16px; }
  .serie-proposta .chart-head h2 { font-size: 14px; }
  .serie-proposta .chart-head p { font-size: 10.5px; }
  .serie-proposta .chart-head .global-search { width: 100% !important; }
  .serie-proposta .metric-switch { width: 100%; }
  .serie-proposta .metric-switch button { flex: 1; padding: 6px 8px; }
  .serie-proposta .bars { height: 215px; gap: 5px; padding-right: 0; padding-left: 0; }
  .serie-proposta .bar-value { font-size: 8.5px; }
  .serie-proposta .bar-label { font-size: 9px; }
  .serie-proposta .legend { font-size: 10px; }
  .serie-proposta .proposta-filter-window { max-height: calc(100dvh - 24px); }
}
@media (max-width: 430px) {
  .serie-proposta .topbar-actions { align-items: stretch; }
  .serie-proposta .section-nav { flex-basis: 100%; }
  .hero-tools { margin-left: auto; }
  .serie-proposta .brand-text h1 { font-size: 21px; }
  .serie-proposta .brand-text .brand-sub { font-size: 10px; }
  .recorte-editar { max-width: 61px; line-height: 1.3; }
}
@media (prefers-reduced-motion: reduce) {
  .serie-proposta *, .serie-proposta *::before, .serie-proposta *::after { scroll-behavior: auto; transition: none !important; animation: none !important; }
}

/* Seleções múltiplas mantêm a janela em uma coluna, com rolagem interna. */
.proposta-selecionados { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.proposta-selecionados:empty { display: none; }
.proposta-selection-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; border: 1px solid var(--border); border-radius: 8px; background: rgba(42, 146, 92, .1); color: var(--tx); font: 500 10px/1.4 var(--font); padding: 6px 8px; cursor: pointer; }
.proposta-selection-chip:hover { background: rgba(42, 146, 92, .18); }
.proposta-selection-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#propostaFiltros .proposta-selection-chip { background: #0b4b36; color: #eafaf3; border-color: #72b398; }
#propostaFiltros .proposta-selection-chip:hover { background: #136648; color: #fff; }
#propostaFiltros .proposta-selection-chip:focus-visible { outline-color: #6ee7b7; }
.kpi-val.kpi-multiplos, .kpi-multiplos { display: flex; flex-direction: column; gap: 6px; font-size: 19px !important; }
.kpi-componente { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.kpi-componente small { font: 500 10px/1.25 var(--font); color: var(--tx-2); }
.kpi-componente strong { font: inherit; }
.bar-multi-track { height: 100%; display: flex; align-items: flex-end; gap: 4px; }
.bar-multi-component { position: relative; min-width: 10px; flex: 1; border-radius: 4px 4px 0 0; }
.bar-multi-component span { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-size: 8px; white-space: nowrap; }
.mapas-componentes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.mapas-componentes section { min-width: 0; }
.mapas-componentes h4 { margin: 4px 0 8px; font: 600 11px var(--font); }

/* Layout fluido em monitores amplos; tabelas mantêm rolagem dentro do painel. */
.serie-proposta .footer-container { max-width: none; }
.serie-proposta .workspace > *, .serie-proposta .grid-2 > * { min-width: 0; }
.serie-proposta .table-wrap { max-width: 100%; overflow-x: auto; }
.proposta-med-opcoes [role="option"] { display: flex; align-items: flex-start; gap: 8px; }
.proposta-med-checkbox { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-top: 1px; border: 1.5px solid currentColor; border-radius: 3px; font-size: 12px; line-height: 1; }
.proposta-med-nome { min-width: 0; }
.proposta-med-opcoes [data-active="true"] { outline: 2px solid #34c995; outline-offset: -2px; }
