/* ============================================================
   LG CRM — estilos do shell
   ============================================================
   Identidade LG Empreendimentos: preto e branco, com champagne nos
   detalhes (item ativo do menu, foco, selos, fios).

   • Tema claro (padrão): conteúdo branco, menu lateral preto.
   • Tema escuro: tudo em preto e grafite.
   • O menu lateral e a tela de login são SEMPRE escuros, porque é
     neles que o logo aparece.

   Toda cor sai das variáveis abaixo. Os nomes --gold* são o slot do
   acento da marca (hoje, champagne).
   ============================================================ */

/* ── Tema escuro ───────────────────────────────────────────── */
:root,
:root[data-theme="dark"] {
  --bg:        #0A0A0B;
  --bg-2:      #131315;
  --bg-3:      #1B1B1E;
  --bg-4:      #26262A;

  --surface-hover:  rgba(255, 255, 255, 0.05);
  --surface-active: rgba(255, 255, 255, 0.09);

  --line:      rgba(255, 255, 255, 0.09);
  --line-2:    rgba(255, 255, 255, 0.15);
  --line-3:    rgba(255, 255, 255, 0.24);

  --text:      #F4F4F2;
  --text-2:    #B6B6BA;
  --mute:      #8B8B91;
  --mute-2:    #606066;

  /* Champagne — acento da marca */
  --gold:        #D4BC84;
  --gold-light:  #E8D7AC;
  --gold-dark:   #A88E55;
  --gold-soft:   rgba(212, 188, 132, 0.12);
  --gold-soft-2: rgba(212, 188, 132, 0.20);

  --gold-pure:       #D4BC84;
  --gold-pure-light: #EBDDB8;
  --gold-pure-dark:  #9C7F45;
  --gold-pure-soft:  rgba(212, 188, 132, 0.14);

  --gold-gradient:      linear-gradient(135deg, #EFE2BD 0%, #D4BC84 46%, #9C7F45 100%);
  --gold-pure-gradient: linear-gradient(135deg, #EFE2BD 0%, #D4BC84 46%, #9C7F45 100%);
  --on-gold: #0A0A0B;               /* texto sobre champagne */

  /* Botão primário: branco no escuro, preto no claro */
  --gold-fill:       #F4F4F2;
  --gold-fill-hover: #FFFFFF;
  --on-gold-fill:    #0A0A0B;

  --danger:    #E5665F;
  --warn:      #E0A93A;
  --ok:        #4FB37A;
  --info:      #6AA5E0;

  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --radius:    7px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.32);
  --shadow:    0 6px 24px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);

  --header-h:  56px;

  --z-modal:   1000;
  --z-toast:   2000;
  --z-tooltip: 3000;

  --logo:    url('/assets/lg-logo-branco.png');
  --simbolo: url('/assets/lg-simbolo.png');

  color-scheme: dark;
}

