/* =========================================================================
   Nexo Fiscal — sistema de design
   Tokens (claro/escuro) → base → layout → componentes → páginas → utilitários
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f4f6;      /* blocos internos, cabeçalho de tabela */
  --surface-3: #e9ecf0;      /* hover forte, trilhos */
  --hover: #f7f8fa;
  --border: #e4e7eb;
  --border-strong: #cfd4db;
  --text: #1c2128;
  --text-2: #424a53;         /* texto secundário */
  --muted: #59636e;          /* ≥ 4.5:1 sobre branco */
  --faint: #8a939d;          /* só para elementos decorativos */
  --pri: #0B1B3A;            /* marca: navy */
  --pri-hover: #13284F;
  --pri-text: #ffffff;
  --accent: #0F766E;         /* marca: teal (contraste p/ texto) */
  --accent-hover: #115E59;
  --accent-soft: #ECFDF8;
  --accent-border: #A7EBDD;
  --marca-teal: #2DD4BF;
  --ok: #1a7f37;      --ok-soft: #e6f6ea;   --ok-border: #b7e2c3;
  --warn: #9a6700;    --warn-soft: #fff7e0; --warn-border: #f0dca8;
  --err: #cf222e;     --err-soft: #ffeceb;  --err-border: #f5c2c0;
  --orange: #c2410c;
  --dot-cinza: #b4bcc6;
  --row-active: #1c2433;
  --row-active-text: #f1f5f9;
  --pop: #343a46;            /* popovers escuros (etiquetas) */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-full: 999px;
  --side: 248px; --side-mini: 68px; --top: 58px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --t: .15s ease;
}

:root[data-theme="escuro"] {
  color-scheme: dark;
  --bg: #0e1117;
  --surface: #161b22;
  --surface-2: #1c222b;
  --surface-3: #262d37;
  --hover: #1b2129;
  --border: #2a313c;
  --border-strong: #3a424e;
  --text: #e6edf3;
  --text-2: #c2cad3;
  --muted: #9aa4af;
  --faint: #6e7781;
  --pri: #2DD4BF;
  --pri-hover: #5EEAD4;
  --pri-text: #04131F;
  --accent: #2DD4BF;
  --accent-hover: #5EEAD4;
  --accent-soft: #0C2A2C;
  --accent-border: #134E4A;
  --marca-teal: #2DD4BF;
  --ok: #3fb950;      --ok-soft: #12261a;   --ok-border: #1f4a2a;
  --warn: #d29922;    --warn-soft: #2a2110; --warn-border: #4d3b14;
  --err: #f85149;     --err-soft: #2d1416;  --err-border: #5a2225;
  --orange: #fb923c;
  --dot-cinza: #57606a;
  --row-active: #23324a;
  --row-active-text: #f1f5f9;
  --pop: #262d37;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; font: 14px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased }
a { color: var(--accent); text-decoration: none }
a:hover { text-decoration: underline }
h1 { font-size: 22px; margin: 0 0 18px; font-weight: 700; letter-spacing: -.015em }
h2, h3, h4 { letter-spacing: -.01em }
small { font-size: 12px }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top }
th { font-size: 12px; color: var(--muted); font-weight: 600 }
tbody tr:hover td { background: var(--hover) }
[hidden] { display: none !important }
::selection { background: var(--accent-soft) }

/* Foco visível só pelo teclado */
:focus { outline: none }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none }

.pular { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--pri); color: var(--pri-text); padding: 8px 14px; border-radius: var(--r) }
.pular:focus { top: 10px }

/* ---------- Formulários ---------- */
input, select, textarea, button { font: inherit; color: inherit }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--r);
  background: var(--surface); color: var(--text); transition: border-color var(--t), box-shadow var(--t); min-height: 36px
}
input::placeholder, textarea::placeholder { color: var(--faint) }
input:hover, select:hover, textarea:hover { border-color: var(--faint) }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a939d' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px
}
select:disabled { opacity: .75; cursor: default }
input[type=date] { font-variant-numeric: tabular-nums }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; filter: var(--icon-filter, none) }
:root[data-theme="escuro"] input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1) }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer }
input[type=color] { border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); cursor: pointer }
label { color: var(--text-2) }

/* Botões */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--pri); color: var(--pri-text); border: 1px solid transparent; cursor: pointer;
  padding: 7px 14px; border-radius: var(--r); font-weight: 500; line-height: 1.4; text-decoration: none;
  transition: background var(--t), border-color var(--t), opacity var(--t); white-space: nowrap
}
button:hover, .btn:hover { background: var(--pri-hover); text-decoration: none }
button:disabled, .btn.off { opacity: .55; cursor: default }
.btn.sec, button.sec { background: var(--surface); color: var(--text); border-color: var(--border-strong) }
.btn.sec:hover, button.sec:hover { background: var(--surface-2) }
.btn.sm, button.sm { padding: 3px 10px; font-size: 12.5px }
.btn svg, button svg { width: 16px; height: 16px; flex-shrink: 0 }
/* estado "carregando" aplicado ao enviar formulários */
.carregando { position: relative; color: transparent !important; pointer-events: none }
.carregando::after {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--pri-text) var(--pri-text) transparent transparent; animation: girar .7s linear infinite
}
.sec.carregando::after, .ra-btn.carregando::after { border-color: var(--text) var(--text) transparent transparent }
@keyframes girar { to { transform: rotate(360deg) } }

/* ---------- Layout ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; height: var(--top); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 18px; z-index: 20
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.02em; color: var(--text); text-decoration: none !important }
.logo { font-family: Manrope, Inter, sans-serif; font-weight: 800 }
.logo-marca { width: 30px; height: 30px; display: block; flex: none }
.logo-marca img, .logo-marca svg { width: 30px; height: 30px; display: block }
.logo-nome b { color: var(--accent); font-weight: 500 }
h1, h2, .cab h1 { font-family: Manrope, Inter, sans-serif }
.pill {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-full);
  padding: 5px 12px; font-weight: 600; font-size: 13px; max-width: 260px; overflow: hidden; text-overflow: ellipsis
}
.pill:hover { background: var(--surface-3) }
.top .acoes { margin-left: auto; display: flex; align-items: center; gap: 6px }
.ico {
  position: relative; color: var(--muted); display: inline-grid; place-items: center; text-decoration: none; cursor: pointer;
  background: none; border: 0; padding: 7px; border-radius: var(--r)
}
.ico:hover { background: var(--surface-2); color: var(--text) }
.ico svg { width: 20px; height: 20px }
.badge {
  position: absolute; top: 0; right: -2px; background: var(--err); color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: var(--r-full); padding: 0 5px; min-width: 18px; line-height: 16px; border: 2px solid var(--surface); text-align: center
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px;
  display: grid; place-items: center; cursor: pointer; border: 1px solid var(--accent-border); padding: 0; line-height: 1; flex-shrink: 0; margin-left: 6px
}
.avatar:hover { background: var(--accent-soft); filter: brightness(.97) }

/* Dropdowns */
.drop { position: relative }
.drop-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); min-width: 230px; padding: 6px; z-index: 30
}
.drop-menu.esq { left: 0; right: auto; max-height: 60vh; overflow: auto }
.drop.aberto .drop-menu { display: block; animation: surgir .14s ease-out }
@keyframes surgir { from { opacity: 0; transform: translateY(-4px) } }
.drop-menu a, .drop-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text); text-decoration: none; background: none; border: 0; font-weight: 400; justify-content: flex-start
}
.drop-menu a:hover, .drop-menu button:hover { background: var(--surface-2) }
.drop-menu svg { width: 16px; height: 16px; color: var(--muted) }
.drop-menu .cab { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px }
.drop-menu .sep { height: 1px; background: var(--border); margin: 4px 0 }
.tema-opcoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px }
.drop-menu .tema-opcoes button { flex-direction: column; gap: 3px; font-size: 11.5px; padding: 7px 4px; border: 1px solid var(--border); justify-content: center; text-align: center }
.drop-menu .tema-opcoes button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent) }
.drop-menu .tema-opcoes button.on svg { color: var(--accent) }
.rotulo-menu { font-size: 11.5px; color: var(--muted); padding: 6px 10px 2px; font-weight: 600 }

