@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@800&display=swap');

/* ============================================
   Coletor NetFlow
   Tema: FlatHost — Dark & Light
   ============================================ */

/* ── TEMA ESCURO (padrão) ─────────────────── */
:root,
[data-theme="dark"] {
  /* Diz ao navegador que a página é escura. Sem isto, os controles NATIVOS
     (a lista que abre num <select>, calendário do date, scrollbar) são
     desenhados pelo sistema no esquema claro — versões recentes do Chrome
     deixaram de aplicar o background das <option> definido via CSS e passaram
     a decidir pelo color-scheme, o que fazia o dropdown abrir branco no meio
     do tema escuro. */
  color-scheme: dark;

  --dq: 61, 220, 132;
  --verde: #3ddc84;
  --verde-escuro: #2fc873;
  --verde-hover: #57e89a;
  --ciano: #2dd4bf;
  --vermelho: #f05a4f;
  --laranja: #ef8a3c;
  --amarelo: #f5b423;
  --roxo: #a86ede;

  /* Backgrounds */
  --bg-body:     #1a1c23;
  --bg-header:   #16181e;
  --bg-sidebar:  #16181e;
  --bg-card:     #20232e;
  --bg-input:    #16181e;
  --bg-section:  #16181e;
  --bg-hover:    rgba(var(--dq), 0.08);

  /* Brilho ambiente do fundo (aplicado em body::before).
     No claro fica "none" — ver bloco do tema claro. */
  --bg-glow:
    radial-gradient(1100px 560px at 60% -10%, rgba(var(--dq), 0.09), transparent 60%),
    radial-gradient(820px 480px at 8% 100%,   rgba(45,212,191,0.05), transparent 62%);

  /* Bordas */
  --borda:       #31343f;
  --borda-input: #3a3d49;

  /* Textos */
  --texto:       #eceef3;
  --texto-sec:   #979dab;
  --texto-muted: #6c7280;

  /* Apelidos (nomes alternativos usados no código das telas) --------------
     Vários trechos escrevem --texto-secundario / --fundo-card / --texto-principal.
     Esses nomes nunca existiram aqui, então caíam no valor padrão: texto sem a
     cor pretendida e, pior, FUNDO TRANSPARENTE em popovers (o conteúdo de trás
     aparecia através da caixa). Definir os apelidos corrige todos os usos de
     uma vez, sem precisar reescrever centenas de linhas espalhadas. */
  --texto-secundario: var(--texto-sec);
  --texto-principal:  var(--texto);
  --fundo-card:       var(--bg-card);
  --fundo-body:       var(--bg-body);
  --fundo-input:      var(--bg-input);
  --vermelho-claro:   #ef4444;

  /* Sombra */
  --shadow:      0 4px 22px rgba(0,0,0,0.45);
  --shadow-card: 0 2px 10px rgba(0,0,0,0.28);

  /* Stat cards */
  --stat-verde-bg:   rgba(var(--dq), 0.15);
  --stat-verde-icon: rgba(var(--dq), 0.2);
  --stat-azul-bg:    rgba(45,212,191,0.15);
  --stat-azul-icon:  rgba(45,212,191,0.2);
  --stat-red-bg:     rgba(231,76,60,0.15);
  --stat-red-icon:   rgba(231,76,60,0.2);
  --stat-roxo-bg:    rgba(155,89,182,0.15);
  --stat-roxo-icon:  rgba(155,89,182,0.2);
  --stat-lar-bg:     rgba(230,126,34,0.15);
  --stat-lar-icon:   rgba(230,126,34,0.2);
  --stat-amar-bg:    rgba(243,156,18,0.15);
  --stat-amar-icon:  rgba(243,156,18,0.2);

  /* Badge */
  --badge-success-bg: rgba(var(--dq), 0.18);
  --badge-danger-bg:  rgba(231,76,60,0.18);
  --badge-warning-bg: rgba(243,156,18,0.18);
  --badge-info-bg:    rgba(45,212,191,0.18);
  --badge-sec-bg:     rgba(160,160,192,0.15);

  /* Alert */
  --alert-success-bg: rgba(var(--dq), 0.1);
  --alert-danger-bg:  rgba(231,76,60,0.1);
  --alert-warning-bg: rgba(243,156,18,0.1);
  --alert-info-bg:    rgba(45,212,191,0.1);

  /* Ticket */
  --ticket-bubble-admin:  #20232e;
  --ticket-bubble-cliente: rgba(var(--dq), 0.09);
  --ticket-border-cliente: rgba(var(--dq), 0.2);

  /* Scrollbar */
  --scroll-track: #16181e;
  --scroll-thumb: #3a3d49;

  /* Btn secondary */
  --btn-sec-bg:   #262a35;
  --btn-sec-text: #eceef3;
  --btn-sec-border: #3a3d49;
  --btn-sec-hover: #30343f;

  /* Login */
  --login-box-shadow: 0 20px 60px rgba(0,0,0,0.65);

  /* Texto sobre o verde: no escuro o verde e claro, entao o texto vai escuro
     (mesma leitura do site). No claro o verde e fechado e o texto fica branco. */
  --btn-primary-text: #06140d;

  /* Toggle icon */

  --header-h: 70px;
  --sidebar-w: 260px;
  --radius: 8px;
  --trans: 0.2s ease;
}

