/* ==========================================================================
   THEME · Sol & Sedimento
   Tokens, atmosfera, tipografia e componentes
   Os protótipos em _redesign/onda{1,2,3}.html são a fonte de verdade.
   ========================================================================== */

/* Fontes locais (12/09/2026): static/fonts/fonts.css é gerado por scripts/baixar_fontes.py.
   Nada de Google Fonts em tempo de execução — nem na tela, nem no PDF. */
@import url("fonts/fonts.css");

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- Tokens ---------- */
:root {
  /* fundo / superfícies */
  --bg:        #F4EFE7;
  --bg-tint:   #EEE7DB;
  --surface:   #FBF8F2;
  --surface-2: #F7F2E9;
  --line:      #E3D8C7;
  --line-soft: #EDE4D5;

  /* tinta / texto */
  --ink:       #2A2018;
  --ink-soft:  #6E6155;
  --ink-faint: #A2978A;

  /* acento âmbar (sol/energia) */
  --amber:      #C8651B;
  --amber-soft: #E8843B;
  --amber-deep: #A8500F;
  --amber-wash: #F6E2CF;

  /* acento sálvia */
  --sage:      #6B7A5A;
  --sage-wash: #E4E7DA;
  --sage-deep: #4E5B40;

  /* acento azul-ardósia (só em gráficos, 3ª série) */
  --blue:      #4A6670;
  --blue-wash: #DCE6E8;

  /* sombras */
  --shadow:     18px 18px 40px rgba(120, 95, 60, .10), -6px -6px 24px rgba(255, 255, 255, .6);
  --shadow-sm:  8px 8px 22px rgba(120, 95, 60, .09), -4px -4px 14px rgba(255, 255, 255, .55);
  --shadow-pop: 0 30px 80px rgba(42, 32, 24, .30);

  /* raios */
  --radius-lg: 30px;
  --radius:    22px;
  --radius-sm: 16px;

  /* easing — curva ease-out já usada na app, agora como token reaproveitável */
  --ease-out: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- Body + atmosfera ---------- */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  top: -20vh; right: -10vw;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(232, 132, 59, .16), rgba(232, 132, 59, 0) 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: multiply;
}

/* ---------- Container app ---------- */
.app {
  position: relative;
  z-index: 1;
  padding: 34px 32px 80px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  cursor: pointer;
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--amber-deep), var(--amber) 45%, var(--amber-soft));
  position: relative;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .5), transparent 55%);
}
.brand-mark.lg { width: 46px; height: 46px; border-radius: 14px; }
.brand .bn { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.brand .bs { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }

.userchip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: .18s;
}
.userchip:hover { background: var(--amber-wash); color: var(--amber); border-color: var(--amber-wash); }
/* O chip é um <button> dentro de um form (logout via POST + CSRF, 12/09/2026). */
.userchip-form { display: inline; margin: 0; }
button.userchip { font-family: inherit; line-height: inherit; text-align: left; }
button.userchip:focus-visible { outline: 2px solid var(--amber-soft); outline-offset: 2px; }
.userchip .av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage), #8a9778);
  display: grid; place-items: center;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  font-size: 13px;
  flex-wrap: wrap;
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  transition: .18s;
  border-radius: 8px;
}
.breadcrumb a:hover { color: var(--amber); }
.breadcrumb .sep { color: var(--ink-faint); font-size: 14px; }
.breadcrumb .current { color: var(--ink); font-weight: 600; }
.breadcrumb .home-ico { width: 15px; height: 15px; }

/* ---------- Page head ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.page-sub {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-bottom: 26px;
}

/* ---------- Section head ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 4px 18px;
}
.section-head h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -.01em;
}
.section-head .tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.section-head .ln { flex: 1; height: 1px; background: var(--line); }

/* ---------- Botões ---------- */
.btn {
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: .22s;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  text-align: center;
  justify-content: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--amber-deep), var(--amber) 45%, var(--amber-soft));
  color: #fff;
  box-shadow: 0 8px 20px rgba(200, 101, 27, .28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(200, 101, 27, .36); }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-faint); color: var(--ink); }
.btn-import {
  background: var(--sage);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 14px;
  /* Mesmo esqueleto do .btn: ícone e texto na mesma linha, sem quebrar
     quando o cabeçalho aperta (12/09/2026, botão "Lançar fatura" ao lado). */
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
}
.btn-import:hover { background: var(--sage-deep); transform: translateY(-2px); }
.btn-block { display: flex; width: 100%; }
.btn-flex { flex: 1; }

/* ---------- Inputs / Fields ---------- */
.field { margin-bottom: 18px; }
.field.full { grid-column: 1 / -1; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field label .opt { color: var(--ink-faint); font-weight: 400; }
.inp {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: .2s;
}
.inp::placeholder { color: var(--ink-faint); }
.inp:focus { outline: none; border-color: var(--amber-soft); background: var(--surface); }
textarea.inp { resize: vertical; min-height: 80px; }
/* Rádios e checkboxes nativos: o navegador pinta em azul do sistema; accent-color
   traz para o âmbar da marca (pendência 17, 12/09/2026). Cobre também o foco. */
input[type="radio"], input[type="checkbox"] { accent-color: var(--amber); }
input[type="radio"]:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid var(--amber-soft); outline-offset: 2px; }
select.inp {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A2978A' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.field-inline label { margin-bottom: 0; white-space: nowrap; }
.field-inline .inp { max-width: 180px; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-faint);
}
.search input {
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}
.chip-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-faint);
  padding: 0 4px;
}