/* Lateral */
.side { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); padding: 14px 12px; overflow-y: auto; transition: width .2s ease; z-index: 15 }
.side nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 8px; box-shadow: var(--shadow-sm) }
.side h6 { margin: 12px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden }
.side h6:first-child { margin-top: 2px }
.side a {
  display: flex; align-items: center; gap: 11px; padding: 6px 10px; border-radius: var(--r); color: var(--text-2);
  text-decoration: none; font-size: 14px; white-space: nowrap; position: relative
}
.side a svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--faint) }
.side a:hover { background: var(--surface-2); color: var(--text) }
.side a.on { background: var(--surface-3); color: var(--text); font-weight: 600 }
.side a.on svg { color: var(--accent) }
.side a .rot { flex: 1; overflow: hidden; text-overflow: ellipsis }
.side a small { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); padding: 0 7px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums }
.side a.on small { background: var(--surface) }
.recolher { margin-top: 8px; width: 100%; justify-content: flex-start; background: none; color: var(--muted); border: 0; padding: 6px 10px; font-weight: 400; gap: 11px }
.recolher:hover { background: var(--surface-2); color: var(--text) }
.recolher svg { width: 18px; height: 18px; transition: transform .2s }
main { margin: var(--top) 0 0 var(--side); padding: 22px 26px 40px; transition: margin .2s ease; min-height: calc(100vh - var(--top)) }
.menu-btn { display: none }

/* menu recolhido (só ícones) */
body.recolhido { --side: var(--side-mini) }
body.recolhido .side { padding: 14px 8px }
body.recolhido .side h6 { height: 1px; margin: 10px 6px; background: var(--border); color: transparent }
body.recolhido .side a { justify-content: center; padding: 8px }
body.recolhido .side a .rot, body.recolhido .recolher .rot { display: none }
body.recolhido .side a small { position: absolute; top: 2px; right: 2px; padding: 0 4px; font-size: 9.5px; line-height: 14px }
body.recolhido .recolher { justify-content: center }
body.recolhido .recolher svg { transform: rotate(180deg) }

.convidado main { margin: 0; padding: 0 }

/* ---------- Componentes ---------- */
/* Superfícies: card, painel, lista-card, bi-bloco usam a mesma base */
.card, .painel, .lista-card, .bi-bloco, .emp, .kpi, .bi-kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm)
}
.card { padding: 20px; margin-bottom: 16px }
.card > h3:first-child, .painel h3 { margin-top: 0 }
.card h3 { font-size: 16px; margin: 0 0 14px }
.painel { padding: 22px 24px; margin-bottom: 16px }
.bi-bloco { padding: 16px 18px; margin-bottom: 14px; box-shadow: none }
.lista-card { overflow: hidden }

/* Cabeçalho de página */
.cabecalho { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap }
.cabecalho h1 { margin: 0 }
.cabecalho p { margin: 4px 0 0; color: var(--muted) }
.cabecalho .voltar { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 6px }
.cabecalho .voltar:hover { color: var(--text); text-decoration: none }
.cabecalho .acoes-pag { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
/* aliases antigos */
.lista-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap }
.lista-acoes { display: flex; gap: 8px; flex-wrap: wrap }

/* Etiquetas de status */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: var(--r-full); font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border) }
.tag.err { background: var(--err-soft); color: var(--err); border-color: var(--err-border) }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border) }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--dot-cinza); flex-shrink: 0 }
.dot.verde { background: var(--ok) } .dot.amarelo { background: var(--warn) } .dot.vermelho { background: var(--err) } .dot.cinza { background: var(--dot-cinza) }
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap }

/* Alertas em página (persistentes) */
.alert { padding: 11px 14px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2) }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border) }
.alert.erro { background: var(--err-soft); color: var(--err); border-color: var(--err-border) }
.alert.aviso { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border) }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)) }
.toast {
  display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: var(--r-lg); padding: 12px 12px 12px 14px; box-shadow: var(--shadow-lg); animation: toastIn .25s cubic-bezier(.2, .8, .2, 1)
}
.toast.ok { border-left-color: var(--ok) } .toast.erro { border-left-color: var(--err) }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px }
.toast.ok > svg { color: var(--ok) } .toast.erro > svg { color: var(--err) }
.toast p { margin: 0; flex: 1; color: var(--text); line-height: 1.45 }
.toast button { background: none; color: var(--muted); padding: 2px; border: 0 }
.toast button:hover { background: var(--surface-2); color: var(--text) }
.toast.saindo { animation: toastOut .2s ease-in forwards }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98) } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px) } }

/* Estado vazio */
.vazio-box { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 44px 20px; gap: 6px }
.vazio-box .vazio-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--faint); margin-bottom: 8px }
.vazio-box .vazio-ico svg { width: 26px; height: 26px }
.vazio-box b { font-size: 15px; color: var(--text) }
.vazio-box p { margin: 0; color: var(--muted); max-width: 420px }
.vazio-box .btn { margin-top: 12px }
td.vazio { padding: 0 !important; color: var(--muted) }
tr:hover td.vazio { background: transparent }

/* Esqueleto de carregamento */
.esqueleto, .bi-graf.carregando-graf {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%;
  animation: brilho 1.3s ease infinite; border-radius: var(--r)
}
@keyframes brilho { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* Tabelas de listagem */
.tabela-wrap { overflow-x: auto }
.tabela th { background: var(--surface-2); padding: 10px 12px; white-space: nowrap; border-bottom-color: var(--border) }
.tabela th a { color: inherit; text-decoration: none }
.tabela th a:hover { color: var(--text) }
.tabela td { padding: 12px; vertical-align: middle; font-size: 13.5px }
.tabela tbody tr { transition: background var(--t) }
.tabela td small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px }
.tabela tr.marcada td { background: var(--accent-soft) }
.col-emit { max-width: 260px } .col-emit b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.col-emp { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.col-rd { max-width: 250px } .col-rd b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.col-rd small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tabela td small.trajeto { color: var(--text-2); margin-top: 3px }
.valor { font-weight: 600; white-space: nowrap }
.right { text-align: right }
.total-linha td { background: var(--surface-2); border-top: 2px solid var(--border) }

/* Linha ativa + barra de ações */
.tabela tbody tr.nf-linha { cursor: pointer }
.tabela tbody tr.nf-linha:hover td { background: var(--hover) }
.tabela tr.nf-linha.ativa td { background: var(--row-active) !important; color: var(--row-active-text) !important }
.tabela tr.nf-linha.ativa small { color: #94a3b8 !important }
.tabela tr.nf-linha.ativa a { color: #93c5fd }
.tabela tr.nf-acoes td { padding: 0 12px 10px; background: var(--row-active); border-bottom: 2px solid #374151; cursor: default }
.chevron-td { width: 44px }
.chevron { width: 26px; height: 26px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: transform .2s }
.chevron svg { width: 15px }
.nf-linha.ativa .chevron { transform: rotate(180deg); background: rgba(255, 255, 255, .12); color: #e2e8f0 }
.row-actions { display: flex; gap: 2px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow); padding: 3px 5px; width: fit-content; flex-wrap: wrap }
.ra-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; cursor: pointer; border: none; background: transparent; color: var(--text-2); text-decoration: none }
.ra-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none }
.ra-btn.ra-primary { background: var(--accent-soft); color: var(--accent) }
.ra-btn.ra-success { background: var(--ok-soft); color: var(--ok) }
.ra-btn.ra-warning { background: var(--warn-soft); color: var(--warn) }
.ra-btn.ra-danger { color: var(--err) } .ra-btn.ra-danger:hover { background: var(--err-soft) }
.ra-btn.ra-primary:hover, .ra-btn.ra-success:hover, .ra-btn.ra-warning:hover { filter: brightness(.96) }
.ra-sep { width: 1px; height: 18px; background: var(--border); margin: 0 1px; flex-shrink: 0 }

/* Barra de busca/filtros das listagens */
.lista-busca { display: flex; gap: 10px; padding: 16px 18px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border) }
.busca-input { flex: 1; min-width: 240px; display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r); padding: 0 4px 0 10px; background: var(--surface); transition: border-color var(--t), box-shadow var(--t) }
.busca-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.busca-input svg { width: 17px; color: var(--faint); flex-shrink: 0 }
.busca-input input { border: 0 !important; box-shadow: none !important; flex: 1; outline: none; background: transparent }
.busca-input kbd, kbd { font: 11px var(--mono); color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface-2) }
.periodo { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong); border-radius: var(--r); padding: 0 6px; background: var(--surface) }
.periodo input { border: 0 !important; box-shadow: none !important; padding: 6px 4px !important; min-height: 34px !important; background: transparent !important }
.periodo span { color: var(--muted); font-size: 13px }
.filtro-btn .cont { background: var(--accent); color: #fff; border-radius: var(--r-full); font-size: 11px; padding: 0 6px; line-height: 16px }
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: end }
.filtros label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px }

