/* board-temp.css — parallel build F2 (Kai-UX 2026-05-11)
 *
 * CSS exclusivo do #boardTempView. Reusa o máximo do scout.css principal
 * (.cb-band, .cb-sector, .control-bar, .control-bar__*, .btn, .btn--*,
 * .metric-row, .metric-tile, .dt-*). Tudo aqui é Board-specific.
 *
 * Patterns novos (candidatos DS v1.15): filter-pill, filter-popover,
 * view-toggle, drawer-detail, bulk-action-bar, skeleton-card,
 * board-card (variante densa).
 *
 * Tudo prefixado .bt-* (board-temp) pra não colidir com nada existente.
 */

/* =================================================================
   ROOT
   ================================================================= */
.bt-root { background: var(--surface, #F9FAFB); min-height: 100vh; }

/* =================================================================
   SUMMARY BAR (reusa .metric-row do scout.css principal)
   Variante is-clickable / is-active
   ================================================================= */
.bt-summary .metric-tile.is-clickable { cursor: pointer; }
.bt-summary .metric-tile.is-clickable:hover { background: white; }
.bt-summary .metric-tile.is-active {
  box-shadow: inset 0 -3px 0 var(--gold, #0A9E5E);
}

/* =================================================================
   CONTROL BAR (Board-specific overrides na .control-bar do primitivo)
   ================================================================= */
.bt-controls {
  padding: 10px 16px;
  background: white;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border, #E5E7EB);
  position: relative; /* anchor pros popovers */
}
.bt-controls__search {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 1px solid var(--border, #E5E7EB);
  border-radius: 4px; background: white;
  min-width: 240px; flex: 1; max-width: 380px;
}
.bt-controls__icon {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  color: var(--text-dim, #9CA3AF); font-size: 13px;
}
.bt-controls__input {
  border: none; outline: none;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 12.5px;
  flex: 1; color: var(--text, #1F2937); background: transparent;
}
.bt-controls__input::placeholder { color: var(--text-dim, #9CA3AF); }
.bt-controls__sep {
  width: 1px; align-self: stretch;
  background: var(--border, #E5E7EB); margin: 0 4px;
}
.bt-controls__right {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.bt-controls__meta {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 1px; line-height: 1;
}
.bt-controls__meta-label {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 9.5px; font-weight: 700;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.bt-controls__meta-val {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 13px; font-weight: 600;
  font-feature-settings: "tnum" 1;
}

/* =================================================================
   FILTER PILL (PATTERN NOVO → DS v1.15)
   ================================================================= */
.bt-pill {
  padding: 3px 10px; background: white;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 12px;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px; font-weight: 600;
  color: var(--text-muted, #6B7280);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.04em;
  line-height: 1.4;
}
.bt-pill:hover { border-color: var(--border-strong, #D1D5DB); color: var(--text, #1F2937); }
.bt-pill.is-active { background: var(--text, #1F2937); color: white; border-color: var(--text, #1F2937); }
.bt-pill.is-active:hover { background: #000; }
.bt-pill__label { font-weight: 700; }
.bt-pill__value { opacity: 0.9; }
.bt-pill__count {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 9.5px; padding: 1px 5px;
  background: var(--gold, #0A9E5E); color: white;
  border-radius: 8px; font-weight: 700;
  margin-left: 2px;
}
.bt-pill__x { opacity: 0.7; font-weight: 700; cursor: pointer; }
.bt-pill__x:hover { opacity: 1; }
.bt-pill__caret { width: 8px; height: 8px; opacity: 0.6; }

.bt-pill--segmented { padding: 0; gap: 0; overflow: hidden; }
.bt-pill--segmented .bt-pill__seg {
  padding: 3px 10px; background: white;
  border-right: 1px solid var(--border, #E5E7EB);
  color: var(--text-muted, #6B7280); cursor: pointer;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.bt-pill--segmented .bt-pill__seg:last-child { border-right: none; }
.bt-pill--segmented .bt-pill__seg.is-active {
  background: var(--text, #1F2937); color: white;
}

/* =================================================================
   FILTER POP-OVER (PATTERN NOVO → DS v1.15)
   ================================================================= */
.bt-popover {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 280px; max-width: 360px;
  background: white;
  border: 1px solid var(--border-strong, #D1D5DB);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  padding: 10px;
  z-index: 100;
}
.bt-popover[hidden] { display: none; }
.bt-popover__search {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 4px;
  margin-bottom: 8px;
}
.bt-popover__search input {
  border: none; outline: none; flex: 1;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 12.5px;
}
.bt-popover__list {
  max-height: 280px; overflow-y: auto;
  margin: -2px; padding: 2px;
}
.bt-popover__item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; cursor: pointer; border-radius: 3px;
  font-size: 12px;
}
.bt-popover__item:hover { background: var(--surface, #F9FAFB); }
.bt-popover__item input { accent-color: var(--text, #1F2937); cursor: pointer; }
.bt-popover__item .bt-popover__count {
  margin-left: auto;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px; color: var(--text-dim, #9CA3AF);
  font-feature-settings: "tnum" 1;
}
.bt-popover__sep {
  height: 1px; background: var(--border, #E5E7EB);
  margin: 6px -10px;
}
.bt-popover__footer {
  display: flex; gap: 6px; justify-content: flex-end;
  padding-top: 6px;
}
.bt-popover__empty {
  padding: 16px 8px; text-align: center;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 11px; color: var(--text-dim, #9CA3AF);
}

/* =================================================================
   VIEW TOGGLE (PATTERN NOVO → DS v1.15)
   ================================================================= */
.bt-vt {
  display: inline-flex; gap: 0;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 4px; overflow: hidden;
}
.bt-vt__btn {
  padding: 4px 9px; background: white; border: none;
  border-right: 1px solid var(--border, #E5E7EB);
  cursor: pointer;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10px; color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.bt-vt__btn:last-child { border-right: none; }
.bt-vt__btn.is-active { background: var(--text, #1F2937); color: white; }
.bt-vt__icon { width: 11px; height: 11px; }

/* Pill wrap — relativiza p/ popover absolute. v25.6.37 saiu do inline
   style pra que mobile CSS (display:none default) consiga vencer. */
.bt-pill-wrap {
  position: relative;
  display: inline-block;
}

/* =================================================================
   SORT DROPDOWN
   ================================================================= */
.bt-sort {
  position: relative; display: inline-block;
}
.bt-sort__dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px;
  background: white;
  border: 1px solid var(--border-strong, #D1D5DB);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  padding: 4px; z-index: 90;
}
.bt-sort__dropdown[hidden] { display: none; }
.bt-sort__item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 6px 10px;
  background: transparent; border: none;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 12.5px; color: var(--text, #1F2937);
  cursor: pointer; text-align: left;
  border-radius: 4px;
}
.bt-sort__item:hover { background: var(--surface, #F9FAFB); }
.bt-sort__item.is-active { font-weight: 700; color: var(--gold, #0A9E5E); }
.bt-sort__dir { margin-left: auto; font-family: var(--mono, 'IBM Plex Mono', monospace); font-size: 11px; }

/* =================================================================
   GRID CARDS VIEW
   ================================================================= */
.bt-grid {
  display: grid;
  /* FIX-BUG-BOARD-COLS-DESIGUAIS v25.2.1: minmax(0, 1fr) forca colunas iguais.
     Antes: repeat(3, 1fr) = minmax(auto, 1fr) = min-content baseline; cards com
     nomes longos (ex: "Companhia de Saneamento Basico do Estado de Sao Paulo")
     forcavam coluna a min-content maior, somando > viewport e gerando scroll-x. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  background: var(--surface, #F9FAFB);
}
@media (max-width: 1100px) { .bt-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .bt-grid { grid-template-columns: 1fr; padding: 10px; gap: 10px; } }

/* CARD v3 (Diretório) — sem logo, sem dots, sem 5 sub-scores, sem trend.
   Anatomia: nome dominante · location · tags (sector + MIRA chips + subsets) · brief · foot (MIRA + updated) */
/* F2-CARDS-DENSIDADE v25.1.8 (Anna ciclo 2): comprimido. Antes ~150px altura
   (3 cards/viewport 800px). Agora ~90-100px (6+ cards/viewport). Reduções:
   padding 16/18/14 → 8/12/6, gap 10 → 4, name 18 → 14, brief line-clamp 2 → 1. */
.bt-card {
  background: white; border: 1px solid var(--border, #E5E7EB);
  border-radius: 6px; padding: 8px 12px 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 80ms, box-shadow 80ms;
  position: relative;
  /* FIX-BUG-BOARD-COLS-DESIGUAIS v25.2.1: min-width:0 protege contra overflow
     interno (texto longo em flex/grid child que ignora container width). */
  min-width: 0;
}
.bt-card:hover { border-color: var(--text, #1F2937); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.bt-card.is-selected { border-color: var(--gold, #0A9E5E); background: rgba(10,158,94,0.04); }
.bt-card.is-open {
  border-color: var(--text, #1F2937);
  box-shadow: 0 0 0 2px rgba(31,41,55,0.12);
}
/* Border-top sutil quando empresa é MIRA top 10 geral
   Reduzido pra 2px + opacity baixa pra desempilhar verde do card */
.bt-card.is-mira-top { border-color: var(--border, #E5E7EB); }
.bt-card.is-mira-top::before {
  content: ''; position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 2px;
  background: var(--gold, #0A9E5E);
  opacity: 0.7;
  border-radius: 8px 8px 0 0;
}
.bt-card.is-mira-top:hover::before { opacity: 1; }

.bt-card__check {
  position: absolute; top: 10px; right: 10px;
  opacity: 0; transition: opacity 80ms;
  z-index: 2;
}
.bt-card:hover .bt-card__check,
.bt-card.is-selected .bt-card__check { opacity: 1; }
.bt-card__check input {
  accent-color: var(--text, #1F2937); cursor: pointer;
  width: 14px; height: 14px;
}

.bt-card__head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: -2px;
}
.bt-card__name {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text, #1F2937); line-height: 1.15;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bt-card__verdict-slot { flex-shrink: 0; }

.bt-card__location {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-feature-settings: "tnum" 1;
}
.bt-card__location .bt-card__loc-sep { color: var(--text-dim, #9CA3AF); margin: 0 5px; }

.bt-card__tags {
  display: flex; gap: 5px; align-items: center; flex-wrap: wrap;
}

/* MIRA chips */
.bt-mira-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 3px;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  line-height: 1.4;
}
.bt-mira-chip--top {
  background: var(--gold, #0A9E5E); color: white;
}
.bt-mira-chip--top::before {
  content: ''; display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
  animation: bt-mira-pulse 2s ease-in-out infinite;
}
@keyframes bt-mira-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }
  50% { box-shadow: 0 0 0 4px rgba(255,255,255,0.55); }
}
.bt-mira-chip--setor {
  background: var(--gold-soft, rgba(10,158,94,0.08));
  color: var(--gold, #0A9E5E);
  border: 1px solid rgba(10,158,94,0.3);
}

/* Subset chips */
.bt-subset-chip {
  display: inline-block;
  padding: 2px 7px;
  background: white;
  color: var(--text-muted, #6B7280);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 3px;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  line-height: 1.4;
}
.bt-subset-chip--pe { color: var(--gold, #0A9E5E); border-color: rgba(10,158,94,0.3); }
.bt-subset-chip--ma { color: var(--purple, #8B5CF6); border-color: rgba(139,92,246,0.3); }
.bt-subset-chip--parc { color: var(--blue, #3B82F6); border-color: rgba(59,130,246,0.3); }
.bt-subset-chip--more { color: var(--text-dim, #9CA3AF); font-weight: 700; }

.bt-card__brief {
  font-size: 11.5px; color: var(--text-muted, #6B7280); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

.bt-card__foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 4px; border-top: 1px solid var(--border, #E5E7EB);
  margin-top: 2px;
}
.bt-card__mira-mini {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 11px;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-feature-settings: "tnum" 1;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.bt-card__mira-mini strong {
  color: var(--text, #1F2937); font-weight: 700; font-size: 12px;
}
/* Neutralizado: tira o verde da mini-pílula MIRA pra reduzir saturação.
   Sinal de "alto" já vem do chip MIRA TOP + verdict ALTA. */
.bt-card__mira-mini--good strong { color: var(--text, #1F2937); }
.bt-card__mira-mini--bad strong { color: var(--red, #EF4444); }

/* === DEPRECATED v1 — manter classes pra não quebrar nada externo, mas card v3 não usa === */
.bt-card__top { display: none; }
.bt-card__rank { display: none; }
.bt-card__head--old { flex: 1; min-width: 0; }
.bt-card__sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.bt-card__badges { display: none; }
.bt-card__metric { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.bt-card__metric-label {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 8.5px; font-weight: 700;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.bt-card__metric-value {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 14px; font-weight: 800;
  font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums;
  color: var(--text, #1F2937); letter-spacing: -0.02em; line-height: 1;
}
.bt-card__metric-value--good { color: var(--gold, #0A9E5E); }
.bt-card__metric-value--bad  { color: var(--red, #EF4444); }

.bt-card__fit {
  font-size: 12px; color: var(--text-muted, #6B7280); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.bt-card__completude { display: none; }
.bt-card__cdot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border, #E5E7EB);
}
.bt-card__cdot.is-done { background: var(--gold, #0A9E5E); }
.bt-card__completude-count {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 9.5px; color: var(--text-dim, #9CA3AF);
  margin-left: 4px; font-feature-settings: "tnum" 1;
}
.bt-card__updated {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 9.5px; color: var(--text-dim, #9CA3AF);
  font-feature-settings: "tnum" 1;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* =================================================================
   LIST DENSE VIEW
   ================================================================= */
.bt-list { background: white; }
.bt-list-row {
  display: grid;
  grid-template-columns: 36px 50px 1fr 110px 60px 60px 88px 90px;
  align-items: center; gap: 0;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border, #E5E7EB);
  font-size: 12.5px;
  cursor: pointer;
}
.bt-list-row:hover { background: var(--surface, #F9FAFB); }
.bt-list-row.is-selected { background: rgba(10,158,94,0.06); }
.bt-list-row__rank {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 11px; color: var(--gold, #0A9E5E); font-weight: 700;
}
.bt-list-row__name {
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bt-list-row__num {
  text-align: right;
  font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.bt-list-row__num--good { color: var(--gold, #0A9E5E); }
.bt-list-row__num--bad  { color: var(--red, #EF4444); }
.bt-list-row__updated {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px; color: var(--text-muted, #6B7280);
  text-align: right; font-feature-settings: "tnum" 1;
}
.bt-list-row--header {
  background: var(--surface, #F9FAFB); cursor: default;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px; font-weight: 700;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border, #E5E7EB);
}
.bt-list-row--header:hover { background: var(--surface, #F9FAFB); }

/* =================================================================
   TABLE VIEW container
   ================================================================= */
.bt-table-host { padding: 0; background: white; }

/* =================================================================
   EMPTY / LOADING
   ================================================================= */
.bt-empty {
  padding: 60px 24px; text-align: center;
  background: var(--surface, #F9FAFB);
  border-bottom: 1px solid var(--border, #E5E7EB);
}
.bt-empty__glyph {
  width: 40px; height: 40px; margin: 0 auto 16px;
  color: var(--text-dim, #9CA3AF);
}
.bt-empty__title {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 17px; font-weight: 700; color: var(--text, #1F2937);
  margin-bottom: 4px;
}
.bt-empty__body {
  font-size: 12.5px; color: var(--text-muted, #6B7280);
  max-width: 380px; margin: 0 auto 14px; line-height: 1.55;
}

.bt-skeleton-card {
  background: white; border: 1px solid var(--border, #E5E7EB);
  border-radius: 6px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 158px;
}
.bt-skeleton-line {
  height: 10px;
  background: linear-gradient(90deg,
    var(--surface-2, #F3F4F6) 0%,
    var(--surface, #F9FAFB) 50%,
    var(--surface-2, #F3F4F6) 100%);
  background-size: 200% 100%;
  border-radius: 3px;
  animation: bt-shimmer 1.2s ease-in-out infinite;
}
.bt-skeleton-line--sm { width: 40%; height: 8px; }
.bt-skeleton-line--md { width: 70%; }
.bt-skeleton-line--lg { width: 95%; }
@keyframes bt-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.bt-skeleton-metrics {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border, #E5E7EB);
  margin-top: 4px;
}
.bt-skeleton-metrics .bt-skeleton-line { height: 18px; width: 100%; }

/* =================================================================
   BULK ACTION BAR (PATTERN NOVO → DS v1.15)
   ================================================================= */
.bt-bulk {
  background: var(--text, #1F2937); color: white;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--text, #1F2937);
  position: sticky; bottom: 0; z-index: 10;
}
.bt-bulk[hidden] { display: none; }
.bt-bulk__info {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 13px; font-weight: 600;
  font-feature-settings: "tnum" 1;
}
.bt-bulk__info strong { color: var(--gold, #0A9E5E); font-weight: 700; }
.bt-bulk__actions { margin-left: auto; display: flex; gap: 6px; }
.bt-bulk .btn {
  background: rgba(255,255,255,0.08); color: white;
  border-color: rgba(255,255,255,0.18);
}
.bt-bulk .btn:hover { background: rgba(255,255,255,0.16); }
.bt-bulk .btn--primary {
  background: var(--gold, #0A9E5E); color: white;
  border-color: var(--gold, #0A9E5E);
}
.bt-bulk .btn--primary:hover { background: #0c8650; border-color: #0c8650; }
.bt-bulk__clear {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 11px; color: rgba(255,255,255,0.5); cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-left: 8px;
  background: none; border: none; padding: 0;
}
.bt-bulk__clear:hover { color: white; }

/* =================================================================
   DRAWER DETAIL (PATTERN NOVO → DS v1.15)
   ================================================================= */
.bt-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(31,41,55,0.28);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 160ms ease-out;
}
.bt-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.bt-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 520px; max-width: 92vw;
  background: white;
  border-left: 1px solid var(--border-strong, #D1D5DB);
  box-shadow: -8px 0 24px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  font-family: var(--sans, 'Inter', sans-serif);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 200ms ease-out;
}
.bt-drawer.is-open { transform: translateX(0); }
@media (max-width: 768px) { .bt-drawer { width: 100vw; max-width: 100vw; } }

.bt-drawer__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #E5E7EB);
  display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0;
}
.bt-drawer__topbar { display: flex; align-items: center; gap: 8px; }
.bt-drawer__close {
  width: 26px; height: 26px;
  border: 1px solid var(--border, #E5E7EB); background: white;
  cursor: pointer; border-radius: 4px;
  color: var(--text-muted, #6B7280);
  font-family: var(--sans, 'Inter', sans-serif); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.bt-drawer__close:hover { border-color: var(--text, #1F2937); color: var(--text, #1F2937); }
.bt-drawer__rank {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px; font-weight: 700;
  color: var(--gold, #0A9E5E);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.bt-drawer__title {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.1;
}
/* PADRAO-DRAWER-TITLE-LINK v25.1.8 */
.bt-drawer__title-link { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; transition: border-color 120ms ease; }
.bt-drawer__title-link:hover { border-bottom-color: var(--text-muted, #6B7280); }
.bt-drawer__sub {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted, #6B7280);
}
.bt-drawer__actions { display: flex; gap: 6px; margin-left: auto; }

.bt-drawer__tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border, #E5E7EB);
  background: var(--surface, #F9FAFB);
  padding: 0 14px;
  flex-shrink: 0;
}
.bt-drawer__tab {
  padding: 9px 12px;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px; font-weight: 700;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em;
  border: none; background: transparent; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.bt-drawer__tab:hover { color: var(--text, #1F2937); }
.bt-drawer__tab.is-active {
  color: var(--text, #1F2937);
  border-bottom-color: var(--gold, #0A9E5E);
}

.bt-drawer__body { flex: 1; overflow-y: auto; padding: 18px; }

.bt-drawer__metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border, #E5E7EB);
  padding: 1px; border-radius: 6px;
  margin-bottom: 16px;
}
.bt-drawer__metric { background: white; padding: 10px 12px; }
.bt-drawer__metric-label {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 9.5px; font-weight: 700;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.bt-drawer__metric-value {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 18px; font-weight: 800;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
  color: var(--text, #1F2937); line-height: 1;
}
.bt-drawer__metric-value--good { color: var(--gold, #0A9E5E); }
.bt-drawer__metric-value--bad { color: var(--red, #EF4444); }

.bt-drawer__section { margin-bottom: 18px; }
.bt-drawer__section-title {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px; font-weight: 700;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.bt-drawer__section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border, #E5E7EB);
}
.bt-drawer__brief {
  font-size: 13px; line-height: 1.65; color: var(--text, #1F2937);
}
.bt-drawer__brief p + p { margin-top: 8px; }

.bt-drawer__dl {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 6px 18px; font-size: 12px;
}
.bt-drawer__dl dt {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px; font-weight: 600;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.bt-drawer__dl dd {
  font-family: var(--sans, 'Inter', sans-serif);
  color: var(--text, #1F2937);
  font-feature-settings: "tnum" 1;
}
.bt-drawer__dl dd.is-empty {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  color: var(--text-dim, #9CA3AF);
}

.bt-drawer__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 12px;
}
.bt-drawer__bar-label {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10px; font-weight: 700;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase; letter-spacing: 0.06em;
  width: 76px;
}
.bt-drawer__bar-track {
  flex: 1; height: 6px;
  background: var(--surface-2, #F3F4F6);
  border-radius: 3px; overflow: hidden;
}
.bt-drawer__bar-fill {
  height: 100%; background: var(--gold, #0A9E5E); border-radius: 3px;
}
.bt-drawer__bar-fill--mod { background: var(--orange, #F59E0B); }
.bt-drawer__bar-fill--bad { background: var(--red, #EF4444); }
.bt-drawer__bar-value {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 12px; font-weight: 700;
  font-feature-settings: "tnum" 1;
  min-width: 36px; text-align: right;
}

.bt-drawer__footer {
  border-top: 1px solid var(--border, #E5E7EB);
  padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface, #F9FAFB);
  flex-shrink: 0;
}
.bt-drawer__nav { display: flex; gap: 4px; }

/* =================================================================
   TABLET — BUG-01 v25.5.5: reduz min-width search + força wrap controles
   ================================================================= */
@media (max-width: 1100px) {
  .bt-controls {
    /* Permite wrap em 2 linhas: search no topo, pills/right embaixo */
    gap: 6px;
    padding: 8px 12px;
  }
  .bt-controls__search {
    min-width: 180px;       /* era 240px — apertado em 1100px com 5+ pills */
    max-width: 280px;       /* mantém legibilidade */
  }
  .bt-controls__right {
    margin-left: 0;         /* deixa flex-wrap empurrar pra baixo se faltar espaço */
  }
}

/* =================================================================
   MOBILE — control-bar scroll horizontal de pills
   ================================================================= */
/* =================================================================
   Mobile toggle buttons (lupa + Filtros) — só aparecem <599px.
   v25.6.36: control bar mobile colapsa filtros + busca atrás de botões.
   ================================================================= */
.bt-mobile-toggle { display: none; }

@media (max-width: 599px) {
  .bt-controls {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 8px;
    padding: 10px 12px;
    align-items: center;
  }

  /* Row 1 (sempre visível): toggles + view-toggle + meta.
     v25.6.38: botões ainda menores (Anna feedback). */
  .bt-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--border, #E5E7EB);
    background: white;
    color: var(--text, #111);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    padding: 5px 9px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .bt-mobile-toggle:hover { background: var(--surface, #F9FAFB); }
  .bt-mobile-toggle.is-active {
    background: var(--text, #111);
    color: white;
    border-color: var(--text, #111);
  }
  .bt-mobile-toggle--search { padding: 5px 7px; }
  .bt-mobile-toggle__icon { font-size: 12px; line-height: 1; }
  .bt-mobile-toggle__label { font-size: 10px; }
  .bt-mobile-toggle__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold, #B89F5A);
    color: white;
    border-radius: 999px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
  }
  .bt-mobile-toggle.is-active .bt-mobile-toggle__count { background: white; color: var(--text, #111); }
  /* Dot indicador de busca ativa */
  .bt-mobile-toggle__dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--gold, #B89F5A);
    display: inline-block;
  }

  /* Default: esconde search input + pills + sort + clear + sep.
     Aparecem só quando classe state correspondente está ativa. */
  .bt-controls__search { display: none; flex: 1 1 100%; min-width: 0; order: 90; }
  /* HOTFIX v25.6.43 · busca Board mobile (Anna 2026-05-18):
     - font-size 16px (era 14px) anti-iOS auto-zoom DS §14c
     - -webkit-appearance:none remove clear button nativo iOS que
       brigava com layout do `<input type="search">`
     - min-height: 44px touch target DS §14c
     - padding 10px 12px conforto mobile */
  .bt-controls__search .bt-controls__input {
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    min-height: 44px;
    padding: 10px 12px;
  }
  .bt-controls__search .bt-controls__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
  }
  .bt-controls > .bt-pill-wrap,
  .bt-controls > .bt-pill--segmented { display: none; }
  .bt-controls__sep { display: none; }
  .bt-sort { display: none; }
  .bt-controls__clear-btn { display: none; }
  /* Esconde só o label "Mostrando", deixa o número visível pra economizar espaço */
  .bt-controls__meta-label { display: none; }

  /* View toggle (TAB/GRD) sempre visível, fica encurtado */
  .bt-vt { flex-shrink: 0; }
  .bt-controls__right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .bt-controls__meta { font-size: 11px; }

  /* v25.6.37: quando filtros abrem, right block "desaparece" como container
     (display: contents) — meta/sort/clear viram flex items diretos. Meta
     mantém margin-left: auto pra continuar ancorado na direita do row 1;
     sort + clear ganham order 92/93 e caem no painel wrapped abaixo. */
  .bt-controls.is-mobile-filters-open .bt-controls__right {
    display: contents;
  }
  .bt-controls.is-mobile-filters-open .bt-controls__meta {
    margin-left: auto;
    flex-shrink: 0;
  }

  /* SEARCH OPEN: input aparece numa nova linha full-width */
  .bt-controls.is-mobile-search-open .bt-controls__search {
    display: flex;
  }

  /* FILTERS OPEN: pills + sort + clear viram um painel wrapped abaixo */
  .bt-controls.is-mobile-filters-open > .bt-pill-wrap,
  .bt-controls.is-mobile-filters-open > .bt-pill--segmented {
    display: inline-flex;
    flex-shrink: 0;
    order: 91;
  }
  .bt-controls.is-mobile-filters-open .bt-sort {
    display: inline-flex;
    order: 92;
  }
  .bt-controls.is-mobile-filters-open .bt-controls__clear-btn {
    display: inline-flex;
    order: 93;
  }
  /* Pills menores quando o painel abre */
  .bt-controls.is-mobile-filters-open .bt-pill {
    padding: 4px 10px;
    font-size: 11px;
  }
  /* Sort dropdown pill segue mesmo padding compacto */
  .bt-controls.is-mobile-filters-open .bt-sort .bt-pill {
    padding: 4px 10px;
    font-size: 11px;
  }
}

/* KPI mobile rule promovida pra escopo global em css/scout.css (v25.6.38).
   Agora qualquer .metric-row no app (Motor/Orbit/INTEL/Detail) usa o mesmo
   padrão compacto de 1 linha. */

/* ═══ Hotfix v25.5.8 · bt-modal Mover pra subset (bulk action) ═══ */
.bt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
}
.bt-modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bt-modal__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bt-modal__title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.bt-modal__close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 6px;
}
.bt-modal__close:hover { color: var(--text); }
.bt-modal__body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.bt-modal__search {
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}
.bt-modal__search:focus {
  outline: none;
  border-color: var(--gold);
  background: white;
}
.bt-modal__list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.bt-modal__row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas: "name btn" "meta btn";
  align-items: center;
  gap: 4px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.bt-modal__row:last-child { border-bottom: none; }
.bt-modal__row:hover { background: var(--surface); }
.bt-modal__row-name {
  grid-area: name;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.bt-modal__row-meta {
  grid-area: meta;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-muted);
}
.bt-modal__row .btn {
  grid-area: btn;
}

