:root {
  --lh-bg: #f3f4f6;
  --lh-surface: #ffffff;
  --lh-surface-muted: #f9fafb;
  --lh-border: #e5e7eb;
  --lh-text: #111827;
  --lh-text-secondary: #6b7280;
  --lh-nav-bg: #0369a1;
  --lh-accent: #0ea5e9;
  --lh-accent-hover: #0284c7;
  --lh-row-hover: #f9fafb;
  --lh-success: #059669;
  --lh-danger: #dc2626;
  --lh-warn: #d97706;
}

[data-theme="dark"] {
  --lh-bg: #111827;
  --lh-surface: #1f2937;
  --lh-surface-muted: #374151;
  --lh-border: #4b5563;
  --lh-text: #f9fafb;
  --lh-text-secondary: #9ca3af;
  --lh-nav-bg: #0c4a6e;
  --lh-accent: #38bdf8;
  --lh-accent-hover: #7dd3fc;
  --lh-row-hover: #374151;
}

* { box-sizing: border-box; }

body.lh-body {
  margin: 0;
  min-height: 100vh;
  background: var(--lh-bg);
  color: var(--lh-text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Layout com sidebar (estilo GuardianFlow) */
.lh-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.lh-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 16rem;
  background: var(--lh-surface);
  border-right: 1px solid var(--lh-border);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
}

.lh-sidebar.is-open {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .lh-sidebar {
    position: static;
    transform: none;
    flex-shrink: 0;
  }
  .lh-menu-btn { display: none !important; }
  .lh-sidebar-backdrop { display: none !important; }
}

.lh-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.45);
}

.lh-sidebar-brand {
  padding: 1.15rem 1rem;
  border-bottom: 1px solid var(--lh-border);
  text-align: center;
}

.lh-sidebar-logo-img {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.55rem;
  object-fit: contain;
}

.lh-wordmark {
  display: inline-block;
  font-family: Montserrat, Inter, system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.lh-wordmark-lg {
  font-size: 1.85rem;
  margin: 0.35rem 0 0;
}

.lh-wordmark-legal {
  color: #0b2a4a;
}

.lh-wordmark-hub {
  color: #00b7c8;
}

[data-theme="dark"] .lh-wordmark-legal {
  color: #e2e8f0;
}

[data-theme="dark"] .lh-wordmark-hub {
  color: #22d3ee;
}

.lh-sidebar-logo {
  display: none;
}

.lh-sidebar-name {
  display: none;
}

.lh-sidebar-tag {
  margin: 0.35rem 0 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lh-text-secondary);
}

.auth-logo-img {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.auth-brand-panel .lh-wordmark-legal {
  color: #ffffff;
}

.auth-brand-panel .lh-wordmark-hub {
  color: #7dd3e8;
}

.lh-sidebar-nav {
  padding: 0.75rem;
}

.lh-side-section {
  margin: 1rem 0 0.35rem;
  padding: 0 0.75rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
}

.lh-side-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--lh-text-secondary);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.lh-side-link:hover {
  background: var(--lh-surface-muted);
  color: var(--lh-text);
}

.lh-side-link.is-active {
  background: #eff6ff;
  color: #1d4ed8;
}

[data-theme="dark"] .lh-side-link.is-active {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}

.lh-side-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.lh-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.lh-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--lh-surface);
  border-bottom: 1px solid var(--lh-border);
}

.lh-topbar-title {
  margin: 0;
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--lh-text);
}

.lh-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lh-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--lh-text-secondary);
  cursor: pointer;
}

.lh-icon-btn:hover {
  background: var(--lh-surface-muted);
  color: var(--lh-text);
}

.lh-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
}

.lh-logout-btn:hover {
  background: #fef2f2;
}

[data-theme="dark"] .lh-logout-btn:hover {
  background: rgba(220, 38, 38, 0.15);
}

.lh-logout-btn span {
  display: none;
}

@media (min-width: 768px) {
  .lh-logout-btn span { display: inline; }
}

.lh-user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--lh-text-secondary);
}

.lh-user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.lh-user-name {
  display: none;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .lh-user-name { display: inline; }
}

.lh-content {
  flex: 1;
  padding: 1rem 1.25rem 1.5rem;
  overflow: auto;
  width: 100%;
  max-width: none;
}

