/* ==========================================================================
   LECASU, LDA. - Sistema Financeiro ERP
   Folha de Estilos Principal (style.css)
   Conforme especificações idv.md & agentes.md
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* ==========================================================================
     Backgrounds & Superfícies (Identidade Oficial LECASU)
     ========================================================================== */
  --bg-app: #f4f6f9;              /* Fundo geral da aplicação */
  --bg-surface-1: #ffffff;        /* Cards, tabelas, containers e painéis */
  --bg-surface-2: #f8fafc;        /* Inputs, subcards, painéis secundários */
  --bg-surface-hover: #f1f5f9;    /* Estados de hover em tabelas e listas */

  /* Aliases para compatibilidade total com o código existente */
  --bg: var(--bg-app);
  --cd: var(--bg-surface-1);

  /* ==========================================================================
     Bordas & Linhas Divisórias
     ========================================================================== */
  --border-subtle: #e2e8f0;       /* Divisórias padrão e tabelas */
  --border-medium: #cbd5e1;       /* Bordas de maior contraste em controlos */
  --border-glow: rgba(254, 129, 0, 0.35); /* Borda de destaque / foco laranja */
  --bd: var(--border-subtle);

  /* ==========================================================================
     Tipografia & Contraste
     ========================================================================== */
  --text-primary: #18202f;        /* Preto Grafite de alto contraste */
  --text-secondary: #475569;      /* Textos complementares e rótulos */
  --text-muted: #64748b;          /* Textos atenuados, legendas e notas */
  --text-inverse: #ffffff;        /* Texto branco sobre botões/cabeçalhos */
  --tx: var(--text-primary);
  --mu: var(--text-muted);

  /* ==========================================================================
     Cores de Marca & Acentos Oficiais LECASU
     ========================================================================== */
  --accent-primary: #fe8100;        /* Laranja Oficial LECASU (Energia & Engenharia) */
  --accent-primary-hover: #e57400;  /* Laranja escuro para hover/clique */
  --accent-glow: #fe8100;
  --accent-gradient: linear-gradient(135deg, #fe8100 0%, #ff9f38 100%);
  --accent-subtle: #fff3e6;         /* Laranja suave para fundos e seleções */
  --accent-subtle-border: #fed7aa;  /* Borda laranja suave */
  --ac: var(--accent-primary);
  --ach: var(--accent-primary-hover);
  --ab: var(--accent-subtle);
  --abb: var(--accent-subtle-border);

  /* ==========================================================================
     Feedback & Status
     ========================================================================== */
  --feedback-success: #12b76a;
  --feedback-success-bg: #ecfdf3;
  --feedback-warning: #f79009;
  --feedback-warning-bg: #fffaeb;
  --feedback-danger: #b42318;       /* Vermelho Restrito LECASU */
  --feedback-danger-bg: #fde7e4;
  --feedback-info: #0ba5ec;
  --feedback-info-bg: #f0f9ff;

  --ok: var(--accent-primary);
  --okb: var(--accent-subtle);
  --wa: var(--feedback-warning);
  --wab: #ffedd5;
  --er: var(--feedback-danger);
  --erb: var(--feedback-danger-bg);
  --in: #334155;
  --inb: #f1f5f9;

  /* ==========================================================================
     Espaçamento & Grid (Escala Base 4px / 8px do idv.md)
     ========================================================================== */
  --space-1: 0.25rem;   /* 4px  - Micro espaçamento, tags */
  --space-2: 0.5rem;    /* 8px  - Gaps internos de botões e ícones */
  --space-3: 0.75rem;   /* 12px - Padding de inputs e badges */
  --space-4: 1rem;      /* 16px - Padding de cartões compactos e KPIs */
  --space-5: 1.25rem;   /* 20px - Gaps médios e padding de containers */
  --space-6: 1.5rem;    /* 24px - Padding de containers e modais */
  --space-8: 2rem;      /* 32px - Gaps entre grupos de blocos e páginas */
  --space-10: 2.5rem;   /* 40px - Separação vertical moderada */
  --space-12: 3rem;     /* 48px - Margem entre seções secundárias */
  --space-16: 4rem;     /* 64px - Margem entre seções principais */

  /* ==========================================================================
     Raios de Borda (Border Radius do idv.md)
     ========================================================================== */
  --radius-xs: 4px;     /* Tags diminutas, tooltips */
  --radius-sm: 6px;     /* Badges, caixas de seleção, botões pequenos */
  --radius-md: 10px;    /* Inputs, dropdowns, botões regulares */
  --radius-lg: 16px;    /* Cards padrão, tabelas, containers */
  --radius-xl: 24px;    /* Modais, cards hero, caixas de diálogo */
  --radius-full: 9999px;/* Pílulas, chips e botões arredondados */

  /* ==========================================================================
     Sombras & Iluminação (Elevation & Glow para Sistema Administrativo)
     ========================================================================== */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
  --glow-button: 0 2px 10px rgba(254, 129, 0, 0.28);
  --glow-card: 0 4px 20px rgba(254, 129, 0, 0.08);
  --glow-ambient: 0 8px 30px rgba(254, 129, 0, 0.05);

  /* ==========================================================================
     Tipografia (Font Families & Sizes do idv.md adaptado para ERP)
     ========================================================================== */
  --font-family-base: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "JetBrains Mono", "Fira Code", monospace;

  --text-display: 2.25rem;    /* 36px - Valores numéricos de destaque do topo */
  --text-h1: 1.75rem;         /* 28px - Título de página ou módulo mestre */
  --text-h2: 1.35rem;         /* 22px - Cabeçalho de seções e subdivisões */
  --text-h3: 1.15rem;         /* 18px - Títulos de cartões, modais e agrupamentos */
  --text-body: 0.9375rem;     /* 15px - Texto corrido, notas e parágrafos */
  --text-body-sm: 0.84375rem; /* 13.5px - Tabelas, inputs, formulários, navegação */
  --text-caption: 0.75rem;    /* 12px - Badges, tags de estado, legendas */

  --leading-tight: 1.15;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  color-scheme: light;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

/* Prevenção de salto de layout ("movimento estranho") e rolagem desnecessária */
html {
  scrollbar-gutter: stable;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-family-base);
  font-size: var(--text-body-sm);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, kbd, samp, pre {
  font-family: var(--font-family-mono);
}

/* Diálogos modais nativos quando fechados nunca ocupam espaço no fluxo */
dialog:not([open]) {
  display: none !important;
}

/* Layout Geral & Sidebar */
.app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

aside {
  width: 256px;
  flex: none;
  background: #ffffff;
  border-right: 1px solid var(--bd);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  box-sizing: border-box;
  z-index: 60;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Transição animada apenas quando acionada intencionalmente pelo botão toggle */
aside.animating {
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease;
}

.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  position: relative;
  min-height: 40px;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.brand-logo-img {
  display: block;
  max-height: 38px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
}

.brand-icon-img {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: contain;
}

.brand-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.sidebar-toggle {
  background: none;
  border: 1px solid transparent;
  color: var(--mu);
  cursor: pointer;
  border-radius: 8px;
  padding: 6px;
  display: grid;
  place-items: center;
  transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--bg);
  border-color: var(--bd);
  color: var(--tx);
}

/* Sidebar no modo Recolhido */
aside.collapsed {
  width: 72px;
  padding: 20px 10px;
}

aside.collapsed .brand-text {
  display: none;
}

aside.collapsed .brand {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0;
  position: static;
}

aside.collapsed .brand-link {
  justify-content: center;
  width: 100%;
}

aside.collapsed .brand-logo-img {
  display: none !important;
}

aside.collapsed .brand-icon-img {
  display: block !important;
  margin: 0 auto;
}

aside.collapsed .logo {
  margin: 0 auto;
}

aside.collapsed .sidebar-toggle {
  position: static;
  transform: none;
  background: var(--bg);
  border: 1px solid var(--bd);
  box-shadow: none;
  border-radius: 8px;
  padding: 6px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin: 0 auto;
}

aside.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

aside.collapsed #nav a {
  justify-content: center;
  padding: 12px 0;
}

