/* Tokens e componentes essenciais do portal executivo (modelo index AGF) — uso dentro dos módulos */
:root {
  --bg: #eef3f9;
  --panel: #ffffff;
  --line: #d3deeb;
  --line-soft: #e8eef6;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #2f7df6;
  --teal: #00b8a9;
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
  --radius: 16px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --space-3: 16px;
  --tap-min: 44px;
  --focus-ring: 0 0 0 3px rgba(47, 125, 246, 0.28);
}
.agf-portal-surface {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-3);
}
.agf-portal-surface .section-toolbar h3 { color: var(--text); }
.agf-portal-surface .section-toolbar p { color: var(--muted); }
.toolbar-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.section-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.section-toolbar.no-button { justify-content: flex-start; }
.section-toolbar h3 { margin: 0 0 6px; font-size: 1.08rem; font-weight: 800; letter-spacing: -0.02em; }
.section-toolbar p { margin: 0; line-height: 1.55; max-width: 62ch; font-size: 0.94rem; }
.filter-select {
  min-width: 180px;
  max-width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  min-height: var(--tap-min);
  color: var(--text);
}
.filter-select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: var(--focus-ring);
}
.agf-ref-search {
  min-width: 220px;
  flex: 1 1 200px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  min-height: var(--tap-min);
}
.agf-ref-search:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: var(--focus-ring);
}
.agf-detail-panel { margin-top: 12px; border-radius: 14px; }
.agf-detail-summary { cursor: pointer; font-size: 0.95rem; color: var(--text); padding: 4px 0; }
.agf-detail-panel .hint-box {
  margin-top: 0;
  background: #f8fbff;
  border: 1px solid #d9e7fb;
  border-radius: 14px;
  padding: 14px 16px;
}
.dark-executive .agf-portal-surface .table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.dark-executive .agf-portal-surface table th {
  background: linear-gradient(180deg, #f4f8fc 0%, #eef4fb 100%);
  color: #475569;
}
.dark-executive .agf-portal-surface table td,
.dark-executive .agf-portal-surface table th {
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

/* --- Portal entrada / home (SITE 3.0) --- */
.landing-home-final {
  margin: 0;
  min-height: 100vh;
}

#portalGateHub:not([hidden]) {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.portal-kpi-strip {
  padding: 20px 0 8px;
}

.portal-exec-charts {
  padding: 12px 0 8px;
}

.portal-chart-head h2 {
  white-space: normal;
}

.portal-chart-lead {
  margin: 12px 0 0;
  max-width: 72ch;
  color: rgba(237, 245, 251, 0.78);
  line-height: 1.65;
  font-size: 0.95rem;
}

.portal-chart-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.portal-canvas-wrap {
  position: relative;
  height: min(320px, 42vw);
  min-height: 220px;
}

.portal-chart-disclaimer {
  text-align: center;
  margin: 16px 0 0;
  font-size: 0.82rem;
  color: rgba(237, 245, 251, 0.52);
}

.portal-hub-actions {
  margin: 12px 0 20px;
}

.landing-home-final .portal-logout-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.landing-home-final .portal-logout-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  filter: none;
}

.landing-home-final .home-premium-card.disabled {
  opacity: 0.38;
  pointer-events: none;
  filter: grayscale(0.25);
}

.gate-top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, #123252, #1490d2);
  color: #fff;
  box-shadow: 0 14px 32px rgba(20, 144, 210, 0.28);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

/* Login sobre fundo executivo (vidro) */
#portalGateLogin[hidden],
#portalGateHub[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.portal-gate-overlay.auth-overlay {
  background: radial-gradient(ellipse 120% 80% at 50% 20%, rgba(20, 144, 210, 0.18), transparent 55%),
    rgba(4, 12, 22, 0.72);
  backdrop-filter: blur(16px);
}

