:root {
  --app-green: #00b152;
  --app-green-light: #e6f7ee;
  --app-green-dark: #007c39;
  --app-border: #e5e7eb;
  --app-muted: #6b7280;
  --app-sidebar-w: 260px;
  --app-topbar-h: 56px;
  --app-sidebar-offset: var(--app-sidebar-w);
  --kpi-tech-bg0: rgba(255, 255, 255, 0.92);
  --kpi-tech-bg1: rgba(248, 250, 252, 0.97);
  --kpi-tech-edge: rgba(30, 77, 143, 0.1);
}
* { box-sizing: border-box; }
.material-icons { font-size: 20px; line-height: 1; user-select: none; vertical-align: middle; }
html { overflow-y: scroll; }
body { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
       margin: 0; padding: 0; background: #f3f5f8; color: #1c2733; }

/* Gate de login: garante que o app não apareça antes de autenticar */
body.auth-locked #authOverlay { display: grid !important; }
body.auth-locked #appRoot { display: none !important; }

/* Shell inspirado em proposta-menu-v4 */
#appRoot.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #f9fafb;
}
.app-topbar {
  height: var(--app-topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}
.app-menu-toggle {
  width: 40px; height: 40px; border-radius: 10px;
  border: none; background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--app-muted);
  transition: background .15s;
}
.app-menu-toggle:hover { background: #f3f4f6; color: #1c2733; }
.app-topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-logo-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(30,77,143,.12);
  flex-shrink: 0;
  padding: 3px;
  box-sizing: border-box;
}
.app-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.app-logo-name { font-size: 15px; font-weight: 800; color: #1a1a2e; letter-spacing: -.2px; }
.app-logo-tag { font-size: 9px; color: var(--app-muted); letter-spacing: .85px; text-transform: uppercase; display: block; margin-top: -1px; }
.app-topbar-fill { flex: 1; min-width: 8px; }
.app-topbar-meta {
  display: none;
  align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--app-muted);
}
@media (min-width: 640px) {
  .app-topbar-meta { display: flex; }
}
.app-tb-ico { font-size: 18px !important; opacity: .85; }

.app-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 90;
  backdrop-filter: blur(2px);
}
.app-overlay.show { display: block; }

.app-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  position: relative;
}
.app-sidebar {
  width: var(--app-sidebar-w);
  background: #fff;
  border-right: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1), box-shadow .28s;
  z-index: 95;
  overflow: hidden;
}
.app-layout.app-layout--collapsed .app-sidebar {
  width: 0;
  transform: translateX(-8px);
  border-right: none;
  pointer-events: none;
}
.app-sidebar-intro {
  padding: 14px 16px;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.app-si-ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
  border: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 4px;
  box-sizing: border-box;
}
.app-si-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.app-si-text { font-size: 12px; color: var(--app-muted); line-height: 1.45; padding-top: 2px; }

