/* BGP Finance — adapted from BGP project visual */
:root {
  --bg: #05080a;
  --bg-1: #080c0f;
  --surface: #0d1216;
  --surface-2: #11181d;
  --surface-3: #161f25;
  --border: #1a242a;
  --border-2: #243038;
  --text: #ffffff;
  --fg: #ffffff;
  --text-2: #b8c2c8;
  --fg-2: #b8c2c8;
  --mute: #6b7680;
  --fg-3: #6b7680;
  --mute-2: #3a4348;
  --fg-4: #3a4348;

  --cyan: #22d3ee;
  --cyan-2: #67e8f9;
  --cyan-3: #a5f3fc;
  --cyan-dim: #0e7490;
  --cyan-glow: rgba(34, 211, 238, 0.35);
  --cyan-glow-strong: rgba(34, 211, 238, 0.6);

  --green: #10b981;
  --green-2: #34d399;
  --green-3: #6ee7b7;
  --green-dim: #064e3b;
  --green-soft: rgba(16, 185, 129, 0.18);

  --red: #ef4444;
  --red-2: #f87171;
  --red-3: #fca5a5;
  --red-dim: #7f1d1d;
  --red-soft: rgba(239, 68, 68, 0.18);

  --amber: #f59e0b;
  --violet: #a78bfa;

  --line: #1a242a;
  --line-soft: #161c26;
  --line-strong: #243038;
  --bg-3: #11181d;
  --bg-4: #161f25;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font-family: inherit; color: inherit; }
::selection { background: rgba(34,211,238,0.3); color: var(--text); }

/* ============== APP ============== */
.app {
  display: grid;
  grid-template-columns: 244px 1fr;
  height: 100vh;
  background: var(--bg);
}

/* ============== SIDEBAR ============== */
.sidebar {
  background: linear-gradient(180deg, #0a1014 0%, #05080a 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.sb-brand {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}
.sb-logo-img {
  display: block;
  width: 100%;
  max-width: 170px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(34,211,238,0.18));
}

.sb-section {
  padding: 22px 16px 8px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute-2);
  font-weight: 600;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin: 0 12px 2px;
  border-radius: 10px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  transition: all 160ms cubic-bezier(.2,.7,.2,1);
}
.sb-item svg { width: 18px; height: 18px; color: var(--mute); flex-shrink: 0; transition: color 160ms; }
.sb-item:hover:not(:disabled) {
  background: rgba(255,255,255,0.025);
  color: var(--text);
  border-color: var(--border);
}
.sb-item.active {
  background: rgba(34,211,238,0.08);
  color: var(--text);
  border-color: rgba(34,211,238,0.14);
}
.sb-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px; bottom: 10px;
  width: 3px;
  background: var(--cyan);
  border-radius: 0 3px 3px 0;
}
.sb-item.active svg { color: var(--cyan); }
.sb-item .label { flex: 1; }
.sb-item .badge {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(34,211,238,0.12);
  color: var(--cyan-2);
  font-family: var(--font-mono);
  font-weight: 600;
  border: 1px solid rgba(34,211,238,0.2);
  letter-spacing: 0.06em;
}
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-spacer { flex: 1; }
.sb-user {
  padding: 14px 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(34,211,238,0.03));
}
.sb-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cyan-dim);
  display: grid; place-items: center;
  color: var(--cyan-3);
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.sb-user .who { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.sb-user .who b { font-size: 13px; font-weight: 600; color: var(--text); }
.sb-user .who span { font-size: 11px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============== MAIN ============== */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.header {
  height: 70px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 18px;
  background: rgba(8,12,15,0.7);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  position: relative;
  z-index: 10;
}
.hd-icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  transition: all 160ms;
}
.hd-icon-btn:hover {
  background: var(--surface-2);
  color: var(--cyan-2);
  border-color: rgba(34,211,238,0.25);
  box-shadow: 0 0 18px -6px var(--cyan-glow-strong);
}
.hd-icon-btn svg { width: 16px; height: 16px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mute);
}
.breadcrumb b { color: var(--text); font-weight: 600; }
.breadcrumb svg { width: 12px; height: 12px; color: var(--mute-2); }

.search-box {
  margin-left: auto;
  position: relative;
  width: 240px;
}
.search-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--mute);
}
.search-box input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 50px 10px 38px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: all 160ms;
}
.search-box input::placeholder { color: var(--mute); }
.search-box input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15), 0 0 20px -4px rgba(34,211,238,0.4);
  background: var(--surface-2);
}
.search-box .kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-2);
  border: 1px solid var(--border-2);
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg);
  font-weight: 600;
}

.btn-primary {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cyan);
  color: #02181d;
  border: 1px solid var(--cyan);
  transition: all 160ms;
}
.btn-primary:hover { background: var(--cyan-2); border-color: var(--cyan-2); }
.btn-primary svg { width: 14px; height: 14px; }

.btn-ghost {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 160ms;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn-ghost svg { width: 14px; height: 14px; }

/* ============== CONTENT (gradient + dot grid) ============== */
.page {
  flex: 1;
  overflow: auto;
  padding: 24px 32px 56px;
  position: relative;
  display: grid;
  grid-auto-rows: max-content;
  gap: 16px;
  background:
    radial-gradient(1800px 1100px at 100% -10%, rgba(34,211,238,0.55), transparent 55%),
    radial-gradient(1400px 900px at -10% 110%, rgba(8,145,178,0.40), transparent 55%),
    radial-gradient(1000px 700px at 50% 50%, rgba(20,184,166,0.10), transparent 60%),
    linear-gradient(180deg, #061218 0%, #04101a 50%, #050d18 100%);
}
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(180,220,235,0.18) 1.2px, transparent 0);
  background-size: 24px 24px;
}
.page > * { position: relative; z-index: 1; }

/* ============== PAGE TITLE ============== */
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.page-title h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.1;
}
.page-title .subtitle, .page-title .status-line {
  color: var(--mute);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title .subtitle b, .page-title .status-line b { color: var(--cyan-2); font-weight: 500; }
.page-title .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============== FILTERS BAR ============== */
.filters-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.seg button {
  padding: 7px 14px;
  font-size: 12.5px;
  border-radius: 7px;
  color: var(--text-2);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 140ms;
}
.seg button:hover { color: var(--text); }
.seg button.active {
  background: linear-gradient(180deg, rgba(34,211,238,0.18), rgba(34,211,238,0.08));
  color: var(--cyan-2);
  box-shadow: inset 0 0 0 1px rgba(34,211,238,0.25), 0 0 14px -4px var(--cyan-glow-strong);
}
.seg button svg { width: 13px; height: 13px; }

.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 30px 9px 12px;
  font-size: 12.5px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path fill='none' stroke='%236b7680' stroke-width='1.4' d='M2 4l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: all 160ms;
}
.filter-select:hover { border-color: var(--border-2); background-color: var(--surface-2); }
.filter-select:focus { outline: 0; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,0.15); }

/* range pills */
.range-pills {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}
.range-pills button {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-2);
  transition: all 140ms;
}
.range-pills button:hover { color: var(--text); }
.range-pills button.active {
  background: linear-gradient(180deg, rgba(34,211,238,0.18), rgba(34,211,238,0.08));
  color: var(--cyan-2);
  box-shadow: inset 0 0 0 1px rgba(34,211,238,0.25);
}

/* ============== CARDS ============== */
.card {
  background: rgba(8, 14, 18, 0.78);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: background 220ms;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 20px 40px -20px rgba(0,0,0,0.7),
    0 0 0 1px rgba(0,0,0,0.4);
  min-width: 0;
}
.card:hover { background: rgba(12, 19, 24, 0.84); }
.card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mute);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 16px;
  line-height: 1;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title-row .card-title { margin: 0; }

