:root {
  --kb-primary: #1d4ed8;
  --kb-primary-dark: #1e3a8a;
  --kb-sidebar: #0f172a;
  --kb-bg: #f4f6fb;
}
body { background: var(--kb-bg); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.btn-primary { --bs-btn-bg: var(--kb-primary); --bs-btn-border-color: var(--kb-primary); --bs-btn-hover-bg: var(--kb-primary-dark); --bs-btn-hover-border-color: var(--kb-primary-dark); --bs-btn-active-bg: var(--kb-primary-dark); }
a { color: var(--kb-primary); }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: var(--kb-sidebar); color: #cbd5e1; padding: 1.25rem .75rem; position: fixed; display: flex; flex-direction: column; overflow: hidden; inset: 0 auto 0 0; z-index: 1030; transition: transform .2s; }
.sidebar-brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .02em; padding: 0 .5rem; }
.sidebar-logo { display: block; width: 120px; height: auto; margin: .25rem auto 0; }
.sidebar-tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; padding: 1.25rem .5rem .5rem; }
.sidebar-nav .nav-link { color: #cbd5e1; border-radius: .5rem; padding: .6rem .75rem; display: flex; align-items: center; gap: .75rem; }
.sidebar-nav-fixo { flex: none; }
.sidebar-nav-rolagem { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; color-scheme: dark; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.sidebar-nav-rolagem::-webkit-scrollbar { width: 8px; }
.sidebar-nav-rolagem::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav-rolagem::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.sidebar-nav-rolagem::-webkit-scrollbar-thumb:hover { background: #475569; }
.sidebar-brand, .sidebar-tag { flex: none; }
.sidebar-nav .nav-secao { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; padding: 1rem .75rem .35rem; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--kb-primary); color: #fff; }
.main { flex: 1; margin-left: 248px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid #e5e7eb; padding: .6rem 1.5rem; display: flex; align-items: center; gap: .75rem; }
.topbar-title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.content { padding: 1.5rem; max-width: 1280px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #dbeafe; color: var(--kb-primary-dark); font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.aberta { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
}

/* Cartões */
.card { border: 1px solid #e5e7eb; border-radius: .75rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: transparent; font-weight: 600; }
.kpi { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; }
.kpi-icon { width: 46px; height: 46px; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.kpi-valor { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.kpi-rotulo { color: #64748b; font-size: .82rem; }
.table > :not(caption) > * > * { padding-top: .75rem; padding-bottom: .75rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; white-space: nowrap; }
.secao-titulo { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; font-weight: 600; }

/* Ocultar valores (olho na barra superior) */
.valores-ocultos .valores-sensivel { filter: blur(8px); pointer-events: none; user-select: none; }
.vl { white-space: nowrap; }

/* Login */
.body-auth { background: #fff; }
.auth { min-height: 100vh; display: flex; }
.auth-lado { flex: 1 1 50%; background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.auth-lado h2 { font-weight: 700; max-width: 420px; }
.auth-lado li { margin-bottom: .75rem; color: #dbeafe; }
.auth-form { flex: 1 1 50%; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-box { width: 100%; max-width: 380px; }
@media (max-width: 991.98px) { .auth-lado { display: none; } }

/* Impressão / PDF: só o conteúdo da página, sem menu, barra do topo, filtros e avisos */
@media print {
  @page { size: A4; margin: 12mm; }
  body, body.body-shell { background: #fff; }
  .sidebar, .topbar, .alert, .d-print-none { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; }
  .card-header, .card-footer { background: transparent; padding-left: 0; padding-right: 0; }
  .table-responsive { overflow: visible; }
  tr { break-inside: avoid; }
  tfoot { display: table-row-group; }
}

/* Política de privacidade (texto corrido) */
.politica-texto { max-width: 820px; }
.politica-texto p, .politica-texto ul { font-size: .94rem; line-height: 1.65; }
.politica-texto h3 { font-size: 1.02rem; font-weight: 700; margin: 24px 0 10px; }
.politica-texto ul { padding-left: 20px; }
.politica-texto li { margin-bottom: 6px; }
.politica-texto .pp-versao { color: var(--bs-secondary-color); font-size: .86rem; }
