:root {
  --lh-bg: #f8fafc;
  --lh-surface: #ffffff;
  --lh-surface-muted: #f1f5f9;
  --lh-border: #e2e8f0;
  --lh-text: #0f172a;
  --lh-text-secondary: #64748b;
  --lh-nav-bg: #E6511F;
  --lh-accent: #E6511F;
  --lh-accent-hover: #F25C27;
  --lh-accent-soft: #fff1ec;
  --lh-row-hover: #f8fafc;
  --lh-success: #059669;
  --lh-danger: #dc2626;
  --lh-warn: #d97706;
}

[data-theme="dark"] {
  --lh-bg: #0b1329;
  --lh-surface: #131f37;
  --lh-surface-muted: #1e2d4a;
  --lh-border: #223454;
  --lh-text: #f1f5f9;
  --lh-text-secondary: #94a3b8;
  --lh-nav-bg: #9a3412;
  --lh-accent: #F25C27;
  --lh-accent-hover: #fb923c;
  --lh-accent-soft: rgba(242, 92, 39, 0.18);
  --lh-row-hover: #1c2b45;
}

[data-theme="dark"] select,
[data-theme="dark"] option {
  background-color: #131f37;
  color: #f1f5f9;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: #131f37;
  border-color: #223454;
  color: #f1f5f9;
}

* { 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;
}

h1, h2, h3, .lh-wordmark, .lh-table-heading, .gf-chart-title, .lh-topbar-title {
  font-family: Montserrat, Inter, system-ui, sans-serif;
}

/* Layout com sidebar */
.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: auto;
  max-width: 11.5rem;
  height: 2.75rem;
  margin: 0 auto 0.55rem;
  object-fit: contain;
}

.lh-wordmark {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #E6511F;
  text-transform: lowercase;
}

.lh-wordmark-lg { font-size: 1.95rem; margin: 0.35rem 0 0; }

.lh-wordmark-legal,
.lh-wordmark-hub { color: #E6511F; }

[data-theme="dark"] .lh-wordmark,
[data-theme="dark"] .lh-wordmark-legal,
[data-theme="dark"] .lh-wordmark-hub { color: #fb923c; }

.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-brand-panel .lh-wordmark,
.auth-brand-panel .lh-wordmark-legal,
.auth-brand-panel .lh-wordmark-hub { color: #ffffff; }

.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: #94a3b8;
}

.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: var(--lh-accent-soft);
  color: #c2410c;
}

[data-theme="dark"] .lh-side-link.is-active { color: #fdba74; }

.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: 700; 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: var(--lh-accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; 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%; }
@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; }

/* Painéis e cartões */
.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); }

.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: 700; color: var(--lh-text); }

/* Filtros — wrap sem scroll horizontal */
.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;
  overflow: visible;
  position: relative;
  z-index: 20;
}
.lh-filter-inline {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.45rem 0.5rem; width: 100%; overflow: visible;
}
.lh-filter-inline .lh-input {
  flex: 1 1 8.5rem; min-width: 7rem; max-width: 16rem; width: auto; height: 2.1rem;
  font-size: 0.8125rem; padding: 0.3rem 0.5rem;
}
.lh-filter-search {
  flex: 1 1 12rem !important; min-width: 10rem !important; max-width: 18rem !important; width: auto !important;
}
.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: var(--lh-accent);
  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: var(--lh-accent); background: var(--lh-accent-soft); color: var(--lh-accent-hover); outline: none;
}
.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-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; }