/* ---------- Segmented controls ---------- */
.seg {
  display: flex;
  gap: 4px;
  background: var(--bg-tint);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
}
.seg button {
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: .18s;
}
.seg button.active {
  background: var(--surface);
  color: var(--amber);
  box-shadow: var(--shadow-sm);
}

.seg-radio {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.seg-radio label {
  flex: 1;
  min-width: calc(50% - 4px);
  text-align: center;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: .18s;
  background: var(--surface-2);
  margin-bottom: 0;
}
.seg-radio input { display: none; }
.seg-radio input:checked + label {
  border-color: var(--amber-soft);
  background: var(--amber-wash);
  color: var(--amber-deep);
}

/* ---------- Hero (Home) ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 26px;
  margin-bottom: 32px;
}
.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.03;
  letter-spacing: -.025em;
  margin-bottom: 14px;
}
.hero-title em { font-style: italic; color: var(--amber); font-weight: 600; }
.hero-lead { font-size: 16px; color: var(--ink-soft); max-width: 44ch; }
.hero-stats { display: flex; gap: 14px; }

.stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: auto;
}
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  margin: 14px 0 4px;
}
.stat-num.date { font-size: 30px; }
.stat-foot { font-size: 12px; color: var(--ink-soft); }
.stat.accent {
  background: linear-gradient(150deg, var(--amber-deep), var(--amber) 50%, var(--amber-soft));
  border: none;
  color: #fff;
}
.stat.accent .stat-label { color: rgba(255, 255, 255, .7); }
.stat.accent .stat-foot { color: rgba(255, 255, 255, .85); }

/* ---------- Badge da bandeira no hero (fatia bandeiras, S4) ----------
   Cor de fundo pela bandeira vigente, na paleta da casa — SEM vermelho.
   Cada variante redefine os TRÊS textos: .stat-label (ink-faint) e
   .stat-foot (ink-soft) têm cor fixa por padrão e sumiriam em fundo escuro.
   Os pares são MEDIDOS (smoke_bandeiras_badge afere >= 4.5:1, o mínimo dos
   textos de 10px/12px): sage+branco 4.61 | amber-soft+ink 5.91 |
   amber-deep+branco 5.50 | ink+branco 15.93. O --amber puro ficou de fora:
   reprova com ink (4.05) E com branco (3.94). Sem dado = .stat neutro. */
.stat.flag-verde { background: var(--sage); border-color: var(--sage-deep); }
.stat.flag-verde .stat-label,
.stat.flag-verde .stat-num,
.stat.flag-verde .stat-foot { color: #fff; }

.stat.flag-amarela { background: var(--amber-soft); border-color: var(--amber); }
.stat.flag-amarela .stat-label,
.stat.flag-amarela .stat-num,
.stat.flag-amarela .stat-foot { color: var(--ink); }

.stat.flag-vermelha-p1 { background: var(--amber-deep); border-color: var(--amber-deep); }
.stat.flag-vermelha-p1 .stat-label,
.stat.flag-vermelha-p1 .stat-num,
.stat.flag-vermelha-p1 .stat-foot { color: #fff; }

.stat.flag-vermelha-p2 { background: var(--amber-deep); border: 2px solid var(--ink); font-weight: 700; }
.stat.flag-vermelha-p2 .stat-label,
.stat.flag-vermelha-p2 .stat-num,
.stat.flag-vermelha-p2 .stat-foot { color: #fff; }

.stat.flag-escassez { background: var(--ink); border-color: var(--ink); }
.stat.flag-escassez .stat-label,
.stat.flag-escassez .stat-num,
.stat.flag-escassez .stat-foot { color: #fff; }

/* ---------- CTA card ---------- */
.cta-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: linear-gradient(125deg, var(--amber-deep) 0%, var(--amber) 42%, var(--amber-soft) 100%);
  border: none;
  border-radius: var(--radius-lg);
  padding: 30px 36px;
  box-shadow: 0 16px 40px rgba(200, 101, 27, .30);
  margin-bottom: 46px;
  cursor: pointer;
  transition: .28s cubic-bezier(.2, .7, .3, 1);
  width: 100%;
  text-align: left;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-card:hover { transform: translateY(-3px); box-shadow: 0 22px 50px rgba(200, 101, 27, .38); }
.cta-ico {
  width: 60px; height: 60px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .18);
  display: grid; place-items: center;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 2;
}
.cta-body { flex: 1; position: relative; z-index: 2; }
.cta-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
  margin-bottom: 6px;
}
.cta-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -.015em;
  line-height: 1.1;
}
.cta-sub { font-size: 14px; color: rgba(255, 255, 255, .85); margin-top: 4px; }
.cta-go {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: rgba(255, 255, 255, .18);
  border-radius: 14px;
  position: relative;
  z-index: 2;
  white-space: nowrap;
  transition: .25s;
}
.cta-card:hover .cta-go { background: rgba(255, 255, 255, .26); gap: 12px; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 16px; margin-bottom: 38px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Cards de navegação ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: .28s cubic-bezier(.2, .7, .3, 1);
  position: relative;
  overflow: hidden;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--amber-wash);
}
.card .ci {
  width: 46px; height: 46px;
  border-radius: 14px;
  margin-bottom: 18px;
  display: grid; place-items: center;
  transition: .28s;
}
.card:hover .ci { transform: scale(1.06) rotate(-3deg); }
.ci.amber { background: var(--amber-wash); color: var(--amber); }
.ci.sage  { background: var(--sage-wash);  color: var(--sage); }
.card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  margin-bottom: 5px;
}
.card p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.card .arrow {
  position: absolute;
  top: 24px; right: 22px;
  color: var(--ink-faint);
  transition: .28s;
  opacity: 0;
}
.card:hover .arrow { opacity: 1; transform: translate(3px, -3px); }