/* ============== KPI ROW ============== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

/* ============== KPI TILE ============== */
.kpi-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(8, 14, 18, 0.78);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
  transition: background 220ms;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 20px 40px -20px rgba(0,0,0,0.7),
    0 0 0 1px rgba(0,0,0,0.4);
}
.kpi-tile:hover { background: rgba(12, 19, 24, 0.84); }
.kpi-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(560px 280px at 100% 0%, rgba(34,211,238,0.10), transparent 62%);
  pointer-events: none;
}
.kpi-tile.green::before {
  background:
    radial-gradient(560px 280px at 100% 0%, rgba(16,185,129,0.22), transparent 62%),
    linear-gradient(135deg, rgba(16,185,129,0.06), transparent 55%);
}
.kpi-tile.green { border-color: rgba(16,185,129,0.18) !important; }
.kpi-tile.red::before {
  background:
    radial-gradient(560px 280px at 100% 0%, rgba(239,68,68,0.22), transparent 62%),
    linear-gradient(135deg, rgba(239,68,68,0.06), transparent 55%);
}
.kpi-tile.red { border-color: rgba(239,68,68,0.18) !important; }
.kpi-tile.cyan::before {
  background:
    radial-gradient(560px 280px at 100% 0%, rgba(34,211,238,0.20), transparent 62%),
    linear-gradient(135deg, rgba(34,211,238,0.05), transparent 55%);
}
.kpi-tile.cyan { border-color: rgba(34,211,238,0.18) !important; }
.kpi-tile.amber::before {
  background:
    radial-gradient(560px 280px at 100% 0%, rgba(245,158,11,0.22), transparent 62%),
    linear-gradient(135deg, rgba(245,158,11,0.05), transparent 55%);
}
.kpi-tile.amber { border-color: rgba(245,158,11,0.18) !important; }
.kpi-tile > * { position: relative; }
.kpi-tile .kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi-tile .kpi-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-top: 6px;
  font-family: var(--font-ui);
  font-feature-settings: "tnum" 1, "ss01" 1;
  color: var(--text);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.kpi-tile .kpi-value .currency {
  font-size: 14px;
  color: var(--mute);
  font-weight: 500;
}
.kpi-tile .kpi-value .unit {
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
  margin-left: 2px;
  letter-spacing: -0.01em;
  opacity: 0.85;
}
.kpi-tile .kpi-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 8px;
}
.kpi-tile .kpi-delta.up { color: var(--green-2); }
.kpi-tile .kpi-delta.down { color: var(--red-2); }
.kpi-tile .kpi-delta.cyan { color: var(--cyan-2); }
.kpi-tile .kpi-delta svg { width: 12px; height: 12px; }
.kpi-tile .spark-wrap { width: 80px; height: 38px; flex-shrink: 0; }

/* ============== METRIC STRIP (indicators) ============== */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(8, 14, 18, 0.78);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid transparent;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 20px 40px -20px rgba(0,0,0,0.7),
    0 0 0 1px rgba(0,0,0,0.4);
}
.metric-strip .metric {
  padding: 18px 22px;
  border-right: 1px solid var(--border);
}
.metric-strip .metric:last-child { border-right: 0; }
.metric-strip .m-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--mute);
  font-weight: 600;
  margin-bottom: 8px;
}
.metric-strip .m-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}
.metric-strip .m-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  margin-top: 4px;
}
.metric-strip .m-bar {
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
}
.metric-strip .m-bar > div { height: 100%; background: var(--green); border-radius: 2px; }
.metric-strip .m-bar.red > div { background: var(--red); }
.metric-strip .m-bar.cyan > div { background: var(--cyan); }
.metric-strip .m-bar.amber > div { background: var(--amber); }

/* ============== TABLES ============== */
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mute);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
  background-image: linear-gradient(180deg, rgba(34,211,238,0.05), rgba(34,211,238,0));
  position: sticky; top: 0; z-index: 2;
  box-shadow: 0 1px 0 var(--border);
}
table.t td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
table.t tbody tr { transition: background 160ms; }
table.t tbody tr:hover {
  background: linear-gradient(90deg, rgba(34,211,238,0.04), rgba(34,211,238,0.01));
}
table.t tbody tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { font-family: var(--font-mono); text-align: right; font-weight: 500; }
table.t td.green { color: var(--green-2); }
table.t td.red { color: var(--red-2); }
table.t td.cyan { color: var(--cyan); }
table.t td.amber { color: #f59e0b; }
table.t tr.active { background: rgba(34,211,238,0.06); }
table.t td.bold { font-weight: 700; color: var(--text); }
table.t tr.section td {
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  font-size: 12px;
}
table.t tr.total td {
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border-2);
  background: var(--surface-2);
}
.t-scroll { max-height: 320px; overflow: auto; border-radius: 10px; }
.t-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.t-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ============== BAR LISTS ============== */
.bar-list { display: grid; gap: 10px; }
.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  font-size: 12.5px;
}
.bar-row .top { display: flex; align-items: center; gap: 8px; }
.bar-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan); flex-shrink: 0;
}
.bar-row .label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .val { font-family: var(--font-mono); font-size: 11.5px; color: var(--text); white-space: nowrap; font-weight: 600; }
.bar-row .pct { font-family: var(--font-mono); font-size: 10.5px; color: var(--mute); margin-left: 6px; }

.bar-list.with-bars { gap: 12px; }
.bar-list.with-bars .bar-row { grid-template-columns: 1fr; min-width: 0; }
.bar-list.with-bars .row-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  margin-bottom: 5px;
}
/* Garante que rótulos longos encolham com ellipsis e o valor não seja empurrado pra fora */
.bar-list.with-bars .row-meta .label {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-list.with-bars .row-meta .val { flex-shrink: 0; }
.bar-list.with-bars .track {
  height: 4px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}
.bar-list.with-bars .fill { height: 100%; border-radius: 4px; background: var(--cyan); }
.bar-list.with-bars .fill.green { background: var(--green); }
.bar-list.with-bars .fill.red { background: var(--red); }
.bar-list.with-bars .fill.violet { background: var(--violet); }
.bar-list.with-bars .fill.amber { background: var(--amber); }

/* ============== VBARS ============== */
.vbar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 220px;
  padding: 30px 28px 0;
  position: relative;
}
.vbar-col {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  min-width: 0; position: relative;
  height: 100%; justify-content: flex-end;
}
.vbar-col .stack {
  display: flex; align-items: flex-end; gap: 3px;
  width: 100%; justify-content: center; height: 100%;
}
.vbar-col .bar {
  width: 14px;
  border-radius: 3px 3px 0 0;
  background: var(--green);
  position: relative;
  transition: all 150ms;
  min-height: 3px;
}
.vbar-col .bar.red { background: var(--red); }
.vbar-col .bar:hover { filter: brightness(1.2); }
.vbar-col .bar .v {
  position: absolute; top: -16px;
  left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px; color: var(--text-2);
  white-space: nowrap;
}
.vbar-col .x { font-size: 10px; color: var(--mute); white-space: nowrap; }
.vbar-axis { position: absolute; left: 0; right: 0; top: 0; bottom: 24px; pointer-events: none; }
.vbar-axis .grid { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255,255,255,0.04); }
.vbar-axis .glabel {
  position: absolute; left: 0;
  transform: translateY(-50%);
  font-size: 9px; color: var(--mute-2);
  font-family: var(--font-mono);
}

/* ============== DRILLDOWN ============== */
.vbar-col { transition: opacity 120ms; }
.vbar-col.clickable { cursor: pointer; }
.vbar-col.clickable:hover .bar { filter: brightness(1.25); }
.vbar-col.dimmed { opacity: 0.35; }
.vbar-col.active .bar { box-shadow: 0 0 0 2px var(--cyan); }

.ov-bar-col { transition: opacity 120ms; }
.ov-bar-col.clickable { cursor: pointer; }
.ov-bar-col.clickable:hover .ov-bar { filter: brightness(1.25); }
.ov-bar-col.dimmed { opacity: 0.35; }
.ov-bar-col.active .ov-bar { box-shadow: 0 0 0 2px var(--cyan); }

.bar-list .bar-row.clickable { cursor: pointer; transition: opacity 120ms, padding 120ms; }
.bar-list .bar-row.clickable:hover .label { color: var(--text); }
.bar-list .bar-row.dimmed { opacity: 0.45; }
.bar-list .bar-row.active {
  border-left: 2px solid var(--cyan);
  padding-left: 10px;
  font-weight: 700;
}
.bar-list .bar-row.active .label { color: var(--text); }

