/* ==========================================================================
   UDP InvoiceHub — Design System
   Identidade: Azul Principal #0B6BFF · Azul Secundário #00A3FF
               Azul Escuro #0F2D4A · Verde Bling #22C55E · Montserrat
   ========================================================================== */
:root {
  --azul: #0B6BFF;
  --azul-2: #00A3FF;
  --azul-escuro: #0F2D4A;
  --azul-noite: #0A1F35;
  --verde: #22C55E;
  --vermelho: #EF4444;
  --amarelo: #F59E0B;

  --bg: #F3F6FB;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --border: #E3E9F2;
  --text-main: #0F2D4A;
  --text-muted: #64748B;

  --gradiente: linear-gradient(135deg, var(--azul) 0%, var(--azul-2) 100%);
  --gradiente-escuro: linear-gradient(160deg, #0F2D4A 0%, #0A1F35 100%);
  --sombra-sm: 0 1px 2px rgba(15, 45, 74, .06);
  --sombra: 0 6px 24px -8px rgba(15, 45, 74, .14);
  --sombra-azul: 0 10px 24px -10px rgba(11, 107, 255, .55);
  --raio: 14px;
  --raio-sm: 10px;
  --sidebar-w: 264px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font); color: var(--text-main); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0 0 6px; font-weight: 700; letter-spacing: -.01em; color: var(--text-main); }
h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; }
a { color: var(--azul); }
code { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px; }
.text-muted { color: var(--text-muted); font-size: .9rem; margin: 0; }
.mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.ico { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===================== LAYOUT DO PAINEL ===================== */
body.painel-body { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 50;
  background: var(--gradiente-escuro); color: #fff;
  display: flex; flex-direction: column; padding: 22px 16px;
  transition: transform .3s ease;
}
.sidebar::after { content: ""; position: absolute; inset: auto -80px -80px auto; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(0,163,255,.25), transparent 70%); pointer-events: none; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 18px; }
.sidebar-brand img { width: 42px; height: 42px; }
.sidebar-brand .marca { line-height: 1.05; }
.sidebar-brand .marca small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .12em; color: rgba(255,255,255,.75); }
.sidebar-brand .marca strong { font-size: 1.25rem; font-weight: 800; color: #fff; }
.sidebar-brand .marca strong span { color: var(--azul-2); }

.nav-titulo { font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); padding: 10px 12px 6px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--raio-sm);
  color: rgba(255,255,255,.72); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: background .2s, color .2s, transform .2s; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(2px); }
