/* ============================================================
   GERTH — Portal do Cliente (mockup navegável)
   ============================================================ */

body.portal { background: var(--paper); }
.js .portal-protected .pt-shell { visibility: hidden; }
.js .portal-protected.session-ready .pt-shell { visibility: visible; }

/* =================== Login =================== */

.login-wrap {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.login-brand {
  position: relative;
  background:
    radial-gradient(700px 420px at 20% 110%, rgba(77, 160, 77, 0.18), transparent 60%),
    linear-gradient(180deg, var(--dk-bg), var(--dk-bg-2));
  color: var(--text-invert);
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.login-brand::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(244,247,245,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,247,245,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}
.login-brand > * { position: relative; }
.login-brand .lb-logo { height: 44px; width: auto; }
.login-brand .lb-mid { margin: auto 0; padding-block: var(--sp-10); }
.login-brand h1 {
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem);
  font-weight: 900;
  font-stretch: 110%;
  letter-spacing: -0.025em;
  max-width: 18ch;
}
.login-brand .lb-sub { margin-top: var(--sp-4); color: var(--text-invert-2); max-width: 44ch; font-size: var(--fs-sm); line-height: 1.7; }

.lb-preview {
  margin-top: var(--sp-8);
  border: 1px solid var(--dk-line);
  border-radius: var(--r-lg);
  background: rgba(244,247,245,0.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  padding: var(--sp-5);
  max-width: 440px;
}
.lb-preview .lp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  padding-block: 8px;
}
.lb-preview .lp-row + .lp-row { border-top: 1px solid var(--dk-line-soft); }
.lb-preview .lp-row .l { color: var(--text-invert-2); }
.lb-preview .lp-row .v { font-family: var(--font-mono); font-weight: 700; }
.lb-preview .lp-row .v.pos { color: var(--dk-green); }

.login-brand .lb-foot { font-size: var(--fs-xs); color: var(--text-invert-2); }

.login-side {
  display: grid;
  place-items: center;
  padding: clamp(2rem, 5vw, 4rem);
}
.login-card { width: 100%; max-width: 420px; }
.login-card .lc-head { margin-bottom: var(--sp-8); }
.login-card .chip { margin-bottom: var(--sp-4); }
.login-card h2 { font-size: var(--fs-xl); letter-spacing: -0.02em; }
.login-card .lc-sub { margin-top: var(--sp-2); color: var(--text-2); font-size: var(--fs-sm); }
.login-card .lc-routing {
  margin-top: var(--sp-3);
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

.login-form { display: grid; gap: var(--sp-5); }
.login-form .f-field label { display: flex; justify-content: space-between; align-items: baseline; }
.login-form .f-field label .lnk { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-600); text-decoration: none; }
.login-form .f-field label .lnk:active { color: var(--green-700); }
@media (hover: hover) and (pointer: fine) {
  .login-form .f-field label .lnk:hover { color: var(--green-700); text-decoration: underline; }
}

.pw-box { position: relative; }
.pw-box .f-input { padding-right: 48px; }
.pw-toggle {
  position: absolute;
  right: 2px; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.pw-toggle:active { color: var(--ink-800); }
@media (hover: hover) and (pointer: fine) {
  .pw-toggle:hover { color: var(--ink-800); background: var(--ink-050); }
}

.demo-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--green-100);
  background: var(--green-050);
  color: var(--green-800);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: var(--fs-xs);
  line-height: 1.55;
}
.demo-note svg { flex: none; margin-top: 1px; }

.login-back {
  margin-top: var(--sp-6);
  text-align: center;
  font-size: var(--fs-sm);
}
.login-back a { color: var(--text-2); text-decoration: none; font-weight: 600; }
.login-back a:active { color: var(--ink-900); }
@media (hover: hover) and (pointer: fine) {
  .login-back a:hover { color: var(--ink-900); text-decoration: underline; }
}

@media (max-width: 880px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-brand { min-height: auto; }
  .login-brand .lb-mid { padding-block: var(--sp-6); }
  .lb-preview { display: none; }
}

/* =================== Shell do app =================== */