.daily-bars .b { transition: opacity 120ms; }
.daily-bars .b.dimmed { opacity: 0.35; }
.daily-bars .b.active { box-shadow: 0 0 0 2px var(--cyan); }

.clickable-th { transition: color 120ms, background 120ms; }
.clickable-th:hover { color: var(--cyan-2); background: rgba(34,211,238,0.06); }
.clickable-th.active { color: var(--cyan); background: rgba(34,211,238,0.10); }

.drilldown-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(34,211,238,0.12);
  border: 1px solid var(--cyan-dim);
  color: var(--cyan-2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 16px;
  max-width: max-content;
}
.drilldown-badge .dd-label { letter-spacing: 0.01em; }
.drilldown-badge .dd-label b { color: var(--text); font-weight: 600; margin-left: 4px; }
.drilldown-badge .dd-clear {
  background: transparent;
  color: var(--cyan-3);
  border: 0;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  font-family: inherit;
}
.drilldown-badge .dd-clear:hover { color: var(--text); }

/* ============== DAILY ============== */
.daily { display: grid; gap: 2px; }
.daily-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: 24px; position: relative; }
.daily-bars .b {
  flex: 1; background: var(--green);
  border-radius: 2px 2px 0 0;
  min-height: 2px; position: relative;
}
.daily-bars .b.red { background: var(--red); }
.daily-bars .b.peak::after {
  content: attr(data-v);
  position: absolute; top: -12px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px; color: var(--text-2);
  white-space: nowrap;
}
.daily-x {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--mute-2);
  font-family: var(--font-mono);
  margin-top: 4px; padding: 0 2px;
}

/* ============== TREND ============== */
.trend { width: 100%; height: 160px; display: block; }
.trend .grid { stroke: rgba(255,255,255,0.05); stroke-width: 1; stroke-dasharray: 3 3; }
.trend .axis-text { fill: var(--mute-2); font-family: var(--font-mono); font-size: 9px; }
.trend .point-label { fill: var(--text-2); font-family: var(--font-mono); font-size: 9px; }

/* ============== LEGEND ============== */
.legend { display: inline-flex; gap: 14px; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.legend-dot.red { background: var(--red); }
.legend-dot.cyan { background: var(--cyan); }

/* ============== CHIPS ============== */
.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.chip.green { background: rgba(16,185,129,0.12); color: var(--green-3); border-color: rgba(16,185,129,0.25); }
.chip.red { background: rgba(239,68,68,0.12); color: var(--red-3); border-color: rgba(239,68,68,0.25); }
.chip.cyan { background: rgba(34,211,238,0.12); color: var(--cyan-3); border-color: rgba(34,211,238,0.28); }

/* ============== DONUT ============== */
.donut-wrap { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.donut-center { display: grid; place-items: center; position: relative; }
.donut-center .center { position: absolute; inset: 0; display: grid; place-items: center; }
.donut-center .center-inner { text-align: center; }
.donut-center .center-inner .lbl {
  font-size: 10px; color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.14em; font-weight: 600;
}
.donut-center .center-inner .v { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }

/* ============== UTIL ============== */
.row { display: grid; gap: 16px; }
.row-3-9 { grid-template-columns: minmax(260px, 3fr) minmax(0, 9fr); }
.row-1-1 { grid-template-columns: 1fr 1fr; }
.row-2-1 { grid-template-columns: 2fr 1fr; }
.row-4 { grid-template-columns: repeat(4, 1fr); }

.spark { width: 100%; height: 100%; display: block; }

.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); display: inline-block;
  box-shadow: 0 0 0 0 var(--cyan);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,211,238,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(34,211,238,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); }
}

.chev {
  display: inline-block; width: 12px;
  color: var(--mute); font-family: var(--font-mono);
  text-align: center; margin-right: 4px;
}

.div-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.div-row .label { color: var(--text-2); font-size: 11px; }
.div-row .val { font-family: var(--font-mono); font-size: 11px; font-weight: 600; }

/* ============== INDICATOR CARDS (comparativo) ============== */
.indicator-card {
  background: rgba(8, 14, 18, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.indicator-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(360px 180px at 100% 0%, rgba(16,185,129,0.10), transparent 60%);
  pointer-events: none;
}
.indicator-card.red::before {
  background: radial-gradient(360px 180px at 100% 0%, rgba(239,68,68,0.10), transparent 60%);
}
.indicator-card > * { position: relative; }
.indicator-card .kpi-label { margin-bottom: 6px; }
.indicator-card .kpi-delta { margin-top: 6px; }

.filter-mini-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--mute);
  font-weight: 600;
  margin-bottom: 6px;
}

/* ============== OVERVIEW (BGP-like layout) ============== */
.section-heading {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 18px;
  line-height: 1;
}
.section-heading .muted { color: var(--mute); font-weight: 600; }

.kpi-stack { display: grid; gap: 16px; }
.kpi-stack-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  padding-left: 14px;
}
.kpi-stack-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 3px;
  background: var(--border-2);
}
.kpi-stack-item.receita::before { background: var(--green); box-shadow: 0 0 8px -1px rgba(16,185,129,0.45); }
.kpi-stack-item.despesa::before { background: var(--red);   box-shadow: 0 0 8px -1px rgba(239,68,68,0.40); }

.kpi-stack-value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.05;
  font-feature-settings: "tnum" 1;
}
.kpi-stack-label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.kpi-stack-pct {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--green-2);
  line-height: 1.05;
  margin-top: 14px;
  font-feature-settings: "tnum" 1;
}

.resultado-card {
  background:
    radial-gradient(180% 120% at 0% 0%, rgba(16,185,129,0.22) 0%, rgba(16,185,129,0.06) 40%, transparent 70%),
    rgba(8, 14, 18, 0.78);
  border: 1px solid rgba(16,185,129,0.28) !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 0 32px -8px rgba(16,185,129,0.25),
    0 20px 40px -20px rgba(0,0,0,0.7);
}
.resultado-card .resultado-val { color: var(--green-3); }

/* Side-by-side bars */
.ov-bars {
  padding-left: 56px;
  padding-top: 26px;
  padding-right: 4px;
}
.ov-bars-plot { position: relative; }
.ov-bars-axis {
  position: absolute;
  inset: 0 4px 0 0;
  pointer-events: none;
}
.ov-bars-tick {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(255,255,255,0.06);
}
.ov-bars-tick span {
  position: absolute;
  left: -56px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  padding-right: 8px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--mute);
  white-space: nowrap;
}
.ov-bars-cols {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 100%;
}
.ov-bar-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ov-bar-stack {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
}
.ov-bar {
  width: 18px;
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  position: relative;
  background: #22c55e;
  transition: filter 150ms;
}
.ov-bar.red { background: #ef4444; }
.ov-bar:hover { filter: brightness(1.15); }
.ov-bar-chip {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: #0a0e14;
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.ov-bars-x {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding-right: 4px;
}
.ov-bars-x span {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.ov-bars-year {
  display: flex;
  align-items: center;
  margin-top: 10px;
  padding-right: 4px;
}
.ov-bars-year::before, .ov-bars-year::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
}
.ov-bars-year span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.22em;
  padding: 0 14px;
  font-weight: 600;
}

/* Indicator pill toggle (Visualização Indicadores) */
.ind-pills {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ind-pill {
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 160ms;
  font-family: inherit;
}
.ind-pill:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.ind-pill.active {
  background: linear-gradient(180deg, rgba(34,211,238,0.20), rgba(34,211,238,0.08));
  color: var(--cyan-2);
  border-color: rgba(34,211,238,0.4);
  box-shadow: inset 0 0 0 1px rgba(34,211,238,0.15), 0 0 16px -4px var(--cyan-glow);
}

.ind-line { display: block; }

/* ============== LEGEND PILLS (overview) ============== */
.legend-pills {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(8, 14, 18, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
}
.legend-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
}
.legend-pill.green .dot { background: var(--green); box-shadow: 0 0 8px -1px rgba(16,185,129,0.7); }
.legend-pill.red   .dot { background: var(--red);   box-shadow: 0 0 8px -1px rgba(239,68,68,0.65); }
.legend-pill.cyan  .dot { background: var(--cyan);  box-shadow: 0 0 8px -1px rgba(34,211,238,0.65); }
.legend-pill .lbl  { color: var(--text-2); font-weight: 500; }
.legend-pill .val  {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding-left: 6px;
  margin-left: 2px;
  border-left: 1px solid var(--border-2);
}

/* ============== FILTERS BUTTON + DRAWER ============== */
.filters-btn {
  position: relative;
}
.filters-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--cyan);
  color: #02181d;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  line-height: 1;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 6, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: flex-end;
  animation: fadein 160ms cubic-bezier(.2,.7,.2,1);
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  width: min(420px, 100vw);
  height: 100%;
  background: linear-gradient(180deg, #0a1014 0%, #05080a 100%);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -30px 0 60px -10px rgba(0,0,0,0.7);
  animation: slidein 220ms cubic-bezier(.2,.7,.2,1);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.drawer-header {
  height: 70px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-header h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0;
}
.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: grid;
  place-items: center;
  transition: all 160ms;
}
.drawer-close:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.drawer-close svg { width: 14px; height: 14px; }

.drawer-body {
  padding: 24px;
  overflow: auto;
  flex: 1;
  display: grid;
  gap: 22px;
  align-content: start;
}
.drawer-group { display: grid; gap: 8px; }
.drawer-group > label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--mute);
  font-weight: 600;
}
.drawer-group .seg.full { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.drawer-group .filter-select { width: 100%; padding: 11px 30px 11px 14px; font-size: 13px; }

.drawer-footer {
  height: 72px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  background: rgba(8, 14, 18, 0.6);
}
.drawer-footer .btn-ghost { flex: 1; justify-content: center; }
.drawer-footer .btn-primary { flex: 1; justify-content: center; }

.date-range-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}
.date-range-pair input[type="date"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 13px;
  font-family: inherit;
  background-image: none;
}
.date-range-pair input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.5); cursor: pointer; }
.date-range-sep { color: var(--mute); font-family: var(--font-mono); font-size: 13px; }