/* ── TEMA CLARO ───────────────────────────── */
[data-theme="light"] {
  color-scheme: light;

  --dq: 22, 163, 74;
  --verde: #16a34a;
  --verde-escuro: #15803d;
  --verde-hover: #14532d;
  --ciano: #0d9488;
  --vermelho: #dc2626;
  --laranja: #ea580c;
  --amarelo: #d97706;
  --roxo: #7c3aed;

  /* Backgrounds */
  --bg-body:     #f0f2f5;
  --bg-header:   #ffffff;
  --bg-sidebar:  #ffffff;
  --bg-card:     #ffffff;
  --bg-input:    #f8fafc;
  --bg-section:  #f0f2f5;
  --bg-hover:    rgba(var(--dq), 0.06);

  /* Bordas */
  --borda:       #e2e8f0;
  --borda-input: #cbd5e1;

  /* Textos */
  --texto:       #0f172a;
  --texto-sec:   #64748b;
  --texto-muted: #94a3b8;

  /* Sombra */
  --shadow:      0 4px 20px rgba(0,0,0,0.1);
  --shadow-card: 0 1px 4px rgba(0,0,0,0.08);

  /* Stat cards */
  --stat-verde-bg:   rgba(var(--dq), 0.08);
  --stat-verde-icon: rgba(var(--dq), 0.15);
  --stat-azul-bg:    rgba(13,148,136,0.08);
  --stat-azul-icon:  rgba(13,148,136,0.15);
  --stat-red-bg:     rgba(220,38,38,0.08);
  --stat-red-icon:   rgba(220,38,38,0.15);
  --stat-roxo-bg:    rgba(124,58,237,0.08);
  --stat-roxo-icon:  rgba(124,58,237,0.15);
  --stat-lar-bg:     rgba(234,88,12,0.08);
  --stat-lar-icon:   rgba(234,88,12,0.15);
  --stat-amar-bg:    rgba(217,119,6,0.08);
  --stat-amar-icon:  rgba(217,119,6,0.15);

  /* Badge */
  --badge-success-bg: rgba(var(--dq), 0.12);
  --badge-danger-bg:  rgba(220,38,38,0.12);
  --badge-warning-bg: rgba(217,119,6,0.12);
  --badge-info-bg:    rgba(13,148,136,0.12);
  --badge-sec-bg:     rgba(100,116,139,0.12);

  /* Alert */
  --alert-success-bg: rgba(var(--dq), 0.08);
  --alert-danger-bg:  rgba(220,38,38,0.08);
  --alert-warning-bg: rgba(217,119,6,0.08);
  --alert-info-bg:    rgba(13,148,136,0.08);

  /* Ticket */
  --ticket-bubble-admin:  #f8fafc;
  --ticket-bubble-cliente: rgba(var(--dq), 0.06);
  --ticket-border-cliente: rgba(var(--dq), 0.2);

  /* Scrollbar */
  --scroll-track: #f0f2f5;
  --scroll-thumb: #cbd5e1;

  /* Btn secondary */
  --btn-sec-bg:   #ffffff;
  --btn-sec-text: #0f172a;
  --btn-sec-border: #e2e8f0;
  --btn-sec-hover: #f1f5f9;

  /* Login */
  --login-box-shadow: 0 10px 40px rgba(0,0,0,0.12);

  --bg-glow: none;
  --btn-primary-text: #ffffff;
}

/* ── TRANSIÇÃO SUAVE entre temas ─────────── */
*, *::before, *::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease;
}
/* Exceções: não animar transforms/positions */
.sidebar, .modal, .dropdown-menu, .btn, a, input, select, textarea {
  transition: background-color 0.25s ease, border-color 0.25s ease,
              color 0.2s ease, opacity 0.2s ease, transform 0.2s ease,
              box-shadow 0.2s ease;
}

/* ── RESET ───────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--texto);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* Brilho ambiente: fica fixo atras de todo o conteudo, nao intercepta clique
   e some no tema claro (--bg-glow: none). */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: var(--bg-glow, none);
  pointer-events: none;
  z-index: -1;
}

/* ── SCROLLBAR ───────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--verde); }

/* ── HEADER ──────────────────────────────── */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-header);
  border-bottom: 1px solid var(--borda);
  display: flex; align-items: center;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  font-weight: 700; font-size: 20px; color: var(--verde);
  flex-shrink: 0;
}
.header-logo img { height: 36px; }

.header-nav {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}

.header-nav a {
  color: var(--texto-sec);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
}
.header-nav a:hover, .header-nav a.active {
  color: var(--texto);
  background: var(--bg-hover);
}

.btn-area-cliente {
  background: var(--verde) !important;
  color: #fff !important;
  font-weight: 700 !important;
  padding: 8px 20px !important;
  border-radius: 6px !important;
}
.btn-area-cliente:hover { background: var(--verde-hover) !important; }

/* ── BOTÃO GOOGLE (OAuth) ────────────────── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--texto);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  margin-bottom: 16px;
}
.btn-google:hover {
  background: var(--bg-hover);
  border-color: var(--verde);
  color: var(--texto);
}

/* ── SEPARADOR "ou" ──────────────────────── */
.separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--texto-secundario);
  font-size: 12px;
}
.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--borda);
}
.separator::before { content: ''; }
.separator::after  { content: ''; }
.separator:empty::before { content: ''; }
.separator:not(:empty) {
  /* com texto "ou" dentro */
}
.separator-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--texto-secundario);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.separator-label::before,
.separator-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--borda);
}

/* ── SIDEBAR ─────────────────────────────── */
.sidebar {
  position: fixed; top: var(--header-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--borda);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  padding: 16px 0;
  transition: width .2s ease;
}

/* ── Sidebar colapsado ── */
.sidebar.collapsed { width: 52px; }
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .sidebar-user-name,
.sidebar.collapsed .sidebar-user-role,
.sidebar.collapsed a span,
.sidebar.collapsed .sidebar-badge { display: none !important; }
.sidebar.collapsed a {
  justify-content: center;
  padding: 10px 0;
  font-size: 18px;
  gap: 0;
}
.sidebar.collapsed .sidebar-user { padding: 12px 0; text-align: center; }

/* ── Botão toggle ── */
.sidebar-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px 12px;
  cursor: pointer;
  color: var(--texto-secundario);
  font-size: 13px;
  border-bottom: 1px solid var(--borda);
  margin-bottom: 8px;
  user-select: none;
}
.sidebar-toggle:hover { color: var(--texto); }
.sidebar-toggle svg { flex-shrink: 0; transition: transform .2s; }
.sidebar.collapsed .sidebar-toggle { justify-content: center; padding: 8px 0 12px; }
.sidebar.collapsed .sidebar-toggle span { display: none; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }


.sidebar-section {
  padding: 8px 16px 4px;
  font-size: 10px; font-weight: 700;
  color: var(--texto-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-top: 8px;
}

.sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: var(--texto-sec);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar a:hover {
  color: var(--texto);
  background: var(--bg-hover);
  border-left-color: rgba(var(--dq), 0.3);
}
.sidebar a.active {
  color: var(--verde);
  background: var(--bg-hover);
  border-left-color: var(--verde);
}

.sidebar-badge {
  margin-left: auto;
  background: var(--vermelho);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 100px;
  min-width: 20px; text-align: center;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--borda);
  margin-bottom: 8px;
}
.sidebar-user-name { font-weight: 600; font-size: 14px; color: var(--texto); }
.sidebar-user-role { font-size: 12px; color: var(--verde); margin-top: 2px; }

