/* Portal R2 — CSS próprio, sem framework/build. Tema escuro. */
:root {
  --bg: #020617;
  --surface: #0f172a;
  --surface-2: #1e293b;
  --border: #1e293b;
  --border-2: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --faint: #64748b;
  --brand: #1278be;
  --brand-hover: #1a8ad6;
  --brand-400: #4aa3dc;
  --brand-soft: rgba(18, 120, 190, 0.15);
  --red: #ef4444;
  --green: #10b981;
  --amber: #f59e0b;
  --sky: #38bdf8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  /* superfícies derivadas (viram variáveis p/ o tema claro adaptar) */
  --card-bg: rgba(15, 23, 42, 0.6);
  --header-bg: rgba(15, 23, 42, 0.8);
  --row-hover: rgba(30, 41, 59, 0.4);
}

/* ===== Tema claro (cinza bem clarinho). NÃO se aplica à tela de login. ===== */
html[data-theme="light"] {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #e9eef4;
  --border: #dbe3ec;
  --border-2: #c2cdda;
  --text: #0f172a;
  --muted: #475569;
  --faint: #7c8aa0;
  --brand: #1278be;
  --brand-hover: #0f6aa8;
  --brand-400: #0f6aa8;
  --brand-soft: rgba(18, 120, 190, 0.12);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.10);
  --card-bg: #ffffff;
  --header-bg: #f5f8fb;
  --row-hover: rgba(18, 120, 190, 0.06);
}
/* contraste de badges/alertas no tema claro (texto claro ficaria ilegível no fundo claro) */
html[data-theme="light"] .badge--active, html[data-theme="light"] .badge-public { color: #047857; }
html[data-theme="light"] .badge--provisioning { color: #b45309; }
html[data-theme="light"] .badge--suspended { color: #c2410c; }
html[data-theme="light"] .badge--canceled { color: #b91c1c; }
html[data-theme="light"] .badge-private { color: #475569; }
html[data-theme="light"] .badge-named { color: #1d4ed8; }
/* Seletor de tema (Configurações › Conta) */
.theme-switch { display: inline-flex; gap: 0.35rem; }
.theme-opt { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-2); }
.theme-opt--active { background: var(--brand); color: #fff; border-color: var(--brand); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Barra de rolagem vertical SEMPRE presente: o conteúdo (e os cabeçalhos) nunca deslocam
   quando ela aparece/some. overflow-y:scroll funciona em todos os navegadores. */
html { overflow-y: scroll; scrollbar-gutter: stable; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
.boot { padding: 4rem; text-align: center; color: var(--muted); }

/* ---------- Layout ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
}
.app-header__inner {
  max-width: 1120px; margin: 0 auto; padding: 0.4rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.5rem; }
.brand__logo {
  width: 32px; height: 32px; border-radius: 8px; background: var(--brand);
  color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px;
}
.brand__title { font-size: 0.875rem; font-weight: 600; line-height: 1; }
.brand__sub { font-size: 0.75rem; color: var(--faint); }
.nav { display: flex; gap: 0.25rem; }
.nav a {
  color: var(--muted); padding: 0.5rem 0.75rem; border-radius: 8px;
  font-size: 0.875rem; font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--brand); color: #fff; }
.header-user { display: flex; align-items: center; gap: 0.75rem; }
.header-user__name { color: var(--muted); font-size: 0.875rem; }
@media (max-width: 640px) { .header-user__name { display: none; } }
main.container { max-width: none; margin: 0; padding: 1.5rem 1.5rem; }

/* ---------- Sidebar lateral (estilo painel) ---------- */
.layout__main { margin-left: 64px; }
.layout__main--full { margin-left: 0; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 64px; z-index: 40;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: visible;
}
.sidebar--expanded { width: 244px; box-shadow: 6px 0 28px rgba(0,0,0,0.5); }

/* topo: avatar + nome */
.sidebar__top { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.7rem; min-height: 62px; }
.sidebar__avatar {
  width: 40px; height: 40px; border-radius: 11px; background: var(--brand);
  color: #fff; font-weight: 700; font-size: 1.1rem; display: grid; place-items: center; flex-shrink: 0;
}
.sidebar__avatar--img { object-fit: cover; padding: 0; background: none; }
.sidebar__id { display: flex; flex-direction: column; overflow: hidden; }
.sidebar__name { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__role { font-size: 0.72rem; color: var(--faint); white-space: nowrap; }

/* botão de trava circular na borda */
.sidebar__pin {
  position: absolute; top: 70px; right: -13px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; border: 3px solid var(--bg); cursor: pointer;
  display: grid; place-items: center; font-size: 0.7rem; z-index: 41; padding: 0;
}
.sidebar__pin:hover { background: var(--brand-hover); }

/* navegação por seções */
.sidebar__nav { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.4rem 0.5rem; flex: 1; overflow-y: auto; overflow-x: hidden; }
.sidebar__grouptitle {
  font-size: 0.62rem; letter-spacing: 0.09em; color: var(--faint); text-transform: uppercase;
  padding: 0.7rem 0.55rem 0.25rem; margin: 0;
}
.sidebar__link {
  position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.55rem;
  border-radius: 9px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 0.92rem;
}
.sidebar__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar__link.active { background: var(--brand-soft); color: var(--brand-400); font-weight: 600; }
.sidebar__link.active::before {
  content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.sidebar__icon { width: 24px; height: 24px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.sidebar__arrow { margin-left: auto; opacity: 0; transition: opacity .12s; }
.sidebar__link.active .sidebar__arrow { opacity: 1; }

/* rodapé: sair */
.sidebar__foot { padding: 0.5rem; border-top: 1px solid var(--border); }
.sidebar__logout {
  display: flex; align-items: center; gap: 0.7rem; width: 100%; background: none; border: none;
  color: var(--muted); cursor: pointer; font: inherit; font-size: 0.85rem; padding: 0.55rem; border-radius: 9px; white-space: nowrap;
}
.sidebar__logout:hover { background: var(--surface-2); color: var(--text); }

/* recolhida: só ícones (esconde textos, id, títulos e setas) */
.sidebar:not(.sidebar--expanded) .sidebar__label,
.sidebar:not(.sidebar--expanded) .sidebar__id,
.sidebar:not(.sidebar--expanded) .sidebar__grouptitle,
.sidebar:not(.sidebar--expanded) .sidebar__arrow { display: none; }
.sidebar:not(.sidebar--expanded) .sidebar__top { justify-content: center; padding: 0.7rem 0; }
.sidebar--expanded .sidebar__logout { justify-content: center; }

/* ---------- Tipografia ---------- */
h1 { font-size: 1.5rem; font-weight: 600; margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head__titles { display: flex; align-items: center; gap: 0.85rem; }
/* Botão Voltar: pílula discreta que destaca na cor da marca ao passar o mouse. */
.back-btn { flex-shrink: 0; border-radius: 999px; padding: 0.4rem 0.95rem; font-weight: 500; gap: 0.3rem; }
.back-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.cfg-head { margin-bottom: 0.6rem; }
.subtitle { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 8px; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; transition: background-color .15s, border-color .15s;
  font-family: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.link-btn { background: none; border: none; cursor: pointer; font: inherit; font-size: 0.75rem; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.link-sky { color: var(--sky); }
.link-red { color: #f87171; }
.link-green { color: #34d399; }
.link-amber { color: #fbbf24; }
.icon-btn { background: none; border: none; cursor: pointer; padding: 0.25rem; display: inline-flex; align-items: center; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Form ---------- */
.field { margin-bottom: 1rem; }
.label { display: block; margin-bottom: 0.25rem; font-size: 0.7rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.input {
  width: 100%; border: 1px solid var(--border-2); background: var(--surface);
  border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.875rem; color: var(--text);
  font-family: inherit;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
/* Campo com rótulo à ESQUERDA do input (mesma linha) */
.field--inline { display: flex; align-items: center; gap: 0.6rem; }
.field--inline > .label { margin-bottom: 0; white-space: nowrap; }
.field--inline .input { flex: 1; min-width: 0; }
/* Inputs estreitos (vencem o flex:1 acima por maior especificidade) */
.field--inline .input--narrow { flex: 0 0 auto; width: 6rem; }
.field--inline .input--uf { flex: 0 0 auto; width: 4rem; text-transform: uppercase; }
.field--inline .input--num { flex: 0 0 auto; width: 6rem; }
.field--inline .input--city { flex: 0 0 auto; width: 11rem; }
.field--inline .input--cep { flex: 0 0 auto; width: 6.5rem; text-align: center; }
.field--inline .input--ie { flex: 0 0 auto; width: 9rem; }
.field--inline .input--slug { flex: 0 0 auto; width: 9rem; }
.field--inline .input--cnpj { flex: 0 0 auto; width: 11rem; }
.field--inline .input--cpf { flex: 0 0 auto; width: 9.5rem; }
.field--inline .input--phone { flex: 0 0 auto; width: 11rem; text-align: center; }
.field--inline .input--cel { flex: 0 0 auto; width: 11.5rem; text-align: center; }
.field--inline .input--email { flex: 0 0 auto; width: 18rem; }
.field--inline .input--ramal { flex: 0 0 auto; width: 5rem; }
.field--inline .input--plan { flex: 0 0 auto; width: 11rem; }
.field--inline .input--login { flex: 0 0 auto; width: 18rem; }
.phone-row, .inline-row { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.phone-row:last-child, .inline-row:last-child { margin-bottom: 0; }
/* nas linhas inline os campos não têm margem própria (senão desalinham com botões, ex.: Sintegra) */
.phone-row .field, .inline-row .field { margin-bottom: 0; }
/* fieldset que termina logo após o último campo (não estica até a borda) */
.fieldset--fit { width: -moz-fit-content; width: fit-content; max-width: 100%; }
/* Duas colunas: Dados da empresa (esq.) e Dados do responsável (dir.) */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.two-col > fieldset { margin: 0; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
/* Validação de campo (ex.: CPF) */
.input--invalid, .input--invalid:focus { border-color: #ef4444; box-shadow: 0 0 0 1px #ef4444; }
.field-msg { color: #ef4444; font-size: 0.72rem; white-space: nowrap; }
/* Botão de chamada para o Sintegra (ao lado da IE) — mesma altura/alinhamento do input */
.sintegra-link { flex: 0 0 auto; white-space: nowrap; font-size: 0.8rem; padding: 0.5rem 0.75rem; line-height: 1.5;
  border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); background: var(--surface); text-decoration: none; }
.sintegra-link:hover { border-color: var(--brand); color: var(--brand); }
/* Endereço em grade: Endereço cresce; Número/Cidade/UF fixos.
   2ª linha: CEP + Complemento ocupam só a coluna do Endereço (Complemento termina onde o Endereço termina). */
.addr-grid { display: grid; grid-template-columns: 1fr auto auto auto; gap: 0.75rem; align-items: end; }
.addr-grid > .field { margin-bottom: 0; }
.addr-cep-comp { grid-column: 1 / 2; display: flex; gap: 0.75rem; align-items: center; }
.addr-cep-comp .field { margin-bottom: 0; }
.addr-grow2 { flex: 1; min-width: 0; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; margin: 0 0 1rem; }
legend { padding: 0 0.25rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); }
.form-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin-bottom: 1.5rem; }
.toolbar .field { margin: 0; }
/* Na toolbar, campos De/Até inline mantêm a largura natural do input de data. */
.toolbar .field--inline .input { flex: 0 0 auto; }
/* Botões rápidos de período (7 dias, 30 dias, 6 meses, 1 ano) — linha própria, abaixo dos campos, centralizados. */
.quick-range { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; justify-content: center; flex: 1 0 100%; }
/* Toolbar do BI: mais respiro entre os campos De/Até para não ficarem "trepados". */
.bi-toolbar { gap: 1.5rem; row-gap: 0.85rem; align-items: center; }
/* Campos centralizados (espaçadores laterais) e Exportar fixo à direita. */
.bi-toolbar__spacer { flex: 1 1 0; }
.bi-toolbar__center { display: flex; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.bi-toolbar__right { flex: 1 1 0; display: flex; justify-content: flex-end; }
.bi-toolbar .field--inline { gap: 0.5rem; }
.bi-toolbar .field--inline .label { margin-right: 0.15rem; }
/* Campos de data compactos (largura só do necessário para a data + ícone). */
.bi-toolbar .input[type="date"] { width: 9rem; padding: 0.5rem 0.55rem; }

/* ---------- Cards / Stats ---------- */
.card { border: 1px solid var(--border); background: var(--card-bg);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.5rem; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stats--6 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1024px) { .stats--6 { grid-template-columns: repeat(6, 1fr); } }
.stats--4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .stats--4 { grid-template-columns: repeat(4, 1fr); } }
.stat__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stat__value { font-size: 1.5rem; font-weight: 600; margin-top: 0.25rem; }
.stat__sub { font-size: 0.75rem; color: var(--faint); margin-top: 0.25rem; }
/* stats compactos: cards menores (ex.: topo da tela Arquivos) */
.stats--compact { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.stats--compact .card { padding: 0.35rem 0.9rem; min-width: 120px; text-align: center; }
.stats--compact .stat__label { font-size: 0.6rem; }
.stats--compact .stat__value { font-size: 1rem; margin-top: 0; }
.stats--compact .stat__sub { font-size: 0.6rem; margin-top: 0; }
/* Card de uso do plano (franquia) na tela Consumo — abaixo dos cards de consumo */
.plan-usage { text-align: left; }
.progress-fill--warn   { background: #f59e0b; } /* amarelo: perto do limite */
.progress-fill--danger { background: #ef4444; } /* vermelho: limite atingido */
/* Blocos da tela Consumo: contornos empilhados (Consumo atual em cima, Histórico embaixo) */
.usage-box, .usage-section {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem 1.25rem; max-width: 760px; margin: 0 0 1.5rem;
}
.usage-box__title, .usage-section__title { text-align: center; display: block; margin: 0 0 0.75rem; }
.usage-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.usage-pair .card { text-align: center; padding: 0.7rem 0.9rem; }
.usage-pair .stat__value { font-size: 1.3rem; margin-top: 0.1rem; }
.usage-pair .stat__sub { margin-top: 0.15rem; }
/* Consumo atual: 3 cards na linha — Armazenamento | Objetos | Uso do plano (mais largo) */
.usage-now { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; align-items: stretch; }
.usage-now > .card { text-align: center; padding: 0.7rem 0.9rem; }
.usage-now .stat__value { font-size: 1.3rem; margin-top: 0.1rem; }
.usage-now .stat__sub { margin-top: 0.15rem; }
.usage-now > .plan-usage { grid-column: 1 / -1; text-align: left; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 640px) { .usage-now { grid-template-columns: 1fr; } }
/* Controles de período dentro do bloco Histórico: contorno que abraça o conteúdo, centralizado */
.usage-period { display: flex; flex-direction: column; justify-content: center; width: fit-content; max-width: 100%; margin: 0 auto 1rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; }
.usage-period__row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.usage-period__row .label { margin: 0; min-width: 36px; text-align: left; }
.usage-period__row .input { width: 160px; }
/* botões e Aplicar com a mesma largura dos campos, alinhados sobre eles */
.usage-period__presets { width: 160px; margin: 0 0 0.7rem auto; display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.usage-period__presets .btn { width: 100%; }
.usage-period__apply { width: 160px; margin: 0.2rem 0 0 auto; }
.usage-period__apply .btn { width: 100%; }
/* Histórico: período à esquerda, cards (Armazenamento médio em cima, Objetos máx. embaixo) à direita */
.usage-hist-top { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: stretch; justify-content: center; margin-bottom: 1rem; }
.usage-hist-top .usage-period { margin: 0; }
/* Cards do histórico de consumo: em LINHA (um ao lado do outro), abaixo da toolbar. */
.usage-hist-cards { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-bottom: 1rem; }
.usage-hist-cards .card { text-align: center; padding: 0.8rem 1rem; flex: 1 1 160px; max-width: 300px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.usage-hist-cards .stat__value { font-size: 1.3rem; margin-top: 0.1rem; }
.usage-hist-cards .stat__sub { margin-top: 0.15rem; }
/* Tela Consumo: cards saltam no hover e rótulos DE/ATÉ centralizados sobre os campos */
.usage-view .card { transition: transform .15s ease, box-shadow .15s ease; }
.usage-view .card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.usage-toolbar, .billing-toolbar { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.usage-toolbar .field, .billing-toolbar .field { align-items: center; text-align: center; }
.usage-toolbar .label, .billing-toolbar .label { display: block; text-align: center; }
/* Fatura: contorno "Período" com a mesma largura do bloco de cards abaixo, campos centralizados */
.billing-toolbar { display: flex; justify-content: center; align-items: flex-end; gap: 0.75rem; width: 100%; max-width: 600px; box-sizing: border-box; }
/* Fatura do cliente: coluna estreita, cards e contorno alinhados à esquerda */
.billing-client { max-width: 600px; }
.billing-client .card { width: 100%; }
.billing-client__top { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.billing-client__top .card { text-align: center; transition: transform .15s ease, box-shadow .15s ease; }
.billing-client__top .card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
/* Balão de informação ("i") nos títulos de seção */
.info-label { display: inline-flex; align-items: center; gap: 0.45rem; }
.info-wrap { position: relative; display: inline-flex; }
.info-dot {
  width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border-2);
  background: transparent; color: var(--faint); cursor: pointer;
  font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 700;
  font-size: 0.72rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  text-transform: none; letter-spacing: normal;
}
.info-dot:hover { color: var(--text); border-color: var(--brand); }
.info-balloon {
  position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 8px);
  width: 240px; max-width: 80vw;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 0.6rem 0.75rem; text-align: left; font-size: 0.72rem; line-height: 1.4; color: var(--faint);
  text-transform: none; letter-spacing: normal; font-weight: 400;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.12s ease; z-index: 70;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.info-balloon.show { opacity: 1; visibility: visible; }

/* layout em 2 colunas: tabela à esquerda, cards/ação à direita */
.files-layout { display: flex; gap: 1rem; align-items: flex-start; }
.files-layout__main { flex: 1; min-width: 0; }
.files-side { width: 150px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.6rem; position: sticky; top: 0.5rem; }
.files-side .card { text-align: center; padding: 0.7rem 0.5rem; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.files-side .card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.files-side__action { width: 100%; justify-content: center; }
@media (max-width: 760px) {
  .files-layout { flex-direction: column-reverse; }
  .files-side { width: 100%; flex-direction: row; flex-wrap: wrap; position: static; }
  .files-side .card { flex: 1; }
  .files-side__action { width: 100%; }
}
/* Cabeçalho da tela de arquivos: breadcrumb (esq.) + alternador (dir.) */
.files-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
/* Navegação estilo Explorer: botões Voltar/Subir + barra de endereço */
.explorer-nav { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.4rem; }
.nav-btn { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.nav-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* Barra de endereço estilo Windows Explorer */
.breadcrumb { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; overflow: visible; cursor: text;
  border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); padding: 2px; font-size: 0.85rem; }
/* Barra de endereço editável (digitar/copiar o caminho). */
.breadcrumb--edit { padding: 0; cursor: auto; }
.crumb-input { width: 100%; border: none; background: transparent; color: var(--text); font: inherit; font-size: 0.85rem;
  padding: 0.4rem 0.65rem; border-radius: 8px; outline: none; }
.crumb { background: none; border: none; padding: 0.3rem 0.55rem; border-radius: 5px; color: var(--text);
  cursor: pointer; font: inherit; white-space: nowrap; }
.crumb:hover { background: var(--surface-2); }
.crumb--current { font-weight: 600; cursor: default; }
.crumb--current:hover { background: none; }
.crumb-sep { display: inline-flex; align-items: center; color: var(--faint); padding: 0 1px; user-select: none; }
.crumb-sep:hover { color: var(--text); }
/* Separador interativo (estilo Explorer): abre dropdown das subpastas. */
.crumb-sep--menu { position: relative; padding: 0; }
.crumb-sep__btn { background: none; border: none; color: var(--faint); cursor: pointer; padding: 0 3px; font: inherit; line-height: 1; }
.crumb-sep--menu:hover .crumb-sep__btn, .crumb-sep--menu.open .crumb-sep__btn { color: var(--brand-400); }
.crumb-menu { position: absolute; top: 100%; left: 0; margin-top: 3px; z-index: 80; min-width: 150px; max-height: 280px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); padding: 4px; display: none; }
.crumb-sep--menu.open .crumb-menu { display: block; }
.crumb-menu__item { display: flex; align-items: center; gap: 0.45rem; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); cursor: pointer; padding: 0.4rem 0.6rem; border-radius: 6px; font: inherit; font-size: 0.82rem; white-space: nowrap; }
.crumb-menu__item:hover { background: var(--surface-2); }
.crumb-menu__ico { display: inline-flex; color: var(--brand); }
.crumb-menu__ico svg { width: 15px; height: 15px; }
/* Pastas */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, 150px); gap: 0.6rem; margin-bottom: 1rem; }
.folder-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; padding: 0.7rem 0.5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s; }
.folder-card__kebab { position: absolute; top: 3px; right: 3px; padding: 2px; }
.folder-card__kebab svg { width: 16px; height: 16px; }
.folder-card:hover { border-color: var(--brand); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.folder-card__icon { color: var(--brand); display: inline-flex; flex-shrink: 0; }
.folder-card__icon svg { width: 32px; height: 32px; }
.folder-card__info { min-width: 0; width: 100%; }
.folder-card__name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Alternador Lista/Grade */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-btn { background: var(--surface); border: none; padding: 0.4rem 0.6rem; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; }
.view-btn + .view-btn { border-left: 1px solid var(--border); }
.view-btn:hover { color: var(--text); }
.view-btn.active { background: var(--brand); color: #fff; }
/* Barras fixas no topo (ações + explorer) ao rolar a lista.
   O padding-bottom impede a margem do último filho de "vazar" pra fora da área fixa. */
.files-bar { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 0.25rem 0 0.6rem; }
/* Barra de ações (Enviar arquivos + Nova pasta, em ícone) */
.files-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.85rem; }
.files-actions .bulk-bar { flex: 1; margin: 0; }
.icon-btn--action { width: 40px; height: 40px; justify-content: center; border: 1px solid var(--border-2); }
.icon-btn--action svg { width: 20px; height: 20px; }
.icon-btn--action:hover { border-color: currentColor; }
/* Área de conteúdo: padding-top dá folga p/ o card "saltar" no hover sem ir sob a barra fixa;
   min-height dá espaço vazio clicável p/ desmarcar a seleção */
.files-content { min-height: 55vh; padding-top: 1rem; }
/* Grade de arquivos (miniaturas) */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.85rem; }
/* Grade pequena (arquivos e pastas compactos) */
.file-grid--sm { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.5rem; }
.file-grid--sm .file-card__namerow { padding: 0.3rem 0.2rem 0 0.4rem; }
.file-grid--sm .file-card__name { font-size: 0.7rem; }
.file-grid--sm .file-card__meta { display: none; }
.file-grid--sm .kebab-btn svg { width: 15px; height: 15px; }
.file-grid--sm .file-card__badge { right: auto; left: 50%; transform: translateX(-50%); }
.folder-grid--sm { grid-template-columns: repeat(auto-fill, 104px); }
.folder-grid--sm .folder-card { padding: 0.45rem 0.35rem; gap: 0.2rem; }
.folder-grid--sm .folder-card__icon svg { width: 24px; height: 24px; }
.folder-grid--sm .folder-card__name { font-size: 0.72rem; }
.folder-grid--sm .folder-card .file-card__meta { font-size: 0.62rem; }
.file-card { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s; }
.file-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
/* Card levantado no hover fica à FRENTE dos vizinhos (evita o ícone/cartão ficar "por baixo"). */
.folder-card:hover, .folder-card.is-selected, .file-card:hover, .file-card.is-selected { z-index: 5; }
/* QR Code (modal) — QR à esquerda, informações à direita. */
.qr-modal { max-width: 44rem; }
.qr-layout { display: flex; gap: 1.5rem; align-items: center; flex-wrap: nowrap; }
.qr-info { display: flex; flex-direction: column; gap: 0.6rem; flex: 1 1 auto; min-width: 0; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; flex: 0 0 auto; }
.qr-name { margin: 0; max-width: 240px; text-align: center; font-weight: 600; color: var(--text); font-size: 0.9rem; word-break: break-all; }
@media (max-width: 520px) { .qr-layout { flex-wrap: wrap; justify-content: center; } }
.qr-box { background: #fff; padding: 8px; border-radius: 10px; }
.qr-box canvas, .qr-box svg { display: block; }
/* Alinha o "ⓘ" com o texto do label da validade. */
.qr-info .label-row > span { display: inline-flex; align-items: center; }
.qr-info .hint { font-size: 0.78rem; line-height: 1; }
/* Botões alinhados em grade 2×2. */
.qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.6rem; }
.qr-actions .btn { width: 100%; }
.folder-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
/* Destaque do alvo ao arrastar para dentro */
.folder-card.drop-target, .crumb.drop-target, .tree-row.drop-target { outline: 2px dashed var(--brand); outline-offset: 2px; background: var(--brand-soft); }
/* Layout com árvore de pastas à esquerda */
.files-shell { display: flex; gap: 1rem; align-items: flex-start; }
.files-shell__main { flex: 1; min-width: 0; }

/* border-collapse: separate é ESSENCIAL — sticky no thead NÃO funciona com border-collapse: collapse. */
.table-wrap--sticky table { border-collapse: separate; border-spacing: 0; }
/* Tela Arquivos: a página NÃO rola (topo travado) e SÓ a tabela rola por dentro (scrollbar na tabela),
   com o cabeçalho fixo no topo dela. Encadeamento flex em altura cheia. */
.files-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; padding: 1rem 1.5rem 0; --files-bar-h: 0px; }
.files-page .files-bar { position: static; padding: 0 0 0.6rem; }
.files-page .files-shell { flex: 1 1 auto; min-height: 0; overflow: hidden; align-items: stretch; }
.files-page .files-shell__main { display: flex; flex-direction: column; min-height: 0; }
/* O .files-content é o ÚNICO scroller — vale para a lista (com thead fixo) E para a grade.
   overflow-y:scroll (sempre) evita o cabeçalho deslocar quando a rolagem aparece/some. */
.files-page .files-content { flex: 1 1 auto; min-height: 0; overflow-y: scroll; scrollbar-gutter: stable; padding-top: 0; }
/* Cabeçalho da tabela SEMPRE no topo do scroller (top:0), com contorno próprio (a borda do
   wrap rola junto, então o thead carrega a sua). */
.files-page .table--compact thead th { position: sticky; top: 0; z-index: 15; background: var(--surface);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border-2); }
.files-page .tree { position: static; margin-top: 0; max-height: 100%; }
/* Avatar + Configurações + Sair alinhados à direita na barra "Nova pasta". */
.files-actions .files-head__user { margin-left: auto; }
.tree { width: 230px; flex-shrink: 0; margin-top: 1rem; position: sticky; top: var(--files-bar-h, 0px);
  max-height: calc(100vh - var(--files-bar-h, 0px) - 24px); overflow: auto;
  border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--surface); }
/* Coluna esquerda da tela Arquivos: árvore + seletor de tema embaixo. */
.files-tree-col { width: 230px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.files-tree-col .tree { width: 100%; margin-top: 0; }
.files-page .files-tree-col .tree { flex: 1 1 auto; min-height: 0; }
.files-theme { display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem; background: var(--surface); }
.files-theme__label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.files-theme .theme-switch { flex-wrap: wrap; justify-content: center; }
@media (max-width: 640px) { .files-theme { display: none; } }
.tree-row { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 0.82rem; white-space: nowrap; color: var(--text); }
.tree-row:hover { background: var(--surface-2); }
.tree-row.active { background: var(--brand); color: #fff; }
.tree-row.active .tree-ico, .tree-row.active .tree-toggle { color: #fff; }
.tree-root { font-weight: 600; margin-bottom: 2px; }
.tree-toggle { flex-shrink: 0; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; background: none; border: none; color: var(--muted); cursor: pointer; padding: 0; transition: transform 0.12s; }
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle--empty { visibility: hidden; }
.tree-toggle svg { width: 12px; height: 12px; }
.tree-ico { display: inline-flex; color: var(--brand); flex-shrink: 0; }
.tree-ico svg { width: 16px; height: 16px; }
.tree-name { overflow: hidden; text-overflow: ellipsis; }
.tree-count { margin-left: auto; flex-shrink: 0; min-width: 1.3rem; padding: 0 0.45rem; height: 1.3rem;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: 0.72rem; font-weight: 700; line-height: 1; }
/* Na linha ativa (fundo da cor da marca), inverte para manter legível. */
.tree-row.active .tree-count { background: #fff; color: var(--brand); }
@media (max-width: 640px) { .tree { display: none; } }
.file-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.file-card__thumb { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); display: grid; place-items: center; }
.file-card__thumb .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s; }
.file-card__thumb .thumb[src] { opacity: 1; }
.file-card__thumb .thumb--failed { display: none; }
.thumb-ph { position: absolute; color: var(--faint); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.05em; }
.file-card__sel { position: absolute; top: 0.4rem; left: 0.4rem; width: 20px; height: 20px; border-radius: 999px;
  background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.file-card__sel svg { width: 13px; height: 13px; }
.file-card__badge { position: absolute; top: 0.4rem; right: 0.4rem; margin: 0; font-size: 0.6rem;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 7px; border-radius: 999px; }
.file-card__badge.badge-public { background: rgba(16,185,129,0.92); color: #07301f; }
.file-card__badge.badge-private { background: rgba(148,163,184,0.92); color: #1f2937; }
.file-card__badge.badge-named { background: rgba(59,130,246,0.92); color: #0a2342; }
.file-card__name { padding: 0.5rem 0.6rem 0; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.file-card__meta { padding: 0.1rem 0.6rem 0.5rem; font-size: 0.7rem; color: var(--muted); text-align: center; }
/* Linha do nome com o botão "..." (menu de ações) */
.file-card__namerow { display: flex; align-items: center; gap: 0.2rem; padding: 0.5rem 0.35rem 0 0.6rem; }
.file-card__namerow .file-card__name { padding: 0; flex: 1; min-width: 0; text-align: left; }
.kebab-btn { flex-shrink: 0; background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 6px; display: inline-flex; align-items: center; }
.kebab-btn:hover { background: var(--surface-2); color: var(--text); }
.kebab-btn svg { width: 18px; height: 18px; }
.kebab-menu { position: fixed; z-index: 90; min-width: 175px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); padding: 4px; }
.kebab-item { display: flex; align-items: center; gap: 0.55rem; width: 100%; background: none; border: none; color: var(--text); cursor: pointer; padding: 0.5rem 0.6rem; border-radius: 6px; font: inherit; font-size: 0.85rem; text-align: left; }
.kebab-item:hover { background: var(--surface-2); }
.kebab-item__icon { display: inline-flex; color: var(--muted); flex-shrink: 0; }
.kebab-item__icon svg { width: 16px; height: 16px; }
.kebab-item--danger, .kebab-item--danger .kebab-item__icon { color: #f87171; }

/* ---------- Tabela ---------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--header-bg); }
th { text-align: left; padding: 0.75rem 1rem; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
td { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
tbody tr:hover { background: var(--row-hover); }
.t-right { text-align: right; }
.t-center { text-align: center; }
tfoot td { border-top: 2px solid var(--border-2); background: var(--card-bg); font-weight: 600; }
.row-actions { display: flex; justify-content: flex-end; gap: 0.75rem; }
.row-actions--center { justify-content: center; }

/* seleção em lote de arquivos */
.bulk-bar {
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; text-align: center;
  border: 1px solid var(--brand-700); background: var(--brand-soft);
  border-radius: 8px; padding: 0.5rem 0.85rem; margin-bottom: 0.75rem; font-size: 0.85rem;
}
tr.row-selected td { background: var(--brand-soft); }

/* tabela compacta: linhas mais baixas (ex.: lista de arquivos) */
.table--compact th { padding-top: 0.45rem; padding-bottom: 0.45rem; }
.table--compact td { padding-top: 0.35rem; padding-bottom: 0.35rem; }
/* Tabela de Usuários: centraliza todas as colunas, exceto a primeira (Usuário) */
.team-table th:not(:first-child), .team-table td:not(:first-child) { text-align: center; }
.team-table .row-actions { display: flex; justify-content: center; }
.tenants-table .row-actions { display: flex; justify-content: center; }
.plans-table th:not(:first-child), .plans-table td:not(:first-child) { text-align: center; }
.plans-table .row-actions { display: flex; justify-content: center; }
/* Cards de visão geral no cabeçalho da página Empresas */
.empresas-head-right { display: flex; align-items: stretch; gap: 0.75rem; flex-wrap: wrap; }
.mini-stat { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.45rem 0.9rem; text-align: center; display: flex; flex-direction: column; justify-content: center; transition: transform .15s ease, box-shadow .15s ease; }
.mini-stat--link { cursor: pointer; }
.mini-stat--link:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); border-color: var(--brand); }
.mini-stat:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.mini-stat__label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }
.mini-stat__value { font-size: 1.1rem; font-weight: 600; margin-top: 0.1rem; }
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--text); }
.th-arrow { opacity: 0.35; font-size: 0.85em; }
.th-arrow.active { opacity: 1; color: var(--brand); }
.th-sort:hover .th-arrow { opacity: 0.7; }
.th-sort:hover .th-arrow.active { opacity: 1; }
.table--compact td .cell-strong { margin: 0; line-height: 1.2; }
.table--compact td .cell-sub { margin: 0.18rem 0 0; line-height: 1.2; }
.table--compact .cell-sub { font-size: 0.76rem; }
/* cabeçalho fixo ao rolar (precisa overflow visible no wrap) */
.table-wrap--sticky { overflow: visible; border-radius: 0; }
.table--compact thead th { position: sticky; top: var(--files-bar-h, 0); z-index: 10; background: var(--surface); }
/* Coluna Arquivo(s): ícone de extensão + nome; e pasta dentro da tabela */
.list-file, .list-folder { display: flex; align-items: center; gap: 0.5rem; }
.list-folder { cursor: pointer; }
.list-file .cell-strong, .list-folder .cell-strong { margin: 0; }
.list-ext { flex-shrink: 0; width: 34px; height: 34px; border-radius: 6px; background: var(--surface-2);
  color: var(--faint); font-size: 0.56rem; font-weight: 700; letter-spacing: 0.03em;
  display: inline-flex; align-items: center; justify-content: center; }
.list-folder__ico { flex-shrink: 0; color: var(--brand); display: inline-flex; }
.list-folder__ico svg { width: 22px; height: 22px; }
/* Nome + selo de status sempre na mesma linha (nome trunca se for longo) */
.list-name { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.list-name__txt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-name__link { cursor: pointer; }
.list-name__link:hover { color: var(--brand); text-decoration: underline; }
.list-name .badge-public, .list-name .badge-private, .list-name .badge-named { flex-shrink: 0; margin-left: 0; }
.table-wrap--sticky thead tr th:first-child { border-top-left-radius: 0; }
.table-wrap--sticky thead tr th:last-child { border-top-right-radius: 0; }

/* ---------- Badge / status ---------- */
.badge { display: inline-flex; align-items: center; border-radius: 999px;
  padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 500; }
.badge--active { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.badge--provisioning { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge--suspended { background: rgba(249,115,22,0.15); color: #fdba74; }
.badge--canceled { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge--default { background: var(--surface-2); color: var(--muted); }

/* ---------- Alert / toast ---------- */
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  border: 1px solid; border-radius: 8px; padding: 0.75rem 1rem; font-size: 0.875rem; margin-bottom: 1rem; }
.alert--error { border-color: #7f1d1d; background: rgba(127,29,29,0.4); color: #fecaca; }
.alert--success { border-color: #065f46; background: rgba(6,95,70,0.4); color: #a7f3d0; }
.alert--info { border-color: #075985; background: rgba(7,89,133,0.4); color: #bae6fd; }
.alert__close { background: none; border: none; color: inherit; cursor: pointer; opacity: 0.7; font-size: 1rem; }
.alert__close:hover { opacity: 1; }

/* ---------- Estados ---------- */
/* Borda tracejada desenhada via background (4 gradientes) em vez de `border: dashed`,
   porque a borda tracejada nativa "some" de um lado em larguras com subpixel (resize do navegador). */
.empty { border-radius: var(--radius); padding: 3rem 1.5rem; text-align: center;
  background-image:
    repeating-linear-gradient(90deg, var(--border-2) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(90deg, var(--border-2) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(0deg, var(--border-2) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(0deg, var(--border-2) 0 6px, transparent 6px 12px);
  background-size: 100% 1px, 100% 1px, 1px 100%, 1px 100%;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  background-repeat: no-repeat; }
/* Na aba Fatura (Configurações) a caixa vazia colava no título; mantém respiro do topo. */
.cfg-panel .empty { margin-top: 0.85rem; }
.empty__title { color: var(--text); }
.empty__hint { color: var(--faint); font-size: 0.875rem; margin-top: 0.25rem; }
.loading { display: flex; align-items: center; justify-content: center; gap: 0.75rem; min-height: 60vh; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 3px solid var(--border-2);
  border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner--sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(0,0,0,0.6); padding: 1rem; }
.modal { width: 100%; max-width: 32rem; border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius); padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5); max-height: 90vh; overflow-y: auto; }
.modal--sm { max-width: 22rem; }
.modal--wide { max-width: 52rem; }
.modal--md { max-width: 40rem; }
/* Modal que cresce conforme o conteúdo (usado em avisos sem quebra de linha). */
.modal--fit { width: -moz-fit-content; width: fit-content; max-width: min(95vw, 60rem); }
/* Mini popup (toast) de confirmação — ex.: "Copiado!". Fecha sozinho. */
.mini-toast { position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2);
  padding: 0.55rem 1.1rem; border-radius: 8px; font-size: 0.85rem; box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  animation: mini-toast-in 0.15s ease; }
@keyframes mini-toast-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* Toolbar de filtros da tela de Logs: rótulo À ESQUERDA do campo (inline); Exportar à direita. */
.logs-toolbar { gap: 0.85rem 1.25rem; align-items: center; flex-wrap: wrap; }
.logs-toolbar .field { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; margin: 0; }
.logs-toolbar .field .label { white-space: nowrap; margin-bottom: 0; }
.logs-toolbar__spacer { flex: 1 1 auto; }
.logs-toolbar .input[type="date"] { width: 10rem; }
.logs-toolbar select.input { min-width: 9rem; width: auto; }
.logs-toolbar input[type="text"].input { width: 13rem; }
/* Badges de evento na tela de Logs. */
.log-badge { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.log-badge--login  { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.log-badge--logout { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.log-badge--upload { background: rgba(56,189,248,0.15); color: #7dd3fc; }
.log-badge--delete { background: rgba(239,68,68,0.15); color: #fca5a5; }
html[data-theme="light"] .log-badge--login  { color: #047857; }
html[data-theme="light"] .log-badge--logout { color: #475569; }
html[data-theme="light"] .log-badge--upload { color: #0369a1; }
html[data-theme="light"] .log-badge--delete { color: #b91c1c; }
/* Avatar do usuário (inicial) + célula de usuário na tela de Usuários. */
.user-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 0.8rem; line-height: 1; flex-shrink: 0; }
.user-cell { display: flex; align-items: center; gap: 0.6rem; }
/* Gerenciar membros de grupo. */
.group-members { display: flex; flex-direction: column; gap: 0.25rem; max-height: 55vh; overflow-y: auto; }
.group-member { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; border-radius: 8px; cursor: pointer; }
.group-member:hover { background: var(--surface-2); }
.group-member__id { display: flex; flex-direction: column; min-width: 0; }
.group-member__id .cell-sub { line-height: 1.1; }
/* Lista de detalhes do "+ Informações" (arquivo/pasta). */
.info-list { display: flex; flex-direction: column; gap: 0.55rem; }
.info-row { display: grid; grid-template-columns: 10rem 1fr; gap: 0.75rem; font-size: 0.85rem; align-items: start; }
.info-row__label { color: var(--muted); }
.info-row__value { color: var(--text); word-break: break-word; }
@media (max-width: 480px) { .info-row { grid-template-columns: 1fr; gap: 0.15rem; } }
/* Quase tela inteira (ex.: Editar empresa) */
.modal--full { max-width: 1600px; width: 96vw; max-height: 94vh; }
/* Abas (orelhas) — usadas no cadastro/edição de empresa */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab { background: transparent; border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0; padding: 0.5rem 1.1rem; color: var(--muted); cursor: pointer; font-size: 0.85rem; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-2); border-color: var(--border); color: var(--text); margin-bottom: -1px; font-weight: 600; }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal__title { font-size: 1.125rem; font-weight: 600; }
.modal__close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.125rem; }

/* ---------- Login ---------- */
/* Tema da página de login com as cores da marca Dyne (azul) */
.login-wrap {
  --brand: #1278be;
  --brand-hover: #1a8ad6;
  --brand-soft: rgba(18, 120, 190, 0.15);
  --sky: #4aa3dc;
  min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(18, 120, 190, 0.18), transparent 60%);
}
.login-wrap h1 { color: #cfe6f7; }
.login-head__logo { box-shadow: 0 6px 22px rgba(18, 120, 190, 0.35); }
.login-box { width: 100%; max-width: 23rem; }
.login-captcha-field { display: flex; justify-content: center; }
.login-link { display: block; width: 100%; margin-top: 0.75rem; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 0.85rem; text-align: center; font-family: inherit; }
.login-link:hover { color: var(--brand); text-decoration: underline; }
.login-head { text-align: center; margin-bottom: 2rem; }
.login-head__logo { display: inline-block; height: 40px; width: auto; max-width: 100%;
  background: #fff; padding: 6px 10px; border-radius: 8px; object-fit: contain; margin: 0 auto 0.75rem; }
.tabs { display: flex; flex-wrap: nowrap; gap: 0.25rem; padding: 0.25rem;
  background: var(--surface-2); border-radius: 8px; margin-bottom: 1.25rem; }
.tab { flex: 1; text-align: center; border: none; background: none; padding: 0.5rem; border-radius: 6px; cursor: pointer;
  color: var(--muted); font-size: 0.875rem; font-weight: 500; font-family: inherit; }
.tab.active { background: var(--brand); color: #fff; }
.login-foot { text-align: center; font-size: 0.75rem; color: var(--faint); margin-top: 1.5rem; }
.w-full { width: 100%; }

/* ---------- Barras (consumo) ---------- */
.bar-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.75rem; margin-bottom: 0.5rem; }
.bar-row__date { width: 5rem; flex-shrink: 0; color: var(--faint); }
.bar-track { flex: 1; height: 16px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 4px; }
.bar-row__val { width: 5rem; flex-shrink: 0; text-align: right; color: var(--muted); }

/* ---------- Upload progress ---------- */
.upload-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.upload-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 0.875rem; gap: 0.25rem 1rem; line-height: 1.2; }
.upload-item__name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.upload-item__status { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.upload-item__status.st-red { flex: 1 1 100%; white-space: normal; }
.st-amber { color: var(--amber); }
.st-green { color: #34d399; }
.st-red { color: #f87171; }
.st-faint { color: var(--faint); }

.pager { display: flex; align-items: center; justify-content: space-between;
  font-size: 0.875rem; color: var(--muted); margin-top: 0.6rem; padding: 0 0.5rem 1rem; gap: 1rem; flex-wrap: wrap; }
.pager__left { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pager__size { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; }
.pager__select { background: var(--surface); color: var(--text); border: 1px solid var(--border-2);
  border-radius: 6px; padding: 0.2rem 0.4rem; font: inherit; font-size: 0.8rem; cursor: pointer; }

/* barra de progresso (ex.: exclusão em lote) */
.progress-head { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.4rem; }
.progress-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand); border-radius: 5px; transition: width 0.2s; }
.progress-indeterminate { height: 100%; width: 40%; background: var(--brand); border-radius: 5px; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.publish-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,0.5); }
.publish-box { min-width: 260px; padding: 1.25rem 1.5rem; text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.upload-modal { width: 100%; max-width: 30rem; max-height: 80vh; display: flex; flex-direction: column;
  padding: 1.25rem 1.5rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.upload-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.upload-modal__title { text-align: center; margin-bottom: 0.85rem; }
.upload-modal__title-row { position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 0.85rem; }
.upload-total { position: absolute; right: 0; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.upload-list-scroll { overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 0; }
.upload-list-scroll .upload-item { padding: 0.12rem 0; }
.upload-eta { text-align: center; margin: 0.8rem 0 0; font-size: 0.8rem; color: var(--muted); }
.upload-modal__foot { display: flex; justify-content: center; margin-top: 1rem; }
.truncate { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-strong { color: var(--text); font-weight: 500; }
.cell-sub { font-size: 0.75rem; color: var(--faint); }
.mode-desc {
  border: 1px solid var(--border-2); border-radius: 8px; padding: 0.5rem 0.7rem;
  margin: 0.5rem 0 1rem; text-align: left; font-size: 0.72rem; color: var(--faint);
}
.mode-arrow { font-size: 1.3rem; color: var(--muted); margin: 0.4rem 0 0.7rem; line-height: 1; }
.mode-fork { color: var(--muted); margin: 0.7rem 0; display: flex; justify-content: center; }
.mode-fork svg { max-width: 100%; height: auto; }
.mode-row { display: flex; align-items: center; justify-content: center; gap: 0.85rem; }
.mode-row .mode-or { margin: 0; }
.mode-or { font-size: 0.8rem; color: var(--faint); margin: 0.6rem 0; }
.mode-opt { position: relative; display: inline-block; }
.mode-btn { min-width: 210px; justify-content: center; }
.mode-tip {
  position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%);
  width: 300px; max-width: 80vw;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 0.55rem 0.7rem; text-align: left; font-size: 0.72rem; color: var(--faint);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.12s ease; z-index: 60;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.mode-tip--up { top: auto; bottom: calc(100% + 8px); }
.mode-opt:hover .mode-tip { opacity: 1; visibility: visible; }
.radio-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.radio-opt { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; color: var(--text); font-size: 0.9rem; }
.radio-opt input { accent-color: var(--brand); }
.backup-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; text-align: center; max-width: 560px; margin: 0 auto; }
.backup-box .radio-row, .backup-box .toolbar { justify-content: center; }
.badge-public, .badge-private, .badge-named {
  display: inline-block; margin-left: 0.5rem; padding: 0.05rem 0.45rem; border-radius: 999px;
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; vertical-align: middle;
}
.badge-public { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.badge-private { background: rgba(148,163,184,0.15); color: #94a3b8; }
.badge-named { background: rgba(59,130,246,0.15); color: #93c5fd; }

/* ---------- Configurações (2 colunas) ---------- */
.cfg-layout { display: flex; gap: 1rem; align-items: flex-start; }
.cfg-menu { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.2rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem;
  position: sticky; top: 0.5rem; }
.cfg-menu__item { text-align: left; background: none; border: none; color: var(--muted); cursor: pointer;
  font: inherit; padding: 0.6rem 0.75rem; border-radius: 8px; white-space: nowrap; }
.cfg-menu__item:hover { background: var(--surface-2); color: var(--text); }
.cfg-menu__item.active { background: var(--brand-soft); color: var(--brand-400); font-weight: 600; }
.cfg-panel { flex: 1; min-width: 0; padding: 1rem 1.25rem; }
.cfg-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.5rem; }
.cfg-subtitle { font-size: 0.95rem; font-weight: 600; margin: 0.35rem 0 0; color: var(--text); text-align: center; }
.cfg-form { display: flex; flex-direction: column; gap: 0.55rem; }
.cfg-form .field { margin: 0; }
.conta-cols { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.conta-col { display: flex; flex-direction: column; gap: 0.55rem; }
/* Dados da empresa (esq.) e card Segurança (dir.) lado a lado.
   flex 0 1 = não cresce (campos mais estreitos), mas pode encolher em telas menores. */
.conta-col--data { flex: 0 1 16rem; }
.conta-col--data .input { max-width: 16rem; }
/* margin-top alinha a borda de cima do card com o botão "Trocar imagem"
   (que fica centralizado nos 72px do avatar → ~18px abaixo do topo da coluna). */
.conta-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; flex: 2 1 420px; margin-top: 18px; }
/* Segurança: título fora dos contornos; cada coluna em sua própria caixa. */
.seg-wrap { flex: 2 1 420px; margin-top: 18px; }
.seg-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; }
/* Dentro de "Segurança": Alterar senha (esq.) e Políticas de acesso (dir.), lado a lado. */
.seg-cols { display: flex; gap: 1.25rem; align-items: stretch; flex-wrap: wrap; }
/* Textos centralizados com seus campos (títulos e labels). */
.seg-col { display: flex; flex-direction: column; gap: 0.55rem; flex: 1 1 200px; min-width: 0; text-align: center; }
.seg-col .label { text-align: center; }
/* Campos de senha e botão "Alterar senha" mais estreitos e centralizados. */
.seg-col .pwd-wrap { max-width: 14rem; margin: 0 auto; }
.seg-col .btn-primary { width: 100%; max-width: 14rem; margin: 0.25rem auto 0; }
/* Selects de políticas mais estreitos e centralizados na coluna. */
.seg-col select.input { max-width: 14rem; margin: 0 auto; }
/* Alinha o ícone "ⓘ" verticalmente com o texto do label. */
.seg-col .label-row { justify-content: center; }
.seg-col .label-row > span { display: inline-flex; align-items: center; }
.seg-col .hint { font-size: 0.78rem; line-height: 1; }

/* MFA: bloco da chave e grade de backup codes (modais). */
.mfa-key { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; }
.mfa-key p { margin: 0.2rem 0; }
.mfa-key code { font-size: 1rem; letter-spacing: 0.08em; }
/* Chave numa única linha (sem quebra); rola na horizontal se faltar espaço. */
.mfa-key__secret { display: flex; align-items: baseline; gap: 0.35rem; white-space: nowrap; overflow-x: auto; }
.mfa-key__secret code { font-size: 0.98rem; letter-spacing: 0.06em; white-space: nowrap; }
/* QR code do MFA. */
.mfa-qr-wrap { display: flex; justify-content: center; margin: 0; }
.mfa-qr { width: 176px; height: 176px; background: #fff; padding: 10px; border-radius: 8px; }
.mfa-qr img, .mfa-qr canvas { display: block; width: 100%; height: 100%; }
/* Modal de ativação do MFA: cresce nas laterais e usa QR | instruções lado a lado. */
.mfa-modal { max-width: 68rem; }
/* Texto de introdução numa única linha (rola na horizontal só em telas pequenas). */
.mfa-intro { white-space: nowrap; overflow-x: auto; font-size: 0.78rem; }
/* Modal de desativar MFA: largura suficiente para o título caber em uma linha. */
.mfa-disable-modal { max-width: 31rem; }

/* ===== BI (analytics de links públicos) ===== */
.bi-card-title { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.7rem; color: var(--text); }
.bi-card-title--center { text-align: center; }
/* Abas ("orelhas") internas do BI. */
.bi-tabbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.bi-tabbar .export-wrap { margin-bottom: 0.4rem; }
.bi-tabs { display: flex; gap: 0.25rem; }
.bi-tab { appearance: none; background: transparent; border: 1px solid transparent; border-bottom: none; color: var(--faint); font-size: 0.9rem; font-weight: 600; padding: 0.6rem 1.1rem; cursor: pointer; border-radius: 8px 8px 0 0; margin-bottom: -1px; }
.bi-tab:hover { color: var(--text); }
.bi-tab.is-active { color: var(--text); background: var(--surface); border-color: var(--border); border-bottom: 1px solid var(--surface); }
.bi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 720px) { .bi-grid { grid-template-columns: 1fr; } }
/* Gráfico de barras (acessos por dia) — sem lib. */
.bi-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; overflow-x: auto; padding-top: 0.5rem; }
.bi-bar { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; min-width: 14px; flex: 1 0 14px; height: 100%; }
/* Acessos por dia (30 dias): colunas verticais menores e mais estreitas. */
.bi-chart--days { height: 110px; gap: 2px; }
.bi-chart--days .bi-bar { min-width: 9px; flex: 1 0 9px; }
.bi-chart--days .bi-bar__fill { border-radius: 2px 2px 0 0; }
.bi-chart--days .bi-bar__lbl { font-size: 0.55rem; }
/* Um gráfico por mês (aba "Total de acessos por dia"). */
.bi-months { display: flex; flex-direction: column; gap: 1.25rem; }
.bi-month__title { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.bi-bar__track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bi-bar__fill { width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 3px; }
.bi-bar:hover .bi-bar__fill { background: var(--brand-hover); }
.bi-bar__lbl { font-size: 0.6rem; color: var(--faint); }
/* Dois informativos lado a lado dentro do contorno "QR Code". */
.bi-stat-row { display: flex; align-items: stretch; }
.bi-stat-row .bi-stat { flex: 1 1 0; }
.bi-stat-row .bi-stat + .bi-stat { border-left: 1px solid var(--border); }
@media (max-width: 560px) { .bi-stat-row { flex-direction: column; } .bi-stat-row .bi-stat + .bi-stat { border-left: 0; border-top: 1px solid var(--border); } }
/* Informativo de número grande (acessos via QR / diretos). */
.bi-stat { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.35rem; min-height: 7rem; text-align: center; padding: 0 1rem; }
.bi-stat__num { font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--text); }
.bi-stat__sub { font-size: 0.8rem; color: var(--faint); }
/* Barras horizontais (rankings: links e países). */
.bi-hbars { display: flex; flex-direction: column; gap: 0.55rem; }
.bi-hbar { display: grid; grid-template-columns: 9rem 1fr 2.5rem; align-items: center; gap: 0.6rem; }
.bi-hbar__label { font-size: 0.8rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-hbar__track { background: var(--surface-2); border-radius: 5px; height: 14px; overflow: hidden; }
.bi-hbar__fill { height: 100%; background: var(--brand); border-radius: 5px; min-width: 2px; }
.bi-hbar__val { font-size: 0.8rem; color: var(--muted); text-align: right; }
/* Resumo (sem card de KPI). */
.bi-summary { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }
.bi-summary strong { color: var(--text); font-size: 1.05rem; }
/* Donut (Por região) + legenda. */
.bi-donut-wrap { display: flex; align-items: center; justify-content: center; gap: 1.25rem; flex-wrap: wrap; }
.bi-donut { flex: 0 0 auto; }
.bi-legend { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.bi-legend__item { display: grid; grid-template-columns: 12px auto auto; justify-content: center; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.bi-legend__dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.bi-legend__lbl { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-legend__val { color: var(--muted); white-space: nowrap; }
/* Menu suspenso "Exportar". */
.export-wrap { position: relative; }
.export-menu { position: absolute; right: 0; top: 100%; margin-top: 4px; min-width: 150px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45); padding: 4px; display: none; }
.export-wrap.open .export-menu { display: block; }
.export-item { display: flex; align-items: center; gap: 0.55rem; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--text); padding: 0.45rem 0.7rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-family: inherit; }
.export-item:hover { background: var(--surface-2); }
.export-ico { display: inline-flex; align-items: center; flex: 0 0 auto; }
.export-btn { display: inline-flex; align-items: center; gap: 0.5rem; }
.export-caret { font-size: 0.7rem; opacity: 0.8; }

/* Atalhos de navegação na barra da tela Arquivos (ao lado de "Nova pasta") — ícones do menu lateral. */
.files-nav { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; margin-left: 0.5rem; padding-left: 0.5rem; border-left: 1px solid var(--border); }
.files-nav__item { position: relative; }
.files-nav__item.active { color: var(--brand-400); }
.files-nav__ico { display: inline-flex; }
/* Balão amarelo com o nome (no hover). */
.files-nav__tip {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #fde68a; color: #3a2f00; border: 1px solid #f59e0b; border-radius: 6px;
  padding: 2px 8px; font-size: 0.72rem; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.12s ease; z-index: 200;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.files-nav__item:hover .files-nav__tip { opacity: 1; visibility: visible; }
/* Avatar/Configurações/Sair: balão ancorado à direita p/ não cortar na borda. */
.files-head__right .files-nav__tip { left: auto; right: 0; transform: none; }

/* Avatar + Configurações + Sair centralizados sobre os botões de grade (view toggle). */
.files-head__right { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.files-head__user { display: flex; align-items: center; gap: 0.5rem; }
.files-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.files-avatar--initial { display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 0.9rem; }
.mfa-setup { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: start; }
.mfa-setup__qr { display: flex; flex-direction: column; align-items: center; }
@media (max-width: 560px) { .mfa-setup { grid-template-columns: 1fr; } }
/* Passos do MFA. */
.mfa-setup__info { min-width: 0; }
.mfa-step { margin: 0 0 0.55rem; color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
.mfa-step strong { color: var(--text); }
/* Passo numa única linha (rola na horizontal se faltar espaço). */
.mfa-step--nowrap { white-space: nowrap; overflow-x: auto; }
.mfa-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin: 0.5rem 0 1rem; }
.mfa-codes code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.35rem 0.5rem; text-align: center; font-size: 0.95rem; letter-spacing: 0.04em; }
.cfg-subtitle-sm { font-size: 0.82rem; font-weight: 600; margin: 0 0 0.25rem; color: var(--text); text-align: center; }
.force-pwd__err { color: #f87171; font-size: 0.8rem; min-height: 1.1em; margin: 0; }
.pwd-wrap { position: relative; }
.pwd-wrap .input { width: 100%; padding-right: 2.5rem; }
.pwd-eye { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); background: none; border: none;
  color: var(--muted); cursor: pointer; padding: 0.25rem; display: inline-flex; align-items: center; }
.pwd-eye:hover { color: var(--text); }
.pwd-eye svg { width: 18px; height: 18px; }
.cfg-avatar-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.25rem; }
.cfg-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.cfg-avatar--initial { display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 1.8rem; font-weight: 700; }
.cfg-tip-wrap { position: relative; display: inline-block; }
.cfg-tip {
  position: absolute; left: 0; top: calc(100% + 8px); width: 280px; max-width: 80vw;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 0.6rem 0.75rem; text-align: left; font-size: 0.75rem; color: var(--faint);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.12s ease; z-index: 30;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.cfg-tip p { margin: 0.12rem 0; }
.cfg-tip strong { color: var(--text); }
.cfg-tip-wrap:hover .cfg-tip { opacity: 1; visibility: visible; }
@media (max-width: 700px) {
  .cfg-layout { flex-direction: column; }
  .cfg-menu { width: 100%; flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Tooltip / label com ajuda ---------- */
.label-row { display: flex; align-items: center; gap: 0.4rem; }
.hint { cursor: help; color: var(--faint); font-size: 0.8rem; }
.hint:hover { color: var(--brand-400); }
.btn-link-inline {
  margin-left: auto; background: none; border: none; color: var(--sky);
  cursor: pointer; font: inherit; font-size: 0.72rem; font-weight: 600;
  padding: 0; text-transform: none; letter-spacing: normal;
}
.btn-link-inline:hover { text-decoration: underline; }

/* checkbox inline (ex.: ativar expiração) */
.checkbox-row {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem;
  font-size: 0.8rem; color: var(--muted); text-transform: none; letter-spacing: normal; cursor: pointer;
}
.checkbox-row input { width: auto; }
.input:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Lista de planos (modal) ---------- */
.plan-list { display: flex; flex-direction: column; gap: 0.75rem; max-height: 60vh; overflow-y: auto; }
.plan-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.85rem; background: var(--surface); }
.plan-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.5rem; }
.plan-card__name { font-weight: 600; }
.plan-table { width: 100%; font-size: 0.8rem; }
.plan-table td { padding: 0.2rem 0; border: none; }