/* Abas */
.abas { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none }
.abas a { padding: 11px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; margin-bottom: -1px }
.abas a:hover { color: var(--text) }
.abas a.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600 }
.abas span { background: var(--surface-2); border-radius: var(--r-full); padding: 1px 8px; font-size: 12px; margin-left: 5px; color: var(--muted); font-variant-numeric: tabular-nums }
.abas span.alerta { background: var(--err-soft); color: var(--err) }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px }
.chips a { padding: 5px 12px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); text-decoration: none; font-size: 13px }
.chips a:hover { border-color: var(--border-strong) }
.chips a.on { background: var(--pri); color: var(--pri-text); border-color: var(--pri) }

/* Seleção em massa */
.lote { display: none; align-items: center; gap: 10px; padding: 10px 18px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-border); flex-wrap: wrap }
.lote.ativo { display: flex; animation: surgir .15s ease-out }
.lote .sm-sel { padding: 3px 28px 3px 8px; font-size: 12.5px; min-height: 28px }

/* Rodapé de listagem e paginação */
.lista-rodape { display: flex; align-items: center; gap: 18px; padding: 14px 18px; flex-wrap: wrap; border-top: 1px solid var(--border) }
.por-pagina { display: flex; align-items: center; gap: 8px; margin-left: auto }
.por-pagina select { padding: 3px 28px 3px 8px; min-height: 30px }
.paginas { display: flex; gap: 4px }
.paginas a { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--text); text-decoration: none; border: 1px solid var(--border); font-variant-numeric: tabular-nums; padding: 0 6px }
.paginas a:hover { background: var(--surface-2) }
.paginas a.on { background: var(--pri); color: var(--pri-text); border-color: var(--pri) }
.paginas a.off { pointer-events: none; opacity: .4 }

/* Gaveta de filtros */
.gaveta-fundo { position: fixed; inset: 0; background: rgba(10, 14, 20, .45); z-index: 40; animation: fadeIn .15s }
.gaveta-painel { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 100%; background: var(--surface); z-index: 41; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow: auto; box-shadow: var(--shadow-lg); animation: gavetaIn .22s cubic-bezier(.2, .8, .2, 1) }
.gaveta { display: none } .gaveta.aberta { display: block }
.gaveta-cab { display: flex; justify-content: space-between; align-items: center } .gaveta-cab b { font-size: 17px }
.gaveta-painel label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted) }
.gaveta-rodape { margin-top: auto; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 14px }
@keyframes fadeIn { from { opacity: 0 } }
@keyframes gavetaIn { from { transform: translateX(30px); opacity: 0 } }