/* ---------- Mini-stats ---------- */
.ministats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.ms {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.ms .l {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.ms .v {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.ms .v small {
  font-size: 14px;
  color: var(--ink-soft);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
}
.ms .delta { font-size: 12px; font-weight: 600; margin-top: 6px; }
.ms .delta.up   { color: var(--sage-deep); }
.ms .delta.down { color: var(--amber-deep); }

/* ---------- KPI row (workspace, fatura) ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.kpi .l {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.kpi .v {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.kpi.accent {
  background: linear-gradient(140deg, var(--amber-deep), var(--amber-soft));
  border: none;
}
.kpi.accent .l { color: rgba(255, 255, 255, .75); }
.kpi.accent .v { color: #fff; }

/* ---------- Panel block (data-grid de chave/valor) ---------- */
.panel-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.pb-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pb-head .ln { flex: 1; height: 1px; background: var(--line); }
.data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 40px;
}
.drow {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.drow .k { font-size: 13.5px; color: var(--ink-soft); }
.drow .v {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
}

/* ---------- Report banner ---------- */
.report-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  background: var(--sage-wash);
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
}
.report-banner .ck {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.report-banner b { font-family: 'Space Grotesk', sans-serif; font-size: 16px; display: block; }
.report-banner span { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Tabela ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  background: var(--surface-2);
}
thead th.right { text-align: right; }
thead th.center { text-align: center; }
tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: .18s; }
tbody tr:hover { background: var(--amber-wash); }
td.right { text-align: right; }
td.center { text-align: center; }
td.num { font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; }
.t-strong { font-weight: 600; color: var(--ink); }
.t-soft { color: var(--ink-soft); font-size: 12.5px; }
.t-pos { color: var(--sage-deep); }
.t-neg { color: var(--amber-deep); }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok   { background: var(--sage-wash);  color: var(--sage-deep); }
.badge.warn { background: var(--amber-wash); color: var(--amber-deep); }
.badge.mut  { background: var(--bg-tint);    color: var(--ink-soft); }
.badge .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Row actions / icon button ---------- */
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--ink-soft);
  transition: .18s;
}
.icon-btn:hover { background: var(--amber-wash); color: var(--amber); border-color: var(--amber-wash); }

/* ---------- Avatares (titulares/usinas) ---------- */
.avatar-cell { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif;
}
.av-amber { background: var(--amber-wash); color: var(--amber); }
.av-sage  { background: var(--sage-wash);  color: var(--sage-deep); }

/* ---------- Workspace da fatura ---------- */
.ws-top { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: .2s;
}
.back-btn:hover { background: var(--amber-wash); color: var(--amber); border-color: var(--amber-wash); }
.ws-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 6px;
}
.ws-titular {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.ws-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--ink-faint);
  margin-bottom: 24px;
}
.doc-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-tint);
  padding: 6px;
  border-radius: 16px;
  margin-bottom: 26px;
  border: 1px solid var(--line-soft);
  width: fit-content;
}
.doc-tab {
  padding: 11px 22px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: .22s;
}
.doc-tab:hover { color: var(--ink); }
.doc-tab.active { background: var(--surface); color: var(--amber); box-shadow: var(--shadow-sm); }
.doc-panel { display: none; }
.doc-panel.active { display: block; }

/* ---------- Charts ---------- */
.chart-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.chart-grid.cg-2 { grid-template-columns: 1.5fr 1fr; }
.chart-grid.cg-2b { grid-template-columns: 1fr 1fr; }
.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.cc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}
.cc-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -.01em;
}
.cc-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.cc-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 5px 10px;
  background: var(--bg-tint);
  border-radius: 8px;
}
.legend {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.legend .lg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; }