/* ── MAIN CONTENT ────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 28px;
  min-height: calc(100vh - var(--header-h));
  width: calc(100% - var(--sidebar-w));
  box-sizing: border-box;
  transition: margin-left .2s ease, width .2s ease;
}
.sidebar.collapsed ~ .main-content,
body.sidebar-collapsed .main-content {
  margin-left: 52px;
  width: calc(100% - 52px);
}

/* ── TOPBAR ──────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.topbar h1 { font-size: 22px; font-weight: 700; color: var(--texto); }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; }
/* Descrição curta embaixo do título da página */
.topbar-desc {
  font-size: 13.5px; color: var(--texto-sec);
  margin-top: 6px; max-width: 640px; line-height: 1.55;
}

.breadcrumb {
  font-size: 12px; color: var(--texto-sec);
  display: flex; align-items: center; gap: 6px;
}
.breadcrumb a { color: var(--verde); text-decoration: none; }
/* Antes isto era `color: var(--borda)`, pensado para o separador ">". Mas o
   markup usa <span> tambem para a data e o "Bem-vindo, Fulano", entao TODO o
   texto herdava a cor de uma borda — ilegivel. Os spans ficam no texto
   secundario; so o separador (.breadcrumb-sep) fica apagado. */
.breadcrumb span { color: var(--texto-sec); }
.breadcrumb .breadcrumb-sep { color: var(--texto-muted); }

/* ── STAT CARDS ──────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px; margin-bottom: 28px;
}
/* Nunca mais que 3 por linha */
@media (min-width: 901px) {
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .stat-cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .stat-cards.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
}


.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-card.verde::before  { background: var(--verde); }
.stat-card.azul::before   { background: var(--ciano); }
.stat-card.vermelho::before { background: var(--vermelho); }
.stat-card.roxo::before   { background: var(--roxo); }
.stat-card.laranja::before { background: var(--laranja); }
.stat-card.amarelo::before { background: var(--amarelo); }

.stat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-card.verde  .stat-icon { background: var(--stat-verde-icon); color: var(--verde); }
.stat-card.azul   .stat-icon { background: var(--stat-azul-icon);  color: var(--ciano); }
.stat-card.vermelho .stat-icon { background: var(--stat-red-icon); color: var(--vermelho); }
.stat-card.roxo   .stat-icon { background: var(--stat-roxo-icon);  color: var(--roxo); }
.stat-card.laranja .stat-icon { background: var(--stat-lar-icon);  color: var(--laranja); }
.stat-card.amarelo .stat-icon { background: var(--stat-amar-icon); color: var(--amarelo); }

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--texto); line-height: 1.1; }
.stat-label {
  font-size: 11px; color: var(--texto-sec); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px;
}
/* Linha de contexto opcional embaixo do rótulo ("desde 16/09 15:18") */
.stat-sub {
  font-size: 12px; color: var(--texto-muted);
  margin-top: 4px; line-height: 1.4;
}

/* ── CARDS ───────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--borda);
  display: flex; align-items: center; gap: 10px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--texto); flex: 1; }
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--borda);
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.03);
}

/* ── ÁREA DE SOLTAR ARQUIVO ──────────────── */
/* <label class="dropzone"> com o <input type="file"> dentro: o clique abre o
   seletor sem JS; arrastar e soltar é tratado pela página. */