/* Header date-range segmented control */
.date-range-seg {
  flex-shrink: 0;
}
.date-range-seg button {
  font-weight: 500;
  font-size: 12px;
  padding: 7px 12px;
  white-space: nowrap;
}

/* Header status filter (Realizado / A pagar/receber / Tudo) */
.status-filter-seg {
  flex-shrink: 0;
}
.status-filter-seg button {
  font-weight: 500;
  font-size: 12px;
  padding: 7px 12px;
  white-space: nowrap;
}
.status-filter-seg button.active {
  background: linear-gradient(180deg, rgba(34,197,94,0.18), rgba(34,197,94,0.08));
  color: #86efac;
  box-shadow: inset 0 0 0 1px rgba(34,197,94,0.28), 0 0 14px -4px rgba(34,197,94,0.4);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #344048; }

/* ============== RESPONSIVE ============== */
.hd-menu-btn { display: none; }
.sidebar-backdrop { display: none; }

/* Tablet & below: sidebar becomes slide-in drawer */
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }

  .hd-menu-btn { display: grid; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 60;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(.2,.7,.2,1);
    box-shadow: 30px 0 60px -10px rgba(0,0,0,0);
    /* V2-1: drawer mobile precisa scrollar verticalmente — sobrescreve overflow:hidden da regra base */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 30px 0 60px -10px rgba(0,0,0,0.7);
  }
  /* V2-1: spacer não pode forçar altura grande no drawer; sb-user flui no fim */
  .sidebar .sb-spacer { flex: 0 0 12px; }
  .sidebar .sb-user {
    background: linear-gradient(180deg, transparent, rgba(34,211,238,0.05));
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(2, 6, 10, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }
  .app.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Stack multi-column rows */
  .row-3-9, .row-1-1, .row-2-1 { grid-template-columns: 1fr !important; }
  .row-4 { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr !important; }

  /* Header tightens */
  .header { padding: 0 18px; gap: 12px; }
  .breadcrumb { display: none; }
  .search-box { width: auto; flex: 1; max-width: 360px; min-width: 0; }
  .page { padding: 20px 20px 48px; }

  /* OverviewBars / chips tighten */
  .ov-bar { width: 14px; }
  .ov-bar-stack { gap: 3px; }
  .ov-bars-cols { gap: 8px; }
  .ov-bar-chip { font-size: 9px; padding: 1px 4px; }

  .donut-wrap { grid-template-columns: 1fr; gap: 16px; justify-items: center; }
}