/* Indicadores (kpi) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px }
.kpi { padding: 16px 18px; text-decoration: none !important; color: inherit; transition: border-color var(--t), transform var(--t) }
.kpi b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; color: var(--text) }
.kpi span { color: var(--muted); font-size: 13px }
a.kpi:hover { border-color: var(--border-strong); transform: translateY(-1px) }
.kpi.vermelho { background: var(--err-soft); border-color: var(--err-border) }
.kpi.amarelo { background: var(--warn-soft); border-color: var(--warn-border) }

/* Popover escuro de etiquetas */
.etqs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px }
.etq { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1.5; white-space: nowrap }
.etq-pop { position: fixed; z-index: 50; width: 300px; max-width: calc(100vw - 24px); background: var(--pop); color: #f1f3f5; border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid rgba(255, 255, 255, .06); animation: surgir .14s ease-out }
.etq-busca { position: relative; margin: 12px }
.etq-busca input { width: 100%; background: transparent !important; border: 1px solid #6b7280 !important; color: #fff !important; padding: 8px 36px 8px 11px !important; box-shadow: none !important }
.etq-busca input::placeholder { color: #b8bec9 }
.etq-busca svg { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 17px; color: #e5e7eb }
.etq-lista { max-height: 240px; overflow-y: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding: 4px 0; scrollbar-width: thin; scrollbar-color: #6b7280 transparent }
.etq-lista label { display: flex; align-items: center; gap: 12px; padding: 7px 14px; cursor: pointer; color: inherit }
.etq-lista label:hover { background: rgba(255, 255, 255, .07) }
.etq-lista input { width: 17px; height: 17px; margin: 0; flex-shrink: 0 }
.etq-vazia { padding: 10px 14px; margin: 0; color: #b8bec9; font-size: 13px }
.etq-aplicar { padding: 8px 12px 12px }
.etq-aplicar button { width: 100%; background: #e5e7eb; color: #1f2328; font-weight: 600; padding: 8px }
.etq-aplicar button:hover { background: #fff }
.etq-aplicar button:disabled { opacity: .5; color: #6b7280 }
.etq-rodape { border-top: 1px solid rgba(255, 255, 255, .1); padding: 4px 0 }
.etq-rodape a { display: flex; align-items: center; gap: 12px; padding: 8px 14px; color: #f1f3f5; text-decoration: none; font-size: 14px }
.etq-rodape a:hover { background: rgba(255, 255, 255, .07) }
.etq-rodape svg { width: 17px; height: 17px }
.etq-nova { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px }
.etq-nova-cab { display: flex; align-items: center; gap: 6px } .etq-nova-cab b { font-size: 15px }
.etq-voltar { background: none; color: #e5e7eb; font-size: 22px; line-height: 1; padding: 0 6px }
.etq-voltar:hover { background: none; color: #fff }
.etq-nova input { background: transparent !important; border: 1px solid #6b7280 !important; color: #fff !important; box-shadow: none !important }
.etq-rot { font-size: 12px; color: #b8bec9; margin-bottom: -4px }
.etq-cores { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px }
.etq-cores button { aspect-ratio: 1; width: 100%; border-radius: 7px; padding: 0; border: 2px solid transparent }
.etq-cores button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--pop) inset }
.etq-previa { background: rgba(0, 0, 0, .2); border-radius: var(--r); padding: 10px; text-align: center }
.etq-erro { color: #fca5a5 } .etq-erro:empty { display: none }
.etq-nova-acoes { display: flex; gap: 8px; justify-content: flex-end }
.etq-cancelar { background: transparent; color: #e5e7eb; border: 1px solid #6b7280 } .etq-cancelar:hover { background: rgba(255, 255, 255, .07) }
.etq-criar { background: var(--accent); color: #fff } .etq-criar:hover { background: var(--accent-hover) }
.regra { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); padding: 2px 4px 2px 10px; font-size: 12px; margin: 2px 4px 2px 0; color: var(--text-2) }
.regra button { background: none; color: var(--muted); padding: 0 5px; font-size: 14px; line-height: 1 }
.regra button:hover { background: none; color: var(--err) }
.regra-form { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap }
.regra-form select, .regra-form input { padding: 3px 8px !important; font-size: 12.5px; min-height: 30px !important }
.regra-form select { padding-right: 28px !important }
.regra-form input { width: 150px }

/* Notificações */
.drop-menu.notif { width: 360px; padding: 0; right: -60px }
.notif-cab { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border) }
.notif-cab b { font-size: 16px }
.notif-cab form { margin: 0 }
.drop-menu .notif-cab .ico { width: auto; padding: 6px }
.notif-lista { max-height: 360px; overflow: auto; padding: 4px 0 }
.drop-menu .notif-lista a { display: flex; gap: 12px; padding: 11px 16px; border-radius: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.45; align-items: flex-start }
.notif-lista a i { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: transparent }
.notif-lista a.nova i { background: var(--err) }
.notif-lista a span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.notif-lista a b { display: block; color: var(--text); font-weight: 600 }
.notif-lista a small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px }
.drop-menu a.notif-rodape { border-top: 1px solid var(--border); border-radius: 0; padding: 11px 16px; color: var(--accent); font-size: 13.5px; justify-content: center }
.notif-item { display: flex; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border); text-decoration: none !important; color: inherit }
.notif-item:last-child { border-bottom: 0 }
.notif-item:hover { background: var(--hover) }
.notif-item i { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0 }
.notif-item.nova i { background: var(--err) }
.notif-item.nova b { font-weight: 700 }

/* ---------- Páginas ---------- */
/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) }
.login-form { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px 24px; background: var(--surface); position: relative }
.login-caixa { width: 100%; max-width: 380px; margin: auto 0; animation: subir .5s cubic-bezier(.2, .8, .2, 1) both }
.login-form .logo { margin-bottom: 44px; font-size: 18px }
.login-form .logo-marca, .login-form .logo-marca img { width: 36px; height: 36px }
.login-form h1 { font-size: 28px; letter-spacing: -.03em; margin: 0 0 6px }
.login-sub { color: var(--muted); margin: 0 0 28px }
.login-form .alert { margin-bottom: 16px }
.login-form form { display: flex; flex-direction: column; gap: 16px }
.login-form label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600 }
.campo-ic { position: relative; display: block }
.campo-ic > svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); pointer-events: none; transition: color var(--t) }
.login-form .campo-ic input { width: 100%; height: 46px; padding: 0 44px 0 42px !important; border-radius: 10px; font-size: 14.5px; font-weight: 400 }
.campo-ic input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft) }
.campo-ic:focus-within > svg { color: var(--accent) }
.ver-senha { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 0 !important; margin: 0 !important; background: transparent !important; border: 0; color: var(--faint); display: grid; place-items: center; border-radius: 8px; box-shadow: none }
.ver-senha:hover, .ver-senha.on { color: var(--accent); background: var(--hover) !important }
.ver-senha svg { width: 18px; height: 18px }
.login-form .lembrar { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--muted) }
.login-btn { height: 46px; margin-top: 4px; border-radius: 10px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, #0B1B3A, #13315F) !important; color: #fff !important; box-shadow: 0 6px 18px -6px rgba(11, 27, 58, .55); transition: transform var(--t), box-shadow var(--t) }
.login-btn svg { width: 18px; height: 18px; transition: transform var(--t) }
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(11, 27, 58, .6) }
.login-btn:hover svg { transform: translateX(3px) }
:root[data-theme="escuro"] .login-btn { background: linear-gradient(135deg, #14B8A6, #2DD4BF) !important; color: #04131F !important }
.login-seguro { display: flex; align-items: center; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--faint) }
.login-seguro svg { width: 16px; height: 16px; color: var(--accent); flex: none }
.login-rodape { font-size: 12px; color: var(--faint); padding-top: 24px }

.login-arte { position: relative; overflow: hidden; color: #cbd5e1; padding: 56px clamp(32px, 5vw, 80px); display: flex; align-items: center;
  background: radial-gradient(ellipse at 15% 10%, #1A3A6B 0, transparent 50%), radial-gradient(ellipse at 90% 95%, rgba(45, 212, 191, .28) 0, transparent 55%), #0B1B3A }
.login-rede { position: absolute; inset: -5%; width: 110%; height: 110%; opacity: .75; animation: derivar 40s ease-in-out infinite alternate }
@keyframes derivar { to { transform: translate(-2%, 2%) scale(1.04) } }
.login-rede line { stroke-dasharray: 4 6; animation: fluir 6s linear infinite }
@keyframes fluir { to { stroke-dashoffset: -100 } }
.login-rede .pacote { fill: #A7F3D0; filter: drop-shadow(0 0 5px #2DD4BF); animation: none; opacity: 0 }
.login-rede.neural line { stroke: rgba(94, 234, 212, .14); stroke-width: .8; stroke-dasharray: none; animation: none }
.login-rede .neuronio { fill: #0B1B3A; stroke: #2DD4BF; stroke-width: 1.6; animation: disparar 4.2s ease-out infinite; transform-box: fill-box; transform-origin: center }
@keyframes disparar { 0% { fill: #0B1B3A } 6% { fill: #5EEAD4; transform: scale(1.5); filter: drop-shadow(0 0 8px #2DD4BF) } 22%, 100% { fill: #0B1B3A; transform: scale(1); filter: none } }
.login-grade { position: absolute; inset: 0; background-image: linear-gradient(rgba(148, 197, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 197, 255, .05) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 75%) }
.orbe { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none }
.orbe.o1 { width: 380px; height: 380px; background: #2DD4BF; top: -120px; right: -80px; opacity: .22; animation: orbitar 18s ease-in-out infinite alternate }
.orbe.o2 { width: 460px; height: 460px; background: #1E40AF; bottom: -160px; left: -120px; opacity: .45; animation: orbitar 22s ease-in-out infinite alternate-reverse }
.orbe.o3 { width: 240px; height: 240px; background: #14B8A6; top: 45%; left: 55%; opacity: .2; animation: orbitar 14s ease-in-out infinite alternate }
@keyframes orbitar { 50% { transform: translate(60px, 40px) scale(1.1) } 100% { transform: translate(-40px, 70px) scale(.95) } }
.login-rede line { stroke: rgba(94, 234, 212, .28); stroke-width: 1.2 }
.login-rede circle { fill: #2DD4BF; animation: pulsar 3.2s ease-in-out infinite }
@keyframes pulsar { 0%, 100% { opacity: .35 } 50% { opacity: 1 } }
.login-conteudo { position: relative; max-width: 520px; animation: subir .6s .1s cubic-bezier(.2, .8, .2, 1) both }
.login-selo { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; background: rgba(45, 212, 191, .12); border: 1px solid rgba(45, 212, 191, .3); color: #5EEAD4; font-size: 12.5px; font-weight: 600; margin-bottom: 20px }
.login-selo i { width: 7px; height: 7px; border-radius: 50%; background: #2DD4BF; box-shadow: 0 0 0 0 rgba(45, 212, 191, .6); animation: ping 1.8s infinite }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(45, 212, 191, 0) } 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0) } }
.login-arte h2 { font-family: Manrope, Inter, sans-serif; font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; line-height: 1.18; letter-spacing: -.03em; margin: 0 0 14px; color: #fff }
.login-arte h2 em { font-style: normal; background: linear-gradient(90deg, #2DD4BF, #5EEAD4); -webkit-background-clip: text; background-clip: text; color: transparent }
.login-arte p { color: #94a3b8; margin: 0 0 30px; font-size: 15px; line-height: 1.55 }
.login-preview { background: rgba(255, 255, 255, .97); color: #0f172a; border-radius: 14px; padding: 6px 6px 8px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1); transform: perspective(1200px) rotateY(-4deg) rotateX(2deg) }
.lp-cab { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 8px; font-size: 13px }
.lp-cab span { font-size: 11.5px; color: #0F766E; font-weight: 600 }
.lp-linha { display: grid; grid-template-columns: 32px 1fr auto auto; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; animation: entrar .5s cubic-bezier(.2, .8, .2, 1) both }
.lp-linha:nth-child(2) { background: #F0FDFA }
.lp-av { width: 32px; height: 32px; border-radius: 8px; background: #0B1B3A; color: #2DD4BF; display: grid; place-items: center; font-weight: 700; font-size: 13px }
.lp-txt b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.lp-txt small { color: #64748b; font-size: 11.5px }
.lp-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums }
.lp-st { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px }
.lp-st.ok { background: #CCFBF1; color: #0F766E } .lp-st.pend { background: #FEF3C7; color: #B45309 }
@keyframes entrar { from { opacity: 0; transform: translateX(14px) } }
@keyframes subir { from { opacity: 0; transform: translateY(12px) } }
.login-lista { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; font-size: 14px }
.login-lista li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(6px); color: #e2e8f0 }
.login-lista li::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: rgba(45, 212, 191, .15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232DD4BF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat }
@media (prefers-reduced-motion: reduce) { .login-caixa, .login-conteudo, .lp-linha, .login-rede circle, .login-selo i, .login-rede, .login-rede line, .orbe, .login-rede .neuronio { animation: none } .login-rede .pacote { display: none } }

/* Início */
.busca-doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px 40px 32px; margin-bottom: 16px; box-shadow: var(--shadow-sm); background-image: linear-gradient(110deg, transparent 55%, var(--accent-soft) 100%) }
.busca-cab { display: flex; gap: 16px; align-items: center; margin-bottom: 20px }
.busca-cab b { font-size: 16px } .busca-cab p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px }
.busca-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--pri); color: var(--pri-text); display: grid; place-items: center }
.busca-logo svg { width: 20px; height: 20px }
.busca-campo { display: flex; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; max-width: 1130px; background: var(--surface); transition: border-color var(--t), box-shadow var(--t) }
.busca-campo:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.busca-campo select { border: 0 !important; border-right: 1px solid var(--border-strong) !important; border-radius: 0 !important; background-color: var(--surface-2) !important; font-weight: 500; box-shadow: none !important }
.busca-campo input { flex: 1; border: 0 !important; border-radius: 0 !important; font-size: 15px; padding: 10px 12px !important; box-shadow: none !important; background: transparent !important }
.busca-campo button { border-radius: 0; background: var(--surface-2); color: var(--muted); border-left: 1px solid var(--border-strong); padding: 0 14px }
.busca-campo button:hover { background: var(--surface-3); color: var(--text) }
.home-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; align-items: start; margin-bottom: 22px }
.painel-cab h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 10px }
.painel-cab svg { width: 19px; height: 19px; color: var(--muted) }
.painel-sub { color: var(--muted); font-size: 13.5px; margin: 12px 0 18px }
.painel-link { display: block; text-align: center; margin-top: 18px; color: var(--text-2); font-weight: 600; font-size: 13.5px }
.atalhos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px }
.atalho { border-radius: var(--r-lg); padding: 24px 14px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; text-decoration: none !important; color: var(--text); min-height: 200px; transition: transform var(--t), box-shadow var(--t); border: 1px solid transparent }
.atalho:hover { transform: translateY(-2px); box-shadow: var(--shadow) }
.atalho svg { width: 22px; height: 22px }
.atalho b { font-size: 15px; line-height: 1.45 }
.atalho span { font-size: 26px; font-weight: 700; margin-top: auto; font-variant-numeric: tabular-nums }
.atalho small { display: block; font-size: 11px; font-weight: 400; color: var(--muted) }
.atalho.azul { background: var(--accent-soft); border-color: var(--accent-border) } .atalho.azul svg { color: var(--accent) }
.atalho.amarelo { background: var(--warn-soft); border-color: var(--warn-border) } .atalho.amarelo svg { color: var(--warn) }
.atalho.vermelho { background: var(--err-soft); border-color: var(--err-border) } .atalho.vermelho svg { color: var(--err) }
.atalho.novo { border: 1px dashed var(--border-strong); justify-content: center; color: var(--muted) }
.atalho.novo i { width: 44px; height: 44px; border-radius: var(--r); background: var(--surface-2); display: grid; place-items: center; font-style: normal; font-size: 26px; color: var(--muted) }
.atalho.novo span { font-size: 13.5px; font-weight: 400; margin: 0 }
.vol { background: var(--surface-2); border-radius: var(--r-lg); padding: 16px }
.vol b { font-size: 13.5px }
.vol-linha { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); margin-top: 12px; font-variant-numeric: tabular-nums }
.vol-barra { height: 6px; background: var(--surface-3); border-radius: 9px; margin-top: 6px; overflow: hidden }
.vol-barra i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transform-origin: left; animation: encher 1s .2s cubic-bezier(.2, .8, .2, 1) both }
@keyframes encher { from { transform: scaleX(0) } }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 12px }
.mini div { background: var(--surface-2); border-radius: var(--r-lg); padding: 16px; font-size: 13.5px }
.mini .vermelho { background: var(--err-soft) } .mini .amarelo { background: var(--warn-soft) }
.mini small { color: var(--muted) }
.cert-box { border: 1px solid var(--err-border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 8px }
.cert-box.av { border-color: var(--warn-border) }
.cert-topo { display: flex; gap: 14px; align-items: flex-start; background: var(--err-soft); padding: 14px 16px; font-size: 13.5px }
.cert-box.av .cert-topo { background: var(--warn-soft) }
.cert-topo .dot { margin-top: 6px; width: 10px; height: 10px }
.cert-box p { margin: 0; padding: 12px 16px; font-size: 13.5px; color: var(--text-2) }
.aviso-linha { display: block; background: var(--warn-soft); border-radius: var(--r-lg); padding: 14px 16px; margin: 10px 0; color: var(--text-2); text-decoration: none !important; font-size: 13.5px }
.aviso-linha.erro { background: var(--err-soft) }
.aviso-linha b { margin-right: 6px; color: var(--text); font-variant-numeric: tabular-nums }
.consulta-info { background: var(--surface-2); border-radius: var(--r-lg); padding: 16px; font-size: 13.5px; color: var(--text-2); line-height: 1.6 }
.sec-tit { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 12px }
.sec-tit h2 { font-size: 17px; margin: 0 }
.sec-tit a { font-size: 13px }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px }
.emp { padding: 16px; text-decoration: none !important; color: inherit; display: flex; flex-direction: column; gap: 14px; transition: border-color var(--t), box-shadow var(--t), transform var(--t) }
.emp:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px) }
.emp-top { display: flex; gap: 12px; align-items: center }
.emp-uf { width: 42px; height: 42px; border-radius: 10px; background: var(--pri); color: var(--pri-text); font-weight: 700; display: grid; place-items: center; font-size: 14px; flex-shrink: 0 }
.emp-nome { display: flex; flex-direction: column; min-width: 0 }
.emp-nome b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.emp-nome .mono { color: var(--muted) }
.emp-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--surface-2); border-radius: var(--r); padding: 10px; font-variant-numeric: tabular-nums }
.emp-nums span { display: block; font-size: 11px; color: var(--muted) }
.emp-nums b { font-size: 15px; font-weight: 700 }
.emp-nums b.alerta { color: var(--err) }
.emp-status { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px }
.rodape { margin: 30px 0 4px; color: var(--faint); font-size: 13px }

/* BI */
.bi-filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px }
.bi-filtros select { min-width: 180px }
.bi-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; margin-bottom: 16px }
.bi-kpi { padding: 14px 16px; position: relative; overflow: hidden; box-shadow: none }
.bi-kpi span { font-size: 12.5px; color: var(--muted) }
.bi-kpi b { display: block; font-size: clamp(17px, 1.45vw, 21px); font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; white-space: nowrap; font-variant-numeric: tabular-nums }
.bi-var { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: var(--r-full); font-variant-numeric: tabular-nums }
.bi-var.sobe { color: var(--ok); background: var(--ok-soft) }
.bi-var.desce { color: var(--err); background: var(--err-soft) }
.bi-var.neutro { color: var(--muted); background: var(--surface-2) }
.bi-kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); transform: scaleY(0); transform-origin: bottom; animation: kpiBarra .7s .15s cubic-bezier(.2, .8, .2, 1) forwards }
@keyframes kpiBarra { to { transform: scaleY(1) } }
.bi-bloco h4 { margin: 0 0 2px; font-size: 14.5px }
.bi-bloco p { margin: 0 0 6px; color: var(--muted); font-size: 12.5px }
.bi-duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.bi-graf { width: 100%; height: 300px }
.bi-graf.baixo { height: 300px }
.bi-vazio { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; width: 110px }
.spark i { flex: 1; background: var(--accent-border); border-radius: 2px 2px 0 0; min-height: 1px; transform-origin: bottom; animation: crescer .6s cubic-bezier(.2, .8, .2, 1) both }
.spark i.cheio { background: var(--accent) }
.spark i:nth-child(2) { animation-delay: .03s } .spark i:nth-child(3) { animation-delay: .06s } .spark i:nth-child(4) { animation-delay: .09s }
.spark i:nth-child(5) { animation-delay: .12s } .spark i:nth-child(6) { animation-delay: .15s } .spark i:nth-child(7) { animation-delay: .18s }
.spark i:nth-child(8) { animation-delay: .21s } .spark i:nth-child(9) { animation-delay: .24s } .spark i:nth-child(10) { animation-delay: .27s }
.spark i:nth-child(11) { animation-delay: .3s } .spark i:nth-child(12) { animation-delay: .33s }

/* Contas, impostos, fornecedores, importar */
.sit-pag { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.aviso-nota { color: var(--orange) !important }
.tabela tr.nf-linha.ativa small.aviso-nota { color: #fcd34d !important }
.aviso-preco { color: var(--orange); font-weight: 600 }
.drop-zona { border: 2px dashed var(--border-strong); border-radius: var(--r-lg); padding: 44px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; transition: border-color var(--t), background var(--t); background: var(--surface-2) }
.drop-zona:hover, .drop-zona.sobre { border-color: var(--accent); background: var(--accent-soft) }
.drop-zona svg { width: 38px; color: var(--faint) }
.escolhidos { font-weight: 600; color: var(--accent) }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px }
.lista-simples { padding-left: 18px; margin: 0; line-height: 1.7; color: var(--muted) }

/* ---------- Utilitários ---------- */
.muted { color: var(--muted) }
.mono { font-family: var(--mono); font-size: 12px }
.num { font-variant-numeric: tabular-nums }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .home-cols { grid-template-columns: 1fr }
  .atalhos { grid-template-columns: repeat(2, 1fr) }
  .bi-duplo { grid-template-columns: 1fr }
}
@media (max-width: 900px) {
  :root { --side: 260px }
  body.recolhido { --side: 260px }
  .side { transform: translateX(-100%); transition: transform .2s ease; background: var(--bg); box-shadow: var(--shadow-lg) }
  body.menu .side { transform: none }
  body.recolhido .side a .rot { display: inline } body.recolhido .side a { justify-content: flex-start } body.recolhido .side h6 { height: auto; background: none; color: var(--muted) }
  .recolher { display: none }
  main { margin-left: 0; padding: 16px 14px 32px }
  .menu-btn { display: inline-grid }
  .top { gap: 10px; padding: 0 12px }
  .top .pill { max-width: 140px }
  .busca-doc { padding: 20px }
  .drop-menu.notif { right: -100px; width: min(360px, calc(100vw - 24px)) }
  body.menu::after { content: ""; position: fixed; inset: var(--top) 0 0 0; background: rgba(10, 14, 20, .4); z-index: 14; animation: fadeIn .15s }
}
@media (max-width: 600px) {
  .logo-nome, .top .ajuda { display: none }
  .top .pill { max-width: 46vw }
  kbd { display: none }
}
/* Tabelas viram cartões no celular */
@media (max-width: 760px) {
  .tabela thead { display: none }
  .tabela, .tabela tbody, .tabela tr, .tabela td { display: block; width: 100% }
  .tabela tbody tr { border-bottom: 1px solid var(--border); padding: 10px 46px 10px 14px; position: relative }
  .tabela td small { display: inline; margin-left: 6px }
  .tabela td.col-emit small, .tabela td.col-rd small { display: block; margin-left: 0 }
  .tabela td.col-emp { white-space: normal; overflow: visible; flex-wrap: wrap; justify-content: flex-end }
  .tabela td.col-emp::before { margin-right: auto }
  .tabela tbody tr.nf-acoes { padding: 0 }
  .tabela td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; max-width: none !important }
  .tabela td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; flex-shrink: 0 }
  .tabela td:not([data-label])::before, .tabela td[data-label=""]::before { display: none }
  .tabela td > * { min-width: 0 }
  .tabela td.col-emit { display: block; text-align: left; padding-right: 40px }
  .tabela td.col-emit::before { display: none }
  .tabela td.chevron-td { position: absolute; top: 10px; right: 10px; width: auto; padding: 0 }
  .tabela td.chevron-td::before { display: none }
  .tabela td:first-child:has(input[type=checkbox]) { position: absolute; left: -2px; top: 12px; width: auto }
  .tabela tbody tr:has(input.sel) { padding-left: 36px }
  .tabela tr.nf-acoes td { display: block; padding: 0 10px 10px }
  .tabela tr.nf-acoes td::before { display: none }
  .tabela td.vazio { display: block }
  .tabela td.vazio::before { display: none }
  .total-linha td { display: flex }
  .lista-busca > * { flex: 1 1 100% }
  .periodo { justify-content: space-between }
  .cabecalho { align-items: flex-start }
  .lista-rodape { justify-content: center } .por-pagina { margin-left: 0 }
  .kpis { grid-template-columns: repeat(2, 1fr) }
  .kpi b { font-size: 19px }
  .login { grid-template-columns: 1fr } .login-arte { display: none }
  .login-form .logo-nome { display: inline }
  .toasts { right: 12px; left: 12px; bottom: 12px; max-width: none }
  h1 { font-size: 20px }
}
@media (max-width: 520px) {
  .atalhos { grid-template-columns: 1fr 1fr } .atalho { min-height: 160px; padding: 18px 10px }
  .vg-filtros, .bi-kpis { grid-template-columns: 1fr 1fr }
  .emp-grid { grid-template-columns: 1fr }
}

/* Movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important }
}

/* ---------- Modal, senha provisória, filtros salvos, primeiros passos, alertas ---------- */
.modal { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg) }
.modal::backdrop { background: rgba(10, 14, 20, .45) }
.modal[open] { animation: surgir .18s ease-out }
.modal form { display: flex; flex-direction: column; gap: 14px; padding: 20px }
.modal label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500 }
.modal label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400 }
.modal-cab { display: flex; justify-content: space-between; align-items: center } .modal-cab b { font-size: 17px }
.modal-rodape { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px }
.cores-escolha { display: flex; gap: 8px; flex-wrap: wrap }
.cores-escolha label { flex-direction: row !important; cursor: pointer }
.cores-escolha input { position: absolute; opacity: 0; pointer-events: none }
.cores-escolha span { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; display: block }
.cores-escolha input:checked + span { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset }
.cores-escolha input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px }

.senha-box { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; background: var(--ok-soft); border: 1px solid var(--ok-border); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 16px; flex-wrap: wrap }
.senha-box b { color: var(--ok) } .senha-box p { margin: 4px 0 10px; color: var(--text-2) }
.senha-dados { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted) }
.senha-dados code { font: 600 13.5px var(--mono); color: var(--text); background: var(--surface); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; margin-left: 4px }

