:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #122033;
  --muted: #65748b;
  --line: #e3e9f3;
  --brand: #1f6feb;
  --brand-dark: #1558c0;
  --ok: #0f8a5f;
  --warn: #b7791f;
  --danger: #d33f49;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell {
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #0e1726;
  color: #f8fafc;
  padding: 24px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar-top { flex-shrink: 0; }
.sidebar-scroll { flex: 1; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.brand h1 {
  margin: 0;
  font-size: 22px;
}
.brand-subtitle {
  margin: 4px 0 0;
  color: #d9e3f3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.brand p {
  margin: 4px 0 0;
  color: #aab7cf;
  font-size: 13px;
}
.mode-banner {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mode-banner.desktop { background: rgba(31,111,235,0.18); color: #b7d1ff; }
.mode-banner.online { background: rgba(15,138,95,0.18); color: #b8f7dc; }

.version-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 14px;
  text-align: left;
  color: #dbeafe;
  background: transparent;
}
.nav-btn:hover { background: rgba(255,255,255,0.08); }
.nav-btn.active {
  background: #1f6feb;
  color: #fff;
  box-shadow: 0 12px 30px rgba(31, 111, 235, 0.25);
}
.side-section { border-top: 1px solid rgba(255,255,255,0.10); padding-top: 16px; }
.section-title {
  color: #9fb0c9;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.list { display: flex; flex-direction: column; gap: 7px; }
.list.muted { color: #9fb0c9; font-size: 13px; }
.list-item {
  width: 100%;
  border: 0;
  background: rgba(255,255,255,0.06);
  color: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.list-item:hover, .list-item.selected { background: rgba(31,111,235,0.40); }
.list-item small { color: #aec0db; font-size: 11px; }
.report-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  font-size: 13px;
  color: var(--text, #1a1d26);
}
.report-mini:hover { background: rgba(31,111,235,0.08); }
.report-mini .report-mini-icon {
  flex-shrink: 0;
  color: var(--brand, #4f6ef6);
  display: flex;
  align-items: center;
}
.report-mini .report-mini-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.report-mini .report-mini-del {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s;
}
.report-mini:hover .report-mini-del { opacity: 1; }

.sidebar-footer {
  padding: 10px 14px;
  font-size: 11px;
  color: #6b7280;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
  display: grid;
  gap: 8px;
}
.sidebar-logout {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  color: #dbe7f7;
  background: rgba(255,255,255,.06);
  font-size: 12px;
  font-weight: 750;
}
.sidebar-logout:hover { color: #fff; background: rgba(255,255,255,.11); }
.sidebar-logout svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.sidebar-collapsed .sidebar-footer { padding-left: 2px; padding-right: 2px; }
body.sidebar-collapsed .sidebar-footer > span,
body.sidebar-collapsed .sidebar-logout span { display: none; }
.sidebar-account-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 11px;
  color: #eef6ff;
  background: rgba(255,255,255,.06);
  text-align: left;
}
.sidebar-account-button:hover { background: rgba(255,255,255,.11); }
.sidebar-account-copy { min-width: 0; display: grid; gap: 1px; }
.sidebar-account-copy b,
.sidebar-account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account-copy b { font-size: 12px; }
.sidebar-account-copy small { color: #9fb0c9; font-size: 10px; }
body.sidebar-collapsed .sidebar-account-button { width: 48px; min-width: 48px; margin-left: auto; margin-right: auto; justify-content: center; padding: 5px; }
body.sidebar-collapsed .sidebar-account-copy { display: none; }
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}
.sidebar .icon-btn {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.15);
}
.icon-btn:hover { transform: translateY(-1px); }

.main {
  padding: 32px;
  overflow-x: hidden;
}
.tab { display: none; }
.tab.active { display: block; }
#modelTab.tab.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
}

#schemaTab.tab.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
}

#schemaTab.tab.active .insert-data-layout {
  flex: 1;
  min-height: 0;
}

#schemaTab.tab.active .insert-data-left-col {
  min-height: 0;
}

/* Model Cards Grid */
.model-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 0;
}
.model-card {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e3e9f3);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.model-card:hover {
  border-color: var(--brand, #1f6feb);
  box-shadow: 0 4px 16px rgba(31,111,235,0.1);
  transform: translateY(-2px);
}
.model-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.model-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand, #1f6feb) 0%, #3b82f6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.model-card-icon.table-icon { background: linear-gradient(135deg, #0f8a5f 0%, #10b981 100%); }
.model-card-icon.view-icon { background: linear-gradient(135deg, #b7791f 0%, #d4a24c 100%); }
.model-card-icon.calendar-icon { background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%); }
.model-card-info {
  flex: 1;
  min-width: 0;
}
.model-card-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text, #122033);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-card-type {
  font-size: 10px;
  color: var(--muted, #65748b);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.model-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11px;
  color: var(--muted, #65748b);
}
.model-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg, #f4f7fb);
  padding: 2px 6px;
  border-radius: 5px;
}
.model-col-loading {
  opacity: 0.5;
  font-style: italic;
}
.model-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.model-card-actions .btn {
  font-size: 11px;
  padding: 5px 12px;
}

/* === Header escuro padrão (aplicado em todas as abas) === */
.page-head.page-head-dark,
.page-head-dark {
  background: linear-gradient(135deg, #1a2744 0%, #1e3a5f 50%, #0f2340 100%) !important;
  border: 0 !important;
  border-radius: 16px;
  padding: 12px 20px;
  margin-bottom: 16px;
  color: #fff;
  box-shadow: none !important;
  backdrop-filter: none !important;
  align-items: center !important;
}
.page-head-dark > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 0;
}
.page-head-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #93c5fd;
}
.page-head-dark h2 {
  color: #fff !important;
  font-size: 20px;
  margin: 0;
  line-height: 1;
}
.page-head-dark .btn {
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.25) !important;
  background: transparent !important;
}
.page-head-dark .btn:hover {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.4) !important;
}
.page-head-dark .btn.primary {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}
.page-head-dark .btn.primary:hover { background: #1d4ed8 !important; }
.page-head-dark .btn.secondary {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.2) !important;
}
.page-head-dark .btn.secondary:hover { background: rgba(255,255,255,0.18) !important; }
.page-head-dark .meta,
.page-head-dark .last-update-badge {
  color: rgba(255,255,255,0.7) !important;
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.15) !important;
}
.page-head-dark .last-update-badge.updated {
  color: #fff !important;
  background: #0f8a5f !important;
  border-color: #0f8a5f !important;
}
.page-head-dark .last-update-badge.offline {
  color: #fff !important;
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}
.page-head-dark .last-update-badge.loading {
  color: #fff !important;
  background: #b7791f !important;
  border-color: #b7791f !important;
}
.page-head-dark select {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}
.page-head-dark select option { color: #122033; background: #fff; }
.page-head-dark .tables-select-label {
  color: rgba(255,255,255,0.7) !important;
}

/* === Modelo tab - Topbar (estende o header escuro) === */
.model-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #1a2744 0%, #1e3a5f 50%, #0f2340 100%);
  border-radius: 16px;
  padding: 14px 22px;
  margin-bottom: 14px;
  color: #fff;
  flex-wrap: wrap;
}
.model-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.model-topbar-left h2 {
  color: #fff;
  font-size: 20px;
  margin: 0;
  line-height: 1;
}
.model-topbar-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #93c5fd;
}
.model-topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.model-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.model-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: #cbd5e1;
}
.model-topbar-right .btn { color: #fff !important; border: 1px solid rgba(255,255,255,0.25) !important; background: transparent !important; }
.model-topbar-right .btn:hover { background: rgba(255,255,255,0.1) !important; }
.model-topbar-right .btn.primary { background: #2563eb !important; border-color: #2563eb !important; }
.model-topbar-right .btn.primary:hover { background: #1d4ed8 !important; }

/* === Modelo tab - Section wrapper === */
.model-section {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e3e9f3);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  flex-shrink: 0;
}
.model-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line, #e3e9f3);
  background: #f8fafd;
  cursor: default;
  user-select: none;
}
.model-section-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text, #122033);
}
.model-section-head-left h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--text, #122033);
}
.model-section-head-left svg {
  color: var(--brand, #1f6feb);
  flex-shrink: 0;
}
.model-section #modelCardsGrid {
  padding: 16px;
  margin: 0;
  border: 0;
  max-height: 200px;
  overflow: auto;
}

/* === Modelo tab - Sub-tabs === */
.model-subtabs {
  display: flex;
  gap: 2px;
  background: var(--bg, #f1f5f9);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.model-subtab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #65748b);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.model-subtab:hover {
  color: var(--text, #122033);
  background: rgba(255,255,255,0.6);
}
.model-subtab.active {
  background: #fff;
  color: var(--brand, #1f6feb);
  box-shadow: 0 2px 8px rgba(15,23,42,0.08);
}
.model-subtab svg { flex-shrink: 0; }

/* === Modelo tab - Sub-panels === */
.model-subpanel { display: none; }
.model-subpanel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.model-subpanel-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}
.model-subpanel-grid .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.model-subpanel-grid .panel > label,
.model-subpanel-grid .panel > .actions {
  flex-shrink: 0;
}
.model-subpanel-grid .panel > .panel-head {
  flex-shrink: 0;
}
.model-rel-form {
  grid-template-columns: 1fr 1fr;
}
.model-subpanel-grid .column-picker,
.model-subpanel-grid .model-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.rel-list { gap: 6px !important; }
.rel-item {
  grid-template-columns: 1fr auto !important;
  padding: 8px 10px !important;
  gap: 6px !important;
  border-radius: 10px !important;
  background: #fbfdff !important;
  border-color: #e3eaf3 !important;
}
.rel-item:hover { border-color: #c4d4e8; background: #f8faff; }
.rel-inactive { opacity: 0.55; }
.rel-item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.rel-path {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.3;
}
.rel-table {
  font-weight: 700;
  color: #122033;
  white-space: nowrap;
}
.rel-col {
  color: #65748b;
  font-size: 11px;
  white-space: nowrap;
}
.rel-arrow {
  color: #1f6feb;
  font-weight: 900;
  font-size: 14px;
  margin: 0 2px;
}
.rel-meta {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.rel-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  background: #eef3fb;
  color: #3b5998;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.rel-badge-warn {
  background: #fef3c7;
  color: #92400e;
}
.rel-item-actions {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.rel-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
}
.rel-action-btn:hover { background: #f1f5f9; color: #475569; }
.rel-actions-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 200;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  min-width: 130px;
  display: none;
  overflow: hidden;
}
.rel-actions-menu.open { display: block; }
.rel-actions-menu button {
  display: block;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  color: #334155;
}
.rel-actions-menu button:hover { background: #f1f5f9; }
.rel-actions-menu button.danger { color: #dc2626; }
.rel-actions-menu button.danger:hover { background: #fef2f2; }

@media (max-width: 1280px) {
  #modelTab.tab.active { height: calc(100vh - 40px); }
}

@media (max-width: 980px) {
  .model-subpanel-grid { grid-template-columns: 1fr; }
  .model-topbar { flex-direction: column; align-items: flex-start; }
  .model-topbar-right { width: 100%; justify-content: space-between; }
  #modelTab.tab.active { height: auto; overflow: visible; }
}

@media (max-width: 640px) {
  .model-subtabs { flex-direction: column; gap: 4px; }
  #modelTab.tab.active { height: auto; overflow: visible; }
  .model-section #modelCardsGrid { max-height: 180px; }
}

.model-cards-grid.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  font-size: 14px;
  color: var(--muted, #65748b);
  background: var(--panel, #fff);
  border: 1px dashed var(--line, #e3e9f3);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
}

/* Responsive fixes */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
.page-head-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding-top: 4px;
}
.tables-select-label { font-size: 14px; font-weight: 700; color: var(--text, #1e293b); white-space: nowrap; }
.page-head-actions .tables-select {
  width: 260px; padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--line, #cbd5e1); border-radius: 8px;
  background: var(--panel-bg, #f8fafc); color: var(--text, #1e293b);
  cursor: pointer;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 12px;
}
h2 { margin: 0; font-size: 34px; letter-spacing: -0.04em; }
h3 { margin: 0; font-size: 18px; }
h4 { margin: 14px 0 10px; }
.sub { margin: 8px 0 0; color: var(--muted); }
.muted { color: var(--muted); }
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.actions.wrap { flex-wrap: wrap; }

.dashboard-refresh-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.last-update-badge {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}
.last-update-badge.updated {
  color: var(--ok);
  border-color: rgba(15, 138, 95, 0.25);
  background: #f0fdf4;
}
.last-update-badge.loading {
  color: var(--warn);
  border-color: rgba(183, 121, 31, 0.25);
  background: #fffbeb;
}
.last-update-badge.offline {
  color: var(--danger);
  border-color: rgba(181, 18, 75, 0.25);
  background: #fff1f2;
}
.resource-loading-inline {
  margin: 4px 0 8px;
  padding: 8px 10px;
  border: 1px dashed rgba(37, 99, 235, 0.25);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  font-weight: 800;
}
.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
  background: #e9eef8;
  color: var(--text);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.secondary { background: #dce8ff; color: #124185; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: #ffe4e6; color: #9f1239; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 18px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.docs { line-height: 1.55; }
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
.form-grid.one-col { grid-template-columns: 1fr; }
.check-label {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  margin: 10px 0;
}
.check-label input { width: auto; }
.top-space { margin-top: 25px; }
.settings-actions { margin-top: 18px; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.form-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
label span { color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,0.13); }
textarea {
  min-height: 180px;
  resize: vertical;
  font-family: Consolas, Monaco, monospace;
  line-height: 1.5;
}
.sql-label { margin: 16px 0; }
.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  margin: 10px 0;
}
.check input, .tiny-check input { width: auto; }
.tiny-check {
  flex-direction: row;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 12px;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.dashboard-grid.empty-state { display: grid; grid-template-columns: 1fr; }
.dash-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dash-card header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.dash-card h3 { margin: 0; }
.dash-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.dash-body { padding: 18px; flex: 1; overflow: auto; }
.dash-card footer { padding: 0 18px 14px; color: var(--muted); font-size: 12px; }
.empty-state {
  min-height: 120px;
  border: 1px dashed #cdd7e6;
  border-radius: 16px;
  background: #f8fbff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
}
#visualFieldsEmpty,
#visualFilterEmpty {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
}
.error-box {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #9f1239;
  padding: 14px;
  border-radius: 14px;
}
.result-card { overflow: hidden; }
.table-wrap { overflow: auto; max-width: 100%; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 11px;
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  background: #f3f6fb;
  color: #43536b;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table tr:hover td { background: #f8fbff; }
.data-table tr.selected-row td { background: #e7f0ff; }
.compact-table .data-table th, .compact-table .data-table td { padding: 8px; }
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, .8fr);
  gap: 20px;
  align-items: start;
}
.schema-grid, .settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
.row-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 480px;
  overflow: auto;
  padding-right: 4px;
}
.row-form em {
  display: inline-block;
  color: var(--brand);
  font-style: normal;
  font-size: 10px;
  margin-left: 4px;
}
.column-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}
.column-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 75px 75px 70px auto auto auto 90px 34px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbff;
}
.column-row input, .column-row select { padding: 9px 10px; }
.mini-danger {
  border: 0;
  background: #fff1f2;
  color: #9f1239;
  border-radius: 10px;
  padding: 7px 9px;
  font-weight: 800;
}

.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 160px) 1fr auto; gap: 10px; align-items: center; }
.bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; background: #e8eef8; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #1f6feb, #55d6be); border-radius: 999px; }
.line-chart svg { width: 100%; height: auto; }
.line-chart .axis { stroke: #cbd5e1; stroke-width: 2; }
.line-chart .line { stroke: #1f6feb; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.line-chart circle { fill: #1f6feb; }
.chart-caption { color: var(--muted); text-align: center; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.metric-card { border: 1px solid var(--line); background: #f8fbff; border-radius: 16px; padding: 18px; }
.metric-card span { color: var(--muted); display: block; margin-bottom: 8px; }
.metric-card strong { font-size: 28px; letter-spacing: -0.04em; }
.lock-box {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: 16px;
  padding: 16px;
  color: #14532d;
  margin: 12px 0;
}
.lock-box p { margin: 6px 0 0; }
.status-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 14px;
  padding: 12px;
}
.info-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 14px;
  margin: 14px 0;
}
.info-list dt { color: var(--muted); font-weight: 800; }
.info-list dd { margin: 0; word-break: break-word; }
code {
  background: #eef2ff;
  color: #1e3a8a;
  padding: 2px 5px;
  border-radius: 6px;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 16px 40px rgba(15,23,42,.25);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  max-width: 520px;
  z-index: 50;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #9f1239; }
.toast.ok { background: #065f46; }

body.view-only .dash-card { min-height: 300px; }
body.view-only .sidebar { background: #10201b; }
body.view-only .nav-btn.active { background: #0f8a5f; }

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 260px 1fr; }
  .dashboard-grid, .split, .split-grid, .schema-grid, .settings-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .column-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 18px; }
  .page-head { flex-direction: column; }
  .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
  .actions { flex-wrap: wrap; }
  h2 { font-size: 28px; }
}

.connection-panel .panel-head { margin-bottom: 16px; }
.connection-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.guide-card {
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 16px;
  padding: 14px;
}
.guide-card strong { display: block; margin-bottom: 8px; color: var(--text); }
.guide-card p { margin: 7px 0; }
code {
  background: #eef4ff;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  padding: 2px 6px;
  color: #123d7a;
}
@media (max-width: 1100px) {
  .connection-guide { grid-template-columns: 1fr; }
}

/* Settings internal tabs */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.settings-tab-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.settings-tab-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.online-panel {
  border-color: #bfdbfe;
}
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }

.notice-inline {
  grid-column: 1 / -1;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.resource-list {
  gap: 8px;
}
.resource-group-title {
  margin: 10px 0 4px;
  color: #9fb0c9;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.resource-group-title:first-child {
  margin-top: 0;
}


.model-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}
.column-picker {
  max-height: 360px;
  overflow: auto;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 12px;
  margin: 14px 0;
  background: #fbfdff;
}
.model-check {
  padding: 8px 10px;
  border-radius: 12px;
  margin: 4px 0;
}
.model-check:hover { background: #eef5ff; }
.model-check em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  margin-left: 6px;
}
.model-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow: auto;
}
.model-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 14px;
  padding: 10px 12px;
}
.model-item small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.model-item input {
  max-width: 180px;
  padding: 8px 10px;
}
@media (max-width: 1100px) {
  .model-grid { grid-template-columns: 1fr; }
}

/* Measure cards (Medidas Criadas) */
.model-measure-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.model-measure-cards.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: #94a3b8;
  font-size: 13px;
}
.model-measure-card {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #8b5cf6;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.model-measure-card:hover {
  box-shadow: 0 2px 8px rgba(139,92,246,0.1);
  border-color: #c4b5fd;
}
.model-measure-card.selected {
  border-color: #8b5cf6;
  background: #f5f3ff;
}
.model-measure-card .measure-card-name {
  font-weight: 600;
  font-size: 13px;
  color: #1e293b;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-measure-card .measure-card-status {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
}
.model-measure-card .measure-card-status.warn {
  background: #fef3c7;
  color: #92400e;
}
.model-measure-card .measure-card-status.ok {
  background: #dcfce7;
  color: #166534;
}

/* Formula display panel */
.measure-formula-display {
  padding: 12px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow: auto;
  min-height: 60px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  word-break: break-word;
}
.measure-formula-display.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
  font-family: inherit;
}


.builder-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
.fields-panel { position: sticky; top: 24px; }
.field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  margin-top: 12px;
  padding-right: 4px;
}
.field-chip {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fbff;
  padding: 10px 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.field-chip:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,0.10); }
.field-chip small { color: var(--muted); font-size: 11px; }
.filter-row {
  display: grid;
  grid-template-columns: 1fr 170px 1fr;
  gap: 14px;
  margin: 14px 0;
}
.advanced-sql-panel summary {
  cursor: pointer;
  color: var(--text);
  margin-bottom: 12px;
}
@media (max-width: 1100px) {
  .builder-layout { grid-template-columns: 1fr; }
  .fields-panel { position: static; }
  .filter-row { grid-template-columns: 1fr; }
}

/* Power BI-like report builder */
.powerbi-shell {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 280px 310px;
  gap: 14px;
  align-items: stretch;
  min-height: calc(100vh - 64px);
}
.report-canvas-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  align-items: stretch;
  position: relative;
}
.powerbi-head {
  margin-bottom: 14px;
}
.report-page-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 160px 150px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.report-canvas {
  background: #dbe2ee;
  border: 1px solid #cdd7e8;
  border-radius: 16px;
  padding: 22px;
  min-height: 520px;
  overflow: hidden;
}
.report-page {
  background: #fff;
  border: 1px dotted #1e293b;
  min-height: 460px;
  padding: 28px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, .08);
}
.visual-frame {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 360px;
  padding: 16px;
}
.visual-frame-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.powerbi-side-panel {
  background: #f8fafc;
  border-left: 1px solid #d8e1ef;
  border-radius: 14px;
  padding: 14px;
  min-height: calc(100vh - 96px);
  overflow: auto;
  position: sticky;
  top: 22px;
}