/* ── Tema claro (padrão) ───────────────────────────────────── */
:root[data-theme="light"] {
  --bg:        #F5F5F3;
  --bg-2:      #FFFFFF;
  --bg-3:      #EFEFEC;
  --bg-4:      #E3E3DF;

  --surface-hover:  rgba(10, 10, 11, 0.04);
  --surface-active: rgba(10, 10, 11, 0.07);

  --line:      rgba(10, 10, 11, 0.10);
  --line-2:    rgba(10, 10, 11, 0.16);
  --line-3:    rgba(10, 10, 11, 0.28);

  --text:      #0E0E10;
  --text-2:    #46464B;
  --mute:      #66666C;
  --mute-2:    #96969B;

  /* No branco o champagne claro não lê: o tom fecha até passar de 4,5:1 */
  --gold:        #8A6F3A;
  --gold-light:  #A88E55;
  --gold-dark:   #6B5529;
  --gold-soft:   rgba(156, 127, 69, 0.12);
  --gold-soft-2: rgba(156, 127, 69, 0.20);

  --gold-pure:       #9C7F45;
  --gold-pure-light: #B99D59;
  --gold-pure-dark:  #6B5529;
  --gold-pure-soft:  rgba(156, 127, 69, 0.14);

  --gold-gradient:      linear-gradient(135deg, #E6D5A8 0%, #C9AF73 46%, #A88E55 100%);
  --gold-pure-gradient: linear-gradient(135deg, #E6D5A8 0%, #C9AF73 46%, #A88E55 100%);
  --on-gold: #0E0E10;

  --gold-fill:       #0E0E10;
  --gold-fill-hover: #2A2A2E;
  --on-gold-fill:    #FFFFFF;

  --danger:    #C0392B;
  --warn:      #9A6B06;
  --ok:        #1E7A45;
  --info:      #1F5FBF;

  --shadow-sm: 0 1px 4px rgba(10, 10, 11, 0.06);
  --shadow:    0 6px 24px rgba(10, 10, 11, 0.10);
  --shadow-lg: 0 16px 48px rgba(10, 10, 11, 0.16);

  --logo:    url('/assets/lg-logo-preto.png');
  --simbolo: url('/assets/lg-simbolo-preto.png');

  color-scheme: light;
}

/* ── Áreas sempre escuras ──────────────────────────────────────
   O menu lateral e o login usam a paleta escura nos dois temas. Em vez de
   reescrever cada regra, as variáveis são redefinidas dentro deles: tudo
   que está ali dentro passa a ler os valores escuros. */
:root[data-theme="light"] .lg-sidebar,
:root[data-theme="light"] #lg-login {
  --bg:        #0A0A0B;
  --bg-2:      #0A0A0B;
  --bg-3:      #1B1B1E;
  --bg-4:      #26262A;
  --surface-hover:  rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.10);
  --line:      rgba(255, 255, 255, 0.10);
  --line-2:    rgba(255, 255, 255, 0.16);
  --line-3:    rgba(255, 255, 255, 0.24);
  --text:      #F4F4F2;
  --text-2:    #B6B6BA;
  --mute:      #8B8B91;
  --mute-2:    #606066;
  --gold:            #D4BC84;
  --gold-light:      #E8D7AC;
  --gold-dark:       #A88E55;
  --gold-pure:       #D4BC84;
  --gold-pure-light: #EBDDB8;
  --gold-pure-dark:  #9C7F45;
  --gold-pure-soft:  rgba(212, 188, 132, 0.14);
  --gold-soft:       rgba(212, 188, 132, 0.12);
  --gold-soft-2:     rgba(212, 188, 132, 0.20);
  --gold-fill:       #F4F4F2;
  --gold-fill-hover: #FFFFFF;
  --on-gold-fill:    #0A0A0B;
  --danger:    #E5665F;
  --logo:    url('/assets/lg-logo-branco.png');
  --simbolo: url('/assets/lg-simbolo.png');
  color-scheme: dark;
}

/* Apelidos: nomes antigos que alguns módulos ainda usam. Apontam pras
   variáveis do tema, então acompanham claro e escuro. */
:root {
  --bg-1:         var(--bg-2);
  --surface:      var(--bg-2);
  --lg-surface-2: var(--bg-3);
  --lg-surface-3: var(--bg-4);
  --border:       var(--line-2);
  --lg-border:    var(--line-2);
  --text-dim:     var(--text-2);
}

/* O atributo hidden vale mesmo quando a classe define display */
[hidden] { display: none !important; }