/* Phablet */
@media (max-width: 820px) {
  .header { padding: 0 14px; gap: 10px; height: 64px; }
  .header .btn-primary { padding: 0 12px; }
  .search-box { display: none; }
  .date-range-seg { display: none; }
  .status-filter-seg { display: none; }
  .header .hd-icon-btn[title="Notificações"] { display: none; }

  .page-title { flex-direction: column; align-items: flex-start; gap: 14px; }
  .page-title .actions { width: 100%; flex-wrap: wrap; }
  .page-title h1 { font-size: 20px; }

  .filters-bar { flex-wrap: wrap; gap: 6px; }
  .seg, .filter-select, .range-pills { flex: 1 1 auto; }
  .filter-select { min-width: 0; }

  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip .metric { padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .metric-strip .metric:nth-child(odd) { border-right: 1px solid var(--border); }
  .metric-strip .metric:nth-last-child(-n+2) { border-bottom: 0; }

  .ind-pills { width: 100%; gap: 6px; }
  .ind-pill { flex: 1 1 auto; padding: 0 10px; font-size: 11.5px; }

  .legend-pills { width: 100%; }
  .legend-pill { flex: 1 1 auto; justify-content: space-between; }
}

/* Mobile */
@media (max-width: 600px) {
  .row-4 { grid-template-columns: 1fr; }
  .page { padding: 16px 12px 40px; }
  .card { padding: 14px; border-radius: 14px; }
  .kpi-tile { padding: 14px 16px; border-radius: 14px; }
  .kpi-tile .kpi-value { font-size: 24px; }
  .kpi-tile .kpi-value .currency { font-size: 12px; }
  .kpi-tile .kpi-value .unit { font-size: 15px; }
  .kpi-tile .spark-wrap { width: 60px; height: 32px; }

  /* Header on phone: collapse novo lançamento to icon */
  .header { padding: 0 12px; height: 60px; gap: 8px; }
  .header .btn-primary { padding: 0; width: 38px; height: 38px; justify-content: center; gap: 0; }
  .header .btn-primary .btn-text { display: none; }

  /* Brand smaller — V2-1: ganha altura comprimindo área da logo */
  .sb-brand { padding: 0 18px; height: 58px; }
  .sb-logo-img { max-width: 130px; }

  /* V2-1: sub-headers Geral/Outros mais compactos pra ganhar ~20px */
  .sb-section { padding: 14px 16px 6px; }

  /* V2-1: spacer zerado em phone — sb-user flui logo após o último item */
  .sidebar .sb-spacer { flex: 0 0 4px; }

  /* V2-1: rodapé do usuário mais enxuto, com border-top mantida */
  .sb-user { padding: 10px 14px 12px; gap: 8px; }
  .sb-user .avatar { width: 32px; height: 32px; font-size: 11px; }
  .sb-user .who b { font-size: 12.5px; }
  .sb-user .who span { font-size: 10.5px; }

  /* OV bars compress */
  .ov-bars { padding-left: 38px; padding-top: 24px; }
  .ov-bar { width: 9px; }
  .ov-bar-stack { gap: 2px; }
  .ov-bars-cols { gap: 4px; }
  .ov-bar-chip { display: none; }
  .ov-bars-tick span { font-size: 9px; }
  .ov-bars-x span { font-size: 10px; }
  .ov-bars-x { gap: 4px; }
  .ov-bars-year span { font-size: 9.5px; padding: 0 8px; }

  /* Indicador line + filter mini */
  .ind-pills { gap: 4px; }
  .ind-pill { padding: 0 8px; height: 32px; font-size: 11px; }

  /* Section headings smaller */
  .section-heading, .card-title { font-size: 11.5px; letter-spacing: 0.16em; margin-bottom: 12px; }

  /* Resultado card */
  .kpi-stack-value { font-size: 18px; }
  .kpi-stack-pct { font-size: 22px; margin-top: 12px; }
  .kpi-stack { gap: 14px; }

  /* Tables */
  .t-scroll { overflow: auto; -webkit-overflow-scrolling: touch; }
  table.t { font-size: 11.5px; }
  table.t th, table.t td { padding: 8px 10px; }
  table.t th { font-size: 9.5px; letter-spacing: 0.10em; }

  /* Page title */
  .page-title h1 { font-size: 18px; }
  .status-line { font-size: 11.5px; }

  /* Range pills */
  .range-pills button { padding: 4px 8px; font-size: 10px; }

  /* Drawer takes full width */
  .drawer { width: 100vw; }

  /* Sidebar items denser — V2-1: padding vertical reduzido pra caber 18 items + 2 headers */
  .sb-item { padding: 8px 12px; font-size: 13px; margin-bottom: 1px; }

  /* Trend / indicator chart compact */
  .trend, .ind-line { height: 200px !important; }

  /* Vertical bars tighter */
  .vbar-chart { padding: 24px 14px 0; gap: 4px; }
  .vbar-col .bar { width: 12px !important; }

  /* Daily bars */
  .daily-bars { gap: 2px; }

  /* Diverging bars row */
  .div-row { grid-template-columns: 60px 1fr auto; gap: 8px; font-size: 11px; }

  /* Bar list values */
  .bar-row .val { font-size: 11px; }

  /* Filters drawer body padding */
  .drawer-body { padding: 18px; gap: 18px; }
  .drawer-header { padding: 0 18px; }
  .drawer-footer { padding: 0 18px; }

  /* Indicator card on Comparativo */
  .indicator-card { padding: 12px 14px; }

  /* Resultado-card border keep */

  /* Fluxo de Caixa — .metric-strip vira 1 coluna pra valores R$ caberem em 1 linha
     (em ≤820px estava em 2x2, mas R$2.531.934,25 cortava em 354px de largura). */
  .metric-strip { grid-template-columns: 1fr; }
  .metric-strip .metric {
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .metric-strip .metric:nth-child(odd) { border-right: 0; }
  .metric-strip .metric:last-child { border-bottom: 0; }
  .metric-strip .m-value { font-size: 20px; }

  /* Relatório IA: o .report tinha padding: 32px e o .report-toolbar não wrappava — estourava em 390px */
  .report { padding: 16px; max-width: 100%; }
  .report-cover { padding: 32px 8px 40px; }
  .report-section h2 { font-size: 16px; }
  .report-toolbar { flex-wrap: wrap; gap: 10px; }
  .report-toolbar .actions { flex-wrap: wrap; }
}

/* Very small phones */
@media (max-width: 380px) {
  .header { padding: 0 10px; gap: 6px; }
  .hd-icon-btn { width: 34px; height: 34px; }
  .header .btn-primary { width: 34px; height: 34px; }
  .ov-bar { width: 7px; }
  .page-title h1 { font-size: 17px; }
  .kpi-tile .kpi-value { font-size: 22px; }
}

/* Print: clean up for export PDF */
@media print {
  .sidebar, .sidebar-backdrop, .header { display: none !important; }
  .app { grid-template-columns: 1fr; height: auto; }
  .main { overflow: visible; height: auto; }
  .page { overflow: visible; padding: 16px; background: white !important; color: black !important; }
  .page::before { display: none; }
  .card, .kpi-tile { background: #fafafa !important; box-shadow: none !important; border: 1px solid #ddd !important; color: black !important; break-inside: avoid; }
  .card-title, .kpi-label, .kpi-stack-label, .ov-bars-tick span, .ov-bars-x span { color: #444 !important; }
  .kpi-value, .kpi-stack-value, .kpi-stack-pct { color: black !important; }
  .filters-btn, .btn-ghost, .btn-primary, .ind-pills, .range-pills, .actions { display: none !important; }
}

/* ===== Pagina Relatorio IA ===== */

.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.report-toolbar .actions {
  display: flex;
  gap: 8px;
}

.report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  color: var(--fg);
  max-width: 880px;
  margin: 0 auto;
  font-family: var(--font-body, 'Inter', sans-serif);
  line-height: 1.6;
}

.report-cover {
  text-align: center;
  padding: 48px 16px 64px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.report-logo { width: 140px; opacity: 0.95; margin-bottom: 24px; }
.report-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.report-subtitle {
  font-size: 18px;
  color: var(--fg-2);
  margin: 0 0 8px;
  font-weight: 500;
}
.report-meta {
  font-size: 12px;
  color: var(--fg-3);
  margin: 4px 0;
}

.report-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
}
.report-section:last-of-type { border-bottom: 0; }
.report-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.report-section h3.report-sub {
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.report-kpi {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.report-kpi .lbl {
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.report-kpi .val {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}
.report-kpi .val.green { color: var(--green); }
.report-kpi .val.red { color: var(--red); }

.report-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
}
.report-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.report-list li:last-child { border-bottom: 0; }
.report-list li b {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 600;
  color: var(--fg);
}

.report-analysis {
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-2);
  margin: 12px 0;
  text-align: justify;
}
.report-analysis.muted { color: var(--fg-3); font-style: italic; }

.report-conclusion {
  background: var(--surface-2);
  margin-top: 16px;
  padding: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.report-footer {
  text-align: center;
  font-size: 10px;
  color: var(--fg-3);
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

/* ===== Print rules para o relatorio (Ctrl+P / Save as PDF) ===== */

@media print {
  @page {
    size: A4;
    margin: 18mm 16mm;
  }

  /* Esconde tudo da UI, mostra so o relatorio */
  .sidebar,
  .sidebar-backdrop,
  .header,
  .report-toolbar,
  .no-print,
  .drawer-overlay,
  .drawer { display: none !important; }

  body, html { background: white !important; color: black !important; }
  .app { display: block !important; height: auto !important; }
  .main { display: block !important; overflow: visible !important; height: auto !important; }
  .page { padding: 0 !important; background: white !important; }
  .page::before { display: none !important; }

  /* Relatorio tipografia A4 */
  .report {
    background: white !important;
    color: black !important;
    border: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    font-size: 11pt;
    font-family: 'Inter', Arial, sans-serif;
  }

  .report-cover {
    page-break-after: always;
    text-align: center;
    padding: 60mm 0 0 !important;
    border: 0 !important;
    height: 240mm;
  }
  .report-logo {
    /* Logo branco invertido pra print */
    filter: invert(1) brightness(0);
    width: 50mm;
    margin-bottom: 16mm;
  }
  .report-title {
    font-size: 22pt !important;
    color: black !important;
    margin-bottom: 8mm !important;
  }
  .report-subtitle {
    font-size: 14pt !important;
    color: #333 !important;
  }
  .report-meta { color: #555 !important; font-size: 10pt !important; }

  .report-section {
    page-break-before: always;
    page-break-inside: avoid;
    border: 0 !important;
    padding: 0 !important;
  }
  .report-section h2 {
    font-size: 16pt !important;
    color: black !important;
    margin-bottom: 6mm !important;
    border-bottom: 1px solid #999;
    padding-bottom: 3mm;
  }
  .report-section h3.report-sub {
    font-size: 10pt !important;
    color: #333 !important;
  }

  .report-kpis {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4mm !important;
  }
  .report-kpi {
    background: #f5f5f5 !important;
    border: 1px solid #ccc !important;
    color: black !important;
    page-break-inside: avoid;
  }
  .report-kpi .lbl { color: #555 !important; }
  .report-kpi .val { color: black !important; }
  .report-kpi .val.green { color: #047857 !important; }
  .report-kpi .val.red { color: #b91c1c !important; }

  .report-list li {
    border-bottom: 1px solid #ddd !important;
    color: black !important;
  }
  .report-list li b { color: black !important; }

  .report-analysis {
    color: #222 !important;
    font-size: 11pt !important;
    line-height: 1.6 !important;
    page-break-inside: avoid;
  }

  .report-conclusion {
    background: #f5f5f5 !important;
    border: 1px solid #ccc !important;
    color: black !important;
    page-break-before: always;
  }

  .report-footer {
    color: #666 !important;
    border-top: 1px solid #999 !important;
    margin-top: 8mm;
  }
}

/* Year select no header (esquerda do StatusFilter) */
.header-year {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  margin-right: 10px;
  font-family: inherit;
}
.header-year:hover { border-color: var(--cyan-dim); }
.header-year:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,0.15); }
.header-year option { background: var(--surface); color: var(--text); }

/* ============== HIERARQUIA ADS (PageHierarquia) ============== */
.hier-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: rgba(8, 14, 18, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.hier-filters .hf-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hier-filters .hf-item label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--mute);
  font-weight: 600;
}
.hier-filters .hf-item .filter-select {
  width: 100%;
}
.hier-filters .hf-item input[type="date"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 12.5px;
  background-image: none;
}

.hier-stage {
  position: relative;
  background: linear-gradient(180deg, #0c0e12 0%, #0e1014 60%, #08090c 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 22px 28px;
  overflow: hidden;
  min-height: 420px;
}
.hier-spotlight {
  position: absolute;
  top: -100px;
  right: -120px;
  width: 720px;
  height: 720px;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(245,158,11,0.30), rgba(245,158,11,0.10) 35%, transparent 65%);
  z-index: 0;
}
.hier-title {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f59e0b;
  text-align: center;
  margin: 0 0 18px;
  text-shadow: 0 0 20px rgba(245,158,11,0.4);
}
.hier-cols-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 64px;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(245,158,11,0.10), rgba(245,158,11,0.04));
  border-radius: 6px;
  border-bottom: 1px solid rgba(245,158,11,0.20);
}
.hier-cols-header > div {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #fbbf24;
  font-weight: 600;
  white-space: nowrap;
}
.hier-tree-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 4px;
}
.hier-tree-wrap::-webkit-scrollbar { height: 8px; }
.hier-tree-wrap::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ============== DETALHADO (PageDetalhado bar lists fortes) ============== */
.radke-bars-card {
  background: rgba(8, 14, 18, 0.78);
  position: relative;
  overflow: hidden;
}
.radke-bars-card .card-title {
  color: #fbbf24;
  letter-spacing: 0.12em;
}
.rd-barlist {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rd-barrow {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.rd-bar {
  position: relative;
  height: 26px;
  background: rgba(255,255,255,0.025);
  border-radius: 3px;
  overflow: hidden;
}
.rd-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  border-radius: 3px;
  box-shadow: 0 0 12px -2px rgba(245,158,11,0.45);
}
.rd-bar-label {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0 10px;
  line-height: 26px;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.rd-bar-value {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #fbbf24;
  white-space: nowrap;
}

/* Faturamento col destaque na matrix */
.rd-matrix .rd-fat-col {
  background: rgba(245,158,11,0.10);
}
.rd-matrix tbody tr:hover .rd-fat-col {
  background: rgba(245,158,11,0.16);
}
.rd-matrix th.rd-fat-col,
.rd-matrix tr.total .rd-fat-col {
  background: rgba(245,158,11,0.18);
  color: #fbbf24;
}

/* ============== PROFUNDA CLIENTE (PageProfundaCliente — bar overlay) ============== */
.pc-card {
  padding: 0;
  overflow: hidden;
}
.pc-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 22px;
  background: linear-gradient(180deg, rgba(245,158,11,0.12), rgba(245,158,11,0.04));
  border-bottom: 1px solid rgba(245,158,11,0.25);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: #fbbf24;
}
.pc-header .pc-h-valor { padding-right: 8px; }
.pc-list {
  display: flex;
  flex-direction: column;
  max-height: 640px;
  overflow-y: auto;
}
.pc-row {
  position: relative;
  padding: 0 22px;
  background: var(--rowBg, transparent);
  transition: background 120ms;
}
.pc-row:hover {
  background: rgba(245,158,11,0.06);
}
.pc-row-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(245,158,11,0.20) 0%, rgba(245,158,11,0.06) 100%);
  pointer-events: none;
}
.pc-row-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  height: 36px;
  font-size: 12.5px;
}
.pc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245,158,11,0.55);
  flex-shrink: 0;
}
.pc-name {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fbbf24;
  font-weight: 700;
  white-space: nowrap;
}
.pc-row.pc-total {
  border-top: 2px solid rgba(245,158,11,0.35);
  background: rgba(245,158,11,0.08);
  padding-top: 4px;
  padding-bottom: 4px;
}
.pc-row.pc-total .pc-row-content {
  grid-template-columns: 1fr auto;
  height: 44px;
}