/* cores de atalho */
.c-azul { --c: var(--accent); --c-soft: var(--accent-soft); --c-borda: var(--accent-border) }
.c-amarelo { --c: var(--warn); --c-soft: var(--warn-soft); --c-borda: var(--warn-border) }
.c-vermelho { --c: var(--err); --c-soft: var(--err-soft); --c-borda: var(--err-border) }
.c-verde { --c: var(--ok); --c-soft: var(--ok-soft); --c-borda: var(--ok-border) }
.c-roxo { --c: #7c3aed; --c-soft: #f3eeff; --c-borda: #ddd0fb }
.c-cinza { --c: var(--muted); --c-soft: var(--surface-2); --c-borda: var(--border) }
:root[data-theme="escuro"] .c-roxo { --c: #a78bfa; --c-soft: #241a3d; --c-borda: #3b2d63 }
.cor-amostra { background: var(--c) }
.atalho.salvo { background: var(--c-soft); border-color: var(--c-borda); position: relative }
.atalho.salvo svg { color: var(--c) }
.atalho .remover { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity var(--t) }
.atalho:hover .remover, .atalho:focus-within .remover { opacity: 1 }
.atalho .remover button { background: var(--surface); color: var(--muted); border: 1px solid var(--border); width: 24px; height: 24px; padding: 0; border-radius: 6px; font-size: 13px }
.atalho .remover button:hover { color: var(--err) }
.salvos { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px 0 }
.salvos > span { font-size: 12px; color: var(--muted); font-weight: 600 }
.salvo-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--c-borda); background: var(--c-soft); color: var(--text); border-radius: var(--r-full); padding: 3px 4px 3px 10px; font-size: 12.5px; text-decoration: none !important }
.salvo-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c) }
.salvo-chip.on { outline: 2px solid var(--c); outline-offset: 1px }
.salvo-chip form { display: inline } .salvo-chip button { background: none; color: var(--muted); padding: 0 5px; font-size: 13px; line-height: 1 }
.salvo-chip button:hover { background: none; color: var(--err) }