/* Selos semânticos no tema claro (tons mais fechados pra dar contraste) */
:root[data-theme="light"] .lg-pill.heavy { background: rgba(192, 57, 43, 0.10);  color: #8C2A20; border-color: rgba(192, 57, 43, 0.28); }
:root[data-theme="light"] .lg-pill.ok    { background: rgba(30, 122, 69, 0.10);  color: #17603A; border-color: rgba(30, 122, 69, 0.28); }
:root[data-theme="light"] .lg-pill.warn  { background: rgba(154, 107, 6, 0.12);  color: #6E4D05; border-color: rgba(154, 107, 6, 0.30); }
:root[data-theme="light"] .lg-toast-error { color: #8C2A20; }
:root[data-theme="light"] .lg-test-value.ok   { color: #17603A; }
:root[data-theme="light"] .lg-test-value.warn { color: #8C2A20; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--text);
  margin: 0;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* ════════════════════════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════════════════════════ */

.lg-login-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.lg-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 44px 38px 38px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.lg-login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(180deg, var(--line-3) 0%, transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* Logo grande no topo do card de login */
.lg-login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.lg-login-logo img {
  max-width: 240px;
  width: 100%;
  height: auto;
  display: block;
}

.lg-login-subtitle {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--mute);
  text-transform: uppercase;
  margin-bottom: 36px;
}

.lg-login-field { margin-bottom: 14px; }
.lg-login-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--mute);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.lg-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 120ms ease;
}
.lg-input:focus { border-color: var(--gold-dark); }
.lg-input::placeholder { color: var(--mute-2); }

.lg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 8px 15px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 120ms ease;
}
.lg-btn:hover:not(:disabled) {
  border-color: var(--gold-dark);
  background: var(--gold-soft);
}
.lg-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.lg-btn-primary {
  background: var(--gold-fill);
  border-color: var(--gold-fill);
  color: var(--on-gold-fill);
  font-weight: 700;
}
.lg-btn-primary:hover:not(:disabled) {
  background: var(--gold-fill-hover);
  border-color: var(--gold-fill-hover);
}

.lg-btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 600;
}
.lg-btn-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.lg-btn-lg { padding: 12px 24px; font-size: 14px; }
.lg-btn-sm { padding: 6px 12px; font-size: 12px; }
.lg-btn-block { width: 100%; }

.lg-login-error {
  background: rgba(196, 70, 56, 0.1);
  border: 1px solid rgba(196, 70, 56, 0.3);
  color: #e88a7d;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  margin-top: 14px;
  font-family: var(--font-mono);
}

/* ════════════════════════════════════════════════════════════
   APP LAYOUT
   ════════════════════════════════════════════════════════════ */

.lg-app {
  height: 100vh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}
.lg-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.lg-header {
  height: 56px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.lg-header-spacer { flex: 1; }

/* Botão de recolher a sidebar */
.lg-sidebar-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.lg-sidebar-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--line-2);
  color: var(--gold-light);
}

.lg-header-left {
  display: flex;
  align-items: center;
  height: 100%;
  margin-right: auto;
}

/* Logo completo no header — troca conforme o tema */
.lg-header-logo {
  height: 38px;
  width: auto;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
/* A marca virou um SVG só, recolorido por CSS mask. As quatro regras
   que alternavam duas imagens por tema saíram junto. As classes genéricas
   .lg-logo-light/.lg-logo-dark abaixo continuam, porque outras telas usam. */
.lg-logo-light { display: none; }
.lg-logo-dark  { display: block; }
:root[data-theme="light"] .lg-logo-light { display: block; }
:root[data-theme="light"] .lg-logo-dark  { display: none; }

.lg-header-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lg-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 10px 5px 5px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 120ms ease;
}
.lg-user-btn:hover { border-color: var(--gold-dark); }

.lg-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--on-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}

.lg-user-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.lg-user-name { font-size: 13px; color: var(--text); font-weight: 500; }
.lg-user-role {
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  color: var(--mute);
  text-transform: uppercase;
}

.lg-user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  min-width: 160px;
  box-shadow: var(--shadow);
  z-index: 200;
  padding: 4px;
}

.lg-user-menu-item {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
  font-size: 13px;
}
.lg-user-menu-item:hover { background: var(--surface-hover); color: var(--text); }