.portal-gate-card.auth-card {
  max-width: 420px;
  width: calc(100% - 32px);
  margin: 0 auto;
  padding: 32px 28px 28px;
  border-radius: 28px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.12) 0%, rgba(10, 33, 55, 0.55) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.portal-gate-card .auth-logo {
  max-width: 200px;
  border-radius: 18px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.portal-gate-card h1 {
  margin: 18px 0 8px;
  text-align: center;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.portal-gate-tagline {
  text-align: center;
  margin: 0 0 18px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.35;
  color: rgba(237, 245, 251, 0.95);
}

.portal-gate-card .auth-logo-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.portal-gate-card .auth-form {
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.portal-gate-card .auth-form label {
  color: rgba(237, 245, 251, 0.92);
  font-weight: 700;
  font-size: 0.9rem;
}

.portal-gate-card .auth-form input[type="password"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 17, 31, 0.65);
  color: #fff;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 1rem;
  min-height: var(--tap-min);
}

.portal-gate-card .auth-form input[type="password"]::placeholder {
  color: rgba(237, 245, 251, 0.45);
}

.portal-gate-card .auth-form input[type="password"]:focus {
  outline: none;
  border-color: rgba(140, 198, 63, 0.55);
  box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.2);
}

.portal-gate-card .feedback-inline {
  color: #fecaca;
  min-height: 20px;
  font-size: 0.88rem;
}

.portal-gate-note.auth-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(237, 245, 251, 0.88);
  font-size: 0.86rem;
  line-height: 1.55;
}

.portal-gate-note strong {
  color: #b7d96c;
}

.portal-gate-note code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

.landing-home-final .home-premium-card:not(.disabled) {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.landing-home-final .home-premium-card:not(.disabled):hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(140, 198, 63, 0.45);
}

.landing-home-final .portal-chart-card {
  border-radius: 22px;
  border: 1px solid rgba(31, 93, 139, 0.35);
  background: linear-gradient(165deg, rgba(10, 33, 55, 0.98), rgba(8, 26, 44, 0.92));
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Filtros nos módulos executivos: alinhar select/caixa de busca ao botão "Limpar" (compacto, não bloco branco alto) */
.dark-executive .agf-portal-surface .agf-filter-toolbar .filter-select,
.dark-executive .agf-portal-surface .agf-filter-toolbar .agf-ref-search {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 16px;
  border: 1px solid rgba(11, 95, 168, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: #123252;
  box-shadow: 0 12px 24px rgba(18, 50, 75, 0.06);
  min-width: 0;
}
.dark-executive .agf-portal-surface .agf-filter-toolbar .filter-select {
  max-width: 200px;
  flex: 0 1 auto;
}
.dark-executive .agf-portal-surface .agf-filter-toolbar .agf-ref-search {
  flex: 1 1 200px;
  max-width: 360px;
  font-weight: 600;
}
.dark-executive .agf-portal-surface .agf-filter-toolbar .filter-select:focus,
.dark-executive .agf-portal-surface .agf-filter-toolbar .agf-ref-search:focus {
  outline: none;
  border-color: rgba(20, 144, 210, 0.45);
  box-shadow: 0 0 0 3px rgba(20, 144, 210, 0.18);
}
.dark-executive .agf-portal-surface .agf-filter-toolbar--wrap {
  gap: 10px;
}

/* Filtros compactos na faixa escura do cabeçalho (page-topbar) */
.dark-executive .page-panel.dark-panel .page-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
}
.dark-executive .agf-topbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  justify-content: flex-end;
  max-width: min(720px, 100%);
}
.dark-executive .agf-topbar-filters .filter-select,
.dark-executive .agf-topbar-filters .agf-ref-search {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #edf5fb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  min-width: 0;
}
.dark-executive .agf-topbar-filters .filter-select {
  max-width: 150px;
}
.dark-executive .agf-topbar-filters .agf-ref-search {
  width: 150px;
  flex: 1 1 130px;
  max-width: 220px;
  font-weight: 500;
}
.dark-executive .agf-topbar-filters .btn.btn-light {
  padding: 7px 14px;
  min-height: 38px;
  font-size: 0.84rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}
.dark-executive .agf-chart-wrap-metrics {
  position: relative;
  height: 260px;
  min-height: 220px;
  margin-top: 8px;
}
.dark-executive .agf-chart-wrap-metrics canvas {
  width: 100% !important;
  height: 100% !important;
}