.dropzone {
  display: block; position: relative;
  padding: 30px 20px; text-align: center; cursor: pointer;
  background: var(--bg-input);
  border: 1.5px dashed var(--borda-input);
  border-radius: var(--radius);
  transition: border-color var(--trans), background var(--trans);
}
.dropzone:hover,
.dropzone:focus-within { border-color: var(--verde); }
.dropzone.arrastando   { border-color: var(--verde); background: var(--bg-hover); }
.dropzone.escolhido    { border-style: solid; border-color: var(--verde); }
.dropzone.invalido     { border-style: solid; border-color: var(--vermelho); }
/* Escondido só visualmente: continua focável pelo teclado */
.dropzone input[type="file"] {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.dropzone-icone  { font-size: 26px; line-height: 1; margin-bottom: 10px; }
.dropzone-titulo { font-size: 14.5px; font-weight: 600; color: var(--texto); word-break: break-all; }
.dropzone-dica   { font-size: 12.5px; color: var(--texto-sec); margin-top: 6px; line-height: 1.5; }
.dropzone.invalido .dropzone-dica { color: var(--vermelho); }

/* ── TABELAS ─────────────────────────────── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--texto-sec);
  text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid var(--borda);
  background: rgba(0,0,0,0.03);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--borda);
  vertical-align: middle;
  font-size: 13px;
  color: var(--texto);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }

/* ── BOTÕES ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px;
  border: none; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--verde); color: var(--btn-primary-text); }
.btn-primary:hover { background: var(--verde-hover); color: var(--btn-primary-text); }

.btn-secondary {
  background: var(--btn-sec-bg);
  color: var(--btn-sec-text);
  border: 1px solid var(--btn-sec-border);
}
.btn-secondary:hover { background: var(--btn-sec-hover); }

.btn-danger { background: var(--vermelho); color: #fff; }
.btn-danger:hover { opacity: 0.88; }

/* Texto escuro sobre o amarelo: branco em cima de amarelo tem contraste ruim
   e some em tela clara. */
.btn-warning { background: var(--amarelo); color: #1a1c23; font-weight: 600; }
.btn-warning:hover { opacity: 0.88; }

.btn-info { background: var(--ciano); color: #fff; }
.btn-info:hover { opacity: 0.88; }

.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-lg  { padding: 13px 28px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-outline { background: transparent; border: 1px solid currentColor; }
.btn-outline.btn-primary { color: var(--verde); }
.btn-outline.btn-primary:hover { background: var(--verde); color: #fff; }

/* ── FORMULÁRIOS ─────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--texto-sec);
}
.form-label .required { color: var(--vermelho); }

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--borda-input);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px; color: var(--texto);
  outline: none;
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(var(--dq), 0.15);
}
.form-control::placeholder { color: var(--texto-muted); }
select.form-control option,
select.form-control optgroup {
  background: var(--bg-card);
  color: var(--texto);
}
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint  { font-size: 11px; color: var(--texto-sec);  margin-top: 5px; }
.form-error { font-size: 12px; color: var(--vermelho); margin-top: 5px; }

/* ── BADGES / STATUS ─────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-success { background: var(--badge-success-bg); color: var(--verde); }
.badge-danger  { background: var(--badge-danger-bg);  color: var(--vermelho); }
.badge-warning { background: var(--badge-warning-bg); color: var(--amarelo); }
.badge-info    { background: var(--badge-info-bg);    color: var(--ciano); }
.badge-secondary { background: var(--badge-sec-bg);  color: var(--texto-sec); }

/* ── ALERTS ──────────────────────────────── */
/* Fluxo de texto normal, NÃO flex.
   Com `display:flex` aqui, cada pedaço de texto solto entre tags virava um
   item anônimo do flex container: um alerta com <strong>Título</strong> seguido
   de texto e de um <a> se quebrava em três colunas lado a lado. Quem precisa de
   ícone à esquerda + conteúdo à direita declara o flex no próprio elemento
   (ex: cliente/fatura.php) ou usa .alert-flex abaixo. */
.alert {
  padding: 14px 18px; border-radius: var(--radius);
  margin-bottom: 20px; font-size: 13px;
  line-height: 1.65;
  border-left: 4px solid;
}

/* Variante para alerta com ícone/ação em coluna própria. */
.alert-flex {
  display: flex; align-items: flex-start; gap: 12px;
}
.alert-success { background: var(--alert-success-bg); border-color: var(--verde);    color: var(--verde); }
.alert-danger  { background: var(--alert-danger-bg);  border-color: var(--vermelho); color: var(--vermelho); }
.alert-warning { background: var(--alert-warning-bg); border-color: var(--amarelo);  color: var(--amarelo); }
.alert-info    { background: var(--alert-info-bg);    border-color: var(--ciano);    color: var(--ciano); }

[data-theme="light"] .alert-success { color: #15803d; }
[data-theme="light"] .alert-danger  { color: #b91c1c; }
[data-theme="light"] .alert-warning { color: #92400e; }
[data-theme="light"] .alert-info    { color: #0f766e; }

/* ── HERO (Site público) ─────────────────── */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px;
  background:
    linear-gradient(rgba(10,10,30,0.82), rgba(10,10,30,0.82)),
    url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1400') center/cover no-repeat;
  margin-top: var(--header-h);
}
.hero-content { max-width: 720px; }
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900; line-height: 1.15;
  margin-bottom: 20px; color: #ffffff;
}
.hero h1 span { color: var(--verde); }
.hero p { font-size: 18px; color: rgba(255,255,255,0.75); margin-bottom: 36px; line-height: 1.7; }
.hero-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── SECTIONS (Site) ─────────────────────── */
.section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { font-size: 36px; font-weight: 800; margin-bottom: 12px; }
.section-title p  { color: var(--texto-sec); font-size: 17px; }

/* ── PRICING CARDS ───────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.pricing-card {
  background: var(--bg-card);
  border: 2px solid var(--borda);
  border-radius: 12px; padding: 32px;
  position: relative;
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card.destaque { border-color: var(--verde); }

.pricing-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--verde); color: #fff;
  padding: 4px 18px; border-radius: 100px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; white-space: nowrap;
}
.pricing-name  { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.pricing-desc  { color: var(--texto-sec); font-size: 13px; margin-bottom: 24px; }
.pricing-price { font-size: 42px; font-weight: 900; color: var(--verde); margin-bottom: 4px; }
.pricing-price sup { font-size: 18px; vertical-align: super; margin-right: 2px; }
.pricing-price sub { font-size: 14px; vertical-align: baseline; color: var(--texto-sec); }
.pricing-period { color: var(--texto-sec); font-size: 13px; margin-bottom: 28px; }

.pricing-features { list-style: none; margin-bottom: 28px; }
.pricing-features li {
  padding: 7px 0; font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--borda);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li::before { content: '✓'; color: var(--verde); font-weight: 700; }

/* ── FATURA ──────────────────────────────── */
.fatura-box { max-width: 700px; margin: 0 auto; }
.fatura-header {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.fatura-itens .table td:last-child,
.fatura-itens .table th:last-child { text-align: right; }
.fatura-total {
  background: rgba(var(--dq), 0.08);
  border-top: 2px solid var(--verde);
  padding: 16px 20px;
  display: flex; justify-content: space-between;
  font-size: 18px; font-weight: 800; color: var(--verde);
}

.boleto-code {
  font-family: 'Courier New', monospace; font-size: 13px;
  background: var(--bg-input);
  padding: 12px 16px; border-radius: 6px;
  border: 1px solid var(--borda);
  word-break: break-all; color: var(--texto-sec);
}

.pix-qrcode { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 20px; }
.pix-qrcode img { max-width: 200px; border-radius: 8px; }

/* ── TICKETS ─────────────────────────────── */
.ticket-mensagens { display: flex; flex-direction: column; gap: 16px; }

.ticket-msg { display: flex; gap: 14px; max-width: 90%; }
.ticket-msg.admin   { align-self: flex-start; }
.ticket-msg.cliente { align-self: flex-end; flex-direction: row-reverse; }

.ticket-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.ticket-msg.admin   .ticket-avatar { background: var(--stat-verde-icon); color: var(--verde); }
.ticket-msg.cliente .ticket-avatar { background: var(--stat-azul-icon);  color: var(--ciano); }

.ticket-bubble {
  background: var(--ticket-bubble-admin);
  border: 1px solid var(--borda);
  border-radius: 12px; padding: 14px 18px;
  font-size: 13.5px; line-height: 1.65; flex: 1;
  color: var(--texto);
}
.ticket-msg.cliente .ticket-bubble {
  background: var(--ticket-bubble-cliente);
  border-color: var(--ticket-border-cliente);
}
.ticket-meta { font-size: 11px; color: var(--texto-sec); margin-bottom: 6px; font-weight: 600; }

/* ── MODAL ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: 12px;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--borda);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--texto); }
/* Escopado só ao X do cabeçalho — .modal-close também é usado como gancho de
   JS (fecha o modal) em botões "Cancelar" no rodapé (ex: <button class="btn
   btn-secondary modal-close">), e esse estilo de ícone solto (sem padding,
   fonte grande, fica vermelho) não deveria valer pra esses, senão o botão
   perde toda a aparência de botão. Restringindo ao contexto do cabeçalho,
   os botões do rodapé caem de volta no visual normal de .btn.btn-secondary,
   sem perder a função de fechar o modal (o nome da classe continua igual). */
.modal-header .modal-close {
  cursor: pointer; font-size: 22px; background: none; border: none;
  color: var(--texto-sec); line-height: 1; padding: 0;
}
.modal-header .modal-close:hover { color: var(--vermelho); }
.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--borda);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── LOGIN ───────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(var(--dq), 0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(45,212,191,0.07) 0%, transparent 50%),
    var(--bg-body);
}
.login-box {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--login-box-shadow);
}
.login-header {
  padding: 32px; text-align: center;
  border-bottom: 1px solid var(--borda);
  background: linear-gradient(135deg, rgba(var(--dq), 0.06), rgba(45,212,191,0.04));
}
.login-header img { height: 48px; margin-bottom: 12px; }
.login-header h2  { font-size: 20px; font-weight: 700; color: var(--texto); }
.login-header p   { color: var(--texto-sec); font-size: 13px; margin-top: 4px; }
.login-body { padding: 32px; }

/* ── DROPDOWN ────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none;
  position: absolute; top: 100%; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  min-width: 180px;
  z-index: 1100; overflow: hidden;
  box-shadow: var(--shadow);
  animation: fadeDown 0.15s ease;
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown:hover .dropdown-menu,
.dropdown.open  .dropdown-menu { display: block; }

.dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  color: var(--texto-sec); text-decoration: none;
  font-size: 13px;
}
.dropdown-menu a:hover { background: var(--bg-hover); color: var(--texto); }
.dropdown-divider { height: 1px; background: var(--borda); margin: 4px 0; }

/* ── TABS ────────────────────────────────── */
.tabs {
  display: flex; border-bottom: 1px solid var(--borda);
  margin-bottom: 24px; gap: 4px;
}
.tab-btn {
  padding: 10px 18px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: var(--texto-sec);
  border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover  { color: var(--texto); }
.tab-btn.active { color: var(--verde); border-bottom-color: var(--verde); }
.tab-content        { display: none; }
.tab-content.active { display: block; }

/* ── PAGINAÇÃO ───────────────────────────── */
.pagination {
  display: flex; gap: 6px; flex-wrap: wrap;
  align-items: center; justify-content: center; padding: 16px;
}
.page-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 13px; font-weight: 600;
  text-decoration: none; color: var(--texto-sec);
  border: 1px solid var(--borda);
}
.page-btn:hover, .page-btn.active {
  background: var(--verde); color: #fff; border-color: var(--verde);
}

/* ── RESPONSIVO ──────────────────────────── */

/* Telas intermediárias: sidebar menor */
@media (max-width: 1280px) {
  :root { --sidebar-w: 220px; }
  .main-content { padding: 24px 20px; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .main-content { padding: 20px 18px; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr; }
}

/* Mobile: sidebar oculta, ativada por botão */
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .sidebar-overlay.open { display: block; }
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 16px;
  }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-actions { margin-left: 0; width: 100%; }
  .hero h1 { font-size: 28px; }
  .btn-menu-toggle {
    display: flex !important;
    align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: var(--bg-hover);
    border: 1px solid var(--borda);
    border-radius: 8px; cursor: pointer;
    font-size: 18px; color: var(--texto);
  }
}

@media (min-width: 769px) {
  .btn-menu-toggle { display: none !important; }
  .sidebar-overlay  { display: none !important; }
}

/* ── RESPONSIVO GERAL (2.4.25) ─────────────
   A base já se adaptava (sidebar, .form-row, .table-responsive), mas as
   telas montam grades com style inline — "2fr 1fr", "1fr 1fr 1fr",
   minmax(320px…) — que no celular viravam duas ou três colunas de 100px,
   com texto quebrando letra a letra. Aqui essas grades caem para uma
   coluna, e qualquer tabela larga rola dentro do próprio card em vez de
   empurrar a página para o lado.
   Grades pequenas de propósito (campo + botão, teclado do 2FA) ficam como
   estão: não entram nos seletores abaixo. */
@media (max-width: 768px) {
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns:1fr 2fr"],
  [style*="grid-template-columns: 3fr 1fr"],
  [style*="grid-template-columns:3fr 1fr"],
  [style*="grid-template-columns: 240px 1fr"],
  [style*="grid-template-columns:240px 1fr"],
  [style*="grid-template-columns: 260px 1fr"],
  [style*="grid-template-columns:260px 1fr"],
  [style*="minmax(320px"],
  [style*="minmax(300px"],
  [style*="minmax(280px"],
  [style*="minmax(260px"] {
    grid-template-columns: 1fr !important;
  }

  /* Tabela larga rola dentro do card, não na página. */
  .card { overflow-x: auto; }
  .table { width: 100%; }

  /* Barras de ação e filtros empilham em vez de espremer. */
  .topbar-actions { flex-wrap: wrap; }
  .topbar-actions > * { flex: 1 1 auto; }

  /* Nome de host, e-mail e chave SSH não estouram a largura. */
  .card, .table td, .table th { overflow-wrap: anywhere; }
}

@media (max-width: 480px) {
  .main-content { padding: 12px; }
  .card-header h3 { font-size: 15px; }
  .table td, .table th { padding: 8px 10px; font-size: 12.5px; }
  .btn { padding: 8px 12px; }
  /* Modal usa a largura da tela: 440px não cabe num celular. */
  .modal { width: 100%; max-width: 100% !important; }
}

/* ── UTILITÁRIOS ─────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted   { color: var(--texto-sec); }
.text-success { color: var(--verde); }
.text-danger  { color: var(--vermelho); }
.text-warning { color: var(--amarelo); }
.text-info    { color: var(--ciano); }

.mt-1 { margin-top: 8px; }   .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }  .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }

.separator { height: 1px; background: var(--borda); margin: 24px 0; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--texto-sec); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--texto); }
.empty-state p  { font-size: 14px; }

/* ── TEMA CLARO: ajustes finos ───────────── */
[data-theme="light"] .table th { background: #f8fafc; }
[data-theme="light"] .card-footer { background: #f8fafc; }
[data-theme="light"] .stat-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.12); }
[data-theme="light"] .hero { /* hero sempre escuro */ }
[data-theme="light"] .fatura-total { background: rgba(var(--dq), 0.07); }
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.45); }
[data-theme="light"] select.form-control option,
[data-theme="light"] select.form-control optgroup { background: #ffffff; color: var(--texto); }

/* ===== PWA: safe areas (notch / barra de gestos) quando instalado standalone ===== */
@media (display-mode: standalone) {
  .header {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-h) + env(safe-area-inset-top));
  }
  .main-content {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sidebar {
    padding-top: env(safe-area-inset-top);
  }
}

/* ===== SELECT CUSTOMIZADO (nocselect.js) =====================================
   A lista de um <select> nativo é desenhada pelo sistema operacional e ignora
   o CSS da página — em Chrome recente ela abre branca mesmo no tema escuro.
   Aqui o <select> real fica escondido (mas presente, para o formulário) e o
   controle visível é HTML comum, que obedece ao tema como qualquer outro.
   ========================================================================== */
.nsel { position: relative; display: inline-block; vertical-align: middle; }
/* Select com .form-control ocupa a largura da célula, como o nativo. Sem
   isto o wrapper encolhia/crescia pelo texto da opção: rótulo longo
   ("local-lvm — 125 GB livres…") vazava por cima do campo vizinho na grade,
   e rótulo curto deixava o campo estreito. */
.nsel.nsel-bloco { display: block; width: 100%; min-width: 0; max-width: 100%; }

/* Escondido sem display:none — precisa continuar sendo enviado no submit e
   participar da validação nativa do formulário */
select.nsel-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 100% !important; height: 100% !important;
  left: 0; top: 0; margin: 0 !important; padding: 0 !important;
  border: 0 !important; z-index: -1;
}

.nsel-btn {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--borda-input);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px; font-family: inherit; color: var(--texto);
  cursor: pointer; text-align: left; line-height: 1.2;
}
.nsel-btn:hover { border-color: var(--verde); }
.nsel-btn:focus {
  outline: none; border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(var(--dq), 0.15);
}
.nsel-label {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nsel-arrow { opacity: .55; font-size: 11px; flex-shrink: 0; }
.nsel-aberto .nsel-arrow { transform: rotate(180deg); }
.nsel-disabled .nsel-btn { opacity: .55; cursor: not-allowed; }

/* Painel ancorado no body: dentro do card seria cortado pelo overflow */
.nsel-pop {
  position: fixed; z-index: 4000;
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  overflow: hidden;
  display: flex; flex-direction: column;
}
[data-theme="light"] .nsel-pop { box-shadow: 0 12px 32px rgba(0,0,0,0.18); }

.nsel-busca {
  border: 0; border-bottom: 1px solid var(--borda);
  background: var(--bg-input); color: var(--texto);
  padding: 10px 12px; font-size: 13px; font-family: inherit;
  outline: none; flex-shrink: 0;
}
.nsel-busca::placeholder { color: var(--texto-muted); }

.nsel-lista { overflow-y: auto; padding: 4px 0; }

.nsel-op {
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--texto);
}
.nsel-op:hover, .nsel-op.ativo { background: rgba(var(--dq), 0.12); }
.nsel-op.sel { color: var(--verde); font-weight: 600; }
.nsel-op.off { opacity: .45; cursor: not-allowed; }
.nsel-vazio {
  padding: 14px 12px; font-size: 12.5px; color: var(--texto-sec);
  text-align: center;
}