.lg-content {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.lg-sidebar {
  width: 218px;
  height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.lg-sidebar-brand {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
/* O logo é imagem (o dourado é degradê, não dá pra pintar por CSS). Qual
   arquivo usar vem da variável --logo, que muda com o fundo. */
.lg-brand-logo {
  height: 38px;
  width: 84px;                       /* proporção do logo: 2,21 */
  display: block;
  background: var(--logo) no-repeat center / contain;
}
.lg-brand-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1;
}
.lg-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 10px;
}

.lg-nav-group { margin-bottom: 14px; }
.lg-nav-group:last-child { margin-bottom: 4px; }
.lg-nav-group-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--mute-2);
  text-transform: uppercase;
  padding: 0 10px;
  margin-bottom: 6px;
}

.lg-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  color: var(--text-2);
  border-radius: var(--radius);
  margin-bottom: 1px;
  transition: all 120ms ease;
  font-size: 12.5px;
}
.lg-nav-item:hover { background: var(--surface-hover); color: var(--text); }
.lg-nav-item.active {
  background: var(--gold-pure-soft);
  color: var(--gold-pure-light);
  border-left: 2px solid var(--gold-pure);
  padding-left: 8px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 500;
}

.lg-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-2);
  flex-shrink: 0;
}
.lg-nav-icon .lg-icon { width: 18px; height: 18px; }
.lg-nav-item.active .lg-nav-icon { color: var(--gold-pure-light); }
.lg-nav-item:hover .lg-nav-icon { color: var(--text); }

.lg-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  min-width: 0;
}

/* ════════════════════════════════════════════════════════════
   PAGE / CARD
   ════════════════════════════════════════════════════════════ */

.lg-page-header { margin-bottom: 16px; }
.lg-page-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
  line-height: 1.25;
}
.lg-page-sub {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--mute);
  text-transform: none;
  margin-top: 4px;
}

.lg-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.lg-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.lg-card-sub {
  font-family: var(--font-body);
  font-size: 12.5px;
  letter-spacing: 0;
  color: var(--mute);
  text-transform: none;
  margin-bottom: 18px;
}

.lg-field { margin-bottom: 14px; }
.lg-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--mute);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.lg-select {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 11px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
}
.lg-select:focus { border-color: var(--gold-dark); }

.lg-grid { display: grid; gap: 18px; }
.lg-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lg-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 980px) {
  .lg-grid-2, .lg-grid-3 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   TABLE
   ════════════════════════════════════════════════════════════ */

.lg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.lg-table th {
  text-align: left;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mute);
  text-transform: none;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.lg-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
  font-size: 13px;
}
.lg-table tr:hover td { background: var(--surface-hover); }
.lg-table tr:last-child td { border-bottom: none; }