.pt-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100dvh;
}

.pt-content { min-width: 0; }

/* o scrim nunca participa do fluxo: escondido no desktop, fixo no mobile */
.side-scrim { display: none; }

.pt-side {
  background: var(--ink-950);
  color: var(--text-invert-2);
  display: flex;
  flex-direction: column;
  padding: var(--sp-5) var(--sp-4);
  gap: var(--sp-6);
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}
.pt-side .ps-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  text-decoration: none;
}
.pt-side .ps-brand img.sym { height: 34px; width: auto; }
.pt-side .ps-brand img.nm { height: 22px; width: auto; }

.ps-client {
  margin: 0 10px;
  border: 1px solid var(--dk-line);
  border-radius: var(--r-md);
  background: rgba(244,247,245,0.05);
  padding: 10px 12px;
}
.ps-client .c-label { font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-invert-2); font-weight: 700; }
.ps-client .c-name { font-size: var(--fs-sm); font-weight: 700; color: var(--text-invert); margin-top: 2px; }

.ps-nav { display: grid; gap: 2px; }
.ps-nav .n-label {
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(169, 195, 197, 0.55);
  padding: 14px 12px 6px;
}
.ps-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text-invert-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.ps-nav a svg { flex: none; opacity: 0.85; }
.ps-nav a:active { color: var(--text-invert); }
@media (hover: hover) and (pointer: fine) {
  .ps-nav a:hover { background: rgba(244,247,245,0.06); color: var(--text-invert); }
}
.ps-nav a.is-active {
  background: rgba(111, 191, 103, 0.13);
  border-color: rgba(111, 191, 103, 0.22);
  color: #CDEBC8;
}
.ps-nav a.is-active svg { color: var(--dk-green); opacity: 1; }

.ps-foot { margin-top: auto; display: grid; gap: var(--sp-3); }
.ps-user {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--dk-line-soft);
  padding: var(--sp-4) 10px 0;
}
.ps-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-600), var(--ink-600));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
  flex: none;
}
.ps-user .u-name { font-size: var(--fs-sm); font-weight: 700; color: var(--text-invert); line-height: 1.2; }
.ps-user .u-role { font-size: var(--fs-xs); color: var(--text-invert-2); }
.ps-exit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-invert-2);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}
@media (hover: hover) and (pointer: fine) {
  .ps-exit:hover { background: rgba(244,247,245,0.06); color: var(--text-invert); }
}

/* Topbar */

.pt-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 245, 240, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
}
.pt-top h1 { font-size: var(--fs-lg); letter-spacing: -0.02em; }
.pt-top .t-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }
.pt-top .t-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }

.side-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--card);
  cursor: pointer;
  place-items: center;
  color: var(--ink-800);
}

.period-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: var(--r-full);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-800);
}
.period-pill svg { color: var(--text-3); }

.demo-flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--warn-bg);
  border: 1px solid #EAD9AE;
  color: #7A5A14;
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: var(--r-full);
  padding: 7px 14px;
}
.demo-flag .chip-dot { background: var(--warn); }

/* Área principal */

.pt-main {
  padding: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  gap: var(--sp-5);
  align-content: start;
}

.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-5); }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: 1 / -1; }