/* Ensure side panels use flex column for proper child alignment */
.visualizations-pane,
.data-pane {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pane-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #d8e1ef;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.pane-title h3 { font-size: 16px; }
.mini-label {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.visual-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.visual-icon {
  border: 1px solid #cdd7e8;
  border-radius: 10px;
  background: #fff;
  min-height: 42px;
  font-weight: 900;
  color: #24415f;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.visual-icon span {
  font-size: 14px;
}
.visual-icon[data-viz="table"] span { color: #e8a020; }
.visual-icon[data-viz="matrix"] span { color: #1e8e5c; }
.visual-icon[data-viz="bar"] span,
.visual-icon[data-viz="column"] span { color: #2563eb; }
.visual-icon[data-viz="stackedbar"] span,
.visual-icon[data-viz="stackedcolumn"] span { color: #0d9488; }
.visual-icon[data-viz="line"] span { color: #1e40af; }
.visual-icon[data-viz="area"] span { color: #3b82f6; }
.visual-icon[data-viz="pie"] span,
.visual-icon[data-viz="donut"] span { color: #7c3aed; }
.visual-icon[data-viz="scatter"] span { color: #db2777; }
.visual-icon[data-viz="funnel"] span { color: #0891b2; }
.visual-icon[data-viz="gauge"] span { color: #dc2626; }
.visual-icon[data-viz="card"] span { color: #0f766e; }
.visual-icon[data-viz="kpi"] span { color: #16a34a; }
.visual-icon[data-viz="map"] span { color: #0891b2; }
.visual-icon[data-viz="slicer"] span { color: #ea580c; }
.visual-icon[data-viz="textbox"] span { color: #64748b; }
.visual-icon[data-viz="image"] span { color: #9333ea; }
.visual-icon.active span { filter: brightness(0.85); }
.visual-icon.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31,111,235,.12);
  background: #eaf2ff;
}
.field-bucket {
  border-top: 1px solid #d8e1ef;
  padding-top: 12px;
  margin-top: 12px;
}
.field-bucket:first-of-type,
.field-bucket.visual-format-pane,
.field-bucket.visual-analytics-pane {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.field-bucket h4 {
  margin: 0 0 10px;
  font-size: 14px;
}
.field-bucket label,
.source-selector {
  margin-bottom: 10px;
}
.search-input {
  margin-bottom: 12px;
}
.powerbi-field-list {
  max-height: 560px;
}
.field-table-title {
  width: 100%;
  border: 0;
  background: #e9eef8;
  color: #122033;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 900;
  margin: 8px 0 6px;
}
.field-row {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 8px 8px;
  background: transparent;
  text-align: left;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #24364b;
}
.field-row:hover { background: #eef5ff; }
.field-row input { width: auto; }
.field-row small { margin-left: auto; color: var(--muted); font-size: 11px; }
.full-width { width: 100%; justify-content: center; }
@media (max-width: 1280px) {
  .powerbi-shell { grid-template-columns: 1fr; }
  .powerbi-side-panel { position: static; min-height: auto; }
  .report-page-toolbar { grid-template-columns: 1fr 1fr; }
}


/* v2.8.1 - layout compacto e responsivo */
:root {
  --shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  --radius: 14px;
}
body { font-size: 14px; }
.app-shell { grid-template-columns: 276px minmax(0, 1fr); }
.sidebar { padding: 18px 14px; gap: 14px; }
.brand { gap: 10px; }
.brand-logo { width: 58px; height: 58px; border-radius: 14px; }
.brand h1 { font-size: 20px; }
.brand-subtitle { font-size: 11px; line-height: 1.15; }
.brand p { font-size: 12px; }
.nav { gap: 5px; }
.nav-btn { padding: 10px 12px; border-radius: 12px; }
.side-section { padding-top: 12px; }
.list { gap: 5px; }
.list-item { padding: 9px 10px; border-radius: 10px; }
.main { padding: 20px 24px; }
.page-head { margin-bottom: 14px; gap: 12px; }
.eyebrow { font-size: 11px; margin-bottom: 4px; }
h2 { font-size: 28px; }
h3 { font-size: 16px; }
h4 { font-size: 13px; }
.sub { margin-top: 5px; }
.btn { border-radius: 10px; padding: 9px 13px; }
.card, .panel { padding: 14px; border-radius: 14px; }
.form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.form-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
input, select, textarea { border-radius: 10px; padding: 9px 10px; }
label { gap: 5px; font-size: 12px; }
textarea { min-height: 130px; }
.settings-tabs { gap: 6px; margin-bottom: 10px; }
.settings-tab-btn { padding: 9px 12px; border-radius: 10px; }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-panel .panel, .settings-panel .card { padding: 13px; }
.settings-panel .docs { font-size: 13px; line-height: 1.42; }
.settings-actions { margin-top: 12px; }

.powerbi-shell {
  grid-template-columns: minmax(460px, 1fr) 258px 285px;
  gap: 10px;
  min-height: calc(100vh - 40px);
  overflow: hidden;
}
.powerbi-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: start;
  margin-bottom: 10px;
}
.powerbi-head .actions { flex-direction: column; align-items: stretch; gap: 8px; }
.powerbi-head .actions .btn { width: 156px; }
.report-page-toolbar {
  grid-template-columns: minmax(160px, 1fr) 150px 140px auto;
  gap: 9px;
  margin-bottom: 10px;
}
.report-canvas { min-height: 430px; padding: 14px; border-radius: 12px; }
.report-page { min-height: 390px; padding: 18px; }
.visual-frame { min-height: 300px; padding: 12px; }
.powerbi-side-panel { padding: 10px; border-radius: 12px; min-height: calc(100vh - 58px); top: 12px; }
.pane-title { padding-bottom: 8px; margin-bottom: 8px; }
.pane-title h3 { font-size: 15px; }
.visual-icon-grid.powerbi-icons { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.visual-icon { min-height: 48px; padding: 5px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.visual-icon span { font-size: 16px; line-height: 1; }
.visual-icon small { display: block; font-size: 9px; line-height: 1; font-weight: 800; color: #51657e; }
.field-bucket { margin-top: 9px; padding-top: 9px; }
.field-bucket label, .source-selector { margin-bottom: 8px; }
.mini-help { margin: -4px 0 8px; color: var(--muted); font-size: 11px; }
.powerbi-field-list { max-height: calc(100vh - 315px); overflow: auto; }
.field-table-title { padding: 8px 10px; }
.field-row { padding: 6px; font-size: 12px; }
.page-tabs { display: flex; gap: 4px; align-items: center; margin: 8px 0 12px; flex-shrink: 0; }
.page-tab, .page-add { border: 1px solid var(--line); background: #fff; padding: 8px 14px; font-weight: 800; }
.page-tab.active { border-bottom: 3px solid var(--brand); }
.page-add { background: var(--brand); color: #fff; }
.advanced-sql-panel { margin-top: 10px; }

.pie-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: center; }
.pie-chart { width: 220px; height: 220px; }
.pie-slice, .pie-legend i, .scatter-dot { fill: #1f6feb; }
.slice-0 { fill: #1f6feb; background: #1f6feb; } .slice-1 { fill: #0f8a5f; background: #0f8a5f; } .slice-2 { fill: #b7791f; background: #b7791f; } .slice-3 { fill: #d33f49; background: #d33f49; } .slice-4 { fill: #7c3aed; background: #7c3aed; } .slice-5 { fill: #0891b2; background: #0891b2; } .slice-6 { fill: #ea580c; background: #ea580c; } .slice-7 { fill: #4f46e5; background: #4f46e5; } .slice-8 { fill: #16a34a; background: #16a34a; } .slice-9 { fill: #be123c; background: #be123c; }
.donut-hole { fill: #fff; }
.pie-legend { display: grid; gap: 6px; font-size: 12px; }
.pie-legend span { display: flex; align-items: center; gap: 8px; }
.pie-legend i { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.gauge-wrap { display: grid; place-items: center; min-height: 220px; }
.gauge { width: 230px; height: 120px; border-radius: 230px 230px 0 0; background: #e7edf7; position: relative; overflow: hidden; }
.gauge-fill { position: absolute; inset: 0; background: conic-gradient(from 270deg, var(--brand) calc(var(--pct) * 1.8), transparent 0); }
.gauge-center { position: absolute; left: 35px; right: 35px; bottom: 0; height: 82px; border-radius: 160px 160px 0 0; background: #fff; display: grid; place-items: center; align-content: center; }
.gauge-center strong { font-size: 26px; } .gauge-center span { color: var(--muted); font-size: 12px; }
.kpi-card { min-height: 220px; display: grid; place-items: center; align-content: center; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg,#fff,#edf5ff); }
.kpi-card span { color: var(--muted); font-weight: 800; } .kpi-card strong { font-size: 42px; } .kpi-card small { color: var(--ok); font-weight: 900; }
.slicer-box { display: grid; gap: 8px; max-width: 360px; }
.slicer-box .check { border: 1px solid var(--line); padding: 8px 10px; border-radius: 10px; }

@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 238px minmax(0, 1fr); }
  .sidebar { padding: 14px 12px; }
  .brand-logo { width: 48px; height: 48px; }
  .powerbi-shell { grid-template-columns: minmax(420px, 1fr) 235px 255px; }
  .report-page-toolbar { grid-template-columns: 1fr 120px 120px; }
  #downloadQueryCsvBtn { grid-column: span 3; }
  .visual-icon-grid.powerbi-icons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 14px; }
  .powerbi-shell { grid-template-columns: 1fr; }
  .powerbi-side-panel { position: static; min-height: auto; max-height: none; }
  .powerbi-field-list { max-height: 340px; }
  .settings-grid, .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
  .report-page-toolbar { grid-template-columns: 1fr; }
  #downloadQueryCsvBtn { grid-column: auto; }
}


/* v2.8.2 - regras Power BI para edição de dashboard/canvas */
.sidebar-collapse-btn {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #dbeafe;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
  text-align: left;
}
body.sidebar-collapsed .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { padding: 14px 8px; align-items: stretch; }
body.sidebar-collapsed .brand { justify-content: center; }
body.sidebar-collapsed .brand > div,
body.sidebar-collapsed .nav-btn,
body.sidebar-collapsed .side-section,
body.sidebar-collapsed .sidebar-collapse-btn { font-size: 0; }
body.sidebar-collapsed .brand-logo { width: 46px; height: 46px; }
body.sidebar-collapsed .sidebar-collapse-btn::before { content: '☰'; font-size: 18px; }
body.sidebar-collapsed .nav-btn::first-letter { font-size: 16px; }

.pane-collapse-btn {
  border: 0;
  background: #e9eef8;
  color: #122033;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-weight: 900;
  display: grid;
  place-items: center;
}
.powerbi-shell.visuals-collapsed { grid-template-columns: minmax(460px, 1fr) 52px 285px; }
.powerbi-shell.data-collapsed { grid-template-columns: minmax(460px, 1fr) 258px 52px; }
.powerbi-shell.visuals-collapsed.data-collapsed { grid-template-columns: minmax(460px, 1fr) 52px 52px; }
.powerbi-side-panel.collapsed { 
  padding: 8px; 
  overflow: hidden; 
  display: flex;
  flex-direction: column;
}
.powerbi-side-panel.collapsed .pane-title { writing-mode: vertical-rl; border-bottom: 0; margin: 0; padding: 0; height: calc(100vh - 90px); justify-content: flex-start; flex: 1 1 auto; }
.powerbi-side-panel.collapsed .pane-title h3 { font-size: 13px; white-space: nowrap; }
.powerbi-side-panel.collapsed > *:not(.pane-title) { display: none !important; }

.report-canvas {
  flex: 1;
  min-height: 0;
  height: auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}
.report-page {
  width: 1280px;
  height: 720px;
  min-height: 720px;
  padding: 0;
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(#f7f9fd 1px, transparent 1px), linear-gradient(90deg, #f7f9fd 1px, transparent 1px);
  background-size: 16px 16px;
}
.visual-frame {
  position: absolute;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}
.visual-frame.selected,
.visual-frame:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.visual-frame.dragging,
.visual-frame.resizing { opacity: .92; user-select: none; }
.visual-frame-head {
  cursor: move;
  flex: 0 0 auto;
  padding: 10px 12px 8px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.visual-content,
.visual-frame .result {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}
.visual-content.visual-content-updating {
  position: relative;
}
.visual-loading-badge {
  position: absolute;
  z-index: 30;
  top: 8px;
  right: 8px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, .2);
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .12);
  pointer-events: none;
}
.visual-loading-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(37, 99, 235, .22);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: visual-loading-spin .7s linear infinite;
}
@keyframes visual-loading-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .visual-loading-spinner { animation-duration: 1.5s; }
}
.visual-frame .table-wrap { max-height: none; height: 100%; overflow: auto; }
.visual-resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  right: 3px;
  bottom: 3px;
  border: 0;
  background: linear-gradient(135deg, transparent 0 45%, #64748b 45% 55%, transparent 55%), linear-gradient(135deg, transparent 0 65%, #64748b 65% 75%, transparent 75%);
  cursor: nwse-resize;
}
.field-row[draggable="true"] { cursor: grab; }
.field-row[draggable="true"]:active { cursor: grabbing; }

@media (max-width: 1280px) {
  .powerbi-shell.visuals-collapsed { grid-template-columns: minmax(420px, 1fr) 52px 255px; }
  .powerbi-shell.data-collapsed { grid-template-columns: minmax(420px, 1fr) 235px 52px; }
}
@media (max-width: 1080px) {
  body.sidebar-collapsed .app-shell { grid-template-columns: 1fr; }
  .powerbi-shell.visuals-collapsed,
  .powerbi-shell.data-collapsed,
  .powerbi-shell.visuals-collapsed.data-collapsed { grid-template-columns: 1fr; }
  .powerbi-side-panel.collapsed .pane-title { writing-mode: horizontal-tb; height: auto; }
}


/* v2.8.3 - correção de SQL com espaços/acentos e painel Dados compacto */
.powerbi-field-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 3px;
}
.field-table-title {
  min-height: 34px;
  padding: 7px 9px;
  margin: 5px 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.field-row {
  min-height: 30px;
  padding: 4px 6px;
  gap: 6px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  text-align: left;
}
.field-row input {
  margin: 0;
  width: 14px;
  height: 14px;
}
.field-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-row small {
  margin-left: 0;
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font-size: 10px;
}
.other-data-sources h4 {
  margin: 8px 0 4px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.other-data-sources .field-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.source-selector select,
.field-bucket select,
.field-bucket input {
  min-height: 36px;
}
.visual-frame .table-wrap table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}
.visual-frame .table-wrap th,
.visual-frame .table-wrap td {
  white-space: nowrap;
  padding: 7px 9px;
}

.error-state { border-color: #fecdd3 !important; background: #fff1f2 !important; color: #9f1239 !important; }

/* v2.8.5 - Tela Conexões estilo Power BI */
.connections-layout {
  display: grid;
  grid-template-columns: 300px minmax(420px, 1fr) 340px;
  gap: 12px;
  align-items: start;
}
.connections-panel,
.connections-canvas-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  min-height: 520px;
  overflow: hidden;
}
.compact-head { margin-bottom: 10px; }
.connection-actions-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.connection-resource-list { max-height: calc(100vh - 245px); overflow: auto; display: grid; gap: 5px; }
.connection-resource-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 8px;
  background: #f8fbff;
  color: var(--text);
  font-size: 12px;
}
.connection-resource-row:hover { border-color: #bfd2ef; background: #eef5ff; }
.connection-resource-row input { width: auto; }
.connection-resource-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.connection-resource-row small { color: var(--muted); font-size: 10px; }
.connection-diagram { min-height: 470px; border: 1px dashed #c8d7ec; border-radius: 14px; padding: 14px; background: repeating-linear-gradient(0deg, #fff 0 23px, #f4f8ff 24px), repeating-linear-gradient(90deg, transparent 0 23px, rgba(31,111,235,.06) 24px); overflow: auto; }
.diagram-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-items: start; }
.diagram-table-card { background: #fff; border: 1px solid #dde5f0; border-left: 4px solid #1f6feb; border-radius: 10px; box-shadow: 0 2px 8px rgba(15,23,42,.05), 0 0 0 1px rgba(15,23,42,.02); overflow: hidden; transition: box-shadow .18s ease, border-color .18s ease; }
.diagram-table-card:hover { box-shadow: 0 6px 20px rgba(15,23,42,.09), 0 0 0 1px rgba(31,111,235,.08); }
.diagram-table-card.card-accent-table { border-left-color: #0f8a5f; }
.diagram-table-card.card-accent-view { border-left-color: #b7791f; }
.diagram-table-card.card-accent-calendar { border-left-color: #6366f1; }
.diagram-table-card.card-accent-transform { border-left-color: #8b5cf6; }
.diagram-table-head { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%); border-bottom: 1px solid #dde5f0; cursor: move; user-select: none; }
.diagram-table-head .card-type-letter { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0; background: #1f6feb; }
.diagram-table-head .card-type-letter.letter-table { background: #0f8a5f; }
.diagram-table-head .card-type-letter.letter-view { background: #b7791f; }
.diagram-table-head .card-type-letter.letter-calendar { background: #6366f1; }
.diagram-table-head .card-type-letter.letter-transform { background: #8b5cf6; }
.diagram-table-head .card-title-area { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.diagram-table-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: #122033; }
.diagram-table-head .card-subtitle { font-size: 9px; color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .4px; }
.diagram-table-head .card-rel-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 99px; background: #eef5ff; color: #1f6feb; border: 1px solid #d0e2f8; white-space: nowrap; flex-shrink: 0; }
.diagram-table-body { padding: 10px; color: var(--muted); font-size: 12px; min-height: 58px; }
.diagram-relationships { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 7px; }
.relationship-line { border: 1px solid #d8e4f5; background: #fbfdff; border-radius: 10px; padding: 8px 10px; font-size: 12px; }
.relationship-line small { display: block; margin-top: 3px; color: var(--muted); }
.connection-form-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.relationship-builder-panel .full-width { margin: 10px 0; }
.edit-rel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  border-bottom: 1px solid #e3eaf3;
  margin-bottom: 10px;
}
.edit-rel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  width: 100%;
}
.edit-rel-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.edit-rel-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.edit-rel-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.edit-rel-arrow {
  text-align: center;
  font-size: 16px;
  color: #1f6feb;
  font-weight: 700;
  margin: -2px 0;
}
.edit-rel-row select {
  width: 100%;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 6px;
}
.edit-rel-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.edit-rel-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e3eaf3;
}
.edit-rel-actions .btn {
  width: 100%;
  font-size: 13px;
  padding: 7px 12px;
  justify-content: center;
}
.edit-rel-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.edit-rel-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #1f6feb;
}
.small-note { font-size: 12px; }
@media (max-width: 1320px) {
  .connections-layout { grid-template-columns: 260px minmax(360px, 1fr) 300px; }
}
@media (max-width: 1080px) {
  .connections-layout { grid-template-columns: 1fr; }
  .connections-panel, .connections-canvas-panel { min-height: auto; }
  .connection-resource-list { max-height: 320px; }
}


/* v2.8.7 - Conexões compactas estilo Power BI */
.connections-layout {
  grid-template-columns: minmax(220px, 280px) minmax(520px, 1fr) minmax(260px, 320px);
  gap: 10px;
}
.connections-panel,
.connections-canvas-panel {
  padding: 12px;
  min-height: 0;
  overflow: hidden;
}
.connection-resource-list { max-height: calc(100vh - 285px); gap: 4px; }
.connection-resource-row { padding: 6px 7px; min-height: 32px; cursor: grab; }
.connection-resource-row.native-row {
  background: #eef7ff;
  border-color: #9cc9ff;
  box-shadow: inset 3px 0 0 #1f6feb;
}
.connection-resource-row:active { cursor: grabbing; }
.connection-diagram {
  height: calc(100vh - 228px);
  min-height: 520px;
  padding: 10px;
  position: relative;
}
.connection-drop-zone { outline: 1px dashed rgba(31,111,235,.2); }
.diagram-toolbar-inline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  background: rgba(255,255,255,.92);
  border: 1px solid #d9e5f6;
  border-radius: 10px;
  padding: 7px 9px;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  backdrop-filter: blur(6px);
  width: 100%;
}
.zoom-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  border-radius: 6px;
}
.zoom-label {
  font-weight: 700;
  color: var(--text);
  min-width: 36px;
  text-align: center;
  display: inline-block;
}
.diagram-card-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
}
.powerbi-model-card {
  min-width: 0;
  max-height: 330px;
  display: flex;
  flex-direction: column;
}
.powerbi-model-card.selected {
  outline: 2px solid #1f6feb;
  box-shadow: 0 0 0 4px rgba(31,111,235,.15);
}
.diagram-table-head { padding: 8px 9px; }
.diagram-table-columns {
  padding: 6px;
  overflow: auto;
  display: grid;
  gap: 3px;
}
.diagram-column-row {
  display: grid;
  grid-template-columns: 10px minmax(0,1fr) auto;
  gap: 6px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 6px;
  background: #fbfdff;
  font-size: 12px;
  cursor: grab;
}
.diagram-column-row:hover { border-color: #bfd2ef; background: #eef5ff; }
.diagram-column-row.dragging-column { opacity: .55; }
.diagram-column-row.drop-target-column { border-color: #1f6feb; background: #dcecff; }
.diagram-column-row .col-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1f6feb;
  opacity: .8;
}
.diagram-column-row .col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.diagram-column-row small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.compact-relationships { margin-top: 10px; padding-top: 10px; max-height: 190px; overflow: auto; }
.relationship-line { position: relative; padding-right: 42px; }
.icon-btn.mini { width: 24px; height: 24px; border-radius: 7px; position: absolute; right: 7px; top: 7px; }
@media (max-width: 1280px) {
  .connections-layout { grid-template-columns: 240px minmax(480px, 1fr); }
  .relationship-builder-panel { grid-column: 1 / -1; min-height: auto; }
  .connection-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .connections-layout { grid-template-columns: 1fr; }
  .connection-form-grid { grid-template-columns: 1fr; }
  .connection-diagram { min-height: 420px; height: auto; }
}


.dash-card-actions { display: flex; gap: 8px; align-items: center; }
.mini-filter-btn { padding: 8px 10px; border-radius: 10px; font-size: 12px; }
.dashboard-filter-panel { margin: 10px 0 14px; border: 1px solid var(--line); background: #f8fbff; border-radius: 14px; padding: 12px; }
.dashboard-filter-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.dashboard-filter-head small { color: var(--muted); }
.dashboard-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.compact-actions { margin-top: 10px; }
.online-filter-config { border-top: 1px solid var(--line); padding-top: 12px; }
.online-filter-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; max-height: 160px; overflow: auto; }
.online-filter-list.small { font-size: 12px; padding: 10px; }
.online-filter-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; }
.online-filter-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.icon-btn.mini { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }


/* v2.9.0 - Campos removiveis no criador visual */
.field-select-with-clear {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
}
.field-select-with-clear select { min-width: 0; }
.clear-field-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #d8e1ef;
  border-radius: 10px;
  background: #fff;
  color: #9f1239;
  font-weight: 900;
  line-height: 1;
}
.clear-field-btn:hover {
  background: #ffe4e6;
  border-color: #fecdd3;
}


.visual-tools-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.add-visual-btn { padding: 6px 8px; font-size: 11px; border-radius: 8px; }
.report-page { position: relative; width: 1280px; height: 720px; min-height: 720px; overflow: hidden; }
.visual-frame { position: absolute; overflow: hidden; }
.visual-frame .visual-content { height: calc(100% - 42px); overflow: auto; }
.visual-frame-head { cursor: move; }
.visual-remove-btn { margin-left: auto; width: 26px; height: 26px; border: 0; border-radius: 8px; background: #fee2e2; color: #991b1b; font-weight: 900; cursor: pointer; }
.visual-frame.selected { outline: 2px solid var(--brand); outline-offset: 0; }
.visual-icon[draggable="true"] { cursor: grab; }
.dashboard-report-page { position: relative; width: 1280px; height: 720px; transform-origin: top left; overflow: auto; background: #f8fbff; border: 1px solid var(--line); border-radius: 12px; }
.dashboard-visual-box { position: absolute; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px; overflow: hidden; }
.dashboard-visual-box > b { display: block; margin-bottom: 6px; }
.dashboard-visual-body { height: calc(100% - 28px); overflow: auto; }

/* v2.9.2 - popup de filtros online */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}
.modal.hidden { display: none !important; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}
.modal-backdrop[hidden] { display: none !important; }
.modal-card {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.24);
  padding: 20px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.online-filter-modal-card { width: min(1080px, calc(100vw - 36px)); }
.filter-popup-designer-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 330px;
  gap: 16px;
  align-items: start;
}
.filter-popup-canvas {
  min-height: 360px;
  border: 1px dashed #bcd0ea;
  border-radius: 18px;
  background: #fbfdff;
  padding: 16px;
}
.filter-popup-canvas.drag-over {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 3px rgba(31,111,235,0.12);
}
.filter-popup-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.filter-popup-form {
  display: grid;
  gap: 12px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.online-filter-summary { margin-top: 10px; }
.online-filter-list { display: grid; gap: 9px; }
.online-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
}
.online-filter-item small { display: block; color: var(--muted); margin-top: 3px; }
.dashboard-filter-runtime-card { width: min(760px, calc(100vw - 36px)); }
.popup-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.filter-between-row, .filter-value-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 900px) {
  .filter-popup-designer-layout, .popup-filter-grid { grid-template-columns: 1fr; }
  .filter-popup-form { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
}

/* v2.9.4 - Filtros popup redimensionaveis e funcionais */
.filter-popup-visual-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: none;
  overflow: visible;
}
.filter-popup-visual-item {
  position: relative;
  min-width: 240px;
  min-height: 76px;
  max-width: 100%;
  resize: both;
  overflow: auto;
  align-items: stretch;
  padding: 8px;
}
.filter-popup-visual-body { width: 100%; min-width: 0; }
.filter-visual-preview {
  width: 100%;
  height: 100%;
  min-height: 64px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}
.filter-visual-title { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.filter-visual-title small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-option-list {
  max-height: 170px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
}
.filter-check-option {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  color: var(--text);
}
.filter-check-option input { width: auto; }
.dashboard-filter-runtime-card .popup-filter-grid label {
  min-width: 0;
}
.dashboard-filter-runtime-card select,
.dashboard-filter-runtime-card input {
  min-width: 0;
}


/* v2.9.5 - Relatórios/Dashboards compacto sem rolagem geral, estilo Power BI */
body.report-editor-active {
  overflow: hidden;
}
body.report-editor-active .app-shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}
body.report-editor-active .sidebar {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}
body.report-editor-active .main {
  height: 100vh;
  overflow: hidden;
  padding: 12px 14px;
}
body.report-editor-active #sqlTab {
  height: 100%;
  overflow: hidden;
}
body.report-editor-active .powerbi-shell {
  height: calc(100vh - 24px);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 250px 286px;
  gap: 8px;
  align-items: stretch;
  overflow: hidden;
}
body.report-editor-active .report-canvas-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.report-editor-active .powerbi-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0,1fr) 156px;
  gap: 8px;
  margin: 0 0 6px;
}
body.report-editor-active .powerbi-head h2 {
  font-size: 24px;
  line-height: 1.05;
}
body.report-editor-active .powerbi-head .sub {
  font-size: 12px;
  line-height: 1.25;
  max-width: 520px;
}
body.report-editor-active .powerbi-head .actions {
  gap: 6px;
}
body.report-editor-active .powerbi-head .actions .btn {
  width: 150px;
  padding: 8px 10px;
}
body.report-editor-active .report-page-toolbar {
  flex: 0 0 auto;
  grid-template-columns: minmax(150px, 1fr) 140px 130px 104px;
  gap: 7px;
  margin: 0 0 6px;
}
body.report-editor-active .report-page-toolbar label {
  font-size: 11px;
}
body.report-editor-active .report-page-toolbar input {
  padding: 8px 9px;
}
body.report-editor-active .report-canvas {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  padding: 8px;
  border-radius: 10px;
  overflow: hidden;
}
body.report-editor-active .report-page {
  width: 1280px;
  height: 720px;
  min-height: 720px;
  overflow: hidden;
}
body.report-editor-active .advanced-sql-panel,
body.report-editor-active .page-tabs {
  flex: 0 0 auto;
  margin-top: 6px;
}
body.report-editor-active .powerbi-side-panel {
  position: static;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 9px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
body.report-editor-active .pane-title {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafc;
  padding-bottom: 7px;
  margin-bottom: 7px;
}
body.report-editor-active .visual-icon-grid.powerbi-icons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
body.report-editor-active .visual-icon {
  min-height: 43px;
  padding: 4px 2px;
}
body.report-editor-active .visual-icon small {
  font-size: 8.5px;
}
body.report-editor-active .field-bucket {
  margin-top: 7px;
  padding-top: 7px;
}
body.report-editor-active .field-bucket h4 {
  margin-bottom: 5px;
}
body.report-editor-active .field-bucket label,
body.report-editor-active .source-selector {
  margin-bottom: 6px;
}
body.report-editor-active .powerbi-field-list {
  max-height: none;
  overflow: visible;
}
body.report-editor-active .field-row {
  padding: 5px 6px;
}
body.report-editor-active .search-input {
  margin-bottom: 8px;
}
body.report-editor-active .powerbi-shell.visuals-collapsed { grid-template-columns: minmax(520px, 1fr) 48px 286px; }
body.report-editor-active .powerbi-shell.data-collapsed { grid-template-columns: minmax(520px, 1fr) 250px 48px; }
body.report-editor-active .powerbi-shell.visuals-collapsed.data-collapsed { grid-template-columns: minmax(520px, 1fr) 48px 48px; }
body.report-editor-active .powerbi-side-panel.collapsed .pane-title {
  height: calc(100vh - 40px);
  flex: 1 1 auto;
}
@media (max-width: 1180px) {
  body.report-editor-active .powerbi-shell {
    grid-template-columns: 1fr;
  }
  body.report-editor-active .powerbi-side-panel {
    max-height: 360px;
  }
}


/* v2.9.9 - Transformar Dados: etapas aplicadas e prévia por etapa */
.transform-shell { height: calc(100vh - 28px); display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.transform-topbar { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding-bottom: 6px; }
.transform-topbar h2 { font-size: 26px; margin-bottom: 2px; }
.transform-topbar .sub { margin-top: 3px; font-size: 13px; }
.transform-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(420px, 1fr) 300px; gap: 10px; overflow: hidden; }
.compact-panel { padding: 12px; overflow: auto; min-height: 0; }
.transform-left, .transform-right { max-height: 100%; }
.transform-center { max-height: 100%; display: flex; flex-direction: column; }
.transform-center .panel-head { margin-bottom: 6px; padding-bottom: 6px; }
.transform-preview { flex: 1; min-height: 0; overflow: auto; max-height: 100%; }
.actions.stack { display: grid; gap: 6px; }
.steps-list { display: grid; gap: 6px; }
.step-item { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbff; }
.step-title { border: 0; background: transparent; text-align: left; font-weight: 800; color: var(--text); cursor: pointer; }
.transform-sql-details textarea { min-height: 120px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.transform-modal-card { width: min(720px, 94vw); }
.format-history-modal-card { width: min(640px, 94vw); }
.format-history-body { max-height: 55vh; overflow-y: auto; }
.format-history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.format-history-table thead { position: sticky; top: 0; z-index: 1; }
.format-history-table th { background: #f0f4ff; padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); border-bottom: 2px solid var(--line); }
.format-history-table tbody tr { border-bottom: 1px solid var(--line); }
.format-history-table tbody tr:hover td { background: #f8faff; }
.format-history-table td { padding: 8px 10px; vertical-align: middle; }
.format-history-table .hist-col { font-weight: 700; font-size: 13px; }
.format-history-table .hist-type { font-size: 11px; color: var(--muted); }
.format-history-table .hist-format { font-family: monospace; font-size: 11px; color: var(--brand); background: #eef5ff; padding: 2px 8px; border-radius: 4px; }
.format-history-table .hist-format:empty::after { content: '—'; color: var(--muted); }
.format-panel-head-actions { display: flex; align-items: center; gap: 6px; }
.format-panel-head-actions .btn.ghost { padding: 2px 8px; font-size: 11px; font-weight: 600; }
.filter-imported-modal-card { width: min(640px, 94vw); }
.transform-column-checks { max-height: 360px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.transform-step-form { display: grid; gap: 10px; }
.filter-values-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; }
.filter-value-item { font-size: 12px; padding: 3px 8px; border-radius: 4px; margin: 0; border-bottom: 1px solid #f0f4fb; }
.filter-value-item:last-child { border-bottom: none; }
.filter-value-item:hover { background: #edf2fe; }
.transform-values-label { font-weight: 600; font-size: 12px; }
.filter-values-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.filter-values-search { width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; margin-bottom: 4px; background: #fff; }
.filter-values-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12); }
#transformApplyToTableLabel { background: #eef5ff; border: 1px solid #bcd0ea; border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: 13px; }
.filter-preview-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #eef5ff; border: 1px solid #bcd0ea; border-radius: 8px; font-size: 12px; color: #174ea6; margin-bottom: 8px; cursor: pointer; }
.filter-preview-bar b { font-size: 12px; }
.filter-active-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; background: #eef5ff; border: 1px solid #bcd0ea; border-radius: 8px; font-size: 13px; color: #174ea6; }
.filter-active-bar b { font-size: 13px; }
@media (max-width: 1100px) { .transform-layout { grid-template-columns: 1fr; overflow: auto; } .transform-shell { height: auto; overflow: visible; } }


/* v2.9.9 - Power Query: etapas aplicadas e prévia por etapa (compacto) */
.step-compact { display: flex; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; cursor: pointer; transition: all 0.15s ease; }
.step-compact.selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31,111,235,.12); background: #eef5ff; }
.step-compact:hover { border-color: #8bb3f0; background: #f0f7ff; }
.step-compact-label { flex: 1; font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.step-compact-label b { font-size: 12px; }
.step-compact-icon { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; }
.step-compact-btn { font-size: 10px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.step-compact-btn:hover { background: #eef4ff; }
.step-compact-btn.danger { color: #d00; border-color: #fcc; }
.step-compact-btn.danger:hover { background: #fff0f0; }
.step-compact-section { font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 8px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.mini-step-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; min-width: 26px; height: 28px; font-weight: 900; color: var(--text); }
.mini-step-btn:hover { border-color: var(--brand); color: var(--brand); }
.mini-step-btn.danger { color: #9f1239; background: #fff1f2; }
.step-status { align-self: center; color: var(--muted); font-size: 12px; font-weight: 800; }
.small-empty { padding: 12px !important; min-height: auto !important; }
.mini-help { color: var(--muted); font-size: 11px; font-weight: 700; margin: 0 0 6px; line-height: 1.25; }
.transform-preview table { font-size: 11px; line-height: 1.2; }
.transform-preview th, .transform-preview td { padding: 5px 7px; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.transform-preview { flex: 1; min-height: 0; overflow: auto; max-height: 100%; }

/* Tabs do modal Nova tabela */
.nova-tabela-tab { padding: 6px 14px; border: 1px solid transparent; border-radius: 8px 8px 0 0; background: transparent; cursor: pointer; font-size: 13px; color: var(--muted); transition: all .15s; }
.nova-tabela-tab:hover { color: var(--brand); }
.nova-tabela-tab.active { border-color: var(--line); background: var(--panel); color: var(--text); font-weight: 600; }

/* v3.x - Painel de formatação de coluna (acima do layout) */
.transform-format-panel { border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; overflow: hidden; flex-shrink: 0; }
.transform-format-panel.collapsed .format-panel-body { display: none; }
.transform-format-panel.collapsed .format-panel-head { border-bottom: none; }
.format-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #f0f4ff; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px; user-select: none; }
.format-panel-toggle { border: 0; background: transparent; font-size: 16px; cursor: pointer; color: var(--muted); padding: 0 4px; line-height: 1; font-weight: 900; }
.format-panel-toggle:hover { color: var(--text); }
.format-panel-body { padding: 10px 12px; }
.format-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.format-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; min-width: 140px; }
.format-row select { min-width: 160px; }
.format-row .btn { align-self: flex-end; }
@media (max-width: 1100px) { .format-row { flex-direction: column; align-items: stretch; } .format-row label { min-width: auto; } }



/* v3.0.3 - Filtros dinamicos estilo Power BI */
.filter-popup-visual-item.selected,
.filter-visual-preview.selected {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px rgba(31,111,235,0.18);
}
.filter-visual-preview {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 4px;
}
.filter-popup-visual-item select,
.filter-popup-visual-item input,
.dashboard-filter-runtime-card select,
.dashboard-filter-runtime-card input {
  width: 100%;
  min-height: 36px;
}
.filter-popup-visual-item .filter-between-row,
.dashboard-filter-runtime-card .filter-between-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.filter-popup-visual-item .filter-option-list,
.dashboard-filter-runtime-card .filter-option-list {
  max-height: 220px;
}
.filter-popup-visual-item .filter-check-option,
.dashboard-filter-runtime-card .filter-check-option {
  font-size: 12px;
}

/* v3.0.5 - Tabelas e Views somente visualização */
.visualizacao-layout { display: flex; flex-direction: column; gap: 12px; }
/* Painel da tabela */
.table-viewer-panel { width: 100%; min-width: 0; }
.table-view-only-panel { min-height: 62vh; }
.table-view-result { max-height: calc(100vh - 280px); overflow: auto; }
.table-view-result .table-wrap,
.table-view-result .visual-table-wrap { overflow: visible; }
.table-view-result .data-table tfoot td { position: static; background: #f3f6fb; }
.hidden-edit-controls { display: none !important; }
#createTablesInfo, .create-tables-info { font-size: 12px; color: var(--muted); }


/* v3.0.6 - Criar Tabelas estilo Power BI */
.compact-head { align-items: center; margin-bottom: 12px; }
.compact-panel-head { margin-bottom: 10px; }
.manual-table-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 330px;
  gap: 14px;
  align-items: stretch;
  height: calc(100vh - 155px);
  min-height: 560px;
}
.manual-data-panel, .manual-side-panel { min-height: 0; overflow: hidden; }
.manual-side-panel { overflow-y: auto; }
.manual-table-config {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}
.inline-check { margin: 0 0 2px; }
.manual-grid-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.manual-format-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  background: #f7faff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  align-items: center;
}
.format-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.format-panel-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.format-panel-head .meta { font-size: 11px; }
.format-panel-body {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 10px;
  align-items: end;
}
.format-panel-body label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.format-panel-body select,
.format-panel-body input {
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12px;
  min-width: 130px;
}
.manual-format-input {
  width: 100px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 11px;
  border: 1px solid var(--line);
}
@media (max-width: 760px) {
  .manual-format-panel { grid-template-columns: 1fr; gap: 8px; }
  .format-panel-body {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
}
.btn.mini { padding: 6px 9px; font-size: 12px; border-radius: 8px; }
.btn.mini.danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.btn.mini.danger:hover { background: #fecaca; color: #7f1d1d; }
.btn.danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.btn.danger:hover { background: #fecaca; color: #7f1d1d; }
.manual-data-grid {
  height: calc(100% - 190px);
  min-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.manual-grid-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
  width: max-content;
  background: #fff;
}
.manual-grid-table th,
.manual-grid-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0;
  vertical-align: top;
}
.manual-grid-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7faff;
  min-width: 175px;
  box-shadow: 0 1px 0 var(--line);
}
.manual-grid-table th.row-number,
.manual-grid-table td.row-number {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 46px;
  width: 46px;
  text-align: center;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 9px 4px;
}
.manual-grid-table th.row-number { z-index: 4; }
.manual-col-head { display: grid; gap: 6px; padding: 8px; }
.manual-col-head input,
.manual-col-head select { padding: 7px 8px; border-radius: 8px; font-size: 12px; }
.manual-col-tools { display: flex; align-items: center; gap: 6px; }
.manual-col-tools button { flex: 0 0 auto; }
.manual-cell {
  width: 100%;
  min-width: 175px;
  border: 0;
  border-radius: 0;
  padding: 9px 10px;
  background: #fff;
  font-size: 13px;
}
.manual-cell:focus { outline: 2px solid rgba(31,111,235,0.35); box-shadow: none; }
.manual-grid-table tr:nth-child(even) .manual-cell { background: #fbfdff; }
.manual-delete-row { width: 100%; height: 100%; border: 0; background: transparent; color: #9f1239; font-weight: 900; }
.soft-separator { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.compact-form { gap: 9px; }
.full-width { width: 100%; }
.small-modal { max-width: 720px; }
.manual-side-panel h4 { margin-top: 0; }
@media (max-width: 1150px) {
  .manual-table-layout { grid-template-columns: 1fr; height: auto; }
  .manual-data-grid { height: 520px; }
}
@media (max-width: 760px) {
  .manual-table-config { grid-template-columns: 1fr; }
  .manual-grid-toolbar { align-items: flex-start; flex-direction: column; }
}

/* v3.0.7 - Conexões estilo Power BI com linhas visuais salvas */
.connections-layout {
  grid-template-columns: minmax(220px, 280px) minmax(620px, 1fr) minmax(260px, 320px);
  min-height: calc(100vh - 150px);
}
.connections-canvas-panel {
  overflow: hidden;
}
.connection-diagram {
  height: calc(100vh - 220px);
  min-height: 540px;
  overflow: auto;
  position: relative;
}
.diagram-model-area {
  position: relative;
  min-height: 430px;
  min-width: 980px;
  padding: 10px;
}
.relationship-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.diagram-card-board {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px 24px;
  min-width: 940px;
  padding: 6px 18px 28px 6px;
}
.powerbi-model-card {
  width: 250px;
  min-height: 140px;
  max-height: 310px;
  resize: both;
  overflow: hidden;
}
.powerbi-model-card .diagram-table-columns {
  max-height: 230px;
  overflow: auto;
  padding: 4px 5px;
  display: grid;
  gap: 2px;
}
.relationship-path {
  fill: none;
  stroke: #7eb8f4;
  stroke-width: 2.25;
  filter: drop-shadow(0 1px 1px rgba(37, 99, 235, .10));
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  pointer-events: auto;
  transition: stroke .15s ease, stroke-width .15s ease;
}
.relationship-path:hover {
  stroke: #1d4ed8;
  stroke-width: 3;
  filter: drop-shadow(0 1px 3px rgba(37, 99, 235, .30));
}
.relationship-end {
  fill: #fff;
  stroke: #2563eb;
  stroke-width: 2;
}
.relationship-end-to {
  fill: #2563eb;
  stroke: #1d4ed8;
  stroke-width: 2;
}
.relationship-arrow {
  fill: #2563eb;
  stroke: none;
}
.relationship-card-label {
  font-size: 12px;
  font-weight: 800;
  fill: #1d4ed8;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.relationship-label {
  font-size: 11px;
  font-weight: 800;
  fill: #1d4ed8;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  stroke-linejoin: round;
}
.diagram-column-row.drop-target-column {
  box-shadow: 0 0 0 2px rgba(37,99,235,.25);
}
.compact-relationships {
  max-height: 150px;
}
@media (max-width: 1280px) {
  .connections-layout { grid-template-columns: 240px minmax(560px, 1fr); }
  .relationship-builder-panel { grid-column: 1 / -1; }
  .diagram-model-area { min-width: 900px; }
  .diagram-card-board { min-width: 860px; }
}


.table-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* v3.1.1 - Conexões: cards persistentes, linhas precisas e painéis recolhíveis */
.connections-layout.resources-collapsed {
  grid-template-columns: 0 minmax(760px, 1fr) minmax(260px, 320px);
}
.connections-layout.relationship-collapsed {
  grid-template-columns: minmax(220px, 280px) minmax(760px, 1fr) 0;
}
.connections-layout.resources-collapsed.relationship-collapsed {
  grid-template-columns: 0 minmax(900px, 1fr) 0;
}
.connections-layout.resources-collapsed .connections-resource-panel,
.connections-layout.relationship-collapsed .relationship-builder-panel {
  padding: 0;
  min-width: 0;
  width: 0;
  overflow: hidden;
  border: 0;
  box-shadow: none;
}
.mini-collapse {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex: 0 0 auto;
}
.connections-canvas-panel {
  min-width: 0;
}
/* Modelo visual tela cheia */
.connections-canvas-panel:fullscreen {
  padding: 20px 24px;
  background: #f4f7fb;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.connections-canvas-panel:fullscreen .panel-head {
  flex-shrink: 0;
}
.connections-canvas-panel:fullscreen .connection-diagram {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid #d8e2f2;
  background: #fbfdff;
  background-image:
    linear-gradient(rgba(31,111,235,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,111,235,0.045) 1px, transparent 1px);
  background-size: 26px 26px;
}
.connections-canvas-panel:fullscreen .diagram-model-area,
.connections-canvas-panel:fullscreen .diagram-card-board {
  min-width: 100%;
  min-height: 100%;
}
.connection-diagram {
  overflow: auto;
}
.diagram-model-area {
  min-width: 1450px;
  min-height: 980px;
}
.diagram-card-board {
  position: relative;
  display: block;
  min-width: 1450px;
  min-height: 940px;
  padding: 0 0 80px 0;
}
.powerbi-model-card {
  position: absolute;
  width: 260px;
  min-height: 140px;
  max-height: 340px;
  resize: both;
  overflow: hidden;
  z-index: 3;
}
.powerbi-model-card.moving-card {
  opacity: .92;
  z-index: 10;
  box-shadow: 0 18px 42px rgba(15,23,42,.22);
}
.powerbi-model-card .diagram-table-head {
  cursor: move;
  user-select: none;
}
.powerbi-model-card .diagram-table-columns {
  max-height: calc(100% - 42px);
  overflow: auto !important;
  min-height: 40px;
}
.relationship-svg {
  pointer-events: none;
  z-index: 3;
}
.relationship-path {
  fill: none;
  stroke: #7eb8f4;
  stroke-width: 2.25;
  filter: drop-shadow(0 1px 2px rgba(37, 99, 235, .12));
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  pointer-events: auto;
  transition: stroke .15s ease, stroke-width .15s ease;
}
.relationship-path:hover {
  stroke: #1d4ed8;
  stroke-width: 3;
  filter: drop-shadow(0 1px 3px rgba(37, 99, 235, .30));
}
.relationship-end {
  fill: #fff;
  stroke: #2563eb;
  stroke-width: 2;
}
.relationship-end-to {
  fill: #2563eb;
  stroke: #1d4ed8;
  stroke-width: 2;
}
.relationship-arrow {
  fill: #2563eb;
  stroke: none;
}
.relationship-card-label {
  font-size: 12px;
  font-weight: 800;
  fill: #1d4ed8;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.card-border-dot {
  fill: #fff;
  stroke: #2563eb;
  stroke-width: 2.5;
  filter: drop-shadow(0 1px 2px rgba(37,99,235,.3));
  cursor: pointer;
  pointer-events: auto;
}
.card-border-dot:hover {
  fill: #2563eb;
  stroke: #1d4ed8;
  r: 6;
}
.card-level-fallback {
  stroke-dasharray: 8 4;
  stroke-width: 2;
}
.card-level-dot {
  fill: #2563eb;
  stroke: #1d4ed8;
  stroke-width: 1.5;
}
.relationship-label {
  font-size: 11px;
  font-weight: 800;
  fill: #1d4ed8;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  stroke-linejoin: round;
}
@media (max-width: 1280px) {
  .connections-layout.resources-collapsed,
  .connections-layout.relationship-collapsed,
  .connections-layout.resources-collapsed.relationship-collapsed {
    grid-template-columns: 1fr;
  }
}

/* v3.3.13 - Editor contextual de medidas DAX responsivo */
body.report-editor-active .report-canvas-panel {
  container-name: report-editor;
  container-type: inline-size;
}

body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon {
  flex: 0 0 74px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .05);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: #b8c6d8 transparent;
  scrollbar-width: thin;
}

body.report-editor-active .measure-formula-bar:not([hidden]) {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  z-index: 30;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  height: auto;
  max-height: 300px;
  margin: 0;
  padding: 1px 0;
  box-sizing: border-box;
}

body.report-editor-active .measure-formula-bar-wrapper {
  min-width: 0;
  border-radius: 0 6px 6px 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}

body.report-editor-active .measure-formula-input,
body.report-editor-active .measure-formula-highlight {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@container report-editor (max-width: 850px) {
  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon.is-open {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 52px 52px;
    flex: 0 0 116px;
    gap: 0;
    height: 116px;
    min-height: 116px;
    max-height: 116px;
    padding: 5px 7px;
    overflow: hidden;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group {
    width: auto;
    min-width: 0;
    height: 52px;
    padding: 2px 8px;
    overflow: hidden;
    box-sizing: border-box;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-struct {
    grid-column: 1;
    grid-row: 1;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-props {
    grid-column: 2;
    grid-row: 1;
    border-right: 0;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-format {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid #e2e8f0;
    border-right: 0;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group-label {
    height: 12px;
    line-height: 12px;
    font-size: 9px;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group-content {
    width: 100%;
    height: 32px;
    min-width: 0;
    gap: 5px;
    overflow: visible;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-inline-label {
    width: 100%;
    min-width: 0;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-inline-label > input,
  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-inline-label > select,
  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon #ribbonMeasureCategory {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-format .ribbon-tool-group-content--col {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-format-row {
    flex: 0 0 auto;
  }
}

@container report-editor (max-width: 520px) {
  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(3, 52px);
    flex-basis: 168px;
    height: 168px;
    min-height: 168px;
    max-height: 168px;
    overflow-y: auto;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-struct {
    grid-column: 1;
    grid-row: 1;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-props {
    grid-column: 1;
    grid-row: 2;
    border-top: 1px solid #e2e8f0;
  }

  body.report-editor-active .powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-format {
    grid-column: 1;
    grid-row: 3;
  }
}


/* v3.1.2 - Painéis de Conexões no lado direito, recolhíveis sem sumir */
.connections-layout {
  grid-template-columns: minmax(720px, 1fr) minmax(220px, 280px) minmax(260px, 320px) !important;
  grid-auto-flow: column;
  align-items: stretch;
}
.connections-canvas-panel { order: 1; min-width: 0; }
.connections-resource-panel { order: 2; min-width: 0; }
.relationship-builder-panel { order: 3; min-width: 0; }
.connections-layout.resources-collapsed {
  grid-template-columns: minmax(840px, 1fr) 52px minmax(260px, 320px) !important;
}
.connections-layout.relationship-collapsed {
  grid-template-columns: minmax(840px, 1fr) minmax(220px, 280px) 52px !important;
}
.connections-layout.resources-collapsed.relationship-collapsed {
  grid-template-columns: minmax(940px, 1fr) 52px 52px !important;
}
.connections-layout.resources-collapsed .connections-resource-panel,
.connections-layout.relationship-collapsed .relationship-builder-panel {
  width: auto !important;
  min-width: 0 !important;
  padding: 8px !important;
  overflow: hidden !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow) !important;
}
.connections-layout.resources-collapsed .connections-resource-panel > *:not(.panel-head),
.connections-layout.relationship-collapsed .relationship-builder-panel > *:not(.panel-head) {
  display: none !important;
}
.connections-layout.resources-collapsed .connections-resource-panel .panel-head,
.connections-layout.relationship-collapsed .relationship-builder-panel .panel-head {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: calc(100vh - 210px);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding: 4px 0;
}
.connections-layout.resources-collapsed .connections-resource-panel .panel-head h3,
.connections-layout.relationship-collapsed .relationship-builder-panel .panel-head h3 {
  font-size: 13px;
  white-space: nowrap;
}
.connections-layout.resources-collapsed .connections-resource-panel .panel-head .meta,
.connections-layout.relationship-collapsed .relationship-builder-panel .panel-head .meta {
  display: none;
}
.connections-layout.resources-collapsed .connections-resource-panel .mini-collapse,
.connections-layout.relationship-collapsed .relationship-builder-panel .mini-collapse {
  writing-mode: horizontal-tb;
  transform: rotate(180deg);
  position: sticky;
  top: 6px;
}
.diagram-model-area {
  position: relative;
  min-width: 1600px;
  min-height: 1000px;
}
.diagram-card-board {
  position: relative;
  min-width: 1600px;
  min-height: 1000px;
  display: block !important;
  padding: 0 0 80px 0;
}
.powerbi-model-card {
  position: absolute;
  width: 240px;
  min-height: 130px;
  max-height: 330px;
}
.relationship-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.connection-diagram {
  height: calc(100vh - 225px);
  overflow: auto !important;
}
@media (max-width: 1180px) {
  .connections-layout,
  .connections-layout.resources-collapsed,
  .connections-layout.relationship-collapsed,
  .connections-layout.resources-collapsed.relationship-collapsed {
    grid-template-columns: minmax(640px, 1fr) 52px 52px !important;
  }
  .connections-resource-panel, .relationship-builder-panel { min-height: calc(100vh - 172px); }
}

/* v3.2.0 - melhorias de frontend estilo Power BI / viewer online */
.dashboard-grid-pro {
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  align-items: start;
}
.dashboard-commandbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 14px 34px rgba(15,23,42,.06);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 10px;
  z-index: 8;
}
.dashboard-commandbar-main,
.dashboard-commandbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dashboard-commandbar.is-paused {
  border-color: rgba(183,121,31,.35);
  background: #fffaf0;
}
.dashboard-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid #dbe6f5;
  border-radius: 999px;
  background: #f8fbff;
  color: #42536b;
  font-size: 12px;
  font-weight: 800;
}
.powerbi-dashboard-card {
  border: 1px solid #dbe6f5;
  border-radius: 20px;
  box-shadow: 0 16px 42px rgba(15,23,42,.08);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.powerbi-dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 58px rgba(15,23,42,.12);
  border-color: #bcd2ef;
}
.powerbi-dashboard-card header {
  background: linear-gradient(180deg,#ffffff,#f8fbff);
  border-bottom: 1px solid #edf2f8;
}
.dash-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.visual-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(101,116,139,.08);
}
.visual-status-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(15,138,95,.12); }
.visual-status-dot.loading { background: var(--warn); box-shadow: 0 0 0 4px rgba(183,121,31,.14); }
.visual-status-dot.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(211,63,73,.12); }
.visual-status-badge {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid transparent;
}
.visual-status-badge.ok { color: #0f6b4d; background: #e8fff5; border-color: #b8f2d8; }
.visual-status-badge.loading { color: #8a5a0a; background: #fff7e6; border-color: #ffe0a3; }
.visual-status-badge.error { color: #991b1b; background: #fff1f2; border-color: #fecdd3; }
.powerbi-dashboard-card.is-refreshing .dash-body {
  opacity: .72;
}
.biwa-skeleton {
  display: grid;
  gap: 12px;
  padding: 18px;
}
.biwa-skeleton span {
  height: 15px;
  border-radius: 999px;
  background: linear-gradient(90deg,#edf2f7,#f8fbff,#edf2f7);
  background-size: 220% 100%;
  animation: biwaSkeleton 1.2s ease-in-out infinite;
}
.biwa-skeleton span:nth-child(2) { width: 72%; }
.biwa-skeleton span:nth-child(3) { width: 46%; }
@keyframes biwaSkeleton {
  0% { background-position: 0 0; }
  100% { background-position: -220% 0; }
}
.dashboard-card-fullscreen {
  grid-column: 1 / -1;
  min-height: calc(100vh - 160px);
}
.dashboard-card-fullscreen .dash-body {
  min-height: calc(100vh - 260px);
}
.dashboard-card-fullscreen .dashboard-report-page {
  transform-origin: top left;
}
.dashboard-report-page {
  background:
    linear-gradient(#eef4fb 1px, transparent 1px),
    linear-gradient(90deg, #eef4fb 1px, transparent 1px),
    #ffffff;
  background-size: 24px 24px;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.04);
}
.dashboard-visual-box {
  box-shadow: 0 8px 22px rgba(15,23,42,.08);
}
.dashboard-visual-title {
  min-height: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #122033;
}
.dashboard-visual-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.dash-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
body.view-only .main {
  background: radial-gradient(circle at top left, rgba(31,111,235,.10), transparent 32%), var(--bg);
}
body.view-only .page-head {
  border: 1px solid #dbe6f5;
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,255,255,.86);
}
body.view-only .page-head.page-head-dark {
  border: 0 !important;
  background: linear-gradient(135deg, #1a2744 0%, #1e3a5f 50%, #0f2340 100%) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
@media (max-width: 860px) {
  .dashboard-commandbar { position: static; align-items: stretch; flex-direction: column; }
  .dashboard-commandbar-actions .btn { flex: 1; }
  .dashboard-grid-pro { grid-template-columns: 1fr; }
  .powerbi-dashboard-card { border-radius: 16px; }
}

/* v3.2.1 - Etapa 2: canvas e acabamento Power BI */
.report-canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #d8e1ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
}
.canvas-toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-toggle { display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; font-size: 12px; font-weight: 800; color: #42536b; }
.inline-toggle input { width: auto !important; }
.format-color-grid { 
  display: grid; 
  grid-template-columns: repeat(3, minmax(0, 1fr)); 
  gap: 10px; 
}
.format-color-grid label { 
  font-size: 11px; 
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  color: #42536b;
}
.format-color-grid input[type="color"] { 
  min-height: 38px; 
  padding: 3px; 
  width: 100%;
  border-radius: 8px;
}
.report-canvas { background: #dde3ed; }
.report-canvas:fullscreen { background: #cfd8e8; padding: 22px; overflow: auto; }
.report-canvas-stage {
  position: relative;
  flex: 0 0 auto;
  width: 1280px;
  height: 720px;
  margin: auto;
}
.report-page {
  transform: scale(var(--canvas-zoom, 1));
  transform-origin: top left;
  transition: background .16s ease, box-shadow .16s ease;
}
.report-page[data-theme="dark"] { background: #0f172a; border-color: #334155; box-shadow: 0 22px 60px rgba(2,6,23,.28); }
.report-page[data-theme="executive"] { background: linear-gradient(135deg, #f8fafc, #eef2ff); border-color: #b8c5e6; }
.visual-frame {
  background: var(--visual-bg, #fff) !important;
  color: var(--visual-text, #0f172a);
  border-color: color-mix(in srgb, var(--visual-accent, #2563eb) 28%, #d8e1ef) !important;
  transition: box-shadow .16s ease, border-color .16s ease, transform .16s ease;
}
.visual-frame.has-shadow { box-shadow: 0 16px 36px rgba(15,23,42,.13); }
.visual-frame.no-shadow { box-shadow: none !important; }
.visual-frame.no-border { border-color: transparent !important; }
.visual-frame.selected { box-shadow: 0 0 0 2px var(--visual-accent, #2563eb), 0 22px 48px rgba(15,23,42,.15) !important; }
.visual-frame-head { color: var(--visual-text, #0f172a); border-bottom: 1px solid color-mix(in srgb, var(--visual-accent, #2563eb) 20%, transparent); padding-bottom: 8px; }
.visual-frame-head strong { color: var(--visual-text, #0f172a); }
.visual-frame .meta { color: color-mix(in srgb, var(--visual-text, #0f172a) 70%, #94a3b8); }
.visual-frame .result { color: var(--visual-text, #0f172a); }
.visual-frame .visual-resize-handle { background: var(--visual-accent, #2563eb); border-color: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.2); }
.echarts-host { width: 100%; height: 100%; min-width: 0; min-height: 220px; overflow: hidden; }
.dashboard-visual-box { background: var(--visual-bg, #fff); color: var(--visual-text, #0f172a); border-color: color-mix(in srgb, var(--visual-accent, #2563eb) 24%, #dbe6f5) !important; }
.dashboard-visual-body .echarts-host { min-height: 160px; }
@media (max-width: 900px) {
  .report-canvas-toolbar { align-items: stretch; flex-direction: column; }
  .canvas-toolbar-group { justify-content: space-between; }
  .format-color-grid { grid-template-columns: 1fr; }
}

/* v3.2.3 - Etapa 4 BI avancado */
.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary, #2563eb);
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
}
.measure-template-btn {
  white-space: nowrap;
}
.measure-formula-wrapper {
  position: relative;
}
.measure-autocomplete-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 10px;
  z-index: 100;
  background: #fff;
  border: 1px solid #d0dcee;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.14);
  max-height: 280px;
  min-width: 200px;
  max-width: 420px;
  width: auto;
  overflow: auto;
  display: none;
  padding: 4px 0;
}
.measure-autocomplete-list.show {
  display: block;
}
.measure-autocomplete-item {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  transition: background .1s;
}
.measure-autocomplete-item:last-child {
  border-bottom: none;
}
.measure-autocomplete-item:hover,
.measure-autocomplete-item.selected {
  background: #e8f0fe;
}
.measure-autocomplete-item small {
  color: #6b7280;
  font-size: 10px;
  white-space: nowrap;
  margin-left: auto;
  opacity: .75;
}
.measure-row-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.measure-actions-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 16px;
  line-height: 1;
  color: #94a3b8;
  border-radius: 4px;
  letter-spacing: 1px;
}
.measure-actions-btn:hover {
  background: #f1f5f9;
  color: #475569;
}
.measure-actions-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 200;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  min-width: 140px;
  display: none;
  overflow: hidden;
}
.measure-actions-menu.open {
  display: block;
}
.measure-actions-menu button {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  color: #334155;
}
.measure-actions-menu button:hover {
  background: #f1f5f9;
}
.measure-actions-menu button.danger {
  color: #dc2626;
}
.measure-actions-menu button.danger:hover {
  background: #fef2f2;
}
.model-item .measure-row-actions {
  overflow: visible;
}
.builder-measure-row {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 8px;
}
.builder-measure-row .field-row {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.builder-measure-row .measure-edit-trigger {
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.builder-measure-row .measure-edit-trigger:hover,
.builder-measure-row .measure-edit-trigger:focus-visible {
  color: #0f6cbd;
}
.builder-measure-row .measure-edit-trigger:focus-visible {
  outline: 2px solid rgba(38, 132, 255, .55);
  outline-offset: 2px;
}

.report-empty-canvas {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #64748b;
  text-align: center;
  pointer-events: none;
}
.report-empty-canvas-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px dashed #9fb5cc;
  border-radius: 10px;
  background: #f6f9fc;
  color: #356f9f;
  font-size: 25px;
  font-weight: 400;
}
.report-empty-canvas strong {
  color: #334155;
  font-size: 13px;
}
.report-empty-canvas small {
  max-width: 340px;
  font-size: 10px;
  line-height: 1.4;
}
.builder-measure-row .measure-row-actions {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 0 4px;
}
.measure-editor-container {
  position: relative;
  border: 1px solid #d0dcee;
  border-radius: 14px;
  overflow: hidden;
}
.measure-editor-container:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
.measure-formula-highlight {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
  color: #1e293b;
  overflow: hidden;
}
.measure-editor-container textarea {
  position: relative;
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: transparent;
  caret-color: #1e293b;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none;
  resize: vertical;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}
.measure-editor-container textarea::placeholder {
  color: #94a3b8;
}
.dashboard-card-actions .icon-btn[data-export-report-csv],
.dashboard-card-actions .icon-btn[data-export-report-json],
.dash-card-actions .icon-btn[data-export-report-csv],
.dash-card-actions .icon-btn[data-export-report-json] {
  min-width: 42px;
  font-size: 11px;
  font-weight: 800;
}
@media print {
  .sidebar, .topbar, .tabs, .dashboard-commandbar, .dash-card-actions, .nav, .page-head .actions {
    display: none !important;
  }
  body, main, .content, .tab.active {
    background: #fff !important;
    color: #000 !important;
  }
  .dash-card, .powerbi-dashboard-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* v3.2.4 - validacao geral de responsividade e anti-corte de telas */
html, body {
  width: 100%;
  max-width: 100%;
}

body {
  overflow-x: hidden;
}

.app-shell,
.main,
.tab,
.card,
.panel,
.connections-layout,
.connections-panel,
.connections-canvas-panel,
.relationship-builder-panel,
.powerbi-shell,
.transform-shell,
.transform-layout,
.model-grid,
.builder-layout,
.split,
.table-viewer-panel,
.manual-table-layout,
.dashboard-grid,
.dashboard-grid-pro {
  min-width: 0;
}

.app-shell {
  width: 100%;
  max-width: 100vw;
  grid-template-columns: clamp(248px, 20vw, 310px) minmax(0, 1fr);
}

.sidebar {
  min-width: 0;
}

.brand {
  min-width: 0;
}

.brand > div,
.brand h1,
.brand p,
#dbStatus,
.version-badge,
.mode-banner {
  min-width: 0;
  overflow-wrap: anywhere;
}

.main {
  width: 100%;
  max-width: 100%;
  padding: clamp(18px, 2vw, 32px);
  overflow-x: auto;
  overflow-y: auto;
}

.page-head {
  align-items: flex-start;
  gap: 14px;
}

.page-head > div:first-child {
  min-width: 0;
}

.page-head h2,
.page-head .sub,
.eyebrow {
  overflow-wrap: anywhere;
}

.actions,
.actions.wrap,
.dashboard-refresh-actions,
.inline-actions,
.table-view-toolbar,
.manual-grid-toolbar,
.dashboard-commandbar,
.dashboard-toolbar-row,
.canvas-toolbar,
.canvas-toolbar-group,
.transform-topbar {
  min-width: 0;
  flex-wrap: wrap;
}

.btn {
  max-width: 100%;
  white-space: normal;
  line-height: 1.2;
}

input,
select,
textarea,
button {
  min-width: 0;
  max-width: 100%;
}

.panel-head,
.card-head,
.compact-head {
  min-width: 0;
}

.panel-head h3,
.card-head h3,
.compact-head h3,
.panel-head .meta,
.compact-head .meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Melhorias para a área de transformação - prévia compacta */
.transform-center .compact-head { margin-bottom: 4px; padding-bottom: 4px; }
.transform-center .compact-head h3 { font-size: 13px; }
.transform-center .mini-help { margin-bottom: 4px; line-height: 1.2; }

.table-wrap,
.result,
.table-view-result,
.transform-preview,
.manual-data-grid,
.visual-content,
.visual-frame .table-wrap,
.model-list,
.column-picker {
  max-width: 100%;
  min-width: 0;
  overflow: auto;
}

.data-table,
.manual-grid-table {
  max-width: none;
}

/* Conexoes: corrige corte dos paineis laterais em resolucoes de notebook */
#connectionsTab {
  overflow: hidden;
}
#connectionsTab.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
}


.connections-layout,
.connections-layout.resources-collapsed,
.connections-layout.relationship-collapsed,
.connections-layout.resources-collapsed.relationship-collapsed {
  width: 100%;
  max-width: 100%;
  grid-auto-flow: row !important;
  grid-template-columns: minmax(0, 1fr) clamp(190px, 20vw, 260px) clamp(190px, 20vw, 260px) !important;
  gap: clamp(8px, 1vw, 12px);
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
}

.connections-canvas-panel,
.connections-resource-panel,
.relationship-builder-panel {
  min-width: 0 !important;
  max-width: 100%;
}

.connections-panel,
.connections-canvas-panel {
  padding: clamp(10px, 1vw, 14px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.connections-canvas-panel {
  overflow: hidden;
  flex: 1;
}

.connection-diagram {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 1;
  min-height: 0;
  overflow: auto !important;
  overscroll-behavior: contain;
}

.diagram-model-area,
.diagram-card-board {
  width: max-content;
  min-width: 1200px;
  min-height: 820px;
}

.powerbi-model-card {
  max-width: 380px;
}

.powerbi-model-card .diagram-table-head b,
.powerbi-model-card .diagram-table-head small,
.diagram-column-row .col-name,
.relationship-line,
.model-item,
.connection-resource-row span,
.connection-resource-row small {
  min-width: 0;
}
.model-item { overflow: visible; }
.connection-resource-row span,
.connection-resource-row small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-resource-list {
  max-height: calc(100vh - 300px);
  padding-right: 2px;
}

.connection-actions-mini {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.connection-form-grid label {
  min-width: 0;
}

.relationship-builder-panel .model-list,
#connRelationshipList {
  max-height: calc(100vh - 590px);
  min-height: 80px;
}

.connections-layout.resources-collapsed {
  grid-template-columns: minmax(0, 1fr) 52px clamp(190px, 20vw, 260px) !important;
}

.connections-layout.relationship-collapsed {
  grid-template-columns: minmax(0, 1fr) clamp(190px, 20vw, 260px) 52px !important;
}

.connections-layout.resources-collapsed.relationship-collapsed {
  grid-template-columns: minmax(0, 1fr) 52px 52px !important;
}

.connections-layout.resources-collapsed .connections-resource-panel .panel-head,
.connections-layout.relationship-collapsed .relationship-builder-panel .panel-head {
  height: auto;
  min-height: min(460px, calc(100vh - 210px));
}

/* Demais telas administrativas */
.model-grid,
.builder-layout,
.manual-table-layout {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.form-grid,
.form-grid.compact,
.connection-form-grid,
.manual-table-config,
.dashboard-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

.transform-topbar {
  display: flex;
  justify-content: space-between;
}

.transform-layout {
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(230px, 280px);
}

.transform-center,
.transform-left,
.transform-right,
.compact-panel {
  min-width: 0;
}

.dashboard-grid-pro {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* Report Thumb Card */
.report-thumb-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  border: 1px solid var(--line, #e8ecf1);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  transition: box-shadow .25s, transform .2s, border-color .2s;
  cursor: pointer;
  min-height: 220px;
  justify-content: center;
}
.report-thumb-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  transform: translateY(-3px);
  border-color: var(--brand, #3366ff);
}
.report-thumb-card .thumb-preview {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ebf0ff 0%, #d0dbff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand, #4f6ef6);
  flex-shrink: 0;
}
.report-thumb-card .thumb-preview svg {
  width: 32px;
  height: 32px;
}
.report-thumb-card .thumb-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-thumb-card .thumb-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1a1d26;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.report-thumb-card .thumb-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #8892a4;
  justify-content: center;
  flex-wrap: wrap;
  line-height: 1.4;
}
.report-thumb-card .thumb-meta span {
  background: #f4f6f9;
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 500;
}
.report-thumb-card .thumb-actions {
  margin-top: auto;
  padding-top: 4px;
}
.report-thumb-card .thumb-actions .btn {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 22px;
  border-radius: 8px;
}

.dashboard-card,
.visual-frame,
.dashboard-visual,
.report-card {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1450px) {
  .app-shell {
    grid-template-columns: clamp(248px, 19vw, 290px) minmax(0, 1fr);
  }

  .page-head {
    flex-direction: column;
  }

  .page-head .actions,
  .page-head .actions.wrap {
    width: 100%;
    justify-content: flex-start;
  }

  .connections-layout,
  .connections-layout.resources-collapsed,
  .connections-layout.relationship-collapsed,
  .connections-layout.resources-collapsed.relationship-collapsed {
    grid-template-columns: minmax(0, 1fr) minmax(178px, 230px) minmax(205px, 260px) !important;
  }

  .connections-panel,
  .connections-canvas-panel {
    min-height: calc(100vh - 190px);
  }

  .connection-form-grid {
    gap: 7px;
  }

  .connection-form-grid label,
  .connection-resource-row,
  .relationship-line,
  .small-note {
    font-size: 12px;
  }

  .connection-form-grid input,
  .connection-form-grid select,
  .connection-form-grid textarea {
    padding: 9px 10px;
    border-radius: 10px;
  }

  .connection-actions-mini .btn,
  .relationship-builder-panel .btn,
  .connections-panel .btn {
    padding: 9px 10px;
    font-size: 12px;
  }
}

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 12px;
  }

  .brand-logo {
    width: 54px;
    height: 54px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .nav-btn {
    padding: 11px 12px;
  }

  .connections-layout,
  .connections-layout.resources-collapsed,
  .connections-layout.relationship-collapsed,
  .connections-layout.resources-collapsed.relationship-collapsed {
    grid-template-columns: minmax(0, 1fr) 52px 52px !important;
  }

  .connections-layout:not(.resources-collapsed) .connections-resource-panel,
  .connections-layout:not(.relationship-collapsed) .relationship-builder-panel {
    grid-column: 1 / -1;
    min-height: auto !important;
  }

  .connections-layout:not(.resources-collapsed) .connections-resource-panel {
    order: 2;
  }

  .connections-layout:not(.relationship-collapsed) .relationship-builder-panel {
    order: 3;
  }

  .connections-canvas-panel {
    grid-column: 1 / -1;
  }

  .connection-resource-list {
    max-height: 260px;
  }

  .relationship-builder-panel .model-list,
  #connRelationshipList {
    max-height: 220px;
  }

  .transform-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .transform-shell {
    height: auto;
    min-height: calc(100vh - 36px);
    overflow: visible;
  }
}

@media (max-width: 860px) {
  body {
    overflow-x: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

  .main {
    padding: 14px;
  }

  h2 {
    font-size: 28px;
  }

  .connections-layout,
  .connections-layout.resources-collapsed,
  .connections-layout.relationship-collapsed,
  .connections-layout.resources-collapsed.relationship-collapsed {
    grid-template-columns: 1fr !important;
  }

  .connections-layout.resources-collapsed .connections-resource-panel,
  .connections-layout.relationship-collapsed .relationship-builder-panel {
    display: none;
  }

  .connection-diagram {
    height: 62vh;
    min-height: 360px;
  }

  .diagram-model-area,
  .diagram-card-board {
    min-width: 900px;
    min-height: 640px;
  }

  .table-view-toolbar,
  .dashboard-commandbar,
  .dashboard-toolbar-row,
  .transform-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v3.2.5 - Conexoes: paineis recolhidos realmente liberam espaco para o canvas */
#connectionsTab {
  min-width: 0;
  overflow: hidden;
}
#connectionsTab.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
}

#connectionsLayout.connections-layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: stretch;
}

#connectionsLayout.connections-layout.resources-collapsed {
  grid-template-columns: minmax(0, 1fr) 44px clamp(190px, 20vw, 260px) !important;
}

#connectionsLayout.connections-layout.relationship-collapsed {
  grid-template-columns: minmax(0, 1fr) clamp(190px, 20vw, 260px) 44px !important;
}

#connectionsLayout.connections-layout.resources-collapsed.relationship-collapsed {
  grid-template-columns: minmax(0, 1fr) 44px 44px !important;
}

#connectionsLayout.resources-collapsed .connections-resource-panel,
#connectionsLayout.relationship-collapsed .relationship-builder-panel {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  padding: 6px !important;
  overflow: hidden !important;
}

#connectionsLayout.resources-collapsed .connections-resource-panel .panel-head,
#connectionsLayout.relationship-collapsed .relationship-builder-panel .panel-head {
  width: 32px !important;
  min-width: 32px !important;
  height: auto !important;
  min-height: min(420px, calc(100vh - 220px)) !important;
  writing-mode: vertical-rl !important;
  transform: rotate(180deg) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 4px 0 !important;
}

#connectionsLayout.resources-collapsed .connections-resource-panel > *:not(.panel-head),
#connectionsLayout.relationship-collapsed .relationship-builder-panel > *:not(.panel-head),
#connectionsLayout.resources-collapsed .connections-resource-panel .panel-head .meta,
#connectionsLayout.relationship-collapsed .relationship-builder-panel .panel-head .meta {
  display: none !important;
}

#connectionsLayout.resources-collapsed .connections-resource-panel .panel-head h3,
#connectionsLayout.relationship-collapsed .relationship-builder-panel .panel-head h3 {
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

#connectionsLayout.resources-collapsed .connections-resource-panel .mini-collapse,
#connectionsLayout.relationship-collapsed .relationship-builder-panel .mini-collapse {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  padding: 0 !important;
  writing-mode: horizontal-tb !important;
  transform: rotate(180deg) !important;
  position: sticky !important;
  top: 4px !important;
}

#connectionsLayout.resources-collapsed .connections-canvas-panel,
#connectionsLayout.relationship-collapsed .connections-canvas-panel,
#connectionsLayout.resources-collapsed.relationship-collapsed .connections-canvas-panel {
  min-width: 0 !important;
  max-width: 100% !important;
}

body.sidebar-collapsed #connectionsLayout.connections-layout:not(.resources-collapsed):not(.relationship-collapsed) {
  grid-template-columns: minmax(0, 1fr) clamp(190px, 18vw, 260px) clamp(190px, 18vw, 260px) !important;
}

body.sidebar-collapsed #connectionsLayout.connections-layout.resources-collapsed {
  grid-template-columns: minmax(0, 1fr) 44px clamp(190px, 18vw, 260px) !important;
}

body.sidebar-collapsed #connectionsLayout.connections-layout.relationship-collapsed {
  grid-template-columns: minmax(0, 1fr) clamp(190px, 18vw, 260px) 44px !important;
}

body.sidebar-collapsed #connectionsLayout.connections-layout.resources-collapsed.relationship-collapsed {
  grid-template-columns: minmax(0, 1fr) 44px 44px !important;
}

@media (max-width: 1450px) {
  #connectionsLayout.connections-layout.resources-collapsed {
    grid-template-columns: minmax(0, 1fr) 44px clamp(190px, 22vw, 260px) !important;
  }
  #connectionsLayout.connections-layout.relationship-collapsed {
    grid-template-columns: minmax(0, 1fr) clamp(180px, 21vw, 260px) 44px !important;
  }
  #connectionsLayout.connections-layout.resources-collapsed.relationship-collapsed {
    grid-template-columns: minmax(0, 1fr) 44px 44px !important;
  }
}

@media (max-width: 1220px) {
  #connectionsLayout.connections-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #connectionsLayout.resources-collapsed .connections-resource-panel,
  #connectionsLayout.relationship-collapsed .relationship-builder-panel {
    display: none !important;
  }
}


/* v3.2.7 - menu profissional, compacto e com correção de recolhimento */
:root {
  --sidebar-bg: linear-gradient(180deg, #081325 0%, #0d1b31 45%, #0a1426 100%);
  --sidebar-border: rgba(148, 163, 184, 0.14);
  --sidebar-text: #e8eefc;
  --sidebar-muted: #8fa2c3;
}

.app-shell {
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 16px 14px;
  gap: 16px;
  scrollbar-width: thin;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.03);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.brand.brand-pro {
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.06);
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  flex: 0 0 auto;
}

.brand h1 {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
}

.brand-subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--sidebar-muted);
  letter-spacing: 0.14em;
}

.brand-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.status-chip, .version-badge {
  margin: 0;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.db-status {
  margin: 0;
  color: #b1c0d8;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.92;
}

.db-status.warn {
  color: #facc15;
  font-weight: 600;
}

.sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 800;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

.collapse-icon { font-size: 16px; line-height: 1; }
.collapse-label { white-space: nowrap; }

.nav { gap: 6px; }

.nav-btn {
  position: relative;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 700;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.08);
  transform: translateX(2px);
}

.nav-btn.active {
  background: linear-gradient(135deg, #1f6feb 0%, #3b82f6 100%);
  box-shadow: 0 12px 28px rgba(31, 111, 235, 0.26);
}

.side-section-compact {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 14px 12px;
}

.section-title { color: #a9b8d3; margin-bottom: 12px; }
.list.muted { color: #a7b3ca; }
.list-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.04);
  color: #edf4ff;
}
.list-item small { color: #bdd0f6; }

.sidebar-expand-fab {
  position: fixed;
  top: 16px;
  left: 18px;
  z-index: 35;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f6feb 0%, #3b82f6 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 16px 32px rgba(31, 111, 235, 0.30);
  display: none;
}

body.sidebar-collapsed .app-shell { grid-template-columns: 88px minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { padding: 12px 10px; overflow: hidden; }
body.sidebar-collapsed .sidebar-scroll { overflow: hidden; }
body.sidebar-collapsed .brand.brand-pro { justify-content: center; padding: 10px; }
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .side-section,
body.sidebar-collapsed .collapse-label { display: none !important; }
body.sidebar-collapsed .sidebar-collapse-btn { width: 52px; min-width: 52px; padding: 0; min-height: 52px; margin: 0 auto; }
body.sidebar-collapsed .sidebar-collapse-btn .collapse-icon { font-size: 18px; }
body.sidebar-collapsed .nav { align-items: center; }
body.sidebar-collapsed .nav-btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 0;
  margin: 0 auto;
}
body.sidebar-collapsed .nav-btn::before {
  content: attr(data-short);
  font-size: 11px;
  font-weight: 900;
  color: inherit;
  letter-spacing: 0.03em;
}
body.sidebar-collapsed .nav-btn:hover { transform: none; }
body.sidebar-collapsed .brand-logo { width: 52px; height: 52px; }
body.sidebar-collapsed .sidebar-expand-fab { display: inline-grid; place-items: center; }

@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 252px minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(86vw, 296px); z-index: 45; transform: translateX(0); transition: transform .22s ease; }
  body.sidebar-collapsed .app-shell { grid-template-columns: 1fr; }
  body.sidebar-collapsed .sidebar { transform: translateX(calc(-100% - 8px)); }
  body.sidebar-collapsed .sidebar-expand-fab { display: inline-grid; place-items: center; }
  .main { padding-left: clamp(18px, 2vw, 28px); }
}

body.sidebar-collapsed .sidebar-collapse-btn::before { content: none; }
body.sidebar-collapsed .nav-btn::first-letter { font-size: 0; }


/* v3.2.8 - Etapa 5: ícones no menu e refinamento visual premium geral */
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
}
.nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  color: #b7c7e4;
}
.nav-icon svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: currentColor;
}
.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-btn.active .nav-icon { color: #fff; }
.nav-btn:hover .nav-icon { color: #fff; }

body.sidebar-collapsed .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
body.sidebar-collapsed .sidebar {
  padding: 14px 10px;
  align-items: center;
}
body.sidebar-collapsed .brand.brand-pro {
  width: 58px;
  padding: 7px;
  margin: 0 auto;
  background: rgba(255,255,255,0.05);
}
body.sidebar-collapsed .brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}
body.sidebar-collapsed .sidebar-collapse-btn {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 14px;
}
body.sidebar-collapsed .nav {
  width: 100%;
  gap: 8px;
}
body.sidebar-collapsed .nav-btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 16px;
  justify-content: center;
  margin: 0 auto;
  display: flex;
}
body.sidebar-collapsed .nav-btn::before { content: none !important; }
body.sidebar-collapsed .nav-btn::first-letter { font-size: inherit !important; }
body.sidebar-collapsed .nav-label { display: none !important; }
body.sidebar-collapsed .nav-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}
body.sidebar-collapsed .nav-icon svg {
  width: 23px;
  height: 23px;
}
body.sidebar-collapsed .nav-btn:hover,
body.sidebar-collapsed .nav-btn.active {
  transform: translateY(-1px);
}
body.sidebar-collapsed .sidebar-expand-fab { display: none !important; }

/* Premium foundation */
body {
  background:
    radial-gradient(circle at top left, rgba(31,111,235,0.10), transparent 32vw),
    linear-gradient(180deg, #f7faff 0%, #eef4fb 100%);
}
.main {
  background: transparent;
}
.page-head {
  background: rgba(255,255,255,0.64);
  border: 1px solid rgba(211, 221, 236, 0.72);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.055);
  backdrop-filter: blur(10px);
  border-radius: 22px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.page-head h2 {
  letter-spacing: -0.035em;
}
.eyebrow {
  color: #1f6feb;
  letter-spacing: 0.14em;
}
.sub {
  color: #53647c;
}

.card,
.panel,
.connections-canvas-panel,
.connections-panel,
.relationship-builder-panel,
.powerbi-card,
.dashboard-grid .dashboard-card,
.dash-card,
.visual-card,
.modal-content,
.table-viewer-panel,
.builder-card,
.settings-card,
.transform-card {
  border: 1px solid rgba(207, 218, 234, 0.78) !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.065) !important;
  background: rgba(255,255,255,0.88) !important;
}

.btn,
button.btn {
  border-radius: 14px;
  font-weight: 850;
  letter-spacing: -0.01em;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.btn:hover,
button.btn:hover {
  transform: translateY(-1px);
}
.btn.primary,
button.btn.primary {
  background: linear-gradient(135deg, #1f6feb 0%, #357df6 100%);
  box-shadow: 0 12px 26px rgba(31,111,235,0.22);
}
.btn.secondary,
button.btn.secondary {
  background: linear-gradient(135deg, #e8f0ff 0%, #dbeafe 100%);
  color: #0f4fb8;
}
.btn.ghost,
button.btn.ghost {
  background: rgba(255,255,255,0.74);
  border-color: rgba(194, 207, 226, 0.82);
}

input,
select,
textarea,
.form-control,
.filter-input {
  border-radius: 13px !important;
  border-color: #d7e0ed !important;
  background: rgba(255,255,255,0.94) !important;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.filter-input:focus {
  outline: none !important;
  border-color: #75a7ff !important;
  box-shadow: 0 0 0 4px rgba(31,111,235,0.12) !important;
}

.table-wrap,
.preview-table-wrap,
.data-preview,
.result-table-wrap {
  border-radius: 16px;
  border: 1px solid rgba(211, 221, 236, 0.85);
  overflow: auto;
  background: #fff;
}
table th {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%) !important;
  color: #23364f !important;
  font-weight: 900 !important;
}
table td {
  border-color: #edf2f8 !important;
}

.dashboard-commandbar,
.report-page-toolbar,
.connection-toolbar,
.actions.wrap {
  gap: 10px;
}
.dashboard-grid:not(.empty-state),
.dashboard-grid-pro {
  gap: 18px;
}
.dash-card,
.dashboard-card {
  border-radius: 22px !important;
  overflow: hidden;
}
.dash-card-header,
.visual-card-header,
.card-title-row {
  border-bottom-color: rgba(216, 225, 238, 0.72) !important;
}

/* Modelo visual mais limpo */
.model-canvas,
.connections-canvas,
#connectionsCanvas {
  background-color: #fbfdff;
  background-image:
    linear-gradient(rgba(31,111,235,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,111,235,0.045) 1px, transparent 1px);
  background-size: 26px 26px;
}
.model-table-card,
.table-card,
.connection-table-card {
  border-radius: 16px !important;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08) !important;
}

/* Toast premium */
.toast,
.toast-message,
#toast {
  border-radius: 16px !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.20) !important;
}

@media (max-width: 980px) {
  body.sidebar-collapsed .sidebar-expand-fab { display: inline-grid !important; place-items: center; }
  body.sidebar-collapsed .sidebar { align-items: stretch; }
  .page-head { padding: 16px; }
}


/* v3.2.9 - Relatorios mais limpo, paginas funcionais e zoom abaixo das abas */
body.report-editor-active .powerbi-head {
  grid-template-columns: minmax(0, 1fr) 162px;
  padding: 16px 20px;
  margin-bottom: 8px;
}
body.report-editor-active .powerbi-head h2 {
  font-size: 26px;
  margin: 0;
}
body.report-editor-active .powerbi-head .eyebrow,
body.report-editor-active .powerbi-head .sub {
  display: none !important;
}
body.report-editor-active .report-page-toolbar {
  grid-template-columns: minmax(220px, 1fr) 140px 130px 110px;
  margin-bottom: 8px;
}
body.report-editor-active .report-canvas {
  border-radius: 16px;
  border: 1px solid rgba(188, 203, 225, 0.85);
  background: #f8fbff;
}
body.report-editor-active .page-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0 2px;
  overflow-x: auto;
}
body.report-editor-active .page-tab,
body.report-editor-active .page-add {
  min-height: 38px;
  border-radius: 10px 10px 0 0;
  border: 1px solid #d8e2f2;
  background: #fff;
  color: #122033;
  padding: 9px 16px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}
body.report-editor-active .page-tab.active {
  color: #0f5de8;
  border-color: #b8cff8;
  border-bottom: 3px solid #1f6feb;
}
body.report-editor-active .page-add {
  width: 40px;
  min-width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1f6feb 0%, #3b82f6 100%);
  color: #fff;
  border-color: transparent;
}
body.report-editor-active .bottom-toolbar {
  flex: 0 0 auto;
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(216, 226, 242, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
body.report-editor-active .bottom-toolbar .btn {
  min-height: 38px;
  padding: 8px 14px;
}
body.report-editor-active .advanced-sql-panel {
  margin-top: 8px;
}
body.report-editor-active .advanced-sql-panel summary {
  font-size: 13px;
}
body.report-editor-active .advanced-sql-panel summary::after {
  content: ' opcional';
  color: #64748b;
  font-weight: 700;
}
@media (max-width: 1180px) {
  body.report-editor-active .report-page-toolbar { grid-template-columns: 1fr 1fr; }
  body.report-editor-active .bottom-toolbar { justify-content: flex-start; }
}


/* v3.2.10 - tela cheia com painéis flutuantes de Dados e Visualizações */
#reportDesignerShell:fullscreen,
#reportDesignerShell.designer-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: linear-gradient(180deg, #eef4fb 0%, #e6edf7 100%);
  padding: 12px;
  overflow: hidden;
  display: block;
  position: relative;
}

#reportDesignerShell:fullscreen .report-canvas-panel,
#reportDesignerShell.designer-fullscreen .report-canvas-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

#reportDesignerShell:fullscreen .powerbi-head,
#reportDesignerShell.designer-fullscreen .powerbi-head {
  flex: 0 0 auto;
  margin: 0 0 8px;
  padding: 12px 16px;
  border-radius: 18px;
}

#reportDesignerShell:fullscreen .report-page-toolbar,
#reportDesignerShell.designer-fullscreen .report-page-toolbar {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

#reportDesignerShell:fullscreen .report-canvas,
#reportDesignerShell.designer-fullscreen .report-canvas {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: auto;
  padding: 12px;
  border-radius: 18px;
  background: radial-gradient(circle at 16px 16px, rgba(37,99,235,.12) 1px, transparent 1px), #f8fbff;
  background-size: 16px 16px;
}

#reportDesignerShell:fullscreen .page-tabs,
#reportDesignerShell.designer-fullscreen .page-tabs,
#reportDesignerShell:fullscreen .bottom-toolbar,
#reportDesignerShell.designer-fullscreen .bottom-toolbar,
#reportDesignerShell:fullscreen .advanced-sql-panel,
#reportDesignerShell.designer-fullscreen .advanced-sql-panel {
  flex: 0 0 auto;
}

#reportDesignerShell:fullscreen .powerbi-side-panel,
#reportDesignerShell.designer-fullscreen .powerbi-side-panel {
  position: fixed;
  top: 84px;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: min(360px, calc(100vw - 52px));
  max-height: calc(100vh - 102px);
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(186, 202, 224, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 65px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(12px);
  transition: width .2s ease, right .2s ease, transform .2s ease, box-shadow .2s ease;
}

#reportDesignerShell:fullscreen #visualizationsPane:not(.collapsed),
#reportDesignerShell.designer-fullscreen #visualizationsPane:not(.collapsed) {
  right: 18px;
}

#reportDesignerShell:fullscreen #dataPane:not(.collapsed),
#reportDesignerShell.designer-fullscreen #dataPane:not(.collapsed) {
  right: 18px;
}

#reportDesignerShell:fullscreen .powerbi-side-panel.collapsed,
#reportDesignerShell.designer-fullscreen .powerbi-side-panel.collapsed {
  top: 142px;
  bottom: auto;
  width: 52px;
  height: 178px;
  min-height: 178px;
  max-height: 178px;
  padding: 8px;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

#reportDesignerShell:fullscreen #visualizationsPane.collapsed,
#reportDesignerShell.designer-fullscreen #visualizationsPane.collapsed {
  right: 76px;
}

#reportDesignerShell:fullscreen #dataPane.collapsed,
#reportDesignerShell.designer-fullscreen #dataPane.collapsed {
  right: 18px;
}

#reportDesignerShell:fullscreen .powerbi-side-panel.collapsed .pane-title,
#reportDesignerShell.designer-fullscreen .powerbi-side-panel.collapsed .pane-title {
  height: 100%;
  min-height: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  margin: 0;
  border: 0;
}

#reportDesignerShell:fullscreen .powerbi-side-panel.collapsed .pane-title h3,
#reportDesignerShell.designer-fullscreen .powerbi-side-panel.collapsed .pane-title h3 {
  font-size: 12px;
  letter-spacing: .02em;
  white-space: nowrap;
}

#reportDesignerShell:fullscreen .powerbi-side-panel.collapsed .pane-collapse-btn,
#reportDesignerShell.designer-fullscreen .powerbi-side-panel.collapsed .pane-collapse-btn {
  transform: rotate(180deg);
}

#reportDesignerShell:fullscreen .powerbi-side-panel:not(.collapsed) .pane-title,
#reportDesignerShell.designer-fullscreen .powerbi-side-panel:not(.collapsed) .pane-title {
  position: sticky;
  top: -14px;
  z-index: 2;
  margin: -14px -14px 12px;
  padding: 14px;
  border-radius: 18px 18px 0 0;
  background: rgba(248, 250, 252, 0.98);
  border-bottom: 1px solid #e3eaf5;
}

#reportDesignerShell:fullscreen .powerbi-side-panel:not(.collapsed)::before,
#reportDesignerShell.designer-fullscreen .powerbi-side-panel:not(.collapsed)::before {
  content: 'Painel flutuante';
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1f6feb;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

#reportDesignerShell:fullscreen .advanced-sql-panel[open],
#reportDesignerShell.designer-fullscreen .advanced-sql-panel[open] {
  max-height: 32vh;
  overflow: auto;
}

body.report-designer-fullscreen-active .sidebar-expand-fab {
  display: none !important;
}

@media (max-width: 900px) {
  #reportDesignerShell:fullscreen .powerbi-side-panel:not(.collapsed),
  #reportDesignerShell.designer-fullscreen .powerbi-side-panel:not(.collapsed) {
    width: calc(100vw - 28px);
    right: 14px;
    left: 14px;
  }
  #reportDesignerShell:fullscreen #visualizationsPane.collapsed,
  #reportDesignerShell.designer-fullscreen #visualizationsPane.collapsed { right: 72px; }
  #reportDesignerShell:fullscreen #dataPane.collapsed,
  #reportDesignerShell.designer-fullscreen #dataPane.collapsed { right: 14px; }
}


/* v3.2.11 - topo do menu lateral limpo com logo em destaque */
.brand.brand-pro.brand-logo-only {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px;
  min-height: auto;
}

.brand-logo-only .brand-logo {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  background: rgba(255,255,255,0.06);
  box-shadow: 0 18px 38px rgba(0,0,0,0.22);
}

.brand-status-only {
  width: 100%;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.brand-status-only .brand-meta {
  justify-content: center;
  gap: 8px;
}

.brand-status-only .status-chip,
.brand-status-only .version-badge {
  padding: 6px 10px;
  font-size: 11px;
}

.brand-status-only .db-status {
  width: 100%;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #aebed8;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

body.sidebar-collapsed .brand.brand-pro.brand-logo-only {
  width: 62px;
  padding: 8px;
  gap: 0;
  background: rgba(255,255,255,0.045);
}

body.sidebar-collapsed .brand-logo-only .brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

body.sidebar-collapsed .brand-status-only {
  display: none !important;
}

@media (max-width: 1280px) {
  .brand-logo-only .brand-logo { width: 76px; height: 76px; }
}


/* v3.2.13 - editor de relatório com canvas predominante e páginas excluíveis */
body.report-editor-active .main {
  padding: 12px 14px;
}

body.report-editor-active .powerbi-shell {
  grid-template-columns: minmax(720px, 1fr) 214px 244px;
  gap: 6px;
  height: calc(100vh - 18px);
}

body.report-editor-active .report-canvas-panel {
  background: #ffffff;
  padding: 0;
}

body.report-editor-active .powerbi-head {
  grid-template-columns: minmax(0, 1fr) 150px;
  padding: 10px 14px;
  border-radius: 16px;
  box-shadow: none;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

body.report-editor-active .powerbi-head h2 {
  font-size: 22px;
}

body.report-editor-active .powerbi-head .actions .btn {
  width: 142px;
  min-height: 34px;
  padding: 7px 10px;
}

body.report-editor-active .report-page-toolbar {
  grid-template-columns: minmax(220px, 1fr) 130px 118px 96px;
  gap: 7px;
  padding: 0 2px;
}

body.report-editor-active .report-page-toolbar label {
  font-size: 10px;
  letter-spacing: .01em;
}

body.report-editor-active .report-page-toolbar input {
  min-height: 34px;
  border-radius: 12px;
}

body.report-editor-active .report-canvas {
  min-height: 0;
  padding: 7px;
  border-radius: 14px;
  background: #eef4fb;
}

body.report-editor-active .report-page {
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

body.report-editor-active .powerbi-side-panel {
  border: 1px solid rgba(202, 214, 232, 0.95);
  border-radius: 16px;
  background: rgba(255,255,255,0.96);
  padding: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

body.report-editor-active .pane-title {
  margin: -8px -8px 8px;
  padding: 10px 10px 8px;
  border-radius: 16px 16px 0 0;
  border-bottom: 1px solid #e4ebf5;
  background: #f8fbff;
}

body.report-editor-active .pane-title h3 {
  font-size: 13px;
}

body.report-editor-active .visual-tools-head,
body.report-editor-active .field-bucket h4,
body.report-editor-active .mini-help {
  margin-bottom: 5px;
}

body.report-editor-active .visual-icon-grid.powerbi-icons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

body.report-editor-active .visual-icon {
  min-height: 43px;
  border-radius: 10px;
}

body.report-editor-active .visual-icon span {
  font-size: 14px;
}

body.report-editor-active .visual-icon small {
  font-size: 8px;
}

body.report-editor-active .powerbi-field-list {
  max-height: calc(100vh - 230px);
  overflow: auto;
}

body.report-editor-active .field-row {
  gap: 6px;
  font-size: 11px;
}

body.report-editor-active .field-row span:last-child {
  font-size: 10px;
}

body.report-editor-active .page-tabs {
  align-items: stretch;
  gap: 6px;
  margin-top: 7px;
}

body.report-editor-active .page-tab-wrap {
  display: inline-flex;
  align-items: stretch;
  min-height: 40px;
  border: 1px solid #d8e2f2;
  border-bottom: 3px solid transparent;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

body.report-editor-active .page-tab-wrap.active {
  border-bottom-color: #1f6feb;
  box-shadow: 0 10px 24px rgba(31, 111, 235, 0.10);
}

body.report-editor-active .page-tab-wrap .page-tab {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 38px;
  padding: 8px 14px;
  background: transparent;
}

body.report-editor-active .page-tab-wrap .page-tab.active {
  color: #1f6feb;
}

body.report-editor-active .page-delete {
  width: 34px;
  border: 0;
  border-left: 1px solid #e4ebf5;
  background: #fff;
  color: #8a97aa;
  font-size: 18px;
  font-weight: 900;
}

body.report-editor-active .page-delete:hover:not(:disabled) {
  background: #fee2e2;
  color: #b91c1c;
}

body.report-editor-active .page-delete:disabled {
  opacity: .32;
  cursor: not-allowed;
}

body.report-editor-active .page-add {
  min-width: 42px;
  border-radius: 12px 12px 0 0;
}

body.report-editor-active .bottom-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid #dfe8f5;
  border-radius: 14px;
  background: #fff;
}

body.report-editor-active .canvas-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

body.report-editor-active .advanced-sql-panel {
  margin-top: 7px;
  border-radius: 14px;
  padding: 10px 12px;
}

body.report-editor-active .powerbi-shell.visuals-collapsed { grid-template-columns: minmax(720px, 1fr) 46px 244px; }
body.report-editor-active .powerbi-shell.data-collapsed { grid-template-columns: minmax(720px, 1fr) 214px 46px; }
body.report-editor-active .powerbi-shell.visuals-collapsed.data-collapsed { grid-template-columns: minmax(720px, 1fr) 46px 46px; }

@media (max-width: 1280px) {
  body.report-editor-active .powerbi-shell {
    grid-template-columns: minmax(620px, 1fr) 198px 228px;
  }
  body.report-editor-active .powerbi-shell.visuals-collapsed { grid-template-columns: minmax(620px, 1fr) 46px 228px; }
  body.report-editor-active .powerbi-shell.data-collapsed { grid-template-columns: minmax(620px, 1fr) 198px 46px; }
  body.report-editor-active .powerbi-shell.visuals-collapsed.data-collapsed { grid-template-columns: minmax(620px, 1fr) 46px 46px; }
}

@media (max-width: 1120px) {
  body.report-editor-active .powerbi-shell,
  body.report-editor-active .powerbi-shell.visuals-collapsed,
  body.report-editor-active .powerbi-shell.data-collapsed,
  body.report-editor-active .powerbi-shell.visuals-collapsed.data-collapsed {
    grid-template-columns: 1fr;
  }
  body.report-editor-active .powerbi-side-panel {
    max-height: 340px;
  }
}


/* v3.2.14 - correção do corte no editor de relatórios */
body.report-editor-active {
  overflow: hidden;
}
html.report-editor-active {
  overflow: hidden;
}

body.report-editor-active .app-shell {
  max-width: 100vw;
  overflow: hidden;
}

body.report-editor-active .main,
body.report-editor-active #sqlTab {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

body.report-editor-active .powerbi-shell,
body.report-editor-active .powerbi-shell.visuals-collapsed,
body.report-editor-active .powerbi-shell.data-collapsed,
body.report-editor-active .powerbi-shell.visuals-collapsed.data-collapsed {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 206px 226px;
  gap: 8px;
  overflow: hidden;
}

body.report-editor-active .powerbi-shell.visuals-collapsed {
  grid-template-columns: minmax(0, 1fr) 46px 226px;
}

body.report-editor-active .powerbi-shell.data-collapsed {
  grid-template-columns: minmax(0, 1fr) 206px 46px;
}

body.report-editor-active .powerbi-shell.visuals-collapsed.data-collapsed {
  grid-template-columns: minmax(0, 1fr) 46px 46px;
}

body.report-editor-active .report-canvas-panel,
body.report-editor-active .powerbi-side-panel,
body.report-editor-active .report-page-toolbar,
body.report-editor-active .report-canvas,
body.report-editor-active .page-tabs,
body.report-editor-active .bottom-toolbar {
  min-width: 0;
  max-width: 100%;
}

body.report-editor-active .report-canvas-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.report-editor-active .report-canvas {
  flex: 1 1 auto;
  overflow: hidden;
  max-width: 100%;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.report-editor-active .powerbi-side-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.report-editor-active .visual-icon-grid.powerbi-icons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.report-editor-active .visual-icon {
  min-width: 0;
  padding: 6px 4px;
}

body.report-editor-active .visual-icon span,
body.report-editor-active .visual-icon small,
body.report-editor-active .field-row span,
body.report-editor-active .source-selector,
body.report-editor-active .pane-title h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.report-editor-active .powerbi-field-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

body.report-editor-active .field-bucket {
  flex: 0 0 auto;
}

body.report-editor-active .report-page-toolbar {
  grid-template-columns: minmax(180px, 1fr) 124px 118px 96px;
}

body.report-editor-active .bottom-toolbar {
  flex: 0 0 auto;
}

body.report-editor-active .page-tabs {
  flex: 0 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
}

@media (max-width: 1366px) {
  body.report-editor-active .main { padding: 10px 12px; }
  body.report-editor-active .powerbi-shell,
  body.report-editor-active .powerbi-shell.visuals-collapsed,
  body.report-editor-active .powerbi-shell.data-collapsed,
  body.report-editor-active .powerbi-shell.visuals-collapsed.data-collapsed {
    grid-template-columns: minmax(0, 1fr) 194px 214px;
    gap: 7px;
  }
  body.report-editor-active .powerbi-shell.visuals-collapsed { grid-template-columns: minmax(0, 1fr) 44px 214px; }
  body.report-editor-active .powerbi-shell.data-collapsed { grid-template-columns: minmax(0, 1fr) 194px 44px; }
  body.report-editor-active .powerbi-shell.visuals-collapsed.data-collapsed { grid-template-columns: minmax(0, 1fr) 44px 44px; }
  body.report-editor-active .report-page-toolbar { grid-template-columns: minmax(150px, 1fr) 118px 112px 88px; }
  body.report-editor-active .visual-icon-grid.powerbi-icons { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  body.report-editor-active .visual-icon { min-height: 39px; }
}

@media (max-width: 1180px) {
  body.report-editor-active .powerbi-shell,
  body.report-editor-active .powerbi-shell.visuals-collapsed,
  body.report-editor-active .powerbi-shell.data-collapsed,
  body.report-editor-active .powerbi-shell.visuals-collapsed.data-collapsed {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
  }
  body.report-editor-active .powerbi-side-panel:not(.collapsed) {
    position: fixed;
    z-index: 40;
    top: 12px;
    bottom: 12px;
    width: min(320px, 82vw);
    max-height: calc(100vh - 24px);
  }
  body.report-editor-active #visualizationsPane:not(.collapsed) { right: 62px; }
  body.report-editor-active #dataPane:not(.collapsed) { right: 12px; }
}


/* v3.2.15 - tela cheia limpa: apenas canvas e painéis flutuantes */
#reportDesignerShell:fullscreen .powerbi-head,
#reportDesignerShell.designer-fullscreen .powerbi-head,
#reportDesignerShell:fullscreen .report-page-toolbar,
#reportDesignerShell.designer-fullscreen .report-page-toolbar,
#reportDesignerShell:fullscreen .page-tabs,
#reportDesignerShell.designer-fullscreen .page-tabs,
#reportDesignerShell:fullscreen .bottom-toolbar,
#reportDesignerShell.designer-fullscreen .bottom-toolbar,
#reportDesignerShell:fullscreen .advanced-sql-panel,
#reportDesignerShell.designer-fullscreen .advanced-sql-panel {
  display: none !important;
}

#reportDesignerShell:fullscreen,
#reportDesignerShell.designer-fullscreen {
  padding: 10px;
}

#reportDesignerShell:fullscreen .report-canvas-panel,
#reportDesignerShell.designer-fullscreen .report-canvas-panel {
  display: block;
  height: 100%;
}

#reportDesignerShell:fullscreen .report-canvas,
#reportDesignerShell.designer-fullscreen .report-canvas {
  height: calc(100vh - 20px);
  min-height: calc(100vh - 20px);
  margin: 0;
  padding: 10px;
  border-radius: 20px;
}

#reportDesignerShell:fullscreen .report-page,
#reportDesignerShell.designer-fullscreen .report-page {
  min-height: 720px;
  height: 720px;
}

#reportDesignerShell:fullscreen .powerbi-side-panel,
#reportDesignerShell.designer-fullscreen .powerbi-side-panel {
  top: 18px;
  bottom: 18px;
  max-height: calc(100vh - 36px);
}

#reportDesignerShell:fullscreen .powerbi-side-panel.collapsed,
#reportDesignerShell.designer-fullscreen .powerbi-side-panel.collapsed {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

#reportDesignerShell:fullscreen #visualizationsPane.collapsed,
#reportDesignerShell.designer-fullscreen #visualizationsPane.collapsed {
  right: 78px;
}

#reportDesignerShell:fullscreen #dataPane.collapsed,
#reportDesignerShell.designer-fullscreen #dataPane.collapsed {
  right: 18px;
}

#reportDesignerShell:fullscreen .powerbi-side-panel:not(.collapsed),
#reportDesignerShell.designer-fullscreen .powerbi-side-panel:not(.collapsed) {
  width: min(360px, calc(100vw - 44px));
}

@media (max-width: 900px) {
  #reportDesignerShell:fullscreen .report-canvas,
  #reportDesignerShell.designer-fullscreen .report-canvas {
    height: calc(100vh - 16px);
    min-height: calc(100vh - 16px);
    padding: 8px;
  }
  #reportDesignerShell:fullscreen .powerbi-side-panel.collapsed,
  #reportDesignerShell.designer-fullscreen .powerbi-side-panel.collapsed {
    top: auto;
    bottom: 18px;
    transform: none;
  }
}


/* v3.2.16 - filtros estilo Power BI em Tabelas e Views */
.table-filter-panel {
  margin: 0 0 14px;
  border: 1px solid #d7e3f4;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.table-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e6edf8;
}
.table-filter-head b { font-size: 15px; color: #132238; }
.table-filter-head span { display: block; margin-top: 2px; color: #687890; font-size: 12px; font-weight: 700; }
.table-filter-body {
  display: grid;
  grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px 14px;
}
.table-filter-panel.collapsed .table-filter-body { display: none; }
.table-search-box { min-width: 0; font-size: 12px; font-weight: 800; color: #53637a; }
.table-search-box input { margin-top: 6px; width: 100%; }
.table-filter-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.table-filter-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(130px, .8fr) minmax(120px, .8fr) minmax(120px, .8fr) 38px;
  gap: 8px;
  align-items: center;
}
.table-filter-row select,
.table-filter-row input { width: 100%; min-width: 0; height: 38px; }
.table-filter-row .icon-btn.danger {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}
.table-view-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(248, 251, 255, .92);
  backdrop-filter: blur(8px);
}
@media (max-width: 1100px) {
  .table-filter-body { grid-template-columns: 1fr; }
  .table-filter-row { grid-template-columns: 1fr 1fr; }
  .table-filter-row .icon-btn.danger { width: 100%; }
}
@media (max-width: 720px) {
  .table-filter-head { align-items: flex-start; flex-direction: column; }
  .table-filter-row { grid-template-columns: 1fr; }
}

/* v3.2.x - Filtro compacto inline */
.table-filter-compact {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: var(--panel-bg, #f8fafc);
  margin-bottom: 10px;
  overflow: hidden;
}
.table-filter-compact-row {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  flex-wrap: wrap;
}
.table-search-compact {
  flex: 1; min-width: 180px;
  padding: 6px 10px; font-size: 12px;
  border: 1px solid var(--line, #cbd5e1); border-radius: 6px;
  background: #fff; color: var(--text, #1e293b);
}
.table-search-compact::placeholder { color: #94a3b8; }
.table-filter-compact .table-filter-list {
  padding: 0 10px 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.table-filter-compact .table-filter-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.table-filter-compact .table-filter-row select,
.table-filter-compact .table-filter-row input {
  width: auto; min-width: 100px; max-width: 180px;
  height: 32px; padding: 4px 8px; font-size: 12px;
  border: 1px solid var(--line, #cbd5e1); border-radius: 6px;
  background: #fff; color: var(--text, #1e293b);
}
.table-filter-compact .table-filter-row .icon-btn.danger {
  width: 28px; height: 28px; font-size: 12px;
  border-radius: 6px; background: #fff1f2; color: #be123c;
  border: 1px solid #fecdd3; padding: 0; line-height: 1;
}
.filter-count-badge {
  font-size: 11px; font-weight: 700; color: #1f6feb;
  background: rgba(31,111,235,0.1); padding: 2px 8px; border-radius: 10px;
}

/* Toolbar unificada */
.table-toolbar-panel {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: var(--panel-bg, #f8fafc);
  margin-bottom: 8px;
  overflow: hidden;
}
.table-toolbar-row1 {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 8px;
  flex-wrap: wrap;
}
.toolbar-table-name { font-size: 13px; font-weight: 700; color: var(--text, #1e293b); white-space: nowrap; }
.table-toolbar-row1 .table-search-compact {
  flex: 1; min-width: 160px; max-width: 320px;
  padding: 5px 8px; font-size: 12px;
  border: 1px solid var(--line, #cbd5e1); border-radius: 6px;
  background: #fff; color: var(--text, #1e293b);
}
.toolbar-sep { color: var(--line, #cbd5e1); font-size: 16px; margin: 0 2px; user-select: none; }
.toolbar-info { font-size: 11px; font-weight: 600; color: var(--muted, #64748b); white-space: nowrap; }
.table-toolbar-row2 {
  padding: 0 8px 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.table-toolbar-row2 .table-filter-row {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.table-toolbar-row2 .table-filter-row select,
.table-toolbar-row2 .table-filter-row input {
  width: auto; min-width: 90px; max-width: 160px;
  height: 30px; padding: 3px 6px; font-size: 11px;
  border: 1px solid var(--line, #cbd5e1); border-radius: 5px;
  background: #fff; color: var(--text, #1e293b);
}
.table-toolbar-row2 .table-filter-row .icon-btn.danger {
  width: 24px; height: 24px; font-size: 10px;
  border-radius: 5px; background: #fff1f2; color: #be123c;
  border: 1px solid #fecdd3; padding: 0; line-height: 1;
}


/* v3.2.17 - painel Dados mais limpo */
.data-pane .source-selector {
  gap: 6px;
}

.data-pane #builderTableSelect {
  font-weight: 800;
  color: #172033;
}

.data-pane .field-table-title.clean-field-title {
  justify-content: flex-start;
  gap: 8px;
  font-weight: 900;
  color: #172033;
}

.data-pane .field-table-title.clean-field-title small,
.data-pane .field-row.clean-field-row small {
  display: none !important;
}

.data-pane .field-row.clean-field-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
}

.data-pane .field-row.clean-field-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.data-pane .other-data-sources .field-row.clean-field-row {
  display: flex;
  justify-content: flex-start;
}

.data-pane .other-data-sources h4 {
  color: #6b7a90;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}


/* v3.2.18 - editor mais compacto com páginas renomeáveis */
body.report-editor-active .report-canvas-panel {
  padding: 8px;
  gap: 5px;
}

body.report-editor-active .powerbi-head {
  min-height: 58px;
  padding: 8px 12px;
  margin-bottom: 4px;
}

body.report-editor-active .powerbi-head h2 {
  font-size: 20px;
  line-height: 1.1;
}

body.report-editor-active .powerbi-head .actions {
  gap: 6px;
}

body.report-editor-active .powerbi-head .actions .btn {
  width: 132px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 13px;
  font-size: 12px;
}

body.report-editor-active .report-page-toolbar {
  grid-template-columns: minmax(220px, 1fr) 108px 104px 80px;
  gap: 5px;
  margin: 0;
  padding: 0;
  align-items: end;
}

body.report-editor-active .report-page-toolbar label {
  font-size: 9px;
  gap: 3px;
}

body.report-editor-active .report-page-toolbar input {
  min-height: 30px;
  height: 30px;
  padding: 5px 10px;
  border-radius: 11px;
  font-size: 12px;
}

body.report-editor-active #downloadQueryCsvBtn {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 12px;
  font-size: 12px;
}

body.report-editor-active .compact-top-toolbar {
  order: 3;
  margin: 0;
  padding: 4px 6px;
  min-height: 38px;
  border-radius: 13px;
  background: rgba(255,255,255,0.74);
  box-shadow: none;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

body.report-editor-active .compact-top-toolbar .canvas-toolbar-group {
  gap: 5px;
  flex-wrap: nowrap;
}

body.report-editor-active .compact-top-toolbar .btn,
body.report-editor-active .compact-top-toolbar .compact-btn,
body.report-editor-active .compact-top-toolbar .compact-action {
  min-height: 28px;
  height: 28px;
  padding: 4px 9px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1;
}

body.report-editor-active .compact-top-toolbar .compact-btn {
  min-width: 34px;
}

body.report-editor-active .compact-top-toolbar #canvasZoomResetBtn {
  min-width: 52px;
}

body.report-editor-active .compact-zoom-badge {
  min-height: 26px;
  padding: 5px 8px;
  font-size: 11px;
}

body.report-editor-active .compact-inline-toggle {
  font-size: 11px;
  gap: 5px;
}

body.report-editor-active .report-canvas {
  order: 4;
  padding: 5px;
  border-radius: 13px;
}

body.report-editor-active .compact-page-tabs,
body.report-editor-active .page-tabs {
  order: 5;
  padding: 3px 0 0;
  gap: 4px;
  min-height: 38px;
  max-height: 42px;
}

body.report-editor-active .page-tab-wrap {
  min-height: 34px;
}

body.report-editor-active .page-tab {
  min-height: 34px;
  padding: 7px 24px 7px 12px;
  font-size: 12px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.report-editor-active .page-delete {
  width: 20px;
  height: 20px;
  right: 3px;
  font-size: 14px;
}

body.report-editor-active .page-add {
  width: 38px;
  min-width: 38px;
  height: 34px;
  border-radius: 9px;
}

body.report-editor-active .advanced-sql-panel {
  order: 6;
  margin-top: 4px;
  padding: 8px 10px;
}

body.report-editor-active .report-page-toolbar + .compact-top-toolbar {
  margin-top: 2px;
}

body.report-editor-active .visual-frame-head {
  min-height: 34px;
  padding: 8px 12px;
}

body.report-editor-active .visual-content {
  padding: 8px;
}

@media (max-width: 1366px) {
  body.report-editor-active .report-page-toolbar {
    grid-template-columns: minmax(190px, 1fr) 100px 96px 74px;
  }
  body.report-editor-active .compact-top-toolbar .compact-action {
    padding-left: 8px;
    padding-right: 8px;
  }
}


/* v3.2.19 - ações lado a lado e zoom abaixo das páginas */
body.report-editor-active .powerbi-head {
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
}
body.report-editor-active .powerbi-head .actions {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}
body.report-editor-active .powerbi-head .actions .btn {
  width: auto;
  min-width: 132px;
  height: 32px;
  min-height: 32px;
  padding: 5px 14px;
  white-space: nowrap;
}
body.report-editor-active .report-page-toolbar {
  grid-template-columns: minmax(200px,1fr) 92px 92px 84px;
  gap: 4px;
}
body.report-editor-active .report-page-toolbar label {
  font-size: 9px;
}
body.report-editor-active .report-page-toolbar input,
body.report-editor-active #downloadQueryCsvBtn {
  height: 28px;
  min-height: 28px;
}
body.report-editor-active .report-canvas {
  order: 4;
}
body.report-editor-active .compact-page-tabs,
body.report-editor-active .page-tabs {
  order: 5;
  margin: 0;
}
body.report-editor-active .compact-top-toolbar {
  order: 6;
  margin-top: -1px;
  padding-top: 2px;
}
body.report-editor-active .advanced-sql-panel {
  order: 7;
}
body.report-editor-active .compact-top-toolbar .canvas-toolbar-group {
  gap: 4px;
}
body.report-editor-active .compact-top-toolbar .btn,
body.report-editor-active .compact-top-toolbar .compact-btn,
body.report-editor-active .compact-top-toolbar .compact-action {
  min-height: 26px;
  height: 26px;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
}
body.report-editor-active .compact-top-toolbar .compact-btn { min-width: 30px; }
body.report-editor-active .compact-top-toolbar #canvasZoomResetBtn { min-width: 48px; }
body.report-editor-active .compact-zoom-badge { min-height: 24px; font-size: 10px; padding: 4px 7px; }
body.report-editor-active .compact-inline-toggle { font-size: 10px; }
body.report-editor-active .page-tab {
  min-height: 32px;
  padding: 6px 22px 6px 10px;
  font-size: 11px;
  max-width: 126px;
}
body.report-editor-active .page-add { width: 34px; min-width: 34px; height: 32px; }
body.report-editor-active .page-delete { width: 18px; height: 18px; font-size: 12px; }
@media (max-width: 1366px) {
  body.report-editor-active .powerbi-head { grid-template-columns: minmax(0,1fr) auto; }
  body.report-editor-active .report-page-toolbar { grid-template-columns: minmax(180px,1fr) 86px 86px 80px; }
  body.report-editor-active .powerbi-head .actions .btn { min-width: 120px; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 1180px) {
  body.report-editor-active .powerbi-head { grid-template-columns: 1fr; }
  body.report-editor-active .powerbi-head .actions { justify-content: flex-start; }
}


/* v3.2.20 - formatação avançada do visual estilo Power BI */
.visual-format-pane {
  display: grid;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
}

.visual-format-pane .format-pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 2px;
}

.format-pane-header h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 900;
  color: #172033;
}

.format-pane-header .mini-help {
  margin: 0;
  font-size: 10px;
  color: #64748b;
  line-height: 1.3;
}

.format-selected-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  max-width: 110px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1757a6;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.format-section {
  border: 1px solid #e1e9f5;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 13px;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.format-section-title {
  font-size: 11px;
  font-weight: 950;
  color: #172033;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.format-section label {
  font-size: 11px;
  font-weight: 850;
  color: #53637a;
}
.format-section input,
.format-section select {
  min-height: 32px;
  height: 32px;
  font-size: 12px;
}
.visual-frame {
  background: var(--visual-bg, #fff) !important;
  color: var(--visual-text, #0f172a);
  font-family: var(--visual-font, Inter, Segoe UI, Arial, sans-serif);
  border-radius: var(--visual-radius, 14px) !important;
  padding: var(--visual-padding, 8px) !important;
}
.visual-frame.no-border { border-color: transparent !important; }
.visual-frame.has-border { border-color: var(--visual-accent, #2563eb) !important; }
.visual-frame.no-shadow { box-shadow: none !important; }
.visual-frame.has-shadow { box-shadow: 0 18px 34px rgba(15,23,42,.14) !important; }
.visual-frame.hide-title .visual-frame-head { display: none !important; }
.visual-frame .visual-frame-head {
  background: var(--visual-title-bg, #fff);
  color: var(--visual-title-text, #0f172a);
  border-radius: calc(var(--visual-radius, 14px) - 4px) calc(var(--visual-radius, 14px) - 4px) 8px 8px;
  padding: 8px 10px;
  text-align: var(--visual-title-align, left);
  border-bottom: 1px solid rgba(211,221,236,.8);
}
.visual-frame .visual-title-preview {
  color: var(--visual-title-text, #0f172a);
  font-size: var(--visual-title-size, 14px);
  width: 100%;
}
.visual-frame .visual-content {
  color: var(--visual-text, #0f172a);
  font-size: var(--visual-body-size, 12px);
}
.visual-table-wrap {
  height: 100%;
  border-radius: calc(var(--visual-radius, 14px) - 4px);
}
.visual-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--visual-body-size, 12px);
  color: var(--visual-text, #0f172a);
}
.visual-table th {
  background: var(--visual-header-bg, #eef4fb) !important;
  color: var(--visual-header-text, #172033) !important;
  font-size: var(--visual-header-size, 12px);
  text-align: var(--visual-header-align, left);
  position: sticky;
  top: 0;
  z-index: 1;
}
.visual-table td {
  text-align: var(--visual-cell-align, left);
  font-size: var(--visual-body-size, 12px);
}
.visual-table.density-compact th,
.visual-table.density-compact td { padding: 5px 7px; line-height: 1.15; }
.visual-table.density-normal th,
.visual-table.density-normal td { padding: 8px 10px; line-height: 1.28; }
.visual-table.density-comfortable th,
.visual-table.density-comfortable td { padding: 11px 12px; line-height: 1.42; }
.visual-table.zebra-rows tbody tr:nth-child(even) td { background: rgba(31,111,235,.035); }
.visual-table.no-zebra tbody tr td { background: transparent; }
.visual-table.no-grid th,
.visual-table.no-grid td { border-color: transparent !important; }
.visual-table.show-grid th,
.visual-table.show-grid td { border-bottom: 1px solid #edf2f8 !important; }
.visual-frame .bar-fill,
.visual-frame .line-chart .line,
.visual-frame .scatter-dot {
  stroke: var(--visual-accent, #2563eb);
  background: var(--visual-accent, #2563eb);
}
.visual-frame .metric-card strong,
.visual-frame .kpi-card strong {
  color: var(--visual-accent, #2563eb);
}
@media (max-width: 1366px) {
  .format-section { padding: 8px; gap: 6px; }
  .format-section input, .format-section select { height: 30px; min-height: 30px; }
}


/* BI WA v3.2.21 - painel inicial Admin/Online */
.biwa-start-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) repeat(3, minmax(170px, 1fr));
  gap: 14px;
  margin: -8px 0 20px;
}
.biwa-start-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
  min-height: 120px;
}
.biwa-start-card.main-card {
  background: radial-gradient(circle at top left, rgba(31,111,235,0.14), transparent 34%), #ffffff;
}
.biwa-start-card h3 { margin: 6px 0 6px; font-size: 21px; letter-spacing: -0.02em; }
.biwa-start-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.biwa-start-card b { display: block; margin: 12px 0 7px; font-size: 15px; }
.biwa-start-card small { color: var(--muted); line-height: 1.45; }
.start-step {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf2ff;
  color: var(--brand);
  font-weight: 900;
}
.biwa-start-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.viewer-mode .biwa-start-panel { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.viewer-mode .biwa-start-card.main-card { display: none; }
@media (max-width: 1180px) {
  .biwa-start-panel { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .biwa-start-panel, .viewer-mode .biwa-start-panel { grid-template-columns: 1fr; }
}

/* v3.2.22 - páginas e formatação preservadas no Online/Viewer */
.dashboard-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.dashboard-page-tab {
  border: 1px solid var(--line);
  background: #f8fbff;
  color: #334155;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.dashboard-page-tab.active {
  background: #eaf2ff;
  border-color: #9dc1ff;
  color: #174ea6;
}
.dashboard-visual-box {
  border-radius: var(--visual-radius, 12px);
  padding: var(--visual-padding, 10px);
  font-family: var(--visual-font, Inter, Segoe UI, Arial, sans-serif);
}
.dashboard-visual-box.no-border { border-color: transparent !important; }
.dashboard-visual-box.no-shadow { box-shadow: none; }
.dashboard-visual-box.hide-title .dashboard-visual-title { display: none; }
.dashboard-visual-box.hide-title .dashboard-visual-body { height: 100%; }
.dashboard-visual-title {
  background: var(--visual-title-bg, transparent);
  color: var(--visual-title-text, var(--visual-text, #0f172a));
  font-size: var(--visual-title-size, 14px);
  justify-content: var(--visual-title-align, flex-start);
  text-align: var(--visual-title-align, left);
  border-radius: calc(var(--visual-radius, 12px) - 4px);
  padding: 4px 6px;
}
.dashboard-visual-body .visual-table th {
  background: var(--visual-header-bg, #eef4fb);
  color: var(--visual-header-text, #172033);
  font-size: var(--visual-header-size, 12px);
  text-align: var(--visual-header-align, left);
}
.dashboard-visual-body .visual-table td {
  font-size: var(--visual-body-size, 12px);
  text-align: var(--visual-cell-align, left);
}

/* v3.2.23 - Etapa 1: editor Admin mais próximo do Power BI */
.powerbi-editor-head {
  border: 1px solid #dbe7f6;
  background: radial-gradient(circle at top left, rgba(31,111,235,.13), transparent 32%), linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 14px 32px rgba(15,23,42,.06);
}
.powerbi-editor-head h2 { letter-spacing: -.035em; }
.powerbi-editor-head .sub { max-width: 760px; }
.editor-main-actions { gap: 7px; }
.editor-main-actions .btn { min-width: 118px !important; }
.powerbi-editor-ribbon.unified-ribbon {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #f8fbff;
  border: 1px solid #dbe7f6;
  border-radius: 14px;
  align-items: stretch;
  height: 74px;
  min-height: 74px;
  max-height: 74px;
  box-sizing: border-box;
  overflow: hidden;
}
.measure-tools-ribbon {
  height: 74px;
  min-height: 74px;
  max-height: 74px;
  flex-wrap: nowrap !important;
  overflow: hidden;
  box-sizing: border-box;
}
.measure-tools-ribbon .ribbon-tool-group {
  flex: 0 1 auto;
  min-width: 0;
  padding: 4px 9px;
  overflow: hidden;
}
.measure-tools-ribbon .ribbon-tool-group--measure-struct { flex-basis: 205px; }
.measure-tools-ribbon .ribbon-tool-group--measure-format { flex-basis: 280px; }
.measure-tools-ribbon .ribbon-tool-group--measure-props { flex-basis: 245px; }
.measure-tools-ribbon .ribbon-tool-group-content {
  flex-wrap: nowrap;
  overflow: hidden;
}
.measure-tools-ribbon .ribbon-tool-group-content--col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.ribbon-inline-label {
  display: grid;
  gap: 3px;
  color: #475569;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
  min-width: 0;
}
.ribbon-text-input,
.ribbon-select,
.ribbon-decimal-input {
  height: 28px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #cfd9e8;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  box-sizing: border-box;
}
.ribbon-text-input { width: 175px; }
.ribbon-select { width: 165px; }
.ribbon-decimal-input { width: 58px; }
.ribbon-format-row,
.ribbon-calc-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.measure-tools-ribbon .btn.compact-btn {
  min-height: 26px;
  height: 26px;
  padding: 3px 8px !important;
}
.ribbon-format-symbol,
.ribbon-decimal-btn {
  min-width: 28px !important;
  width: 28px;
}
.ribbon-calc-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ribbon-calc-icon { font-weight: 900; }
.measure-tools-ribbon-close {
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #e2edfb;
}
.ribbon-tool-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px;
  border-right: 1px solid #e2edfb;
}
.ribbon-tool-group:last-child { border-right: none; }
.ribbon-tool-group-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #174ea6;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.ribbon-tool-group-content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ribbon-tool-group-content select {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  max-width: 180px;
}
.ribbon-tool-group-content .btn.compact-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.ribbon-organizar-group { flex: 0 0 auto; min-width: 240px; display: none; }
.ribbon-zorder-btns { display: flex; gap: 1px; align-items: center; background: #f0f4fa; border-radius: 6px; padding: 2px; }
.ribbon-zorder-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 10px !important; font-size: 11px; font-weight: 600; color: #1a3a6b; border-radius: 5px; border: none; background: transparent; transition: background .12s ease, color .12s ease; min-width: 36px; white-space: nowrap; }
.ribbon-zorder-btn:hover { background: #dce6f2; color: #0a2540; }
.ribbon-zorder-btn:active { background: #c8d6eb; }
.ribbon-zorder-icon { font-size: 11px; line-height: 1; opacity: .8; }
.ribbon-tool-group--measure-formula { flex: 3 1 520px; min-width: 420px; }
.ribbon-measure-formula-content {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.ribbon-measure-formula-wrapper {
  border: 1px solid #cfe0f6;
  border-radius: 10px;
  background: #fff;
  min-height: 48px;
  overflow: visible;
}
.ribbon-measure-formula-wrapper:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}
.ribbon-measure-formula {
  position: relative;
  width: 100%;
  min-height: 48px;
  max-height: 92px;
  resize: vertical;
  padding: 8px 10px;
  border: 0 !important;
  outline: none;
  background: transparent !important;
  color: transparent;
  caret-color: #172033;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.35;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.ribbon-measure-formula-wrapper .measure-formula-highlight {
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}
.ribbon-measure-editor-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 112px;
}
.ribbon-measure-editor-actions .btn { width: 100%; justify-content: center; }
.ribbon-measure-suggestions { z-index: 2600; max-height: 260px; }
.measure-formula-bar {
  display: flex;
  align-items: flex-start;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--measure-formula-top, 154px);
  z-index: 2200;
  margin: 0;
  min-height: 38px;
  max-height: 300px;
  background: transparent;
  overflow: visible;
  pointer-events: auto;
}
.measure-formula-bar[hidden] { display: none !important; }
.measure-formula-action {
  border: 0;
  border-top: 1px solid #d0dcee;
  border-bottom: 1px solid #d0dcee;
  background: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  flex: 0 0 34px;
}
.measure-formula-action:first-child {
  border-left: 1px solid #d0dcee;
  border-radius: 6px 0 0 0;
}
.measure-formula-action.cancel { color: #d11f1f; }
.measure-formula-action.apply { color: #16823a; font-size: 22px; }
.measure-formula-action:hover { background: #eef5ff; }
.measure-formula-equals {
  border: 0;
  border-top: 1px solid #d0dcee;
  border-bottom: 1px solid #d0dcee;
  border-right: 1px solid #d0dcee;
  background: #f8fafc;
  color: #475569;
  display: grid;
  place-items: center;
  font-weight: 900;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  flex: 0 0 26px;
}
.measure-formula-bar-wrapper {
  position: relative;
  min-height: 38px;
  background: #fff;
  flex: 1;
  border: 1px solid #d0dcee;
  border-left: none;
  border-radius: 0 6px 6px 6px;
}
.measure-formula-input {
  position: relative;
  width: 100%;
  min-height: 38px;
  max-height: 280px;
  padding: 8px 10px;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none;
  background: transparent !important;
  color: transparent;
  caret-color: #172033;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: none;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.measure-formula-bar-wrapper .measure-formula-highlight {
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
}
.measure-formula-suggestions {
  z-index: 3000;
  max-height: 300px;
}
/* DAX measure ribbon: fixed Power BI-like sizing, no layout push */
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon {
  display: none;
  align-items: stretch;
  gap: 0;
  padding: 6px 8px;
  height: 74px;
  min-height: 74px;
  max-height: 74px;
  overflow: hidden;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group {
  flex: 0 0 auto;
  height: 62px;
  padding: 3px 10px;
  gap: 3px;
  justify-content: flex-start;
  overflow: hidden;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-struct { width: 250px; }
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-format { width: 430px; }
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group--measure-props { width: 330px; }
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group-label {
  height: 13px;
  line-height: 13px;
  font-size: 10px;
  white-space: nowrap;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group-content {
  height: 42px;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-tool-group-content--col {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-inline-label {
  font-size: 10px;
  line-height: 1;
  gap: 2px;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-text-input,
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-select,
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-decimal-input {
  height: 24px;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 16px;
  max-width: none;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-text-input { width: 220px; }
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-select { width: 180px; }
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon #ribbonMeasureCategory { width: 285px; }
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-decimal-input {
  width: 38px;
  text-align: center;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-format-row {
  height: 24px;
  gap: 4px;
  flex: 0 0 auto;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .btn.compact-btn {
  height: 24px;
  min-height: 24px;
  padding: 2px 7px !important;
  border-radius: 4px;
  font-size: 10.5px;
}
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-format-symbol,
.powerbi-editor-ribbon.unified-ribbon.measure-tools-ribbon .ribbon-decimal-btn {
  width: 24px;
  min-width: 24px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.builder-measure-row.selected { background: #e8f0fe; outline: 2px solid #1a73e8; outline-offset: -2px; border-radius: 8px; }
.builder-measure-row.selected .field-row { background: transparent; }
.measure-tools-ribbon { display: none; }
.measure-tools-ribbon.measure-tools-ribbon { display: none; }
.model-errors-container { margin: 8px 0; padding: 10px 14px; background: #fef8e7; border: 1px solid #f5c542; border-radius: 12px; color: #5c3d00; font-size: 12px; }
.model-errors-header { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; margin-bottom: 6px; color: #8a5600; }
.model-errors-list { display: flex; flex-direction: column; gap: 4px; }
.model-error-item { display: flex; align-items: flex-start; gap: 6px; padding: 4px 0; line-height: 1.4; }
.model-error-icon { flex-shrink: 0; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 11px; background: #f0e6c8; border-radius: 4px; }
.model-error-coluna .model-error-icon { background: #e0ecfe; color: #1a73e8; }
.model-error-relacionamento .model-error-icon { background: #fce4ec; color: #c62828; }
.model-error-medida .model-error-icon { background: #e8f5e9; color: #2e7d32; }
.model-check.preview-active { background: #e8f0fe; border-radius: 6px; }
.model-check.preview-active span { cursor: pointer; }
.model-check span { cursor: pointer; }
.model-item-preview { background: #f0f7ff; border-left: 3px solid #1a73e8; padding-left: 10px; margin-top: 4px; border-radius: 6px; }
.model-preview-divider { font-size: 10px; font-weight: 700; color: #1a73e8; text-transform: uppercase; letter-spacing: .04em; padding: 8px 4px 4px; border-top: 1px dashed #b7c8df; margin-top: 8px; }
.badge-preview { display: inline-block; font-size: 9px; font-weight: 700; color: #1a73e8; background: #e0ecfe; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.badge-type { display: inline-block; font-size: 9px; font-weight: 600; color: #475569; background: #e9eef3; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.designer-status-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  border: 1px solid #dbe7f6;
  background: #f8fbff;
  border-radius: 13px;
  padding: 7px 9px;
  margin-bottom: 6px;
  color: #475569;
  font-size: 11px;
  font-weight: 750;
}
.designer-status-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid #e1e9f5;
  background: #ffffff;
  border-radius: 999px;
}
.powerbi-side-panel.focus-flash,
.report-canvas-panel.focus-flash {
  animation: biwaFocusFlash 1.15s ease;
}
/* Visualizations pane - aproveita todo espaco disponivel */
body.report-editor-active .visualizations-pane {
  padding: 10px;
}
body.report-editor-active .visualizations-pane .pane-title {
  padding-bottom: 6px;
  margin-bottom: 8px;
}
body.report-editor-active .visualizations-pane .visual-pane-tabs {
  margin: 0 0 6px;
}
body.report-editor-active .visualizations-pane .visual-icon-grid {
  margin-bottom: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
body.report-editor-active .visualizations-pane .visual-icon {
  min-height: 44px;
  padding: 5px 2px;
}
body.report-editor-active .visualizations-pane .field-bucket {
  margin-top: 6px;
  padding-top: 6px;
}
body.report-editor-active .visualizations-pane .field-bucket.visual-format-pane,
body.report-editor-active .visualizations-pane .field-bucket.visual-analytics-pane {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
body.report-editor-active .visualizations-pane .field-bucket h4 {
  margin: 0 0 6px;
}
body.report-editor-active .visualizations-pane .visual-field-drop-grid {
  margin: 4px 0 6px;
  gap: 5px;
}
body.report-editor-active .visualizations-pane .visual-field-drop.has-pills {
  padding: 3px 4px;
}
@keyframes biwaFocusFlash {
  0% { box-shadow: 0 0 0 0 rgba(31,111,235,.34); border-color: #1f6feb; }
  100% { box-shadow: none; }
}
body.report-editor-active .visualizations-pane .field-bucket h4,
body.report-editor-active .data-pane .pane-title h3 {
  display: flex;
  align-items: center;
  gap: 6px;
}
body.report-editor-active .visualizations-pane .field-bucket h4::before,
body.report-editor-active .data-pane .pane-title h3::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #1f6feb;
  box-shadow: 0 0 0 4px rgba(31,111,235,.10);
}
@media (max-width: 1366px) {
  .powerbi-editor-head { padding: 11px 13px; }
  .powerbi-editor-head .sub { display: none; }
  .powerbi-editor-ribbon.unified-ribbon { flex-wrap: wrap; }
  .ribbon-tool-group { flex: 1 1 200px; border-right: none; }
}
@media (max-width: 980px) {
  .powerbi-editor-ribbon.unified-ribbon { flex-direction: column; }
  .ribbon-tool-group { border-right: none; border-bottom: 1px solid #e2edfb; padding: 8px 6px; }
  .ribbon-tool-group:last-child { border-bottom: none; }
  .editor-main-actions .btn { min-width: 0 !important; }
}

/* v3.2.24 - Etapa 2: painel Campos/Dados mais próximo do Power BI */
.visual-field-drop-grid {
  display: grid;
  gap: 6px;
  margin: 6px 0 8px;
}
.visual-field-drop {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 4px 8px;
  align-items: center;
  min-height: 52px;
  padding: 8px 8px 8px 10px;
  border: 1px dashed #b7c8df;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff, #f4f8ff);
  color: var(--text);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.visual-field-drop .drop-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.visual-field-drop strong {
  grid-column: 1 / 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.visual-field-drop .drop-clear {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  border: 1px solid #d6e1ef;
  border-radius: 7px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}
.visual-field-drop.has-field {
  border-style: solid;
  border-color: #7aa7e8;
  background: #edf5ff;
}
.visual-field-drop.has-pills {
  padding: 5px 6px;
  grid-template-columns: 1fr;
  gap: 5px;
  border: 1px solid #bdd3f0;
  background: #f8fbff;
  min-height: auto;
}
#visualFieldDropGrid .visual-field-drop:not(.has-field):not(.has-pills) {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 34px;
  padding: 5px 9px;
  gap: 8px;
  border-color: #c9d6e7;
  border-radius: 8px;
  background: #f8fbff;
}
#visualFieldDropGrid .visual-field-drop:not(.has-field):not(.has-pills) .drop-label {
  grid-column: 1;
  color: #51657e;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}
#visualFieldDropGrid .visual-field-drop:not(.has-field):not(.has-pills) strong {
  grid-column: 2;
  color: #7b8da5;
  font-size: 10px;
  font-weight: 650;
  text-align: right;
}
#visualFieldDropGrid .visual-field-drop:not(.has-field):not(.has-pills) strong::before {
  content: "+";
  display: inline-block;
  margin-right: 4px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}
#visualFieldDropGrid .visual-field-drop:not(.has-field):not(.has-pills) .drop-clear {
  display: none !important;
}
#visualFieldDropGrid .visual-field-drop:not(.has-field):not(.has-pills):hover {
  border-color: #7aa7e8;
  background: #f1f7ff;
}
#visualFieldDropGrid .visual-field-drop.matrix-bucket,
#visualFieldDropGrid .visual-field-drop.matrix-bucket.has-pills,
#visualFieldDropGrid .visual-field-drop.matrix-bucket:not(.has-field):not(.has-pills) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  padding: 0;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0 !important;
}
#visualFieldDropGrid:has(.visual-field-drop.matrix-bucket) {
  gap: 7px;
  align-items: stretch;
}
#visualFieldDropGrid .visual-field-drop.matrix-bucket .drop-label,
#visualFieldDropGrid .visual-field-drop.matrix-bucket.has-pills .drop-label {
  display: flex;
  grid-column: 1;
  align-items: center;
  height: 10px;
  padding: 0 2px;
  margin: 0;
  color: #52657d;
  font-size: 9px;
  font-weight: 750;
  line-height: 10px;
  letter-spacing: .02em;
}
#visualFieldDropGrid .visual-field-drop.matrix-bucket:not(.has-field):not(.has-pills) strong {
  display: flex;
  grid-column: 1;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 29px;
  min-height: 29px;
  padding: 4px 8px;
  box-sizing: border-box;
  border: 1px dashed #c4d1e2;
  border-radius: 6px;
  background: #fbfdff;
  color: #7b8da5;
  text-align: left;
}
#visualFieldDropGrid .visual-field-drop.matrix-bucket:not(.has-field):not(.has-pills):hover strong {
  border-color: #7aa7e8;
  background: #f1f7ff;
}
#visualFieldDropGrid .visual-field-drop.matrix-bucket.has-pills .visual-field-pills {
  gap: 3px;
  width: 100%;
}
#visualFieldDropGrid .visual-field-drop.matrix-bucket .visual-field-pill {
  min-height: 29px;
  box-sizing: border-box;
}
.visual-field-drop.has-pills .drop-label {
  display: none;
}
.visual-field-drop.matrix-bucket.has-pills .drop-label {
  display: block;
}
.visual-field-drop.drag-over {
  border-color: #2563eb;
  background: #dbeafe;
  transform: translateY(-1px);
}

.matrix-visual-wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
}
.matrix-pivot-table {
  min-width: 100%;
  width: max-content;
}
.matrix-pivot-table .matrix-row-field:first-child,
.matrix-pivot-table .matrix-row-value:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}
.matrix-pivot-table .matrix-row-field:first-child {
  z-index: 4;
}
.matrix-pivot-table .matrix-row-value {
  background: var(--visual-bg, #fff);
  font-weight: 600;
}
.matrix-pivot-table .matrix-value-field,
.matrix-pivot-table .matrix-aggregated-value {
  min-width: 92px;
}
.matrix-pivot-table.table-fixed .matrix-value-field,
.matrix-pivot-table.table-fixed .matrix-aggregated-value {
  min-width: 0;
}
.matrix-pivot-table .matrix-total-label {
  text-align: left;
  font-weight: 800;
}

#pageFilterDropGrid .visual-field-drop,
#allPagesFilterDropGrid .visual-field-drop {
  grid-template-columns: 1fr;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px dashed #cdd7e6;
  background: #f8fbff;
  border-radius: 8px;
}
#pageFilterDropGrid .visual-field-drop strong,
#allPagesFilterDropGrid .visual-field-drop strong {
  font-size: 12px;
  color: #8899aa;
  font-weight: 500;
}
#pageFilterDropGrid .visual-field-drop.drag-over,
#allPagesFilterDropGrid .visual-field-drop.drag-over {
  border-color: var(--accent);
  background: #eef4ff;
  transform: translateY(-1px);
}
#pageFilterDropGrid .visual-field-drop.drag-over strong,
#allPagesFilterDropGrid .visual-field-drop.drag-over strong {
  color: var(--accent);
}

/* Field pills inside drop zone (Power BI-style individual column cards) */
.visual-field-pills {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 10px;
}
.visual-field-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 10px;
  border: 1px solid #bdd3f0;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  cursor: grab;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  user-select: none;
  min-height: 34px;
}
.visual-field-pill:hover {
  border-color: #7aa7e8;
  box-shadow: 0 0 0 2px rgba(31,111,235,0.10);
}
.visual-field-pill.filter-pill {
  border-color: #f0c45a;
  background: #fffdf5;
}
.visual-field-pill.filter-pill:hover {
  border-color: #d4a52a;
  box-shadow: 0 0 0 2px rgba(212,165,42,0.12);
}
.visual-field-pill .pill-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: #172033;
  pointer-events: none;
}
.visual-field-pill .pill-remove {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 11px;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.visual-field-pill .pill-remove:hover {
  color: #ef4444;
  border-color: #fecaca;
  background: #fef2f2;
}
.visual-field-pill .pill-menu-btn {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.visual-field-pill .pill-menu-btn:hover {
  color: #2563eb;
  border-color: #bdd3f0;
  background: #eff6ff;
}
.visual-field-pill.dragging-pill {
  opacity: 0.5;
  border-style: dashed;
}
.visual-field-pill.pill-drag-over {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: 0 0 0 2px rgba(31,111,235,0.15);
}

/* Visual filter cards (Power BI-style filter pane) */
.visual-filter-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

.visual-filter-card {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.visual-filter-card.filter-active {
  border-color: var(--accent, #2563eb);
  background: #f8faff;
}

.visual-filter-card.collapsed .visual-filter-card-header {
  border-bottom: 1px solid transparent;
}

.visual-filter-card.expanded .visual-filter-card-header {
  border-bottom: 1px solid #e0e0e0;
}

.visual-filter-card-header {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  background: #f4f4f4;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s ease;
}

.visual-filter-card-header:hover {
  background: #e8ecf1;
}

.filter-card-caret {
  font-size: 10px;
  color: #888;
  width: 12px;
  flex-shrink: 0;
  text-align: center;
  transition: transform 0.15s ease;
}

.visual-filter-card.expanded .filter-card-caret {
  color: #444;
}

.visual-filter-card-header .filter-type-icon {
  font-size: 11px;
  font-style: normal;
  color: #888;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.visual-filter-card-header .filter-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-card-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--accent, #2563eb);
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
  flex-shrink: 0;
  line-height: 16px;
}

.filter-card-clear {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}

.filter-card-clear:hover {
  background: #fce4e4;
  color: #c62828;
}

.visual-filter-card-header .filter-card-remove {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.visual-filter-card-header .filter-card-remove:hover {
  background: #fce4e4;
  color: #c62828;
}

.visual-filter-card-body {
  padding: 8px;
  max-height: 300px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.visual-filter-card .filter-card-loading {
  padding: 8px;
  font-size: 11px;
  color: #999;
  text-align: center;
}

.visual-filter-card-body .filter-values-search {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 11px;
  margin-bottom: 6px;
  background: #fff;
  box-sizing: border-box;
}

.visual-filter-card-body .filter-values-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

.visual-filter-card-body .filter-values-list {
  max-height: 180px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 3px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #fff;
}

.visual-filter-card-body .filter-value-item {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  margin: 0;
  border-bottom: 1px solid #f5f5f5;
}

.visual-filter-card-body .filter-value-item:last-child {
  border-bottom: none;
}

.visual-filter-card-body .filter-value-item:hover {
  background: #eff4fc;
}

.visual-filter-card-body .filter-values-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 11px;
}

.visual-filter-card-body .filter-values-bar .transform-values-label {
  font-size: 11px;
  color: #666;
}

.visual-filter-card-empty {
  padding: 10px;
  font-size: 11px;
  color: #999;
  text-align: center;
}

.visual-filter-drop-surface {
  min-height: 0;
  border-radius: 8px;
  transition: background-color .12s ease, box-shadow .12s ease;
}

.visual-filter-drop-surface.drag-over {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px #60a5fa;
}

.visual-filter-card-header .filter-card-heading {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.visual-filter-card-header .filter-card-heading .filter-card-title {
  display: block;
  width: 100%;
  flex: 0 1 auto;
}

.visual-filter-card-header .filter-card-heading small {
  overflow: hidden;
  color: #64748b;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-filter-card-body .filter-values-bar {
  flex-wrap: wrap;
  gap: 5px;
}

.visual-filter-card-body .filter-values-bar .actions {
  display: inline-flex;
  gap: 4px;
}

.visual-filter-card-body input:disabled,
.visual-filter-card-body button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

/* Pill context dropdown menu (Power BI-style ▼ column menu) */
.pill-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 200px;
  max-width: 280px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 4px 0;
  font-family: inherit;
  font-size: 13px;
  animation: pill-menu-fade-in .12s ease;
}
@keyframes pill-menu-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pill-menu-separator {
  height: 1px;
  background: #eaeaea;
  margin: 4px 8px;
}
.pill-menu-item {
  display: block;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: #172033;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .1s ease;
}
.pill-menu-item:hover {
  background: #f0f4ff;
  color: #0a2f7a;
}
.pill-menu-item.danger {
  color: #d13438;
}
.pill-menu-item.danger:hover {
  background: #fef2f2;
  color: #b5252a;
}

/* Submenu arrow */
.pill-menu-has-sub {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pill-sub-arrow {
  font-size: 10px;
  color: #8a8a8a;
  flex-shrink: 0;
}
.pill-menu-has-sub:hover .pill-sub-arrow {
  color: #0a2f7a;
}

/* Submenu panel - inline (hidden by default, used only for structure) */
.pill-submenu {
  display: none;
}

/* Flyout submenu panel */
.pill-flyout-menu {
  position: fixed;
  z-index: 10001;
  min-width: 200px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 4px 0;
  font-family: inherit;
  font-size: 13px;
  animation: pill-menu-fade-in .12s ease;
}
.pill-flyout-menu .pill-menu-item {
  padding-left: 14px;
  font-size: 13px;
}

/* Radio dot for aggregation / show-value-as selections */
.pill-menu-radio {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 6px 14px;
}
.pill-radio-dot {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid #c4c4c4;
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.pill-menu-radio.checked .pill-radio-dot {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: inset 0 0 0 2px #fff;
}
.pill-menu-radio.checked {
  color: #0a2f7a;
  font-weight: 600;
}
.pill-menu-radio:hover .pill-radio-dot {
  border-color: #7aa7e8;
}
.pill-menu-radio.checked:hover .pill-radio-dot {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.enhanced-field-row .field-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.field-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 4px;
  border-radius: 6px;
  background: #eaf2ff;
  color: #1d4ed8;
  font-style: normal;
  font-size: 9px;
  font-weight: 900;
}
.enhanced-field-row small {
  color: #64748b;
  text-transform: lowercase;
}
.enhanced-field-row:hover {
  border-color: #b6cdf0;
  background: #f3f8ff;
}

/* v3.3.7 - informações à esquerda e controles do canvas no extremo direito */
body.report-editor-active .report-page-toolbar {
  position: relative;
  z-index: 20;
  grid-template-columns: minmax(180px, 200px) 100px auto minmax(182px, 1fr);
  justify-content: start;
  gap: 6px;
}
body.report-editor-active .report-name-field {
  width: 100%;
  max-width: 200px;
}
.toolbar-end-actions {
  display: flex;
  align-items: center;
  align-self: end;
  justify-self: end;
  gap: 5px;
  min-width: 0;
}
body.report-editor-active .report-filter-toolbar-btn,
body.report-editor-active .report-toolbar-icon-btn,
body.report-editor-active .toolbar-zoom-controls .btn {
  height: 28px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.toolbar-zoom-field {
  display: flex;
  align-items: center;
  align-self: end;
  gap: 5px;
  min-width: 0;
  height: 28px;
  padding: 2px 4px 2px 8px;
  border: 1px solid #cbd7e8;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  box-sizing: border-box;
}
.toolbar-zoom-field > span {
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.toolbar-zoom-controls {
  display: grid;
  grid-template-columns: 24px 42px 24px;
  gap: 2px;
}
body.report-editor-active .toolbar-zoom-controls .btn {
  height: 22px;
  min-height: 22px;
  min-width: 0;
  padding: 2px;
  border-radius: 7px;
  font-size: 11px;
}
body.report-editor-active .fullscreen-editor-btn {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 18px;
  font-weight: 900;
}
body.report-designer-fullscreen-active {
  overflow: hidden;
}
body.report-designer-fullscreen-active #reportDesignerShell.designer-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100vh;
  margin: 0;
}
.ribbon-organizar-group {
  min-width: 430px;
}
.ribbon-organizar-group .ribbon-tool-group-content {
  flex-wrap: nowrap;
}
.ribbon-layout-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 5px;
  border-left: 1px solid #d5dfec;
}
.ribbon-grid-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.ribbon-grid-toggle input {
  width: 13px;
  height: 13px;
  margin: 0;
}
.ribbon-layout-btn {
  width: 28px;
  min-width: 28px !important;
  height: 28px;
  padding: 3px !important;
  font-size: 15px !important;
}

/* v3.2.25 - Etapa 3: canvas central mais próximo do Power BI */
body.report-editor-active .report-canvas {
  position: relative;
  overflow: auto;
  background: #e7ebf1;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  scrollbar-gutter: stable;
}
body.report-editor-active .report-canvas-stage {
  position: relative;
  flex: 0 0 auto;
  width: 1280px;
  height: 720px;
  margin: auto;
}
body.report-editor-active .report-page {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1280px;
  min-height: 720px;
  height: 720px;
  background: #ffffff;
  padding: 0;
  border: none;
  overflow: visible;
  transform-origin: top left;
}

body.report-editor-active .visual-frame {
  cursor: default;
  outline: 1px solid rgba(148,163,184,.25);
  outline-offset: 0;
}
body.report-editor-active .visual-frame .visual-frame-head {
  cursor: move;
  user-select: none;
}
body.report-editor-active .visual-frame.selected::before {
  content: attr(data-size);
  position: absolute;
  right: 10px;
  top: -24px;
  z-index: 4;
  min-width: 64px;
  text-align: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1f6feb;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(31,111,235,.24);
}
body.report-editor-active .visual-frame.selected::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px dashed rgba(31,111,235,.62);
  border-radius: calc(var(--visual-radius, 14px) + 6px);
  pointer-events: none;
}
body.report-editor-active .visual-frame.dragging,
body.report-editor-active .visual-frame.resizing {
  opacity: .92;
  box-shadow: 0 0 0 2px #1f6feb, 0 26px 54px rgba(15,23,42,.22) !important;
}
body.report-editor-active .visual-resize-handle {
  width: 14px !important;
  height: 14px !important;
  right: -7px !important;
  bottom: -7px !important;
  border-radius: 5px !important;
  cursor: nwse-resize;
}
.canvas-organize-group .compact-action {
  min-height: 32px;
  padding: 6px 9px;
}
body.report-editor-active .visual-frame.visual-static .visual-frame-head {
  cursor: default;
}
body.report-editor-active .visual-frame.visual-static .visual-content.visual-static-content {
  overflow: hidden;
}
.textbox-content {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 12px;
  min-height: 40px;
  outline: none;
  overflow: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  text-align: var(--visual-cell-align, left);
}
.textbox-content:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-style: italic;
  pointer-events: none;
}
.textbox-content[contenteditable="true"] {
  cursor: text;
  background: color-mix(in srgb, var(--visual-bg, #fff) 96%, var(--visual-accent, #2563eb));
  box-shadow: inset 0 0 0 2px var(--visual-accent, #2563eb);
  border-radius: 4px;
}
.image-fit-contain,
.image-fit-cover,
.image-fit-fill {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-fit-contain img { max-width: 100%; max-height: 100%; object-fit: contain; }
.image-fit-cover img { width: 100%; height: 100%; object-fit: cover; }
.image-fit-fill img { width: 100%; height: 100%; object-fit: fill; }
body.report-editor-active .designer-status-strip span:last-child::after {
  content: " · setas movem · Shift acelera · Alt redimensiona · Ctrl+D duplica";
  color: #64748b;
  font-weight: 700;
}
@media (max-width: 1280px) {
  .canvas-organize-group .compact-action { font-size: 11px; padding-inline: 7px; }
}

.format-card {
  border: 1px solid #dfe8f5;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}
.format-card:hover {
  border-color: #c4d8f0;
}
.format-card[open] {
  border-color: #bcd0ea;
  box-shadow: 0 4px 16px rgba(31,111,235,.06);
}
.format-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  border-bottom: 1px solid transparent;
  user-select: none;
}
.format-card[open] summary { 
  border-bottom-color: #e5edf8; 
  background: #fafcff;
}
.format-card summary::-webkit-details-marker { display: none; }
.format-card summary::after {
  content: '';
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.format-card[open] summary::after { transform: rotate(180deg); }
.format-card summary span {
  font-size: 12px;
  font-weight: 950;
  color: #172033;
  flex: 1;
  min-width: 0;
}
.format-card summary small {
  display: none;
}
.format-card-body {
  display: grid;
  gap: 9px;
  padding: 12px 14px 14px;
}

.format-card-body label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #42536b;
}

.format-card-body label.inline-toggle {
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  margin: 0 !important;
  padding: 2px 0;
}

.format-card-body label.check-label {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  margin: 0;
  padding: 2px 0;
}

.format-card-body label.check-label input {
  width: auto;
  flex-shrink: 0;
}

.format-card-body input:not([type="color"]):not([type="checkbox"]),
.format-card-body select,
.format-card-body textarea {
  width: 100%;
  min-height: 34px;
  border-radius: 9px;
}

.format-card-body input[type="number"] {
  min-height: 34px;
}

.format-card-body input[type="color"] {
  min-height: 34px;
  width: 100%;
  padding: 3px;
  border-radius: 8px;
  cursor: pointer;
}

.format-color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.format-color-grid label {
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  color: #42536b;
  min-width: 0;
}

.format-color-grid input[type="color"] {
  min-height: 38px;
  padding: 3px;
  width: 100%;
  border-radius: 8px;
}

.format-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.format-two-cols label {
  min-width: 0;
}

.format-two-cols input[type="color"] {
  min-height: 34px;
  max-height: 36px;
}

.column-rules-editor {
  gap: 10px;
  padding: 10px;
  background: #f8fbff;
}

.column-rule-field-label select {
  border-color: #aac8e8 !important;
  background: #fff;
  color: #173f61;
  font-weight: 750;
}

.column-rule-empty {
  padding: 14px 10px;
  border: 1px dashed #b9cde2;
  border-radius: 9px;
  background: #fff;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.4;
  text-align: center;
}

.column-rule-master-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid #a9c9ea;
  border-radius: 9px;
  background: #eaf4ff;
  color: #0f4f82 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

.column-rule-master-toggle input,
.column-rule-section input[type="checkbox"] {
  width: auto !important;
  flex: 0 0 auto;
  margin: 0;
}

.column-rule-section {
  display: grid;
  gap: 8px;
  margin-top: 9px;
  padding: 9px;
  border: 1px solid #dbe6f2;
  border-radius: 10px;
  background: #fff;
  transition: opacity .15s ease, border-color .15s ease;
}

.column-rule-section.is-disabled {
  opacity: .56;
}

.column-rule-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #1e3f5e;
}

.column-rule-section-title strong {
  font-size: 11px;
  font-weight: 900;
}

.column-rule-section-icon {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 6px;
  background: #eaf4ff;
  color: #0f6cbd;
  font-size: 12px;
  font-weight: 900;
}

.column-value-rule {
  display: grid;
  grid-template-columns: minmax(56px, .9fr) 1fr 1fr;
  align-items: end;
  gap: 6px;
  padding: 7px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #fbfdff;
}

.visualizations-pane .column-value-rule {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visualizations-pane .column-value-rule-name {
  grid-column: 1 / -1;
  width: 100%;
  text-align: left;
}

.column-value-rule.negative { border-left: 3px solid #ef4444; }
.column-value-rule.zero { border-left: 3px solid #94a3b8; }
.column-value-rule.positive { border-left: 3px solid #22c55e; }

.column-value-rule-name {
  align-self: center;
  color: #354a61;
  font-size: 9.5px;
  font-weight: 850;
}

.column-value-rule label {
  gap: 3px !important;
  font-size: 8.5px !important;
}

.column-value-rule input[type="color"] {
  min-height: 30px !important;
}

.column-icon-rule {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 6px;
}

.column-icon-rule > span {
  color: #4a5d73;
  font-size: 9.5px;
  font-weight: 800;
}

.column-icon-rule select {
  min-width: 0;
  min-height: 31px !important;
  height: 31px;
  padding: 3px 22px 3px 6px;
  font-size: 9.5px;
}

.column-icon-rule input[type="color"] {
  width: 34px !important;
  min-height: 31px !important;
  height: 31px;
}

.column-rule-reset {
  min-height: 34px;
  border-color: #c8d7e8;
  background: #fff;
  color: #36536f;
  font-size: 10px;
  font-weight: 800;
}

.conditional-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  isolation: isolate;
}

.conditional-cell.has-data-bar {
  width: 100%;
  min-height: 18px;
  padding: 1px 3px;
}

.conditional-data-bar {
  position: absolute;
  z-index: 0;
  top: 1px;
  bottom: 1px;
  left: 0;
  min-width: 2px;
  border-radius: 3px;
  opacity: .22;
}

.conditional-cell-value {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
}

.table-word-wrap .conditional-cell-value {
  overflow: visible;
  text-overflow: clip;
}

.conditional-cell-icon {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-width: 12px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}
.format-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 2px;
}
.format-actions-grid .btn { 
  width: 100%; 
  min-height: 36px; 
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  padding: 7px 10px;
  border: 1px solid #dbe6f5;
  background: #f8fbff;
  color: #425b78;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.format-actions-grid .btn:hover {
  background: #edf5ff;
  border-color: #b8cfe8;
  color: #1f6feb;
}

.visualizations-pane .visual-format-pane,
.visualizations-pane .format-card,
.visualizations-pane .format-card-body,
.visualizations-pane .format-card-body label,
.visualizations-pane .format-card-body input,
.visualizations-pane .format-card-body select,
.visualizations-pane .format-card-body textarea {
  min-width: 0;
  box-sizing: border-box;
}

.visualizations-pane .format-card-body {
  gap: 10px;
  padding: 11px 12px 13px;
}

.visualizations-pane .format-card-body label {
  width: 100%;
  line-height: 1.25;
  text-align: left;
  overflow-wrap: normal;
  word-break: normal;
}

.visualizations-pane .format-color-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.visualizations-pane .format-color-grid-single {
  grid-template-columns: 1fr;
}

.visualizations-pane .format-color-grid label {
  width: 100%;
  font-size: 10px;
  line-height: 1.2;
}

.visualizations-pane .format-color-grid input[type="color"] {
  min-height: 36px;
  max-height: 36px;
}

.visualizations-pane .format-two-cols {
  align-items: end;
  gap: 8px;
}

.visualizations-pane .format-two-cols-with-alignment {
  grid-template-columns: 1fr;
}

.visualizations-pane .alignment-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-items: center;
  text-align: center !important;
}

.visualizations-pane .alignment-field > span:first-child {
  display: block;
  width: 100%;
  color: #49627d;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.visualizations-pane .alignment-button-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 30px;
}

.visualizations-pane .alignment-choice {
  position: relative;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid #b8c7d8;
  border-radius: 5px;
  background: #fff;
  color: #324a62;
  box-shadow: none;
  cursor: pointer;
}

.visualizations-pane .alignment-choice::before {
  content: "";
  position: absolute;
  inset: 7px 6px;
}

.visualizations-pane .alignment-choice.alignment-left::before {
  background:
    linear-gradient(currentColor 0 0) left top / 100% 1px no-repeat,
    linear-gradient(currentColor 0 0) left 5px / 72% 1px no-repeat,
    linear-gradient(currentColor 0 0) left 10px / 100% 1px no-repeat,
    linear-gradient(currentColor 0 0) left bottom / 82% 1px no-repeat;
}

.visualizations-pane .alignment-choice.alignment-center::before {
  background:
    linear-gradient(currentColor 0 0) center top / 100% 1px no-repeat,
    linear-gradient(currentColor 0 0) center 5px / 72% 1px no-repeat,
    linear-gradient(currentColor 0 0) center 10px / 100% 1px no-repeat,
    linear-gradient(currentColor 0 0) center bottom / 82% 1px no-repeat;
}

.visualizations-pane .alignment-choice.alignment-right::before {
  background:
    linear-gradient(currentColor 0 0) right top / 100% 1px no-repeat,
    linear-gradient(currentColor 0 0) right 5px / 72% 1px no-repeat,
    linear-gradient(currentColor 0 0) right 10px / 100% 1px no-repeat,
    linear-gradient(currentColor 0 0) right bottom / 82% 1px no-repeat;
}

.visualizations-pane .alignment-choice:hover {
  border-color: #6997c7;
  background: #f3f8fe;
}

.visualizations-pane .alignment-choice.active,
.visualizations-pane .alignment-choice[aria-pressed="true"] {
  border-color: #1671d9;
  background: #e8f2ff;
  color: #0d5eaf;
  box-shadow: inset 0 0 0 1px #9fc7f1;
}

.visualizations-pane .alignment-choice:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.visualizations-pane .alignment-native-select[hidden] {
  display: none !important;
}

.visualizations-pane .format-card:not(.column-rules-card) .format-card-body label.inline-toggle,
.visualizations-pane .format-card:not(.column-rules-card) .format-card-body label.check-label {
  display: grid !important;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  justify-content: start;
  width: 100%;
  min-height: 30px;
  padding: 6px 7px;
  border: 1px solid #e4ebf4;
  border-radius: 8px;
  background: #f9fbfe;
  color: #334a62;
  font-size: 10.5px;
  line-height: 1.25;
  text-align: left;
}

.visualizations-pane .format-card:not(.column-rules-card) .format-card-body label.inline-toggle input,
.visualizations-pane .format-card:not(.column-rules-card) .format-card-body label.check-label input {
  width: 14px !important;
  height: 14px;
  margin: 0;
  margin-top: 1px;
  justify-self: start;
}

.visualizations-pane .format-card-body input:not([type="color"]):not([type="checkbox"]),
.visualizations-pane .format-card-body select,
.visualizations-pane .format-card-body textarea {
  min-height: 36px;
  height: auto;
}

.visualizations-pane .format-card-body input[type="number"] {
  min-height: 36px;
  padding-inline: 10px;
}

.visualizations-pane .format-card-body select {
  padding-left: 10px;
  padding-right: 28px;
  text-overflow: ellipsis;
}

.visualizations-pane .format-card-body > label,
.visualizations-pane .format-two-cols > label,
.visualizations-pane .format-color-grid > label {
  justify-content: flex-start;
}

.visualizations-pane .format-card-body > label:not(.inline-toggle):not(.check-label),
.visualizations-pane .format-two-cols > label,
.visualizations-pane .format-color-grid > label {
  color: #344a61;
  font-size: 10px;
  font-weight: 750;
}

.table-alignment-editor {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid #dce7f3;
  border-radius: 10px;
  background: #f8fbff;
}

.table-alignment-editor > label {
  display: grid;
  gap: 5px;
  color: #344a61;
  font-size: 10px;
  font-weight: 800;
}

.table-alignment-editor .format-two-cols {
  grid-template-columns: 1fr;
  align-items: end;
}

.table-alignment-editor .format-two-cols label {
  line-height: 1.2;
}

.table-alignment-reset {
  min-height: 32px;
  border-color: #c7d8e9;
  background: #fff;
  color: #36536f;
  font-size: 10px;
  font-weight: 800;
}

.visualizations-pane .format-card summary span {
  display: flex;
  align-items: center;
  min-height: 18px;
  line-height: 1.25;
}
.visual-frame,
.dashboard-visual-box {
  opacity: var(--visual-opacity, 1);
}
.visual-frame.has-border,
.dashboard-visual-box.has-border {
  border-color: var(--visual-border-color, var(--visual-accent, #2563eb)) !important;
  border-width: var(--visual-border-width, 1px) !important;
}
.visual-frame.no-border,
.dashboard-visual-box.no-border {
  border-color: transparent !important;
  border-width: 1px !important;
}
.visual-frame.hide-legend .pie-legend,
.dashboard-visual-box.hide-legend .pie-legend {
  display: none !important;
}
.visual-frame.hide-legend .chart-caption,
.dashboard-visual-box.hide-legend .chart-caption {
  display: none !important;
}

@media (max-width: 980px) {
  .format-card summary { align-items: flex-start; }
  .format-card summary small { display: none; }
  .format-actions-grid { grid-template-columns: 1fr; }
}


/* v3.2.27 - filtros e segmentacoes no padrão Power BI */
.filter-scope-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}
.filter-scope-mini-grid span {
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 10px;
  padding: 7px 6px;
  min-width: 0;
}
.filter-scope-mini-grid b { display: block; font-size: 11px; }
.filter-scope-mini-grid small { display: block; color: var(--muted); font-size: 10px; }
.filter-scope-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 6px 0 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2150a8;
  border: 1px solid #d7e4ff;
  font-size: 11px;
  font-weight: 700;
}
.filter-popup-form label select#onlineFilterTargetSelect:disabled {
  background: #f3f6fa;
  color: var(--muted);
}

/* v3.2.28 - Login e permissões do BI WA Online */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, .22), transparent 32%), linear-gradient(135deg, #0f172a, #1e293b);
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .35);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.login-card.admin-access { border-color: rgba(37, 99, 235, .42); box-shadow: 0 24px 80px rgba(15, 23, 42, .35), 0 0 0 4px rgba(37, 99, 235, .08); }
.login-card h1 { margin: 4px 0 8px; font-size: 28px; }
.login-card label { display: grid; gap: 6px; margin-top: 14px; font-weight: 700; color: #334155; }
.login-card input { min-height: 42px; border: 1px solid #cbd5e1; border-radius: 12px; padding: 0 12px; outline: none; }
.login-card input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.login-logo { width: 74px; height: 74px; object-fit: contain; margin-bottom: 8px; }
.login-access-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 14px 0 18px;
  padding: 5px;
  border: 1px solid #dbe4f0;
  border-radius: 13px;
  background: #f1f5f9;
}
.login-access-option {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  color: #64748b;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.login-access-option:hover { color: #1e3a5f; background: rgba(255,255,255,.72); }
.login-access-option.active { color: #174ea6; background: #fff; box-shadow: 0 2px 9px rgba(15, 23, 42, .10); }
.login-card.admin-access .login-access-option.active { color: #fff; background: #2563eb; }
.login-card .sub { line-height: 1.45; }
.login-card .warn-text { margin-top: 12px; }
.login-card .btn:disabled { cursor: wait; opacity: .72; }
.btn.full { width: 100%; justify-content: center; margin-top: 18px; }
.app-locked { filter: blur(2px); pointer-events: none; user-select: none; }
.user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #2563eb, #174ea6);
  box-shadow: 0 4px 12px rgba(37,99,235,.24);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}
.user-avatar.large { width: 42px; height: 42px; flex-basis: 42px; font-size: 14px; }
.header-user-button,
.online-portal-user-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-grid;
  place-items: center;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.header-user-button:hover,
.online-portal-user-button:hover { background: rgba(255,255,255,.20); transform: translateY(-1px); }
.header-user-button .user-avatar,
.online-portal-user-button .user-avatar { width: 32px; height: 32px; flex-basis: 32px; box-shadow: none; }
.user-account-menu {
  position: fixed;
  z-index: 13000;
  width: 274px;
  padding: 8px;
  border: 1px solid #d9e2ef;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(15,23,42,.22);
}
.user-account-menu[hidden] { display: none !important; }
.user-account-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 6px;
  padding: 10px;
  border-bottom: 1px solid #e8edf4;
}
.user-account-summary > div { min-width: 0; display: grid; gap: 2px; }
.user-account-summary strong,
.user-account-summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-account-summary strong { color: #172033; font-size: 13px; }
.user-account-summary small { color: #728096; font-size: 11px; }
.user-account-menu > button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: #26354d;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}
.user-account-menu > button:hover { background: #f1f5f9; }
.user-account-menu > button.logout { color: #c62828; }
.user-account-menu > button.logout:hover { background: #fff1f2; }
.user-account-menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.profile-modal-card { width: min(500px, calc(100vw - 32px)); padding: 20px; overflow: visible; }
.profile-modal-head { align-items: center; }
.profile-modal-identity { display: flex; align-items: center; gap: 12px; }
.profile-modal-identity .eyebrow { margin: 0 0 2px; font-size: 10px; }
.profile-modal-identity h3 { font-size: 19px; }
.profile-modal-identity small { display: block; margin-top: 3px; color: #718096; font-size: 11px; }
.profile-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-form-grid label { min-width: 0; display: grid; gap: 6px; color: #34435a; font-size: 12px; font-weight: 800; }
.profile-form-grid label > small { margin-left: 4px; color: #8491a4; font-size: 10px; font-weight: 600; }
.profile-form-grid input { width: 100%; min-height: 42px; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 11px; padding: 0 11px; outline: none; }
.profile-form-grid input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.11); }
.profile-form-wide { grid-column: 1 / -1; }
.profile-form-error { margin: 13px 0 0; padding: 9px 11px; border: 1px solid #fecaca; border-radius: 9px; color: #b42318; background: #fff1f2; font-size: 12px; }
.profile-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #e5eaf1; }
@media (max-width: 560px) {
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-form-wide { grid-column: auto; }
}
.user-permission-panel {
  margin-top: 18px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  padding: 16px;
  background: #f8fafc;
}
.compact-head { margin-bottom: 12px; }
.online-users-list { display: grid; gap: 12px; margin-top: 12px; }
.online-user-card {
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 14px;
}
.online-user-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.compact-actions { align-items: center; gap: 8px; }
.permission-box { margin-top: 12px; border-top: 1px solid #e2e8f0; padding-top: 12px; }
.permission-report-row { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; margin-top: 8px; background: #f8fafc; }
.permission-pages { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 0 26px; }
.mini-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #475569; }


.deploy-log {
  width: 100%;
  min-height: 200px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.5;
  background: #0f172a;
  color: #a8f0c0;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  white-space: pre;
  overflow: auto;
}

.publish-center-panel {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--border, #d8e0ec);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,249,253,.98));
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.publish-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.publish-summary-card {
  border: 1px solid var(--border, #d8e0ec);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-height: 86px;
}
.publish-summary-card span,
.publish-summary-card small {
  display: block;
  color: var(--muted, #64748b);
  font-size: 12px;
}
.publish-summary-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 22px;
  color: var(--text, #0f172a);
}
.publish-report-table-wrap {
  overflow: auto;
  border: 1px solid var(--border, #d8e0ec);
  border-radius: 14px;
  background: #fff;
}
.publish-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.publish-report-table th,
.publish-report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #d8e0ec);
  text-align: left;
  vertical-align: middle;
}
.publish-report-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.publish-report-table td small {
  display: block;
  color: var(--muted, #64748b);
  margin-top: 2px;
}
.publish-report-table tr:last-child td { border-bottom: 0; }
@media (max-width: 980px) {
  .publish-summary-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 620px) {
  .publish-summary-grid { grid-template-columns: 1fr; }
}


/* v3.2.35 - Ajustes do construtor de filtros online */
.online-filter-modal-card {
  width: min(1080px, calc(100vw - 32px));
  max-height: min(90vh, calc(100vh - 32px));
  overflow: hidden;
}
.online-filter-modal-card .filter-popup-designer-layout {
  max-height: calc(100vh - 210px);
  overflow: hidden;
}
.filter-popup-canvas {
  overflow: auto;
}
.filter-popup-form {
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 4px;
}
.online-filter-list.filter-popup-visual-list {
  max-height: calc(100vh - 310px);
  overflow: auto;
  padding-right: 6px;
}
.filter-popup-canvas:focus-within {
  border-color: #8cb9ff;
}
#cancelOnlineFilterEditBtn {
  margin-top: -4px;
}


/* v3.2.38 - Popup de filtros compacto e arrastavel */
.filter-popup-canvas {
  min-height: 420px;
}
.online-filter-list.filter-popup-visual-list {
  position: relative;
  display: block;
  max-height: calc(100vh - 310px);
  overflow: auto;
  padding: 10px;
}
.filter-popup-visual-item {
  position: absolute;
  display: block;
  min-width: 190px;
  min-height: 58px;
  max-width: none;
  padding: 6px 8px;
  cursor: grab;
  border-radius: 12px;
  resize: none;
  box-shadow: 0 8px 22px rgba(15,23,42,0.08);
}
.filter-popup-visual-item.dragging {
  cursor: grabbing;
  user-select: none;
  z-index: 20;
  box-shadow: 0 14px 34px rgba(15,23,42,0.18);
}
.filter-popup-visual-item .filter-popup-visual-body,
.filter-popup-visual-item .filter-visual-preview {
  height: 100%;
}
.filter-popup-visual-item .filter-visual-preview {
  min-height: 0;
  gap: 5px;
  padding: 2px 4px 4px;
  grid-template-rows: auto auto 1fr;
}
.filter-popup-visual-item .filter-visual-title {
  gap: 6px;
  line-height: 1.1;
}
.filter-popup-visual-item .filter-visual-title b {
  font-size: 13px;
}
.filter-popup-visual-item .filter-visual-title small {
  max-width: 120px;
  font-size: 10px;
}
.filter-popup-visual-item .filter-scope-badge {
  justify-self: start;
  font-size: 10px;
  padding: 3px 8px;
  line-height: 1;
}
.filter-popup-visual-item select,
.filter-popup-visual-item input {
  min-height: 30px;
  height: 30px;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 10px;
}
.filter-popup-visual-item .filter-between-row {
  gap: 6px;
}
.filter-popup-title-row .muted {
  font-size: 12px;
}


/* v3.2.39 - filtros online: alca de arraste, cards mais compactos e escopo claro */
.filter-popup-visual-item {
  padding: 4px 6px 6px;
  min-width: 180px;
  min-height: 54px;
}
.filter-card-drag-handle {
  height: 18px;
  margin: -1px 22px 2px 0;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: grab;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}
.filter-popup-visual-item.dragging .filter-card-drag-handle {
  cursor: grabbing;
  background: rgba(37, 99, 235, 0.16);
}
.filter-popup-visual-item .filter-visual-preview {
  padding-top: 0;
  gap: 4px;
}
.filter-popup-visual-item .filter-visual-title b { font-size: 12px; }
.filter-popup-visual-item .filter-visual-title small { font-size: 9px; }
.filter-popup-visual-item .filter-scope-badge { font-size: 9px; padding: 2px 7px; }
.filter-popup-visual-item select,
.filter-popup-visual-item input {
  min-height: 28px;
  height: 28px;
  font-size: 11px;
  padding: 4px 9px;
}
.filter-popup-form label select#onlineFilterTargetSelect:disabled {
  opacity: .72;
  background: #f8fafc;
}


/* v3.2.40 - arraste e redimensionamento corrigidos no popup de filtros */
.filter-popup-visual-item {
  resize: none !important;
  cursor: default;
  overflow: visible;
}
.filter-popup-visual-item.dragging,
.filter-popup-visual-item.resizing {
  user-select: none;
  z-index: 30;
}
.filter-popup-visual-item.resizing {
  box-shadow: 0 14px 34px rgba(15,23,42,0.18);
}
.filter-card-drag-handle {
  cursor: move;
  touch-action: none;
}
.filter-card-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  cursor: nwse-resize;
  z-index: 20;
  padding: 0;
  margin: 0;
  appearance: none;
  display: block;
  touch-action: none;
}
.filter-card-resize-handle::before {
  content: '';
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 12px;
  height: 12px;
  border-right: 3px solid #64748b;
  border-bottom: 3px solid #64748b;
  border-radius: 0 0 4px 0;
  opacity: .9;
}
.filter-card-resize-handle:hover::before {
  border-color: #2563eb;
  opacity: 1;
}
.filter-popup-visual-item .filter-popup-visual-body {
  pointer-events: auto;
}

.dashboard-cross-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 4px;
  font-size: 12px;
  color: var(--muted, #64748b);
}
.dashboard-cross-filter-chip {
  border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 32%, #dbe6f5);
  background: color-mix(in srgb, var(--accent, #2563eb) 8%, #ffffff);
  color: var(--text, #0f172a);
  border-radius: 999px;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 12px;
}
.dashboard-cross-filter-chip:hover {
  border-color: var(--accent, #2563eb);
}
.dashboard-clickable-chart,
.dashboard-visual-box table td {
  cursor: pointer;
}
.dashboard-visual-box:hover {
  outline: 1px solid color-mix(in srgb, var(--visual-accent, #2563eb) 26%, transparent);
}

/* v3.2.68 - destaque visual para cross-filter e seleção múltipla */
.dashboard-cross-filter-bar span {
  font-weight: 700;
  color: var(--text, #0f172a);
}
.dashboard-cross-filter-chip {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cross-filter-selected-cell,
.visual-table td.cross-filter-selected-cell {
  background: color-mix(in srgb, var(--visual-accent, #2563eb) 18%, #ffffff) !important;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--visual-accent, #2563eb) 70%, transparent);
  font-weight: 700;
}
.cross-filter-selected-mark {
  filter: saturate(1.2) contrast(1.05);
  outline: 2px solid color-mix(in srgb, var(--visual-accent, #2563eb) 70%, #0f172a);
  outline-offset: 2px;
}
.bar-row.cross-filter-selected-mark {
  border-radius: 10px;
  padding: 2px 4px;
  background: color-mix(in srgb, var(--visual-accent, #2563eb) 10%, transparent);
}
.pie-slice.cross-filter-selected-mark,
.scatter-dot.cross-filter-selected-mark {
  stroke: var(--visual-text, #0f172a);
  stroke-width: 3px;
}

/* v3.2.69 - filtros persistentes e slicer interativo */
.dashboard-report-filter-bar {
  padding-top: 4px;
  color: #475569;
}
.dashboard-report-filter-chip {
  border-color: color-mix(in srgb, #16a34a 34%, #dbe6f5);
  background: color-mix(in srgb, #16a34a 8%, #ffffff);
}
.slicer-cross-filter-box {
  align-content: start;
  overflow: auto;
  max-height: 100%;
  padding-right: 4px;
}
.slicer-cross-filter-box .slicer-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.slicer-cross-filter-box .slicer-check:hover {
  border-color: var(--visual-accent, #2563eb);
  transform: translateX(1px);
}
.slicer-cross-filter-box .slicer-check.is-selected {
  border-color: color-mix(in srgb, var(--visual-accent, #2563eb) 70%, #dbe6f5);
  background: color-mix(in srgb, var(--visual-accent, #2563eb) 13%, #ffffff);
  font-weight: 800;
}
.slicer-cross-filter-box input[readonly] {
  pointer-events: none;
}

/* v3.2.70 - tabela/matriz: totais visuais sem somar textos */
.visual-table tfoot td,
.data-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: #f8fafc !important;
  border-top: 1px solid #cbd5e1 !important;
  font-weight: 700;
}
.table-total-cell {
  white-space: nowrap;
}

/* v3.2.75 - Tabela/Matriz avançada segura */
.table-sort-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: inherit;
  padding: 0;
  cursor: pointer;
}
.table-sort-btn.active { color: var(--accent); }
.visual-table-sort-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-right: 7px;
}
.visual-table-sort-btn.active { color: var(--visual-accent, #2563eb); }
.table-sort-indicator {
  flex: 0 0 auto;
  opacity: 0;
  font-size: 11px;
  transition: opacity .12s ease;
}
.visual-table-sort-btn:hover .table-sort-indicator,
.visual-table-sort-btn:focus-visible .table-sort-indicator { opacity: .45; }
.visual-table-sort-btn.active .table-sort-indicator { opacity: 1; }
.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.mini-label select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
}
.table-number-positive { font-variant-numeric: tabular-nums; }
.table-number-negative { color: #b91c1c; font-variant-numeric: tabular-nums; }
.table-number-zero { color: #64748b; font-variant-numeric: tabular-nums; }
.matrix-subtotal-row td {
  position: sticky;
  bottom: 34px;
  z-index: 1;
  background: #eef6ff !important;
  border-top: 1px solid #bfdbfe !important;
  font-weight: 800;
}
.visual-table-wrap {
  max-height: 100%;
}
.visual-table-progress-row td {
  height: 34px;
  padding: 7px 10px !important;
  text-align: center !important;
  color: var(--muted, #64748b) !important;
  background: rgba(248, 250, 252, 0.96) !important;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.visual-table-progress-row td > span {
  vertical-align: middle;
}
.visual-table-progress-row .visual-loading-spinner {
  display: none;
  margin-right: 7px;
}
.visual-table-progress-row.loading .visual-loading-spinner {
  display: inline-block;
}
.visual-table th {
  top: 0;
  z-index: 2;
}

/* v3.2.80 - Power BI-like side panes: scroll, build/format/analyze tabs and collapsible data tables */
body.report-editor-active #visualizationsPane:not(.collapsed) {
  display: flex !important;
  flex-direction: column;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: calc(100vh - 24px);
  min-height: 0;
  scrollbar-gutter: stable;
}
body.report-editor-active #visualizationsPane:not(.collapsed) > * {
  flex: 0 0 auto;
  min-height: 0;
}
.visual-pane-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px;
  border: 1px solid #dbe6f5;
  border-radius: 12px;
  background: #f7fbff;
}
.visual-pane-tab {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #425b78;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.visual-pane-tab:hover { background: #eef5ff; }
.visual-pane-tab.active {
  background: #ffffff;
  color: #0f6ad9;
  box-shadow: inset 0 -3px 0 #0f6ad9, 0 6px 14px rgba(15, 106, 217, .10);
}
.hidden-pane-section { display: none !important; }
.visual-analytics-pane .analytics-placeholder {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px dashed #c8d7ee;
  border-radius: 12px;
  background: #f8fbff;
}

body.report-editor-active #dataPane:not(.collapsed) {
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
  max-height: calc(100vh - 24px);
  min-height: 0;
}
body.report-editor-active #dataPane:not(.collapsed) > * {
  flex: 0 0 auto;
  min-height: 0;
}
body.report-editor-active #dataPane:not(.collapsed) #builderFieldList {
  overflow-y: auto !important;
  overflow-x: hidden;
  min-height: 0;
  flex: 1 1 auto;
}
body.report-editor-active #dataPane:not(.collapsed) #dataSearchInput,
body.report-editor-active #dataPane:not(.collapsed) .source-selector {
  flex: 0 0 auto;
  margin-bottom: 6px;
}
.powerbi-data-tree .field-table-title {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 6px 0 4px;
}
.powerbi-data-tree .field-table-title .table-caret {
  font-size: 12px;
  color: #334155;
}
.powerbi-data-tree .field-table-title .table-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.powerbi-data-tree .field-table-title small {
  color: #4c6380;
  font-size: 10px;
  font-weight: 800;
}
.powerbi-data-tree .field-table-title.collapsed {
  background: #fff;
  border: 1px solid #e0e8f5;
}
.powerbi-data-tree .field-table-collapsed-note {
  margin: 4px 0 8px 24px;
  padding: 8px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  border: 1px dashed #d7e2f1;
}
.powerbi-data-tree .builder-table-fields.collapsed .field-row { display: none; }
.powerbi-data-tree .powerbi-other-tables {
  margin-top: 8px;
  border-top: 1px solid #e5edf8;
  padding-top: 7px;
}
.powerbi-data-tree .powerbi-other-tables h4 {
  margin: 0 0 6px;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.field-row .field-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-type-icon {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  margin-right: 6px;
  border-radius: 6px;
  background: #e9f1ff;
  color: #0f6ad9;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

/* v3.2.81 - Inserir Dados estilo Power BI */
.insert-data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  margin-bottom: 16px;
}
.insert-source-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(200px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.insert-actions-col {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}
.insert-columns-preview {
  margin-top: 12px;
  min-height: 70px;
  border: 1px dashed var(--border, #d5e1f2);
  background: rgba(248, 251, 255, 0.85);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-content: flex-start;
  max-height: 180px;
  overflow: auto;
}
.column-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.column-chip small { color: #64748b; }
.imported-tables-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.imported-tables-list.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}
.imported-table-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 10px;
}
.imported-table-card strong { display: block; color: #0f172a; font-size: 12px; }
.imported-table-card small { display: block; color: #64748b; font-size: 11px; margin-top: 1px; }
.imported-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
}
.insert-manual-section { margin-top: 16px; }
.manual-grid-toolbar { flex-wrap: wrap; gap: 8px; }
@media (max-width: 1100px) {
  .insert-data-layout { grid-template-columns: 1fr; }
  .insert-source-grid { grid-template-columns: 1fr; }
  .insert-actions-col { justify-content: flex-start; }
}


/* v3.2.82 - Inserir Dados mais profissional e modal manual */
.insert-data-hero {
  align-items: center;
}
.professional-insert-layout {
  align-items: stretch;
}
.soft-eyebrow {
  margin-bottom: 6px;
  color: #4f46e5;
  letter-spacing: .08em;
}
.professional-summary-panel,
.insert-mysql-panel,
.insert-manual-card,
.professional-manual-manage {
  border-radius: 20px;
}
.insert-mysql-panel .panel-head,
.insert-manual-card .panel-head,
.professional-manual-manage .panel-head,
.professional-summary-panel .panel-head {
  align-items: flex-start;
}
.insert-manual-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
  align-items: start;
}
.insert-manual-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.feature-list {
  margin: 0;
  padding-left: 20px;
  color: #334155;
  display: grid;
  gap: 8px;
}
.feature-list li::marker { color: #2563eb; }
.manual-table-modal-card {
  width: min(1200px, calc(100vw - 48px));
}
.manual-table-modal-card .manual-data-grid {
  height: min(56vh, 560px);
}
.actions.end {
  justify-content: flex-end;
}
@media (max-width: 1280px) {
  .insert-manual-cards { grid-template-columns: 1fr; }
}

/* v3.2.87 - status do cache PostgreSQL nas tabelas inseridas */
.cache-status {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
}
.modelo-panel .imported-table-card .cache-status {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
  font-size: 9px;
  line-height: 1.2;
}
.cache-status.ok { color: #047857; }
.cache-status.muted { color: #64748b; }
.cache-status.danger { color: #be123c; }
.imported-card-actions .btn.mini { white-space: nowrap; }

/* v3.2.89 - Indicadores visuais do cache PostgreSQL */
.visual-cache-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}
.visual-cache-badge.pg-cache {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.visual-cache-badge.memory-cache {
  background: #e0f2fe;
  color: #075985;
  border-color: #7dd3fc;
}
.visual-cache-badge.mysql-live {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}
.dashboard-visual-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dashboard-visual-title b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* v3.2.90 - cobertura do cache PostgreSQL no dashboard */
.cache-coverage-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.cache-coverage-badge.ok {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}
.cache-coverage-badge.partial {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}
.cache-coverage-badge.warning {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}
.cache-coverage-badge.disabled {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #64748b;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Table Interactivity Styles */
.visual-table th {
  position: sticky;
}

.visual-table th[draggable="true"] {
  cursor: grab;
}

.visual-table th[draggable="true"]:active {
  cursor: grabbing;
}

.visual-table th.drag-source {
  opacity: 0.4;
  background-color: #e2e8f0;
}

.visual-table th.drag-over-left {
  box-shadow: inset 4px 0 0 0 var(--visual-accent, #2563eb);
}

.visual-table th.drag-over-right {
  box-shadow: inset -4px 0 0 0 var(--visual-accent, #2563eb);
}

.col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 7px;
  cursor: col-resize;
  z-index: 4;
  touch-action: none;
}

.col-resize-handle:hover {
  background-color: var(--visual-accent, #2563eb);
  opacity: 0.5;
}

.visual-table th .th-content {
  pointer-events: none;
  flex: 1 1 auto;
  min-width: 0;
}

.visual-table th.visual-table-auto-width .th-content {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap !important;
}

table.table-fixed {
  table-layout: fixed;
  min-width: 0;
}

.visual-table.table-no-wrap th .th-content,
.visual-table.table-no-wrap td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visual-table.table-no-wrap.table-fixed th,
.visual-table.table-no-wrap.table-fixed td {
  max-width: 0;
}

.visual-table.table-word-wrap th .th-content,
.visual-table.table-word-wrap td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Sync progress bar */
.sync-progress-area {
  grid-column: 1 / -1;
  width: 100%;
}

.sync-progress-bar-container {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e3e9f3);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 8px 0 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sync-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text, #122033);
  gap: 12px;
}

.sync-progress-info span:first-child {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-progress-pct {
  font-size: 15px;
  color: var(--brand, #1f6feb);
  min-width: 48px;
  text-align: right;
}

.sync-progress-track {
  background: var(--line, #e3e9f3);
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
  width: 100%;
}

.sync-progress-fill {
  background: linear-gradient(90deg, var(--brand, #1f6feb), var(--brand-dark, #1558c0));
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
  min-width: 0;
}

/* ── Responsive clean ── */
@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 252px minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-expand-fab { display: flex !important; }
  .model-cards-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 640px) {
  .main { padding: 12px; }
  .model-cards-grid { grid-template-columns: 1fr; gap: 10px; }
  .model-card { padding: 14px; }
}

/* Custom styles for Inserir Dados layout */
.insert-data-left-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
}

.insert-data-left-col .insert-mysql-panel {
  min-width: 0;
}

.modelo-panel {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.modelo-panel .panel-head {
  flex-shrink: 0;
}

.modelo-panel .imported-tables-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
  align-content: start;
  padding: 2px;
  overflow-y: auto;
  min-height: 0;
}

.modelo-panel .imported-tables-grid.empty-state {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: center;
}

.modelo-panel .imported-table-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #2563eb;
  background: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  height: 62px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  box-sizing: border-box;
}
.modelo-panel .imported-table-card.card-accent-table { border-left-color: #0f8a5f; }
.modelo-panel .imported-table-card.card-accent-calendar { border-left-color: #6366f1; }
.modelo-panel .imported-table-card.card-accent-manual { border-left-color: #b7791f; }

.modelo-panel-head .modelo-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.batch-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #475569;
  white-space: nowrap;
}

.batch-sync-status .batch-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.batch-sync-status.batch-done {
  color: #047857;
}

.batch-sync-status.batch-error {
  color: #dc2626;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Spinner on individual card */
.modelo-panel .imported-table-card .card-sync-spinner {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.modelo-panel .imported-table-card.syncing {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.modelo-panel .imported-table-card.sync-done {
  border-left-color: #0f8a5f !important;
  background: #f0fdf4;
}

.modelo-panel .imported-table-card.sync-error {
  border-left-color: #dc2626 !important;
  background: #fef2f2;
}

.modelo-panel .imported-table-card:hover {
  box-shadow: 0 3px 10px rgba(37,99,235,0.1);
  border-color: #93c5fd;
}

.modelo-panel .imported-table-card:active {
  transform: scale(0.98);
}

.modelo-panel .imported-table-card strong {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
}

.modelo-panel .imported-table-card .card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.modelo-panel .imported-table-card .card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.modelo-panel .imported-table-card .card-meta small {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #64748b;
  font-size: 9px;
  background: #f1f5f9;
  padding: 0px 5px;
  border-radius: 3px;
  line-height: 1.3;
}

.modelo-panel .imported-table-card .card-meta .source-label {
  background: transparent;
  color: #94a3b8;
  padding: 0;
  font-size: 9px;
}

.row-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0px 5px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.3;
}

.card-status-row {
  display: inline-flex;
  align-items: center;
}

.mysql-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.3;
}

.mysql-status-badge.online {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.mysql-status-badge.offline {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.modelo-panel .imported-table-card .card-actions-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}

.modelo-panel .imported-table-card .card-actions-btn:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #4f46e5;
}

/* Popover menu for card actions */
.card-action-popover {
  position: fixed;
  z-index: 9999;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(15,23,42,0.15), 0 0 0 1px rgba(37,99,235,0.06);
  padding: 4px;
  min-width: 180px;
  max-width: 220px;
  display: none;
  overflow: hidden;
}

.card-action-popover.open {
  display: block;
  animation: popoverFadeIn 0.15s ease;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-action-popover .popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: #1e293b;
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.card-action-popover .popover-item:hover {
  background: #f1f5f9;
}

.card-action-popover .popover-item.danger {
  color: #dc2626;
}

.card-action-popover .popover-item.danger:hover {
  background: #fef2f2;
}

.card-action-popover .popover-item .popover-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.card-action-popover .popover-item:hover .popover-icon {
  opacity: 1;
}

.card-action-popover .popover-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 3px 8px;
}

/* Overlay to catch clicks outside popover */
.popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
}

.popover-backdrop.open {
  display: block;
}

.hidden-tables-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.insert-data-hero .actions.wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 1100px) {
  .insert-data-left-col {
    gap: 16px;
  }
}




.history-table-wrap { overflow: auto; }
.history-grid { display: flex; flex-direction: column; gap: 14px; }
#historyContent { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
#historyContent .history-grid { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 14px; }
#historyContent .panel { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
#historyContent .panel .panel-head { flex-shrink: 0; }
#historyContent .history-table-wrap { flex: 1; overflow: auto; }
#historyContent .empty-state { margin: 0; }
#historyTab { display: none; flex-direction: column; height: calc(100vh - 110px); overflow: hidden; }
#historyTab.active { display: flex !important; }
#historyTab .page-head { flex-shrink: 0; }
#historyTab .empty-state { flex-shrink: 0; }

.simple-modal-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; }
.simple-modal { background: var(--panel, #fff); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); max-width: 640px; width: 90%; max-height: 80vh; overflow: auto; }
.simple-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line, #e2e8f0); font-size: 15px; }
.simple-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.simple-modal-body { padding: 16px 18px; }
.model-preview-modal .simple-modal { max-width: min(95vw, 1100px); width: 95%; }
.result-table { font-size: 13px; }
.result-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid #d0dcee;
  position: sticky;
  top: 0;
}
.result-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #eef2f8;
  color: #122033;
}
.result-table tbody tr:hover { background: #f8faff; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.settings-grid .panel { margin: 0; }
.settings-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--panel-bg,#f1f5f9); padding: 4px; border-radius: 10px; }
.settings-tab-btn { padding: 8px 18px; border: none; background: transparent; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted,#64748b); cursor: pointer; }
.settings-tab-btn.active { background: #fff; color: var(--text,#1e293b); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
/* ===== ONLINE BUILDER ===== */
.online-builder-layout {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 14px;
  height: calc(100vh - 140px);
  min-height: 500px;
}
.online-builder-panel { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.online-builder-preview { overflow: hidden; display: flex; flex-direction: column; }
.online-builder-preview .panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.online-builder-preview .panel-head { flex-shrink: 0; }

/* Preview Frame */
.online-preview-frame {
  flex: 1;
  display: flex;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  min-height: 400px;
}
.online-preview-sidebar {
  width: 200px;
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: background 0.3s, width 0.3s;
}
.online-preview-brand {
  padding: 14px 12px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.online-preview-nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.online-preview-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: default;
  transition: background 0.15s;
  white-space: nowrap;
}
.online-preview-nav-item:hover { background: rgba(255,255,255,0.06); }
.online-preview-nav-item.active { background: rgba(255,255,255,0.12); font-weight: 600; }
.online-preview-nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.online-preview-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f8fafc;
}
.online-preview-header {
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 13px;
  color: #0f172a;
  flex-shrink: 0;
  transition: background 0.3s, color 0.3s;
}
.online-preview-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.online-preview-placeholder {
  text-align: center;
  color: #94a3b8;
}
.online-preview-placeholder p {
  margin: 8px 0 4px;
  font-weight: 600;
  font-size: 14px;
}
.online-preview-placeholder small { font-size: 12px; }

/* Pages List */
.online-pages-list { display: flex; flex-direction: column; gap: 8px; max-height: min(520px, calc(100vh - 285px)); overflow-y: auto; padding: 2px; }
.online-page-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}
.online-page-item .page-drag-handle { cursor: grab; color: #94a3b8; font-size: 14px; }
.online-page-item .page-icon { font-size: 16px; width: 22px; text-align: center; }
.online-page-item .page-label { flex: 1; font-weight: 500; }
.online-page-item .page-report { font-size: 11px; color: #64748b; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-page-item .page-remove { cursor: pointer; color: #94a3b8; border: none; background: none; font-size: 16px; padding: 0 4px; }
.online-page-item .page-remove:hover { color: #ef4444; }
.online-dashboard-navigation-card {
  position: relative;
  flex: 0 0 auto;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .04);
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.online-dashboard-navigation-card.dragging { opacity: .5; transform: scale(.985); }
.online-dashboard-navigation-card.drag-over-before { box-shadow: inset 0 3px 0 #2563eb, 0 7px 18px rgba(37, 99, 235, .10); }
.online-dashboard-navigation-card.drag-over-after { box-shadow: inset 0 -3px 0 #2563eb, 0 7px 18px rgba(37, 99, 235, .10); }
.online-dashboard-navigation-card.icon-picker-open,
.online-dashboard-navigation-card.menu-open,
.online-dashboard-navigation-card.rename-open { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
.online-dashboard-navigation-card.hidden-dashboard { border-style: dashed; background: #f8fafc; }
.online-dashboard-navigation-card.hidden-dashboard .online-dashboard-icon-preview,
.online-dashboard-navigation-card.hidden-dashboard .online-dashboard-copy { opacity: .58; }
.online-dashboard-navigation-row {
  min-height: 56px;
  display: grid;
  grid-template-columns: 22px 22px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 8px;
}
.online-dashboard-drag-handle {
  width: 22px;
  height: 32px;
  display: grid;
  grid-template-columns: repeat(2, 3px);
  grid-template-rows: repeat(3, 3px);
  place-content: center;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #94a3b8;
  background: transparent;
  cursor: grab;
}
.online-dashboard-drag-handle:hover { color: #2563eb; background: #eff6ff; }
.online-dashboard-drag-handle:active { cursor: grabbing; }
.online-dashboard-drag-handle span { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.online-dashboard-order {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #475569;
  background: #f1f5f9;
  font-size: 10px;
  font-weight: 850;
}
.online-dashboard-icon-preview {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  color: #2563eb;
  background: #eff6ff;
}
.online-dashboard-icon-preview .online-area-icon { width: 19px; height: 19px; }
.online-dashboard-copy,
.online-dashboard-title-row { min-width: 0; }
.online-dashboard-copy b,
.online-dashboard-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-dashboard-copy b { color: #172033; font-size: 12px; }
.online-dashboard-copy small { margin-top: 2px; color: #7b8798; font-size: 9px; }
.online-dashboard-title-row { display: flex; align-items: center; gap: 5px; }
.online-dashboard-title-row b { min-width: 0; }
.online-dashboard-title-row em {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 999px;
  color: #64748b;
  background: #e2e8f0;
  font-size: 7px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.online-dashboard-more {
  width: 32px;
  height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  color: #475569;
  background: #fff;
}
.online-dashboard-more:hover,
.online-dashboard-more[aria-expanded="true"] { color: #1d4ed8; border-color: #93c5fd; background: #eff6ff; }
.online-dashboard-more span { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.online-dashboard-card-menu {
  display: grid;
  gap: 3px;
  margin: 0 8px 8px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
}
.online-dashboard-menu-action {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  color: #334155;
  background: transparent;
  font-size: 10px;
  font-weight: 750;
  text-align: left;
}
.online-dashboard-menu-action:hover { color: #1d4ed8; background: #eff6ff; }
.online-dashboard-menu-action svg {
  width: 17px;
  height: 17px;
  justify-self: center;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.online-dashboard-menu-divider { height: 1px; margin: 2px 5px; background: #e2e8f0; }
.online-dashboard-hidden-action { grid-template-columns: 24px minmax(0, 1fr) 30px; }
.online-dashboard-menu-copy { min-width: 0; }
.online-dashboard-menu-copy b,
.online-dashboard-menu-copy small { display: block; }
.online-dashboard-menu-copy b { color: inherit; font-size: 10px; }
.online-dashboard-menu-copy small { margin-top: 2px; color: #94a3b8; font-size: 8px; font-weight: 550; }
.online-dashboard-switch {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .14s ease;
}
.online-dashboard-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
  transition: transform .14s ease;
}
.online-dashboard-hidden-action[aria-pressed="true"] .online-dashboard-switch { background: #2563eb; }
.online-dashboard-hidden-action[aria-pressed="true"] .online-dashboard-switch::after { transform: translateX(12px); }
.online-dashboard-rename-editor {
  display: grid;
  gap: 8px;
  margin: 0 8px 8px;
  padding: 9px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}
.online-dashboard-rename-editor label { display: grid; gap: 5px; color: #475569; font-size: 9px; font-weight: 800; }
.online-dashboard-rename-editor input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #172033;
  background: #fff;
  font-size: 11px;
  outline: none;
}
.online-dashboard-rename-editor input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
.online-dashboard-rename-actions { display: flex; justify-content: flex-end; gap: 6px; }
.online-dashboard-rename-actions button {
  min-width: 62px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #475569;
  background: #fff;
  font-size: 9px;
  font-weight: 800;
}
.online-dashboard-rename-actions button.primary { color: #fff; border-color: #2563eb; background: #2563eb; }
.online-dashboard-icon-picker { padding: 0 10px 10px; border-top: 1px solid #eef2f7; }
.online-dashboard-icon-picker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 9px 1px 7px; }
.online-dashboard-icon-picker-head b { color: #334155; font-size: 10px; }
.online-dashboard-icon-picker-head small { color: #94a3b8; font-size: 8px; }
.online-dashboard-icon-grid { max-height: 260px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; overflow-y: auto; padding: 2px; }
.online-dashboard-icon-option {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  color: #475569;
  background: #fff;
  text-align: left;
}
.online-dashboard-icon-option:hover { color: #1d4ed8; border-color: #bfdbfe; background: #f8fbff; }
.online-dashboard-icon-option.selected { color: #1d4ed8; border-color: #60a5fa; background: #eff6ff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .10); }
.online-dashboard-icon-option .online-area-icon { flex: 0 0 auto; width: 17px; height: 17px; }
.online-dashboard-icon-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 750; }
.online-add-page-form { margin-top: 8px; }
.inline-form { display: flex; flex-direction: column; gap: 6px; }
.compact-input, .compact-select { padding: 7px 8px; border: 1px solid var(--border, #e2e8f0); border-radius: 6px; font-size: 13px; width: 100%; box-sizing: border-box; background: #fff; color: #0f172a; }
.compact-color { width: 40px; height: 28px; padding: 2px; border: 1px solid var(--border, #e2e8f0); border-radius: 5px; cursor: pointer; }
.form-grid-compact { display: flex; flex-direction: column; gap: 8px; }
.form-grid-compact label { font-size: 12px; font-weight: 600; color: #475569; display: flex; flex-direction: column; gap: 4px; }
.form-grid-compact .check-label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.online-compact-panel { padding: 12px; }
.online-compact-panel .compact-panel-head { margin-bottom: 7px; }
.online-compact-panel .panel-head h3 { font-size: 15px; }
.online-color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.online-color-grid label {
  min-width: 0;
  padding: 7px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 10px;
}
.online-color-grid .compact-color { width: 100%; height: 28px; }
.online-theme-controls { gap: 7px; }
.online-layout-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.online-layout-toggles .check-label {
  min-height: 34px;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 11px;
}
.online-builder-layout > .online-builder-panel:last-child {
  display: grid;
  grid-template-rows: minmax(0, 1.165fr) minmax(0, .995fr) minmax(0, .86fr);
  gap: 10px;
  overflow-y: hidden;
}
.online-builder-layout > .online-builder-panel:first-child { overflow-y: hidden; }
.online-builder-layout > .online-builder-panel:first-child > .panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.online-builder-layout > .online-builder-panel:first-child .compact-panel-head,
.online-builder-layout > .online-builder-panel:first-child .online-auto-dashboard-note { flex: 0 0 auto; }
.online-builder-layout > .online-builder-panel:first-child .online-pages-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #a8b5c7 transparent;
}
.online-builder-layout > .online-builder-panel:first-child .online-pages-list::-webkit-scrollbar { width: 6px; }
.online-builder-layout > .online-builder-panel:first-child .online-pages-list::-webkit-scrollbar-thumb { border-radius: 999px; background: #a8b5c7; }
.online-builder-layout > .online-builder-panel:first-child .online-pages-list::-webkit-scrollbar-track { background: transparent; }
.online-builder-layout > .online-builder-panel:last-child > .panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: #dbe4f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 5px 18px rgba(15, 23, 42, .055);
}
.online-builder-layout > .online-builder-panel:last-child > .panel + .panel { margin-top: 0; }
.online-builder-layout > .online-builder-panel:last-child .online-compact-panel { padding: 9px; }
.online-builder-layout > .online-builder-panel:last-child .compact-panel-head {
  flex: 0 0 auto;
  min-height: 20px;
  align-items: center;
  margin-bottom: 3px;
  padding: 0 1px 3px;
  border-bottom: 1px solid #e7edf5;
}
.online-builder-layout > .online-builder-panel:last-child .compact-panel-head .eyebrow { display: none; }
.online-builder-layout > .online-builder-panel:last-child .panel-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #172033;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -.01em;
}
.online-builder-layout > .online-builder-panel:last-child .panel-head h3::before {
  content: '';
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  box-shadow: 0 0 0 3px #eff6ff;
}
.online-theme-panel .online-color-grid { gap: 4px; }
.online-theme-panel .online-color-grid label { gap: 2px; padding: 4px 5px; font-size: 9px; }
.online-theme-panel .online-color-grid .compact-color { height: clamp(18px, 2.5vh, 26px); padding: 1px; }
.online-theme-panel .online-theme-controls {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 4px;
}
.online-theme-panel .online-color-grid {
  height: 100%;
  grid-template-rows: repeat(3, clamp(36px, 5.2vh, 52px));
  align-content: space-evenly;
}
.online-theme-panel .online-color-grid label { height: clamp(36px, 5.2vh, 52px); justify-content: space-between; }
.online-theme-panel .online-theme-controls > label { gap: 2px; font-size: 10px; }
.online-theme-panel .compact-select { height: clamp(28px, 3.8vh, 34px); padding: 4px 7px; font-size: 11px; }
.online-brand-panel .online-brand-controls {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 4px;
}
.online-brand-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.online-brand-field-grid label { min-width: 0; gap: 2px; font-size: 9px; }
.online-brand-field-grid .compact-input { height: clamp(26px, 3.6vh, 34px); padding: 3px 7px; font-size: 11px; }
.online-brand-controls .online-logo-import {
  height: clamp(50px, 7vh, 74px);
  align-self: center;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 7px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
}
.online-brand-controls .online-logo-preview { width: clamp(42px, 5.5vh, 58px); height: clamp(42px, 5.5vh, 58px); }
.online-brand-controls .online-logo-actions { gap: 4px; }
.online-brand-controls .online-logo-actions small { font-size: 8px; }
.online-brand-controls .online-logo-actions .btn { min-height: 27px; padding: 4px 7px; font-size: 9px; }
.online-builder-layout > .online-builder-panel:last-child .online-layout-panel { padding: 9px 9px 2px; }
.online-header-editor {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: space-between;
  gap: 3px;
  padding: 1px 2px;
}
.online-header-font-control {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #475569;
  font-size: 10px;
  font-weight: 650;
}
.online-header-font-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 6px;
}
.online-header-font-row .compact-select,
.online-header-font-row .compact-input {
  width: 100%;
  height: 26px;
  min-height: 26px;
  padding: 4px 7px;
  font-size: 11px;
}
.online-header-font-row .compact-input { text-align: center; }
.online-header-formatting {
  display: flex;
  align-items: center;
  gap: 5px;
}
.online-header-formatting label {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}
.online-header-formatting input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.online-header-formatting label > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: #172033;
  background: #fff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1;
  transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
}
.online-header-formatting label:hover > span { border-color: #94a3b8; background: #f8fafc; }
.online-header-formatting input:checked + span {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.12);
}
.online-header-formatting input:focus-visible + span { outline: 2px solid rgba(37,99,235,.25); outline-offset: 2px; }
.online-header-color-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.online-header-color-controls label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 5px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  background: #f8fafc;
  font-size: 9px;
  font-weight: 650;
}
.online-header-color-controls .compact-color { width: 100%; height: 20px; padding: 1px; }
@media (min-width: 1201px) {
  .main:has(#onlineTab.tab.active) { height: 100vh; overflow: hidden; }
  #onlineTab.tab.active { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  #onlineTab.tab.active > .page-head { flex: 0 0 auto; }
  #onlineTab.tab.active > .online-builder-layout { flex: 1; height: auto; min-height: 0; }
}
.online-preview-footer {
  padding: 8px 16px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 1200px) {
  .online-builder-layout { grid-template-columns: 1fr; height: auto; }
  .online-builder-preview { min-height: 360px; }
}

/* v3.2.94 - Modal de filtros mais claro e polido */
.modal-backdrop {
  background:
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, .20), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(14, 165, 233, .16), transparent 26%),
    rgba(15, 23, 42, .54);
  backdrop-filter: blur(8px);
}
.online-filter-modal-card,
.dashboard-filter-runtime-card {
  border: 1px solid rgba(203, 213, 225, .86);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.96));
  box-shadow: 0 34px 90px rgba(15, 23, 42, .30);
}
.online-filter-modal-card {
  width: min(1480px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}
.online-filter-modal-card .filter-popup-designer-layout {
  max-height: calc(100vh - 178px);
  grid-template-columns: minmax(720px, 1fr) minmax(380px, 440px);
  gap: 20px;
}
.online-filter-modal-card .filter-popup-canvas {
  min-height: calc(100vh - 230px);
}
.online-filter-modal-card .filter-popup-form {
  max-height: calc(100vh - 194px);
}
.online-filter-modal-card .online-filter-list.filter-popup-visual-list {
  max-height: calc(100vh - 315px);
}
.online-filter-modal-card .modal-head,
.dashboard-filter-runtime-card .modal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -20px -20px 18px;
  padding: 18px 20px 16px;
  background: linear-gradient(135deg, rgba(239,246,255,.98), rgba(255,255,255,.98));
  border-bottom: 1px solid rgba(203, 213, 225, .88);
  border-radius: 22px 22px 0 0;
}
.online-filter-modal-card .modal-head h3,
.dashboard-filter-runtime-card .modal-head h3 {
  margin: 2px 0 4px;
  font-size: 22px;
  letter-spacing: -.02em;
}
.filter-popup-designer-layout { grid-template-columns: minmax(420px, 1fr) minmax(320px, 360px); }
.filter-popup-canvas {
  border: 1px solid rgba(147, 197, 253, .72);
  background:
    linear-gradient(90deg, rgba(226, 232, 240, .35) 1px, transparent 1px),
    linear-gradient(0deg, rgba(226, 232, 240, .35) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(219, 234, 254, .70), transparent 32%),
    #fbfdff;
  background-size: 26px 26px, 26px 26px, auto, auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 16px 40px rgba(15,23,42,.06);
}
.filter-popup-title-row { align-items: flex-start; }
.filter-popup-title-row strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
}
.filter-popup-title-row small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}
.online-filter-summary {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid rgba(191, 219, 254, .88);
  border-radius: 13px;
  background: rgba(239, 246, 255, .86);
  color: #1e3a8a;
  font-weight: 700;
}
.filter-popup-form {
  border-left: 0;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 12px 32px rgba(15,23,42,.06);
}
.filter-popup-form label {
  gap: 6px;
  color: #334155;
  font-weight: 800;
}
.filter-popup-form select,
.filter-popup-form input {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
}
.filter-popup-form select:focus,
.filter-popup-form input:focus,
.dashboard-filter-runtime-card select:focus,
.dashboard-filter-runtime-card input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,.22);
}

.filter-dropdown-control {
  position: relative;
  width: 100%;
  min-width: 0;
}
.filter-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #172033;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.filter-dropdown-toggle [data-filter-dropdown-label] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-dropdown-chevron {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 14px;
  transition: transform .14s ease;
}
.filter-dropdown-control.open .filter-dropdown-toggle {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,.20);
}
.filter-dropdown-control.open .filter-dropdown-chevron {
  transform: rotate(180deg);
}
.filter-dropdown-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  min-width: 180px;
  padding: 6px;
  border: 1px solid #bfcee2;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15,23,42,.20);
}
.filter-dropdown-search {
  width: 100%;
  min-height: 30px !important;
  height: 30px !important;
  margin-bottom: 5px;
  padding: 5px 8px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}
.filter-dropdown-options {
  display: grid;
  gap: 2px;
  max-height: 220px;
  overflow: auto;
}
.filter-dropdown-option {
  width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #26364b;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.filter-dropdown-option:hover,
.filter-dropdown-option.selected {
  background: #eaf3ff;
  color: #174ea6;
}
.filter-dropdown-option.selected {
  font-weight: 800;
}
.filter-dropdown-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 8px;
  color: #64748b;
  font-size: 10px;
}
.filter-native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.filter-popup-visual-item:has(.filter-dropdown-control.open) {
  z-index: 70;
  overflow: visible;
}
.filter-popup-visual-item:has(.filter-dropdown-control.open) .filter-popup-visual-body,
.filter-popup-visual-item:has(.filter-dropdown-control.open) .filter-visual-preview {
  overflow: visible;
}
.dashboard-filter-runtime-card .filter-dropdown-toggle {
  min-height: 36px;
}

/* Portal Online publicado */
body.viewer-mode .app-shell,
body.online-portal-preview-mode .app-shell {
  display: block;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
body.viewer-mode .app-shell > .sidebar,
body.viewer-mode .sidebar-expand-fab,
body.online-portal-preview-mode .app-shell > .sidebar,
body.online-portal-preview-mode .sidebar-expand-fab {
  display: none !important;
}
body.viewer-mode .main,
body.online-portal-preview-mode .main {
  width: 100vw;
  height: 100vh;
  max-width: none;
  padding: 0;
  overflow: hidden;
  background: #eef2f7;
}
body.viewer-mode #dashboardTab.active,
body.online-portal-preview-mode #dashboardTab.active {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body.viewer-mode #dashboardTab > .page-head,
body.online-portal-preview-mode #dashboardTab > .page-head {
  display: none !important;
}
body.viewer-mode #dashboardGrid,
body.online-portal-preview-mode #dashboardGrid,
.online-portal-host {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
}
.online-portal-shell {
  display: grid;
  grid-template-columns: var(--online-sidebar-width, 260px) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  font-family: var(--online-font, Inter, Segoe UI, Arial, sans-serif);
  background: var(--online-bg, #f8fafc);
  color: #132037;
  transition: grid-template-columns .18s ease;
}
.online-portal-shell.sidebar-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.online-portal-sidebar {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 14px 10px 12px;
  overflow: hidden;
  color: var(--online-sidebar-text, #e2e8f0);
  background: var(--online-sidebar-bg, #0f172a);
  border-right: 1px solid rgba(148, 163, 184, .18);
  box-shadow: 12px 0 30px rgba(15, 23, 42, .08);
}
.online-portal-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 2px 8px 4px;
}
.online-portal-brand-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  letter-spacing: .02em;
}
.online-portal-collapse {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 5px;
  color: inherit;
  background: rgba(255,255,255,.07);
}
.online-portal-identity {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 6px 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.online-portal-logo {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,.92);
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.72);
  font-size: 12px;
  text-align: center;
}
.online-portal-logo img { width: 100%; height: 100%; object-fit: contain; }
.online-portal-subtitle {
  max-width: 210px;
  text-align: center;
  white-space: pre-line;
  font-size: var(--online-brand-subtitle-size, 12px);
  line-height: 1.3;
  text-transform: uppercase;
}
.online-portal-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 12px 0;
  overflow: auto;
}
.online-portal-nav-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background .14s ease, transform .14s ease;
}
.online-portal-nav-item:hover { background: rgba(255,255,255,.07); }
.online-portal-nav-item.active { background: var(--online-sidebar-active, #1e293b); box-shadow: inset 3px 0 0 var(--online-accent, #38bdf8); }
.online-portal-nav-item span { flex: 0 0 26px; text-align: center; }
.online-area-icon { display: block; width: 1em; height: 1em; }
.online-portal-nav-icon { display: grid; place-items: center; }
.online-portal-nav-icon .online-area-icon { width: 22px; height: 22px; }
.online-portal-nav-item b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; font-weight: 700; line-height: 1.15; }
.online-portal-nav-empty { padding: 16px 10px; color: rgba(255,255,255,.62); font-size: 12px; text-align: center; }
.online-portal-sidebar-footer {
  padding: 12px 4px 2px;
  border-top: 1px solid rgba(255,255,255,.06);
  color: rgba(255,255,255,.44);
  text-align: center;
  white-space: nowrap;
  font-size: 9px;
}
.online-portal-shell.sidebar-collapsed .online-portal-brand-row strong,
.online-portal-shell.sidebar-collapsed .online-portal-subtitle,
.online-portal-shell.sidebar-collapsed .online-portal-nav-item b,
.online-portal-shell.sidebar-collapsed .online-portal-sidebar-footer { display: none; }
.online-portal-shell.sidebar-collapsed .online-portal-brand-row { justify-content: center; padding-left: 0; padding-right: 0; }
.online-portal-shell.sidebar-collapsed .online-portal-identity {
  display: grid;
  gap: 0;
  padding: 8px 0 10px;
}
.online-portal-shell.sidebar-collapsed .online-portal-logo {
  width: 34px;
  height: 34px;
  border-width: 1px;
  font-size: 0;
}
.online-portal-shell.sidebar-collapsed .online-portal-nav-item { justify-content: center; padding-left: 8px; padding-right: 8px; }
.online-portal-shell.sidebar-collapsed .online-portal-nav-item span { flex-basis: auto; }
.online-portal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--online-bg, #f8fafc);
}
.online-portal-header {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 16px 9px 28px;
  color: var(--online-header-text, #fff);
  background: var(--online-header-bg, #0b1327);
  border-bottom: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 6px 20px rgba(15,23,42,.09);
}
.online-portal-title { min-width: 0; overflow: hidden; }
.online-portal-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--online-header-title-font, var(--online-font)); font-size: var(--online-header-title-size, 23px); font-weight: var(--online-header-title-weight, 900); font-style: var(--online-header-title-style, normal); text-decoration: var(--online-header-title-decoration, none); letter-spacing: .015em; text-transform: none; }
.online-portal-actions { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 9px; min-width: 0; white-space: nowrap; }
.online-portal-action,
.online-portal-icon-action,
.online-portal-page-picker select {
  height: 36px;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 5px;
  color: #172033;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}
.online-portal-action { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 7px; padding: 5px 14px; white-space: nowrap; }
.online-portal-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.online-portal-action.filter-action svg { fill: currentColor; stroke: none; }
.online-portal-action:hover,
.online-portal-icon-action:hover { color: #0f172a; background: #f1f5f9; }
.online-portal-action:disabled,
.online-portal-icon-action:disabled { opacity: .55; cursor: not-allowed; }
.online-portal-action.exit-preview { background: #fff; color: #162138; border-color: #fff; }
.online-portal-icon-action { width: 36px; padding: 0; line-height: 1; }
.online-portal-icon-action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.online-portal-icon-action.reset { color: #dc2638; background: #fff; border-color: rgba(255,255,255,.82); border-radius: 6px; }
.online-portal-icon-action.logout { color: #334155; background: #fff; border-color: rgba(255,255,255,.82); border-radius: 6px; }
.online-portal-user-button { width: 38px; height: 38px; flex-basis: 38px; background: rgba(255,255,255,.08); }
.online-portal-icon-action.is-loading svg { animation: spin .75s linear infinite; }
.online-portal-page-picker { display: flex; flex-direction: row; align-items: center; gap: 7px; margin: 0; color: var(--online-header-text, #fff); text-transform: uppercase; font-size: 11px; font-weight: 850; white-space: nowrap; }
.online-portal-page-picker > span { flex: 0 0 auto; color: #fff; opacity: 1; line-height: 1; }
.online-portal-page-picker select { flex: 0 0 auto; width: auto; min-width: 112px; margin: 0; padding: 4px 30px 4px 10px; color: #111827; background: #fff; }
.online-portal-status.last-update-badge { flex: 0 0 auto; padding: 8px 12px; border: 1px solid transparent; color: #fff; background: #0f8a5f; box-shadow: none; font-size: 11px; white-space: nowrap; }
.online-portal-status.last-update-badge.updated { color: #fff; background: #0f8a5f; border-color: #0f8a5f; }
.online-portal-status.last-update-badge.offline { color: #fff; background: #dc2626; border-color: #dc2626; }
.online-portal-status.last-update-badge.loading { color: #fff; background: #b7791f; border-color: #b7791f; }
.online-portal-filter-summary {
  flex: 0 0 auto;
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 8px 14px;
  padding: 5px 16px;
  overflow-x: auto;
  color: #43516a;
  background: #fff;
  border-bottom: 1px solid #e5eaf2;
  white-space: nowrap;
  font-size: 10px;
}
.online-portal-filter-summary > span { padding-left: 12px; border-left: 1px solid #dce3ed; }
.online-portal-filter-summary.empty { color: #8793a5; }
.online-portal-report-area { position: relative; flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 42px; overflow: hidden; background: var(--online-bg, #f8fafc); }
.online-portal-canvas-viewport {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 10px 6px;
  overflow: auto;
}
.online-portal-canvas-stage { position: relative; flex: 0 0 auto; }
.online-portal-canvas.dashboard-report-page {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  transform-origin: top left;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15,23,42,.05), 0 16px 44px rgba(15,23,42,.08);
}
.online-portal-canvas[data-theme="dark"] { background: #0f172a; }
.online-portal-canvas[data-theme="executive"] { background: linear-gradient(135deg,#f8fafc,#eef2ff); }
.online-portal-visual { position: absolute; overflow: hidden; }
.online-portal-visual.hide-title .visual-content { height: 100% !important; }
.online-portal-visual .visual-frame-head { min-height: 34px; }
.online-portal-visual .visual-content { height: calc(100% - 34px); padding: 8px; overflow: auto; }
.online-portal-visual.visual-static .visual-content { height: 100%; padding: 0; }
.online-portal-error,
.online-portal-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 30px;
  color: #8290a7;
  text-align: center;
}
.online-portal-error { color: #b42331; }
.online-portal-empty strong { font-size: 18px; }
.online-portal-zoom {
  position: relative;
  right: auto;
  bottom: auto;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-self: end;
  align-self: center;
  gap: 3px;
  margin-right: 12px;
  padding: 4px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 20px rgba(15,23,42,.10);
}
.online-portal-zoom button { min-width: 28px; height: 26px; padding: 0 7px; border: 0; border-radius: 5px; color: #44516a; background: transparent; font-size: 11px; }
.online-portal-zoom button:hover { background: #edf3fb; }
.online-portal-footer { flex: 0 0 auto; padding: 6px 14px; color: #76849a; background: #fff; border-top: 1px solid #e5eaf2; text-align: center; font-size: 10px; }

/* Prévia e importação da identidade do portal */
.online-auto-dashboard-note,
.online-layout-note { margin: 8px 0 0; color: #64748b; font-size: 11px; line-height: 1.45; }
.online-page-item.automatic { min-height: 38px; }
.online-logo-import { display: grid; grid-template-columns: 68px minmax(0,1fr); gap: 10px; align-items: center; }
.online-logo-preview { width: 68px; height: 68px; display: grid; place-items: center; overflow: hidden; border: 2px dashed #b8c5d8; border-radius: 50%; color: #8492a6; background: #f8fafc; font-size: 10px; }
.online-logo-preview img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.online-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.online-logo-actions small { flex-basis: 100%; color: #7b889b; font-size: 10px; }
.online-preview-frame { padding: 6px; container-type: inline-size; }
.online-preview-portal-sidebar { flex: 0 0 clamp(150px, 21%, 188px); display: flex; flex-direction: column; min-width: 0; padding: 9px; overflow: hidden; }
.online-preview-portal-brand { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10px; }
.online-preview-portal-brand > span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.09); border-radius: 5px; background: rgba(255,255,255,.07); }
.online-preview-portal-logo { width: 76px; height: 76px; display: grid; place-items: center; align-self: center; margin: 8px 0 7px; overflow: hidden; border: 3px solid #fff; border-radius: 50%; font-size: 9px; }
.online-preview-portal-logo img { width: 100%; height: 100%; object-fit: contain; }
.online-preview-portal-subtitle { min-height: 30px; padding: 2px 4px 8px; border-bottom: 1px solid rgba(255,255,255,.08); overflow: hidden; text-align: center; text-overflow: ellipsis; text-transform: uppercase; font-size: 8px; line-height: 1.35; }
.online-preview-portal-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; padding-top: 7px; overflow: auto; }
.online-preview-portal-nav .online-preview-nav-item { gap: 7px; padding: 8px 9px; font-size: 13px; }
.online-preview-nav-icon { display: grid; place-items: center; }
.online-preview-nav-icon .online-area-icon { width: 17px; height: 17px; }
.online-preview-portal-powered { padding-top: 6px; border-top: 1px solid rgba(255,255,255,.08); opacity: .5; text-align: center; font-size: 7px; }
.online-preview-portal-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.online-preview-portal-header { min-height: 48px; display: grid; grid-template-columns: minmax(88px, 1fr) auto; align-items: center; gap: 10px; padding: 6px 9px 6px 14px; border-bottom: 1px solid rgba(255,255,255,.10); }
.online-preview-portal-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 900; letter-spacing: .01em; text-transform: uppercase; }
.online-preview-portal-actions { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; white-space: nowrap; }
.online-preview-portal-header button,
.online-preview-portal-header select { box-sizing: border-box; height: 28px; min-height: 28px; margin: 0; border: 1px solid rgba(255,255,255,.25); border-radius: 5px; font-family: inherit; font-size: 8px; font-weight: 750; line-height: 1; }
.online-preview-portal-header button { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; padding: 0 7px; color: #172033; background: #fff; }
.online-preview-portal-header button svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.online-preview-portal-header .online-preview-portal-reset { width: 29px; padding: 0; color: #dc2638; }
.online-preview-portal-header .online-preview-portal-filter svg { fill: currentColor; stroke: none; }
.online-preview-portal-page { display: flex; flex-direction: row; align-items: center; gap: 4px; margin: 0; color: inherit; font-size: 7px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.online-preview-portal-page > span { color: #fff; opacity: 1; }
.online-preview-portal-page select { width: 86px; min-width: 86px; padding: 0 20px 0 7px; color: #111827; background: #fff; }
.online-preview-portal-status { height: 28px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; color: #fff; background: #0f8a5f; font-size: 7px; font-weight: 850; white-space: nowrap; }
.online-preview-user-avatar { width: 27px; height: 27px; flex: 0 0 27px; display: inline-grid; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; color: #fff; background: #2563eb; font-size: 7px; font-weight: 900; }
.online-preview-portal-filters { min-height: 23px; display: flex; align-items: center; gap: 6px; padding: 4px 10px; color: #5f6e83; background: #fff; border-bottom: 1px solid #e5eaf2; font-size: 8px; white-space: nowrap; }
.online-preview-portal-filters strong { color: #334155; }
.online-preview-portal-main .online-preview-content { padding: 12px; }

@container (max-width: 650px) {
  .online-preview-portal-sidebar { flex-basis: 128px; padding: 7px; }
  .online-preview-portal-logo { width: 62px; height: 62px; }
  .online-preview-portal-header { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 7px 8px; }
  .online-preview-portal-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; overflow: visible; }
  .online-preview-portal-header .online-preview-portal-filter { width: 29px; padding: 0; }
  .online-preview-portal-filter span,
  .online-preview-portal-page > span { display: none; }
  .online-preview-portal-page select { width: 72px; min-width: 72px; padding-left: 6px; }
  .online-preview-portal-status { height: 22px; padding: 0 7px; font-size: 6.5px; }
}

@media (max-width: 900px) {
  .online-portal-shell { grid-template-columns: 68px minmax(0,1fr); }
  .online-portal-identity,
  .online-portal-brand-row strong,
  .online-portal-nav-item b,
  .online-portal-sidebar-footer { display: none; }
  .online-portal-brand-row,
  .online-portal-nav-item { justify-content: center; }
  .online-portal-header { grid-template-columns: 1fr; align-items: start; gap: 8px; padding-left: 12px; }
  .online-portal-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .online-portal-status { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
}
.online-filter-list.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(147, 197, 253, .85);
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  color: #64748b;
  font-weight: 700;
}
.filter-popup-visual-item {
  border: 1px solid rgba(191, 219, 254, .95);
  background: rgba(255,255,255,.97);
  box-shadow: 0 14px 34px rgba(15,23,42,.12);
}
.filter-popup-visual-item.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.16), 0 18px 42px rgba(15,23,42,.16);
}
.filter-card-drag-handle {
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(14,165,233,.12));
  color: #1d4ed8;
}
.filter-card-resize-handle {
  background: linear-gradient(135deg, transparent 48%, rgba(37,99,235,.08) 49%);
  opacity: .85;
}
.filter-popup-visual-item {
  cursor: grab;
  touch-action: none;
  overflow: hidden;
}
.filter-popup-visual-item.dragging {
  cursor: grabbing;
}
.filter-popup-visual-item select,
.filter-popup-visual-item input,
.filter-popup-visual-item textarea,
.filter-popup-visual-item button,
.filter-popup-visual-item label,
.filter-popup-visual-item .filter-option-list {
  cursor: auto;
  touch-action: auto;
}
.filter-card-drag-handle {
  display: none !important;
}
.filter-card-actions {
  position: absolute;
  top: 5px;
  right: 6px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(226, 232, 240, .92);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .1);
}
.filter-popup-visual-item .filter-card-actions .filter-clear-floating {
  position: static;
  top: auto;
  right: auto;
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}
.filter-popup-visual-item .filter-card-actions .filter-clear-floating {
  color: #0f766e;
  background: rgba(240, 253, 250, .96);
  border: 1px solid rgba(94, 234, 212, .85);
}
.filter-popup-visual-item .filter-card-actions .filter-clear-floating:hover {
  color: #0f5f59;
  background: #ccfbf1;
}
.filter-popup-visual-item .filter-visual-title {
  padding-right: 34px;
  min-width: 0;
  overflow: hidden;
}
.filter-popup-visual-item .filter-visual-title b,
.filter-popup-visual-item .filter-visual-title small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-popup-visual-item .filter-popup-visual-body,
.filter-popup-visual-item .filter-visual-preview {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
.filter-popup-visual-item .filter-visual-preview {
  grid-template-rows: minmax(18px, auto) minmax(18px, auto) minmax(30px, 1fr);
}
.filter-popup-visual-item select,
.filter-popup-visual-item input {
  width: 100%;
  min-width: 0;
}
.dashboard-filter-runtime-card { width: min(820px, calc(100vw - 36px)); }
.dashboard-filter-runtime-card {
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.82), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,.40)),
    var(--dashboard-filter-popup-bg, #f3f6fb) !important;
}
.dashboard-filter-runtime-summary {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(187, 247, 208, .95);
  border-radius: 14px;
  background: rgba(240, 253, 244, .92);
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}
.dashboard-filter-runtime-card .popup-filter-grid { gap: 14px; }
.dashboard-filter-field {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15,23,42,.05);
}
.dashboard-filter-field > span {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}
.dashboard-filter-field select,
.dashboard-filter-field input {
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0 11px;
  background: #f8fafc;
}
.dashboard-filter-runtime-actions {
  position: sticky;
  bottom: -20px;
  margin: 18px -20px -20px;
  padding: 14px 20px;
  background: rgba(255,255,255,.94);
  border-top: 1px solid rgba(226,232,240,.95);
  backdrop-filter: blur(8px);
  justify-content: flex-end;
}

/* Popup de filtros do portal publicado */
#dashboardFilterRuntimeModal.modal-backdrop {
  place-items: start center;
  padding: clamp(14px, 2vw, 28px);
  overflow: auto;
  background: rgba(15, 23, 42, .14);
  backdrop-filter: none;
}
#dashboardFilterRuntimeModal .dashboard-filter-runtime-card {
  width: min(880px, calc(100vw - 32px));
  max-height: none;
  padding: 20px;
  overflow: visible;
  border: 1px solid rgba(203, 213, 225, .92);
  border-radius: 18px;
  background: #f8fafc !important;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .22);
}
#dashboardFilterRuntimeModal .dashboard-filter-runtime-card .modal-head {
  margin: -20px -20px 14px;
  min-height: 54px;
  padding: 10px 14px 10px 20px;
  align-items: center;
  background: #fff;
  border-bottom-color: #e2e8f0;
  border-radius: 18px 18px 0 0;
}
#dashboardFilterRuntimeModal .dashboard-filter-runtime-card .modal-head h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
}
#dashboardFilterRuntimeModal .dashboard-filter-runtime-card .modal-head h3 span {
  color: #475569;
  font-weight: 750;
}
#dashboardFilterRuntimeModal [data-close-dashboard-filter-popup] {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  color: #475569;
  background: #f8fafc;
  font-size: 19px;
}
#dashboardFilterRuntimeModal [data-close-dashboard-filter-popup]:hover {
  color: #b42331;
  background: #fff1f2;
  border-color: #fecdd3;
}
#dashboardFilterRuntimeModal .popup-filter-grid {
  gap: 11px;
  overflow: visible;
}
#dashboardFilterRuntimeModal .dashboard-filter-field {
  position: relative;
  gap: 6px;
  padding: 11px;
  border-color: #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .035);
}
#dashboardFilterRuntimeModal .dashboard-filter-field:has(.filter-dropdown-control.open) {
  z-index: 120;
  overflow: visible;
}
#dashboardFilterRuntimeModal .dashboard-filter-field > span {
  font-size: 11px;
  font-weight: 850;
}
#dashboardFilterRuntimeModal .dashboard-filter-runtime-actions {
  position: relative;
  bottom: auto;
  z-index: 1;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: none;
}
#dashboardFilterRuntimeModal .filter-dropdown-control,
#dashboardFilterRuntimeModal .filter-dropdown-menu,
#dashboardFilterRuntimeModal .filter-dropdown-options {
  overflow: visible;
}
#dashboardFilterRuntimeModal .filter-dropdown-menu {
  z-index: 180;
  max-height: min(360px, calc(100vh - 170px));
}
#dashboardFilterRuntimeModal .filter-dropdown-options {
  max-height: min(300px, calc(100vh - 230px));
  overflow-y: auto;
}
#dashboardFilterRuntimeModal .dashboard-filter-runtime-actions .btn {
  min-width: 110px;
  min-height: 36px;
  border-radius: 9px;
}
@media (max-width: 720px) {
  #dashboardFilterRuntimeModal .popup-filter-grid { grid-template-columns: 1fr; }
  #dashboardFilterRuntimeModal .dashboard-filter-runtime-card { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
}
@media (max-width: 900px) {
  .filter-popup-designer-layout { grid-template-columns: 1fr; }
  .online-filter-modal-card {
    width: min(100vw - 16px, 100%);
    max-height: calc(100vh - 16px);
  }
  .online-filter-modal-card .filter-popup-designer-layout {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 160px);
  }
  .online-filter-modal-card .filter-popup-canvas {
    min-height: 420px;
  }
  .filter-popup-form { border-top: 1px solid rgba(226, 232, 240, .95); }
}

/* v3.2.96 - Modal de filtros sem rolagem interna */
#onlineFilterModal {
  overflow: hidden;
}
#onlineFilterModal .online-filter-modal-card {
  display: flex;
  flex-direction: column;
  width: min(1480px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
  overflow: hidden !important;
}
#onlineFilterModal .online-filter-modal-card .modal-head {
  flex: 0 0 auto;
}
#onlineFilterModal .online-filter-modal-card .modal-head {
  margin-bottom: 12px;
  padding-top: 14px;
  padding-bottom: 12px;
}
#onlineFilterModal .online-filter-modal-card .modal-head .sub {
  display: none;
}
#onlineFilterModal .filter-popup-designer-layout {
  flex: 1 1 auto;
  grid-template-columns: minmax(700px, 1fr) minmax(340px, 380px);
  gap: 16px;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden !important;
  align-items: start;
}
#onlineFilterModal .filter-popup-canvas {
  display: flex;
  flex-direction: column;
  height: min(720px, calc(100vh - 220px));
  min-height: 520px;
  max-height: min(720px, calc(100vh - 220px));
  overflow: hidden !important;
  background:
    linear-gradient(90deg, rgba(203, 213, 225, .46) 1px, transparent 1px),
    linear-gradient(0deg, rgba(203, 213, 225, .46) 1px, transparent 1px),
    var(--online-filter-popup-bg, #f3f6fb) !important;
  background-size: 24px 24px, 24px 24px, auto !important;
}
#onlineFilterModal .online-filter-summary,
#onlineFilterModal .filter-popup-title-row {
  flex: 0 0 auto;
}
#onlineFilterModal .online-filter-list.filter-popup-visual-list {
  flex: 1 1 auto;
  height: auto;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  overscroll-behavior: none;
}
#onlineFilterModal .online-filter-list {
  overflow: hidden !important;
}
#onlineFilterModal .filter-popup-form {
  grid-template-columns: 1fr;
  gap: 8px;
  min-height: 0;
  max-height: none;
  overflow: hidden !important;
  align-content: start;
  padding: 14px 12px;
}
#onlineFilterModal .filter-popup-form label,
#onlineFilterModal .filter-popup-form select,
#onlineFilterModal .filter-popup-form input {
  min-width: 0;
}
#onlineFilterModal #addOnlineFilterBtn,
#onlineFilterModal .online-filter-style-editor,
#onlineFilterModal #saveOnlineFilterConfigBtn,
#onlineFilterModal .filter-popup-form .mini-help {
  grid-column: 1 / -1;
}
#onlineFilterModal .filter-popup-form select,
#onlineFilterModal .filter-popup-form input {
  min-height: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.2;
  padding: 0 12px;
}
#onlineFilterModal .filter-popup-form .mini-help {
  display: none;
}
#onlineFilterModal .filter-popup-form .btn {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}
#onlineFilterModal .filter-popup-form label {
  gap: 4px;
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
}
#onlineFilterModal .online-filter-style-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  padding: 10px;
  border: 1px solid rgba(191, 219, 254, .92);
  border-radius: 14px;
  background: rgba(239, 246, 255, .55);
  backdrop-filter: blur(4px);
}
#onlineFilterModal #editOnlineFilterCardStyleBtn {
  grid-column: 1 / -1;
  background: transparent;
  border-color: rgba(59, 130, 246, .45);
  color: #1d4ed8;
  box-shadow: none;
}
#onlineFilterModal .filter-style-field {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
#onlineFilterModal .filter-style-field input[type="color"] {
  width: 100%;
  min-height: 30px;
  height: 30px;
  padding: 3px;
}
#onlineFilterModal .filter-style-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 130px;
  padding-top: 0;
  font-size: 12px;
}
#onlineFilterModal .filter-style-check input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 auto;
}
#onlineFilterModal #saveOnlineFilterConfigBtn {
  margin-top: 0 !important;
}
#onlineFilterModal .filter-popup-visual-item {
  min-width: 70px !important;
  min-height: 32px !important;
}
#onlineFilterModal .filter-popup-visual-item select,
#onlineFilterModal .filter-popup-visual-item input {
  min-height: 24px;
  height: 26px;
  padding: 0 7px;
  border-radius: 8px;
}
#onlineFilterModal .filter-popup-visual-item .filter-visual-preview {
  gap: 3px;
}
#onlineFilterModal .filter-popup-visual-item .filter-visual-title {
  min-height: 0;
}
#onlineFilterModal .filter-popup-visual-item .filter-visual-title b,
#onlineFilterModal .filter-popup-visual-item .filter-visual-title small {
  font-size: 11px;
  line-height: 1.1;
}
@media (max-width: 900px) {
  #onlineFilterModal .online-filter-modal-card {
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
  }
  #onlineFilterModal .filter-popup-designer-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }
}

@media (max-height: 800px) {
  #onlineFilterModal .filter-popup-canvas {
    height: calc(100vh - 200px);
    min-height: 390px;
    max-height: calc(100vh - 200px);
  }
  #onlineFilterModal .filter-popup-form {
    gap: 6px;
    padding: 10px 12px;
  }
  #onlineFilterModal .filter-popup-form select,
  #onlineFilterModal .filter-popup-form input,
  #onlineFilterModal .filter-popup-form .btn {
    min-height: 31px;
    height: 31px;
  }
  #onlineFilterModal .online-filter-style-editor {
    gap: 6px 8px;
    padding: 8px;
  }
}

/* v3.2.97 - Visuais do construtor estilo Power BI */
body.report-editor-active .visual-remove-btn {
  display: none !important;
}

body.report-editor-active .visual-frame {
  outline: 1px solid rgba(148, 163, 184, .42);
  outline-offset: 0;
  min-width: 0 !important;
  min-height: 0 !important;
}

body.report-editor-active .visual-frame .visual-content,
body.report-editor-active .visual-frame .textbox-content,
body.report-editor-active .visual-frame .echarts-host,
body.report-editor-active .visual-frame .gauge-wrap,
body.report-editor-active .visual-frame .kpi-card {
  min-width: 0 !important;
  min-height: 0 !important;
}

body.report-editor-active .visual-frame.selected,
body.report-editor-active .visual-frame.active-visual,
body.report-editor-active .visual-frame:focus {
  outline: 2px solid var(--visual-accent, #1f6feb) !important;
  outline-offset: 0;
  box-shadow: 0 0 0 4px rgba(31, 111, 235, .14), 0 22px 48px rgba(15, 23, 42, .16) !important;
}

body.report-editor-active .visual-frame.hide-title .visual-content {
  height: 100% !important;
}

body.report-editor-active .visual-move-edge {
  position: absolute;
  z-index: 12;
  display: block;
  border-radius: 999px;
  background: var(--visual-accent, #1f6feb);
  opacity: 0;
  cursor: move;
  transition: opacity .14s ease, transform .14s ease;
}

body.report-editor-active .visual-frame.selected .visual-move-edge,
body.report-editor-active .visual-frame.active-visual .visual-move-edge {
  opacity: .22;
}

body.report-editor-active .visual-frame.selected .visual-move-edge:hover,
body.report-editor-active .visual-frame.active-visual .visual-move-edge:hover {
  opacity: .55;
}

body.report-editor-active .visual-move-edge-top,
body.report-editor-active .visual-move-edge-bottom {
  left: 12px;
  right: 28px;
  height: 8px;
}

body.report-editor-active .visual-move-edge-top {
  top: 0;
}

body.report-editor-active .visual-move-edge-bottom {
  bottom: 0;
}

body.report-editor-active .visual-move-edge-left,
body.report-editor-active .visual-move-edge-right {
  top: 12px;
  bottom: 28px;
  width: 8px;
}

body.report-editor-active .visual-move-edge-left {
  left: 0;
}

body.report-editor-active .visual-move-edge-right {
  right: 0;
}

body.report-editor-active .visual-frame.dragging .visual-move-edge {
  opacity: .72;
}

body.report-editor-active .visual-resize-handle {
  z-index: 14;
}

body.report-editor-active .visualizations-pane,
body.report-editor-active .data-pane {
  overflow-x: hidden;
  overflow-y: auto;
}

/* v3.3.8 - Faixa de ferramentas do construtor em abas */
.powerbi-main-ribbon {
  display: block;
  flex: 0 0 106px;
  min-width: 0;
  height: 106px;
  min-height: 106px;
  max-height: 106px;
  margin: 0 0 8px;
  overflow: hidden;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.ribbon-tab-strip {
  display: flex;
  align-items: flex-end;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid #dce3ec;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  scrollbar-width: thin;
}

.ribbon-tab {
  position: relative;
  align-self: stretch;
  flex: 0 0 auto;
  min-width: 0;
  padding: 0 15px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #263548;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: color .14s ease, background .14s ease;
}

.ribbon-tab::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}

.ribbon-tab:hover {
  color: #0f5da8;
  background: #f2f7fc;
}

.ribbon-tab.active {
  color: #0f5da8;
  background: #fff;
}

.ribbon-tab.active::after {
  background: #0f6cbd;
}

.ribbon-tab-contextual {
  margin-left: 6px;
  border-right: 1px solid #c8d9eb;
  border-left: 1px solid #c8d9eb;
  background: #edf6ff;
  color: #075a9f;
}

.ribbon-tab-contextual:hover,
.ribbon-tab-contextual.active {
  background: #e2f1ff;
  color: #004f91;
}

.ribbon-tab-contextual.active::after {
  background: #0078d4;
}

.ribbon-tab:focus-visible,
.ribbon-command:focus-visible {
  outline: 2px solid #2684ff;
  outline-offset: -2px;
}

.ribbon-context-title {
  align-self: center;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 4px 9px;
  border: 1px solid #d6e5f4;
  border-radius: 999px;
  background: #edf5fc;
  color: #315b7d;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .02em;
  white-space: nowrap;
}

.ribbon-tab-panel {
  display: flex;
  align-items: stretch;
  min-width: 0;
  min-height: 70px;
  max-height: 70px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
  scrollbar-color: #b8c6d8 transparent;
  scrollbar-width: thin;
}

.ribbon-tab-panel[hidden] {
  display: none !important;
}

.ribbon-tab-panel::-webkit-scrollbar,
.ribbon-tab-strip::-webkit-scrollbar {
  height: 5px;
}

.ribbon-tab-panel::-webkit-scrollbar-thumb,
.ribbon-tab-strip::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #b8c6d8;
}

.ribbon-command-group {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-width: 86px;
  padding: 5px 11px 17px;
  border-right: 1px solid #dde4ed;
}

.ribbon-command-group:last-child {
  border-right: 0;
}

.ribbon-command-group-label {
  position: absolute;
  right: 8px;
  bottom: 2px;
  left: 8px;
  overflow: hidden;
  color: #66758a;
  font-size: 9px;
  font-weight: 650;
  line-height: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ribbon-command {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 58px;
  height: 47px;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #16263a;
  font: inherit;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}

.ribbon-command:hover {
  border-color: #c8d9eb;
  background: #eef5fb;
  color: #0f5da8;
}

.ribbon-command:active {
  background: #dcebf8;
}

.ribbon-command-wide {
  width: 86px;
}

.ribbon-command-icon,
.ribbon-guidance-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #356f9f;
}

.ribbon-command-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.ribbon-source-group {
  min-width: 315px;
}

.ribbon-report-actions-group {
  min-width: 92px;
}

.ribbon-source-control {
  display: grid;
  gap: 3px;
  min-width: 220px;
  color: #536277;
  font-size: 9.5px;
  font-weight: 700;
}

.ribbon-source-control select {
  width: 220px;
  height: 31px;
  min-height: 31px;
  padding: 4px 28px 4px 9px;
  overflow: hidden;
  border: 1px solid #cbd6e4;
  border-radius: 5px;
  background-color: #fff;
  color: #172033;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ribbon-source-control select:focus {
  border-color: #2684ff;
  outline: 2px solid rgba(38, 132, 255, .14);
}

.ribbon-home-help-group {
  flex: 1 0 330px;
  min-width: 330px;
}

.ribbon-guidance {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1f3045;
}

.ribbon-guidance-icon {
  width: 34px;
  height: 34px;
  border: 1px solid #d4e4f2;
  border-radius: 8px;
  background: #f3f8fd;
}

.ribbon-guidance-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.ribbon-guidance > span:last-child {
  display: grid;
  gap: 2px;
}

.ribbon-guidance strong {
  font-size: 11px;
}

.ribbon-guidance small {
  color: #66758a;
  font-size: 9.5px;
  white-space: nowrap;
}

.ribbon-visual-panel {
  overflow-x: auto;
}

.ribbon-visual-identity-group {
  min-width: 152px;
}

.ribbon-visual-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 128px;
}

.ribbon-visual-identity > span:last-child {
  display: grid;
  min-width: 0;
}

.ribbon-visual-identity strong {
  overflow: hidden;
  color: #163a59;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ribbon-visual-identity small {
  color: #6b7b8f;
  font-size: 9px;
}

.ribbon-visual-identity-icon {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid #c9dff2;
  border-radius: 7px;
  background: #edf6ff;
  color: #0f6cbd;
  font-size: 20px;
}

.ribbon-visual-title-group {
  min-width: 310px;
}

.ribbon-visual-title-control {
  display: grid;
  gap: 3px;
  width: 205px;
  color: #536277;
  font-size: 9px;
  font-weight: 700;
}

.ribbon-visual-title-control input {
  width: 100%;
  height: 29px;
  min-height: 29px;
  padding: 4px 8px;
  border: 1px solid #cbd6e4;
  border-radius: 5px;
  background: #fff;
  color: #172033;
  font-size: 11px;
}

.ribbon-mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 29px;
  padding: 0 7px;
  border: 1px solid #d7e0eb;
  border-radius: 5px;
  background: #f8fafc;
  color: #33465d;
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
}

.ribbon-mini-toggle input {
  margin: 0;
}

.ribbon-visual-colors-group {
  min-width: 205px;
}

.ribbon-color-control {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: #52647a;
  font-size: 8.5px;
  font-weight: 650;
}

.ribbon-color-control input[type="color"] {
  width: 43px;
  height: 31px;
  padding: 2px;
  border: 1px solid #cbd6e4;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.ribbon-visual-effects-group {
  min-width: 150px;
}

.ribbon-insert-group,
.ribbon-static-group {
  gap: 2px;
}

.powerbi-main-ribbon .ribbon-view-tools {
  display: flex;
  min-width: 0;
  gap: 0;
}

.powerbi-main-ribbon .ribbon-layer-group {
  min-width: 400px;
}

.powerbi-main-ribbon .ribbon-layout-group {
  min-width: 260px;
}

.powerbi-main-ribbon .ribbon-zorder-btns {
  gap: 2px;
  padding: 3px;
  border: 1px solid #dbe4ef;
  background: #f6f8fb;
}

.powerbi-main-ribbon .ribbon-zorder-btn {
  height: 32px;
  padding: 4px 9px !important;
  color: #264763;
  font-size: 10px;
}

.powerbi-main-ribbon .ribbon-layout-actions {
  gap: 3px;
  padding-left: 0;
  border-left: 0;
}

.powerbi-main-ribbon .ribbon-grid-toggle {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #dbe4ef;
  border-radius: 5px;
  background: #f8fafc;
}

.powerbi-main-ribbon .ribbon-layout-btn {
  width: 32px;
  min-width: 32px !important;
  height: 32px;
  border: 1px solid #dbe4ef;
  border-radius: 5px;
  background: #fff;
  color: #264763;
}

.powerbi-main-ribbon .ribbon-layout-btn:hover {
  border-color: #b9cfe4;
  background: #eef5fb;
  color: #0f5da8;
}

@media (max-width: 1100px) {
  .ribbon-context-title {
    display: none;
  }

  .ribbon-home-help-group {
    flex-basis: 250px;
    min-width: 250px;
  }

  .ribbon-guidance small {
    display: none;
  }
}

@media (max-width: 1366px) {
  .ribbon-context-title {
    display: none;
  }

  .ribbon-home-help-group {
    flex-basis: 225px;
    min-width: 225px;
  }

  .ribbon-guidance small {
    display: none;
  }

  body.report-editor-active .powerbi-editor-head {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    padding: 6px 9px;
  }

  body.report-editor-active .powerbi-editor-head > div:first-child {
    display: flex;
    flex: 0 1 210px;
    min-width: 0;
  }

  body.report-editor-active .powerbi-editor-head h2 {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.report-editor-active .editor-main-actions {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    width: auto;
    max-width: calc(100% - 218px);
    min-width: 0;
    gap: 4px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.report-editor-active .editor-main-actions::-webkit-scrollbar {
    display: none;
  }

  body.report-editor-active .editor-main-actions .btn {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 0 !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 3px 5px !important;
    font-size: 9px !important;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .ribbon-tab-strip {
    padding: 0 4px;
  }

  .ribbon-tab {
    padding: 0 11px;
    font-size: 11px;
  }

  .ribbon-source-group {
    min-width: 280px;
  }

  .ribbon-source-control,
  .ribbon-source-control select {
    min-width: 190px;
    width: 190px;
  }
}
