/* Visão enxuta — Julho/26 GD I: KPIs + grade com scroll confiável */

body.dash-enxuta {
  overflow-x: hidden;
}

body.dash-enxuta .app-sidebar,
body.dash-enxuta .app-usina-gd-switch,
body.dash-enxuta .sticky-dash-wrap,
body.dash-enxuta .sticky-ctrl-wrap,
body.dash-enxuta #stickyDashSpacer,
body.dash-enxuta #stickyCtrlSpacer,
body.dash-enxuta #tabC2,
body.dash-enxuta .grid-focus-enter-btn,
body.dash-enxuta .table-grid-pinrow {
  display: none !important;
}

/* Mantém a cadeia flex do app-shell (não usar display:block no layout) */
body.dash-enxuta .app-layout {
  flex: 1;
  min-height: 0;
}

body.dash-enxuta .app-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.dash-enxuta .app-page-topbar {
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  padding-bottom: 0;
  position: relative;
  z-index: 2;
}

body.dash-enxuta .app-page-kpis {
  display: block !important;
  padding: 8px 12px 0;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

body.dash-enxuta .app-page-kpis .kpis {
  margin: 0;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.dash-enxuta--gd2 .app-page-kpis .kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

body.dash-enxuta--gd2 .app-page-kpis .kpi.kpi-cap .value,
body.dash-enxuta--gd2 .app-page-kpis .kpi.kpi-aloc .value {
  font-size: 18px;
}

body.dash-enxuta--gd2 .app-page-kpis .kpi.kpi-cap .sub,
body.dash-enxuta--gd2 .app-page-kpis .kpi.kpi-aloc .sub,
body.dash-enxuta--gd2 .app-page-kpis .kpi.money .sub {
  display: block !important;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.25;
  color: #64748b;
}

body.dash-enxuta .app-page-kpis .kpi {
  padding: 8px 10px 8px 14px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

body.dash-enxuta .app-page-kpis .kpi:hover {
  transform: none;
}

body.dash-enxuta .app-page-kpis .kpi .label {
  font-size: 9px;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

body.dash-enxuta .app-page-kpis .kpi .value {
  font-size: 22px;
  margin-top: 4px;
  line-height: 1.1;
}

body.dash-enxuta .app-page-kpis .kpi .sub {
  display: none !important;
}

body.dash-enxuta .app-page-kpis .kpi.proj .value,
body.dash-enxuta .app-page-kpis .kpi.money .value {
  font-size: 20px;
}

body.dash-enxuta .app-page-search-gd2 {
  padding: 8px 12px 10px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

body.dash-enxuta .enxuta-tipo-plano-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 280px;
  min-width: 200px;
}

body.dash-enxuta .enxuta-tipo-plano-filter__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

body.dash-enxuta .enxuta-tipo-plano-filter__label .material-icons {
  font-size: 16px;
  color: #0f766e;
}

body.dash-enxuta .filtro-tipo-plano-select {
  flex: 1;
  min-width: 160px;
  max-width: 320px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
}

body.dash-enxuta .filtro-tipo-plano-select:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18);
}

body.dash-enxuta .enxuta-pct-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 520px;
}

body.dash-enxuta .enxuta-pct-filter__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

body.dash-enxuta .enxuta-pct-filter__label .material-icons {
  font-size: 16px;
  color: #15803d;
}

body.dash-enxuta .enxuta-pct-filter input[type="range"] {
  flex: 1;
  min-width: 100px;
  accent-color: #15803d;
  cursor: pointer;
}

body.dash-enxuta .enxuta-pct-filter__val {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #14532d;
  min-width: 3.5rem;
  text-align: right;
}

/* Área principal: scroll só na tabela (KPIs e barra ficam fixos) */
body.dash-enxuta .app-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 12px;
}

body.dash-enxuta #tabC1 {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

body.dash-enxuta .table-grid-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

body.dash-enxuta .freeze-cols-toolbar input[type="range"],
body.dash-enxuta .freeze-cols-toolbar select {
  display: none !important;
}