.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-center { text-align: center; }
.donut-center .big {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}
.donut-center .lbl { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Cotações cards ---------- */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.quote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.quote .qh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.quote .qn { font-weight: 600; font-size: 14px; }
.quote .qt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.quote .qv {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.quote .qd { font-size: 12.5px; font-weight: 600; margin-top: 6px; }

/* ---------- Modal / overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 32, 24, .5);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.overlay.show { display: flex; animation: fadein .25s ease; }
.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: pop .35s cubic-bezier(.2, .8, .2, 1);
  max-height: 90vh;
  overflow-y: auto;
}
.modal.sm { max-width: 480px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 30px 34px 0;
}
.modal-head .mk {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}
.modal-head h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.modal-close {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--ink-soft);
  transition: .2s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--amber-wash); color: var(--amber); border-color: var(--amber-wash); }
.modal-body { padding: 24px 34px 34px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 22px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-section:first-child { margin-top: 0; }
.form-section .ln { flex: 1; height: 1px; background: var(--line); }
.modal-actions { display: flex; gap: 12px; margin-top: 26px; }

/* ---------- File drop + processing (modal de apuração) ---------- */
.file-drop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
  background: var(--surface-2);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .25s;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.file-drop:hover { border-color: var(--amber-soft); background: var(--amber-wash); }
.file-drop.filled { border-style: solid; border-color: var(--sage); background: var(--sage-wash); color: var(--ink); }
.file-drop .ico {
  width: 42px; height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--amber-wash);
  display: grid; place-items: center;
  color: var(--amber);
}
.file-drop.filled .ico { background: #fff; color: var(--sage); }
.file-drop.is-dragover {
  border-style: solid;
  border-color: var(--amber);
  background: var(--amber-wash);
  color: var(--ink);
}
.file-drop.is-dragover .ico { background: #fff; color: var(--amber); }
.processing { padding: 50px 34px; text-align: center; display: none; }
.processing.show { display: block; }
.spinner {
  width: 60px; height: 60px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 5px solid var(--amber-wash);
  border-top-color: var(--amber);
  animation: spin 1s linear infinite;
}
.processing h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 21px; margin-bottom: 8px; }
.processing p { font-size: 14px; color: var(--ink-soft); }
.proc-steps {
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 280px;
  text-align: left;
}
.proc-step { display: flex; align-items: center; gap: 11px; font-size: 13px; color: var(--ink-faint); transition: .3s; }
.proc-step.done { color: var(--ink); }
.proc-step .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
  display: grid; place-items: center;
  transition: .3s;
}
.proc-step.done .dot { background: var(--sage); border-color: var(--sage); }
.proc-step .dot svg { display: none; color: #fff; }
.proc-step.done .dot svg { display: block; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 46px 44px;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--amber), var(--amber-soft), var(--sage));
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 34px;
}
.login-brand .bn {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.login-brand .bs {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.login-card h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.login-card .sub { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 30px; }
.login-foot {
  margin-top: 24px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--ink-faint);
}
.login-card .field { margin-bottom: 18px; }

/* ---------- Empty state ---------- */
.empty { padding: 60px 20px; text-align: center; color: var(--ink-faint); }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  margin-top: 30px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-faint);
}

/* ---------- Mensagem de erro inline ---------- */
.error-msg {
  background: var(--amber-wash);
  border: 1px solid var(--amber-soft);
  color: var(--amber-deep);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
}

/* ---------- Animações ---------- */
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: scale(.94) translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.anim { opacity: 0; animation: rise .7s cubic-bezier(.2, .7, .3, 1) forwards; }

/* ---------- Responsivo ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .ministats { grid-template-columns: repeat(2, 1fr); }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .data-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .cta-card { flex-direction: column; align-items: flex-start; gap: 18px; }
  .ws-title-row { flex-direction: column; align-items: flex-start; }
  .chart-grid.cg-2, .chart-grid.cg-2b { grid-template-columns: 1fr !important; }
  .quote-grid { grid-template-columns: 1fr; }
  .hide-mob { display: none; }
}
@media (max-width: 560px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; }
  .doc-tabs { width: 100%; overflow-x: auto; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .ministats { grid-template-columns: 1fr; }
  .app { padding: 24px 18px 60px; }
}

/* ---------- Print mode (PDFs) ---------- */
body.print-mode {
  background: #fff !important;
  color: #000;
  font-family: 'IBM Plex Sans', sans-serif;
}
body.print-mode .app {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px;
}
body.print-mode::before,
body.print-mode::after { display: none !important; }
body.print-mode .topbar,
body.print-mode .breadcrumb,
body.print-mode .footer,
body.print-mode .userchip,
body.print-mode .back-btn,
body.print-mode .row-actions,
body.print-mode .toolbar,
body.print-mode .modal-close,
body.print-mode .doc-tabs,
body.print-mode .screen-only { display: none !important; }
body.print-mode .card,
body.print-mode .panel-block,
body.print-mode .kpi,
body.print-mode .ms,
body.print-mode .table-wrap,
body.print-mode .chart-card,
body.print-mode .quote {
  box-shadow: none !important;
  border-color: #d0d0d0 !important;
}