.nav-item.active { background: var(--gradiente); color: #fff; font-weight: 600; box-shadow: var(--sombra-azul); }

.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; position: relative; z-index: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--raio-sm); background: rgba(255,255,255,.05); margin-bottom: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gradiente); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; flex-shrink: 0; }
.user-chip .info { min-width: 0; }
.user-chip .info strong { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .info span { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--azul-2); font-weight: 700; }
.btn-sair { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: var(--raio-sm); color: #FCA5A5; text-decoration: none; font-size: .85rem; font-weight: 600; border: 1px solid rgba(239,68,68,.3); transition: background .2s; }
.btn-sair:hover { background: rgba(239,68,68,.15); color: #fff; }

.main-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; padding: 0 32px 40px; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; margin-bottom: 8px; background: linear-gradient(var(--bg) 70%, transparent); }
.topbar h1 { font-size: 1.45rem; margin: 0; }
.topbar .crumb { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.topbar-acoes { display: flex; align-items: center; gap: 10px; }
.pill-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.pill-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.btn-menu { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio-sm); padding: 9px; cursor: pointer; color: var(--text-main); }
.sidebar-overlay { display: none; }

.aba-conteudo { animation: entrar .35s ease; }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===================== CARDS ===================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio); padding: 26px; box-shadow: var(--sombra-sm); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.card-titulo { display: flex; align-items: center; gap: 14px; }
.card-icone { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(11,107,255,.1); color: var(--azul); flex-shrink: 0; }
.card-icone .ico { width: 22px; height: 22px; }
.card-icone.verde { background: rgba(34,197,94,.12); color: #16A34A; }
.card-icone.escuro { background: rgba(15,45,74,.08); color: var(--azul-escuro); }

.hero-banner { position: relative; overflow: hidden; border-radius: var(--raio); padding: 28px 30px; margin-bottom: 24px; color: #fff; background: var(--gradiente-escuro); }
.hero-banner::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 60%; height: 220%; background: var(--gradiente); transform: skewX(-18deg); opacity: .9; }
.hero-banner > * { position: relative; }
.hero-banner h2 { color: #fff; font-size: 1.4rem; }
.hero-banner p { margin: 0; color: rgba(255,255,255,.78); font-size: .92rem; }
.hero-banner p strong { color: var(--azul-2); }
.hero-fluxo { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hero-fluxo .chip { background: #fff; color: var(--azul-escuro); font-weight: 700; font-size: .85rem; padding: 8px 16px; border-radius: 10px; }
.hero-fluxo .chip.bling { color: #16A34A; }
.hero-fluxo .sync { width: 36px; height: 36px; border-radius: 50%; background: var(--gradiente); display: grid; place-items: center; box-shadow: 0 0 0 6px rgba(0,163,255,.2); }
.hero-fluxo .sync .ico { color: #fff; animation: girar 4s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio); padding: 18px; display: flex; gap: 14px; align-items: center; }
.kpi strong { display: block; font-size: .95rem; }
.kpi span { font-size: .78rem; color: var(--text-muted); }

/* ===================== FORMULÁRIOS ===================== */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > .form-group { flex: 1; min-width: 180px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; position: relative; }
.form-group label { font-size: .78rem; font-weight: 600; color: var(--text-main); letter-spacing: .01em; }
.form-group label .req { color: var(--vermelho); margin-left: 2px; }
.form-control {
  width: 100%; font-family: inherit; font-size: .9rem; color: var(--text-main);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--raio-sm);
  padding: 11px 14px; transition: border-color .2s, box-shadow .2s, background .2s; outline: none;
}
.form-control::placeholder { color: #A0AEC0; }
.form-control:hover { border-color: #C9D5E6; }
.form-control:focus { border-color: var(--azul); box-shadow: 0 0 0 4px rgba(11,107,255,.12); }
.form-control:disabled, .form-control[readonly] { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }
.form-control.is-invalid { border-color: var(--vermelho); box-shadow: 0 0 0 4px rgba(239,68,68,.1); }
.form-control.is-valid { border-color: var(--verde); }
select.form-control { appearance: none; padding-right: 38px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.5; }
.input-icone { position: relative; }
.input-icone .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 17px; height: 17px; pointer-events: none; }
.input-icone .form-control { padding-left: 40px; }
.toggle-senha { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 6px; display: grid; }
.toggle-senha:hover { color: var(--azul); background: rgba(11,107,255,.08); }
.toggle-senha .ico { position: static; transform: none; pointer-events: none; }
.campo-erro, .error-msg, .error-message { font-size: .75rem; color: var(--vermelho); font-weight: 500; display: none; }
.form-group.tem-erro .campo-erro, .error-message:not(:empty) { display: block; }
.form-ajuda { font-size: .74rem; color: var(--text-muted); }
.divisor { margin: 22px 0; border: 0; border-top: 1px dashed var(--border); }
.form-acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 22px; }

.forca-senha { display: flex; gap: 4px; margin-top: 4px; }
.forca-senha i { flex: 1; height: 4px; border-radius: 4px; background: var(--border); transition: background .25s; }
.forca-senha[data-nivel="1"] i:nth-child(-n+1) { background: var(--vermelho); }
.forca-senha[data-nivel="2"] i:nth-child(-n+2) { background: var(--amarelo); }
.forca-senha[data-nivel="3"] i:nth-child(-n+3) { background: var(--azul-2); }
.forca-senha[data-nivel="4"] i { background: var(--verde); }

.info-box { margin-top: 18px; padding: 14px 16px; border-radius: var(--raio-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: .84rem; display: grid; gap: 6px; }
.info-box strong { color: var(--text-main); }
.info-box span { color: var(--text-muted); }

/* ===================== BOTÕES ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: .87rem; font-weight: 600; padding: 10px 18px; border-radius: var(--raio-sm);
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
  background: var(--surface-2); color: var(--text-main); border-color: var(--border); white-space: nowrap;
}
.btn:hover { background: #EDF2F9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--gradiente); color: #fff; border-color: transparent; box-shadow: var(--sombra-azul); }
.btn-primary:hover { background: var(--gradiente); filter: brightness(1.06); transform: translateY(-1px); }
.btn-success { background: var(--verde); color: #fff; border-color: transparent; box-shadow: 0 10px 22px -12px rgba(34,197,94,.7); }
.btn-success:hover { background: #16A34A; }
.btn-danger { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.btn-danger:hover { background: #FEE2E2; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-sm { padding: 6px 12px; font-size: .78rem; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: .95rem; }
.btn-retry { background: rgba(11,107,255,.08); color: var(--azul); border-color: rgba(11,107,255,.2); }
.btn-retry:hover { background: var(--azul); color: #fff; }
.btn.carregando { pointer-events: none; opacity: .75; }
.btn.carregando::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: girar .7s linear infinite; }

/* ===================== PROGRESSO ===================== */
#containerProgresso { padding: 18px; border-radius: var(--raio-sm); background: var(--surface-2); border: 1px solid var(--border); }
.progresso-trilho { width: 100%; height: 12px; background: #E3E9F2; border-radius: 99px; overflow: hidden; }
#barraProgresso { height: 100%; border-radius: 99px; background: var(--gradiente); transition: width .4s ease; position: relative; background-size: 200% 100%; }

/* ===================== TABS DE MESES ===================== */
.meses-tabs-container { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio); margin-bottom: 16px; }
.mes-tab-btn { font-family: inherit; font-size: .82rem; font-weight: 600; padding: 8px 16px; border-radius: 9px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; transition: all .2s; }
.mes-tab-btn:hover { background: var(--surface-2); color: var(--text-main); }
.mes-tab-btn.active { background: var(--gradiente); color: #fff; box-shadow: var(--sombra-azul); }

/* ===================== TABELAS ===================== */
.tabela-container-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--raio); background: var(--surface); }
.tabela-custom { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tabela-custom thead th { background: var(--surface-2); text-align: left; padding: 13px 16px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; }
.tabela-custom thead th:hover { color: var(--azul); }
.tabela-custom thead th .sort-indicator { opacity: .5; font-size: .75rem; }
.tabela-custom tbody td { padding: 13px 16px; border-bottom: 1px solid #EEF2F7; vertical-align: middle; }
.tabela-custom tbody tr:last-child td { border-bottom: 0; }
.tabela-custom tbody tr { transition: background .15s; }
.tabela-custom tbody tr:hover { background: #F6F9FE; }
.tabela-custom td .acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.paginacao { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; flex-wrap: wrap; }
.paginacao span { font-size: .82rem; color: var(--text-muted); font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: .7rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-sucesso { background: #DCFCE7; color: #15803D; }
.badge-erro { background: #FEE2E2; color: #B91C1C; }
.badge-ignorado { background: #EEF2F7; color: #475569; }
.badge-admin { background: rgba(11,107,255,.12); color: var(--azul); }
.badge-operador { background: rgba(0,163,255,.12); color: #0284C7; }
.badge-visualizador { background: #EEF2F7; color: #475569; }

.estado-vazio { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.estado-vazio img { width: 150px; opacity: .95; margin-bottom: 8px; }

/* ===================== MODAIS ===================== */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(10,31,53,.55); backdrop-filter: blur(4px); align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease; }
.modal-overlay .card { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; box-shadow: 0 30px 60px -20px rgba(10,31,53,.5); animation: subir .25s ease; padding: 0; }
.modal-cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-cabecalho h3 { margin: 0; }
.modal-corpo { padding: 22px 24px; }
.modal-rodape { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--raio) var(--raio); }
.btn-fechar { background: none; border: 0; cursor: pointer; color: var(--text-muted); padding: 6px; border-radius: 8px; display: grid; }
.btn-fechar:hover { background: var(--surface-2); color: var(--text-main); }
@keyframes fade { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* ===================== ALERTAS (TOAST + DIÁLOGO) ===================== */
.toast-pilha { position: fixed; top: 20px; right: 20px; z-index: 10050; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--azul); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(10,31,53,.35); animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2); position: relative; overflow: hidden; }
.toast.saindo { animation: toastOut .25s ease forwards; }
.toast .toast-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: rgba(11,107,255,.12); color: var(--azul); }
.toast .toast-ico .ico { width: 16px; height: 16px; }
.toast strong { display: block; font-size: .86rem; margin-bottom: 2px; }
.toast p { margin: 0; font-size: .8rem; color: var(--text-muted); line-height: 1.45; white-space: pre-line; }
.toast .toast-x { margin-left: auto; background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.toast .toast-barra { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .25; animation: barra linear forwards; }
.toast.sucesso { border-left-color: var(--verde); color: var(--verde); } .toast.sucesso .toast-ico { background: #DCFCE7; color: #16A34A; }
.toast.erro { border-left-color: var(--vermelho); color: var(--vermelho); } .toast.erro .toast-ico { background: #FEE2E2; color: #DC2626; }
.toast.aviso { border-left-color: var(--amarelo); color: var(--amarelo); } .toast.aviso .toast-ico { background: #FEF3C7; color: #D97706; }
.toast.info { color: var(--azul); }
.toast strong, .toast p { color: var(--text-main); } .toast p { color: var(--text-muted); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); height: 0; padding: 0; margin: 0; } }
@keyframes barra { from { width: 100%; } to { width: 0; } }

.dialogo { display: flex; position: fixed; inset: 0; z-index: 10040; background: rgba(10,31,53,.55); backdrop-filter: blur(4px); align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease; }
.dialogo-caixa { background: var(--surface); border-radius: 18px; width: 100%; max-width: 420px; padding: 30px 28px 24px; text-align: center; box-shadow: 0 30px 60px -20px rgba(10,31,53,.5); animation: subir .25s ease; }
.dialogo-ico { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: rgba(11,107,255,.1); color: var(--azul); box-shadow: 0 0 0 8px rgba(11,107,255,.06); }
.dialogo-ico .ico { width: 30px; height: 30px; }
.dialogo.sucesso .dialogo-ico { background: #DCFCE7; color: #16A34A; box-shadow: 0 0 0 8px rgba(34,197,94,.08); }
.dialogo.erro .dialogo-ico { background: #FEE2E2; color: #DC2626; box-shadow: 0 0 0 8px rgba(239,68,68,.08); }
.dialogo.aviso .dialogo-ico { background: #FEF3C7; color: #D97706; box-shadow: 0 0 0 8px rgba(245,158,11,.08); }
.dialogo-caixa h3 { font-size: 1.15rem; }
.dialogo-caixa p { color: var(--text-muted); font-size: .9rem; line-height: 1.55; margin: 0 0 22px; white-space: pre-line; }
.dialogo-botoes { display: flex; gap: 10px; justify-content: center; }
.dialogo-botoes .btn { flex: 1; }

/* ===================== LOGIN ===================== */
body.auth-body { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-visual { position: relative; overflow: hidden; background: var(--azul-noite) url('../img/login-bg.jpg') center/cover no-repeat; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-visual::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,31,53,.55) 0%, rgba(10,31,53,.15) 45%, rgba(10,31,53,.9) 100%); }
.auth-visual > * { position: relative; }
.auth-visual .logo-linha { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.15rem; }
.auth-visual .logo-linha img { width: 44px; }
.auth-visual .logo-linha span { color: var(--azul-2); }
.auth-visual h2 { color: #fff; font-size: 2rem; line-height: 1.2; max-width: 440px; }
.auth-visual h2 span { color: var(--azul-2); }
.auth-beneficios { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; max-width: 460px; }
.auth-beneficios div { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); padding: 10px 12px; border-radius: 10px; backdrop-filter: blur(6px); }
.auth-beneficios .ico { color: var(--azul-2); }
.auth-form-lado { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: radial-gradient(circle at 100% 0%, rgba(0,163,255,.08), transparent 40%), var(--surface); }
.login-card { width: 100%; max-width: 400px; }
.login-card .logo-topo { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-card .logo-topo img { width: 52px; }
.brand-title { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--azul-escuro); }
.brand-title span { background: var(--gradiente); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-subtitle { margin: 4px 0 0; font-size: .82rem; color: var(--text-muted); }
.login-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.login-card .form-group { margin-bottom: 18px; }
.btn-submit { width: 100%; margin-top: 6px; padding: 13px; font-family: inherit; font-size: .95rem; font-weight: 700; color: #fff; border: 0; border-radius: var(--raio-sm); background: var(--gradiente); box-shadow: var(--sombra-azul); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: filter .2s, transform .15s; }
.btn-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.alert-error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 20px; border-radius: var(--raio-sm); background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; font-size: .84rem; font-weight: 500; animation: subir .3s ease; }
.footer-note { margin-top: 32px; font-size: .74rem; color: var(--text-muted); text-align: center; }

/* ===================== IMPRESSÃO ===================== */
.print-cabecalho, .print-rodape { display: none; }

/* ===================== RESPONSIVO ===================== */
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.menu-aberto .sidebar { transform: none; }
  body.menu-aberto .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(10,31,53,.5); z-index: 40; }
  .main-content { margin-left: 0; padding: 0 16px 32px; }
  .btn-menu { display: grid; }
  .pill-status { display: none; }
  body.auth-body { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } .card { padding: 18px; } }

@media print {
  @page { size: A4 landscape; margin: 12mm 10mm 14mm; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { background: #fff !important; font-size: 10pt; }
  .sidebar, .topbar, .sidebar-overlay, .toast-pilha, .nao-imprimir, .modal-overlay, .dialogo, .paginacao button, .btn, .meses-tabs-container { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .aba-conteudo:not(.imprimindo) { display: none !important; }
  .aba-conteudo { animation: none !important; }
  .card { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
  .print-cabecalho { display: flex !important; align-items: center; justify-content: space-between; padding: 0 0 10px; margin-bottom: 14px; border-bottom: 3px solid var(--azul); }
  .print-cabecalho .esq { display: flex; align-items: center; gap: 10px; }
  .print-cabecalho img { width: 38px; }
  .print-cabecalho .marca { font-weight: 800; font-size: 14pt; color: var(--azul-escuro); line-height: 1; }
  .print-cabecalho .marca span { color: var(--azul); }
  .print-cabecalho .marca small { display: block; font-size: 7.5pt; font-weight: 500; color: var(--text-muted); margin-top: 3px; }
  .print-cabecalho .dir { text-align: right; font-size: 8pt; color: var(--text-muted); }
  .print-cabecalho .dir strong { display: block; font-size: 11pt; color: var(--azul-escuro); }
  .print-rodape { display: flex !important; justify-content: space-between; margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 7.5pt; color: var(--text-muted); }
  .tabela-container-scroll { overflow: visible !important; border: 1px solid var(--border) !important; border-radius: 6px; }
  .tabela-custom { font-size: 8pt; }
  .tabela-custom thead { display: table-header-group; }
  .tabela-custom thead th { background: var(--azul-escuro) !important; color: #fff !important; padding: 7px 8px; font-size: 7pt; }
  .tabela-custom thead th .sort-indicator { display: none; }
  .tabela-custom tbody td { padding: 6px 8px; }
  .tabela-custom tbody tr:nth-child(even) td { background: #F5F8FC !important; }
  .tabela-custom tr { break-inside: avoid; page-break-inside: avoid; }
  #tabelaHistorico th:last-child, #tabelaHistorico td:last-child, #tabelaUsuarios th:last-child, #tabelaUsuarios td:last-child { display: none; }
  .estado-vazio img { display: none; }
  .badge { border: 1px solid currentColor; }
  canvas { max-width: 100% !important; }
}

/* Níveis de acesso: visualizador apenas consulta */
body[data-nivel="visualizador"] .btn-retry { display: none !important; }

/* Login: recuperação de senha e mensagens de sucesso */
.alert-ok { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 20px; border-radius: var(--raio-sm); background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; font-size: .84rem; font-weight: 500; animation: subir .3s ease; }
.auth-links { margin-top: 18px; text-align: center; font-size: .84rem; }
.auth-links a { color: var(--azul); font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.badge-pendente { background: #FEF3C7; color: #B45309; }

/* Histórico: paginação por ano nas abas de mês */
.meses-tabs-container { align-items: center; }
.ano-pager { display: inline-flex; align-items: center; gap: 4px; padding-right: 10px; margin-right: 4px; border-right: 1px solid var(--border); }
.ano-pager-ano { min-width: 48px; text-align: center; font-size: .9rem; font-weight: 700; color: var(--text-main); }
.ano-pager-btn { font-family: inherit; font-size: 1.1rem; line-height: 1; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.ano-pager-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text-main); }
.ano-pager-btn:disabled { opacity: .3; cursor: default; }
.mes-tabs-vazio { padding: 8px 12px; font-size: .84rem; color: var(--text-muted); }