/* ==========================================================================
   VIDA NO LAYOUT (2.16.38)
   --------------------------------------------------------------------------
   O brilho ambiente existia só atrás do conteúdo: header e menu lateral eram
   blocos chapados e opacos, então metade da tela ficava "morta". Agora:
     • o fundo tem mais camadas de luz (verde/ciano), com um leve movimento
       lento, e uma trama fina de pontos que some nas bordas;
     • header e menu lateral são vidro fosco: deixam a luz de trás aparecer e
       ganham o próprio brilho, com fio de luz na borda;
     • item ativo do menu com gradiente e barra luminosa;
     • cards, stat-cards, tabelas e botões com reflexo e brilho de cor.
   Tudo aqui é só visual (nenhum seletor muda layout/tamanho) e respeita
   "reduzir movimento" do sistema operacional. Vale para admin, portal do
   cliente e site — todos carregam este arquivo.
   ========================================================================== */
:root,
[data-theme="dark"] {
  --bg-glow:
    radial-gradient(900px 520px at 70% -8%,  rgba(var(--dq), 0.13), transparent 62%),
    radial-gradient(700px 520px at -6% 12%,  rgba(var(--dq), 0.10), transparent 60%),
    radial-gradient(760px 560px at 4% 104%,  rgba(45,212,191,0.10), transparent 62%),
    radial-gradient(900px 600px at 100% 100%, rgba(45,212,191,0.06), transparent 60%);
  --vida-grade: rgba(255,255,255,0.035);
  --vida-vidro-header:  rgba(20,22,28,0.72);
  --vida-vidro-sidebar: rgba(20,22,28,0.62);
  --vida-fio: rgba(var(--dq), 0.45);
  --vida-reflexo: rgba(255,255,255,0.035);
  --vida-card-borda-hover: rgba(var(--dq), 0.28);
}
[data-theme="light"] {
  --bg-glow:
    radial-gradient(900px 520px at 70% -8%,  rgba(var(--dq), 0.10), transparent 62%),
    radial-gradient(700px 520px at -6% 12%,  rgba(var(--dq), 0.07), transparent 60%),
    radial-gradient(760px 560px at 4% 104%,  rgba(13,148,136,0.08), transparent 62%),
    radial-gradient(900px 600px at 100% 100%, rgba(13,148,136,0.05), transparent 60%);
  --vida-grade: rgba(15,23,42,0.045);
  --vida-vidro-header:  rgba(255,255,255,0.78);
  --vida-vidro-sidebar: rgba(255,255,255,0.66);
  --vida-fio: rgba(var(--dq), 0.35);
  --vida-reflexo: rgba(255,255,255,0.6);
  --vida-card-borda-hover: rgba(var(--dq), 0.30);
}

