/* =====================================================================
   LabMoney 2026 - design system (pedido do João, 19/10/2026)
   Escuro = data-theme "futuristic" (padrão) · Claro = "light" / "classic"
   Carrega DEPOIS do style.css e manda nele. Para desligar: tirar do index.html.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
body[data-theme] {
  /* superfícies e tinta (escuro: grafite azulado) */
  --lab-bg: #0d1016;
  --lab-s1: #141820;
  --lab-s2: #1a1f29;
  --lab-s3: #222835;
  --lab-line: rgba(148, 163, 190, .09);
  --lab-line2: rgba(148, 163, 190, .16);
  --lab-ink: #eceef3;
  --lab-ink2: #a3acbc;
  --lab-ink3: #6f798b;
  /* acento de interação (um só) */
  --lab-accent: #8d9cff;
  --lab-accent-2: #a9b4ff;
  --lab-accent-bg: rgba(141, 156, 255, .12);
  --lab-on-accent: #0d1016;
  /* semânticas */
  --lab-pos: #3fca82;
  --lab-pos-bg: rgba(63, 202, 130, .12);
  --lab-neg: #f26b6e;
  --lab-neg-bg: rgba(242, 107, 110, .12);
  --lab-warn: #f0b44c;
  --lab-warn-bg: rgba(240, 180, 76, .13);
  /* séries dos gráficos */
  --lab-rec: #3987e5;
  --lab-custo: #d95926;
  --lab-grid: rgba(148, 163, 190, .08);
  --lab-axis: rgba(148, 163, 190, .22);
  --lab-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .7);
  --lab-pop: 0 24px 64px -24px rgba(0, 0, 0, .8), 0 0 0 1px rgba(148, 163, 190, .14);
  /* tipografia e forma */
  --lab-font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  color-scheme: dark;

  /* tokens antigos apontando para os novos (os estilos escritos no código passam a seguir o tema) */
  --bg: var(--lab-bg);
  --bg2: var(--lab-s1);
  --bg3: var(--lab-s2);
  --card: var(--lab-s1);
  --card2: var(--lab-s2);
  --border: var(--lab-line2);
  --text: var(--lab-ink);
  --text2: var(--lab-ink2);
  --accent: var(--lab-accent);
  --accent2: var(--lab-accent-2);
  --green: var(--lab-pos);
  --red: var(--lab-neg);
  --yellow: var(--lab-warn);
  --radius: var(--r-md);
  --shadow: var(--lab-shadow);
}
body[data-theme="light"],
body[data-theme="classic"] {
  --lab-bg: #f3f4f7;
  --lab-s1: #ffffff;
  --lab-s2: #f6f7f9;
  --lab-s3: #eceef2;
  --lab-line: rgba(17, 24, 39, .07);
  --lab-line2: rgba(17, 24, 39, .12);
  --lab-ink: #111622;
  --lab-ink2: #4a5466;
  --lab-ink3: #848d9d;
  --lab-accent: #3e52d6;
  --lab-accent-2: #3243b8;
  --lab-accent-bg: rgba(62, 82, 214, .09);
  --lab-on-accent: #ffffff;
  --lab-pos: #11804a;
  --lab-pos-bg: rgba(17, 128, 74, .09);
  --lab-neg: #cf3434;
  --lab-neg-bg: rgba(207, 52, 52, .08);
  --lab-warn: #a86a10;
  --lab-warn-bg: rgba(212, 140, 20, .12);
  --lab-rec: #2a78d6;
  --lab-custo: #eb6834;
  --lab-grid: rgba(17, 24, 39, .06);
  --lab-axis: rgba(17, 24, 39, .2);
  --lab-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px -16px rgba(17, 24, 39, .18);
  --lab-pop: 0 24px 64px -24px rgba(17, 24, 39, .35), 0 0 0 1px rgba(17, 24, 39, .08);
  color-scheme: light;
}

/* ---------- 2. Base e tipografia ---------- */
body[data-theme] {
  background: var(--lab-bg) !important;
  color: var(--lab-ink);
  font-family: var(--lab-font);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
body[data-theme] button,
body[data-theme] input,
body[data-theme] select,
body[data-theme] textarea { font-family: inherit; }
body[data-theme] ::selection { background: var(--lab-accent-bg); }
body[data-theme] :focus-visible { outline: 2px solid var(--lab-accent); outline-offset: 2px; border-radius: 6px; }
body[data-theme] [style*="text-transform:uppercase"],
body[data-theme] [style*="text-transform: uppercase"] { text-transform: none !important; letter-spacing: 0 !important; }
.lab-i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3.5px; }
.lab-emo { display: inline-flex; align-items: center; vertical-align: -3px; }
.lab-emo .lab-i { width: 1.15em; height: 1.15em; vertical-align: 0; }
.lab-emo.lab-seta .lab-i { width: 1em; height: 1em; }
.lab-c-pos { color: var(--lab-pos); }
.lab-c-neg { color: var(--lab-neg); }
.lab-c-warn { color: var(--lab-warn); }
.lab-c-pos .lab-i, .lab-c-neg .lab-i, .lab-c-warn .lab-i { width: .95em; height: .95em; }
@media (prefers-reduced-motion: reduce) { body[data-theme] * { transition: none !important; animation: none !important; } }

/* ---------- 3. Menu lateral ---------- */
body[data-theme] .sidebar {
  width: 232px !important;
  background: var(--lab-bg) !important;
  border-right: 1px solid var(--lab-line) !important;
  padding: 18px 12px 12px !important;
  backdrop-filter: none !important;
  display: flex; flex-direction: column;
}
body[data-theme] .sidebar-logo { border: 0 !important; padding: 2px 10px 22px !important; margin: 0 !important; text-align: left !important; }
body[data-theme] .sidebar-logo img { max-height: 30px; max-width: 150px; display: block; }
.lab-wordmark { font-weight: 650; font-size: 17px; letter-spacing: -.02em; color: var(--lab-ink); }
.lab-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
body[data-theme] .nav-item {
  display: flex; align-items: center; gap: 11px;
  margin: 0 !important; padding: 8px 10px !important;
  border-radius: var(--r-sm) !important;
  color: var(--lab-ink2) !important; font-size: 13.5px; font-weight: 450;
  background: transparent !important; box-shadow: none !important;
  text-decoration: none; transition: background .15s, color .15s;
}
body[data-theme] .nav-item .lab-i { color: var(--lab-ink3); }
body[data-theme] .nav-item:hover { background: var(--lab-s2) !important; color: var(--lab-ink) !important; }
body[data-theme] .nav-item.active { background: var(--lab-s2) !important; color: var(--lab-ink) !important; font-weight: 550; position: relative; }
body[data-theme] .nav-item.active .lab-i { color: var(--lab-accent); }
body[data-theme] .nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lab-accent); }
.lab-side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 2px; border-top: 1px solid var(--lab-line); margin-top: 10px; }
.lab-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.lab-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--lab-accent-bg); color: var(--lab-accent); font-weight: 600; font-size: 12px; flex: none; }
.lab-user-nome { font-size: 13px; color: var(--lab-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-iconbtn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none;
  border-radius: var(--r-sm); border: 1px solid var(--lab-line2); background: var(--lab-s1);
  color: var(--lab-ink2); cursor: pointer; transition: background .15s, color .15s;
}
.lab-iconbtn:hover { background: var(--lab-s2); color: var(--lab-ink); }
body[data-theme] .sidebar-close { background: none; border: 0; color: var(--lab-ink2); top: 14px; right: 12px; }
body[data-theme] .main { margin-left: 232px !important; padding: 22px 32px 48px !important; max-width: none !important; }
@media (min-width: 769px) { body[data-theme].sidebar-collapsed .main { margin-left: 0 !important; } }
@media (max-width: 900px) {
  body[data-theme] .sidebar { transform: translateX(-100%); box-shadow: var(--lab-pop); }
  body[data-theme] .sidebar.open { transform: translateX(0); }
  body[data-theme] .main { margin-left: 0 !important; padding: 14px 16px 40px !important; }
}

/* ---------- 4. Topo ---------- */
body[data-theme] .header.lab-top { display: flex; align-items: center; gap: 14px; margin: 0 0 18px !important; padding: 0 !important; flex-wrap: nowrap; }
body[data-theme] .header.lab-top h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; flex: 1; min-width: 0; display: block !important; }
body[data-theme] .header .header-actions { display: flex; align-items: center; gap: 10px; }
body[data-theme] .header-cotacoes { display: flex !important; gap: 8px; margin: 0 !important; }
.lab-cot { display: grid; grid-template-columns: auto auto; column-gap: 7px; align-items: baseline; padding: 6px 12px; border-radius: var(--r-sm); background: var(--lab-s1); border: 1px solid var(--lab-line); }
.lab-cot-sim { font-size: 12px; color: var(--lab-ink3); font-weight: 500; }
.lab-cot-v { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lab-cot-r { grid-column: 1 / -1; font-size: 11px; color: var(--lab-ink3); line-height: 1.2; }
body[data-theme] .hamburger {
  width: 36px !important; height: 36px !important; border-radius: var(--r-sm) !important;
  background: var(--lab-s1) !important; border: 1px solid var(--lab-line2) !important; color: var(--lab-ink2) !important;
  display: none; place-items: center; cursor: pointer; padding: 0; position: static !important;
}
@media (min-width: 769px) { body[data-theme].sidebar-collapsed .hamburger { display: grid !important; } }
@media (max-width: 900px) {
  body[data-theme] .hamburger { display: grid !important; }
  body[data-theme] .header.lab-top h1 { font-size: 18px; }
  .lab-cot { padding: 5px 9px; }
  .lab-cot-r { display: none; }
}
@media (max-width: 420px) { .lab-cot-sim { display: none; } .lab-cot-v { font-size: 13px; } }

/* ---------- 5. Filtros e controles ---------- */
body[data-theme] .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px !important; }
body[data-theme] .filter-btns { display: inline-flex !important; gap: 2px !important; padding: 3px; background: var(--lab-s1); border: 1px solid var(--lab-line); border-radius: 10px; flex-wrap: wrap; }
body[data-theme] .filter-btn {
  border: 0 !important; background: transparent !important; color: var(--lab-ink2) !important;
  padding: 6px 12px !important; border-radius: 7px !important; font-size: 13px !important; font-weight: 500 !important; line-height: 1.2;
}
body[data-theme] .filter-btn:hover { color: var(--lab-ink) !important; background: var(--lab-s2) !important; }
body[data-theme] .filter-btn.active { background: var(--lab-s3) !important; color: var(--lab-ink) !important; box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 1px 2px rgba(0, 0, 0, .2); }
body[data-theme] input[type="date"],
body[data-theme] input[type="text"],
body[data-theme] input[type="email"],
body[data-theme] input[type="password"],
body[data-theme] input[type="number"],
body[data-theme] input:not([type]),
body[data-theme] select,
body[data-theme] textarea {
  background: var(--lab-s1) !important; color: var(--lab-ink) !important;
  border: 1px solid var(--lab-line2) !important; border-radius: var(--r-sm) !important;
  padding: 7px 11px !important; font-size: 13px !important; min-height: 36px; box-shadow: none !important;
  transition: border-color .15s;
}
body[data-theme] input:focus, body[data-theme] select:focus, body[data-theme] textarea:focus { outline: none; border-color: var(--lab-accent) !important; box-shadow: 0 0 0 3px var(--lab-accent-bg) !important; }
body[data-theme] input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; filter: invert(var(--lab-cal-inv, 1)); cursor: pointer; }
body[data-theme="light"], body[data-theme="classic"] { --lab-cal-inv: 0; }
body[data-theme] input[type="checkbox"], body[data-theme] input[type="radio"] { accent-color: var(--lab-accent); }