/* Overlay global de carregamento */
.lh-loading {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}
.lh-loading[hidden] { display: none !important; }
.lh-loading__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(1.5px);
}
.lh-loading__box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem 1.5rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(230, 81, 31, 0.22);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
  min-width: 9.5rem;
}
[data-theme="dark"] .lh-loading__box {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(242, 92, 39, 0.35);
}
.lh-loading__spinner {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 3px solid rgba(230, 81, 31, 0.2);
  border-top-color: var(--lh-accent, #E6511F);
  border-right-color: var(--lh-accent-hover, #F25C27);
  animation: lh-spin 0.75s linear infinite;
}
.lh-loading__text {
  margin: 0;
  font-family: Montserrat, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--lh-accent, #E6511F);
}
@keyframes lh-spin {
  to { transform: rotate(360deg); }
}

.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(230, 81, 31, 0.15); }

/* Autocomplete Unidade (mesmo visual do campo Colaborador) */
.lh-ac {
  position: relative;
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 18rem;
  z-index: 30;
}
.lh-ac__input {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: none !important;
}
.lh-ac__drop {
  position: fixed;
  z-index: 9999;
  background: var(--lh-surface);
  border: 1px solid var(--lh-border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  padding: 0.35rem;
  max-height: min(18rem, 50vh);
  display: flex;
  flex-direction: column;
}
.lh-ac__drop[hidden] { display: none !important; }
.lh-ac__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(16rem, 46vh);
  overflow: auto;
}
.lh-ac__option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--lh-text);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.42rem 0.55rem;
  border-radius: 0.35rem;
  cursor: pointer;
}
.lh-ac__option:hover,
.lh-ac__option.is-active {
  background: var(--lh-accent-soft, rgba(230, 81, 31, 0.12));
  color: var(--lh-accent);
}
.lh-ac__option.is-selected { font-weight: 700; color: var(--lh-accent); }
.lh-ac__empty {
  margin: 0;
  padding: 0.55rem 0.4rem;
  font-size: 0.78rem;
  color: var(--lh-text-secondary);
  text-align: center;
}

.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); }

/* KPIs */
.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-card {
  background: var(--lh-surface); border: 1px solid var(--lh-border); 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 { display: inline-flex; align-items: center; white-space: nowrap; }

.lh-kpi-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lh-accent);
}
.lh-kpi-card.is-accent::before { background: var(--lh-accent-hover); }
.lh-kpi-card.is-money::before { background: #059669; }
.lh-kpi-card.is-risk::before { background: #dc2626; }
.lh-kpi-card.is-ok::before { background: #16a34a; }
.lh-kpi-card.is-warn::before { background: #ca8a04; }

.lh-kpi-label {
  display: block; flex: 1; min-width: 0; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--lh-text-secondary);
  line-height: 1.3; padding-right: 0.15rem;
}

.lh-kpi-value {
  display: block; margin-top: auto;
  font-size: clamp(1.15rem, 1.15vw + 0.55rem, 1.5rem);
  font-weight: 800; letter-spacing: -0.02em; color: var(--lh-text); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lh-kpi-card.is-accent .lh-kpi-value { color: var(--lh-accent); }
.lh-kpi-card.is-money .lh-kpi-value { color: var(--lh-success); }
.lh-kpi-card.is-risk .lh-kpi-value { color: var(--lh-danger); }

.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: column; align-items: stretch; justify-content: flex-start;
  gap: 0.55rem; min-height: 5.25rem; height: 100%; width: 100%; padding: 0.9rem 1rem;
}
.lh-kpi-grid-compact .lh-kpi-head { margin: 0; width: 100%; flex: 0 0 auto; }
.lh-kpi-grid-compact .lh-kpi-value { margin-top: auto; }
@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; } }

.lh-kpi-grid-inicio { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: stretch; }
.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 { margin-top: auto; }

/* KPI info tooltip */
.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: var(--lh-accent-hover); background: var(--lh-accent-soft); 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;
  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-info:hover .lh-kpi-tip, .lh-kpi-info:focus-visible .lh-kpi-tip { opacity: 1; visibility: visible; transform: translateY(0); }

/* Cartão de gráfico */
.gf-chart-card {
  background: var(--lh-surface); border: 1px solid var(--lh-border); border-radius: 0.75rem;
  padding: 1.15rem 1.25rem; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  overflow: visible; position: relative; z-index: 1;
}
.gf-chart-card:hover, .gf-chart-card:focus-within { z-index: 30; }
.gf-chart-title { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--lh-text); letter-spacing: -0.01em; }
.gf-chart-sub { margin: 0.2rem 0 0; font-size: 0.72rem; color: var(--lh-text-secondary); }