/* Fundo: a luz fica um pouco maior que a tela e "respira" devagar. */
body::before {
  inset: -12%;
  animation: vidaRespira 38s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes vidaRespira {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2.5%, 1.5%, 0) scale(1.04); }
  100% { transform: translate3d(-2%, 2.5%, 0) scale(1.02); }
}
/* Trama de pontos, bem fraca, que se apaga longe do topo. */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(var(--vida-grade) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 85%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 85%);
}

/* ── Header de vidro com fio de luz embaixo ── */
.header {
  background: var(--vida-vidro-header);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
          backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: transparent;
}
.header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, var(--vida-fio) 18%, rgba(45,212,191,0.45) 55%, transparent 100%);
  pointer-events: none;
}

/* ── Menu lateral de vidro, com luz própria ── */
.sidebar {
  background:
    radial-gradient(420px 260px at 0% 0%,    rgba(var(--dq), 0.10), transparent 70%),
    radial-gradient(360px 300px at 0% 100%,  rgba(45,212,191,0.08), transparent 70%),
    var(--vida-vidro-sidebar);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
  /* Fio de luz vertical na borda direita (fica na caixa, não rola junto). */
  border-right: 1px solid transparent;
  border-image: linear-gradient(180deg, var(--vida-fio) 0%, rgba(45,212,191,0.20) 45%, rgba(255,255,255,0.04) 100%) 1;
}
@media (max-width: 768px) {
  .sidebar { -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%); }
}