aside.collapsed #nav a span {
  display: none;
}

aside.collapsed .sbf {
  align-items: center;
}

aside.collapsed .sbf .btn-text {
  display: none;
}

aside.collapsed .sbf .btn-sec,
aside.collapsed .sbf #rst {
  padding: 8px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.brand b {
  display: block;
  font-size: 15px;
}

.brand small,
.sbf small {
  color: var(--mu);
  font-size: 12px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ac);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}

#nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#nav button,
#nav a {
  display: flex;
  gap: 11px;
  align-items: center;
  width: 100%;
  border: 0;
  background: none;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--mu);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

#nav button:hover,
#nav a:hover {
  background: var(--bg);
  color: var(--tx);
}

#nav button.on,
#nav a.on {
  background: var(--ab);
  color: var(--ac);
}

.sbf {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sbf button {
  border: 1px solid var(--bd);
  background: #ffffff;
  border-radius: 9px;
  padding: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--mu);
  transition: background 0.15s, border-color 0.15s;
}

.sbf button:hover {
  background: var(--bg);
  border-color: #cbd5e1;
}

/* ==========================================================================
   Área Principal com Header Fixo e Alinhamento de Largura
   ========================================================================== */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Header Fixo */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--bd);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  width: 100%;
  flex-shrink: 0;
}