/* ============== CRM (PageCRM — funil + boxes meta + projeção) ============== */
.crm-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.crm-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.crm-meta-box {
  background: rgba(8, 14, 18, 0.78);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.crm-meta-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.crm-meta-box.green { border-color: rgba(16,185,129,0.32); }
.crm-meta-box.green::before { background: radial-gradient(360px 180px at 100% 0%, rgba(16,185,129,0.16), transparent 60%); }
.crm-meta-box.green .cmb-value { color: var(--green-2); }
.crm-meta-box.green .cmb-bar > div { background: var(--green); }
.crm-meta-box.amber { border-color: rgba(245,158,11,0.32); }
.crm-meta-box.amber::before { background: radial-gradient(360px 180px at 100% 0%, rgba(245,158,11,0.18), transparent 60%); }
.crm-meta-box.amber .cmb-value { color: #fbbf24; }
.crm-meta-box.amber .cmb-bar > div { background: var(--amber); }
.crm-meta-box.red { border-color: rgba(239,68,68,0.32); }
.crm-meta-box.red::before { background: radial-gradient(360px 180px at 100% 0%, rgba(239,68,68,0.16), transparent 60%); }
.crm-meta-box.red .cmb-value { color: var(--red-2); }
.crm-meta-box.red .cmb-bar > div { background: var(--red); }
.crm-meta-box > * { position: relative; }
.cmb-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--mute);
  font-weight: 600;
  margin-bottom: 6px;
}
.cmb-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--font-ui);
  font-feature-settings: "tnum" 1;
  margin-bottom: 8px;
}
.cmb-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.cmb-bar > div { height: 100%; border-radius: 2px; transition: width 240ms; }

.crm-funnel-card {
  background: rgba(8, 14, 18, 0.78);
  display: flex;
  flex-direction: column;
}
.crm-funnel-card .card-title {
  text-align: center;
  color: #fbbf24;
}
.crm-funnel-foot {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
}
.cff-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cff-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--mute);
  font-weight: 600;
}
.cff-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: #fbbf24;
}

.crm-proj-card {
  background: rgba(8, 14, 18, 0.78);
}
.crm-proj-card .card-title { color: #fbbf24; }
.crm-proj-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 11px;
  color: var(--text-2);
  margin-top: 8px;
}
.crm-proj-legend .lg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

@media (max-width: 1200px) {
  .crm-layout { grid-template-columns: 1fr; }
  .crm-meta { flex-direction: row; flex-wrap: wrap; }
  .crm-meta-box { flex: 1 1 calc(50% - 6px); min-height: auto; }
  .hier-cols-header { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* CRM "METAS COMERCIAIS" no mobile: 1 coluna full-width pra valores
   como R$14.593.457 não quebrarem em 2 linhas. Override do bloco 1200px acima. */
@media (max-width: 600px) {
  .crm-meta { flex-direction: column; flex-wrap: nowrap; }
  .crm-meta-box { flex: 1 1 auto; min-height: auto; }
}

/* ============================================================
   FATURAMENTO POR PRODUTO + MARKETING ADS — namespaces .fat-* / .mkt-*
   Telas refeitas pra ficar fiéis aos prints PBI (laranja #ff6b18).
   ============================================================ */

/* ----- Filtros header (compartilhado fat / mkt) ----- */
.fat-filters,
.mkt-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: rgba(8, 14, 18, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.fat-filter,
.mkt-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fat-filter span,
.mkt-filter span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mute);
  font-weight: 600;
}
.fat-filter .filter-select,
.mkt-filter .filter-select { width: 100%; }

/* ============================================================
   FATURAMENTO POR PRODUTO
   ============================================================ */

.fat-row-1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 14px;
  margin-bottom: 14px;
}
.fat-row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 14px;
}
.fat-col-rankings {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

/* Métricas Gerais (KPI bloco esquerda) */
.fat-metricas { padding: 22px 24px; }
.fat-metricas-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--mute);
  font-weight: 700;
  margin-bottom: 18px;
}
.fat-metricas-grid {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 18px;
}
.fat-metric { display: flex; flex-direction: column; gap: 4px; }
.fat-metric-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mute);
  font-weight: 600;
}
.fat-metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  font-feature-settings: "tnum" 1;
  line-height: 1.05;
}