.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: var(--lh-text-secondary); }
.gf-legend-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; display: inline-block; }

.gf-chart-wrap { position: relative; height: 300px; overflow: hidden; border-radius: 0.35rem; z-index: 0; }
.gf-chart-wrap-lg { height: 400px; }

/* Tabelas */
.lh-table-heading {
  margin: 0 0 1rem; text-align: left; font-size: 1.05rem; font-weight: 700;
  letter-spacing: 0.01em; line-height: 1.35; color: var(--lh-text);
}
.lh-data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.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: var(--lh-accent);
}
[data-theme="dark"] .lh-data-table th { background: #182845; color: #f1f5f9; border-bottom: 2px solid #223454; }
.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: var(--lh-accent-soft); 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-badge.is-warn { background: rgba(217, 119, 6, 0.14); color: var(--lh-warn); }

.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, .lh-pager .lh-btn-ghost { color: var(--lh-accent-hover); font-weight: 600; text-decoration: none; }

.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;
}

.overflow-x-auto { overflow-x: auto; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.flex { display: flex; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

/* 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 var(--lh-border);
  background: var(--lh-surface); 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: var(--lh-surface-muted); 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; }
[data-theme="dark"] .lh-icon-action { color: #cbd5e1; }

.lh-filter-label { display: grid; gap: 0.3rem; font-size: 0.8125rem; font-weight: 600; color: var(--lh-text-secondary); }

.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: var(--lh-surface); }
.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 var(--lh-border); }
.lh-modal-card__head h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--lh-text); }
.lh-modal-card__body { padding: 1rem 1.1rem; }
.lh-modal-card__foot { border-top: 1px solid var(--lh-border); justify-content: flex-end; }
.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); }

.auth-stack { display: grid; gap: 0.75rem; }
.auth-stack label { display: grid; gap: 0.3rem; font-size: 0.8125rem; font-weight: 600; color: var(--lh-text-secondary); }
.auth-stack input, .auth-stack select {
  border: 1px solid var(--lh-border); border-radius: 0.5rem; padding: 0.65rem 0.75rem; font: inherit;
  background: var(--lh-surface); color: var(--lh-text);
}

.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; }

/* Export modal (overlay) */
.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-size: 1rem; font-weight: 700; color: var(--lh-text); }
.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: var(--lh-accent); background: var(--lh-accent-soft); 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: var(--lh-accent); color: #fff; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; }
.lh-export-option__badge.is-pdf { background: #0f172a; }
.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); }

/* Horas extras — Detalhamento (accordion por unidade) */
.lh-ot-groups { display: grid; gap: 0.6rem; }
.lh-ot-empty { margin: 0; font-size: 0.8125rem; color: var(--lh-text-secondary); }
.lh-ot-group { border: 1px solid var(--lh-border); border-radius: 0.6rem; overflow: hidden; background: var(--lh-surface); }
.lh-ot-group__head {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left;
  padding: 0.75rem 0.9rem; border: none; background: var(--lh-surface-muted, var(--lh-surface));
  cursor: pointer; font: inherit; color: var(--lh-text); transition: background 0.15s ease;
}
.lh-ot-group__head:hover { background: var(--lh-row-hover); }
.lh-ot-group__chevron {
  flex: 0 0 auto; width: 0; height: 0; border-left: 6px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  color: var(--lh-accent); transition: transform 0.15s ease;
}
.lh-ot-group.is-open .lh-ot-group__chevron { transform: rotate(90deg); }
.lh-ot-group__name { font-weight: 700; flex: 1 1 auto; }
.lh-ot-group__meta { flex: 0 0 auto; font-size: 0.75rem; color: var(--lh-text-secondary); white-space: nowrap; }
.lh-ot-group__body { padding: 0.35rem 0.9rem 0.75rem; border-top: 1px solid var(--lh-border); }