.header-container {
  width: 100%;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

.header-info h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.3px;
  font-weight: 700;
  color: var(--tx);
}

.header-info p {
  margin: 3px 0 0;
  color: var(--mu);
  font-size: 13px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botão de Importação Excel */
.btn-excel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #107c41;
  color: #ffffff;
  border: 1px solid #0b6a36;
  border-radius: 9px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.1s ease, filter 0.1s ease;
}

.btn-excel:hover {
  background: #0d6535;
  filter: brightness(1.05);
  box-shadow: 0 2px 6px rgba(16, 124, 65, 0.25);
}

.btn-excel svg {
  color: #ffffff;
}

/* Widgets do Header: Relógio, Tempo e Notificações */
.header-clock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  font-variant-numeric: tabular-nums;
}

.header-clock svg {
  color: var(--ac);
}

.header-weather {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
}

.weather-icon {
  font-size: 15px;
}

.weather-loc {
  font-size: 11.5px;
  color: var(--mu);
  font-weight: 500;
  border-left: 1px solid var(--bd);
  padding-left: 6px;
  margin-left: 2px;
}

.header-notif-wrapper {
  position: relative;
}

.header-icon-btn {
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 9px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--tx);
  cursor: pointer;
  position: relative;
  transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.header-icon-btn:hover {
  background: var(--ab);
  border-color: var(--ac);
  color: var(--ac);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--er);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  border: 2px solid #ffffff;
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  background: #ffffff;
  border: 1px solid var(--bd);
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
  display: none;
  flex-direction: column;
  z-index: 100;
}

.notif-dropdown.show {
  display: flex;
}

.notif-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--bd);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.notif-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
}

.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f3f7;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--bg);
}

.notif-item b {
  display: block;
  font-size: 12.5px;
  margin-bottom: 2px;
  color: var(--tx);
}

.notif-item p {
  margin: 0;
  font-size: 12px;
  color: var(--mu);
}

/* Conteúdo Principal em Largura Total (Full Width) */
.content-container {
  width: 100%;
  flex: 1;
  display: flex;
}

.cont {
  width: 100%;
  padding: 24px 32px 32px;
  box-sizing: border-box;
  flex: 1;
}

/* Linha Unificada de Abas e Botões de Ação (Módulo Financeiro) */
.tabs-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  flex-wrap: nowrap;
  width: 100%;
}

.tabs-bar-row .pills {
  margin: 0;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs-bar-row .pills::-webkit-scrollbar {
  display: none;
}

.tabs-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
  flex-shrink: 0;
  white-space: nowrap;
}

.tabs-actions .tab-action-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  flex-shrink: 0;
}

.tabs-actions input[type="date"],
.tabs-actions input[type="search"],
.tabs-actions input[type="text"] {
  height: 38px;
  box-sizing: border-box;
  padding: 6px 12px;
  font-size: var(--text-caption);
  border: 1px solid var(--bd);
  border-radius: var(--radius-md);
  background: var(--cd);
  color: var(--tx);
  font-family: inherit;
}

.tabs-actions input[type="search"],
.tabs-actions input[type="text"] {
  width: 240px;
  min-width: 180px;
  max-width: 280px;
  flex-shrink: 0;
}

.tabs-actions button.p {
  height: 38px;
  padding: 0 var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-caption);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Abas de Navegação (Pills) */
.pills {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 0 20px;
  padding: 4px;
  background: #e8ecf2;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
}