/* ---------- Print mode (PDFs) — padrão sóbrio "documento" ----------
   Compacta espaçamentos, branqueia fundos, reduz cantos arredondados
   e neutraliza cores de texto para impressão. Cores semânticas
   (t-pos/t-neg, .kpi.accent, .report-banner, badges, gráficos) NÃO
   são tocadas — são informação, não decoração.
   .pb-head mantém o âmbar como assinatura da marca no documento. */

/* Título e subtítulo de página */
body.print-mode .page-title { font-size: 22px; }
body.print-mode .page-sub {
  font-size: 12px;
  color: #555;
  margin-bottom: 14px;
}

/* Ministats — grid container e cards */
body.print-mode .ministats {
  gap: 8px;
  margin-bottom: 14px;
}
body.print-mode .ms {
  background: #fff;
  border-radius: 4px;
  padding: 10px 12px;
}
body.print-mode .ms .l {
  font-size: 9px;
  color: #666;
  margin-bottom: 5px;
}
body.print-mode .ms .v { font-size: 18px; }
body.print-mode .ms .v small { font-size: 10px; }
body.print-mode .ms .delta { font-size: 9.5px; }

/* KPI cards (workspace da fatura no client_report) — .kpi.accent intocado */
body.print-mode .kpi {
  background: #fff;
  border-radius: 4px;
  padding: 10px 12px;
}
body.print-mode .kpi .l {
  font-size: 9px;
  color: #666;
  margin-bottom: 5px;
}
body.print-mode .kpi .v { font-size: 18px; }

/* Chart cards */
body.print-mode .chart-card {
  background: #fff;
  border-radius: 4px;
  padding: 12px 14px;
}
body.print-mode .cc-head { margin-bottom: 10px; }
body.print-mode .cc-title { font-size: 14px; }
body.print-mode .cc-sub { font-size: 11px; }

/* Panel-block (cadastro, classificação, memória de cálculo) */
body.print-mode .panel-block {
  background: #fff;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
body.print-mode .pb-head {
  font-size: 10px;
  margin-bottom: 8px;
  /* color: var(--amber) preservada — assinatura da marca no documento */
}
body.print-mode .drow { padding: 8px 0; }
body.print-mode .drow .k,
body.print-mode .drow .v { font-size: 11.5px; }

/* Tabelas */
body.print-mode .table-wrap {
  background: #fff;
  border-radius: 4px;
}
body.print-mode thead th {
  font-size: 9.5px;
  color: #444;
  padding: 7px 10px;
  background: #f3f3f3;
}
body.print-mode tbody td {
  padding: 6px 10px;
  font-size: 11.5px;
  border-bottom: 1px solid #e5e5e5;
}
body.print-mode td.num { font-size: 11px; }

/* Sem animação no PDF — captura síncrona, sem fade-in pendurado */
body.print-mode .anim {
  opacity: 1;
  animation: none;
}

/* === Flash messages (Sol & Sedimento) === */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 24px;
}
.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}
.flash-success {
  background: var(--sage-wash);
  color: var(--sage-deep);
  border-color: var(--sage);
}
.flash-error {
  background: var(--amber-wash);
  color: var(--amber-deep);
  border-color: var(--amber);
}
.flash-info {
  background: var(--bg-tint);
  color: var(--ink-soft);
  border-color: var(--line);
}

/* Sort headers (compartilhado O&M/Geração — spec higiene 2026-07-14) */
thead th a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: .15s;
}
thead th a:hover { color: var(--amber); }
.sort-indicator {
  color: var(--amber);
  font-weight: 700;
  margin-left: 3px;
}

/* Multi-select compartilhado (Historico, O&M, Geracao) — spec higiene 2026-07-14 */
  .multi-select { position: relative; min-width: 200px; }
  .multi-select-trigger {
    width: 100%;
    padding: 13px 38px 13px 15px;
    font-family: inherit;
    font-size: 14px;
    background: var(--surface-2);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out), transform .12s var(--ease-out);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A2978A' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
  }
  .multi-select-trigger:hover { border-color: var(--ink-faint); }
  .multi-select-trigger:active { transform: scale(.99); }
  .multi-select.open .multi-select-trigger {
    border-color: var(--amber-soft);
    background-color: var(--surface);
  }
  .multi-select-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: var(--shadow);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(.98);
    transform-origin: top center;
    transition: opacity .18s var(--ease-out), transform .18s var(--ease-out), visibility .18s var(--ease-out);
    pointer-events: none;
  }
  .multi-select.open .multi-select-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  .multi-select-panel input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13.5px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    margin-bottom: 10px;
    outline: none;
  }
  .multi-select-panel input[type="text"]:focus { border-color: var(--amber-soft); background: var(--bg); }
  .multi-select-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
  }
  .multi-select-actions button {
    flex: 1;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--bg-tint);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out), transform .12s var(--ease-out);
    font-family: inherit;
  }
  .multi-select-actions button:active { transform: scale(.96); }
  .multi-select-actions button:hover {
    background: var(--amber-wash);
    border-color: var(--amber-wash);
    color: var(--amber-deep);
  }
  .checkbox-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 4px;
  }
  .checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .15s var(--ease-out), color .15s var(--ease-out);
    font-size: 13.5px;
    color: var(--ink);
  }
  .checkbox-option:hover { background: var(--bg-tint); }
  .checkbox-option input { margin: 0; flex-shrink: 0; }

  @media (prefers-reduced-motion: reduce) {
    .multi-select-panel { transform: none; transition: opacity .12s, visibility .12s; }
    .multi-select.open .multi-select-panel { transform: none; }
    .multi-select-trigger:active,
    .multi-select-actions button:active { transform: none; }
  }