.lh-link-btn {
  border: none; background: transparent; padding: 0; cursor: pointer; font: inherit;
  color: var(--lh-accent-hover); font-weight: 600; text-decoration: none; text-align: left;
}
.lh-link-btn:hover { text-decoration: underline; }

.lh-folha-actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
}

/* Modal amplo (detalhamento diário) */
.lh-modal--wide { padding: 1.25rem; }
.lh-modal__dialog--wide { width: min(1100px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.lh-modal__body--scroll { overflow-y: auto; overflow-x: hidden; }
.lh-modal__subtitle { margin: 0.15rem 0 0; font-size: 0.75rem; color: var(--lh-text-secondary); }
.lh-ot-modal-state { padding: 1.5rem 0.5rem; text-align: center; font-size: 0.875rem; color: var(--lh-text-secondary); }
.lh-ot-modal-state.is-error { color: var(--lh-danger); }
.lh-ot-modal-table { min-width: 640px; }
.lh-ot-punches { line-height: 1.9; }
.lh-ot-punch {
  display: inline-block; padding: 0.05rem 0.35rem; margin: 0.05rem; border-radius: 0.3rem;
  background: var(--lh-surface-muted, rgba(148,163,184,0.15)); font-variant-numeric: tabular-nums; font-size: 0.75rem;
}

/* Modal do colaborador — abas + KPIs por aba */
.lh-tabs { display: flex; gap: 0.25rem; padding: 0 1.25rem; border-bottom: 1px solid var(--lh-border); flex-wrap: wrap; }
.lh-tab {
  appearance: none; border: none; background: transparent; cursor: pointer; font: inherit; font-weight: 600;
  color: var(--lh-text-secondary); padding: 0.65rem 0.9rem; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color 0.15s ease, border-color 0.15s ease;
}
.lh-tab:hover { color: var(--lh-text); }
.lh-tab.is-active { color: var(--lh-accent); border-bottom-color: var(--lh-accent); }
.lh-emp-pane[hidden] { display: none !important; }
.lh-emp-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.6rem; margin-bottom: 1rem;
}
.lh-emp-kpi {
  border: 1px solid var(--lh-border); border-radius: 0.55rem; padding: 0.6rem 0.75rem;
  background: var(--lh-surface); display: flex; flex-direction: column; gap: 0.2rem;
}
.lh-emp-kpi__label { font-size: 0.72rem; font-weight: 600; color: var(--lh-text-secondary); }
.lh-emp-kpi__value { font-size: 1.15rem; font-weight: 800; color: var(--lh-text); font-variant-numeric: tabular-nums; }
.lh-emp-kpi.is-money .lh-emp-kpi__value { color: var(--lh-accent); }
.lh-emp-kpi.is-risk .lh-emp-kpi__value { color: var(--lh-danger, #dc2626); }
.lh-emp-kpi.is-warn .lh-emp-kpi__value { color: #b45309; }

/* Auth (split) */
body.auth-body { margin: 0; min-height: 100vh; font-family: Inter, system-ui, "Segoe UI", 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, #7c2d12 0%, #E6511F 50%, #F25C27 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.14) 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: min(100%, 14rem); height: auto; min-height: 4.5rem; margin: 0 auto 1.5rem; border-radius: 1rem; background: #fff;
  padding: 1rem 1.25rem; 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%; max-width: 12rem; height: auto; max-height: 3.5rem; 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: var(--lh-accent); color: #fff;
  font-weight: 600; font-size: 0.9375rem; text-decoration: none; border: none; cursor: pointer;
}
.auth-btn-primary:hover { background: var(--lh-accent-hover); }
.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; }

.text-center { text-align: center; }
.text-2xl { font-size: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.text-slate-900 { color: #0f172a; }
.text-slate-500 { color: #64748b; }
.mt-2 { margin-top: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.leading-relaxed { line-height: 1.625; }
.hidden { display: none; }
.inline { display: inline; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