.pills button {
  border: 0;
  background: none;
  padding: 8px 14px;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  color: var(--mu);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.pills button:hover {
  color: var(--tx);
}

.pills button.on {
  background: #ffffff;
  color: var(--ac);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  margin: var(--space-6) 0 var(--space-2);
  color: var(--text-primary);
}

h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
}

.bar {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  margin: var(--space-2) 0 var(--space-4);
  width: 100%;
}

.filters-wrap {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.filters-wrap::-webkit-scrollbar {
  display: none;
}

.filters-wrap .btn-sec {
  flex-shrink: 0;
  white-space: nowrap;
}

.bar-search-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.bar-search-actions input[type="search"] {
  height: 38px;
  width: 240px;
  min-width: 180px;
  max-width: 280px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.bar-search-actions button {
  flex-shrink: 0;
  white-space: nowrap;
}

.bar .sp {
  flex: 1;
}

/* ==========================================================================
   Cards & KPIs
   ========================================================================== */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-1);
  margin-bottom: var(--space-4);
}

.k,
.cd,
.sc,
.card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.k {
  padding: 12px 14px;
  border-top: 3px solid var(--accent-primary);
}

.k span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
}

.k b {
  display: block;
  font-size: 1.125rem;
  margin-top: 2px;
  font-weight: var(--weight-extrabold);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.k small {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.k.ok { border-top-color: var(--ok); }
.k.er { border-top-color: var(--er); }
.k.wa { border-top-color: var(--wa); }
.k.in { border-top-color: var(--in); }

.cd {
  padding: 16px 20px;
}

.card-highlight {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--glow-card);
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* Barras de Progresso e Distribuição */
.br {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 9px 0;
  font-size: 13px;
}

.br i {
  height: 10px;
  background: #eef1f5;
  border-radius: 99px;
  overflow: hidden;
  display: block;
}

.br u {
  display: block;
  height: 100%;
  border-radius: 99px;
}

.br b {
  font-variant-numeric: tabular-nums;
}

.ln {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--bd);
}

.ln:last-child {
  border: 0;
}

/* ==========================================================================
   Tabelas com Linhas Verticais e Horizontais Obrigatórias (Conforme idv.md)
   ========================================================================== */
.sc {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-1);
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle); /* LINHAS VERTICAIS MANDATÓRIAS */
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

/* A última coluna de cada linha não tem borda direita externa */
th:last-child,
td:last-child {
  border-right: none;
}

/* A última linha não tem borda inferior interna */
tr:last-child td {
  border-bottom: none;
}

th {
  font-family: var(--font-family-base);
  font-size: var(--text-caption);
  letter-spacing: 0.03em;
  color: var(--text-inverse);
  background: var(--accent-primary); /* Cor oficial da LECASU no header das tabelas */
  text-transform: uppercase;
  font-weight: var(--weight-bold);
  border-bottom: 2px solid var(--accent-primary-hover);
  border-right: 1px solid #ff9d33;
  padding: var(--space-2) var(--space-3);
}

.sc th {
  position: sticky;
  top: 0;
  z-index: 8;
}

th:last-child {
  border-right: none;
}

td.w {
  white-space: normal;
  min-width: 220px;
}

td.n,
th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-family-mono);
}

/* Coluna de Ações Fixa na Rolagem Horizontal */
th.col-actions,
td.col-actions,
th.ac,
td.ac {
  position: sticky !important;
  right: 0 !important;
  z-index: 5;
  background: var(--cd);
  box-shadow: -3px 0 6px rgba(15, 23, 42, 0.08);
  border-left: 1px solid var(--bd) !important;
  white-space: nowrap;
}

th.col-actions,
th.ac {
  background: var(--ac) !important;
  color: #ffffff !important;
  z-index: 12;
  border-left: 1px solid #ff9d33 !important;
}

.sc th.col-actions,
.sc th.ac {
  position: sticky !important;
  top: 0 !important;
  right: 0 !important;
  z-index: 15 !important;
}

tr.t td.col-actions,
tr.t td.ac {
  background: #f8f9fb !important;
}

tr:hover td.col-actions,
tr:hover td.ac {
  background: #f1f5f9 !important;
}

.actions-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Grelha de Reconciliação Bancária Lado a Lado */
.recon-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 10px 0 14px;
}