@media (max-width: 1180px) {
  .col-3 { grid-column: span 6; }
  .col-4, .col-5, .col-7, .col-8 { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .col-3, .col-6 { grid-column: 1 / -1; }
}

/* Cartões */

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--sp-5);
  display: grid;
  gap: 6px;
}
.kpi .k-top { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.kpi .k-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); }
.kpi .k-value {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 1.1rem + 0.9vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink-900);
  line-height: 1.1;
}
.kpi .k-foot { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--text-3); flex-wrap: wrap; }
.kpi .spark { margin-top: 4px; }
.kpi .spark path.ln { fill: none; stroke: var(--green-500); stroke-width: 2; stroke-linecap: round; }
.kpi .spark path.ar { fill: url(#sparkfill); opacity: 0.5; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-5) 0;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: var(--fs-base); font-weight: 800; letter-spacing: -0.015em; }
.panel-head .p-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.panel-body { padding: var(--sp-5); }
.panel-body.tight { padding-top: var(--sp-3); }

.legend { display: flex; gap: var(--sp-4); align-items: center; font-size: var(--fs-xs); color: var(--text-2); flex-wrap: wrap; }
.legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; }
.legend .dot.g { background: var(--green-500); }
.legend .dot.n { background: var(--ink-200); }
.legend .dot.line { width: 14px; height: 2px; border-radius: 2px; background: var(--ink-700); }

/* Gráfico de barras (dias) */

.bars-chart {
  display: grid;
  grid-template-columns: repeat(var(--cols, 22), 1fr);
  align-items: end;
  gap: 4px;
  height: 190px;
  padding-top: var(--sp-2);
}
.bars-chart .bc {
  position: relative;
  display: grid;
  align-items: end;
  height: 100%;
  border-radius: 4px;
}
.bars-chart .bc i {
  display: block;
  border-radius: 3px 3px 2px 2px;
  background: var(--green-500);
  height: calc(var(--v) * 1%);
  min-height: 4px;
  transform-origin: bottom;
  transition: transform 600ms var(--ease-out);
  transition-delay: calc(var(--i) * 22ms);
}
.bars-chart .bc.under i { background: var(--ink-200); }
.js .bars-chart .bc i { transform: scaleY(0); }
.js .in-view .bars-chart .bc i { transform: scaleY(1); }
.bars-chart .bc .goal {
  position: absolute;
  left: -2px; right: -2px;
  bottom: calc(var(--g) * 1%);
  height: 2px;
  background: var(--ink-700);
  opacity: 0.55;
  border-radius: 2px;
}
.bars-axis {
  display: grid;
  grid-template-columns: repeat(var(--cols, 22), 1fr);
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--text-3);
  margin-top: 6px;
  text-align: center;
}
.bars-axis span:nth-child(odd) { visibility: hidden; }
@media (min-width: 900px) { .bars-axis span:nth-child(odd) { visibility: visible; } }

/* Linha acumulada (SVG) */