/* Bloco do usuário: cartão com leve brilho */
.sidebar-user {
  margin: 0 12px 10px;
  border: 1px solid rgba(var(--dq), 0.12);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(var(--dq), 0.10), rgba(45,212,191,0.04) 60%, transparent);
  box-shadow: inset 0 1px 0 var(--vida-reflexo);
  padding: 12px 14px;
}
.sidebar.collapsed .sidebar-user { margin: 0 6px 10px; padding: 10px 0; }

/* Títulos de seção com um tracinho de cor */
.sidebar-section {
  display: flex; align-items: center; gap: 8px;
}
.sidebar-section::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(var(--dq), 0.22), transparent);
}

/* Itens: pílula com gradiente, sem mexer no alinhamento existente */
.sidebar a {
  position: relative;
  margin: 1px 10px;
  border-radius: 8px;
  border-left: none;
  padding-left: 14px;
}
.sidebar a:hover {
  background: linear-gradient(90deg, rgba(var(--dq), 0.10), rgba(var(--dq), 0.02) 80%);
  transform: translateX(2px);
}
.sidebar a.active {
  color: var(--verde);
  background: linear-gradient(90deg, rgba(var(--dq), 0.20), rgba(45,212,191,0.06) 70%, transparent);
  box-shadow: inset 0 0 0 1px rgba(var(--dq), 0.16), 0 4px 18px -8px rgba(var(--dq), 0.45);
  font-weight: 600;
}
.sidebar a.active::before {
  content: '';
  position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--verde);
  box-shadow: 0 0 10px 1px rgba(var(--dq), 0.75);
}
.sidebar.collapsed a { margin: 1px 6px; padding: 10px 0; }
.sidebar.collapsed a:hover { transform: none; }
.sidebar.collapsed a.active::before { left: -6px; }
.sidebar-badge { box-shadow: 0 0 10px rgba(240,90,79,0.55); }

/* ── Cards com reflexo no topo e borda que acende ── */
.card, .stat-card, .login-box {
  background:
    linear-gradient(180deg, var(--vida-reflexo), transparent 90px),
    var(--bg-card);
  box-shadow: var(--shadow-card), inset 0 1px 0 var(--vida-reflexo);
}
.card:hover { border-color: var(--vida-card-borda-hover); }
.card-header {
  background: linear-gradient(90deg, rgba(var(--dq), 0.05), transparent 60%);
}

/* Stat cards: brilho da própria cor no canto e número com luz */
.stat-card { --vida-cor: 61,220,132; }
.stat-card.azul     { --vida-cor: 45,212,191; }
.stat-card.vermelho { --vida-cor: 240,90,79; }
.stat-card.roxo     { --vida-cor: 168,110,222; }
.stat-card.laranja  { --vida-cor: 239,138,60; }
.stat-card.amarelo  { --vida-cor: 245,180,35; }
.stat-card {
  background:
    radial-gradient(220px 140px at 100% 0%, rgba(var(--vida-cor),0.16), transparent 70%),
    linear-gradient(180deg, var(--vida-reflexo), transparent 90px),
    var(--bg-card);
}
.stat-card::before { box-shadow: 0 0 14px 1px rgba(var(--vida-cor),0.6); }
.stat-card:hover {
  border-color: rgba(var(--vida-cor),0.35);
  box-shadow: var(--shadow), 0 10px 30px -14px rgba(var(--vida-cor),0.55);
}
.stat-icon { box-shadow: 0 0 0 1px rgba(var(--vida-cor, 61,220,132),0.18), 0 6px 16px -8px rgba(var(--vida-cor, 61,220,132),0.6); }

/* ── Tabelas ── */
.table th {
  background: linear-gradient(180deg, rgba(var(--dq), 0.05), rgba(0,0,0,0.03));
}
.table tbody tr { position: relative; }
.table tbody tr:hover {
  background: linear-gradient(90deg, rgba(var(--dq), 0.09), rgba(var(--dq), 0.02) 70%);
}
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--verde); }

/* ── Botões com brilho ── */
.btn-primary {
  background: linear-gradient(135deg, var(--verde-hover), var(--verde) 55%, var(--verde-escuro));
  box-shadow: 0 4px 14px -6px rgba(var(--dq), 0.65), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--verde-hover), var(--verde-hover));
  box-shadow: 0 6px 20px -6px rgba(var(--dq), 0.85), inset 0 1px 0 rgba(255,255,255,0.3);
  transform: translateY(-1px);
}
.btn-danger  { box-shadow: 0 4px 14px -6px rgba(240,90,79,0.6); }
.btn-warning { box-shadow: 0 4px 14px -6px rgba(245,180,35,0.6); }
.btn-info    { box-shadow: 0 4px 14px -6px rgba(45,212,191,0.6); }
.btn-secondary:hover { border-color: var(--vida-card-borda-hover); }
.btn:active { transform: scale(0.97); }

/* Campos: foco com halo mais vivo */
.form-control:focus {
  box-shadow: 0 0 0 3px rgba(var(--dq), 0.15), 0 0 18px -4px rgba(var(--dq), 0.45);
}

/* Janelas e menus suspensos: vidro */
.modal-overlay { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal, .dropdown-menu {
  box-shadow: var(--shadow), 0 0 0 1px rgba(var(--dq), 0.10), 0 20px 50px -20px rgba(var(--dq), 0.25);
}

/* Barra de rolagem com o verde da marca */
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--scroll-thumb), rgba(var(--dq), 0.35)); }

/* Tema claro: reflexos brancos pesam menos, sombras de cor mais suaves */
[data-theme="light"] .btn-primary { box-shadow: 0 4px 14px -6px rgba(var(--dq), 0.55), inset 0 1px 0 rgba(255,255,255,0.25); }
[data-theme="light"] .sidebar-user { border-color: rgba(var(--dq), 0.18); }
[data-theme="light"] .sidebar a.active::before { box-shadow: 0 0 8px rgba(var(--dq), 0.55); }