body.dash-enxuta .freeze-cols-toolbar .freeze-cols-label::after {
  content: " · até Cliente";
}

body.dash-enxuta .grid-page-bar {
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
  margin: 0;
  border-radius: 10px 10px 0 0;
  gap: 8px 14px;
}

/* Tabela: único scroll (vertical + horizontal) — colunas fixas permanecem */
body.dash-enxuta .table-grid-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  max-width: 100%;
  max-height: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 0 0 10px 10px;
}

body.dash-enxuta table#tab thead tr.c2-head-sum {
  display: none;
}

body.dash-enxuta table#tab thead tr:last-child th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafc;
}

body.dash-enxuta table#tab thead tr:last-child th.table-col-freeze {
  z-index: 30 !important;
  background: #f8fafc;
}

body.dash-enxuta table#tab tbody td.table-col-freeze {
  z-index: 2;
  background: #fff;
}

body.dash-enxuta .freeze-cols-toolbar {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  gap: 6px;
}

body.dash-enxuta .freeze-cols-toolbar .freeze-cols-label {
  font-weight: 600;
}

body.dash-enxuta .freeze-cols-toolbar input[type="range"] {
  width: 96px;
}

body.dash-enxuta .freeze-cols-toolbar select {
  min-width: 130px;
  max-width: 150px;
  padding: 4px 6px;
}

body.dash-enxuta .freeze-cols-toolbar .freeze-cols-hint {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dash-enxuta .enxuta-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e40af;
  text-decoration: none;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  position: relative;
  z-index: 3;
  cursor: pointer;
}

body.dash-enxuta .enxuta-nav-link:hover {
  background: #dbeafe;
}

body.dash-enxuta .enxuta-menu-popover {
  position: fixed;
  top: calc(var(--app-topbar-h, 56px) + 6px);
  left: 12px;
  z-index: 200;
  min-width: 240px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.dash-enxuta .enxuta-menu-popover[hidden] {
  display: none !important;
}

body.dash-enxuta .enxuta-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #1e293b;
  font-size: 0.9rem;
  font-weight: 600;
}

body.dash-enxuta .enxuta-menu-item:hover {
  background: #eff6ff;
  color: #1e40af;
}

body.dash-enxuta .enxuta-menu-item .material-icons {
  font-size: 20px;
  color: #1e4d8f;
}

body.dash-enxuta .c1-exfishes-valor-badge,
.c1-exfishes-valor-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}

body.dash-enxuta .app-bc-row {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body.dash-enxuta .app-bc-row .enxuta-nav-link--hub {
  margin-left: auto;
}

body.dash-enxuta .app-bc-row .enxuta-nav-link:not(.enxuta-nav-link--hub) {
  margin-left: 0;
}

/* Overlay de login não pode bloquear cliques quando fechado */
.auth-overlay[style*="display: none"],
.auth-overlay[hidden] {
  pointer-events: none !important;
  visibility: hidden !important;
}

body.dash-enxuta .freeze-cols-toolbar {
  display: none !important;
}

body.dash-enxuta table#tab th.num,
body.dash-enxuta table#tab td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

body.dash-enxuta table#tab td.left,
body.dash-enxuta table#tab th.left {
  text-align: left;
}

body.dash-enxuta table#tab tbody tr.row-exfishes-enxuta {
  background: #eff6ff;
}

body.dash-enxuta table#tab tbody tr.row-usina-geradora-enxuta {
  background: #ecfdf5;
  font-weight: 600;
}

body.dash-enxuta .enxuta-head-sum th {
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  body.dash-enxuta .app-page-kpis .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.dash-enxuta--gd2 .app-page-kpis .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body.dash-enxuta .app-page-kpis .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.dash-enxuta .app-page-kpis .kpi .value {
    font-size: 18px;
  }
  body.dash-enxuta .app-bc-row .enxuta-nav-link--hub {
    margin-left: 0;
  }
}