@media (min-width: 768px) {
  .lh-content { padding: 1.25rem 1.5rem 1.75rem; }
}

.lh-footer {
  border-top: 1px solid var(--lh-border);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--lh-text-secondary);
}

.lh-guest {
  min-height: 100vh;
}

.lh-nav { background: var(--lh-nav-bg); }

.lh-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: inherit;
}

.lh-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #0369a1;
  font-weight: 700;
  font-size: 0.8125rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.lh-brand-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.lh-nav-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.lh-nav-btn:hover { background: rgba(255, 255, 255, 0.2); }

.lh-nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 0.375rem;
  font-weight: 500;
}

.lh-nav-link:hover,
.lh-nav-link.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.lh-heading { color: var(--lh-text); }
.lh-subtext { color: var(--lh-text-secondary); }

.lh-shell {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.lh-panel {
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  border-radius: 0.75rem;
  padding: 1rem 1.125rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.lh-panel:hover,
.lh-panel:focus-within {
  z-index: 30;
}

[data-theme="dark"] .lh-panel {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Filtros em uma linha, live */
.lh-filter-bar {
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  border-radius: 0.75rem;
  padding: 0.55rem 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  margin-bottom: 1rem;
}

.lh-filter-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.lh-filter-inline .lh-input {
  flex: 0 0 auto;
  min-width: 7.25rem;
  width: auto;
  height: 2.1rem;
  font-size: 0.8125rem;
  padding: 0.3rem 0.5rem;
}

.lh-filter-search {
  min-width: 9.5rem !important;
  max-width: 14rem;
  flex: 0 0 12.5rem !important;
  width: 12.5rem !important;
}

.lh-filter-ano {
  min-width: 5.5rem !important;
  max-width: 6.5rem;
}

.lh-filter-empresa,
.lh-filter-tipo {
  min-width: 9.5rem !important;
  max-width: 16rem;
}

.lh-filter-empresa .lh-option-matriz,
select.lh-filter-empresa option.lh-option-matriz {
  font-weight: 700;
  color: #0c4a6e;
  background: #e0f2fe;
}

.lh-filter-empresa optgroup[label="Matrizes"] {
  font-weight: 700;
  color: #0369a1;
}

.lh-filter-empresa optgroup[label="Filiais"] {
  font-weight: 600;
  color: #64748b;
}

.lh-filter-clear {
  flex: 0 0 auto;
  white-space: nowrap;
  height: 2.1rem;
  margin-left: 0.15rem;
}

.lh-btn-export {
  flex: 0 0 auto;
  height: 2.1rem;
  margin-left: 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 2.35rem;
  overflow: hidden;
  padding: 0 0.55rem;
  border-radius: 0.375rem;
  border: 1px solid var(--lh-border);
  background: var(--lh-surface);
  color: #00b7c8;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: max-width 0.22s ease, gap 0.22s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lh-btn-export:hover,
.lh-btn-export:focus-visible {
  max-width: 9.5rem;
  gap: 0.4rem;
  border-color: #00b7c8;
  background: rgba(0, 183, 200, 0.08);
  color: #0891b2;
  outline: none;
}

.lh-btn-export__icon {
  flex: 0 0 auto;
}

.lh-btn-export__label {
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.18s ease, max-width 0.22s ease;
}

.lh-btn-export:hover .lh-btn-export__label,
.lh-btn-export:focus-visible .lh-btn-export__label {
  opacity: 1;
  max-width: 6rem;
}

.lh-modal[hidden] { display: none !important; }

.lh-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lh-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.lh-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  border-radius: 0.75rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.lh-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--lh-border);
}

.lh-modal__head h3 {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--lh-text);
}

.lh-modal__close {
  border: none;
  background: transparent;
  color: var(--lh-text-secondary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}

.lh-modal__close:hover {
  color: var(--lh-text);
  background: var(--lh-surface-muted);
}

.lh-modal__body {
  padding: 1rem;
}

.lh-modal__hint {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--lh-text-secondary);
  line-height: 1.45;
}

.lh-export-options {
  display: grid;
  gap: 0.65rem;
}

.lh-export-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-radius: 0.55rem;
  border: 1px solid var(--lh-border);
  background: var(--lh-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.lh-export-option:hover {
  border-color: #00b7c8;
  background: rgba(0, 183, 200, 0.06);
  transform: translateY(-1px);
}

.lh-export-option__badge {
  flex: 0 0 auto;
  min-width: 3.2rem;
  text-align: center;
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  background: #00b7c8;
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lh-export-option__badge.is-pdf {
  background: #0b2a4a;
}

.lh-export-option__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.lh-export-option__text strong {
  font-size: 0.875rem;
  color: var(--lh-text);
}

.lh-export-option__text small {
  font-size: 0.75rem;
  color: var(--lh-text-secondary);
}

.lh-filter-busy {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lh-accent-hover);
  white-space: nowrap;
}

.lh-filter-busy.is-hidden { display: none; }

.lh-input {
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  color: var(--lh-text);
  border-radius: 0.375rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.8125rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lh-input:focus {
  outline: none;
  border-color: var(--lh-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.lh-btn {
  background: var(--lh-accent);
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lh-btn:hover { background: var(--lh-accent-hover); }

.lh-btn-ghost {
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  color: var(--lh-text-secondary);
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.lh-btn-ghost:hover {
  border-color: var(--lh-accent);
  color: var(--lh-accent);
}

.lh-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(12rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 1100px) {
  .lh-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .lh-kpi-grid { grid-template-columns: 1fr; }
}

.lh-kpi,
.lh-kpi-card {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  padding: 1rem 1.15rem 1.05rem 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  position: relative;
  overflow: visible;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 5.25rem;
}

.lh-kpi-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.lh-kpi-head .lh-kpi-label {
  /* Override: no geral a label é block, mas aqui precisamos ficar na mesma linha do ícone */
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.lh-kpi-info {
  position: relative;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.lh-kpi-info:hover,
.lh-kpi-info:focus-visible {
  color: #0284c7;
  background: rgba(14, 165, 233, 0.12);
  outline: none;
}

.lh-kpi-info svg {
  width: 0.95rem;
  height: 0.95rem;
}

.lh-kpi-tip {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 40;
  width: max-content;
  max-width: 16.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

.lh-kpi-tip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 0.55rem;
  width: 10px;
  height: 10px;
  background: #0f172a;
  transform: rotate(45deg);
  border-radius: 2px;
}

.lh-kpi-info:hover .lh-kpi-tip,
.lh-kpi-info:focus-visible .lh-kpi-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

[data-theme="dark"] .lh-kpi-tip {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .lh-kpi-tip::before {
  background: #e2e8f0;
}

.lh-kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #0ea5e9;
}

.lh-kpi-card.is-accent::before { background: #0284c7; }
.lh-kpi-card.is-money::before { background: #059669; }
.lh-kpi-card.is-risk::before { background: #dc2626; }

[data-theme="dark"] .lh-kpi,
[data-theme="dark"] .lh-kpi-card {
  background: #1f2937;
  border-color: rgba(55, 65, 81, 0.6);
}

.lh-kpi span,
.lh-kpi-label {
  display: block;
  flex: 1;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lh-text-secondary);
  line-height: 1.3;
  padding-right: 0.15rem;
}

/* Modo compacto: 1 linha, cards esticam na horizontal conforme a quantidade */
.lh-kpi-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  align-items: stretch;
}

.lh-kpi-grid-compact .lh-kpi-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 0;
  height: 100%;
  width: 100%;
  padding: 0.9rem 1rem;
}

.lh-kpi-grid-compact .lh-kpi-head {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.lh-kpi-grid-compact .lh-kpi-value {
  margin-top: 0;
}

@media (max-width: 1200px) {
  .lh-kpi-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  }
}

@media (max-width: 720px) {
  .lh-kpi-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .lh-kpi-grid-compact {
    grid-template-columns: 1fr;
  }
}

/* Início: nome em cima do valor, cards com a mesma altura */
.lh-kpi-grid-inicio {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: stretch;
}

/* Fases: cards modernos em uma linha */
.lh-kpi-grid-fases {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  align-items: stretch;
}

.lh-kpi-grid-fases .lh-kpi-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.55rem;
  height: 100%;
  min-height: 5.5rem;
}

.lh-kpi-grid-fases .lh-kpi-head {
  width: 100%;
  justify-content: space-between;
  flex: 0 0 auto;
}

.lh-kpi-grid-fases .lh-kpi-value {
  margin-top: auto;
  font-size: 1.45rem;
}

.lh-kpi-card.is-ok::before { background: #16a34a; }
.lh-kpi-card.is-warn::before { background: #ca8a04; }

@media (max-width: 1100px) {
  .lh-kpi-grid-fases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .lh-kpi-grid-fases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.lh-kpi-grid-inicio .lh-kpi-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.55rem;
  height: 100%;
  min-height: 5.75rem;
}

.lh-kpi-grid-inicio .lh-kpi-head {
  width: 100%;
  justify-content: space-between;
  flex: 0 0 auto;
}

.lh-kpi-grid-inicio .lh-kpi-value,
.lh-kpi-grid-inicio .lh-kpi-dual-values {
  margin-top: auto;
}

.lh-kpi-grid-inicio .lh-kpi-card-dual .lh-kpi-dual-values {
  width: 100%;
  justify-content: space-between;
}

/* Card duplo (Executivo): Entradas + Saídas */
.lh-kpi-card-dual .lh-kpi-dual-values {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
}

.lh-kpi-mini-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lh-text-secondary);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.lh-kpi strong,
.lh-kpi-value {
  display: block;
  margin-top: 0;
  font-size: clamp(1.05rem, 1.15vw + 0.55rem, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lh-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lh-kpi.is-accent strong,
.lh-kpi-card.is-accent .lh-kpi-value { color: var(--lh-accent); }
.lh-kpi.is-money strong,
.lh-kpi-card.is-money .lh-kpi-value { color: var(--lh-success); }
.lh-kpi.is-risk strong,
.lh-kpi-card.is-risk .lh-kpi-value { color: var(--lh-danger); }

.lh-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  overflow: visible;
}

@media (max-width: 960px) {
  .lh-panels { grid-template-columns: 1fr; }
}

.lh-panel h2,
.lh-panel-title {
  margin: 0 0 0.85rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--lh-text);
}

.lh-table-heading {
  margin: 0 0 1rem;
  text-align: center;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: var(--lh-text);
  text-wrap: balance;
}

[data-theme="dark"] .lh-table-heading {
  color: #f1f5f9;
}

.lh-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.lh-data-table thead { background: transparent; }

.lh-data-table th {
  color: #ffffff;
  font-weight: 700;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  background: #00b7c8;
}

[data-theme="dark"] .lh-data-table th {
  background: #0891b2;
  color: #f8fafc;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.lh-data-table td {
  color: var(--lh-text);
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--lh-border);
}

.lh-data-table tbody tr:hover { background: var(--lh-row-hover); }

.lh-data-table a {
  color: var(--lh-accent-hover);
  font-weight: 600;
  text-decoration: none;
}

.lh-data-table a:hover { text-decoration: underline; }

.lh-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.12);
  color: var(--lh-accent-hover);
}

.lh-badge.is-risk {
  background: rgba(220, 38, 38, 0.12);
  color: var(--lh-danger);
}

.lh-badge.is-ok {
  background: rgba(5, 150, 105, 0.12);
  color: var(--lh-success);
}

.lh-meta {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
  font-size: 0.8125rem;
}

.lh-meta dt { color: var(--lh-text-secondary); }
.lh-meta dd { margin: 0; color: var(--lh-text); }

.lh-alert-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: var(--lh-text);
}

.lh-alert-list a {
  color: var(--lh-accent-hover);
  text-decoration: none;
}

.lh-alert-list a:hover { text-decoration: underline; }

.lh-flash {
  list-style: none;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.875rem;
}

.lh-hint {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--lh-text-secondary);
}

.lh-pager {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--lh-text-secondary);
}

.lh-pager a {
  color: var(--lh-accent-hover);
  font-weight: 600;
  text-decoration: none;
}

.lh-chart-wrap {
  position: relative;
  height: 280px;
}

.lh-chart-wrap-lg {
  height: 320px;
}

.lh-chart-wrap-dark {
  height: 280px;
}

/* Card de gráfico (estilo gf-chart-card) */
.gf-chart-card {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  /* visible: tooltips ⓘ não podem ser cortados pelo card */
  overflow: visible;
  position: relative;
  z-index: 1;
}

.gf-chart-card:hover,
.gf-chart-card:focus-within {
  z-index: 30;
}

[data-theme="dark"] .gf-chart-card {
  background: #1f2937;
  border-color: rgba(55, 65, 81, 0.6);
}

.gf-chart-card h3,
.gf-chart-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

.gf-chart-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 5;
}

.gf-chart-title-row h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

[data-theme="dark"] .gf-chart-title-row h2 {
  color: #f1f5f9;
}

.gf-chart-title-row .lh-kpi-info {
  margin-top: 0.05rem;
  z-index: 6;
}

/* Tooltip de informação: abre para a direita/baixo e sobe acima do canvas */
.gf-chart-title-row .lh-kpi-tip,
.lh-panel .lh-kpi-tip {
  left: 0;
  right: auto;
  top: calc(100% + 0.5rem);
  max-width: min(22rem, 70vw);
  z-index: 80;
  white-space: normal;
  line-height: 1.35;
  text-align: left;
}

.gf-chart-title-row .lh-kpi-tip::before,
.lh-panel .lh-kpi-tip::before {
  left: 0.55rem;
  right: auto;
}

[data-theme="dark"] .gf-chart-title {
  color: #f3f4f6;
}

.gf-chart-sub {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: #9ca3af;
}

[data-theme="dark"] .gf-chart-sub {
  color: #94a3b8;
}

.gf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.gf-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #6b7280;
}

[data-theme="dark"] .gf-legend-item {
  color: #cbd5e1;
}

.gf-legend-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.gf-chart-wrap {
  position: relative;
  height: 320px;
  overflow: hidden;
  border-radius: 0.35rem;
  z-index: 0;
}

.gf-chart-wrap-lg {
  height: 420px;
}

.gf-chart-tooltip {
  position: absolute;
  z-index: 20;
  min-width: 9rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  font-size: 0.75rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.gf-chart-tooltip-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.gf-chart-tooltip-row,
.gf-chart-tooltip-total {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.gf-chart-tooltip-row strong,
.gf-chart-tooltip-total strong {
  margin-left: auto;
}

.gf-chart-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  display: inline-block;
}

.lh-chart-caption {
  margin: 0.25rem 0 0.85rem;
  text-align: left;
  font-size: 0.75rem;
  color: #94a3b8;
}

.lh-empresa-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.lh-empresa-tab {
  flex: 1;
  min-width: 8rem;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 0.25rem;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: #deebf7;
  color: #111827;
}

.lh-empresa-tab:nth-child(odd) { background: #facc15; }
.lh-empresa-tab.is-active {
  outline: 2px solid #0ea5e9;
  outline-offset: 1px;
}

.lh-empresa-panel.is-hidden { display: none; }

.lh-fase-table thead th {
  background: #00b7c8;
  color: #ffffff;
}

.lh-fase-head th {
  background: #00b7c8 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .lh-fase-table thead th,
[data-theme="dark"] .lh-fase-head th {
  background: #0891b2 !important;
  color: #f8fafc !important;
}

.mb-4 { margin-bottom: 1rem; }

.lh-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .lh-detail-grid { grid-template-columns: 1fr; }
}

.lh-detail-hero {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.35rem;
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] .lh-detail-hero {
  background: #1f2937;
  border-color: rgba(55, 65, 81, 0.6);
}

.lh-detail-hero h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lh-text);
  word-break: break-word;
}

.lh-detail-meta-line {
  margin: 0;
  font-size: 0.875rem;
  color: var(--lh-text-secondary);
}

.lh-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.lh-detail-hero-values {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 12rem;
}

.lh-detail-value-box {
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.lh-detail-value-box.is-muted {
  background: var(--lh-surface-muted);
  border-color: var(--lh-border);
}

.lh-detail-value-box span {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lh-text-secondary);
}

.lh-detail-value-box strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lh-text);
}