.lg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0;
  background: var(--bg-4);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.lg-pill.heavy { background: rgba(196, 70, 56, 0.12); color: #e88a7d; border-color: rgba(196, 70, 56, 0.3); }
.lg-pill.ok    { background: rgba(106, 142, 58, 0.12); color: #b6d987; border-color: rgba(106, 142, 58, 0.3); }
.lg-pill.warn  { background: rgba(184, 134, 11, 0.14); color: var(--gold-light); border-color: rgba(184, 134, 11, 0.32); }
/* Selo de status com cor de cadastro: a cor aparece no ponto e na borda;
   o texto usa a cor normal da tela, pra continuar legível em qualquer tema. */
.lg-pill-status {
  background: color-mix(in srgb, var(--c, #888) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #888) 45%, transparent);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.lg-pill-status::before,
.lg-dot-status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c, #888);
  flex-shrink: 0;
  display: inline-block;
}
.lg-dot-status { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }

.lg-pill.gold  { background: var(--gold-soft-2); color: var(--gold-light); border-color: var(--gold-soft-2); }

/* ════════════════════════════════════════════════════════════
   TOGGLE SWITCH
   ════════════════════════════════════════════════════════════ */

.lg-toggle {
  display: inline-block;
  position: relative;
  width: 38px;
  height: 22px;
  cursor: pointer;
}
.lg-toggle input { opacity: 0; width: 0; height: 0; }
.lg-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-4);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  transition: 200ms;
}
.lg-toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  background: var(--mute);
  border-radius: 50%;
  transition: 200ms;
}
.lg-toggle input:checked + .lg-toggle-slider {
  background: var(--gold-dark);
  border-color: var(--gold);
}
.lg-toggle input:checked + .lg-toggle-slider::before {
  transform: translateX(16px);
  background: var(--gold-light);
}

/* ════════════════════════════════════════════════════════════
   WEEKDAYS (admin distribuição)
   ════════════════════════════════════════════════════════════ */

.lg-weekdays {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lg-weekday {
  padding: 6px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--mute);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 120ms ease;
  user-select: none;
}
.lg-weekday:hover { border-color: var(--gold-dark); color: var(--text); }
.lg-weekday.active {
  background: var(--gold-soft-2);
  border-color: var(--gold);
  color: var(--gold);
}

.lg-time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lg-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.lg-test-result {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.lg-test-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.lg-test-row:last-child { border-bottom: none; }
.lg-test-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--mute);
  text-transform: uppercase;
}
.lg-test-value { color: var(--text); }
.lg-test-value.ok { color: #b6d987; }
.lg-test-value.warn { color: #e88a7d; }

/* ════════════════════════════════════════════════════════════
   TOASTS
   ════════════════════════════════════════════════════════════ */

.lg-toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-toast);
  pointer-events: none;
}
.lg-toast {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow);
  transform: translateX(120%);
  opacity: 0;
  transition: all 250ms ease;
  pointer-events: auto;
  min-width: 240px;
  max-width: 380px;
}
.lg-toast.show { transform: translateX(0); opacity: 1; }
.lg-toast-success { border-left: 3px solid var(--ok); }
.lg-toast-error   { border-left: 3px solid var(--danger); color: #e8a89e; }
.lg-toast-info    { border-left: 3px solid var(--gold-dark); }

/* ════════════════════════════════════════════════════════════
   UTILS
   ════════════════════════════════════════════════════════════ */

.lg-loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px;
  color: var(--mute);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.lg-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--gold-dark);
  border-top-color: transparent;
  border-radius: 50%;
  animation: lg-spin 700ms linear infinite;
}
@keyframes lg-spin { to { transform: rotate(360deg); } }

.lg-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--mute);
  font-family: var(--font-body);
  font-size: 13.5px;
  letter-spacing: 0;
}

.lg-flex { display: flex; }
.lg-flex-between { display: flex; justify-content: space-between; align-items: center; }
.lg-gap-2 { gap: 8px; }
.lg-gap-3 { gap: 12px; }
.lg-mt-2 { margin-top: 12px; }
.lg-mt-3 { margin-top: 18px; }
.lg-mb-2 { margin-bottom: 12px; }
.lg-mb-3 { margin-bottom: 18px; }

/* ─── Theme toggle ──────────────────────────────────── */
.lg-theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--gold-light);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.lg-theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--line-2);
  transform: rotate(-15deg);
}
.lg-theme-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.lg-sidebar-toggle-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

/* ════════════════════════════════════════════════════════════
   SIDEBAR COLAPSADA
   ════════════════════════════════════════════════════════════ */
