/* ═══════════════════════════════════════════════════════════════
   LicenseControl — painel
   Tema claro, alinhado à landing page (views/index.ejs).

   POR QUE TUDO ESTÁ EM VARIÁVEL
   Toda tela do painel usa as mesmas classes e as mesmas custom
   properties. Trocar o tema é trocar o bloco :root abaixo — não
   há cor decidida dentro de componente. Se um dia você quiser um
   modo escuro de volta, é um segundo :root e nada mais.

   TIPOGRAFIA — por que três famílias e não uma
   · Sora    → marca, títulos e NÚMEROS. É a fonte da landing;
               tem personalidade e amarra o painel ao site.
   · Inter   → texto de interface, tabelas, formulários. Sora em
               13px numa tabela densa cansa a vista; Inter foi
               desenhada exatamente para esse tamanho.
   · JetBrains Mono → CNPJ, CPF, token, datas. Documento e chave
               precisam de largura fixa para o olho conferir
               dígito por dígito.
   ═══════════════════════════════════════════════════════════════ */

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Superfícies — creme no fundo, branco no conteúdo.
     O creme evita o branco estourado de tela cheia e é o mesmo
     tom da landing, então o login não "muda de site". */
  --bg:          #f7f5f0;   /* fundo da página        */
  --bg2:         #ffffff;   /* cards, sidebar, topbar */
  --bg3:         #f3f0fd;   /* inputs, cabeçalho de tabela, hover */

  --border:      #e6dff5;
  --border-light:#d6cbef;

  /* Texto em roxo-tinta, não preto. Preto puro sobre creme vibra;
     a tinta arroxeada assenta e conversa com o roxo da marca. */
  --text:        #1a1035;
  --text-muted:  #6b5f92;
  --text-dim:    #9a8fbb;

  /* Um acento só. Estado (ok/atenção/erro) tem cor própria, mas
     nada mais compete com o roxo — é o que evita o visual de
     template com seis cores brigando. */
  --accent:      #4a2d9c;
  --accent-hover:#6b46e0;
  --accent-glow: rgba(74,45,156,.09);
  --accent2:     #0e7c66;   /* mono: token, documento */

  /* Cores de estado escurecidas o suficiente para passar em
     contraste sobre fundo claro (as versões neon do tema escuro
     ficariam ilegíveis aqui). */
  --success:     #12805a;
  --success-bg:  #e4f6ee;
  --warn:        #9a6207;
  --warn-bg:     #fdf1dd;
  --danger:      #b3302b;
  --danger-bg:   #fbe9e8;

  --radius:      12px;
  --radius-sm:   8px;
  --sidebar-w:   248px;

  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --display:     'Sora', 'Inter', sans-serif;
  --mono:        'JetBrains Mono', ui-monospace, monospace;

  /* Sombra em duas camadas: uma linha de contato quase invisível
     e um halo largo e fraco. Card com sombra única fica "colado". */
  --shadow:      0 1px 2px rgba(26,16,53,.04), 0 8px 24px -12px rgba(26,16,53,.10);
  --shadow-lg:   0 2px 4px rgba(26,16,53,.05), 0 24px 48px -20px rgba(26,16,53,.22);

  --transition:  .18s cubic-bezier(.4,0,.2,1);
}

html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Todo número de negócio usa algarismo de largura fixa: as
   colunas de valor alinham sozinhas e o número não "dança" ao
   atualizar. */
.stat-value, .td-mono, .detail-val.mono, table td, .token-value,
.days-badge, .money { font-variant-numeric: tabular-nums; }

/* ── Layout ─────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 11px;
}
.sidebar-brand .logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -4px rgba(74,45,156,.5);
}
.sidebar-brand .brand-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.3px;
  line-height: 1.2;
  color: var(--text);
}
.sidebar-brand .brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.nav-section {
  padding: 18px 8px 8px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--text-dim);
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  margin: 1px 0;
  white-space: nowrap;
  position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}
/* Trilho de 3px à esquerda do item ativo. Detalhe pequeno, mas é
   o que faz o olho achar onde está sem depender só da cor. */
.nav-item.active::before {
  content: '';
  position: absolute; left: -12px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg3);
}
.sidebar-footer .user-name {
  font-family: var(--display);
  font-weight: 600; color: var(--text); font-size: 13px;
}
.sidebar-footer .user-role {
  display: inline-block; font-size: 10px;
  background: var(--accent-glow); color: var(--accent);
  padding: 2px 7px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: .6px;
  font-weight: 600; margin-top: 3px;
}
.sidebar-footer a { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.sidebar-footer a:hover { color: var(--danger); }

/* ── Main ───────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* min-width:0 é o que impede um filho largo (tabela com muitas
     colunas, botão de rótulo comprido) de empurrar a página
     inteira para o lado. Sem isso o item flex adota a largura do
     conteúdo e nasce a barra de rolagem horizontal na janela. */
  min-width: 0;
}