/* Primeiros passos */
.passos { background: var(--surface); border: 1px solid var(--accent-border); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); background-image: linear-gradient(135deg, var(--accent-soft), transparent 60%) }
.passos-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px }
.passos-cab h2 { font-size: 18px; margin: 0 } .passos-cab p { margin: 4px 0 0; color: var(--muted) }
.passos-barra { height: 6px; background: var(--surface-3); border-radius: 9px; overflow: hidden; margin-bottom: 16px }
.passos-barra i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transition: width .4s }
.passos ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px }
.passos li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 6px }
.passos li.feito { border-color: var(--ok-border); background: var(--ok-soft) }
.passo-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border) }
.feito .passo-num { background: var(--ok); color: #fff; border-color: var(--ok) }
.passos li b { font-size: 14.5px } .passos li p { margin: 0; color: var(--muted); font-size: 13px; flex: 1 }
.passos li .btn { align-self: flex-start; margin-top: 6px }
@media (max-width: 900px) { .passos ol { grid-template-columns: 1fr } }

/* Alertas de duplicidade/preço */
.alerta-ico { display: inline-flex; align-items: center; gap: 4px; color: var(--orange); font-size: 11.5px; font-weight: 600 }
.alerta-ico svg { width: 13px; height: 13px }
.preco-alto { color: var(--orange); font-weight: 600 }
.historico { list-style: none; padding: 0; margin: 0 }
.historico li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px }
.historico li:last-child { border-bottom: 0 }
.historico time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 112px }