/* ============================================================================
   Ações da linha (Histórico de relatórios) — 29/08/2026
   A coluna "Ação" carregava 5 controles: 2 selos, "Ver completo", "Desativar" e
   um formulário com motivo + senha + "Excluir". Só os dois campos somavam 310px
   FIXOS por linha, e a senha existia uma vez POR LINHA — com 20 relatórios na
   tela, 20 campos que o gerenciador do navegador preenche de uma vez.
   Aqui a coluna vira um botão; o menu abre em `position: fixed`, calculado no
   clique, portanto NÃO empurra a altura da linha nem é cortado pelo overflow-x
   da tabela. A exclusão foi para um modal único da página.
   ========================================================================== */

/* Coluna grudada na borda esquerda: com a tabela rolando na horizontal o botão
   nunca sai da tela. Precisa de fundo sólido, senão as colunas passam por baixo. */
.col-acao {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
  border-right: 1px solid var(--line-soft);
}
thead .col-acao { z-index: 4; background: var(--surface-2); }
tr.linha-inativa .col-acao { background: var(--surface); }

.acbtn {
  width: 34px; height: 34px; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 11px; color: var(--ink-soft);
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out), color .18s var(--ease-out);
}
.acbtn:hover { background: var(--amber-wash); border-color: var(--amber-soft); color: var(--amber-deep); }
.acbtn[aria-expanded="true"] { background: var(--amber); border-color: var(--amber); color: #FFF8F0; }
.acbtn:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 2px; }
.acbtn svg { display: block; }

/* position: fixed é o ponto do desenho, não detalhe: dentro da célula o menu
   empurraria a altura da linha e seria cortado pelo overflow-x da tabela. */
.acmenu {
  /* z-index ABAIXO do .overlay (50) de proposito: um menu por cima do modal
     de confirmacao apareceria flutuando sobre ele. */
  position: fixed; z-index: 45; min-width: 190px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 38px rgba(42, 32, 24, .16);
  padding: 6px; display: none;
}
.acmenu.open { display: block; animation: acmenu-surge .16s var(--ease-out); }
@keyframes acmenu-surge { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.acmenu .acmenu-cab {
  display: block; font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-faint); padding: 6px 12px 4px;
}
.acmenu form { margin: 0; }
.acmenu a,
.acmenu button {
  display: block; width: 100%; text-align: left; box-sizing: border-box;
  background: none; border: none; font-family: inherit; font-size: 13.5px;
  color: var(--ink); padding: 9px 12px; border-radius: 10px;
  cursor: pointer; text-decoration: none;
}
.acmenu a:hover,
.acmenu button:hover { background: var(--amber-wash); }
.acmenu button.perigo { color: var(--amber-deep); }
.acmenu a:focus-visible,
.acmenu button:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: -2px; }
.acmenu hr { border: none; border-top: 1px solid var(--line-soft); margin: 5px 8px; }

/* Selo de estado ao lado de um dado (Desativado, Excluido, Autoconsumo).
   NAO reaproveitar `.opt` para isto: ela so tem estilo dentro de
   `.field label .opt` e, fora de um label, vira texto normal — o "Desativado"
   saia colado ao nome do titular, como se fosse parte dele. (29/08/2026) */
.selo {
  display: inline-block; vertical-align: middle;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--bg-tint);
  border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}

/* Bloco que identifica o relatório dentro do modal de exclusão/restauração.
   Flex, e nao 3 colunas iguais: com `repeat(3, 1fr)` a UC nao cabia na sua
   fatia e quebrava no meio ("3.312.854.012-" / "66") — logo no dado que
   confirma QUAL relatorio sera excluido. */
.ac-alvo {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 10px 26px;
}
.ac-alvo > div { white-space: nowrap; }
.ac-alvo .k {
  display: block; font-family: 'IBM Plex Mono', monospace; font-size: 9px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}
.ac-alvo .v { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .acmenu.open { animation: none; }
  .acbtn { transition: none; }
}

/* Palantir Energia: identidade da cópia de teste. Componentes preservados; tipografia abaixo.
   Paleta: Brand Book Palantir Energia Final.html; logo original sem edição.
   A especificidade html:root preserva os tokens sobre gd-validation.css. */