.lg-app.sidebar-collapsed .lg-sidebar {
  width: 64px;
}
.lg-app.sidebar-collapsed .lg-sidebar-nav {
  padding: 14px 8px;
}
.lg-app.sidebar-collapsed .lg-sidebar-brand {
  padding: 0;
  justify-content: center;
  gap: 0;
}
.lg-app.sidebar-collapsed .lg-brand-text {
  display: none;
}
/* recolhida: sobra só o símbolo */
.lg-app.sidebar-collapsed .lg-brand-logo {
  height: 30px;
  width: 28px;
  background-image: var(--simbolo);
}
.lg-app.sidebar-collapsed .lg-nav-label {
  display: none;
}
.lg-app.sidebar-collapsed .lg-nav-group-label {
  display: none;
}
.lg-app.sidebar-collapsed .lg-nav-group {
  margin-bottom: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.lg-app.sidebar-collapsed .lg-nav-group:first-child {
  border-top: none;
  padding-top: 0;
}
.lg-app.sidebar-collapsed .lg-nav-item {
  justify-content: center;
  padding: 11px 0;
  margin-bottom: 4px;
}
.lg-app.sidebar-collapsed .lg-nav-item.active {
  border-left: none;
  padding-left: 0;
  border-radius: var(--radius);
  background: var(--gold-soft-2);
  color: var(--gold);
}
.lg-app.sidebar-collapsed .lg-nav-icon {
  width: 22px;
  height: 22px;
}
.lg-app.sidebar-collapsed .lg-nav-icon .lg-icon { width: 20px; height: 20px; }
.lg-sidebar {
  transition: width 0.18s ease, padding 0.18s ease;
}

/* ════════════════════════════════════════════════════════════
   ÍCONES SVG — alinhamento em botões (LG-refat etapa 2)
   ════════════════════════════════════════════════════════════ */
.lg-icon { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }
/* Botões com ícone + texto */
.lg-btn { display: inline-flex; align-items: center; gap: 6px; }
.lg-btn .lg-icon { vertical-align: middle; }

/* ════════════════════════════════════════════════════════════
   PAGINAÇÃO (LG-refat etapa 4)
   ════════════════════════════════════════════════════════════ */
.pgn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pgn-info {
  font-size: 12.5px;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pgn-perpage {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 12.5px;
  font-family: var(--font-body);
  cursor: pointer;
}
.pgn-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pgn-num {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: var(--radius);
  font-size: 12.5px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.12s ease;
}
.pgn-num:hover { background: var(--surface-hover); color: var(--text); }
.pgn-num.active {
  background: var(--gold-soft-2);
  border-color: var(--line-3);
  color: var(--gold-light);
  font-weight: 600;
}
.pgn-arrow {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s ease;
}
.pgn-arrow:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.pgn-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.pgn-dots { color: var(--mute-2); padding: 0 2px; }


/* ════════════════════════════════════════════════════════════
   LIST HELPER: barra de ações (botão + busca + reload) numa linha
   ════════════════════════════════════════════════════════════ */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.list-search-wrap {
  position: relative;
  flex: 1;            /* a busca cresce e ocupa o meio */
  min-width: 0;
  display: flex;
  align-items: center;
}
.list-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mute);
  display: flex;
  align-items: center;
  pointer-events: none;
}
.list-search {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 38px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13.5px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.list-search::placeholder { color: var(--mute); }
.list-search:focus {
  border-color: var(--line-3);
  background: var(--bg-3);
}
.list-toolbar .lg-btn { height: 36px; white-space: nowrap; flex-shrink: 0; }
.list-reload {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ════════════════════════════════════════════════════════════
   FILTRO SIMPLES: botão + popover (webhooks, conversões)
   ════════════════════════════════════════════════════════════ */
.list-filter-btn {
  position: relative;
  height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.list-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  background: var(--gold-fill);
  color: var(--on-gold-fill);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.list-filter-pop {
  position: fixed;
  z-index: 1000;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.list-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.list-filter-head span { display: inline-flex; align-items: center; gap: 7px; }
.list-filter-x {
  background: transparent;
  border: none;
  color: var(--mute);
  cursor: pointer;
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius);
}
.list-filter-x:hover { color: var(--text); background: var(--surface-hover); }
.list-filter-body { padding: 14px; }
.list-filter-body .lg-label { display: block; margin-bottom: 5px; }
.list-filter-body .lg-input { width: 100%; }
.list-filter-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

/* ════════════════════════════════════════════════════════════
   MOBILE / PWA
   ════════════════════════════════════════════════════════════ */
.lg-mobile-backdrop { display: none; }

@media (max-width: 768px) {
  /* Sidebar vira drawer deslizante fora da tela */
  .lg-sidebar {
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    width: 80vw;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .lg-app.mobile-nav-open .lg-sidebar { transform: translateX(0); }

  /* Backdrop */
  .lg-mobile-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .lg-app.mobile-nav-open .lg-mobile-backdrop { opacity: 1; pointer-events: auto; }

  /* Header e conteúdo ocupam tela cheia */
  .lg-content { width: 100%; }
  .lg-header { padding: 0 12px; }
  .lg-header-logo { height: 30px; }
  .lg-main { padding: 14px 12px; }

  /* Toggle sempre visível e com aparência de menu no mobile */
  .lg-sidebar-toggle { display: flex; }

  /* Cards/grids empilham */
  .lg-grid-2, .lg-grid-3 { grid-template-columns: 1fr; }
  .esp-summary-grid, .rel-cards { grid-template-columns: repeat(2, 1fr); }

  /* Drawer do lead e modais ocupam quase a tela toda */
  .cli-drawer, #cli-drawer { width: 100vw !important; max-width: 100vw !important; }
  .tsk-modal-card, .esp-modal, .cli-mat-card { width: 94vw; max-width: 94vw; }

  /* Page header empilha título + ações */
  .lg-page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .lg-page-header .lg-actions, .lg-page-header > button { width: 100%; }

  /* Tabelas com scroll horizontal */
  .lg-table { font-size: 12px; }
  .lg-table th, .lg-table td { padding: 9px 10px; }
}

/* Telas bem pequenas: cards em 1 coluna */
@media (max-width: 480px) {
  .esp-summary-grid, .rel-cards { grid-template-columns: 1fr 1fr; }
  .lg-header-logo { height: 26px; }
}


@keyframes lg-wpp-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* No mobile, esconde o texto e deixa só a bolinha */
@media (max-width: 768px) {
}

/* ════════════════════════════════════════════════════════════
   EMPTY STATE rico (ícone + título + ação)
   ════════════════════════════════════════════════════════════ */
.lg-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  gap: 6px;
}
.lg-empty-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--mute);
  margin-bottom: 10px;
}
.lg-empty-state-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.lg-empty-state-text {
  font-size: 13px;
  color: var(--mute);
  max-width: 340px;
  line-height: 1.5;
}
.lg-empty-action { margin-top: 14px; }

/* ════════════════════════════════════════════════════════════
   LOGIN — tela nova
   Layout centralizado, minimalista, fundo escuro.
   IDs do login (#lg-login-email/pass/btn/error) preservados.
   ════════════════════════════════════════════════════════════ */
#lg-login.lg-login-wrap {
  flex-direction: column;
  background: var(--bg);
}
.lgx-stage {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.lgx-mark { margin: 0 auto 36px; }

.lgx-head { text-align: center; margin-bottom: 48px; }
.lgx-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}
.lgx-head p {
  margin-top: 10px;
  font-size: 13px;
  color: var(--mute);
  letter-spacing: 0.02em;
}