@media (max-width: 960px) {
  .recon-compare-grid {
    grid-template-columns: 1fr;
  }
}

.recon-side-box {
  display: flex;
  flex-direction: column;
}

.recon-side-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f1f5f9;
  border: 1px solid var(--bd);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  font-size: 13px;
  color: var(--tx);
}

.recon-side-box .sc {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  height: 100%;
}

.recon-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--bd);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.recon-summary-card.recon-ok {
  background: #fff8f0;
  border-color: #fed7aa;
}

.recon-summary-card.recon-er {
  background: #fef2f2;
  border-color: #fecaca;
}

.recon-summary-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recon-status-badge {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 6px;
}

.recon-status-badge.ok {
  background: var(--okb);
  color: var(--ok);
}

.recon-status-badge.er {
  background: var(--erb);
  color: var(--er);
}

.recon-summary-values {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--tx);
  flex-wrap: wrap;
}

.recon-equal-sign {
  font-weight: 800;
  color: var(--ac);
  font-size: 15px;
}

.recon-diff-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recon-diff-label {
  font-size: 12.5px;
  color: var(--mu);
}

.recon-diff-val {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--tx);
}

tr.t td {
  font-weight: 700;
  background: #f8f9fb;
}

small {
  color: var(--mu);
}

/* ==========================================================================
   Badges / Etiquetas de Estado (Conforme idv.md)
   ========================================================================== */
.b,
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}

.b.ok, .badge.ok { background: var(--accent-subtle); color: var(--accent-primary); border: 1px solid var(--accent-subtle-border); }
.b.wa, .badge.wa { background: var(--wab); color: var(--feedback-warning); border: 1px solid #fed7aa; }
.b.er, .badge.er { background: var(--feedback-danger-bg); color: var(--feedback-danger); border: 1px solid #fecdd3; }
.b.in, .badge.in { background: var(--bg-surface-2); color: var(--in); border: 1px solid var(--border-subtle); }

/* ==========================================================================
   Controlos de Formulário, Inputs e Placeholders Obrigatórios (Conforme idv.md)
   ========================================================================== */
button,
select,
input,
textarea {
  font-family: var(--font-family-base);
  color: var(--text-primary);
}

button.p,
.btn-primary {
  border: 1px solid var(--accent-primary);
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-family: var(--font-family-base);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  box-shadow: var(--glow-button);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: filter 0.15s ease, background-color 0.15s ease;
}

button.p:hover,
.btn-primary:hover {
  filter: brightness(1.05);
}

button.p:active,
.btn-primary:active {
  filter: brightness(0.95);
}

td.ac button,
.bar button:not(.p),
.btn-sec,
.btn-secondary {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-1);
  color: var(--text-primary);
  font-family: var(--font-family-base);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

td.ac button:hover,
.bar button:not(.p):hover,
.btn-sec:hover,
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

button.dg {
  color: var(--feedback-danger);
}

input,
select,
textarea,
.input-field {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  width: 100%;
  font-family: var(--font-family-base);
  font-size: var(--text-body-sm);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
  font-size: var(--text-body-sm);
}

input:focus,
select:focus,
textarea:focus,
.input-field:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(254, 129, 0, 0.18);
}

.bar input,
.bar select {
  width: auto;
  height: 38px;
  box-sizing: border-box;
}

.bar button.p {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  box-sizing: border-box;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-bold);
  padding: 0 var(--space-4);
}

.filters-wrap .btn-sec {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  flex-shrink: 0;
  white-space: nowrap;
}

td input,
td input.money-input {
  width: 175px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  padding: var(--space-2) var(--space-3);
}

/* ==========================================================================
   Diálogo Modal (Formulários CRUD - Conforme idv.md)
   ========================================================================== */
dialog {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--bg-surface-1);
  color: var(--text-primary);
  width: min(640px, 94vw);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.fg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.fg label {
  font-size: var(--text-caption);
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
}

.fg .full {
  grid-column: 1 / -1;
}

.fg label input,
.fg label select,
.fg label textarea {
  margin-top: var(--space-1);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-regular);
}

.ft {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-5);
}

.ft button:not(.p) {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-1);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ft button:not(.p):hover {
  background: var(--bg-surface-hover);
}