html:root {
  --bg: #F6F7FA; --bg-tint: #ECEEF4; --surface: #FFFFFF; --surface-2: #F4F6FB;
  --line: #C2C7D6; --line-soft: #DCDFE9;
  --ink: #181D28; --ink-soft: #4B5468; --ink-faint: #666F86;
  --amber: #2F49B0; --amber-soft: #0877A6; --amber-deep: #1B2B6B; --amber-wash: #E8EFFA;
  --sage: #4C9A6E; --sage-deep: #2B6D47; --sage-wash: #E5F1E9;
  --blue: #0877A6; --blue-wash: #E1F4FB;
  --shadow: 0 8px 28px rgba(27, 43, 107, .08);
  --shadow-sm: 0 2px 12px rgba(27, 43, 107, .06);
  --shadow-pop: 0 30px 80px rgba(5, 7, 13, .3);
}
html:root[data-gd-theme=dark] {
  --bg: #05070D; --bg-tint: #181D28; --surface: #0B101C; --surface-2: #181D28;
  --line: #4B5468; --line-soft: #333B4E;
  --ink: #F4F6FB; --ink-soft: #C2C7D6; --ink-faint: #A0A8BC;
  --amber: #3BC8F5; --amber-soft: #78DBFA; --amber-deep: #3BC8F5; --amber-wash: #142745;
  --sage: #8BD0A4; --sage-deep: #8BD0A4; --sage-wash: #173728;
  --blue: #78DBFA; --blue-wash: #142745;
  --shadow: none; --shadow-sm: none;
}
body::before { background: radial-gradient(circle, rgba(47, 73, 176, .1), transparent 60%); }
.btn-primary { box-shadow: 0 8px 20px rgba(27, 43, 107, .18); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(27, 43, 107, .24); }
html:root[data-gd-theme=dark] .gd-validation .btn-primary { color: #05070D; }
.palantir-logo { width: 132px; height: auto; object-fit: contain; flex-shrink: 0; }
.gd-sidebar .brand { flex-direction: column; align-items: flex-start; gap: 12px; }
.gd-sidebar .palantir-logo { width: 188px; }
.gd-sidebar .brand .gd-nav-label { font-size: 12px; line-height: 1.4; }
.gd-compact .gd-sidebar .palantir-logo { width: 42px; }
.login-brand { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.login-brand .palantir-logo { width: 250px; max-width: 100%; }
.login-brand .bs { margin-top: 6px; }
.palantir-test-badge {
  margin-bottom: 22px; padding: 7px 10px; border: 1px solid #E09A3F; border-radius: 6px;
  background: #FFF6E8; color: #694309; font-size: 11px; font-weight: 600; line-height: 1.4;
}
/* A faixa de teste ocupa 36px; prevalece sobre o ajuste de produção do CSS-base. */
.gd-validation .gd-sidebar { inset: 36px auto 0 0; }
.gd-validation .gd-shade { inset: 36px 0 0; height: calc(100dvh - 36px); }
.gd-test-banner.palantir-test-banner { background: #1B2B6B; color: #F4F6FB; }
.gd-test-banner.palantir-test-banner span { color: #F4F6FB; }
.palantir-print-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #1B2B6B;
  color: #1B2B6B; font-size: 11px; line-height: 1.3;
}
.palantir-print-header span { font-size: 9px; font-weight: 600; }
.palantir-print-logo { display: block; width: 128px; height: auto; flex-shrink: 0; }
@media (max-width: 760px) {
  .gd-compact .gd-sidebar .palantir-logo { width: 188px; }
  .login-card { padding: 32px 26px; }
}
@media print {
  html:root, html:root[data-gd-theme=dark] {
    --bg: #FFFFFF; --bg-tint: #ECEEF4; --surface: #FFFFFF; --surface-2: #F4F6FB;
    --line: #C2C7D6; --line-soft: #DCDFE9; --ink: #181D28; --ink-soft: #4B5468; --ink-faint: #666F86;
    --amber: #2F49B0; --amber-soft: #0877A6; --amber-deep: #1B2B6B; --amber-wash: #E8EFFA;
    --sage: #4C9A6E; --sage-deep: #2B6D47; --sage-wash: #E5F1E9;
  }
  .gd-test-banner.palantir-test-banner {
    display: block !important; height: auto; padding: 6px 0; margin-bottom: 8px;
    background: #FFFFFF; color: #1B2B6B; border-bottom: 1px solid #1B2B6B;
  }
  .gd-test-banner.palantir-test-banner span { color: #1B2B6B; }
  .palantir-print-header, .palantir-test-badge { break-inside: avoid; }
}

/* ---------- Palantir · tipografia do Brand Book, seção 05 ----------
   Sete níveis oficiais. Componentes densos usam as amostras da seção 07:
   botão/campo 14px, rótulo de formulário e tabela 12.5px, indicadores 26/32px.
   Mantido neste arquivo para o mesmo CSS ser incorporado nos PDFs. */
:root {
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --t-display-size: 48px; --t-display2-size: 38px;
  --t-h1-size: 28px; --t-h2-size: 20px;
  --t-sub-size: 14px; --t-body-size: 17px; --t-data-size: 11px;
  --t-display: 700 48px/1.15 var(--font-display);
  --t-display2: 700 38px/1.15 var(--font-display);
  --t-h1: 700 28px/1.25 var(--font-display);
  --t-h2: 500 20px/1.35 var(--font-display);
  --t-sub: 400 14px/1.4 var(--font-display);
  --t-body: 400 17px/1.65 var(--font-body);
  --t-data: 500 11px/1.4 var(--font-mono);
}
body, body.gd-validation, body.print-mode { font: var(--t-body); }
body .hero-title, body.gd-validation .hero-title {
  font: var(--t-display); letter-spacing: -.03em;
}
body :is(.page-title, .ws-titular, .login-card h1, .rateio-title h1),
body.gd-validation :is(.page-title, .ws-titular, .rateio-title h1) {
  font: var(--t-h1); letter-spacing: -.01em;
}
body :is(.section-head h2, .card h3, .cta-title, .cc-title, .modal-head h2,
  .modal-card h3, .gd-detail h2, .processing h3, .rateio-section-head h2,
  .historico-wrap h2, .docs-wrap h2, .sign-modal h2, .nfse-dropzone strong,
  .nfse-panel h2, .nfse-dialog header h2),
body.gd-validation :is(.section-head h2, .card h3, .cta-title, .cc-title,
  .modal-head h2, .modal-card h3, .gd-detail h2, .rateio-section-head h2,
  .historico-wrap h2, .docs-wrap h2, .sign-modal h2, .nfse-dropzone strong,
  .nfse-panel h2, .nfse-dialog header h2) {
  font: var(--t-h2); letter-spacing: 0;
}
body :is(.brand .bn, .login-brand .bn), body.gd-validation .topbar .brand .bn {
  font: var(--t-h2); letter-spacing: 0;
}
body :is(.brand .bs, .login-brand .bs) {
  font: var(--t-sub); letter-spacing: .44em; text-transform: uppercase;
  overflow-wrap: anywhere;
}
body :is(.hero-lead, .page-sub, .login-card .sub, .card p, .empty),
body.gd-validation :is(.hero-lead, .page-sub) {
  font: var(--t-body); letter-spacing: 0;
}
body :is(.stat-label, .section-head .tag, .ms .l, .kpi .l, .pb-head,
  .cta-kicker, .upload-label, .gd-nav-group, .gd-nav-label small,
  .proposal-number .lbl, .billing-value-card .l, .plant-box .lbl,
  .credit-control__filters .field > span, .nfse-stat span, .nfse-field > span) {
  font: var(--t-data); letter-spacing: .08em;
}
body :is(.stat-num, .ms .v, .kpi .v, .donut-center .big, .quote .qv,
  .billing-value-card .v, .proposal-number .num, .estimate-total strong,
  .gen-card .gc-val, .nfse-stat strong) {
  font-family: var(--font-mono); font-size: 26px; font-weight: 500;
  line-height: 1.4; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
body .stat .stat-num { font-size: 32px; }
body .stat-num.date { font-size: 26px; }
body :is(.drow .v, td.num, .estimate-value, .consumo-bar-value, .tot-val) {
  font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums;
}
body :is(.btn, .cta-go, .btn-salvar, .btn-rebalancear, .btn-exportar, .hist-btn),
body.gd-validation :is(.btn, .gd-query-actions > .btn, .gd-query-menu > .btn) {
  font-family: var(--font-display); font-size: 14px; font-weight: 500; line-height: 1.4;
}
body :is(.inp, .multi-select-trigger, select.plant-sel, .pct-input) {
  font-family: var(--font-body); font-size: 14px; line-height: 1.4;
}
body :is(input[type=number], .pct-input) { font-family: var(--font-mono); font-weight: 500; }
body .field > label { font-family: var(--font-body); font-size: 12.5px; font-weight: 600; }
body .gd-sidebar nav a { font-family: var(--font-body); font-size: 14px; line-height: 1.4; }
body table, body.gd-validation table, body tbody td, body.gd-validation tbody td {
  font-size: 12.5px; line-height: 1.65;
}
body thead th, body.gd-validation thead th { font: var(--t-data); letter-spacing: .08em; }
body td.num, body.gd-validation td.num { font-size: 12.5px; letter-spacing: 0; }
body .drow :is(.k, .v) { font-size: 14px; line-height: 1.4; }
body .gd-test-banner { font-size: 11px; line-height: 20px; }
body .login-foot { font: var(--t-data); letter-spacing: .08em; }
/* A mesma escala no PDF; tabelas seguem a amostra compacta do Brand Book. */
body.print-mode :is(.page-title, .ws-titular) { font: var(--t-h1); letter-spacing: -.01em; }
body.print-mode :is(.page-sub, .drow .k, .drow .v, tbody td, td.num) { font-size: 12.5px; }
body.print-mode :is(.pb-head, .ms .l, .kpi .l, thead th) { font: var(--t-data); }
body.print-mode :is(.ms .v, .kpi .v) { font-family: var(--font-mono); font-size: 20px; }
body.print-mode .cc-title { font: var(--t-h2); }
@media (max-width: 760px) {
  body .hero-title, body.gd-validation .hero-title { font: var(--t-display2); letter-spacing: -.02em; }
  body.gd-validation .page-title { font: var(--t-h1); letter-spacing: -.01em; }
  body .modal-actions { flex-wrap: wrap; }
}