.lgx-field { margin-bottom: 26px; position: relative; }
.lgx-field label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 10px;
}
.lgx-field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-2);
  padding: 6px 0 10px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}
.lgx-field input::placeholder { color: var(--mute-2); }
.lgx-field input:focus { border-bottom-color: var(--gold-pure); }

.lgx-toggle {
  position: absolute;
  right: 0;
  bottom: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 4px 0;
  transition: color 0.15s;
}
.lgx-toggle:hover { color: var(--text); }

.lgx-logo {
  display: block;
  width: 220px;
  height: auto;
  margin: 0 auto;
}

.lgx-btn {
  width: 100%;
  height: 52px;
  margin-top: 12px;
  background: var(--gold-fill);
  color: var(--on-gold-fill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
}
.lgx-btn:hover:not(:disabled) { background: var(--gold-fill-hover); }
.lgx-btn:disabled { opacity: 0.6; cursor: not-allowed; }


.lgx-foot {
  position: fixed;
  bottom: 24px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--mute);
  text-transform: uppercase;
}

/* O erro de login dentro do novo layout */
#lg-login .lg-login-error { margin-top: 18px; }

/* ════════════════════════════════════════════════════════════
   SININHO DE TAREFAS
   ════════════════════════════════════════════════════════════ */
.lg-bell-wrap { position: relative; flex-shrink: 0; }