/* Vertical bars laranja — usado em "VENDAS POR ANÚNCIO" */
.fat-vbars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 30px 8px 0;
  position: relative;
}
.fat-vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}
.fat-vbar-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}
.fat-vbar-bar {
  width: 70%;
  max-width: 38px;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  transition: filter 150ms;
  box-shadow: 0 0 14px -6px rgba(255, 107, 24, 0.6);
}
.fat-vbar-col:hover .fat-vbar-bar { filter: brightness(1.15); }
.fat-vbar-val {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.fat-vbar-x {
  font-size: 9.5px;
  color: var(--mute);
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Bar list horizontal laranja (RANKING POR PRODUTO / VENDEDOR) */
.fat-barlist { display: flex; flex-direction: column; gap: 12px; }
.fat-barrow { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; }
.fat-barrow-label {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  font-weight: 500;
}
.fat-barrow-track {
  position: relative;
  height: 22px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  overflow: visible;
}
.fat-barrow-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 250ms ease-out;
  box-shadow: 0 0 14px -6px rgba(255, 107, 24, 0.5);
}
.fat-barrow-val {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(calc(100% + 8px), -50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

/* Matriz produtos × mês */
.fat-matriz { padding: 18px; }
.fat-matriz-tbl th,
.fat-matriz-tbl td { font-size: 11.5px; padding: 8px 10px; }
.fat-matriz-tbl th { font-size: 9.5px; }

/* ============================================================
   MARKETING ADS
   ============================================================ */

/* 4 KPI tiles em linha (CUSTOS / CLIQUES / IMPRESSÕES / IMPACTO) */
.mkt-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.mkt-kpi {
  background: rgba(8, 14, 18, 0.78);
  border: 1px solid rgba(255, 107, 24, 0.18);
  border-radius: 16px;
  padding: 18px 22px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 28px -16px rgba(0, 0, 0, 0.7);
}
.mkt-kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 220px at 100% 0%, rgba(255, 107, 24, 0.16), transparent 62%);
  pointer-events: none;
}
.mkt-kpi > * { position: relative; }
.mkt-kpi-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--mute);
  font-weight: 700;
  margin-bottom: 10px;
}
.mkt-kpi-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  font-feature-settings: "tnum" 1;
}
.mkt-kpi-orange { color: #ff6b18; }
.mkt-kpi-sub {
  font-size: 11px;
  color: var(--mute);
  margin-top: 8px;
  letter-spacing: 0.02em;
}
.mkt-kpi-sub b { color: var(--text-2); font-weight: 600; }

/* Linha CPM × Valor Investido + Cliques por Campanha */
.mkt-row-1 {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.mkt-cpm-card { padding: 18px 20px 12px; }
.mkt-cliques-card { padding: 18px 20px; }
.mkt-leads-card { padding: 18px 20px; }

/* Bar list horizontal laranja (CLIQUES POR CAMPANHA) */
.mkt-barlist { display: flex; flex-direction: column; gap: 12px; }
.mkt-barrow { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; }
.mkt-barrow-label {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  font-weight: 500;
}
.mkt-barrow-track {
  position: relative;
  height: 22px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.mkt-barrow-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 250ms ease-out;
  box-shadow: 0 0 14px -6px rgba(255, 107, 24, 0.5);
}
.mkt-barrow-val {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(calc(100% + 8px), -50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

/* Vertical bars (LEADS POR ANÚNCIO) */
.mkt-vbars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 30px 14px 0;
}
.mkt-vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
  position: relative;
  min-width: 0;
}
.mkt-vbar-bar {
  width: 60%;
  max-width: 44px;
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  background: #ff6b18;
  box-shadow: 0 0 16px -6px rgba(255, 107, 24, 0.7);
  transition: filter 150ms;
}
.mkt-vbar-col:hover .mkt-vbar-bar { filter: brightness(1.15); }
.mkt-vbar-val {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text);
  white-space: nowrap;
  font-weight: 600;
}
.mkt-vbar-x {
  font-size: 9.5px;
  color: var(--mute);
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----- Responsivo ----- */
@media (max-width: 1100px) {
  .fat-row-1, .fat-row-2, .mkt-row-1 { grid-template-columns: 1fr; }
  .mkt-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .mkt-kpis { grid-template-columns: 1fr; }
  .mkt-kpi-value { font-size: 24px; }
  .fat-metric-value { font-size: 22px; }
  .fat-barrow, .mkt-barrow { grid-template-columns: 90px 1fr; }
  .fat-barrow-label, .mkt-barrow-label { font-size: 10px; }
  /* O valor era posicionado fora do track (transform translate +100%) — estourava o card em mobile.
     No mobile passa a ficar sobreposto no canto direito do track, com cor clara + sombra pra ler em cima da barra laranja. */
  .fat-barrow-track, .mkt-barrow-track { overflow: hidden; }
  .fat-barrow-val, .mkt-barrow-val {
    right: 6px;
    transform: translate(0, -50%);
    color: #fff;
    font-size: 10.5px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.65);
  }
}

/* ===== BI Export modal + print multi-tela ===== */
.bi-export-modal {
  max-width: 560px;
  margin: auto;
  padding: 24px;
}
.bi-export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 16px;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
}
.bi-export-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--fg-2);
  cursor: pointer;
  transition: background 0.12s;
}
.bi-export-row:hover { background: rgba(34, 211, 238, 0.06); }
.bi-export-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
  cursor: pointer;
}
.bi-export-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: space-between;
}
.hd-export-bi {
  margin-left: 8px;
  white-space: nowrap;
}
/* Em telas estreitas, mantém só o ícone do botão Exportar BI pra caber no header */
@media (max-width: 900px) {
  .hd-export-bi span { display: none; }
  .hd-export-bi { padding: 0; width: 38px; justify-content: center; gap: 0; margin-left: 0; }
}