/* Quem pediu menos movimento no sistema operacional não vê animação. */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .sidebar a:hover, .btn-primary:hover { transform: none; }
}

/* ==========================================================================
   VIDA NO LAYOUT — parte 2 (2.16.39)
   Componentes que toda tela usa: selos, avisos, abas, paginação, listas
   suspensas, vazio, fatura, login — e a entrada suave do conteúdo.
   ========================================================================== */

/* Entrada: os blocos da página sobem e aparecem, um depois do outro.
   Só os filhos diretos do .main-content (não se repete quando uma tela
   atualiza os próprios cards por JavaScript). */
.main-content > * { animation: vidaEntra .45s cubic-bezier(.2,.7,.2,1) backwards; }
.main-content > *:nth-child(2) { animation-delay: .04s; }
.main-content > *:nth-child(3) { animation-delay: .08s; }
.main-content > *:nth-child(4) { animation-delay: .12s; }
.main-content > *:nth-child(5) { animation-delay: .16s; }
.main-content > *:nth-child(n+6) { animation-delay: .20s; }
@keyframes vidaEntra {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
/* Tela cheia do painel de links e modais não animam a entrada */
body.pl-cheia .main-content > * { animation: none; }

/* Selos: contorno fino da própria cor e um leve brilho (sem pontinho:
   muitos selos já trazem 🟢/🔴/✅ no texto). */
.badge { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent), 0 0 12px -6px currentColor; }

/* Avisos: faixa lateral luminosa e brilho que some para a direita */
.alert { border-left-width: 3px; position: relative; box-shadow: -2px 0 14px -6px currentColor; }
.alert-success { background: linear-gradient(90deg, rgba(var(--dq), 0.16), var(--alert-success-bg) 60%); }
.alert-danger  { background: linear-gradient(90deg, rgba(240,90,79,0.16),  var(--alert-danger-bg) 60%); }
.alert-warning { background: linear-gradient(90deg, rgba(245,180,35,0.16), var(--alert-warning-bg) 60%); }
.alert-info    { background: linear-gradient(90deg, rgba(45,212,191,0.16), var(--alert-info-bg) 60%); }

/* Abas: sublinhado vira fio de luz */
.tabs { border-bottom-color: transparent; position: relative; }
.tabs::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--dq), 0.45), rgba(45,212,191,0.15) 50%, transparent);
}
.tab-btn { border-radius: 8px 8px 0 0; transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.tab-btn:hover { background: linear-gradient(180deg, transparent, rgba(var(--dq), 0.06)); }
.tab-btn.active {
  background: linear-gradient(180deg, transparent, rgba(var(--dq), 0.12));
  box-shadow: 0 8px 16px -10px var(--verde);
  position: relative; z-index: 1;
}

/* Paginação */
.page-btn { transition: all .2s ease; }
.page-btn:hover { background: rgba(var(--dq), 0.12); color: var(--verde); }
.page-btn.active {
  background: linear-gradient(135deg, var(--verde-hover), var(--verde));
  color: var(--btn-primary-text); box-shadow: 0 4px 14px -5px var(--verde);
}

/* Listas suspensas (select do sistema) e menu do usuário: vidro */
.nsel-pop, .dropdown-menu {
  background: linear-gradient(180deg, rgba(var(--dq), 0.05), transparent 60px), var(--bg-card);
}
.nsel-pop { box-shadow: 0 12px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(var(--dq), 0.10); }
.nsel-op { transition: background .12s ease, color .12s ease, padding-left .12s ease; }
.nsel-op:hover, .nsel-op.ativo {
  background: linear-gradient(90deg, rgba(var(--dq), 0.16), rgba(var(--dq), 0.03));
  padding-left: 15px;
}
.nsel-btn { background: linear-gradient(180deg, var(--vida-reflexo), transparent), var(--bg-input); transition: border-color .2s ease, box-shadow .2s ease; }
.nsel-btn:hover { box-shadow: 0 0 14px -6px var(--verde); }
.dropdown-menu a { transition: background .12s ease, padding-left .12s ease; }
.dropdown-menu a:hover { background: linear-gradient(90deg, rgba(var(--dq), 0.14), transparent); }

/* Campo de texto: leve reflexo (os de busca ficam mais "vivos") */
.form-control { transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.form-control:hover:not(:focus):not(:disabled) { border-color: color-mix(in srgb, var(--verde) 35%, var(--borda-input)); }
input[type="search"].form-control:focus { background-color: var(--bg-card); }

/* Botões secundários com reflexo */
.btn-secondary { background: linear-gradient(180deg, var(--vida-reflexo), transparent), var(--btn-sec-bg); }
.btn-secondary:hover { box-shadow: 0 4px 14px -8px var(--verde); }

/* Vazio: ícone flutua */
.empty-state .empty-icon { opacity: .6; animation: vidaFlutua 5s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(var(--dq), 0.35)); }
@keyframes vidaFlutua { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Fatura e login */
.fatura-header { background: linear-gradient(135deg, rgba(var(--dq), 0.08), transparent 60%), var(--bg-card); }
.fatura-total  { background: linear-gradient(90deg, rgba(var(--dq), 0.16), rgba(var(--dq), 0.04)); text-shadow: 0 0 18px rgba(var(--dq), 0.4); }
.login-box { box-shadow: var(--login-box-shadow), 0 0 0 1px rgba(var(--dq), 0.10), 0 30px 80px -30px rgba(var(--dq), 0.35); }
.login-wrap { position: relative; }

/* Zona de arrastar arquivo */
.dropzone { background: linear-gradient(180deg, rgba(var(--dq), 0.04), transparent), var(--bg-input); }
.dropzone:hover, .dropzone.arrastando { box-shadow: 0 0 22px -8px var(--verde); }

/* Tema claro: avisos sem brilho lateral */
[data-theme="light"] .alert { box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .main-content > *, .empty-state .empty-icon { animation: none; }
}

/* ── Ícones do menu lateral (traço fino, herdam a cor do texto) ── */
.sidebar a .ico-menu {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .85; transition: opacity .15s;
}
.sidebar a:hover .ico-menu, .sidebar a.active .ico-menu { opacity: 1; }
.sidebar.collapsed a .ico-menu { width: 20px; height: 20px; }