/* Mesmo tratamento da nav da landing: fundo translúcido com blur,
   para o conteúdo passar por baixo sem virar uma barra opaca. */
.topbar {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  /* Em tela estreita o título e o botão descem em vez de esticar
     a barra e criar rolagem lateral. */
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 50;
}
.page-title {
  font-family: var(--display);
  font-size: 19px; font-weight: 700; letter-spacing: -.4px;
  color: var(--text);
  min-width: 0;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.content { padding: 28px 32px 48px; flex: 1; width: 100%; min-width: 0; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-family: var(--display);
  font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -.2px;
}
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Stat cards ────────────────────────────────────────────────
   Sem chip de ícone colorido e sem emoji: o dado é o número, e o
   número é a única coisa grande no card. A identidade vem da
   régua de 3px no topo, que muda de cor conforme o estado.
   ───────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1000px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px)  { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--border-light);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-card.is-accent::before  { background: var(--accent); }
.stat-card.is-success::before { background: var(--success); }
.stat-card.is-warn::before    { background: var(--warn); }
.stat-card.is-danger::before  { background: var(--danger); }

.stat-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .9px;
}
.stat-value {
  font-family: var(--display);
  font-size: 34px; font-weight: 700; color: var(--text);
  letter-spacing: -1.4px; line-height: 1.1;
}
.stat-foot { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

.stat-accent { color: var(--accent); }
.stat-warn   { color: var(--warn); }
.stat-danger { color: var(--danger); }
.stat-success{ color: var(--success); }

/* Mantidos por compatibilidade com telas antigas que ainda usem
   o chip de ícone; agora discretos, sem fundo neon. */
.stat-icon { width: 30px; height: 30px; border-radius: 8px; display:flex;
  align-items:center; justify-content:center; margin-bottom: 6px; font-size:15px; }
.si-blue   { background: var(--accent-glow); color: var(--accent); }
.si-green  { background: var(--success-bg);  color: var(--success); }
.si-warn   { background: var(--warn-bg);     color: var(--warn); }
.si-red    { background: var(--danger-bg);   color: var(--danger); }

/* Linha de indicadores financeiros */
.money-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .money-grid { grid-template-columns: 1fr; } }
.money { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -1px; }
.money .cents { font-size: .62em; font-weight: 600; opacity: .55; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 2px 8px -2px rgba(74,45,156,.45); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff;
  box-shadow: 0 4px 14px -3px rgba(107,70,224,.5); }

.btn-outline { background: var(--bg2); color: var(--text-muted); border-color: var(--border-light); }
.btn-outline:hover { background: var(--bg3); color: var(--accent); border-color: var(--accent); }