.line-chart { width: 100%; height: auto; }
.line-chart .grid-l { stroke: var(--ink-050); stroke-width: 1; }
.line-chart .lbl { font: 700 9px var(--font-mono); fill: var(--text-3); }
.line-chart .ln-goal { fill: none; stroke: var(--ink-300); stroke-width: 1.5; stroke-dasharray: 5 5; }
.line-chart .ln-real {
  fill: none;
  stroke: var(--green-600);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 720;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.3s var(--ease-in-out) 150ms;
}
.js .line-chart .ln-real { stroke-dashoffset: 720; }
.js .in-view .line-chart .ln-real { stroke-dashoffset: 0; }
.line-chart .ar-real { fill: rgba(77, 160, 77, 0.09); }
.line-chart .pt-dot { fill: var(--green-600); stroke: #fff; stroke-width: 2; }

/* Tabelas */

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 560px; }
.tbl th {
  text-align: left;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 800;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.tbl th.num { font-family: var(--font-sans); }
.tbl tbody tr { transition: background-color var(--t-fast) ease; }
@media (hover: hover) and (pointer: fine) {
  .tbl tbody tr:hover { background: var(--paper); }
}
.tbl .t-name { font-weight: 700; color: var(--ink-900); white-space: nowrap; }
.tbl .t-sub { display: block; font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; white-space: nowrap; }
.tbl .meter { max-width: 140px; min-width: 90px; }

.pos-badge {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 800;
  background: var(--paper-2);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.pos-badge.p1 { background: #FBF3DC; border-color: #EAD9AE; color: #8A6416; }
.pos-badge.p2 { background: var(--ink-050); border-color: var(--ink-100); color: var(--ink-700); }
.pos-badge.p3 { background: var(--green-050); border-color: var(--green-100); color: var(--green-800); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: var(--r-full);
  padding: 4px 11px;
  white-space: nowrap;
}
.badge .chip-dot { width: 6px; height: 6px; }
.b-ok { background: var(--pos-bg); color: var(--green-800); }
.b-warn { background: var(--warn-bg); color: #8A6416; }
.b-neg { background: var(--neg-bg); color: var(--neg); }
.b-mut { background: var(--paper-2); color: var(--text-2); border: 1px solid var(--line); }

/* Alertas */

.alerts { display: grid; gap: 10px; }
.alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--card);
  font-size: var(--fs-sm);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) ease;
}
@media (hover: hover) and (pointer: fine) {
  .alert:hover { transform: translateY(-1px); box-shadow: var(--sh-card); }
}
.alert .a-ic {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
}
.alert.warn .a-ic { background: var(--warn-bg); color: #8A6416; }
.alert.neg .a-ic { background: var(--neg-bg); color: var(--neg); }
.alert.ok .a-ic { background: var(--pos-bg); color: var(--green-700); }
.alert .a-txt b { display: block; font-weight: 700; color: var(--ink-900); font-size: var(--fs-sm); }
.alert .a-txt span { font-size: var(--fs-xs); color: var(--text-3); }
.alert .a-act {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-600);
  text-decoration: none;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .alert .a-act:hover { color: var(--green-700); text-decoration: underline; }
}

/* Campanha (portal) */

.camp-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-card);
  overflow: hidden;
}
.camp-card .cc-head {
  background: linear-gradient(135deg, var(--ink-900), var(--ink-800));
  color: var(--text-invert);
  padding: var(--sp-5);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  align-items: flex-start;
  flex-wrap: wrap;
}
.camp-card .cc-head b { display: block; font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.015em; }
.camp-card .cc-head span { font-size: var(--fs-xs); color: var(--text-invert-2); }
.camp-card .cc-body { padding: var(--sp-5); display: grid; gap: var(--sp-4); }
.cc-meta { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.cc-meta .m { font-size: var(--fs-xs); color: var(--text-3); }
.cc-meta .m b { display: block; font-family: var(--font-mono); font-size: var(--fs-base); font-weight: 800; color: var(--ink-900); }

/* Pódio (ranking) */

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
  align-items: end;
  padding: var(--sp-5) var(--sp-5) 0;
}
.pd {
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.pd .avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: var(--fs-sm);
  color: #fff;
  background: linear-gradient(135deg, var(--ink-600), var(--ink-800));
}
.pd.first .avatar { width: 68px; height: 68px; background: linear-gradient(135deg, var(--green-500), var(--green-700)); }
.pd .pd-name { font-weight: 700; font-size: var(--fs-sm); color: var(--ink-900); line-height: 1.25; }
.pd .pd-val { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; color: var(--green-700); }
.pd .pd-bar {
  width: 100%;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, var(--ink-050), var(--paper-2));
  border: 1px solid var(--line);
  border-bottom: 0;
  display: grid;
  place-items: start center;
  padding-top: 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-3);
}
.pd.first .pd-bar { height: 96px; background: linear-gradient(180deg, var(--green-050), var(--paper-2)); border-color: var(--green-100); color: var(--green-800); }
.pd.second .pd-bar { height: 66px; }
.pd.third .pd-bar { height: 46px; }

/* Relatórios */

.rep-list { display: grid; gap: 10px; }
.rep {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) ease, border-color var(--t-fast) ease;
}
.rep:active { transform: scale(0.995); }
@media (hover: hover) and (pointer: fine) {
  .rep:hover { transform: translateY(-1px); box-shadow: var(--sh-card); border-color: var(--ink-200); }
}
.rep .r-ic {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--ink-050);
  color: var(--ink-700);
  flex: none;
}
.rep .r-t b { display: block; font-weight: 700; font-size: var(--fs-sm); color: var(--ink-900); }
.rep .r-t span { font-size: var(--fs-xs); color: var(--text-3); }
.rep .r-right { display: flex; align-items: center; gap: var(--sp-3); }
.rep .r-size { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); }

/* Segmentos (filtro mock) */

.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  background: var(--card);
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) var(--ease-out);
}
.seg button:active { transform: scale(0.96); }
.seg button.is-on { background: var(--ink-900); color: var(--text-invert); }
@media (hover: hover) and (pointer: fine) {
  .seg button:not(.is-on):hover { background: var(--ink-050); color: var(--ink-900); }
}