.lg-bell {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--gold-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  position: relative;
}
.lg-bell:hover { background: var(--surface-hover); border-color: var(--line-2); }
.lg-bell.has-late { color: #e08a7d; border-color: rgba(196,80,62,0.45); }

.lg-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--gold-gradient);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}
.lg-bell.has-late .lg-bell-badge { background: #c4503e; color: #fff; }

/* ─── Painel ──────────────────────────────────────────────── */
.lg-bell-panel {
  position: absolute;
  top: 46px;
  right: 0;
  width: 320px;
  max-width: 88vw;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 44px rgba(0,0,0,0.45);
  z-index: 1200;
  padding: 6px;
}
.lg-bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.lg-bell-all {
  background: none;
  border: none;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.lg-bell-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}
.lg-bell-item:hover { background: var(--surface-hover); }
.lg-bell-item.late { border-left-color: #c4503e; }
.lg-bell-item-title {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.lg-bell-item-meta { display: block; font-size: 11px; color: var(--mute); }
.lg-bell-item.late .lg-bell-item-meta { color: #e08a7d; }
.lg-bell-empty { padding: 22px 12px; text-align: center; font-size: 12px; color: var(--mute); }

/* ─── Aviso que só some no botão ──────────────────────────── */
.lg-alert-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 92vw;
}
.lg-alert {
  width: 320px;
  max-width: 92vw;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 44px rgba(0,0,0,0.5);
  padding: 14px 16px;
  animation: lg-alert-in 0.22s ease;
}
.lg-alert.late { border-top-color: #c4503e; }
@keyframes lg-alert-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.lg-alert-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-light);
  margin-bottom: 7px;
}
.lg-alert.late .lg-alert-head { color: #e08a7d; }
.lg-alert-icon { display: inline-flex; }
.lg-alert-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.lg-alert-meta { font-size: 11.5px; color: var(--mute); margin-bottom: 12px; }
.lg-alert-actions { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 620px) {
  .lg-alert-stack { right: 10px; left: 10px; bottom: 10px; }
  .lg-alert { width: auto; }
}

/* ============================================================
   Modal do shell — troca da própria senha
   ============================================================
   Fica aqui, e não num módulo, porque o menu do usuário vive no cabeçalho:
   está disponível em qualquer rota, inclusive nas do corretor, que não
   carrega os módulos de administração. */

.lg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: lg-modal-fade 180ms ease;
}
@keyframes lg-modal-fade { from { opacity: 0 } to { opacity: 1 } }

.lg-modal {
  /* Era var(--surface), que NÃO EXISTE no tema (só --surface-hover
     e --surface-active). Declaração inválida = fundo transparente, e a ficha
     de proposta aparecia por cima do espelho sem nada atrás. */
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  max-height: 90vh;
  overflow-y: auto;
  animation: lg-modal-pop 220ms ease;
}
@keyframes lg-modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(.98) }
  to   { opacity: 1; transform: none }
}

/* ─── Cabeçalho que ordena (shell/ordenacao.js) ─────── */
.lg-table th.lg-th-ord { cursor: pointer; user-select: none; white-space: nowrap; }
.lg-table th.lg-th-ord:hover { color: var(--text); }
.lg-table th.lg-th-ord.is-ativo { color: var(--text); }
.lg-th-seta { display: inline-block; min-width: 1em; margin-left: 4px; font-size: 9px; opacity: .8; }