.btn-success { background: var(--success-bg); color: var(--success); border-color: #b9e5d2; }
.btn-success:hover { background: #d3efe3; color: var(--success); }

.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #f2cdcb; }
.btn-danger:hover { background: #f7d9d7; color: var(--danger); }

.btn-warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dcb4; }
.btn-warn:hover { background: #fae7c9; color: var(--warn); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .1px;
  border: 1px solid transparent;
  white-space: nowrap;   /* "Software house" não quebra em duas linhas */
}
.badge::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; flex-shrink:0; }
.badge-active    { background: var(--success-bg); color: var(--success); border-color:#c8ead9; }
.badge-expired   { background: var(--danger-bg);  color: var(--danger);  border-color:#f2cdcb; }
.badge-suspended { background: var(--warn-bg);    color: var(--warn);    border-color:#f0dcb4; }
.badge-cancelled { background: var(--bg3); color: var(--text-muted); border-color: var(--border); }
.badge-inactive  { background: var(--bg3); color: var(--text-muted); border-color: var(--border); }

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
/* Célula de ações: os botões ficam lado a lado sem transformar o
   <td> em flex container — td com display:flex sai do algoritmo
   de tabela e desalinha a coluna nas outras linhas.

   width:1% + nowrap é o truque clássico de tabela: a coluna encolhe
   até o tamanho do conteúdo e devolve o espaço para as colunas de
   dado, em vez de espremer os botões e empilhá-los um sobre o outro.
   Se ainda assim não couber, quem rola é a .table-wrap, não a
   página inteira. */
th.col-actions, td.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: flex; gap: 7px; align-items: center; justify-content: flex-end; }
thead tr { border-bottom: 1px solid var(--border); background: var(--bg3); }
thead th {
  padding: 12px 18px;
  text-align: left;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }
tbody td { padding: 13px 18px; color: var(--text); vertical-align: middle; }
.td-muted { color: var(--text-muted); font-size: 12.5px; }
.td-mono  { font-family: var(--mono); font-size: 12px; color: var(--text-muted);
  letter-spacing: -.2px; white-space: nowrap; }  /* documento nunca quebra no meio */

/* ── Forms ──────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 700px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1/-1; }
label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .7px;
}

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=tel], input[type=date], select, textarea {
  background: var(--bg2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 13px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:hover, select:hover, textarea:hover { border-color: var(--text-dim); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.form-section {
  font-family: var(--display);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); padding: 14px 0 4px;
  grid-column: 1/-1; border-top: 1px solid var(--border); margin-top: 10px;
}
.form-section:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* ── Alerts / Flash ─────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; margin-bottom: 18px;
  border: 1px solid transparent;
  border-left-width: 3px;
}
.alert-error   { background: var(--danger-bg);  border-color: #f2cdcb; border-left-color: var(--danger);  color: var(--danger); }
.alert-success { background: var(--success-bg); border-color: #c8ead9; border-left-color: var(--success); color: var(--success); }

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.search-bar input { max-width: 300px; font-size: 13px; padding: 8px 13px; }
.search-bar select { max-width: 170px; font-size: 13px; padding: 8px 11px; }

/* ── Token box ──────────────────────────────────────────────── */
.token-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm); padding: 11px 14px;
}
.token-value {
  font-family: var(--mono); font-size: 12px; color: var(--accent2);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Detail sections ────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-section { display: flex; flex-direction: column; gap: 8px; }
.detail-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 12px; color: var(--text-muted); flex-shrink: 0; font-weight: 500; }
.detail-val { font-size: 13.5px; text-align: right; color: var(--text); font-weight: 500; }
.detail-val.mono { font-family: var(--mono); font-size: 12.5px; color: var(--accent2); font-weight: 500; }

/* ── Expiry indicator ───────────────────────────────────────── */
.expiry-bar { height: 5px; border-radius: 3px; background: var(--bg3); overflow: hidden; margin-top: 6px; }
.expiry-fill { height: 100%; border-radius: 3px; background: var(--success); transition: width .4s; }
.expiry-fill.warn { background: var(--warn); }
.expiry-fill.danger { background: var(--danger); }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 20px; gap: 12px; color: var(--text-muted);
}
.empty-state svg { width: 40px; height: 40px; opacity: .3; }
.empty-state p { font-size: 13.5px; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(26,16,53,.42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  z-index: 200; align-items: center; justify-content: center; padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; width: 100%; max-width: 540px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-family: var(--display);
  font-size: 17px; font-weight: 700; margin-bottom: 20px; letter-spacing: -.3px;
}
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ── Days badge ─────────────────────────────────────────────── */
.days-badge {
  display: inline-block; font-family: var(--mono);
  font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 6px;
  border: 1px solid transparent;
}
.days-ok     { background: var(--success-bg); color: var(--success); border-color:#c8ead9; }
.days-warn   { background: var(--warn-bg);    color: var(--warn);    border-color:#f0dcb4; }
.days-danger { background: var(--danger-bg);  color: var(--danger);  border-color:#f2cdcb; }
.days-none   { background: var(--bg3); color: var(--text-muted); border-color: var(--border); }

/* ── Consulta de CNPJ na Receita ────────────────────────────── */
.lookup-status {
  font-size: 11.5px; line-height: 1.5; min-height: 16px;
  display: block; margin-top: 2px;
  text-transform: none; letter-spacing: 0; font-weight: 500;
  color: var(--text-dim);
}
.lookup-status.is-carregando { color: var(--text-muted); }
.lookup-status.is-ok         { color: var(--success); }
.lookup-status.is-aviso      { color: var(--warn); }
.lookup-status.is-erro       { color: var(--danger); }

/* Pisca o campo que acabou de ser preenchido pela consulta. Sem
   isso o operador não percebe que quatro campos abaixo da dobra
   mudaram sozinhos, e salva sem conferir. */
.campo-preenchido {
  animation: preenchido 2.2s ease-out;
}
@keyframes preenchido {
  0%   { background: var(--success-bg); border-color: var(--success); }
  70%  { background: var(--success-bg); border-color: var(--success); }
  100% { background: var(--bg2); border-color: var(--border-light); }
}

.cnpj-field { display: flex; gap: 8px; align-items: stretch; }
.cnpj-field input { flex: 1; }
.cnpj-field .btn { flex-shrink: 0; }

/* ── Nota informativa (caixa de explicação nas telas) ───────── */
.note {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}
.note strong { color: var(--text); font-weight: 600; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-light); border-radius: 8px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Seleção de texto na cor da marca ───────────────────────── */
::selection { background: rgba(107,70,224,.2); color: var(--text); }

/* ── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 780px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 14px 16px; }
}