body[data-theme] .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 7px 15px !important; border-radius: var(--r-sm) !important;
  font-size: 13px !important; font-weight: 550 !important; letter-spacing: 0; border: 1px solid transparent !important;
  box-shadow: none !important; transition: background .15s, border-color .15s, color .15s;
}
body[data-theme] .btn-primary { background: var(--lab-accent) !important; color: var(--lab-on-accent) !important; }
body[data-theme] .btn-primary:hover { background: var(--lab-accent-2) !important; }
body[data-theme] .btn-outline { background: var(--lab-s1) !important; color: var(--lab-ink) !important; border-color: var(--lab-line2) !important; }
body[data-theme] .btn-outline:hover { background: var(--lab-s2) !important; }
body[data-theme] .btn-danger { background: var(--lab-neg-bg) !important; color: var(--lab-neg) !important; border-color: transparent !important; }
body[data-theme] .btn-danger:hover { background: var(--lab-neg) !important; color: #fff !important; }
body[data-theme] .btn-sm { min-height: 30px; padding: 4px 10px !important; font-size: 12.5px !important; }
/* "Atualizar GAM" é ação de manutenção, não de perigo */
body[data-theme] .filters .btn-danger { background: transparent !important; color: var(--lab-ink2) !important; border-color: var(--lab-line2) !important; }
body[data-theme] .filters .btn-danger:hover { background: var(--lab-s2) !important; color: var(--lab-ink) !important; }
@media (max-width: 700px) {
  body[data-theme] .filters input[type="date"], body[data-theme] .filters select { flex: 1 1 140px; width: auto !important; }
  body[data-theme] .filters .btn { flex: 1 1 auto; }
}

.lab-btn-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--lab-line2); background: var(--lab-s1); color: var(--lab-ink2);
  font-size: 12px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.lab-btn-chip .lab-i { width: 14px; height: 14px; vertical-align: 0; color: var(--lab-accent); }
.lab-btn-chip:hover { border-color: var(--lab-accent); color: var(--lab-ink); background: var(--lab-accent-bg); }
.lab-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--lab-s2); border: 1px solid var(--lab-line); flex-wrap: wrap; }
.lab-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--lab-ink2); font-size: 13px; font-weight: 500; cursor: pointer; }
.lab-tab .lab-i { width: 15px; height: 15px; vertical-align: 0; }
.lab-tab:hover { color: var(--lab-ink); }
.lab-tab.on { background: var(--lab-s1); color: var(--lab-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.lab-tab.on .lab-i { color: var(--lab-accent); }
.lab-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--lab-s2); color: var(--lab-ink2); white-space: nowrap; }
.lab-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lab-badge.pos { background: var(--lab-pos-bg); color: var(--lab-pos); }
.lab-badge.warn { background: var(--lab-warn-bg); color: var(--lab-warn); }
.lab-badge.neg { background: var(--lab-neg-bg); color: var(--lab-neg); }
body[data-theme] .badge { border-radius: 999px; font-weight: 550; padding: 2px 9px; }

/* ---------- 6. Seções (sanfona) ---------- */
body[data-theme] .section { margin-bottom: 28px !important; }
body[data-theme] .sec-toggle.lab-sec {
  width: 100%; display: flex; align-items: center; gap: 9px;
  background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  padding: 4px 0 12px !important; margin: 0 !important;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--lab-ink); cursor: pointer; text-align: left;
}
.lab-sec .lab-i { color: var(--lab-ink3); width: 17px; height: 17px; }
.lab-sec .lab-sec-arr { width: 15px; height: 15px; transition: transform .18s; }
.lab-sec.open .lab-sec-arr { transform: rotate(90deg); }
.lab-sec:hover .lab-sec-arr { color: var(--lab-ink); }