.lh-meta-tight {
  margin-top: 0.85rem;
}

.lh-finance-stack {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lh-finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  background: var(--lh-surface-muted);
  font-size: 0.8125rem;
}

.lh-finance-row span { color: var(--lh-text-secondary); }
.lh-finance-row strong { color: var(--lh-text); }

.lh-partes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.lh-parte-card {
  padding: 0.7rem 0.85rem;
  border-radius: 0.55rem;
  background: var(--lh-surface-muted);
  border: 1px solid var(--lh-border);
}

.lh-parte-tipo {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lh-text-secondary);
  margin-bottom: 0.2rem;
}

.lh-alert-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lh-alert-card {
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: 0.55rem;
  border: 1px solid var(--lh-border);
  background: var(--lh-surface-muted);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lh-alert-card:hover {
  border-color: #fca5a5;
  background: #fef2f2;
}

[data-theme="dark"] .lh-alert-card:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
}

.lh-alert-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.lh-alert-num {
  font-size: 0.8125rem;
  color: var(--lh-text);
  word-break: break-all;
}

.lh-alert-valor {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--lh-danger);
  white-space: nowrap;
}

.lh-alert-autor {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
  color: var(--lh-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .lh-detail-hero {
    flex-direction: column;
  }
  .lh-detail-hero-values {
    min-width: 0;
  }
}

.lh-page-meta {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  color: var(--lh-text-secondary);
}

.lh-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.lh-section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--lh-text);
}