/* ---------- Seletor múltiplo de empresas ---------- */
.multi { position: relative; min-width: 260px; flex: 1 1 260px; max-width: 520px }
.multi-campo {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 3px 8px 3px 6px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r); font-weight: 400; justify-content: space-between; text-align: left
}
.multi-campo:hover { background: var(--surface); border-color: var(--faint) }
.multi.aberto .multi-campo { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.multi-chips { display: flex; gap: 4px; align-items: center; min-width: 0; flex: 1; overflow: hidden }
.multi-chips:empty::before { content: attr(data-vazio); color: var(--muted); padding-left: 4px }
.multi-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); padding: 1px 4px 1px 9px; font-size: 12px; color: var(--text-2); max-width: 100%; min-width: 0 }
.multi-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.multi-chip button { background: none; color: var(--muted); padding: 0 3px; border: 0; font-size: 13px; line-height: 1; border-radius: 50% }
.multi-chip button:hover { background: var(--surface-3); color: var(--text) }
.multi-mais { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; font-weight: 600 }
.multi-seta { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; padding: 2px; border-radius: 4px; transition: transform .15s }
.multi.aberto .multi-seta { transform: rotate(180deg); background: var(--surface-2) }
.multi-menu {
  display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 35; width: max(100%, 460px); max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden
}
.multi.aberto .multi-menu { display: block; animation: surgir .14s ease-out }
.multi.direita .multi-menu { left: auto; right: 0 }
.multi-busca { padding: 10px 12px 6px }
.multi-busca input { width: 100% }
.multi-lista { max-height: 290px; overflow-y: auto; scrollbar-width: thin }
.multi-op { display: flex; align-items: flex-start; gap: 12px; padding: 9px 16px; cursor: pointer; color: var(--text-2); font-size: 13.5px; line-height: 1.45 }
.multi-op:hover { background: var(--surface-2) }
.multi-op input { margin-top: 2px; flex-shrink: 0; width: 17px; height: 17px }
.multi-op:has(input:checked) { background: var(--accent-soft); color: var(--text) }
.multi-todos { border-bottom: 1px solid var(--border); color: var(--text-2) }
.multi-todos:has(input:checked) { background: transparent }
.multi-rodape { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface-2) }
.gaveta-painel .multi, .lista-acoes .multi, .bi-filtros .multi { max-width: none }
.gaveta-painel .multi-menu { width: 100% }
@media (max-width: 760px) { .multi { max-width: none; min-width: 0 } .multi-menu { width: 100% } }

/* Lista de atividades (consultas SEFAZ) */
.atividades { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto }
.atividades li { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--border) }
.atividades li:last-child { border-bottom: 0 }
.atividades .dot { margin-top: 6px }
.ativ-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px }
.ativ-linha { display: flex; justify-content: space-between; gap: 10px; align-items: baseline }
.ativ-linha b { font-size: 13.5px; font-weight: 600 }
.ativ-linha time { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums }
.ativ-emp { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ativ-msg { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere }
.ativ-msg .tag { font-size: 11px; padding: 0 6px; font-variant-numeric: tabular-nums }
.cert-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border) }
.cert-item:last-child { border-bottom: 0 }
.cert-item > div { flex: 1; min-width: 0; display: flex; flex-direction: column }
.cert-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.cert-item small { color: var(--muted) }
.cert-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0 }
.cert-ico svg { width: 20px; height: 20px }
.cert-ico.ok { background: var(--ok-soft); color: var(--ok) } .cert-ico.warn { background: var(--warn-soft); color: var(--warn) } .cert-ico.err { background: var(--err-soft); color: var(--err) }
@media (max-width: 1100px) { .grid[style*="1.2fr"] { grid-template-columns: 1fr !important } }
.captura { display: flex; flex-direction: column; gap: 3px; font-size: 13px }
.captura b { font-weight: 600; font-size: 11.5px; color: var(--muted); min-width: 32px }
.comp-campo { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500 }
.exports { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; padding: 16px 18px 18px }
.export { display: flex; gap: 14px; align-items: center; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px }
.export > div { flex: 1; min-width: 0 } .export b { font-size: 14.5px } .export p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px }
.export-ico { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0 }
.export-ico.verde { background: var(--ok-soft); color: var(--ok) } .export-ico svg { width: 21px; height: 21px }
@media (max-width: 760px) { .exports { grid-template-columns: 1fr } .export { flex-wrap: wrap } }
/* seletor global no topo */
.topo-empresas { margin: 0 }
.multi-topo { min-width: 0; max-width: none; flex: none }
.multi-topo .multi-campo { min-height: 34px; border-radius: var(--r-full); background: var(--surface-2); border-color: var(--border); padding: 3px 8px 3px 10px; gap: 6px; max-width: 320px }
.multi-topo .multi-campo:hover { background: var(--surface-3) }
.multi-topo .multi-chips { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block }
.multi-topo .multi-chips:empty::before { color: var(--text); padding: 0 }
.multi-ico { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0 }
.multi-topo .multi-menu { width: 480px }
.multi-topo.filtrando .multi-campo { background: var(--accent-soft); border-color: var(--accent-border) }
.multi-topo.filtrando .multi-chips, .multi-topo.filtrando .multi-ico { color: var(--accent) }
@media (max-width: 600px) { .multi-topo .multi-campo { max-width: 46vw } .multi-topo .multi-menu { position: fixed; left: 12px; right: 12px; top: 64px; width: auto } }
.lista-busca .busca-input { flex: 2 1 280px }
.lista-busca .multi { flex: 1 1 240px; max-width: 360px }