/* Metas */

.goal-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(70px, 1.4fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.goal-row:last-child { border-bottom: 0; }
.goal-row .g-name { font-weight: 700; font-size: var(--fs-sm); color: var(--ink-900); }
.goal-row .g-name span { display: block; font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }
.goal-row .g-val { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 700; text-align: right; white-space: nowrap; }
.goal-row .g-val span { display: block; font-size: 0.625rem; color: var(--text-3); font-weight: 500; }
@media (max-width: 640px) {
  .goal-row { grid-template-columns: 1fr auto; }
  .goal-row .meter-wrap { grid-column: 1 / -1; }
}

/* Mobile shell */

@media (max-width: 960px) {
  .pt-shell { grid-template-columns: 1fr; }
  .pt-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 84vw);
    z-index: 120;
    transform: translateX(-100%);
    transition: transform 280ms var(--ease-out);
    box-shadow: 24px 0 60px -30px rgba(5, 30, 39, 0.5);
  }
  body.side-open .pt-side { transform: none; }
  .side-toggle { display: grid; }
  .side-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(5, 30, 39, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 240ms ease, visibility 0s linear 240ms;
  }
  body.side-open .side-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
}

@media print {
  .pt-side, .pt-top .t-right, .side-toggle { display: none !important; }
  .pt-shell { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bars-chart .bc i, .js .bars-chart .bc i,
  .js .in-view .bars-chart .bc i { transform: scaleY(1); transition: none; }
  .line-chart .ln-real, .js .line-chart .ln-real,
  .js .in-view .line-chart .ln-real { stroke-dashoffset: 0; transition: none; }
}

/* Painel de solicitações Gerth */

.login-feedback { min-height: 1.5em; margin: calc(var(--sp-2) * -1) 0 0; color: var(--text-2); font-size: var(--fs-sm); }
.login-feedback.is-error, .lead-feedback.is-error { color: var(--neg); }
.invite-acceptance .login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(640px 340px at 10% 0%, rgba(77, 160, 77, 0.1), transparent 65%),
    var(--paper);
}
.invite-acceptance .login-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 480px;
  padding: clamp(24px, 6vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--sh-float);
}
.invite-acceptance .login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--green-700), var(--green-400)); }
.invite-acceptance .login-brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: auto;
  padding: 0;
  margin-bottom: var(--sp-6);
  overflow: visible;
  background: transparent;
  color: inherit;
}
.invite-acceptance .login-brand::before { content: none; }
.invite-acceptance .login-brand img:first-child { width: auto; height: 40px; }
.invite-acceptance .login-brand img:last-child { width: auto; height: 30px; }
.invite-acceptance h1 { font-size: clamp(2rem, 7vw, 2.75rem); letter-spacing: -0.03em; }
.invite-acceptance .login-lead { margin-top: var(--sp-2); color: var(--text-2); }
.invite-acceptance .login-feedback { margin: var(--sp-4) 0 0; }
.invite-acceptance .login-form { display: grid; gap: var(--sp-3); }
.invite-acceptance .login-form label { margin-top: var(--sp-2); color: var(--ink-800); font-size: var(--fs-sm); font-weight: 800; }
.invite-acceptance .login-form .hint { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.5; }
.invite-acceptance .login-form .f-input { min-height: 52px; }
.invite-acceptance .login-form .btn { min-height: 44px; margin-top: var(--sp-3); width: 100%; }
.invite-acceptance .login-invite-note { margin-top: var(--sp-6); }
.login-invite-note { border-top: 1px solid var(--line); padding-top: var(--sp-4); color: var(--text-3); font-size: var(--fs-xs); line-height: 1.55; }

@media (max-width: 520px) {
  .invite-acceptance .login-shell { place-items: start center; padding: 16px; }
  .invite-acceptance .login-card { padding: 24px 20px; border-radius: var(--r-lg); }
}