.lh-eyebrow {
  font-size: 0.75rem;
  color: var(--lh-text-secondary);
  margin: 0 0 0.25rem;
}

.lh-eyebrow a {
  color: var(--lh-accent-hover);
  text-decoration: none;
  font-weight: 600;
}

/* Auth (padrão GCS split) */
body.auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #0f172a;
  background: #f8fafc;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .auth-shell { flex-direction: row; }
}

.auth-brand-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #0c4a6e 0%, #0369a1 45%, #0ea5e9 100%);
  color: #fff;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

@media (min-width: 1024px) {
  .auth-brand-panel {
    width: 44%;
    min-height: 100vh;
    padding: 3rem;
  }
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.12) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.auth-brand-content { position: relative; z-index: 1; max-width: 22rem; }

.auth-logo-wrap {
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 1.5rem;
  border-radius: 1.25rem;
  background: #fff;
  padding: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.auth-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

@media (min-width: 640px) {
  .auth-card { padding: 2.5rem 2.25rem; }
}

.auth-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}

.auth-btn-google:hover {
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.2);
}

.auth-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 0.5rem;
  background: #0ea5e9;
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.auth-btn-primary:hover { background: #0284c7; }

.auth-alert {
  border-radius: 0.5rem;
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.auth-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.auth-alert-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-stack { display: grid; gap: 0.75rem; }
.auth-stack label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.auth-stack input {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  font: inherit;
}

/* Admin usuarios / auditoria */
.lh-admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.lh-presence {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.lh-presence-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.lh-presence-online { color: #15803d; }
.lh-presence-online .lh-presence-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.lh-presence-away { color: #a16207; }
.lh-presence-away .lh-presence-dot {
  background: #eab308;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.25);
}

.lh-presence-offline { color: #b91c1c; }
.lh-presence-offline .lh-presence-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.lh-action-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lh-icon-action {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lh-icon-action svg {
  width: 1rem;
  height: 1rem;
}

.lh-icon-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.lh-icon-action.is-ok { color: #059669; }
.lh-icon-action.is-warn { color: #ca8a04; }
.lh-icon-action.is-danger { color: #dc2626; }
.lh-icon-action.is-danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

.lh-modal-dialog {
  border: none;
  border-radius: 0.85rem;
  padding: 0;
  max-width: 26rem;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}

.lh-modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.lh-modal-card {
  display: flex;
  flex-direction: column;
  background: #fff;
}

.lh-modal-card__head,
.lh-modal-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
}

.lh-modal-card__head {
  border-bottom: 1px solid #e2e8f0;
}

.lh-modal-card__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.lh-modal-card__body {
  padding: 1rem 1.1rem;
}

.lh-modal-card__foot {
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end;
}

.lh-audit-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.lh-audit-filters .lh-filter-label {
  min-width: 11rem;
  flex: 1 1 11rem;
}

.lh-audit-detail {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: #64748b;
}

.lh-audit-path {
  font-size: 0.72rem;
  color: #475569;
  word-break: break-all;
}