/* ---------- 7. Resumo do período (o elemento principal da tela) ---------- */
.lab-hero { background: var(--lab-s1); border: 1px solid var(--lab-line); border-radius: var(--r-lg); box-shadow: var(--lab-shadow); padding: 24px 26px 18px; margin-bottom: 30px; }
.lab-hero-top { display: grid; grid-template-columns: minmax(250px, 1fr) 2.3fr; gap: 28px; align-items: start; }
.lab-lbl { font-size: 12.5px; color: var(--lab-ink2); font-weight: 500; margin-bottom: 6px; }
.lab-hero-num { font-size: clamp(36px, 3.6vw, 52px); font-weight: 600; letter-spacing: -.035em; line-height: 1.02; margin-bottom: 10px; color: var(--lab-ink); white-space: nowrap; }
.lab-hero-num.neg { color: var(--lab-neg); }
.lab-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 1px solid var(--lab-line); }
.lab-stat { padding: 2px 0 2px 20px; min-width: 0; }
.lab-stat + .lab-stat { border-left: 1px solid var(--lab-line); }
.lab-stat-v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 6px; white-space: nowrap; }
.lab-stat-v.pos { color: var(--lab-pos); }
.lab-stat-v.neg { color: var(--lab-neg); }
.lab-cap { font-size: 11.5px; color: var(--lab-ink3); margin-top: 5px; line-height: 1.35; }
.lab-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 550; color: var(--lab-ink2); white-space: nowrap; }
.lab-delta .lab-i { width: 13px; height: 13px; vertical-align: 0; stroke-width: 2.25; }
.lab-delta.pos { color: var(--lab-pos); }
.lab-delta.neg { color: var(--lab-neg); }
.lab-delta-c { color: var(--lab-ink3); font-weight: 450; }
.lab-spread { margin: 22px 0 4px; }
.lab-spread-bar { display: flex; gap: 2px; height: 10px; border-radius: 6px; overflow: hidden; background: var(--lab-s2); }
.lab-spread-bar span { display: block; height: 100%; }
.sp-custo { background: var(--lab-custo); border-radius: 6px 0 0 6px; }
.sp-lucro { background: var(--lab-pos); border-radius: 0 6px 6px 0; }
.sp-falta { background: var(--lab-neg); border-radius: 0 6px 6px 0; }
.lab-spread-txt { margin-top: 9px; font-size: 13px; color: var(--lab-ink2); }
.lab-spread-txt b { color: var(--lab-ink); font-weight: 600; }
.lab-spread-txt b.pos { color: var(--lab-pos); }
.lab-spread-txt b.neg { color: var(--lab-neg); }
.lab-chart-wrap { margin-top: 22px; border-top: 1px solid var(--lab-line); padding-top: 18px; }
.lab-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.lab-h2 { font-size: 14px; font-weight: 600; }
.lab-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--lab-ink2); }
.lab-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lk-line { display: inline-block; width: 14px; height: 2px; border-radius: 2px; background: var(--lab-ink3); }
.lk-line.rec { background: var(--lab-rec); }
.lk-line.custo { background: var(--lab-custo); }
.lk-bar { display: inline-block; width: 8px; height: 11px; border-radius: 2px 2px 0 0; background: linear-gradient(var(--lab-pos) 0 50%, var(--lab-neg) 50% 100%); }
.lab-tip .lk-bar { background: var(--lab-pos); }
.lab-tip .lk-bar.neg { background: var(--lab-neg); }
.lab-chart { position: relative; min-height: 220px; }
.lab-chart-vazio { display: grid; place-items: center; height: 220px; color: var(--lab-ink3); font-size: 13px; }
.lab-svg { display: block; overflow: visible; }
.lab-svg .g-grid { stroke: var(--lab-grid); stroke-width: 1; }
.lab-svg .g-base { stroke: var(--lab-axis); stroke-width: 1; }
.lab-svg .g-tick { fill: var(--lab-ink3); font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--lab-font); }
.lab-svg .g-bar.pos { fill: var(--lab-pos); opacity: .85; }
.lab-svg .g-bar.neg { fill: var(--lab-neg); opacity: .85; }
.lab-svg .g-bar.fora { opacity: .28; }
.lab-svg .g-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lab-svg .g-line.rec { stroke: var(--lab-rec); }
.lab-svg .g-line.custo { stroke: var(--lab-custo); }
.lab-svg .g-end { stroke: var(--lab-s1); stroke-width: 2; }
.lab-svg .g-end.rec { fill: var(--lab-rec); }
.lab-svg .g-end.custo { fill: var(--lab-custo); }
.lab-svg .g-cross { stroke: var(--lab-ink3); stroke-width: 1; pointer-events: none; }
.lab-svg .g-hit { fill: transparent; cursor: crosshair; outline: none; }
.lab-tip { position: absolute; z-index: 5; min-width: 220px; padding: 10px 12px; border-radius: 10px; background: var(--lab-s3); box-shadow: var(--lab-pop); pointer-events: none; font-size: 12.5px; }
.lab-tip-h { font-size: 12px; color: var(--lab-ink2); margin-bottom: 6px; }
.lab-tip-r { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 8px; padding: 2px 0; }
.lab-tip-r b { font-weight: 600; font-variant-numeric: tabular-nums; }
.lab-tip-r b.pos { color: var(--lab-pos); }
.lab-tip-r b.neg { color: var(--lab-neg); }
.lab-tip-r span { color: var(--lab-ink2); }
.lab-tabela { margin-top: 6px; }
.lab-tabela summary { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--lab-ink2); cursor: pointer; padding: 4px 0; list-style: none; }
.lab-tabela summary::-webkit-details-marker { display: none; }
.lab-tabela summary .lab-i { width: 15px; height: 15px; vertical-align: 0; }
.lab-tabela summary:hover { color: var(--lab-ink); }
.lab-tabela[open] summary { margin-bottom: 8px; }
.lab-tabela > div { max-height: 340px; overflow: auto; }
.lab-mini td.pos { color: var(--lab-pos); }
.lab-mini td.neg { color: var(--lab-neg); }
.lab-mini tr.fora td { color: var(--lab-ink3); }
@media (max-width: 1280px) {
  .lab-hero-top { grid-template-columns: 1fr; gap: 18px; }
  .lab-stats { border-left: 0; border-top: 1px solid var(--lab-line); padding-top: 16px; }
  .lab-stat:first-child { padding-left: 0; }
}
@media (max-width: 760px) {
  .lab-hero { padding: 18px 16px 12px; border-radius: var(--r-md); }
  .lab-stats { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .lab-stat { padding-left: 14px; }
  .lab-stat:nth-child(odd) { padding-left: 0; border-left: 0 !important; }
  .lab-stat-v { font-size: 19px; }
  .lab-legend { gap: 10px; }
}

/* ---------- 8. Indicadores detalhados (blocos antigos, agora sem caixas pesadas) ---------- */
body[data-theme] .kpi-blocks { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 14px !important; margin: 0 !important; }
body[data-theme] .kpi-block,
body[data-theme] .kpi-block.kpi-block-gam,
body[data-theme] .kpi-block.kpi-block-fb,
body[data-theme] .kpi-block.kpi-block-roas,
body[data-theme] .kpi-block.kpi-block-adsense {
  background: var(--lab-s1) !important; border: 1px solid var(--lab-line) !important; border-radius: var(--r-lg) !important;
  box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; padding: 18px 20px !important;
}
body[data-theme] .kpi-block::before { display: none !important; }
body[data-theme] .kpi-block-header { border: 0 !important; padding: 0 !important; margin: 0 0 12px !important; }
body[data-theme] .kpi-block-dot { width: 8px !important; height: 8px !important; border-radius: 50% !important; }
body[data-theme] .kpi-block-gam .kpi-block-dot { background: var(--lab-rec) !important; }
body[data-theme] .kpi-block-fb .kpi-block-dot { background: var(--lab-custo) !important; }
body[data-theme] .kpi-block-roas .kpi-block-dot { background: var(--lab-pos) !important; }
body[data-theme] .kpi-blocks .kpi-block .kpi-block-header .kpi-block-title,
body[data-theme] .kpi-block-title { font-size: 13.5px !important; font-weight: 600 !important; letter-spacing: -.005em !important; color: var(--lab-ink) !important; text-transform: none !important; }
body[data-theme] .kpi-block-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 0 !important; }
body[data-theme] .kpi-block .kpi-card,
body[data-theme] .kpi-block.kpi-block-gam .kpi-card,
body[data-theme] .kpi-block.kpi-block-fb .kpi-card,
body[data-theme] .kpi-block.kpi-block-roas .kpi-card {
  background: transparent !important; border: 0 !important; border-top: 1px solid var(--lab-line) !important; border-radius: 0 !important;
  box-shadow: none !important; padding: 10px 2px !important; transform: none !important; backdrop-filter: none !important;
}
body[data-theme] .kpi-block .kpi-card:hover { background: transparent !important; }
body[data-theme] .kpi-label { font-size: 12px !important; color: var(--lab-ink2) !important; text-transform: none !important; letter-spacing: 0 !important; opacity: 1 !important; margin-bottom: 3px !important; font-weight: 450; }
body[data-theme] .kpi-value { font-size: 18px !important; font-weight: 600 !important; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
body[data-theme] .kpi-value.positive { color: var(--lab-pos) !important; }
body[data-theme] .kpi-value.negative { color: var(--lab-neg) !important; }
/* já aparecem no resumo de cima: não repetir */
body[data-theme] .lab-hero ~ .section .kpi-block .kpi-card[data-kpi="liquido"],
body[data-theme] .lab-hero ~ .section .kpi-block .kpi-card[data-kpi="roi"],
body[data-theme] .lab-hero ~ .section .kpi-block .kpi-card[data-kpi="receita_bruta"],
body[data-theme] .lab-hero ~ .section .kpi-block .kpi-card[data-kpi="fb_com_imposto"] { display: none !important; }
body[data-theme] .kpi-grid .kpi-card { background: var(--lab-s1); border: 1px solid var(--lab-line); border-radius: var(--r-md); box-shadow: none; }
body[data-theme] .kpi-grid .kpi-card:hover { transform: none; border-color: var(--lab-line2); }
@media (max-width: 1100px) { body[data-theme] .kpi-blocks { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 700px) { body[data-theme] .kpi-blocks { grid-template-columns: 1fr !important; } }

/* ---------- 9. Ad Managers (cartões escritos no código: ajustados aqui) ---------- */
body[data-theme] .section > div[style*="grid-template-columns:repeat(auto-fit,minmax(200px"] { gap: 10px !important; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important; }
body[data-theme] div[onclick^="filterByAM"] {
  background: var(--lab-s1) !important; border: 1px solid var(--lab-line) !important; border-radius: var(--r-md) !important;
  text-align: left !important; padding: 14px 16px !important; position: relative; transition: border-color .15s;
}
body[data-theme] div[onclick^="filterByAM"]:hover { border-color: var(--lab-line2) !important; }
body[data-theme] div[onclick^="filterByAM"][style*="solid var(--accent)"] { border-color: var(--lab-accent) !important; box-shadow: 0 0 0 3px var(--lab-accent-bg); }
body[data-theme] div[onclick^="filterByAM"] > div:first-child { font-size: 13.5px !important; font-weight: 600 !important; margin-bottom: 8px !important; }
body[data-theme] div[onclick^="filterByAM"] > div:nth-child(2) { font-size: 24px !important; font-weight: 600 !important; letter-spacing: -.02em; }
body[data-theme] div[onclick^="filterByAM"] > div:nth-child(3) { font-size: 13px !important; font-weight: 500 !important; }
body[data-theme] div[onclick^="filterByAM"] > div:nth-child(4) { margin-top: 10px !important; padding-top: 8px; border-top: 1px solid var(--lab-line); font-size: 11px !important; color: var(--lab-ink3) !important; font-weight: 500 !important; }

/* ---------- 10. Sites e grupos (cartões) ---------- */
body[data-theme] .table-wrap { overflow-x: auto; }
body[data-theme] div[onclick^="toggleGrupoDash"],
body[data-theme] div[onclick^="toggleSiteCard"] {
  background: var(--lab-s1) !important; border: 1px solid var(--lab-line) !important; border-radius: var(--r-md) !important;
  padding: 12px 16px !important; margin-bottom: 8px !important; transition: border-color .15s, background .15s; gap: 8px 10px !important;
}
body[data-theme] div[onclick^="toggleGrupoDash"] > strong,
body[data-theme] div[onclick^="toggleSiteCard"] > strong { flex: 1 1 230px !important; min-width: 200px; overflow-wrap: anywhere; }
body[data-theme] div[onclick^="toggleGrupoDash"] > div[style*="flex:0 0"],
body[data-theme] div[onclick^="toggleSiteCard"] > div[style*="flex:0 0"] { flex-shrink: 1 !important; min-width: 62px; }
body[data-theme] div[onclick^="toggleGrupoDash"]:hover,
body[data-theme] div[onclick^="toggleSiteCard"]:hover { border-color: var(--lab-line2) !important; background: var(--lab-s1) !important; }
body[data-theme] div[onclick^="toggleGrupoDash"] > strong,
body[data-theme] div[onclick^="toggleSiteCard"] > strong { color: var(--lab-ink) !important; font-weight: 600 !important; font-size: 13.5px !important; display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; line-height: 1.3; }
body[data-theme] div[onclick^="toggleGrupoDash"] > strong .lab-emo,
body[data-theme] div[onclick^="toggleSiteCard"] > strong .lab-emo { color: var(--lab-ink3); }
body[data-theme] div[onclick^="toggleGrupoDash"] > strong .lab-emo.lab-seta,
body[data-theme] div[onclick^="toggleSiteCard"] > strong .lab-emo.lab-seta { color: var(--lab-ink3); }
body[data-theme] div[onclick^="toggleGrupoDash"] > strong .lab-c-pos,
body[data-theme] div[onclick^="toggleSiteCard"] > strong .lab-c-pos { color: var(--lab-pos); }
body[data-theme] div[onclick^="toggleGrupoDash"] > strong .lab-c-warn,
body[data-theme] div[onclick^="toggleSiteCard"] > strong .lab-c-warn { color: var(--lab-warn); }
body[data-theme] div[onclick^="toggleGrupoDash"] div[style*="font-size:10px;letter-spacing"],
body[data-theme] div[onclick^="toggleSiteCard"] div[style*="font-size:10px;letter-spacing"] { font-size: 11.5px !important; color: var(--lab-ink3) !important; font-weight: 450; }
body[data-theme] div[onclick^="toggleGrupoDash"] div[style*="font-size:13px;font-weight:700"],
body[data-theme] div[onclick^="toggleSiteCard"] div[style*="font-size:13px;font-weight:700"] { font-size: 14px !important; font-weight: 600 !important; font-variant-numeric: tabular-nums; }
body[data-theme] div[onclick^="toggleGrupoDash"] + div,
body[data-theme] div[onclick^="toggleSiteCard"] + div { background: var(--lab-s1) !important; border: 1px solid var(--lab-line) !important; border-radius: var(--r-md) !important; margin-top: -4px !important; padding: 6px 14px 8px !important; }
body[data-theme] tr:has(> td > div > div[onclick^="toggleGrupoDash"]):hover,
body[data-theme] tr:has(> td > div > div[onclick^="toggleSiteCard"]):hover { background: transparent !important; }
body[data-theme] td[colspan="13"] > div { margin: 0 0 8px !important; }

/* ---------- 11. Tabelas ---------- */
body[data-theme] table { font-size: 13px; border-collapse: collapse; }
body[data-theme] th {
  color: var(--lab-ink3) !important; font-size: 12px !important; font-weight: 500 !important;
  text-transform: none !important; letter-spacing: 0 !important; padding: 10px 12px !important;
  border-bottom: 1px solid var(--lab-line2) !important; background: transparent; white-space: nowrap;
}
body[data-theme] td { padding: 10px 12px !important; border-bottom: 1px solid var(--lab-line) !important; font-variant-numeric: tabular-nums; }
body[data-theme] tr:hover { background: var(--lab-s2); }
body[data-theme] tr:last-child > td { border-bottom: 0 !important; }
body[data-theme] tr[style*="border-top:2px solid var(--accent)"] { border-top: 1px solid var(--lab-line2) !important; background: var(--lab-s2) !important; }
body[data-theme] tr[style*="border-top:2px solid var(--accent)"] > td { font-weight: 600; }
body[data-theme] .roiTab th { font-size: 11.5px !important; padding: 9px 6px !important; white-space: normal; }
body[data-theme] .roiTab td { padding: 9px 6px !important; }

/* ---------- 12. Popups ---------- */
body[data-theme] .modal-overlay { background: rgba(5, 7, 12, .62) !important; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
body[data-theme="light"] .modal-overlay, body[data-theme="classic"] .modal-overlay { background: rgba(17, 22, 34, .32) !important; }
body[data-theme] .modal { background: var(--lab-s1) !important; border: 0 !important; border-radius: var(--r-lg) !important; box-shadow: var(--lab-pop) !important; padding: 24px 26px !important; }
body[data-theme] .modal h3 { font-size: 18px !important; font-weight: 600 !important; letter-spacing: -.015em; display: inline-flex; align-items: center; gap: 9px; }
body[data-theme] .modal h3 .lab-emo { color: var(--lab-accent); }
body[data-theme] .modal .btn-outline[onclick="closeModal()"]:not(.modal-actions .btn-outline) { width: 34px; padding: 0 !important; }   /* (fix-065) só o X do topo; o "Cancelar" do rodapé fica com a largura normal */
body[data-theme] .form-group label { font-size: 12.5px !important; color: var(--lab-ink2) !important; font-weight: 500; margin-bottom: 6px !important; }
body[data-theme] .modal div[style*="border:1px solid var(--accent)"][style*="border-radius:6px"] { border-color: transparent !important; background: var(--lab-accent-bg) !important; color: var(--lab-ink) !important; border-radius: var(--r-sm) !important; }
body[data-theme] .loading { color: var(--lab-ink3); }

/* ---------- 13. Login ---------- */
body[data-theme] .modal .form-group input { width: 100%; }

/* ---------- 14. Outras telas: herdam tokens; só ajustes de títulos ---------- */
body[data-theme] .section-title { font-size: 15px !important; font-weight: 600 !important; }
body[data-theme] .card, body[data-theme] .kpi-card { border-radius: var(--r-md); }

/* ---------- 15. Ajustes finos (camadas antigas do style.css) ---------- */
body[data-theme] .main { min-width: 0; }
body[data-theme] td[colspan="13"] { padding: 0 !important; border: 0 !important; }
body[data-theme] .table-wrap > table { min-width: 0 !important; table-layout: fixed; width: 100%; }
body[data-theme] .lab-cot-v { display: inline !important; }
body[data-theme] .lab-cot-sim, body[data-theme] .lab-cot-r { display: inline; }
@media (max-width: 900px) {
  body[data-theme] .filters { flex-direction: row !important; align-items: stretch !important; }
  body[data-theme] .filters input[type="date"], body[data-theme] .filters select { height: 38px !important; min-height: 38px !important; padding: 7px 10px !important; }
  body[data-theme] .filters .btn { width: auto !important; padding: 8px 14px !important; font-size: 13px !important; min-height: 38px; }
  body[data-theme] .filter-btns { width: 100%; }
  body[data-theme] .filter-btn { flex: 1 1 auto !important; text-align: center; padding: 7px 8px !important; }
  body[data-theme] .header.lab-top { padding: 0 !important; gap: 8px !important; }
  body[data-theme] th { font-size: 11.5px !important; }
}
@media (max-width: 420px) { body[data-theme] .lab-cot-sim, body[data-theme] .lab-cot-r { display: none !important; } }
@media (max-width: 760px) {
  body[data-theme] div[onclick^="toggleGrupoDash"][title],
  body[data-theme] div[onclick^="toggleSiteCard"][title] { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px !important; align-items: start !important; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > strong,
  body[data-theme] div[onclick^="toggleSiteCard"][title] > strong { grid-column: 1 / 3; min-width: 0; align-self: center; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > span,
  body[data-theme] div[onclick^="toggleSiteCard"][title] > span { grid-column: 3; justify-self: end; align-self: center; }
  body[data-theme] div[onclick^="toggleGrupoDash"] > div[style*="flex:0 0"],
  body[data-theme] div[onclick^="toggleSiteCard"] > div[style*="flex:0 0"] { min-width: 0 !important; }
  body[data-theme] .section > div[style*="grid-template-columns:repeat(auto-fit,minmax(200px"] { grid-template-columns: 1fr 1fr !important; }
  body[data-theme] .kpi-blocks .kpi-block .kpi-block-grid { grid-template-columns: 1fr 1fr !important; }
  body[data-theme] .kpi-blocks .kpi-block .kpi-label { font-size: 11.5px !important; }
}

/* ---------- 16. Cartões de site/grupo fechados em grade (colunas alinhadas entre cartões) ---------- */
body[data-theme] div[onclick^="toggleGrupoDash"][title],
body[data-theme] div[onclick^="toggleSiteCard"][title] {
  display: grid !important; align-items: center !important; column-gap: 14px !important; row-gap: 12px !important;
  grid-template-columns: minmax(190px, 1.8fr) 96px repeat(5, minmax(58px, .9fr)) minmax(118px, 1.45fr) minmax(92px, 1.1fr) minmax(92px, 1.1fr) minmax(70px, .8fr);
}
body[data-theme] div[onclick^="toggleGrupoDash"][title] > *,
body[data-theme] div[onclick^="toggleSiteCard"][title] > * { min-width: 0 !important; flex: none !important; }
body[data-theme] div[onclick^="toggleGrupoDash"][title] > strong,
body[data-theme] div[onclick^="toggleSiteCard"][title] > strong { min-width: 0 !important; }
@media (max-width: 1360px) and (min-width: 761px) {
  body[data-theme] div[onclick^="toggleGrupoDash"][title],
  body[data-theme] div[onclick^="toggleSiteCard"][title] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > strong,
  body[data-theme] div[onclick^="toggleSiteCard"][title] > strong { grid-column: 1 / 5; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > span,
  body[data-theme] div[onclick^="toggleSiteCard"][title] > span { grid-column: 5; justify-self: end; }
}

/* ---------- 17. Gráfico com métricas à escolha, filtro de grupo/site e recolher ---------- */
body[data-theme] {
  --lab-c1: #3987e5; --lab-c2: #d95926; --lab-c3: #199e70; --lab-c4: #c98500; --lab-c5: #d55181; --lab-c7: #9085e9;
}
body[data-theme="light"], body[data-theme="classic"] {
  --lab-c1: #2a78d6; --lab-c2: #eb6834; --lab-c3: #1baf7a; --lab-c4: #eda100; --lab-c5: #e87ba4; --lab-c7: #6250d6;
}
.lk-line.c1, .lab-svg .g-line.c1 { background: var(--lab-c1); stroke: var(--lab-c1); }
.lk-line.c2, .lab-svg .g-line.c2 { background: var(--lab-c2); stroke: var(--lab-c2); }
.lk-line.c3, .lab-svg .g-line.c3 { background: var(--lab-c3); stroke: var(--lab-c3); }
.lk-line.c4, .lab-svg .g-line.c4 { background: var(--lab-c4); stroke: var(--lab-c4); }
.lk-line.c5, .lab-svg .g-line.c5 { background: var(--lab-c5); stroke: var(--lab-c5); }
.lk-line.c7, .lab-svg .g-line.c7 { background: var(--lab-c7); stroke: var(--lab-c7); }
.lab-svg .g-line { background: none !important; }
.lab-svg .g-end.c1 { fill: var(--lab-c1); } .lab-svg .g-end.c2 { fill: var(--lab-c2); } .lab-svg .g-end.c3 { fill: var(--lab-c3); }
.lab-svg .g-end.c4 { fill: var(--lab-c4); } .lab-svg .g-end.c5 { fill: var(--lab-c5); } .lab-svg .g-end.c7 { fill: var(--lab-c7); }
.lab-hero { position: relative; }
.lab-hero-tog { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; }
.lab-hero-top { padding-right: 34px; }
.lab-hero.fechado { padding-bottom: 22px; }
.lab-chart-head { align-items: center; }
.lab-h2-alvo { color: var(--lab-ink2); font-weight: 500; }
.lab-alvo { display: inline-flex; align-items: center; gap: 0; position: relative; }
.lab-alvo-ico { position: absolute; left: 10px; color: var(--lab-ink3); pointer-events: none; display: inline-flex; }
.lab-alvo-ico .lab-i { width: 15px; height: 15px; }
body[data-theme] .lab-alvo select { padding-left: 32px !important; min-width: 210px; max-width: 320px; }
.lab-mets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.lab-met {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--lab-line2); background: transparent; color: var(--lab-ink3); font-size: 12.5px; font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
}
.lab-met i { opacity: .35; }
.lab-met:hover { color: var(--lab-ink); border-color: var(--lab-ink3); }
.lab-met.on { background: var(--lab-s2); color: var(--lab-ink); border-color: var(--lab-line2); }
.lab-met.on i { opacity: 1; }
.lab-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--lab-ink3); margin-bottom: 6px; }
.lab-presets button { border: 0; background: none; padding: 2px 0; color: var(--lab-ink2); font-size: 12px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--lab-line2); text-underline-offset: 3px; }
.lab-presets button:hover { color: var(--lab-accent); text-decoration-color: var(--lab-accent); }
.lab-painel + .lab-painel { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--lab-line); }
.lab-painel-t { font-size: 11.5px; color: var(--lab-ink3); margin: 2px 0 0 56px; }
.lab-chart.lab-carregando { opacity: .45; transition: opacity .2s; }
@media (max-width: 760px) {
  .lab-chart-head { flex-direction: column; align-items: stretch; }
  body[data-theme] .lab-alvo select { min-width: 0; max-width: none; width: 100%; }
  .lab-alvo { width: 100%; }
  .lab-painel-t { margin-left: 0; }
}
@media (max-width: 760px) {
  .lab-delta { white-space: normal; flex-wrap: wrap; }
  .lab-stat-v { white-space: normal; }
}

/* ---------- 18. Hora a hora ---------- */
.lab-chart-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lab-tabs-sm .lab-tab { padding: 5px 11px; font-size: 12.5px; }
.lab-nota-hora { font-size: 11.5px; color: var(--lab-ink3); margin: 6px 0 2px; line-height: 1.45; }
@media (max-width: 760px) { .lab-chart-ctl { flex-direction: column; align-items: stretch; } .lab-tabs-sm { display: flex; } .lab-tabs-sm .lab-tab { flex: 1; justify-content: center; } }

/* ---------- 19. Logo clicável e ordenação dos projetos ---------- */
body[data-theme] .sidebar-logo { cursor: pointer; }
body[data-theme] .sidebar-logo:hover img, body[data-theme] .sidebar-logo:hover .lab-wordmark { opacity: .85; }
.lab-ordem {
  display: grid; align-items: end; column-gap: 14px; padding: 0 17px 8px;
  grid-template-columns: minmax(190px, 1.8fr) 96px repeat(5, minmax(58px, .9fr)) minmax(118px, 1.45fr) minmax(92px, 1.1fr) minmax(92px, 1.1fr) minmax(70px, .8fr);
}
.lab-ord { border: 0; background: none; padding: 2px 0; text-align: left; font-size: 11.5px; color: var(--lab-ink3); cursor: pointer; white-space: nowrap; font-family: inherit; }
.lab-ord i { font-style: normal; opacity: .45; }
.lab-ord b { color: var(--lab-accent); }
.lab-ord:hover, .lab-ord.on { color: var(--lab-ink); }
.lab-ord-sel { display: none; align-items: center; gap: 8px; font-size: 12.5px; color: var(--lab-ink2); margin: 0 0 10px; }
@media (max-width: 1360px) {
  .lab-ordem { display: none; }
  .lab-ord-sel { display: flex; }
  body[data-theme] .lab-ord-sel select { min-width: 0; flex: 1; max-width: 280px; }
}

/* ---------- 20. Ranking Top 10 ---------- */
.lab-rk-card { background: var(--lab-s1); border: 1px solid var(--lab-line); border-radius: var(--r-lg); padding: 16px 20px 14px; }
.lab-rk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.lab-rk-mets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lab-rk-sep { width: 1px; height: 22px; background: var(--lab-line2); margin: 0 4px; }
.lab-rk { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(5, auto); column-gap: 32px; }
.lab-rk-li { display: grid; grid-template-columns: 26px 26px minmax(0, 1fr) auto 44px; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--lab-line); }
.lab-rk-li:nth-child(1), .lab-rk-li:nth-child(6) { border-top: 0; }
.lab-rk-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--lab-ink2); background: var(--lab-s2); font-variant-numeric: tabular-nums; }
.lab-rk-li:nth-child(-n+3) .lab-rk-n { background: var(--lab-accent-bg); color: var(--lab-accent); }
.lab-rk-ic { font-size: 18px; line-height: 1; display: grid; place-items: center; color: var(--lab-ink3); }
.lab-rk-nome { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lab-rk-nome b { font-weight: 550; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-rk-nome small { font-size: 11.5px; color: var(--lab-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-rk-bar { display: block; height: 4px; border-radius: 3px; background: var(--lab-s2); margin-top: 4px; overflow: hidden; }
.lab-rk-bar i { display: block; height: 100%; border-radius: 3px; }
.lab-rk-bar i.pos { background: var(--lab-pos); } .lab-rk-bar i.neg { background: var(--lab-neg); } .lab-rk-bar i.neu { background: var(--lab-c1); }
.lab-rk-v { text-align: right; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lab-rk-v.neg { color: var(--lab-neg); }
.lab-rk-dl { font-size: 11px; font-weight: 500; color: var(--lab-ink3); }
.lab-rk-dl.pos { color: var(--lab-pos); } .lab-rk-dl.neg { color: var(--lab-neg); }
.lab-rk-mov { display: inline-flex; align-items: center; justify-content: flex-end; gap: 1px; font-size: 11.5px; font-weight: 600; color: var(--lab-ink3); font-variant-numeric: tabular-nums; }
.lab-rk-mov .lab-i { width: 13px; height: 13px; stroke-width: 2.25; vertical-align: 0; }
.lab-rk-mov.pos { color: var(--lab-pos); } .lab-rk-mov.neg { color: var(--lab-neg); }
.lab-rk-mov.novo { font-size: 10.5px; font-weight: 550; color: var(--lab-accent); }
.lab-rk-pe { font-size: 11.5px; color: var(--lab-ink3); margin-top: 10px; }
.lab-rk-pe b { color: var(--lab-ink2); font-weight: 600; }
@media (max-width: 1100px) { .lab-rk { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; } .lab-rk-li:nth-child(6) { border-top: 1px solid var(--lab-line); } }
@media (max-width: 760px) { .lab-rk-card { padding: 14px 14px 12px; } .lab-rk-head { flex-direction: column; align-items: stretch; } .lab-rk-sep { display: none; } }

/* ---------- 21. Grupo/site aberto: fundo pastel (fix-025) ---------- */
/* Lavanda bem clara, da mesma família do acento. Dentro dele a tinta vira a do tema claro para ler bem. */
body[data-theme] div[onclick^="toggleGrupoDash"] + div,
body[data-theme] div[onclick^="toggleSiteCard"] + div {
  --lab-ink: #1a2033; --lab-ink2: #4a5368; --lab-ink3: #6c7590;
  --lab-line: rgba(62, 82, 214, .10); --lab-line2: rgba(62, 82, 214, .18);
  --lab-s2: #e3e7fd; --lab-accent: #3e52d6; --lab-accent-bg: rgba(62, 82, 214, .10);
  --lab-pos: #0f7a45; --lab-neg: #c62f32; --lab-warn: #9a6008;
  --text: var(--lab-ink); --text2: var(--lab-ink2); --green: var(--lab-pos); --red: var(--lab-neg); --yellow: var(--lab-warn);
  --accent: var(--lab-accent); --border: var(--lab-line2); --bg3: var(--lab-s2); --card2: var(--lab-s2);
  background: #eef0fe !important; border-color: rgba(62, 82, 214, .22) !important; color: var(--lab-ink);
  color-scheme: light;
}
body[data-theme="light"] div[onclick^="toggleGrupoDash"] + div,
body[data-theme="light"] div[onclick^="toggleSiteCard"] + div,
body[data-theme="classic"] div[onclick^="toggleGrupoDash"] + div,
body[data-theme="classic"] div[onclick^="toggleSiteCard"] + div { background: #f1f3ff !important; }
body[data-theme] div[onclick^="toggleGrupoDash"] + div td,
body[data-theme] div[onclick^="toggleSiteCard"] + div td { color: var(--lab-ink); }
body[data-theme] div[onclick^="toggleGrupoDash"] + div tr:hover,
body[data-theme] div[onclick^="toggleSiteCard"] + div tr:hover { background: rgba(62, 82, 214, .06); }

/* ---------- 22. Expandir / minimizar todos (fix-026) ---------- */
.lab-ord-1 { display: flex; align-items: center; gap: 12px; min-width: 0; grid-column: 1 / 3; }
.lab-ord-1 + span { display: none; }
.lab-todos { display: inline-flex; gap: 6px; }
.lab-todos .lab-btn-chip { padding: 3px 9px; font-size: 11.5px; }
.lab-ord-m { display: none; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.lab-ord-m .lab-ord-sel { margin: 0; }
@media (max-width: 1360px) { .lab-ord-m { display: flex; } }
@media (max-width: 1700px) { .lab-ordem .lab-todos .lab-btn-chip > span { display: none; } .lab-ordem .lab-todos .lab-btn-chip { padding: 4px 7px; } }

/* ---------- 23. Celular: cartões de projeto em ficha (fix-027) ---------- */
@media (max-width: 760px) {
  /* cartão fechado: nome + Análise em cima; métricas em 3 colunas, dinheiro primeiro */
  body[data-theme] div[onclick^="toggleGrupoDash"][title],
  body[data-theme] div[onclick^="toggleSiteCard"][title] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important; column-gap: 12px !important; row-gap: 12px !important;
    align-items: start !important; padding: 12px 14px !important;
  }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > strong,
  body[data-theme] div[onclick^="toggleSiteCard"][title] > strong { grid-column: 1 / 3 !important; order: -2; align-self: center; white-space: normal; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > span,
  body[data-theme] div[onclick^="toggleSiteCard"][title] > span { grid-column: 3 !important; order: -1; justify-self: end; align-self: center; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > div:nth-last-child(2),
  body[data-theme] div[onclick^="toggleSiteCard"][title] > div:nth-last-child(2) { order: 1; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > div:nth-last-child(1),
  body[data-theme] div[onclick^="toggleSiteCard"][title] > div:nth-last-child(1) { order: 2; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > div:nth-last-child(6),
  body[data-theme] div[onclick^="toggleSiteCard"][title] > div:nth-last-child(6) { order: 3; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > div:nth-last-child(4),
  body[data-theme] div[onclick^="toggleSiteCard"][title] > div:nth-last-child(4) { order: 4; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > div:nth-last-child(3),
  body[data-theme] div[onclick^="toggleSiteCard"][title] > div:nth-last-child(3) { order: 5; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > div:nth-last-child(5),
  body[data-theme] div[onclick^="toggleSiteCard"][title] > div:nth-last-child(5) { order: 6; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > div:nth-last-child(n+7),
  body[data-theme] div[onclick^="toggleSiteCard"][title] > div:nth-last-child(n+7) { order: 7; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] > div,
  body[data-theme] div[onclick^="toggleSiteCard"][title] > div { border-top: 1px solid var(--lab-line); padding-top: 8px; }
  body[data-theme] div[onclick^="toggleGrupoDash"][title] div[style*="font-size:13px;font-weight:700"],
  body[data-theme] div[onclick^="toggleSiteCard"][title] div[style*="font-size:13px;font-weight:700"] { font-size: 15px !important; overflow-wrap: anywhere; }
  /* cartão aberto: cabeçalho em 1 coluna (nome em cima, totais embaixo) */
  body[data-theme] div[onclick^="toggleGrupoDash"]:not([title]),
  body[data-theme] div[onclick^="toggleSiteCard"]:not([title]) { display: flex !important; flex-wrap: wrap !important; }
  body[data-theme] div[onclick^="toggleGrupoDash"]:not([title]) > strong,
  body[data-theme] div[onclick^="toggleSiteCard"]:not([title]) > strong { flex: 1 1 60% !important; min-width: 0 !important; }
  body[data-theme] div[onclick^="toggleGrupoDash"]:not([title]) > span:last-child,
  body[data-theme] div[onclick^="toggleSiteCard"]:not([title]) > span:last-child { flex: 1 1 100%; font-size: 12.5px !important; color: var(--lab-ink2); }
  /* tabela do grupo/site aberto: cada linha vira uma ficha com rótulos */
  body[data-theme] div[onclick^="toggleGrupoDash"] + div,
  body[data-theme] div[onclick^="toggleSiteCard"] + div { overflow-x: visible !important; padding: 8px 10px !important; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div table,
  body[data-theme] div[onclick^="toggleSiteCard"] + div table,
  body[data-theme] div[onclick^="toggleGrupoDash"] + div tbody,
  body[data-theme] div[onclick^="toggleSiteCard"] + div tbody { display: block; width: 100%; table-layout: auto; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div tr.lab-cab,
  body[data-theme] div[onclick^="toggleSiteCard"] + div tr.lab-cab { display: none; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div tr:not(.lab-cab),
  body[data-theme] div[onclick^="toggleSiteCard"] + div tr:not(.lab-cab) {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 10px 2px 12px;
    border-bottom: 1px solid var(--lab-line2); border-top: 0 !important;
  }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div tr:last-child,
  body[data-theme] div[onclick^="toggleSiteCard"] + div tr:last-child { border-bottom: 0; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div tr[style*="border-top:2px"],
  body[data-theme] div[onclick^="toggleSiteCard"] + div tr[style*="border-top:2px"] { border-radius: 10px; padding: 10px 10px 12px; margin-top: 4px; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td,
  body[data-theme] div[onclick^="toggleSiteCard"] + div td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; overflow-wrap: anywhere; font-size: 13px !important; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div table,
  body[data-theme] div[onclick^="toggleSiteCard"] + div table,
  body[data-theme] div[onclick^="toggleGrupoDash"] + div tr,
  body[data-theme] div[onclick^="toggleSiteCard"] + div tr { width: 100% !important; min-width: 0 !important; max-width: 100%; box-sizing: border-box; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td:nth-child(9),
  body[data-theme] div[onclick^="toggleSiteCard"] + div td:nth-child(9) { order: 1; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td:nth-child(10),
  body[data-theme] div[onclick^="toggleSiteCard"] + div td:nth-child(10) { order: 2; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td:nth-child(5),
  body[data-theme] div[onclick^="toggleSiteCard"] + div td:nth-child(5) { order: 3; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td:nth-child(7),
  body[data-theme] div[onclick^="toggleSiteCard"] + div td:nth-child(7) { order: 4; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td:nth-child(8),
  body[data-theme] div[onclick^="toggleSiteCard"] + div td:nth-child(8) { order: 5; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td:nth-child(6),
  body[data-theme] div[onclick^="toggleSiteCard"] + div td:nth-child(6) { order: 6; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td:nth-child(-n+4),
  body[data-theme] div[onclick^="toggleSiteCard"] + div td:nth-child(-n+4) { order: 7; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td:first-child,
  body[data-theme] div[onclick^="toggleSiteCard"] + div td:first-child { grid-column: 1 / -1; order: -1; font-weight: 600; font-size: 13.5px !important; }
  body[data-theme] div[onclick^="toggleGrupoDash"] + div td[data-r]:not(:first-child)::before,
  body[data-theme] div[onclick^="toggleSiteCard"] + div td[data-r]:not(:first-child)::before {
    content: attr(data-r); display: block; font-size: 11px; font-weight: 450; color: var(--lab-ink3); margin-bottom: 1px;
  }
  /* nas linhas de site dentro do grupo, as colunas sem dado ("—") somem para não ocupar espaço */
  body[data-theme] div[onclick^="toggleGrupoDash"] + div tr:not([style*="border-top:2px"]) td[style*="color:var(--text2)"] { display: none; }
}

/* ---------- 24. Celular: menu aberto por cima do botão ☰ (fix-028) ---------- */
@media (max-width: 900px) {
  body[data-theme] .sidebar.open { z-index: 400 !important; }
  body[data-theme]:has(.sidebar.open) .hamburger { visibility: hidden; }
}

/* ---------- 25. Celular: logo no topo no lugar do título "Dashboard" (fix-029) ---------- */
.lab-top-logo { display: none; cursor: pointer; flex: 1; min-width: 0; align-items: center; }
.lab-top-logo img { max-height: 26px; max-width: 140px; display: block; }
.lab-top-logo .lab-wordmark { font-size: 18px; }
@media (max-width: 900px) {
  body[data-theme] .header.lab-top .lab-top-logo { display: flex; }
  body[data-theme] .header.lab-top h1.lab-h1-dash { display: none !important; }
}

/* ---------- 26. Celular: logo do topo sem ficar atrás das cotações (fix-030) ---------- */
@media (max-width: 900px) {
  body[data-theme] .header.lab-top .lab-top-logo { flex: 0 1 auto; min-width: 72px; overflow: hidden; }
  body[data-theme] .header.lab-top .lab-top-logo img { max-width: 100%; max-height: 24px; width: auto; height: auto; object-fit: contain; object-position: left center; }
  body[data-theme] .header.lab-top .header-actions { margin-left: auto; flex: none; gap: 6px; }
}
@media (max-width: 600px) {
  body[data-theme] .header.lab-top .lab-cot-r { display: none !important; }
  body[data-theme] .header.lab-top .lab-cot { padding: 6px 8px; column-gap: 5px; }
  body[data-theme] .header.lab-top .header-cotacoes { gap: 6px !important; }
}

/* ---------- 27. Relatórios personalizados no popup Análise (fix-031) ---------- */
.lab-rel-dd { position: relative; display: inline-flex; }
.lab-rel-caret { width: 14px !important; height: 14px !important; opacity: .7; }
.lab-rel-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 270px; max-width: min(360px, 86vw); max-height: 60vh; overflow: auto;
  background: var(--lab-s1); border: 1px solid var(--lab-line2); border-radius: var(--r-md); box-shadow: var(--lab-pop); padding: 6px;
}
.lab-rel-mi { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--lab-ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.lab-rel-mi span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-rel-mi:hover, .lab-rel-mi.on { background: var(--lab-accent-bg); }
.lab-rel-mi .lab-i { color: var(--lab-ink3); flex: none; }
.lab-rel-novo { color: var(--lab-accent); font-weight: 600; }
.lab-rel-novo .lab-i { color: var(--lab-accent); }
.lab-rel-msep { font-size: 11px; color: var(--lab-ink3); padding: 8px 10px 4px; border-top: 1px solid var(--lab-line); margin-top: 4px; }
.lab-rel-mvazio { font-size: 12px; color: var(--lab-ink3); padding: 8px 10px; }
.lab-rel-ed { display: flex; flex-direction: column; gap: 14px; }
.lab-rel-topo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
body[data-theme] .lab-rel-nome { flex: 1 1 320px; max-width: 520px; font-size: 15px !important; font-weight: 600; padding: 9px 12px !important; }
.lab-rel-per { font-size: 12.5px; color: var(--lab-ink3); }
.lab-rel-bloco { background: var(--lab-s1); border: 1px solid var(--lab-line); border-radius: var(--r-md); padding: 12px 14px; }
.lab-rel-tit { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.lab-rel-tit small { font-weight: 400; color: var(--lab-ink3); font-size: 12px; margin-left: 4px; }
.lab-rel-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lab-rel-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--lab-accent-bg); border: 1px solid transparent; font-size: 12.5px; }
.lab-rel-chip b { font-weight: 550; padding: 0 4px; }
.lab-rel-chip button { border: 0; background: none; color: var(--lab-ink3); cursor: pointer; width: 22px; height: 22px; border-radius: 999px; font-size: 15px; line-height: 1; padding: 0; }
.lab-rel-chip button:hover:not([disabled]) { background: var(--lab-s1); color: var(--lab-ink); }
.lab-rel-chip button[disabled] { opacity: .25; cursor: default; }
.lab-rel-chip button.x { font-size: 17px; }
body[data-theme] .lab-rel-add { width: auto !important; min-width: 190px; padding: 6px 10px !important; font-size: 12.5px !important; border-style: dashed !important; }
.lab-rel-filtro { display: grid; grid-template-columns: minmax(150px, 220px) minmax(130px, 180px) minmax(160px, 1fr) 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
body[data-theme] .lab-rel-filtro select, body[data-theme] .lab-rel-filtro input { width: 100% !important; padding: 7px 10px !important; font-size: 13px !important; }
.lab-rel-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.lab-rel-apagar { margin-left: auto; color: var(--lab-neg) !important; display: inline-flex; align-items: center; gap: 6px; }
.lab-rel-aviso { overflow-wrap: anywhere; background: var(--lab-neg-bg); color: var(--lab-neg); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; }
.lab-rel-ok { background: var(--lab-pos-bg); color: var(--lab-pos); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; }
.lab-rel-nota { font-size: 11.5px; color: var(--lab-ink3); line-height: 1.5; margin-top: 8px; }
.lab-rel-barra { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lab-rel-tnome { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.lab-rel-tnome .lab-i { color: var(--lab-accent); }
.lab-rel-bts { display: flex; gap: 6px; flex-wrap: wrap; }
.lab-rel-info { font-size: 12px; color: var(--lab-ink3); margin-bottom: 10px; line-height: 1.5; }
body[data-theme] .lab-rel-busca { width: 100%; max-width: 360px; margin-bottom: 8px; padding: 7px 10px !important; font-size: 13px !important; }
.lab-rel-esp { padding: 40px 10px; text-align: center; color: var(--lab-ink2); font-size: 14px; line-height: 1.7; }
.lab-rel-esp small { color: var(--lab-ink3); font-size: 12px; }
.lab-rel-spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--lab-line2); border-top-color: var(--lab-accent); border-radius: 50%; animation: labRelGira .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes labRelGira { to { transform: rotate(360deg); } }
.lab-rel-wrap { overflow: auto; max-height: calc(88vh - 230px); border: 1px solid var(--lab-line); border-radius: var(--r-md); }
body[data-theme] table.lab-rel-tab { width: 100%; min-width: 0 !important; table-layout: auto; font-size: 13px; }
body[data-theme] .lab-rel-tab th { position: sticky; top: 0; background: var(--lab-s1); z-index: 1; cursor: pointer; user-select: none; white-space: normal !important; vertical-align: bottom; line-height: 1.3; }
.lab-rel-tab th span { opacity: .4; } .lab-rel-tab th span.on { opacity: 1; color: var(--lab-accent); }
body[data-theme] .lab-rel-tab th.n, body[data-theme] .lab-rel-tab td.n { text-align: right; }
body[data-theme] .lab-rel-tab td.d { max-width: 460px; overflow-wrap: anywhere; }
body[data-theme] .lab-rel-tab td.n { white-space: nowrap; }
body[data-theme] .lab-rel-tab td.din { color: var(--lab-pos); }
body[data-theme] .lab-rel-tab tr.tot td { font-weight: 650; background: var(--lab-s2); position: sticky; bottom: 0; border-top: 1px solid var(--lab-line2) !important; }
.lab-rel-vazio { text-align: center; color: var(--lab-ink3); padding: 24px !important; }
@media (max-width: 760px) {
  .lab-rel-filtro { grid-template-columns: 1fr 1fr 34px; }
  .lab-rel-filtro input { grid-column: 1 / 3; }
  .lab-rel-filtro .lab-iconbtn { grid-column: 3; grid-row: 1; }
  .lab-tabs:has(.lab-rel-dd) { position: relative; }
  .lab-rel-dd { position: static; }
  .lab-rel-menu { left: 0; right: 0; max-width: none; min-width: 0; }
  .lab-rel-wrap { max-height: 60vh; }
  body[data-theme] .lab-rel-tab { font-size: 12px; }
  body[data-theme] .lab-rel-tab td.d { min-width: 130px; }
  .lab-rel-bts .lab-btn-chip span { display: none; }
  .lab-rel-apagar { margin-left: 0; }
}

/* ---------- 28. Sugestões no filtro de URL (fix-033) ---------- */
.lab-rel-sugw { position: relative; display: block; min-width: 0; }
.lab-rel-sug {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; max-height: 300px; overflow: auto;
  background: var(--lab-s1); border: 1px solid var(--lab-line2); border-radius: var(--r-md); box-shadow: var(--lab-pop); padding: 4px;
}
.lab-rel-sugt { font-size: 11px; color: var(--lab-ink3); padding: 6px 10px 4px; }
.lab-rel-sugi { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--lab-ink); font: inherit; font-size: 12.5px; padding: 7px 10px; border-radius: 7px; cursor: pointer; overflow-wrap: anywhere; }
.lab-rel-sugi:hover, .lab-rel-sugi.on { background: var(--lab-accent-bg); }
@media (max-width: 760px) { .lab-rel-filtro .lab-rel-sugw { grid-column: 1 / 3; } }

/* ---------- 29. Filtro de URL/Site em caixa, igual ao GAM (fix-035) ---------- */
.lab-rel-filtro.multi { align-items: start; }
.lab-rel-tok { border: 1px solid var(--lab-line2); border-radius: var(--r-sm); background: var(--lab-s1); min-width: 0; }
.lab-rel-tok:focus-within { border-color: var(--lab-accent); }
.lab-rel-tokh { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 2px; font-size: 11.5px; color: var(--lab-ink3); }
.lab-rel-tokh button { border: 0; background: none; color: var(--lab-accent); font: inherit; font-size: 11.5px; cursor: pointer; padding: 0; }
.lab-rel-tokl { max-height: 220px; overflow: auto; padding: 2px 4px; }
.lab-rel-toki { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; border-radius: 6px; font-size: 13px; }
.lab-rel-toki:hover { background: var(--lab-s2); }
.lab-rel-toki span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lab-rel-toki button { border: 0; background: none; color: var(--lab-ink3); cursor: pointer; font-size: 17px; line-height: 1; width: 24px; height: 24px; border-radius: 999px; flex: none; }
.lab-rel-toki button:hover { background: var(--lab-neg-bg); color: var(--lab-neg); }
body[data-theme] .lab-rel-tok .lab-rel-tokin { border: 0 !important; background: transparent !important; box-shadow: none !important; width: 100% !important; padding: 9px 10px !important; font-size: 13px !important; }
.lab-rel-tokl + .lab-rel-sugw .lab-rel-tokin { border-top: 1px solid var(--lab-line) !important; }
.lab-rel-sugadd { color: var(--lab-accent) !important; font-weight: 550; }
.lab-rel-sugadd small { color: var(--lab-ink3); font-weight: 400; }
@media (max-width: 760px) { .lab-rel-filtro .lab-rel-tok { grid-column: 1 / 3; } }
/* a lista abre DENTRO da caixa (empurra o resto para baixo), para não cobrir o filtro de baixo */
.lab-rel-tok .lab-rel-sug { position: static; box-shadow: none; border: 0; border-top: 1px solid var(--lab-line); border-radius: 0 0 var(--r-sm) var(--r-sm); max-height: 260px; margin: 0; }

/* ---------- 30. Controles das campanhas do Facebook (fix-039) ---------- */
.lab-fbbt { padding: 3px 9px !important; font-size: 11.5px !important; white-space: nowrap; }
.lab-fbbt .lab-i { color: var(--lab-accent); }
.lab-fbbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; margin: 0 0 6px; }
.lab-fbbar label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lab-fbbar span { color: var(--lab-ink3); }
.lab-fbst { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--lab-ink3); font-size: 12px; }
.lab-fbst i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lab-fbst.pos { color: var(--lab-pos); } .lab-fbst.neg { color: var(--lab-neg); } .lab-fbst.warn { color: var(--lab-warn); }
.lab-fbov { position: fixed; inset: 0; z-index: 1200; background: rgba(5, 8, 14, .55); display: flex; justify-content: flex-end; }
.lab-fbp { width: min(520px, 100vw); height: 100%; overflow: auto; background: var(--lab-s1); border-left: 1px solid var(--lab-line2); box-shadow: var(--lab-pop); padding: 18px 20px 28px; color: var(--lab-ink); }
.lab-fbh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.lab-fbh b { display: block; font-size: 16px; font-weight: 650; line-height: 1.3; }
.lab-fbh small { display: block; color: var(--lab-ink3); font-size: 12px; margin-top: 2px; }
.lab-fbsec { border-top: 1px solid var(--lab-line); padding: 14px 0 6px; }
.lab-fbsec-t { font-size: 12px; color: var(--lab-ink3); font-weight: 600; margin-bottom: 10px; text-transform: none; }
.lab-fbsec-t small { font-weight: 400; }
.lab-fbvei { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lab-fbvei .lab-fbst { font-size: 13.5px; margin-right: auto; }
.lab-fbed { background: var(--lab-s2); border: 1px solid var(--lab-line); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; }
.lab-fbed-t { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 10px; font-size: 13px; }
.lab-fbed-t span { color: var(--lab-ink2); min-width: 0; overflow-wrap: anywhere; }
.lab-fbed-t b { font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lab-fbed-t b small { font-size: 11.5px; color: var(--lab-ink3); font-weight: 400; }
.lab-fbed-l { display: grid; grid-template-columns: 1fr 140px; gap: 8px; }
body[data-theme] .lab-fbed-l select { width: 100% !important; padding: 8px 10px !important; font-size: 13px !important; }
.lab-fbin { position: relative; display: block; }
body[data-theme] .lab-fbin input { width: 100% !important; padding: 8px 40px 8px 10px !important; font-size: 14px !important; font-variant-numeric: tabular-nums; }
.lab-fbin em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--lab-ink3); }
.lab-fbq { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lab-fbq button { border: 1px solid var(--lab-line2); background: var(--lab-s1); color: var(--lab-ink2); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.lab-fbq button:hover { color: var(--lab-ink); border-color: var(--lab-accent); }
.lab-fbprev { min-height: 20px; margin: 10px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.lab-fbprev .pos { color: var(--lab-pos); } .lab-fbprev .neg, .lab-fbmsg.neg, .lab-fbhist .neg { color: var(--lab-neg); }
.lab-fbap { min-width: 120px; }
.lab-fbmsg { border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; margin-bottom: 10px; }
.lab-fbmsg.pos { background: var(--lab-pos-bg); color: var(--lab-pos); } .lab-fbmsg.neg { background: var(--lab-neg-bg); }
.lab-fbhist { font-size: 12px; color: var(--lab-ink2); display: grid; gap: 6px; }
.lab-fbhist span { color: var(--lab-ink3); font-variant-numeric: tabular-nums; }
.lab-fbvazio { font-size: 13px; color: var(--lab-ink3); }
.lab-fbnota { font-size: 11.5px; color: var(--lab-ink3); line-height: 1.5; margin-top: 12px; }
@media (max-width: 520px) { .lab-fbp { padding: 14px 14px 24px; } .lab-fbed-l { grid-template-columns: 1fr; } }

/* ---------- 31. Orçamento nas listas, seleção e escalar em lote (fix-040) ---------- */
.lab-fborc { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lab-fborc small { color: var(--lab-ink3); font-size: 10px; margin-left: 1px; }
.lab-fborc em { font-style: normal; font-size: 9.5px; color: var(--lab-ink3); border: 1px solid var(--lab-line2); border-radius: 4px; padding: 0 4px; margin-left: 5px; cursor: help; }
.lab-fborc.vazio { color: var(--lab-ink3); }
td.lab-fbacao, th.lab-fbacao { white-space: nowrap; }
.lab-fbckw { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; vertical-align: middle; cursor: pointer; margin-right: 4px; }
body[data-theme] input.lab-fbck { width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important; accent-color: var(--lab-accent); cursor: pointer; }
.lab-fbsel { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1150; display: flex; align-items: center; gap: 10px;
  background: var(--lab-s1); border: 1px solid var(--lab-accent); border-radius: 999px; box-shadow: var(--lab-pop); padding: 8px 10px 8px 18px; font-size: 13px; color: var(--lab-ink); max-width: calc(100vw - 24px); }
.lab-fbsel .btn { padding: 6px 14px !important; font-size: 12.5px !important; border-radius: 999px !important; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.lab-fbsel span { white-space: nowrap; }
body[data-theme] table.lab-fblote { min-width: 0 !important; }
.lab-fblote { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12.5px; }
.lab-fblote th { text-align: left; font-size: 11px; color: var(--lab-ink3); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--lab-line); }
.lab-fblote td { padding: 7px 6px; border-bottom: 1px solid var(--lab-line); vertical-align: top; font-variant-numeric: tabular-nums; }
.lab-fblote td:not(:first-child) { white-space: nowrap; }
.lab-fblote td small { color: var(--lab-ink3); font-size: 10.5px; }
.lab-fblote-n { color: var(--lab-ink); overflow-wrap: anywhere; } .lab-fblote-n span { color: var(--lab-ink3); }
.lab-fblote-s { margin-top: 2px; } .lab-fblote-s .lab-fbst { font-size: 11px; } .lab-fblote-s b { font-size: 11px; font-weight: 500; }
.lab-fblote-r { font-size: 11.5px; margin-top: 3px; }
.lab-fblote .pos, .lab-fblote-r.pos, .lab-fblote-s .pos { color: var(--lab-pos); } .lab-fblote .neg, .lab-fblote-r.neg, .lab-fblote-s .neg { color: var(--lab-neg); }
.lab-fbmut { color: var(--lab-ink3); white-space: normal !important; }
.lab-fbvei .btn:disabled { opacity: .45; }
@media (max-width: 520px) { .lab-fbsel { bottom: 12px; padding: 6px 6px 6px 12px; gap: 6px; font-size: 12px; } .lab-fbsel .btn { padding: 6px 10px !important; }
  .lab-fblote { font-size: 12px; table-layout: fixed; } .lab-fblote th:first-child { width: 46%; } .lab-fblote td:not(:first-child) { white-space: normal; } .lab-fblote td small { display: block; } }

/* ---------- 32. Análise: bloco aberto (campanhas, conjuntos, países) com fundo pastel (fix-041) ---------- */
/* Mesmo lavanda do grupo aberto (seção 21). Vale para Regiões e Países. */
body[data-theme] .roiTab > tbody > tr > td[colspan]:has(table) {
  --lab-ink: #1a2033; --lab-ink2: #4a5368; --lab-ink3: #6c7590;
  --lab-line: rgba(62, 82, 214, .10); --lab-line2: rgba(62, 82, 214, .18);
  --lab-s1: #ffffff; --lab-s2: #e3e7fd; --lab-accent: #3e52d6; --lab-accent-bg: rgba(62, 82, 214, .10);
  --lab-pos: #0f7a45; --lab-neg: #c62f32; --lab-warn: #9a6008;
  --text: var(--lab-ink); --text2: var(--lab-ink2); --green: var(--lab-pos); --red: var(--lab-neg); --yellow: var(--lab-warn);
  --accent: var(--lab-accent); --border: var(--lab-line2); --bg2: #eef0fe; --bg3: var(--lab-s2); --card2: var(--lab-s2);
  background: #eef0fe !important; color: var(--lab-ink); color-scheme: light;
  padding: 10px 14px 12px !important; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(62, 82, 214, .22);
}
body[data-theme="light"] .roiTab > tbody > tr > td[colspan]:has(table),
body[data-theme="classic"] .roiTab > tbody > tr > td[colspan]:has(table) { background: #f1f3ff !important; --bg2: #f1f3ff; }
body[data-theme] .roiTab > tbody > tr > td[colspan]:has(table) table { background: transparent !important; }
body[data-theme] .roiTab > tbody > tr > td[colspan]:has(table) td,
body[data-theme] .roiTab > tbody > tr > td[colspan]:has(table) th { color: var(--lab-ink); border-color: var(--lab-line) !important; }
body[data-theme] .roiTab > tbody > tr > td[colspan]:has(table) th { color: var(--lab-ink3); }
body[data-theme] .roiTab > tbody > tr > td[colspan]:has(table) tr:hover { background: rgba(62, 82, 214, .06); }
body[data-theme] .roiTab > tbody > tr > td[colspan]:has(table) .lab-fbbt { background: #fff !important; border-color: rgba(62, 82, 214, .25) !important; color: var(--lab-ink) !important; }

/* ---------- 33. Regiões: linha de média + cor acima/abaixo da média (fix-042) ---------- */
body[data-theme] tr.lab-media td { font-weight: 650; border-top: 1.5px solid var(--lab-line2) !important; background: rgba(62, 82, 214, .07); color: var(--lab-ink); white-space: nowrap; }
body[data-theme] tr.lab-media td:first-child { color: var(--lab-accent); }
body[data-theme] tr.lab-media-sel td { background: rgba(62, 82, 214, .13); border-top: 1px dashed var(--lab-line2) !important; }
body[data-theme] td.lab-med-bom { color: var(--lab-pos) !important; font-weight: 600; }
body[data-theme] td.lab-med-ruim { color: var(--lab-neg) !important; font-weight: 600; }

/* ---------- 34. Análise: texto explicativo do rodapé em amarelo claro (fix-045) ---------- */
body[data-theme] .modal div[style*="margin-top:10px;line-height:1.5"] { color: #f3e3a0 !important; }
body[data-theme="light"] .modal div[style*="margin-top:10px;line-height:1.5"],
body[data-theme="classic"] .modal div[style*="margin-top:10px;line-height:1.5"] {
  color: #6b5408 !important; background: #fff6cf; border: 1px solid #f1e2a0; border-radius: 8px; padding: 8px 12px;
}

/* ---------- 36. Orçamento: clique duplo para editar (fix-049) ---------- */
.lab-fborc-ed { cursor: text; border-radius: 4px; padding: 1px 3px; margin: -1px -3px; }
.lab-fborc-ed:hover { background: rgba(62, 82, 214, .08); box-shadow: inset 0 0 0 1px rgba(62, 82, 214, .25); }
.lab-fborc-on { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
body[data-theme] input.lab-fborc-in { width: 92px !important; padding: 3px 6px !important; font-size: 12px !important; height: auto !important; min-height: 0 !important;
  border: 1.5px solid var(--lab-accent, #3e52d6) !important; border-radius: 5px !important; background: #fff !important; color: #1a2033 !important; font-variant-numeric: tabular-nums; }
.lab-fborc-msg { font-weight: 500; font-size: 10.5px; color: var(--lab-ink3); white-space: normal; }
.lab-fborc-msg.neg { color: var(--lab-neg, #c62f32); }
.lab-fborc-ok { background: rgba(15, 122, 69, .15) !important; color: var(--lab-pos, #0f7a45); transition: background .6s; }

/* ---------- 37. Split Dinâmico (fix-051) ---------- */
.lab-sd { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.lab-sd > *, .lab-sd-rota, .lab-sd-corpo { min-width: 0; }
.lab-sd-topo { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lab-sd-abas { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.lab-sd-abas .lab-btn-chip.on { border-color: var(--lab-accent); color: var(--lab-ink); background: var(--lab-accent-bg); }
body[data-theme] input.lab-sd-busca { width: 240px !important; padding: 7px 10px !important; font-size: 13px !important; margin-left: auto; }
.lab-sd-info { font-size: 12px; color: var(--lab-ink3); line-height: 1.5; }
.lab-sd-rota { border: 1px solid var(--lab-line); border-radius: var(--r-md, 10px); background: var(--lab-s1); margin-bottom: 8px; overflow: hidden; }
.lab-sd-rota.aberta { border-color: var(--lab-line2); }
.lab-sd-cab { display: grid; grid-template-columns: 18px minmax(0, 1fr) 110px 70px 110px; gap: 12px; align-items: center; padding: 11px 14px; cursor: pointer; }
.lab-sd-cab:hover { background: var(--lab-s2); }
.lab-sd-seta { color: var(--lab-accent); }
.lab-sd-nome b { display: block; font-weight: 650; overflow-wrap: anywhere; }
.lab-sd-nome small, .lab-sd-num small { display: block; font-size: 11px; color: var(--lab-ink3); overflow-wrap: anywhere; }
.lab-sd-num { text-align: right; } .lab-sd-num b { font-variant-numeric: tabular-nums; }
.lab-sd-corpo { border-top: 1px solid var(--lab-line); padding: 10px 14px 14px; overflow-x: auto; }
body[data-theme] table.lab-sd-links { width: 100%; min-width: 760px !important; border-collapse: collapse; font-size: 12.5px; }
.lab-sd-links th { text-align: left; font-size: 11px; color: var(--lab-ink3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--lab-line); cursor: pointer; white-space: nowrap; }
.lab-sd-links td { padding: 8px; border-bottom: 1px solid var(--lab-line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lab-sd-links td.lab-sd-url { white-space: normal; max-width: 420px; overflow-wrap: anywhere; }
.lab-sd-links td.lab-sd-url a { color: var(--lab-ink); text-decoration: none; } .lab-sd-links td.lab-sd-url a:hover { color: var(--lab-accent); }
.lab-sd-rec { color: var(--lab-pos); }
.lab-sd-top { color: var(--lab-pos); font-weight: 700; }
.lab-sd-tipo { font-size: 10.5px; border: 1px solid var(--lab-line2); border-radius: 4px; padding: 1px 5px; color: var(--lab-ink2); }
.lab-sd-pct { min-width: 150px; } .lab-sd-pct b { margin-left: 8px; }
.lab-sd-bar { display: inline-block; width: 80px; height: 6px; border-radius: 3px; background: var(--lab-s2); vertical-align: middle; overflow: hidden; }
.lab-sd-bar i { display: block; height: 100%; background: var(--lab-accent); border-radius: 3px; }
.lab-sd-in { display: inline-flex; align-items: center; gap: 4px; }
body[data-theme] .lab-sd-in input { width: 70px !important; padding: 4px 6px !important; font-size: 12.5px !important; text-align: right; }
.lab-sd-acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; }
.lab-sd-soma { font-size: 12.5px; margin-right: auto; } .lab-sd-soma.pos { color: var(--lab-pos); } .lab-sd-soma.neg { color: var(--lab-neg); }
.lab-sd-mut { color: var(--lab-ink3); }
.lab-sd-vazio { color: var(--lab-ink3); font-size: 13px; padding: 12px; }
.lab-sd-carregando { opacity: .55; pointer-events: none; }
@media (max-width: 760px) {
  .lab-sd-cab { grid-template-columns: 16px minmax(0, 1fr) 80px; } .lab-sd-cab > .lab-sd-num:nth-child(n+4) { display: none; }
  body[data-theme] input.lab-sd-busca { width: 100% !important; margin-left: 0; }
}
.lab-sd-rota.pausada { opacity: .65; }
.lab-sd-proj { font-size: 10.5px; font-weight: 500; color: var(--lab-ink3); border: 1px solid var(--lab-line2); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.lab-sd-copiar { color: var(--lab-accent); cursor: pointer; margin-left: 6px; text-decoration: none; }
.lab-sd-saude { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.lab-sd-saude i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lab-sd-saude.pos { color: var(--lab-pos); } .lab-sd-saude.neg { color: var(--lab-neg); }
.lab-sd-links tr.off td { opacity: .5; }
.lab-sd-ed { width: min(640px, 100vw); }
.lab-sd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lab-sd-grid label, .lab-sd-ed .lab-fbsec > label { display: grid; gap: 4px; font-size: 12px; color: var(--lab-ink2); }
body[data-theme] .lab-sd-ed input:not([type=checkbox]):not([type=color]), body[data-theme] .lab-sd-ed select { width: 100% !important; padding: 7px 9px !important; font-size: 13px !important; }
body[data-theme] .lab-sd-ed input[type=color] { width: 100% !important; height: 34px !important; padding: 2px !important; }
.lab-sd-edlink { display: grid; grid-template-columns: minmax(0, 1fr) 70px 86px 60px 30px; gap: 6px; align-items: center; margin-bottom: 6px; }
.lab-sd-edlink.off .u { opacity: .55; }
body[data-theme] .lab-sd-edlink .lab-sd-in input { width: 60px !important; }
.lab-sd-at { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--lab-ink3); }
.lab-sd-nota { font-size: 11.5px; color: var(--lab-ink3); margin-top: 8px; line-height: 1.5; }
@media (max-width: 560px) { .lab-sd-grid { grid-template-columns: 1fr; } .lab-sd-edlink { grid-template-columns: minmax(0, 1fr) 64px 80px; } .lab-sd-edlink .lab-sd-at, .lab-sd-edlink .lab-iconbtn { grid-row: 2; } }

/* ---------- 38. Split Dinâmico: lista/cards, botões na rota fechada (fix-052) ---------- */
.lab-sd-cab { grid-template-columns: 18px minmax(0, 1fr) 80px 70px 80px auto; }
.lab-sd-bts { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.lab-sd-bt { padding: 3px 9px !important; font-size: 11.5px !important; white-space: nowrap; }
.lab-sd-bt.forte { border-color: var(--lab-accent) !important; color: var(--lab-accent) !important; }
.lab-sd-bt.perigo { border-color: var(--lab-neg) !important; color: var(--lab-neg) !important; }
.lab-sd-x { cursor: pointer; color: var(--lab-ink3); margin-left: 4px; text-decoration: none; } .lab-sd-x:hover { color: var(--lab-neg); }
.lab-sd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; align-items: start; }
.lab-sd-card { border: 1px solid var(--lab-line); border-radius: var(--r-md, 10px); background: var(--lab-s1); padding: 12px; display: grid; gap: 10px; min-width: 0; }
.lab-sd-card.aberta { grid-column: 1 / -1; border-color: var(--lab-line2); }
.lab-sd-card.pausada { opacity: .65; }
.lab-sd-card-t { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; }
.lab-sd-card-n { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lab-sd-card-n .lab-sd-num { text-align: left; }
.lab-sd-card .lab-sd-bts { justify-content: flex-start; }
.lab-sd-card .lab-sd-corpo { border-top: 1px solid var(--lab-line); padding: 10px 0 0; }
@media (max-width: 1300px) { .lab-sd-cab { grid-template-columns: 18px minmax(0, 1fr) 80px 70px 80px; } .lab-sd-cab > .lab-sd-bts { grid-column: 2 / -1; justify-content: flex-start; } }
@media (max-width: 760px) { .lab-sd-cab { grid-template-columns: 16px minmax(0, 1fr) 80px; } .lab-sd-cab > .lab-sd-num:nth-child(n+4) { display: none; } .lab-sd-cab > .lab-sd-bts { grid-column: 1 / -1; } }

/* ===== 39. (fix-054) Split: aviso de URL repetida em mais de uma rota ===== */
.lab-sd-rep { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: 11px; color: #f5c451; background: rgba(245,196,81,.12); white-space: nowrap; }

/* ===== 40. (fix-059) Análise (Regiões, Países, URLs): linha de títulos congelada no topo ao rolar ===== */
body[data-theme] .roiWrap { overflow-x: clip !important; }
body[data-theme] .roiWrap > table.roiTab > tbody > tr:first-child > th { position: sticky; top: -24px; z-index: 3; background: var(--lab-s1) !important; box-shadow: inset 0 -1px 0 var(--border); }
@media (max-width: 700px) { body[data-theme] .roiWrap { overflow-x: auto !important; } body[data-theme] .roiWrap > table.roiTab > tbody > tr:first-child > th { position: static; } }

/* ===== 41. (fix-067) Semáforo da Análise ===== */
.lab-sem-btn { margin-left: 10px; height: 34px; padding: 0 12px !important; }
.lab-sem-btn small { color: var(--lab-ink3); font-weight: 500; }
.lab-sem-btn[disabled] { cursor: default; opacity: .8; }
.lab-sem-luz { display: inline-flex; gap: 2px; }
.lab-sem-luz i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.lab-sem-luz .v { background: #22c55e; } .lab-sem-luz .a { background: #eab308; } .lab-sem-luz .r { background: #ef4444; }
.lab-sem { width: min(460px, 100vw); }
.lab-sem-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.lab-sem-presets .lab-btn-chip.on { border-color: var(--lab-accent); color: var(--lab-ink); }
.lab-sem-presets small { color: var(--lab-ink3); font-weight: 500; }
.lab-sem-campo { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 13px; }
.lab-sem-in { display: inline-flex; align-items: center; gap: 6px; }
body[data-theme] .lab-sem-in input { width: 90px !important; text-align: right; margin: 0 !important; }
.lab-sem-prev { font-size: 12px; line-height: 2; padding: 8px 10px; border-radius: 8px; background: var(--lab-s2); }
.lab-sem-acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lab-sem-dica { font-size: 11.5px; color: var(--lab-ink3); margin-top: 8px; }

/* ===== 42. (fix-068) Países em uma linha só: separação Ad Manager | Facebook ===== */
body[data-theme] .roiTab th.lab-pgrp, body[data-theme] .roiTab td.lab-pgrp { border-left: 1px solid var(--lab-line2) !important; padding-left: 12px !important; }
.lab-pcamp { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.lab-pmais { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--lab-s2); color: var(--lab-ink3); font-size: 10.5px; vertical-align: middle; }
body[data-theme] .roiPais .roiTab th, body[data-theme] .roiPais .roiTab td { padding-left: 5px !important; padding-right: 5px !important; }
.roiPais .lab-pcamp { max-width: 160px; }
.lab-pconta { display: inline-block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
body[data-theme] .roiWrap.rola { overflow-x: auto !important; }

/* ===== 43. (fix-069) Países: títulos numa linha só e dropdown das campanhas do país ===== */
body[data-theme] .roiPais > table.roiTab > tbody > tr:first-child > th { white-space: nowrap !important; }
.lab-pcampw { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; max-width: 230px; }
.lab-pcampw .lab-pcamp { max-width: 170px; }
button.lab-pmais { border: 1px solid var(--lab-line2); cursor: pointer; line-height: 18px; padding: 0 7px; flex: 0 0 auto; }
button.lab-pmais:hover, button.lab-pmais.on { border-color: var(--lab-accent); color: var(--lab-ink); }
.lab-psub > td { padding: 2px 0 12px !important; }
.lab-psub table { width: auto; margin: 0; font-size: 11.5px; background: var(--lab-s2); border-radius: 8px; }
body[data-theme] .lab-psub table th, body[data-theme] .lab-psub table td { padding: 6px 10px !important; white-space: nowrap; }

/* ===== 44. (fix-070) Regiões: países da região na mesma tabela da aba Países ===== */
.lab-regwrap { overflow-x: auto; }
.lab-regp2 { width: 100%; font-size: 12px; background: var(--bg2); border-radius: 6px; margin: 0; }
body[data-theme] .lab-regp2 > tbody > tr > th { white-space: nowrap !important; font-size: 10.5px; }
body[data-theme] .lab-regp2 > tbody > tr > th, body[data-theme] .lab-regp2 > tbody > tr > td { padding-left: 5px !important; padding-right: 5px !important; }
body[data-theme] .lab-regp2 th.lab-pgrp, body[data-theme] .lab-regp2 td.lab-pgrp { border-left: 1px solid var(--lab-line2) !important; padding-left: 10px !important; }

/* ===== 45. (fix-074) Usuários e acessos ===== */
.lab-us-topo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.lab-us-dica { font-size: 12.5px; color: var(--lab-ink3); max-width: 640px; }
.lab-us-eu { color: var(--lab-ink3); font-weight: 500; }
.lab-us-acesso { font-size: 13px; line-height: 1.35; }
.lab-us-acesso small { display: block; color: var(--lab-ink3); font-size: 11.5px; }
.lab-us-tudo { color: var(--lab-ink2); }
.lab-us-falta { color: var(--lab-warn); }
.lab-us { width: min(560px, 100vw); }
.lab-us-campo { display: grid; gap: 4px; font-size: 12px; color: var(--lab-ink2); margin: 0 0 10px; }
.lab-us-campo small { color: var(--lab-ink3); font-weight: 400; }
body[data-theme] .lab-us-campo input { margin: 0 !important; }
.lab-us-tipos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 10px; }
.lab-us-tipo { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--lab-line2); border-radius: var(--r-sm, 8px); cursor: pointer; }
.lab-us-tipo.on { border-color: var(--lab-accent); background: var(--lab-accent-bg); }
.lab-us-tipo b, .lab-us-item b { display: block; font-size: 13px; font-weight: 600; color: var(--lab-ink); }
.lab-us-tipo small, .lab-us-item small { display: block; font-size: 11.5px; color: var(--lab-ink3); line-height: 1.35; margin-top: 1px; }
.lab-us-tipo input, .lab-us-item input { width: auto !important; margin: 3px 0 0 !important; flex: none; accent-color: var(--lab-accent); }
.lab-us-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; border-radius: 6px; cursor: pointer; }
.lab-us-item:hover { background: var(--lab-s2); }
.lab-us-item.off, .lab-us-fixo { cursor: default; opacity: .6; }
.lab-us-item.off:hover, .lab-us-fixo:hover { background: none; }
.lab-us-ativo { margin-top: 2px; }
.lab-us-sect { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lab-us-sect b { color: var(--lab-ink); }
.lab-us-link { background: none; border: 0; padding: 0; color: var(--lab-accent); font: inherit; font-weight: 500; cursor: pointer; }
.lab-us-lista { max-height: 260px; overflow: auto; border: 1px solid var(--lab-line); border-radius: 8px; padding: 4px; }
.lab-us-vazio { font-size: 12.5px; color: var(--lab-ink3); padding: 4px 0 8px; }
.lab-us-areas { display: grid; gap: 2px; }
.lab-us-dica2 { font-size: 12.5px; color: var(--lab-ink2); }
.lab-rel-dono { color: var(--lab-ink3); font-weight: 400; }
@media (max-width: 520px) { .lab-us-tipos { grid-template-columns: 1fr; } }

/* ===== 46. (fix-075) Países: linha-resumo, dropdown que ordena e botão Atualizar do Facebook ===== */
.lab-pres { display: inline-flex; align-items: center; gap: 6px; color: var(--lab-pos); font-size: 12px; white-space: nowrap; }
.lab-pres i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lab-ptag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; color: var(--lab-warn); background: var(--lab-warn-bg); vertical-align: middle; }
.lab-pout td { color: var(--lab-ink3); font-style: italic; }
.lab-fbatual { margin-left: 8px; height: 34px; padding: 0 12px !important; }
.lab-fbatual[disabled] { opacity: .7; cursor: progress; }

/* ===== 47. (fix-077) Conexões (Ad Manager, Facebook e contas de anúncio num menu só) ===== */
.lab-con-intro { font-size: 13px; color: var(--lab-ink2); margin: -4px 0 14px; max-width: 820px; }
.lab-con-abas { margin-bottom: 16px; }
.lab-con-abas .lab-tab small { margin-left: 6px; color: var(--lab-ink3); font-weight: 500; }
.lab-con-card { background: var(--lab-s1); border: 1px solid var(--lab-line2); border-radius: var(--r-lg, 14px); padding: 16px 18px; margin-bottom: 16px; max-width: 860px; }
.lab-con-card > span { display: block; color: var(--lab-ink2); font-size: 13px; margin-top: 4px; }
.lab-con-alerta { border-color: var(--lab-warn); background: var(--lab-warn-bg); }
.lab-con-t { font-size: 12px; font-weight: 600; color: var(--lab-ink3); margin-bottom: 10px; }
.lab-con-email { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lab-con-email code { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--lab-s2); color: var(--lab-ink); word-break: break-all; }
.lab-con-passos { margin: 0 0 10px; padding-left: 20px; font-size: 13px; line-height: 1.7; color: var(--lab-ink2); }
.lab-con-passos b { color: var(--lab-ink); font-weight: 600; }
.lab-con-dica { font-size: 12px; color: var(--lab-ink3); }
.lab-con-topo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.lab-con-erro { font-size: 11.5px; color: var(--lab-ink3); margin-top: 4px; max-width: 380px; white-space: normal; }