.admin-portal { background: var(--paper); min-height: 100vh; }
.admin-portal .pt-main { max-width: 1480px; margin: 0 auto; padding-top: clamp(2rem, 5vw, 4.5rem); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: var(--sp-5); padding-bottom: var(--sp-5); border-bottom: 1px solid var(--line); }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3); flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.8rem, 1.35rem + 1.65vw, 2.7rem); letter-spacing: -0.04em; color: var(--ink-900); }
.page-head > div > p:last-child { max-width: 62ch; margin-top: var(--sp-3); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }

.lead-toolbar { display: flex; align-items: end; gap: var(--sp-4); padding: var(--sp-4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-card); }
.lead-toolbar label { display: grid; gap: 7px; color: var(--text-2); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.lead-toolbar label:first-child { flex: 1 1 22rem; }
.lead-toolbar .f-input, .lead-toolbar .f-select { min-height: 43px; background: var(--paper); }
.lead-toolbar .f-select { min-width: 190px; }
.lead-feedback { min-height: 1.5em; margin-top: calc(var(--sp-3) * -1); color: var(--text-2); font-size: var(--fs-sm); }

.lead-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-card); }
.table-scroll { overflow-x: auto; }
.lead-table { width: 100%; min-width: 1100px; table-layout: fixed; }
.lead-table th:nth-child(1) { width: 130px; }
.lead-table th:nth-child(2) { width: 240px; }
.lead-table th:nth-child(3) { width: 230px; }
.lead-table th:nth-child(4) { width: 150px; }
.lead-table th:nth-child(5) { width: 160px; }
.lead-table th:nth-child(6) { width: 130px; }
.lead-table th:nth-child(7) { width: 110px; }
.lead-table td { overflow: hidden; white-space: nowrap; }
.lead-table .t-name,
.lead-table .t-sub { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-status { min-width: 142px; padding: 7px 30px 7px 10px; font-size: var(--fs-xs); font-weight: 700; background-color: var(--paper); }
.lead-detail { min-width: 80px; }
.lead-pagination { display: flex; align-items: center; justify-content: end; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); color: var(--text-3); font-family: var(--font-mono); font-size: var(--fs-xs); }
.lead-pagination .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.lead-dialog { width: min(680px, calc(100vw - 2rem)); max-height: min(760px, calc(100vh - 2rem)); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 0; background: var(--card); color: var(--text); box-shadow: 0 28px 80px rgba(5, 30, 39, 0.32); }
.lead-dialog::backdrop { background: rgba(5, 30, 39, 0.55); backdrop-filter: blur(3px); }
.lead-dialog form { position: relative; display: grid; gap: var(--sp-5); padding: clamp(1.25rem, 4vw, 2rem); }
.dialog-close { position: absolute; top: var(--sp-3); right: var(--sp-3); width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink-800); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lead-dialog h2 { max-width: calc(100% - 3rem); font-size: var(--fs-xl); letter-spacing: -0.03em; }
.lead-data { display: grid; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lead-data div { display: grid; grid-template-columns: minmax(110px, 0.65fr) minmax(0, 2fr); gap: var(--sp-3); padding: 12px 0; border-bottom: 1px solid var(--line); }
.lead-data div:last-child { border-bottom: 0; }
.lead-data dt { color: var(--text-3); font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.lead-data dd { color: var(--text); font-size: var(--fs-sm); line-height: 1.55; overflow-wrap: anywhere; }
.lead-data a { color: var(--green-700); font-weight: 700; }
.lead-challenges { display: grid; gap: 4px; margin: 0; padding-left: 1.1rem; }
.lead-note-label { display: grid; gap: 8px; font-size: var(--fs-sm); font-weight: 800; color: var(--ink-800); }

@media (max-width: 640px) {
  .page-head { align-items: start; flex-direction: column; }
  .lead-toolbar { align-items: stretch; flex-direction: column; }
  .lead-toolbar label:first-child { flex-basis: auto; }
  .lead-toolbar .f-select { min-width: 0; width: 100%; }
  .lead-pagination { justify-content: space-between; }
  .lead-data div { grid-template-columns: 1fr; gap: 4px; }
}