.app-nav-section {
  font-size: 10px; font-weight: 800;
  color: var(--app-muted);
  letter-spacing: 1.1px;
  text-transform: uppercase;
  padding: 14px 16px 6px;
}
.app-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 12px;
  scrollbar-width: thin;
}
.app-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: #374151;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.app-nav-item:hover {
  background: #f9fafb;
  color: var(--app-green);
}
.app-nav-item:hover .material-icons { color: inherit; }
.app-nav-item.active {
  background: var(--app-green-light);
  color: var(--app-green-dark);
  font-weight: 700;
  border-left-color: var(--app-green);
}
.app-nav-item.active .material-icons { color: var(--app-green-dark); }
a.app-nav-item { text-decoration: none; color: inherit; display: flex; }
a.app-nav-item:visited { color: inherit; }
.app-nav-item--enxuta {
  background: #ecfdf5;
  border-left: 3px solid #34d399;
  color: #065f46;
  font-weight: 700;
}
.app-nav-item--enxuta .material-icons { color: #047857; }
.app-nav-item--enxuta:hover { background: #d1fae5; }
.app-nav-label { flex: 1; }
.app-nav-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  background: #eef4ff;
  color: #1e4d8f;
  letter-spacing: .2px;
}
.app-nav-pill--sec { background: #e0f2fe; color: #0369a1; }

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.app-page-topbar {
  flex-shrink: 0;
  padding: 12px 20px;
  border-bottom: 1px solid var(--app-border);
  background: #fff;
}
.app-bc {
  font-size: 13px;
  color: var(--app-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.app-bc-root { font-weight: 700; color: #1e4d8f; }
.app-bc-sep { opacity: .45; }
.app-bc-cur { color: #1c2733; font-weight: 700; }

/* KPIs globais abaixo do breadcrumb (espelho da usina ativa no menu) */
.app-page-kpis {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.app-page-kpis .kpis {
  margin-bottom: 0;
}
.kpis--tab-source {
  display: none !important;
}

/* Pesquisa rápida GD II (topo) */
.app-page-search-gd2 {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.app-page-search-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  flex: 0 0 auto;
}
.app-page-search-label .material-icons {
  font-size: 18px;
  color: #64748b;
}
.app-page-search-input {
  flex: 1 1 240px;
  min-width: min(100%, 220px);
  max-width: 560px;
  padding: 10px 14px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  font-size: 14px;
  background: #f8fafc;
  box-sizing: border-box;
}
.app-page-search-input:focus {
  outline: none;
  border-color: #1e4d8f;
  background: #fff;
}

.app-bc-row {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.app-usina-gd-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
  padding: 2px;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid var(--app-border);
}
.app-usina-gd-switch[hidden] { display: none !important; }
.app-usina-gd-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.app-usina-gd-btn:hover { color: #1e4d8f; background: #e8eef7; }
.app-usina-gd-btn.active {
  background: #fff;
  color: #1e4d8f;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
a.app-usina-gd-btn {
  text-decoration: none;
  display: inline-block;
  color: #64748b;
}
.app-bc-help {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--app-border);
  background: #f9fafb;
  color: #1e4d8f;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background .15s, border-color .15s, transform .15s;
}
.app-bc-help:hover {
  background: #eef4ff;
  border-color: #1e4d8f;
}
.app-bc-help:focus-visible {
  outline: 2px solid #1e4d8f;
  outline-offset: 2px;
}
.app-bc-help[aria-expanded="true"] {
  background: #1e4d8f;
  border-color: #1e4d8f;
  color: #fff;
}

/* Painel flutuante “Sobre a usina” — card com hierarquia clara */
.app-help-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 220;
  width: min(420px, calc(100vw - 32px));
  max-height: min(78vh, 560px);
  padding: 0;
  border: none;
  background: transparent;
  filter: drop-shadow(0 22px 40px rgba(15, 23, 42, 0.14)) drop-shadow(0 0 1px rgba(15, 23, 42, 0.06));
}
.app-help-popover[hidden] { display: none !important; }
.app-help-popover__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: inherit;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.app-help-popover:not([hidden]) .app-help-popover__panel {
  animation: appHelpEnter .28s cubic-bezier(.2, .85, .25, 1);
}
@keyframes appHelpEnter {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.app-help-popover-inner {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.app-help-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  transition: background .15s, color .15s, transform .15s;
}
.app-help-close .material-icons { font-size: 20px; }
.app-help-close:hover {
  background: #fff;
  color: #1e293b;
  transform: scale(1.04);
}
.app-help-pane { padding: 0; }
.app-help-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  padding: 20px 52px 18px 20px;
  align-items: start;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.app-help-hero--gd1 {
  background: linear-gradient(135deg, #f0f6ff 0%, #fff 48%, #f8fafc 100%);
}
.app-help-hero--gd2 {
  background: linear-gradient(135deg, #ecfeff 0%, #fff 50%, #f8fafc 100%);
}
.app-help-hero__visual {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-help-hero--gd1 .app-help-hero__visual {
  background: linear-gradient(145deg, #1e4d8f, #3b82f6);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 77, 143, 0.35);
}
.app-help-hero--gd2 .app-help-hero__visual {
  background: linear-gradient(145deg, #0369a1, #22d3ee);
  color: #fff;
  box-shadow: 0 8px 20px rgba(3, 105, 161, 0.32);
}
.app-help-hero__ico { font-size: 28px !important; }
.app-help-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1e4d8f;
  background: rgba(30, 77, 143, 0.1);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.app-help-chip--gd2 {
  color: #0369a1;
  background: rgba(3, 105, 161, 0.12);
}
.app-help-hero h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.2;
}
.app-help-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #475569;
}
.app-help-lead strong { color: #0f172a; }
.app-help-grid {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.app-help-block {
  border-radius: 12px;
  padding: 14px 14px 14px 16px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
}
.app-help-block--highlight {
  background: linear-gradient(180deg, #fffbeb 0%, #fff7ed 100%);
  border-color: #fde68a;
}
.app-help-block--code {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}
.app-help-block--code .app-help-block__label { color: #94a3b8; }
.app-help-block__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.app-help-block__label .material-icons { font-size: 18px !important; opacity: 0.85; }
.app-help-block__p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}
.app-help-block--highlight .app-help-block__p { color: #78350f; }
.app-help-block__p strong { color: #0f172a; }
.app-help-matrix {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-help-matrix__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #334155;
}
.fx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}
.fx-a { background: #d4f0de; color: #166534; }
.fx-b { background: #dbe8fb; color: #1e40af; }
.fx-c { background: #fce7f3; color: #9d174d; }
.app-help-minilist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}
.app-help-minilist li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.app-help-formula {
  margin: 0 0 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #1e293b;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #a5f3fc;
  white-space: pre-wrap;
  word-break: break-word;
}
.app-help-footnote {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}
.app-help-footnote strong { color: #e2e8f0; }

@media (max-width: 640px) {
  .app-help-popover {
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-height: min(88vh, 620px);
    filter: drop-shadow(0 -8px 32px rgba(15, 23, 42, 0.18));
  }
  .app-help-popover__panel {
    border-radius: 20px 20px 0 0;
    max-height: min(88vh, 620px);
  }
  .app-help-popover:not([hidden]) .app-help-popover__panel {
    animation: appHelpSheet .35s cubic-bezier(.25, 1, .5, 1);
  }
  @keyframes appHelpSheet {
    from { transform: translateY(100%); opacity: 0.96; }
    to { transform: translateY(0); opacity: 1; }
  }
  .app-help-hero {
    padding-right: 52px;
  }
}

.app-scroll {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px 28px;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    top: var(--app-topbar-h);
    left: 0;
    bottom: 0;
    width: min(var(--app-sidebar-w), 88vw) !important;
    transform: translateX(-105%);
    box-shadow: 8px 0 32px rgba(0,0,0,.12);
  }
  .app-sidebar.app-sidebar--open {
    transform: translateX(0);
    pointer-events: auto;
  }
  .app-layout:not(.app-layout--collapsed) .app-sidebar {
    width: min(var(--app-sidebar-w), 88vw) !important;
  }
  .app-layout.app-layout--collapsed .app-sidebar {
    transform: translateX(-105%);
  }
}

.tab-pane { display: none; }
.tab-pane.active {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

/* —— Faturamento Maio/2026 (aba dedicada) —— */
.fat-maio-wrap { padding: 0 0 1rem; max-width: 100%; }
.fat-maio-header { margin-bottom: 1rem; flex-shrink: 0; }
.fat-maio-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.fat-maio-sub { margin: 0; font-size: 0.85rem; color: var(--muted, #64748b); }
.tab-pane.tab-period.active .fat-maio-wrap {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--app-topbar-h, 56px) - 88px);
}
.fat-maio-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}
@media (max-width: 1100px) {
  .fat-maio-split { grid-template-columns: 1fr; }
  .tab-pane.tab-period.active .fat-maio-wrap { min-height: 0; }
  .fat-maio-col { max-height: none; }
}
.fat-maio-col {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--app-topbar-h, 56px) - 140px);
  overflow: hidden;
}
.fat-maio-sticky-head {
  flex-shrink: 0;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px 12px 0 0;
  z-index: 5;
}
.fat-maio-col-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem 1rem 1.15rem;
  -webkit-overflow-scrolling: touch;
}
.fat-maio-col__title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.fat-maio-col__title .material-icons { font-size: 1.25rem; color: #2c6bbf; }
.fat-maio-col--gd2 .fat-maio-col__title .material-icons,
.fat-maio-col--gd3 .fat-maio-col__title .material-icons { color: #2d9c5b; }
.fat-maio-kpis {
  margin-bottom: 0 !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px) {
  .fat-maio-kpis { grid-template-columns: 1fr; }
}
.fat-maio-kpis .kpi .value { font-size: 22px; }
.fat-maio-kpis--gd2 .kpi.kpi-fat-real .value {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fat-maio-kpis--gd2 .kpi.kpi-fat-previa .value {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fat-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.fat-kpi {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}
.fat-kpi--novos { background: #faf5ff; border-color: #e9d5ff; }
.fat-kpi__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; margin-bottom: 0.2rem; }
.fat-kpi__val { font-size: 1.15rem; font-weight: 700; color: #0f172a; }
.fat-kpi__sub { font-size: 0.75rem; color: #64748b; margin-top: 0.15rem; }
.fat-section { margin-top: 0.5rem; }
.fat-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
}
.fat-section--atraso h3 {
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.fat-section__tag--atraso {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.fat-section__tag--gd3 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
}
.fat-section--atraso .fat-venc-block {
  border-color: #fecaca;
}
.fat-section--atraso .fat-venc-block__head--atraso {
  background: #fef2f2;
  color: #991b1b;
}
.fat-section--atraso .fat-venc-list li {
  border-top-color: #fee2e2;
}
.fat-section--atraso .fat-venc-list li:nth-child(even) {
  background: #fff5f5;
}
.fat-section--atraso .fat-venc-list__nome {
  color: #7f1d1d;
}
.fat-section--atraso .fat-venc-list__val {
  color: #b91c1c;
  font-weight: 700;
}
.fat-maio-kpis .kpi.kpi-fat-atraso::before {
  background: linear-gradient(180deg, #f87171, #dc2626) !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35) !important;
}
.fat-maio-kpis .kpi.kpi-fat-atraso .value {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fat-venc-block {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.fat-venc-block__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
}
.fat-venc-block__head--novos { background: #f3e8ff; color: #6b21a8; }
.fat-venc-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.fat-venc-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  border-top: 1px solid #f1f5f9;
}
.fat-venc-list li:nth-child(even) { background: #fafafa; }
.fat-venc-list__nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fat-venc-list__val { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fat-novos-box {
  border: 2px dashed #c4b5fd;
  border-radius: 10px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  background: #faf5ff;
}
.fat-novos-box h3 { color: #6b21a8; }
.fat-table-wrap { overflow-x: auto; margin-top: 0.5rem; }
.fat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.fat-table th, .fat-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}
.fat-table th { background: #f8fafc; font-weight: 600; font-size: 0.72rem; text-transform: uppercase; color: #64748b; }
.fat-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.fat-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.fat-badge--real { background: #dcfce7; color: #166534; }
.fat-badge--previa { background: #fef3c7; color: #92400e; }
.fat-footnote { margin: 0.75rem 0 0; font-size: 0.72rem; color: #64748b; }
.fat-empty { color: #94a3b8; font-size: 0.9rem; padding: 1rem 0; }
.fat-total-bar {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.fat-total-bar--split span:last-child { font-size: 0.85rem; font-weight: 600; }

.auth-overlay {
  position: fixed; inset: 0; z-index: 9999; padding: 24px 16px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(44, 107, 191, 0.35), transparent 50%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(45, 156, 91, 0.12), transparent 45%),
    linear-gradient(165deg, #0f172a 0%, #1e293b 40%, #0f172a 100%);
}
.auth-overlay-inner {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: 0 auto;
}
.auth-deco-solar {
  flex-shrink: 0;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.45));
}
.auth-deco-solar img {
  width: 96px;
  height: 96px;
  display: block;
  object-fit: contain;
}
.auth-card {
  width: 100%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08);
  overflow: hidden;
}
.auth-hero {
  padding: 28px 24px 22px;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 55%);
  border-bottom: 1px solid #e8eef4;
}
.auth-brand-logo-wrap {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 12px;
}
.auth-brand-logo-wrap img {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(30, 77, 143, 0.12);
}
.auth-brand-name {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #1a1a2e;
  line-height: 1.15;
}
.auth-brand-tag {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #64748b;
}
.auth-title {
  margin: 18px 0 0;
  font-size: 17px;
  font-weight: 700;
  color: #1e4d8f;
  letter-spacing: -0.2px;
}
.auth-lead {
  margin: 8px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}
.auth-body { padding: 22px 24px 26px; }
.auth-body label {
  display: block;
  font-size: 11px;
  color: #475569;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .55px;
}
.auth-body input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 17px;
  letter-spacing: .02em;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.auth-body input:focus {
  outline: none;
}
.auth-body input.auth-phone-empty {
  border-color: #e11d48;
  background: #fff5f5;
  color: #1e293b;
}
.auth-body input.auth-phone-empty:focus {
  border-color: #e11d48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.18);
}
.auth-body input.auth-phone-ok {
  border-color: #34d399;
  background: #ecfdf5;
  color: #064e3b;
}
.auth-body input.auth-phone-ok:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}
.auth-body button {
  margin-top: 16px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #34c776 0%, #2d9c5b 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(45, 156, 91, .35);
  transition: transform .12s, box-shadow .15s;
}
.auth-body button:hover {
  background: linear-gradient(180deg, #2fbd6d 0%, #248d52 100%);
  box-shadow: 0 6px 18px rgba(45, 156, 91, .4);
}
.auth-body button:active { transform: scale(0.98); }
.auth-help {
  font-size: 12px;
  color: #64748b;
  margin-top: 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #eef2f6;
  line-height: 1.45;
}
.auth-error { margin-top: 12px; color: #b91c1c; font-size: 13px; font-weight: 700; min-height: 20px; }

/* KPIs — painel tech / glass / energia */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  align-items: stretch;
}
.kpis--tech .kpi {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 18px 18px 18px 22px;
  background:
    linear-gradient(145deg, var(--kpi-tech-bg0) 0%, var(--kpi-tech-bg1) 100%),
    linear-gradient(rgba(30, 77, 143, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 77, 143, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
  border: 1px solid var(--kpi-tech-edge);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 14px 44px rgba(30, 77, 143, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease, border-color 0.2s ease;
}
.kpis--tech .kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 16px 0 0 16px;
  background: var(--kpi-accent-bar, linear-gradient(180deg, #06b6d4, #6366f1));
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.22);
}
.kpis--tech .kpi:nth-child(1) { --kpi-accent-bar: linear-gradient(180deg, #22d3ee, #0891b2); }
.kpis--tech .kpi:nth-child(1)::before { box-shadow: 0 0 16px rgba(34, 211, 238, 0.35); }
.kpis--tech .kpi:nth-child(2) { --kpi-accent-bar: linear-gradient(180deg, #60a5fa, #1d4ed8); }
.kpis--tech .kpi:nth-child(2)::before { box-shadow: 0 0 16px rgba(59, 130, 246, 0.32); }
.kpis--tech .kpi:nth-child(3) { --kpi-accent-bar: linear-gradient(180deg, #818cf8, #4f46e5); }
.kpis--tech .kpi:nth-child(3)::before { box-shadow: 0 0 16px rgba(99, 102, 241, 0.32); }
.kpis--tech .kpi:nth-child(4) { --kpi-accent-bar: linear-gradient(180deg, #a78bfa, #7c3aed); }
.kpis--tech .kpi:nth-child(4)::before { box-shadow: 0 0 16px rgba(139, 92, 246, 0.3); }
.kpis--tech .kpi:nth-child(5) { --kpi-accent-bar: linear-gradient(180deg, #34d399, #059669); }
.kpis--tech .kpi:nth-child(5)::before { box-shadow: 0 0 16px rgba(16, 185, 129, 0.32); }
/* Faixa de ocupação no KPI «% alocado usina» (3º card): ≥100% verde · <60% vermelho · 60–99% amarelo · >100% laranja */
.kpis--tech .kpi.kpi-uso-band--full::before {
  background: linear-gradient(180deg, #4ade80, #16a34a) !important;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.5) !important;
}
.kpis--tech .kpi.kpi-uso-band--low::before {
  background: linear-gradient(180deg, #f87171, #dc2626) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.45) !important;
}
.kpis--tech .kpi.kpi-uso-band--mid::before {
  background: linear-gradient(180deg, #facc15, #d97706) !important;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.5) !important;
}
.kpis--tech .kpi.kpi-uso-band--excess::before {
  background: linear-gradient(180deg, #fb923c, #ea580c) !important;
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.45) !important;
}
.kpis--tech .kpi::after {
  content: "";
  position: absolute;
  right: -30%;
  top: -50%;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 68%);
  pointer-events: none;
}
.kpis--tech .kpi:hover {
  transform: translateY(-4px);
  border-color: rgba(30, 77, 143, 0.16);
  box-shadow:
    0 8px 16px rgba(15, 23, 42, 0.07),
    0 24px 56px rgba(30, 77, 143, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.kpis--tech .kpi .label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1.15px;
  font-weight: 800;
  margin: 0;
  line-height: 1.35;
}
.kpis--tech .kpi .value {
  font-size: 27px;
  font-weight: 800;
  margin-top: 10px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  color: #0f172a;
  background: linear-gradient(135deg, #0f172a 0%, #334155 55%, #475569 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpis--tech .kpi .sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 8px;
  line-height: 1.45;
  letter-spacing: 0.02em;
}
/* Cartões destaque: métricas energia (proj) */
.kpis--tech .kpi.proj {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 38%, #1e40af 100%);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 4px 16px rgba(37, 99, 235, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}
.kpis--tech .kpi.proj::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(147, 197, 253, 0.35));
  box-shadow: 0 0 20px rgba(147, 197, 253, 0.45);
}
.kpis--tech .kpi.proj::after {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18) 0%, transparent 55%);
  right: -10%;
  top: -20%;
}
.kpis--tech .kpi.proj .label,
.kpis--tech .kpi.proj .sub {
  color: rgba(226, 232, 240, 0.92);
  -webkit-text-fill-color: inherit;
}
.kpis--tech .kpi.proj .value {
  background: none;
  -webkit-text-fill-color: #fff;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.18);
}
.kpis--tech .kpi.proj.over .value {
  color: #fecaca;
  -webkit-text-fill-color: #fecaca;
  text-shadow: 0 0 20px rgba(254, 202, 202, 0.35);
}
.kpis--tech .kpi.proj .money-line {
  font-size: 18px;
  font-weight: 700;
  margin-top: 6px;
}
/* Cartão faturamento */
.kpis--tech .kpi.money {
  background: linear-gradient(135deg, #059669 0%, #047857 42%, #065f46 100%);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 4px 20px rgba(5, 150, 105, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}
.kpis--tech .kpi.money::before {
  background: linear-gradient(180deg, rgba(167, 243, 208, 0.85), rgba(52, 211, 153, 0.45));
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.45);
}
.kpis--tech .kpi.money::after {
  background: radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
}
.kpis--tech .kpi.money .label,
.kpis--tech .kpi.money .sub {
  color: rgba(209, 250, 229, 0.95);
  -webkit-text-fill-color: inherit;
}
.kpis--tech .kpi.money .value {
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: none;
  -webkit-text-fill-color: #fff;
  color: #fff;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.2);
}
.faixas-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }

.origem-chart-panel {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
.origem-chart-head { margin-bottom: 10px; }
.origem-chart-title { display: block; font-weight: 800; font-size: 14px; color: #0f172a; }
.origem-chart-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.35;
}
.origem-chart-body { display: flex; flex-direction: column; gap: 8px; }
.origem-chart-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 2.5fr) minmax(210px, auto);
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
@media (max-width: 720px) {
  .origem-chart-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .origem-chart-val { justify-self: start; }
}
.origem-chart-label {
  font-weight: 600;
  color: #334155;
  line-height: 1.25;
}
.origem-chart-track {
  height: 14px;
  border-radius: 6px;
  background: #e2e8f0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}
.origem-chart-fill { height: 100%; border-radius: 5px; min-width: 2px; transition: width 0.2s ease; }
.origem-chart-fill--mai26 { background: linear-gradient(90deg, #bbf7d0, #22c55e); }
.origem-chart-fill--cadastro { background: linear-gradient(90deg, #bae6fd, #0ea5e9); }
.origem-chart-fill--abri26 { background: linear-gradient(90deg, #fde68a, #f59e0b); }
.origem-chart-fill--ajuste_mai26 { background: linear-gradient(90deg, #d8b4fe, #8b5cf6); }
.origem-chart-fill--dt_outro { background: linear-gradient(90deg, #fcd34d, #d97706); }
.origem-chart-fill--antigos { background: linear-gradient(90deg, #e5e7eb, #9ca3af); }
.origem-chart-fill--usina_geradora { background: linear-gradient(90deg, #e9d5ff, #7c3aed); }
.origem-chart-val { font-variant-numeric: tabular-nums; color: #0f172a; white-space: nowrap; text-align: right; }
.faixa-card { background: #fff; padding: 14px 18px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
              border-left: 4px solid; }
.faixa-card.a { border-color: #2d9c5b; }
.faixa-card.b { border-color: #4a86e8; }
.faixa-card.c { border-color: #c0392b; background: #fff5f4; }
.faixa-card.alocacao { border-color: #f5b631; background: #fff8e1; }
.faixa-card .titulo { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.faixa-card .num { font-size: 22px; font-weight: 700; }
.faixa-card .num .small { font-size: 13px; color: #62707d; font-weight: 500; }
.faixa-card .desc { font-size: 12px; color: #62707d; margin-top: 4px; }

.controls { background: #fff; padding: 14px 18px; border-radius: 10px; margin-bottom: 14px;
            box-shadow: 0 1px 3px rgba(0,0,0,.05); display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.controls label { font-size: 13px; }
.controls input[type=range] { vertical-align: middle; width: 160px; }
.controls button { padding: 7px 14px; border: 1px solid #d0d7de; background: #fff; border-radius: 6px;
                   cursor: pointer; font-size: 13px; font-weight: 500; }
.controls button:hover { background: #f3f5f8; }
.controls button.apply-all-active { background: #2d9c5b; color: #fff; border-color: #2d9c5b; }
.controls button.apply-all-active:hover { background: #248d52; }
.controls button.clear-btn { background: #fff5f4; color: #c0392b; border-color: #e8b9b3; }
.controls button.clear-btn:hover { background: #fde8e6; border-color: #d89087; }
.controls button.btn-csv-export { border-color: #0ea5e9; color: #0369a1; background: #f0f9ff; }
.controls button.btn-csv-export:hover { background: #e0f2fe; border-color: #0284c7; }
.controls button.btn-pdf-export { border-color: #dc2626; color: #991b1b; background: #fef2f2; }
.controls button.btn-pdf-export:hover { background: #fee2e2; border-color: #b91c1c; }
.controls button.btn-xlsx-export { border-color: #16a34a; color: #166534; background: #f0fdf4; }
.controls button.btn-xlsx-export:hover { background: #dcfce7; border-color: #15803d; }
/* GD II: CSV + barra excedente — mesma altura e alinhamento */
.controls.c2-controls .c2-toolbar-row-equal {
  flex-basis: 100%;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px 12px;
}
.controls.c2-controls .c2-toolbar-row-equal > .btn-csv-export,
.controls.c2-controls .c2-toolbar-row-equal > .btn-pdf-export,
.controls.c2-controls .c2-toolbar-row-equal > .btn-xlsx-export {
  flex: 0 0 auto;
  min-height: 42px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  margin: 0;
}
.controls.c2-controls .c2-toolbar-row-equal .c2-usina-excedente-bar {
  flex: 1 1 240px;
  min-height: 42px;
  box-sizing: border-box;
  margin-top: 0;
  padding: 0 12px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
}
.controls.c2-controls .c2-toolbar-row-equal .c2-usina-excedente-bar__text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}
.controls.c2-controls .c2-toolbar-row-equal .btn-c2-excedente-usina {
  flex: 0 0 auto;
  min-height: 42px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .controls.c2-controls .c2-toolbar-row-equal {
    flex-direction: column;
    align-items: stretch;
  }
  .controls.c2-controls .c2-toolbar-row-equal > .btn-csv-export,
  .controls.c2-controls .c2-toolbar-row-equal > .btn-pdf-export,
  .controls.c2-controls .c2-toolbar-row-equal > .btn-xlsx-export {
    width: 100%;
    justify-content: center;
  }
  .controls.c2-controls .c2-toolbar-row-equal .c2-usina-excedente-bar {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: 10px 12px;
    gap: 10px;
  }
  .controls.c2-controls .c2-toolbar-row-equal .btn-c2-excedente-usina {
    width: 100%;
    min-height: 42px;
  }
}
.kpi-usina-geradora-wrap { margin: 0 0 0.65rem; }
.kpi-usina-geradora-card {
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  padding: 0.65rem 0.9rem 0.75rem;
  background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
  box-shadow: 0 1px 2px rgba(91, 33, 182, 0.06);
}
.kpi-usina-geradora-head {
  font-weight: 700;
  font-size: 0.95rem;
  color: #4c1d95;
  letter-spacing: 0.01em;
}
.kpi-usina-geradora-sub {
  font-size: 0.78rem;
  color: #6b21a8;
  margin-top: 0.2rem;
  margin-bottom: 0.55rem;
}
.kpi-usina-geradora-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
}
@media (max-width: 820px) {
  .kpi-usina-geradora-metrics { grid-template-columns: 1fr; }
}
.kpi-usina-geradora-metric .lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7e22ce;
  opacity: 0.95;
}
.kpi-usina-geradora-metric .val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #3b0764;
  margin-top: 0.12rem;
  font-variant-numeric: tabular-nums;
}
.kpi-usina-geradora-metric .hint {
  font-size: 0.7rem;
  color: #6b21a8;
  margin-top: 0.15rem;
  opacity: 0.9;
}
.c2-usina-excedente-bar {
  border-radius: 8px;
  border: 1px solid #c4b5fd;
  background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
  font-size: 0.85rem;
  color: #5b21b6;
}
.c2-usina-excedente-bar__text { line-height: 1.35; }
.controls button.btn-c2-excedente-usina {
  border-color: #7c3aed;
  color: #4c1d95;
  background: #ede9fe;
  font-weight: 600;
}
.controls button.btn-c2-excedente-usina:hover { background: #ddd6fe; border-color: #6d28d9; }
.fa-pill.origem-usina-geradora { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.aloc-usina-geradora { color: #5b21b6; font-weight: 600; }
table#tabC2Tabela tbody tr.row-usina-geradora td { background: #faf5ff; }
table#tabC2Tabela tbody tr.row-usina-geradora:hover td { background: #f3e8ff; }
.controls .sim-btn.active-plus { background: #2d9c5b; color: #fff; border-color: #2d9c5b; }
.controls .sim-btn.active-minus { background: #c0392b; color: #fff; border-color: #c0392b; }
.controls .danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.controls .danger:hover { background: #a93226; }
.controls .select-all-active { background: #c0392b; color: #fff; border-color: #c0392b; }
.controls .filtro-origem-wrap {
  flex-basis: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}
.controls .filtro-origem-wrap label {
  font-weight: 700;
  color: #374151;
  margin: 0;
}
.controls .filtro-origem-select {
  min-width: min(420px, 100%);
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: #1c2733;
}
.controls .filtro-origem-select:focus {
  outline: none;
  border-color: var(--app-green);
  box-shadow: 0 0 0 2px rgba(0, 177, 82, 0.2);
}

.table-grid-section {
  margin-bottom: 14px;
  max-width: 100%;
  min-width: 0;
}
.table-grid-scroll {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
/* Colunas congeladas ao rolar na horizontal (até «Cliente») */
table#tab thead tr:last-child th.table-col-freeze,
table#tabC2Tabela thead tr:last-child th.table-col-freeze {
  background: #f8fafc;
}
table#tab tbody td.table-col-freeze,
table#tabC2Tabela tbody td.table-col-freeze {
  background: #fff;
}
table#tab tbody tr:hover td.table-col-freeze,
table#tabC2Tabela tbody tr:hover td.table-col-freeze {
  background: #fafbfc;
}
table#tab tbody tr.row-mal td.table-col-freeze,
table#tabC2Tabela tbody tr.row-mal td.table-col-freeze {
  background: #fff5f4;
}
table#tab tbody tr.row-mal:hover td.table-col-freeze,
table#tabC2Tabela tbody tr.row-mal:hover td.table-col-freeze {
  background: #ffeae6;
}
table#tab tbody tr.row-incluido-gd2 td.table-col-freeze {
  background: #ecfccb !important;
}
table#tab tbody tr.row-incluido-gd2:hover td.table-col-freeze {
  background: #d9f99d !important;
}
table#tabC2Tabela tbody tr.row-incluido-gd1 td.table-col-freeze {
  background: #fef9c3 !important;
}
table#tabC2Tabela tbody tr.row-incluido-gd1:hover td.table-col-freeze {
  background: #fef08a !important;
}
table#tab tbody td.table-col-freeze.cell-dado-ausente,
table#tabC2Tabela tbody td.table-col-freeze.cell-dado-ausente {
  background: #fef08a !important;
}
table#tab .table-col-freeze-last,
table#tabC2Tabela .table-col-freeze-last {
  box-shadow: 6px 0 12px -8px rgba(15, 23, 42, 0.22);
}

.freeze-cols-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 10px 0;
  padding: 8px 10px;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
}
.freeze-cols-toolbar .freeze-cols-label {
  font-weight: 600;
  white-space: nowrap;
}
.freeze-cols-toolbar input[type="range"] {
  flex: 1;
  min-width: 100px;
  max-width: 200px;
  height: 6px;
  accent-color: var(--app-green, #00b152);
  cursor: pointer;
}
.freeze-cols-toolbar select {
  min-width: 180px;
  max-width: min(100%, 340px);
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
  color: #1e293b;
}
.freeze-cols-toolbar .freeze-cols-hint {
  flex: 1 1 100%;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}
.grid-page-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.grid-page-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.grid-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #1e4d8f;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.grid-page-btn:hover:not(:disabled) {
  background: #eef4ff;
  border-color: #1e4d8f;
}
.grid-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #94a3b8;
}
.grid-page-btn .material-icons { font-size: 22px; }
.grid-page-label {
  min-width: 4.5rem;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.grid-page-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #475569;
}
.grid-page-meta label {
  font-weight: 600;
  white-space: nowrap;
}
.grid-page-meta select {
  min-width: 92px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
  color: #1e293b;
}
.grid-page-info {
  color: #64748b;
  white-space: nowrap;
}
.grid-focus-enter-btn,
.grid-focus-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid #1e4d8f;
  border-radius: 6px;
  background: #fff;
  color: #1e4d8f;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.grid-focus-enter-btn:hover,
.grid-focus-exit-btn:hover {
  background: #eef4ff;
}
.grid-focus-enter-btn .material-icons,
.grid-focus-exit-btn .material-icons {
  font-size: 18px;
}
.grid-focus-exit-btn {
  flex-shrink: 0;
  margin-right: 10px;
}
.grid-focus-exit-btn[hidden] {
  display: none !important;
}
body.grid-focus-mode .grid-focus-enter-btn {
  display: none !important;
}
/* —— Modo «só grade» (tela cheia com pesquisa + paginação) —— */
body.grid-focus-mode .app-topbar,
body.grid-focus-mode .app-sidebar,
body.grid-focus-mode #dataSourceBanner {
  display: none !important;
}
body.grid-focus-mode #appRoot.app-shell {
  --app-sidebar-offset: 0px;
}
body.grid-focus-mode .app-layout,
body.grid-focus-mode .app-main {
  height: 100vh;
  min-height: 0;
}
body.grid-focus-mode .app-page-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 14px;
  min-height: 52px;
  box-shadow: 0 1px 0 #e2e8f0;
}
body.grid-focus-mode .app-bc-row,
body.grid-focus-mode .app-page-kpis,
body.grid-focus-mode #appUsinaGdSwitch,
body.grid-focus-mode .app-bc-help,
body.grid-focus-mode #appUsinaHelpPopover {
  display: none !important;
}
body.grid-focus-mode .app-page-search-gd2 {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  flex: 1 1 280px;
  display: flex !important;
  min-width: 0;
}
body.grid-focus-mode .app-page-search-input {
  max-width: none;
}
body.grid-focus-mode .app-scroll {
  margin-top: 52px;
  padding: 0;
  height: calc(100vh - 52px);
  overflow: hidden;
}
body.grid-focus-mode .tab-pane.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body.grid-focus-mode .sticky-dash-wrap,
body.grid-focus-mode .sticky-ctrl-wrap,
body.grid-focus-mode .sticky-dash-spacer,
body.grid-focus-mode .freeze-cols-toolbar,
body.grid-focus-mode .table-grid-pinrow {
  display: none !important;
}
body.grid-focus-mode .table-grid-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 8px 12px 12px;
  box-shadow: none;
  background: transparent;
}
body.grid-focus-mode .grid-page-bar {
  flex-shrink: 0;
}
body.grid-focus-mode .table-grid-scroll,
body.grid-focus-mode .c2-wrap.c2-wrap--tabela {
  flex: 1;
  overflow: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  background: #fff;
}
body.grid-focus-mode .tab-head-fixed {
  z-index: 10001;
}
/* legado — removido do pinrow */
.grid-page-toolbar {
  display: none;
}
@media (min-width: 900px) {
  .freeze-cols-toolbar .freeze-cols-hint {
    flex: 1 1 200px;
  }
}
.table-grid-pinrow { margin-bottom: 8px; }
table#tab {
  width: 100%;
  min-width: 1000px;
  position: relative;
  background: #fff;
  border-radius: 10px;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
table#tab .c1-cell-doc { font-size: 11px; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
table#tab .c1-cell-inst { font-size: 11px; white-space: nowrap; max-width: 118px; overflow: hidden; text-overflow: ellipsis; }
table#tab .c1-cell-uc { font-size: 11px; white-space: nowrap; max-width: 132px; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
table#tab .c1-cell-email { font-size: 11px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
table#tab .c1-cell-tel { font-size: 11px; min-width: 0; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
/* Coluna «Cliente / Nome» — alargar (GD I = 3ª coluna, após Aplicar; GD II = 5ª coluna). */
table#tab thead tr:last-child th:nth-child(3),
table#tab tbody td:nth-child(3),
#tabHeadFixed .tab-head-fixed-table thead tr:last-child th:nth-child(3) {
  min-width: 160px;
  max-width: min(380px, 36vw);
  width: 18%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table#tabC2Tabela thead tr:last-child th:nth-child(5),
table#tabC2Tabela tbody td:nth-child(5),
#tabHeadFixedC2 .tab-head-fixed-table thead tr:last-child th:nth-child(5) {
  min-width: 160px;
  max-width: min(380px, 36vw);
  width: 18%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table#tabC2Tabela {
  width: 100%;
  min-width: 940px;
  position: relative;
  background: #fff;
  border-radius: 10px;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
table#tabC2Tabela .c2-cell-doc { font-size: 11px; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
table#tabC2Tabela .c2-cell-inst { font-size: 11px; white-space: nowrap; max-width: 118px; overflow: hidden; text-overflow: ellipsis; }
table#tabC2Tabela .c2-cell-uc { font-size: 11px; white-space: nowrap; max-width: 132px; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
table#tabC2Tabela .c2-cell-email,
table#tabC2Tabela .c2-cell-tel { font-size: 11px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

/* Coluna «Alocação» — mais larga (texto de estado + botões) — GD I e GD II + cabeçalho fixo */
table#tab thead tr:last-child th:nth-child(8),
table#tab tbody td:nth-child(8),
#tabHeadFixed .tab-head-fixed-table thead tr:last-child th:nth-child(8) {
  min-width: 200px;
  max-width: min(400px, 42vw);
  width: 16%;
  white-space: normal;
  vertical-align: middle;
  line-height: 1.35;
}
table#tabC2Tabela thead tr:last-child th:nth-child(7),
table#tabC2Tabela tbody td:nth-child(7),
#tabHeadFixedC2 .tab-head-fixed-table thead tr:last-child th:nth-child(7) {
  min-width: 200px;
  max-width: min(400px, 42vw);
  width: 16%;
  white-space: normal;
  vertical-align: middle;
  line-height: 1.35;
}
/* R$ (Plano), Real Média 6M, Telefone — GD I (mais leitura) */
table#tab thead tr:last-child th:nth-child(10),
table#tab tbody td:nth-child(10),
#tabHeadFixed .tab-head-fixed-table thead tr:last-child th:nth-child(10) {
  min-width: 100px;
  width: 7.5%;
  white-space: nowrap;
}
table#tab thead tr:last-child th:nth-child(12),
table#tab tbody td:nth-child(12),
#tabHeadFixed .tab-head-fixed-table thead tr:last-child th:nth-child(12) {
  min-width: 108px;
  width: 8%;
  white-space: nowrap;
}
table#tab thead tr:last-child th:nth-child(18),
table#tab tbody td:nth-child(18),
#tabHeadFixed .tab-head-fixed-table thead tr:last-child th:nth-child(18) {
  min-width: 104px;
  width: 8%;
}
/* Cabeçalho “fixo” = clone em position:fixed (sticky em <th> falha em vários browsers) */
.tab-head-fixed {
  display: none;
  position: fixed;
  left: 0;
  z-index: 820;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15,23,42,.14);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  box-sizing: border-box;
}
.tab-head-fixed-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: #fff;
}
.tab-head-fixed-table th {
  padding: 10px 12px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #62707d;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #eef1f4;
  background: #f8fafc;
  box-sizing: border-box;
}
.tab-head-fixed-table th.left { text-align: left; }
.tab-head-fixed-table th.th-atual { background: #edf7ee; }
.tab-head-fixed-table th.th-sugerido { background: #eef4ff; }
.tab-head-fixed-table th:hover { filter: brightness(0.97); }
th, td { padding: 10px 12px; text-align: right; font-size: 13px; border-bottom: 1px solid #eef1f4; }
th { background: #f8fafc; text-transform: uppercase; font-size: 11px; color: #62707d;
     letter-spacing: .3px; cursor: pointer; user-select: none; font-weight: 600; }
th.left, td.left { text-align: left; }
th:hover { background: #eef1f4; }
.th-atual { background: #edf7ee; }
.td-atual { background: #f4fbf5; }
/* kWh (Plano), R$ (Plano) ou R$/kWh vazio/zero — GD I e GD II */
td.cell-dado-ausente {
  background: #fef08a !important;
  color: #0a0a0a !important;
}
td.cell-dado-ausente.money-cell,
td.cell-dado-ausente.preco-cell {
  color: #0a0a0a !important;
}
/* Instalação ausente — alerta piscante (GD I e GD II) */
@keyframes inst-ausente-blink {
  0%, 100% { background-color: #fecaca; color: #991b1b; box-shadow: inset 0 0 0 1px #ef4444; }
  50% { background-color: #fee2e2; color: #b91c1c; box-shadow: inset 0 0 0 2px #f87171; }
}
@keyframes inst-ausente-bar-blink {
  0%, 100% { background-color: #fef2f2; border-color: #ef4444; color: #991b1b; }
  50% { background-color: #fee2e2; border-color: #dc2626; color: #7f1d1d; }
}
td.c1-cell-inst.cell-inst-ausente,
td.c2-cell-inst.cell-inst-ausente {
  animation: inst-ausente-blink 1.1s ease-in-out infinite;
  font-weight: 700;
}
.inst-ausente-alert-bar {
  flex: 1 1 100%;
  width: 100%;
  margin: 0 0 10px;
  padding: 10px 14px;
  border: 2px solid #ef4444;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  animation: inst-ausente-bar-blink 1.1s ease-in-out infinite;
}
.th-sugerido { background: #eef4ff; }
.td-sugerido { background: #f5f9ff; }

.fa-pill { display: inline-block; padding: 2px 8px; border-radius: 4px; font-weight: 700; font-size: 11px; }
.fa-pill.A { background: #d4f0de; color: #1e6d3f; }
.fa-pill.B { background: #dbe8fb; color: #2a4f99; }
.fa-pill.C { background: #fadbd6; color: #8b271b; }
.fa-pill.sem-plano { background: #fdeaea; color: #922b21; border: 1px dashed #e59890; }
.fa-pill.tipo-plano-pill { font-weight: 600; letter-spacing: 0.02em; }
.fa-pill.tipo-plano-ouro { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.fa-pill.tipo-plano-prata { background: #e5e7eb; color: #374151; border: 1px solid #9ca3af; }
.fa-pill.tipo-plano-consumo { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.fa-pill.tipo-plano-none { background: #f3f4f6; color: #9ca3af; border: 1px solid #e5e7eb; font-weight: 500; }
.fa-pill.tipo-plano-outro { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.fa-pill.origem-antigos { background: #d1d5db; color: #374151; border: 1px solid #9ca3af; }
.fa-pill.origem-novos-mai26 {
  background: linear-gradient(180deg, #dcfce7, #bbf7d0);
  color: #14532d;
  border: 1px solid var(--app-green);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 220px;
  white-space: normal;
  text-align: center;
}
.fa-pill.origem-cadastro-lote {
  background: linear-gradient(180deg, #e0f2fe, #bae6fd);
  color: #0c4a6e;
  border: 1px solid #38bdf8;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 220px;
  white-space: normal;
  text-align: center;
}
.fa-pill.origem-novos-abri26 {
  background: linear-gradient(180deg, #fef3c7, #fde68a);
  color: #78350f;
  border: 1px solid #f59e0b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 240px;
  white-space: normal;
  text-align: center;
}
.fa-pill.origem-ajuste-mai26 {
  background: linear-gradient(180deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
  border: 1px solid #8b5cf6;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 240px;
  white-space: normal;
  text-align: center;
}
.fa-pill.origem-migr-gd1-antigos {
  background: linear-gradient(180deg, #e5e7eb, #d1d5db);
  color: #1f2937;
  border: 1px solid #9ca3af;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 280px;
  white-space: normal;
  text-align: center;
}
.fa-pill.origem-migr-gd1-abri26 {
  background: linear-gradient(180deg, #fef9c3, #fde047);
  color: #713f12;
  border: 1px solid #eab308;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 280px;
  white-space: normal;
  text-align: center;
}
.fa-pill.origem-migr-gd1-ajuste {
  background: linear-gradient(180deg, #ede9fe, #c4b5fd);
  color: #4c1d95;
  border: 1px solid #7c3aed;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 300px;
  white-space: normal;
  text-align: center;
}
.aloc-ok { color: #2d9c5b; font-weight: 600; font-size: 12px; }
.aloc-sem-plano { color: #922b21; font-weight: 600; font-size: 12px; }
.td-sem-plano { color: #c0392b !important; font-weight: 600; background: #fff5f4 !important; }
.aloc-mover { color: #c0392b; font-weight: 700; font-size: 12px; }
.btn-enviar { margin-left: 8px; padding: 3px 8px; border-radius: 5px; border: 1px solid #c0392b; background: #fff; color: #c0392b; font-size: 11px; font-weight: 700; cursor: pointer; }
.btn-enviar:hover { background: #fff5f4; }
.btn-enviar.enviado { border-color: #2d9c5b; color: #2d9c5b; }
.cross-usina-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  width: 100%;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}
.cross-usina-bar__label {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}
.cross-usina-bar__hint {
  font-size: 11px;
  color: #64748b;
  flex: 1 1 180px;
}
.cross-usina-bar__select {
  min-width: 240px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  background: #fff;
}
.cross-usina-bar__btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid #0f766e;
  background: #0d9488;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.cross-usina-bar__btn:hover:not(:disabled) {
  background: #0f766e;
}
.cross-usina-bar__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.row-enviado { opacity: .72; }
tr.row-incluido-gd1 td {
  background: #fef9c3 !important;
}
tr.row-incluido-gd1:hover td {
  background: #fef08a !important;
}
.aloc-incluido-gd1 {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #854d0e;
  background: #fef08a;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #eab308;
}
tr.row-incluido-gd2 td {
  background: #ecfccb !important;
}
tr.row-incluido-gd2:hover td {
  background: #d9f99d !important;
}
.aloc-incluido-gd2 {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #3f6212;
  background: #d9f99d;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #84cc16;
}
.aloc-sinergia {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #991b1b;
  background: #fee2e2;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #f87171;
  line-height: 1.35;
  max-width: 220px;
}
.aloc-plano-ajustado {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #60a5fa;
}
.aloc-ajuste-realizado {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #9a3412;
  background: #ffedd5;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #fb923c;
  line-height: 1.35;
  max-width: 220px;
}
.aloc-reajuste-redist {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #4ade80;
  line-height: 1.35;
  max-width: 220px;
}

.cross-usina-banner-wrap { margin: 0 0 14px; }
.cross-usina-banner-wrap[hidden] { display: none !important; }
.cross-usina-banner {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1e293b;
}
.cross-usina-banner--incoming-gd1 {
  border-color: #34d399;
  background: #ecfdf5;
}
.cross-usina-banner__title { font-weight: 600; margin-bottom: 4px; }
.cross-usina-banner__meta { margin: 0 0 8px; font-size: 12px; color: #64748b; }
.cross-usina-banner__list { margin: 0; padding-left: 20px; }
.cross-usina-banner__list li { margin: 4px 0; }
.cross-usina-banner .muted { color: #64748b; font-size: 12px; font-weight: 400; }
.cross-usina-banner__nome { font-weight: 600; }

.inbound-dock-wrap { margin: 0 0 14px; }
.inbound-dock-wrap[hidden] { display: none !important; }
.inbound-dock {
  border-radius: 10px;
  border: 1px solid #0ea5e9;
  background: linear-gradient(180deg, #f0f9ff 0%, #fff 48%);
  padding: 12px 14px 14px;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.12);
}
.inbound-dock--gd1 {
  border-color: #10b981;
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 48%);
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.1);
}
.inbound-dock__head {
  font-size: 14px;
  font-weight: 700;
  color: #0c4a6e;
  margin-bottom: 10px;
  line-height: 1.35;
}
.inbound-dock--gd1 .inbound-dock__head { color: #065f46; }
.inbound-dock__sub { font-size: 12px; font-weight: 400; color: #64748b; margin-top: 4px; }
.inbound-dock__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.inbound-dock__table th {
  text-align: left;
  padding: 6px 8px;
  background: rgba(255,255,255,.85);
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 600;
}
.inbound-dock__table td {
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.inbound-dock__table tr:last-child td { border-bottom: none; }
.inbound-dock__table .muted { color: #94a3b8; font-size: 11px; }

tr.c2-section-label td {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 12px;
  border-bottom: 2px solid #bae6fd;
}
tr.c2-section-label--info td {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  border-bottom-color: #e2e8f0;
}
tr.row-mal { background: #fff5f4; }
tr.row-mal:hover { background: #ffeae6; }
tr.row-status-edp td { background: #fee2e2 !important; color: #7f1d1d; }
tr.row-status-edp:hover td { background: #fecaca !important; }
table#tab tbody tr.row-status-edp td.table-col-freeze {
  background: #fee2e2 !important;
}
table#tab tbody tr.row-status-edp:hover td.table-col-freeze {
  background: #fecaca !important;
}
.c1-status-edp-cell { font-size: 12px; font-weight: 600; color: #991b1b; max-width: 220px; line-height: 1.35; }
.controls label.filtro-status-edp-label {
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}
.controls .filtro-cadastro-grupo {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.controls button.btn-filtro-cadastro {
  border: 1px solid #f59e0b;
  color: #92400e;
  background: #fffbeb;
  font-weight: 700;
}
.controls button.btn-filtro-cadastro:hover {
  background: #fef3c7;
  border-color: #d97706;
}
.controls button.btn-filtro-cadastro.is-active,
.controls button.btn-filtro-cadastro[aria-pressed="true"] {
  background: #f59e0b;
  border-color: #b45309;
  color: #fff;
}
.controls button.btn-filtro-sisgd.is-active,
.controls button.btn-filtro-sisgd[aria-pressed="true"] {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
}
.sisgd-cell-wrap {
  font-size: 12px;
  line-height: 1.35;
  max-width: 180px;
}
.sisgd-cell--ausente {
  color: #b91c1c;
  font-weight: 600;
}
.sisgd-cell--loading {
  color: #6b7280;
}
.sisgd-usina--hist,
.sisgd-id--hist {
  color: #92400e;
  font-weight: 600;
}
.sisgd-ref-cell--sug {
  font-weight: 700;
  white-space: nowrap;
}
.sisgd-ref-cell--up {
  background: #eff6ff;
  color: #1d4ed8;
}
.sisgd-ref-cell--down {
  background: #fef2f2;
  color: #b91c1c;
}
.sisgd-ref-cell--same {
  background: #f0fdf4;
  color: #166534;
}
.sisgd-ref-cell--warn {
  background: #fffbeb;
  color: #92400e;
}
.sisgd-sug-delta {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.9;
}
.sisgd-acao {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}
.sisgd-acao--aumentar {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}
.sisgd-acao--reduzir {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.sisgd-acao--manter {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.sisgd-acao--sem-fatura,
.sisgd-acao--verificar,
.sisgd-acao--outro {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
body.dash-enxuta .filtro-cadastro-grupo { display: none; }
tr:hover { background: #fafbfc; }
.delta-pos { color: #2d9c5b; font-weight: 700; font-size: 14px; }
.money-cell { font-weight: 600; }
.preco-cell { color: #62707d; font-size: 12px; }

input[type=checkbox] { transform: scale(1.2); cursor: pointer; }
.c2-wrap { background: #fff; padding: 16px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 14px; }
.c2-grid { display: block; min-width: 0; max-width: 100%; }
.c2-wrap--tabela {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.c2-wrap--tabela table { min-width: 0; }
.c2-head-sum th { background: #eef6ff; font-size: 11px; font-weight: 700; color: #1e4d8f;
  border-bottom: 1px solid #dbeafe; vertical-align: middle; }
.c2-head-sum-label { color: #62707d; font-weight: 600; text-transform: none; letter-spacing: 0; cursor: default; }
.c2-head-sum .c2-sum-pct-cell { font-size: 13px; color: #1e4d8f; }
.c2-pct-cell { text-align: right; vertical-align: middle; background: #f4fbf5; }
.c2-pct-cap-val { font-size: 13px; font-weight: 600; color: #1e4d8f; font-variant-numeric: tabular-nums; display: inline-block; text-align: right; min-width: 4.5rem; }
.c2-controls { margin-bottom: 14px; }
.c2-donut-card { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.c2-note { font-size: 12px; color: #62707d; margin-top: 8px; }
.donut { width: 220px; height: 220px; border-radius: 50%; margin: 0 auto; position: relative; }
.donut::after { content: ""; position: absolute; inset: 28%; background: #fff; border-radius: 50%; }
.legend { margin-top: 12px; display: grid; gap: 6px; }
.legend .item { font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.sticky-dash-wrap { position: relative; }
.sticky-dash-inner { position: relative; }
.sticky-dash-pinrow { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.sticky-dash-inner.content-collapsed .sticky-dash-pinrow { margin-bottom: 0; }
.sticky-dash-inner.content-collapsed .kpis,
.sticky-dash-inner.content-collapsed .kpi-ajuste-panel,
.sticky-dash-inner.content-collapsed .kpi-cap-gap,
.sticky-dash-inner.content-collapsed .faixas-row,
.sticky-dash-inner.content-collapsed .origem-chart-panel { display: none !important; }

.kpi-cap-gap {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* ≥100% ocupação — verde */
.kpi-cap-gap--full {
  border-color: #22c55e;
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.85) 0%, rgba(255, 255, 255, 0.95) 100%);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15);
}
.kpi-cap-gap--full .kpi-cap-gap__title { color: #15803d; }
.kpi-cap-gap--full .kpi-cap-gap__metrics { color: #166534; }
.kpi-cap-gap--full .kpi-cap-gap__sub { color: #3f6212; }
.kpi-cap-gap--full .kpi-cap-gap__inner--full { color: #14532d; }
/* <60% — vermelho (muita capacidade ociosa) */
.kpi-cap-gap--low {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.88) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.12);
}
.kpi-cap-gap--low .kpi-cap-gap__title { color: #b91c1c; }
.kpi-cap-gap--low .kpi-cap-gap__metrics { color: #991b1b; }
.kpi-cap-gap--low .kpi-cap-gap__sub { color: #7f1d1d; }
/* 60%–99% — amarelo / âmbar */
.kpi-cap-gap--mid {
  border-color: #eab308;
  background: linear-gradient(135deg, rgba(254, 249, 195, 0.9) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: 0 4px 20px rgba(234, 179, 8, 0.14);
}
.kpi-cap-gap--mid .kpi-cap-gap__title { color: #a16207; }
.kpi-cap-gap--mid .kpi-cap-gap__metrics { color: #854d0e; }
.kpi-cap-gap--mid .kpi-cap-gap__sub { color: #713f12; }
/* >100% — alerta (excesso) */
.kpi-cap-gap--excess {
  border-color: #f97316;
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.92) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.14);
}
.kpi-cap-gap--excess .kpi-cap-gap__title { color: #c2410c; }
.kpi-cap-gap--excess .kpi-cap-gap__inner--over { color: #9a3412; }

.kpi-cap-gap__title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.kpi-cap-gap__metrics {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.kpi-cap-gap__sep { color: #94a3b8; font-weight: 600; margin: 0 8px; }
.kpi-cap-gap__sub {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.45;
}
.kpi-cap-gap__badge-uso {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.kpi-cap-gap--full .kpi-cap-gap__badge-uso { background: rgba(34, 197, 94, 0.25); color: #14532d; }
.kpi-cap-gap--low .kpi-cap-gap__badge-uso { background: rgba(239, 68, 68, 0.2); color: #7f1d1d; }
.kpi-cap-gap--mid .kpi-cap-gap__badge-uso { background: rgba(234, 179, 8, 0.35); color: #713f12; }
.kpi-cap-gap--excess .kpi-cap-gap__badge-uso { background: rgba(249, 115, 22, 0.25); color: #9a3412; }

.kpi-cap-gap__inner--full {
  font-size: 15px;
  font-weight: 600;
}
.kpi-cap-gap__inner--over {
  font-size: 14px;
  font-weight: 600;
}

.kpi-ajuste-panel {
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(16, 185, 129, 0.06) 50%, rgba(14, 165, 233, 0.06) 100%);
  box-shadow: 0 8px 28px rgba(30, 77, 143, 0.08);
}
.kpi-ajuste-panel[hidden] { display: none !important; }
.kpi-ajuste-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 10px;
}
.kpi-ajuste-metrics {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.kpi-ajuste-sep { color: #94a3b8; font-weight: 600; margin: 0 6px; }
.kpi-ajuste-desc {
  font-size: 13px;
  color: #64748b;
  margin: 10px 0 0;
  line-height: 1.45;
}
.kpi-ajuste-foot {
  font-size: 11px;
  color: #64748b;
  margin: 8px 0 0;
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px dashed rgba(30, 77, 143, 0.15);
}
.td-editable input.inp-c1-kwh,
.td-editable input.inp-c2-kwh-ajuste {
  width: 100%;
  max-width: 112px;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.td-editable input.inp-c1-kwh:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f1f5f9;
}
.td-editable input.inp-c1-kwh--fixo {
  background: #f1f5f9;
  color: #334155;
  cursor: default;
}
.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;
}
.pin-dash-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid #1e4d8f; background: #fff; color: #1e4d8f; font-size: 12px; font-weight: 700; cursor: pointer; }
.pin-dash-btn:hover { background: #eef4ff; }
.pin-dash-btn.expand { background: #1e4d8f; color: #fff; }
.pin-dash-btn.expand:hover { background: #163a6b; }
/* Só o resumo (KPIs + painéis) fica colado no topo; faixas, gráfico e o resto rolam. */
.sticky-dash-wrap.pinned .sticky-dash-summary-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(243, 245, 248, 0.97);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 10px 24px 14px;
  margin-bottom: 6px;
  border-radius: 0 0 10px 10px;
}
.sticky-dash-rest {
  position: relative;
  z-index: 1;
}
.sticky-dash-spacer { width: 100%; flex-shrink: 0; }

.sticky-ctrl-wrap { position: relative; }
.sticky-ctrl-inner { position: relative; }
.sticky-ctrl-wrap.pinned .sticky-ctrl-inner {
  position: fixed;
  top: var(--sticky-dash-offset, 0px);
  left: var(--app-sidebar-offset, 0px);
  right: 0; z-index: 850;
  background: rgba(243,245,248,.97); backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  padding: 8px 24px 12px;
  max-height: 78vh; overflow-y: auto;
}
.sticky-ctrl-wrap.pinned .sticky-ctrl-inner .controls { margin-bottom: 0; }
.controls .sticky-dash-pinrow { flex-basis: 100%; width: 100%; justify-content: flex-end; }
.sticky-dash-wrap.pinned .sticky-dash-inner > .sticky-ctrl-inner { margin-top: 6px; }
.sticky-dash-wrap.pinned .sticky-dash-inner > .sticky-ctrl-inner .controls {
  margin-top: 0; margin-bottom: 0; padding-top: 12px; border-top: 1px solid #e2e8f0;
}
.pin-dash-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pin-dash-btn.grid-pin-on { background: #1e4d8f; color: #fff; border-color: #1e4d8f; }
.pin-dash-btn.grid-pin-on:hover { background: #163a6b; }

.btn-sisgd-aplicar {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 6px;
  border: 1px solid #0d9488;
  background: #ecfdf5;
  color: #0f766e;
  cursor: pointer;
  vertical-align: middle;
  white-space: nowrap;
}
.btn-sisgd-aplicar:hover:not(:disabled) {
  background: #ccfbf1;
  border-color: #0f766e;
}
.btn-sisgd-aplicar.is-done,
.btn-sisgd-aplicar:disabled {
  opacity: 0.75;
  cursor: default;
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #475569;
}
.btn-sisgd-aplicar-todas {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #0d9488;
  background: #0d9488;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.btn-sisgd-aplicar-todas:hover {
  background: #0f766e;
}
.sisgd-ref-cell--sug .btn-sisgd-aplicar {
  margin-top: 2px;
}
@media (max-width: 720px) {
  .btn-sisgd-aplicar-todas {
    margin-left: 0;
    margin-top: 6px;
    width: 100%;
    justify-content: center;
  }
}