/* Notificação Toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  margin-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  background: var(--text-primary);
  color: var(--text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  display: none;
  z-index: 100;
  box-shadow: var(--shadow-md);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
}

.note {
  color: var(--text-muted);
  font-size: var(--text-caption);
}


/* ==========================================================================
   Botões Globais e Ações (Conforme idv.md)
   ========================================================================== */
.btn-sec,
.btn-secondary {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-1);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-family-base);
  font-size: var(--text-body-sm);
  cursor: pointer;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  line-height: var(--leading-snug);
  text-decoration: none;
}

.btn-sec:hover,
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn-sec.on,
.btn-secondary.on {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  font-weight: var(--weight-semibold);
}

/* Botões Pequenos de Ações em Tabelas */
.btn-sm {
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-family-base);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-1);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  line-height: 1;
}

.btn-sm:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

/* Botões de Eliminar (Vermelho Mandatório LECASU) */
.btn-sm.del,
.btn-danger,
button.del {
  color: var(--feedback-danger) !important;
  background: var(--feedback-danger-bg) !important;
  border: 1px solid #fecdd3 !important;
  font-weight: var(--weight-bold) !important;
  border-radius: var(--radius-sm);
}

.btn-sm.del:hover,
.btn-danger:hover,
button.del:hover {
  background: var(--feedback-danger) !important;
  color: var(--text-inverse) !important;
  border-color: #991b1b !important;
}

/* Modal de Confirmação de Ações */
#dlg-confirm {
  width: min(440px, 92vw);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-1);
  box-shadow: var(--shadow-lg);
}

.confirm-box {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.confirm-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--feedback-danger-bg);
  color: var(--feedback-danger);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.confirm-body h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.confirm-body p {
  margin: 0;
  font-size: var(--text-body-sm);
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

.weather-svg {
  color: #f59e0b;
  flex-shrink: 0;
}

/* Botões do Rodapé da Sidebar */
.sbf .btn-sec {
  border: 1px solid var(--bd);
  background: #ffffff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--mu);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.sbf .btn-sec:hover {
  background: var(--bg);
  color: var(--tx);
  border-color: #cbd5e1;
}

/* ==========================================================================
   Estilos de Impressão e Relatórios Oficiais (PDF)
   ========================================================================== */
@media print {
  aside,
  #nav,
  .sbf,
  .pills,
  .bar button,
  td.ac,
  th:last-child,
  td:last-child,
  #toast,
  dialog {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }

  .app-header {
    position: static !important;
    border-bottom: 2px solid #000000 !important;
    box-shadow: none !important;
    padding: 0 0 10px 0 !important;
  }

  .header-container {
    padding: 0 !important;
  }

  .header-meta {
    display: none !important;
  }

  .cont {
    padding: 10px 0 !important;
    max-width: 100% !important;
  }

  .k,
  .cd,
  .sc {
    box-shadow: none !important;
    border: 1px solid #cccccc !important;
    page-break-inside: avoid;
  }

  table {
    border: 1px solid #cccccc !important;
  }

  th,
  td {
    padding: 6px 8px !important;
    border-color: #cccccc !important;
    font-size: 9pt !important;
  }

  th {
    background: #f0f0f0 !important;
    color: #000000 !important;
  }
}

/* Grelha de Configuração e Formulários de Parâmetros */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.config-card {
  background: var(--cd);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 16px 18px;
}

.config-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--tx);
  border-bottom: 1px solid var(--bd);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group-row {
  margin-bottom: 14px;
}

.form-group-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mu);
  margin-bottom: 5px;
}

.form-group-row input,
.form-group-row select,
.form-group-row textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  font: inherit;
  color: var(--tx);
  background: #ffffff;
  box-sizing: border-box;
}

.form-group-row input:focus,
.form-group-row select:focus,
.form-group-row textarea:focus {
  outline: none;
  border-color: var(--ac);
  box-shadow: 0 0 0 2px var(--ab);
}

/* ==========================================================================
   Responsividade Completa Mobile / Tablet / Desktop
   ========================================================================== */