/* ---------- Visualizador de documentos ---------- */
.visor-fundo { position: fixed; inset: 0; background: rgba(10, 14, 20, .5); z-index: 44; animation: fadeIn .15s }
.visor { position: fixed; z-index: 45; top: 24px; bottom: 24px; left: 50%; transform: translateX(-50%); width: min(1440px, calc(100vw - 48px));
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: visorIn .2s cubic-bezier(.2, .8, .2, 1) }
@keyframes visorIn { from { opacity: 0; transform: translate(-50%, 10px) scale(.99) } }
body.visor-aberto { overflow: hidden }
.visor-cab { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px 12px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap }
.visor-cab h2 { margin: 0; font-size: 19px; display: flex; align-items: center; gap: 10px; outline: none }
.visor-cab h2 > svg { width: 22px; height: 22px; color: var(--muted) }
.visor-acoes { display: flex; align-items: center; gap: 4px; flex-wrap: wrap }
.visor-btn { background: none; color: var(--text-2); border: 0; padding: 7px 10px; font-weight: 600; font-size: 13.5px; gap: 7px }
.visor-btn:hover { background: var(--surface-2); color: var(--text) }
.visor-btn svg { width: 17px; height: 17px; color: var(--muted) }
.visor-sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px }
.visor-acoes .ico:disabled { opacity: .3; cursor: default; background: none }
.visor-acoes .drop-menu form { margin: 0 }
.visor-abas { display: flex; gap: 2px; padding: 0 22px; border-bottom: 1px solid var(--border) }
.visor-abas button { background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 11px 12px; font-weight: 500; margin-bottom: -1px }
.visor-abas button:hover { background: none; color: var(--text) }
.visor-abas button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600 }
.visor-abas span { background: var(--surface-2); border-radius: var(--r-full); padding: 0 7px; font-size: 11.5px; margin-left: 4px; color: var(--muted) }
.visor-corpo { flex: 1; overflow-y: auto; padding: 18px 22px; background: var(--bg) }
.visor-corpo section[data-painel="doc"] { display: flex; flex-direction: column; gap: 12px; min-height: 100% }
.visor-corpo section[data-painel="doc"][hidden] { display: none }
.visor-pdf { width: 100%; flex: 1; min-height: 70vh; border: 1px solid var(--border); border-radius: var(--r); background: #525659 }
.visor-etqs { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden }
.visor-etqs > span { background: var(--surface-2); padding: 12px 14px; font-weight: 600; font-size: 13px; color: var(--text-2); min-width: 140px; border-right: 1px solid var(--border) }
.visor-etqs > div { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 8px 12px }
.visor-carregando { padding: 28px }
tr.visor-atual td { box-shadow: inset 3px 0 0 var(--accent) }
tr.visor-atual td ~ td { box-shadow: none }

/* DANFE de resumo */
.danfe-resumo { position: relative; background: #fff; color: #1c2128; border: 1px solid var(--border); border-radius: var(--r); padding: 18px; overflow: hidden; font-size: 13px }
.danfe-marca { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-32deg); font-size: clamp(56px, 9vw, 120px); font-weight: 800; color: rgba(239, 68, 68, .28); letter-spacing: .04em; pointer-events: none; white-space: nowrap }
.dr-grid { display: grid; gap: 0; border: 1px solid #cfd4db; border-bottom: 0 }
.dr-grid + .dr-grid { border-top: 0 }
.dr-topo { grid-template-columns: 1.6fr 1fr 1.6fr }
.dr-cel { border-right: 1px solid #cfd4db; border-bottom: 1px solid #cfd4db; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; min-height: 52px }
.dr-cel:last-child { border-right: 0 }
.dr-cel small { font-size: 10px; color: #59636e; text-transform: uppercase }
.dr-cel b { font-size: 14px }
.dr-emit b { font-size: 16px; margin-top: 10px }
.dr-centro { align-items: center; text-align: center }
.dr-chave { font-size: 13px; letter-spacing: .03em }
.dr-sec { margin: 16px 0 6px; font-size: 13px; color: var(--accent) }
.dr-aviso { margin: 16px 0 0; color: #59636e; font-size: 12.5px }
@media (max-width: 900px) {
  .visor { top: 0; bottom: 0; width: 100vw; border-radius: 0 }
  .visor-cab { padding: 10px 12px } .visor-btn { padding: 6px 8px; font-size: 12.5px } .visor-corpo { padding: 12px }
  .dr-topo, .dr-grid { grid-template-columns: 1fr !important } .dr-cel { border-right: 0 }
}
.perm-opcoes { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; margin-top: 6px }
.modal label.perm-op { flex-direction: row; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--r); font-weight: 400; cursor: pointer }
.perm-op:hover { background: var(--surface-2) }
.perm-op:has(input:checked) { background: var(--accent-soft) }
.perm-op input { margin-top: 3px; flex-shrink: 0 }
.perm-op span { display: flex; flex-direction: column } .perm-op b { font-size: 13.5px; color: var(--text) } .perm-op small { color: var(--muted); font-size: 12px }
.perm-lista { max-width: 340px; white-space: normal }
.etq-aplicar { display: flex; flex-direction: column; gap: 6px }
.etq-remover { width: 100%; background: transparent; color: #fca5a5; border: 1px solid rgba(252, 165, 165, .4); font-weight: 600; padding: 7px }
.etq-remover:hover { background: rgba(248, 81, 73, .12) } .etq-remover:disabled { opacity: .45 }

/* ---------- Busca global (Ctrl+K) ---------- */
.busca-global { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); border-radius: var(--r); padding: 6px 8px 6px 10px; font-weight: 400; min-width: 260px; margin-left: 8px }
.busca-global:hover { background: var(--surface-3); color: var(--text) }
.busca-global svg { width: 16px; height: 16px }
.busca-global span { flex: 1; text-align: left; font-size: 13px }
.paleta { position: fixed; inset: 0; z-index: 70 }
.paleta-fundo { position: absolute; inset: 0; background: rgba(10, 14, 20, .45); animation: fadeIn .12s }
.paleta-caixa { position: relative; margin: 10vh auto 0; width: min(640px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: surgir .15s ease-out }
.paleta-campo { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border) }
.paleta-campo svg { width: 19px; height: 19px; color: var(--muted); flex-shrink: 0 }
.paleta-campo input { flex: 1; border: 0 !important; box-shadow: none !important; font-size: 16px; padding: 4px 0 !important; background: transparent !important; min-height: 0 !important }
.paleta-lista { max-height: 56vh; overflow-y: auto; padding: 6px }
.paleta-grupo { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 10px 10px 4px; text-transform: uppercase; letter-spacing: .03em }
.paleta-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r); color: var(--text); text-decoration: none !important }
.paleta-item.on { background: var(--accent-soft) }
.paleta-tipo { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; min-width: 64px; text-align: center; flex-shrink: 0 }
.paleta-item.on .paleta-tipo { color: var(--accent); border-color: var(--accent-border); background: var(--surface) }
.paleta-txt { flex: 1; min-width: 0; display: flex; flex-direction: column }
.paleta-txt b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.paleta-txt small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.paleta-valor { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px }
.paleta-vazio { padding: 24px; text-align: center; color: var(--muted); margin: 0 }
.paleta-rodape { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--muted) }
.paleta-rodape kbd { margin-right: 3px }
body.paleta-aberta { overflow: hidden }
/* período rápido */
.periodo-rapido { border: 0 !important; border-left: 1px solid var(--border) !important; border-radius: 0 !important; box-shadow: none !important; min-height: 32px !important; padding: 4px 26px 4px 10px !important; background-color: transparent !important; color: var(--muted); font-size: 13px; background-position: right 6px center !important }
@media (max-width: 900px) { .busca-global { min-width: 0; margin-left: 0 } .busca-global span, .busca-global kbd { display: none } }
.toast-desfazer { margin: 0 }
.toast-desfazer button { background: var(--surface-2); color: var(--accent); border: 1px solid var(--border); padding: 3px 10px; font-size: 12.5px; font-weight: 600 }
.toast-desfazer button:hover { background: var(--accent-soft); color: var(--accent) }
/* modo triagem */
.triagem-barra { display: none }
.visor.triagem .triagem-barra { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 22px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-border); flex-wrap: wrap }
.triagem-info { display: flex; align-items: baseline; gap: 10px } .triagem-info b { color: var(--accent) } .triagem-info small { color: var(--muted) }
.triagem-acoes { display: flex; gap: 8px; flex-wrap: wrap } .triagem-acoes form { margin: 0 }
.triagem-acoes button { padding: 9px 16px; font-weight: 600; gap: 8px }
.triagem-acoes kbd { background: rgba(255, 255, 255, .25); border-color: rgba(255, 255, 255, .35); color: inherit }
.t-confirmar { background: var(--ok); color: #fff } .t-confirmar:hover { background: var(--ok); filter: brightness(.95) }
.t-ciencia { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border) } .t-ciencia:hover { background: var(--warn-soft); filter: brightness(.97) }
.t-desconhecer { background: var(--surface); color: var(--err); border-color: var(--err-border) } .t-desconhecer:hover { background: var(--err-soft) }
.t-pular { background: var(--surface); color: var(--text-2); border-color: var(--border-strong) } .t-pular:hover { background: var(--surface-2) }
.t-ciencia kbd, .t-desconhecer kbd, .t-pular kbd { background: var(--surface-2); border-color: var(--border); color: var(--muted) }
.btn-triagem { background: var(--accent); color: #fff } .btn-triagem:hover { background: var(--accent-hover) }
.visor-fim { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; height: 100%; padding: 40px }
.visor-fim .vazio-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok) } .visor-fim .vazio-ico svg { width: 32px; height: 32px }
.visor-fim b { font-size: 20px } .visor-fim p { color: var(--muted); margin: 0 0 10px }
/* preferências */
.col-oculta { display: none !important }
.prefs-menu { min-width: 200px }
.drop-menu label.pref-op { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--text) }
.drop-menu label.pref-op:hover { background: var(--surface-2) }
body.densidade-compacta .tabela td { padding-top: 6px; padding-bottom: 6px; font-size: 13px }
body.densidade-compacta .tabela td small { font-size: 11px }
body.densidade-compacta .tabela th { padding-top: 7px; padding-bottom: 7px }
/* Início personalizável */
.inicio-blocos, .inicio-col { display: flex; flex-direction: column; min-width: 0 }
.inicio-blocos > *, .inicio-col > * { margin-top: 0 }
.inicio-topo { display: flex; justify-content: flex-end; margin: -8px 0 10px }
.modal-corpo { display: flex; flex-direction: column; gap: 10px; padding: 20px }
.inicio-lista { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r) }
.inicio-lista li { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--border) }
.inicio-lista li:last-child { border-bottom: 0 }
.inicio-lista label { display: flex; align-items: center; gap: 9px; flex-direction: row !important; font-weight: 400 !important; cursor: pointer }
.inicio-lista .ico { padding: 4px 8px; font-size: 14px }
.inicio-lista li:first-child [data-mover="-1"], .inicio-lista li:last-child [data-mover="1"] { opacity: .3; pointer-events: none }
/* contas (clientes) */
.conta-nome { font-size: 12.5px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--border); padding-left: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.faixa-suporte { position: fixed; top: var(--top); left: var(--side); right: 0; z-index: 16; background: #7c2d12; color: #ffedd5; padding: 7px 20px; font-size: 13px; display: flex; align-items: center; gap: 12px; transition: left .2s }
.faixa-suporte form { margin: 0 0 0 auto } .faixa-suporte button { background: #ffedd5; color: #7c2d12 }
.faixa-suporte + main { padding-top: 60px }
@media (max-width: 900px) { .faixa-suporte { left: 0 } .conta-nome { display: none } }
.login-conteudo::before { content: ""; position: absolute; inset: -60px -70px; z-index: -1; background: radial-gradient(ellipse at center, rgba(11, 27, 58, .82) 35%, rgba(11, 27, 58, 0) 72%); pointer-events: none }