/* BI Print mode: tema escuro preservado, cada tela vira uma página A4 */
.bi-print-root {
  display: block;
  background: var(--bg);
  min-height: 100vh;
}
.bi-print-page {
  background: var(--bg);
  padding: 20mm 14mm;
  page-break-after: always;
  break-after: page;
}
.bi-print-page:last-child { page-break-after: auto; }
.bi-print-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.bi-print-logo { height: 28px; }
.bi-print-pagenum {
  font-size: 11px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.bi-print-brand {
  font-size: 16px;
  color: var(--text);
  font-weight: 700;
}

@media print {
  body.bi-print-mode {
    background: var(--bg) !important;
    color: var(--text) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.bi-print-mode * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.bi-print-mode .page {
    background: var(--bg) !important;
    color: var(--text) !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  body.bi-print-mode .card, body.bi-print-mode .kpi-tile {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  body.bi-print-mode .card-title, body.bi-print-mode .kpi-label,
  body.bi-print-mode .kpi-stack-label, body.bi-print-mode .ov-bars-tick span,
  body.bi-print-mode .ov-bars-x span {
    color: var(--fg-2) !important;
  }
  body.bi-print-mode .kpi-value, body.bi-print-mode .kpi-stack-value,
  body.bi-print-mode .kpi-stack-pct {
    color: var(--text) !important;
  }
  body.bi-print-mode .actions, body.bi-print-mode .no-print { display: none !important; }
  body.bi-print-mode .bi-print-root { display: block !important; }
  body.bi-print-mode .bi-print-page {
    background: var(--bg) !important;
    padding: 14mm 10mm !important;
    page-break-after: always;
    page-break-inside: auto;
  }
  body.bi-print-mode .bi-print-page:last-child { page-break-after: auto; }
  body.bi-print-mode .bi-print-header {
    page-break-inside: avoid;
    page-break-after: avoid;
    break-after: avoid;
  }
  /* Reset sticky thead — em multi-page export sticky vaza pra próxima página */
  body.bi-print-mode table.t th {
    position: static !important;
    box-shadow: none !important;
  }
  /* Permite quebra de tabela mas evita quebra DENTRO de uma linha + repete thead */
  body.bi-print-mode table.t {
    page-break-inside: auto;
    break-inside: auto;
  }
  body.bi-print-mode table.t thead {
    display: table-header-group;
  }
  body.bi-print-mode table.t tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  /* Libera scroll containers — print precisa ver tudo, não só o viewport visível */
  body.bi-print-mode .t-scroll {
    max-height: none !important;
    overflow: visible !important;
  }
  /* Cards não quebram no meio (mas se forem grandes demais, deixa) */
  body.bi-print-mode .card { break-inside: auto; page-break-inside: auto; }
  body.bi-print-mode .kpi-row, body.bi-print-mode .row {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  @page { size: A4; margin: 8mm; }
}

/* Escopa o @media print legado (Relatório IA standalone) pra não interferir
   no multi-page BI export — só aplica quando NÃO está em bi-print-mode */
@media print {
  body:not(.bi-print-mode) .sidebar,
  body:not(.bi-print-mode) .sidebar-backdrop,
  body:not(.bi-print-mode) .header,
  body:not(.bi-print-mode) .report-toolbar,
  body:not(.bi-print-mode) .no-print,
  body:not(.bi-print-mode) .drawer-overlay,
  body:not(.bi-print-mode) .drawer { display: none !important; }
}

/* ===== CRM metas (barras horizontais) ===== */
.crm-metas-card { padding: 18px 20px; }
.crm-metas-grid {
  display: grid;
  gap: 18px;
  margin-top: 12px;
}
.crm-meta-row { display: flex; flex-direction: column; gap: 6px; }
.crm-meta-row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.crm-meta-row-label {
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.crm-meta-row-sub {
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-mono);
  margin-top: 4px;
}
.crm-meta-pct {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}
.crm-meta-pct.green { color: var(--green); }
.crm-meta-pct.cyan { color: var(--cyan); }
.crm-meta-pct.amber { color: #fbbf24; }
.crm-meta-pct.red { color: var(--red); }
.crm-meta-track {
  position: relative;
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.crm-meta-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
}
.crm-meta-fill.green {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}
.crm-meta-fill.cyan {
  background: linear-gradient(90deg, #0891b2 0%, #22d3ee 100%);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.35);
}
.crm-meta-fill.amber {
  background: linear-gradient(90deg, #d97706 0%, #fbbf24 100%);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
}
.crm-meta-fill.red {
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.30);
}
.crm-meta-target {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: rgba(255,255,255,0.35);
  pointer-events: none;
}

/* ===== Inline Filter Bar (substitui modal removido) ===== */
.inline-filterbar {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(34, 211, 238, 0.025);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-wrap: wrap;
}
.ifb-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  min-width: 160px;
}
.ifb-item > span:first-child {
  font-size: 10px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.ifb-search-wrap { min-width: 280px; flex: 1; max-width: 480px; }
.ifb-search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  height: 36px;
  transition: border-color 0.12s;
}
.ifb-search-trigger:hover { border-color: var(--cyan); }
.ifb-search-trigger svg { width: 14px; height: 14px; opacity: 0.6; transform: rotate(90deg); }
.ifb-popover {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--cyan);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 50;
  padding: 8px;
  min-width: 280px;
}
.ifb-search-input {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 6px;
  outline: none;
}
.ifb-search-input:focus { border-color: var(--cyan); }
.ifb-popover-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.ifb-popover-item {
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
  color: var(--fg-2);
  transition: background 0.1s;
}
.ifb-popover-item:hover { background: rgba(34, 211, 238, 0.08); color: var(--text); }
.ifb-popover-item.active { background: rgba(34, 211, 238, 0.18); color: var(--cyan); font-weight: 600; }

/* ===== Tesouraria — banner de risco de caixa ===== */
.tesouraria-risco {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.tesouraria-risco.risco-critico {
  background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(239,68,68,0.04));
  border-color: rgba(239,68,68,0.45);
  box-shadow: 0 0 18px rgba(239,68,68,0.20);
}
.tesouraria-risco.risco-atencao {
  background: linear-gradient(135deg, rgba(251,191,36,0.14), rgba(251,191,36,0.03));
  border-color: rgba(251,191,36,0.4);
}
.tesouraria-risco.risco-ok {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.22);
}
.risco-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.tesouraria-risco.risco-critico .risco-icon { color: var(--red); }
.tesouraria-risco.risco-atencao .risco-icon { color: #fbbf24; }
.tesouraria-risco.risco-ok .risco-icon { color: var(--green); }
.risco-body { flex: 1; min-width: 0; }
.risco-titulo {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.risco-dias {
  display: inline-block;
  padding: 2px 8px;
  background: var(--red);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.tesouraria-risco.risco-atencao .risco-dias { background: #fbbf24; color: #0a141a; }
.risco-detalhe {
  font-size: 12px;
  color: var(--fg-2);
  line-height: 1.6;
  margin-bottom: 4px;
}
.risco-min {
  font-size: 11px;
  color: var(--fg-3);
  line-height: 1.6;
}
.tesouraria-mini-chart { margin: 4px 0 12px; }
.tesouraria-row-critica {
  background: rgba(239, 68, 68, 0.08) !important;
  border-left: 3px solid var(--red);
}
.tesouraria-row-critica td {
  font-weight: 700 !important;
}

/* ===== Upsell page (PRO badge + landing-page interna) ===== */
.upsell-page { color: var(--text); }
.upsell-badge-pro {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0a141a;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-right: 6px;
}
.upsell-hero {
  display: flex;
  gap: 24px;
  padding: 32px 28px;
  background: linear-gradient(135deg, rgba(34,211,238,0.08), rgba(34,211,238,0.02));
  border: 1px solid rgba(34,211,238,0.25);
  border-radius: 12px;
  margin-bottom: 20px;
  align-items: center;
}
.upsell-hero-icon {
  font-size: 64px;
  line-height: 1;
  flex-shrink: 0;
}
.upsell-hero-body { flex: 1; min-width: 0; }
.upsell-hero-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.upsell-hero-desc {
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.6;
  margin: 0 0 16px;
}
.upsell-cta {
  font-size: 14px !important;
  padding: 10px 24px !important;
  background: linear-gradient(135deg, #22d3ee, #0891b2) !important;
  color: #0a141a !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
}
.upsell-cta:hover { box-shadow: 0 0 16px rgba(34,211,238,0.45); transform: translateY(-1px); }
.upsell-cta-hint {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--fg-3);
}
.upsell-beneficios {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.upsell-beneficios li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.5;
}
.upsell-beneficios li:last-child { border-bottom: 0; }
.upsell-check {
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}
.upsell-preview-mock {
  margin-top: 18px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--border-2);
  border-radius: 6px;
}
.upsell-preview-label {
  font-size: 10px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.upsell-preview-box {
  color: var(--fg-3);
  font-size: 12px;
  font-style: italic;
}
.upsell-side { padding: 18px 20px; }
.upsell-divider {
  height: 1px;
  background: var(--border);
  margin: 14px -20px;
}

/* Sidebar — badge PRO em items upsell */
.sb-item-upsell .sb-item-badge-pro {
  display: inline-block;
  padding: 1px 5px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0a141a;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-left: 6px;
  vertical-align: middle;
}

/* === Barleys BI compat aliases === */
html, body, #app { height: 100%; }
.green-text { color: var(--green-2); }
.red-text   { color: var(--red-2); }
.amber-text { color: var(--amber); }
.cyan-text  { color: var(--cyan); }
.muted-text { color: var(--mute); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-2); }
.badge.green  { background: rgba(16,185,129,0.12); color: var(--green-3); border-color: rgba(16,185,129,0.25); }
.badge.red    { background: rgba(239,68,68,0.12);  color: var(--red-3);   border-color: rgba(239,68,68,0.25); }
.badge.amber  { background: rgba(245,158,11,0.12); color: #f59e0b;        border-color: rgba(245,158,11,0.25); }
.badge.cyan   { background: rgba(34,211,238,0.12); color: var(--cyan-3);  border-color: rgba(34,211,238,0.28); }