@media (max-width: 860px) {
  .app {
    flex-direction: column;
    min-height: 100vh;
  }
  aside {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--bd);
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }
  .brand {
    padding: 0;
    flex-shrink: 0;
  }
  .sidebar-toggle {
    display: none;
  }
  #nav {
    display: flex;
    flex-direction: row;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  #nav a {
    padding: 8px 11px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 6px;
  }
  .sbf {
    display: none;
  }
  .header-container {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .header-info h1 {
    font-size: 19px;
  }
  .header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
  }
  .header-period-selector {
    flex-grow: 1;
  }
  .header-user-profile {
    margin-left: auto;
  }
  .cont {
    padding: 14px 12px 40px;
  }
  .fg {
    grid-template-columns: 1fr;
  }
  .grid2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .br {
    grid-template-columns: 100px 1fr auto;
  }
  .bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filters-wrap {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .bar-search-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  .bar-search-actions input[type="search"] {
    width: 100% !important;
    min-width: 0 !important;
  }
  .bar-search-actions button {
    width: 100%;
    justify-content: center;
  }
  .kpis {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
  }
  .k {
    padding: 10px 12px;
  }
  .k b {
    font-size: 17px;
  }
  .k span {
    font-size: 11px;
  }

  /* Em telas menores, adaptação para evitar bloqueio de teclado ou rolagem */
  body.layout-fixed-100vh {
    height: auto !important;
    overflow-y: auto !important;
  }
  body.layout-fixed-100vh .app,
  body.layout-fixed-100vh .main-wrapper,
  body.layout-fixed-100vh .content-container,
  body.layout-fixed-100vh .cont,
  body.layout-fixed-100vh #main {
    height: auto !important;
    overflow: visible !important;
  }
  body.layout-fixed-100vh .sc {
    max-height: 65vh;
  }
}

@media (max-width: 520px) {
  .header-clock {
    display: none;
  }
  .header-weather {
    display: none;
  }
  .btn-excel span {
    display: none;
  }
  .btn-excel {
    padding: 6px 9px;
  }
  dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 14px 16px;
  }
  .ft {
    flex-direction: column;
  }
  .ft button {
    width: 100%;
  }
}

/* ==========================================================================
   Layout 100vh com Scroll Interno na Tabela (Módulos Operacionais)
   ========================================================================== */
body.layout-fixed-100vh {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.layout-fixed-100vh .app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.layout-fixed-100vh .main-wrapper {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.layout-fixed-100vh .content-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

body.layout-fixed-100vh .cont {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 32px 16px;
}

body.layout-fixed-100vh #main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.layout-fixed-100vh .kpis {
  flex-shrink: 0;
  margin-bottom: 12px;
}

body.layout-fixed-100vh .bar {
  flex-shrink: 0;
  margin-bottom: 12px;
}

body.layout-fixed-100vh .sc {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-bottom: 0;
  border-radius: 12px;
}

/* Grid de Gráficos do Dashboard */
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 960px) {
  .dashboard-charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 16px;
  background: var(--cd);
  border: 1px solid var(--bd);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-header h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--tx);
}

.chart-header small {
  font-size: 12px;
  color: var(--mu);
  margin-top: 2px;
  display: block;
}

.chart-legend-custom {
  display: flex;
  gap: 14px;
  align-items: center;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
}

.legend-pill::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background-color: var(--c);
}

.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
}

.chart-container-pie {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Seletor Dinâmico de Período no Header */
.header-period-selector {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12.5px;
  color: var(--tx);
}

.header-period-selector svg {
  color: var(--ac);
  flex-shrink: 0;
}

.period-select {
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tx);
  cursor: pointer;
  outline: none;
  padding: 2px 4px;
}

.period-select:focus {
  color: var(--ac);
}

/* Badge de Estado da Base de Dados Neon PostgreSQL */
.db-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: default;
  transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.db-badge.online {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.db-badge.offline {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.db-badge.syncing {
  background: var(--ab);
  color: var(--ac);
  border: 1px solid var(--abb);
}

.db-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
}

.db-badge.syncing .db-dot {
  animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* Perfil de Usuário e Botão de Logout no Header */
.header-user-profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
  border-left: 1px solid var(--bd);
  margin-left: 4px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ab);
  border: 1.5px solid var(--abb);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tx);
  white-space: nowrap;
}

.user-role {
  font-size: 11px;
  color: var(--mu);
  white-space: nowrap;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--bd);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mu);
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.btn-logout:hover {
  background: var(--erb);
  color: var(--er);
  border-color: #fecdd3;
}



