:root {
  --azul: #1e3a5f;
  --azul-2: #274b78;
  --fundo: #f3f5f9;
  --sidebar-w: 248px;
  --bs-primary: #1f5fae;
  --bs-primary-rgb: 31, 95, 174;
  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { background: var(--fundo); color: #1f2937; font-size: .925rem; }
.btn-primary { --bs-btn-bg: #1f5fae; --bs-btn-border-color: #1f5fae; --bs-btn-hover-bg: #1a4f92; --bs-btn-hover-border-color: #1a4f92; }

/* Sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--azul); padding: 1rem .75rem; overflow-y: auto; z-index: 1040; transition: transform .2s; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; padding: .25rem .5rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: .5rem; }
.brand-icon { width: 36px; height: 36px; border-radius: 10px; background: #f59e0b; display: grid; place-items: center; font-size: 1.2rem; color: #1e3a5f; flex-shrink: 0; }
.brand-name { font-weight: 700; line-height: 1.15; }
.nav-section { color: rgba(255,255,255,.45); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: .9rem .75rem .35rem; }
.nav-item { display: flex; align-items: center; gap: .65rem; color: rgba(255,255,255,.82); text-decoration: none; padding: .55rem .75rem; border-radius: 8px; margin-bottom: 2px; }
.nav-item i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #f59e0b; }
.user-box { border-top: 1px solid rgba(255,255,255,.1); padding: 1rem .5rem 0; margin-top: 1rem; }
.sidebar-backdrop { display: none; }

/* Conteúdo */
.content { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.75rem; background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1020; flex-wrap: wrap; }
.page-title { font-size: 1.35rem; font-weight: 700; margin: 0; color: #0f172a; }
.page { padding: 1.5rem 1.75rem 3rem; }

.card { border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f4; font-weight: 600; padding: .85rem 1.1rem; border-radius: 12px 12px 0 0 !important; }

.kpi { padding: 1rem 1.1rem; height: 100%; }
.kpi .kpi-label { font-size: .78rem; color: #64748b; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi .kpi-value { font-size: 1.45rem; font-weight: 700; margin-top: .2rem; white-space: nowrap; }
.kpi .kpi-sub { font-size: .8rem; color: #64748b; }
.kpi-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem; }
.bg-soft-success { background: #dcfce7; color: #15803d; }
.bg-soft-danger { background: #fee2e2; color: #b91c1c; }
.bg-soft-warning { background: #fef3c7; color: #b45309; }
.bg-soft-primary { background: #dbeafe; color: #1d4ed8; }
.bg-soft-secondary { background: #e2e8f0; color: #334155; }
.bg-soft-info { background: #cffafe; color: #0e7490; }

.table { --bs-table-hover-bg: #f8fafc; margin-bottom: 0; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; background: #f8fafc; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
.table td { vertical-align: middle; }
.table tfoot td { font-weight: 700; background: #f1f5f9; }
.table tr.row-grupo td { background: #eef2f7; font-weight: 700; }
.table tr.row-negativo td { color: #b91c1c; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.money, th.money { text-align: right; }
.badge { font-weight: 600; }
.badge-status { padding: .35em .65em; border-radius: 6px; }
.text-receita { color: #15803d; }
.text-despesa { color: #b91c1c; }

.filtros { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1rem; }
.filtros input[type=date] { min-width: 0; }
.filtros .form-label { font-size: .75rem; color: #64748b; margin-bottom: .2rem; font-weight: 600; }
.status-tabs .nav-link { color: #475569; border-radius: 8px; padding: .35rem .8rem; font-size: .875rem; }
.status-tabs .nav-link.active { background: var(--azul); color: #fff; }

.form-label { font-weight: 600; font-size: .85rem; color: #334155; }
.form-text { font-size: .78rem; }
.errorlist { color: #b91c1c; font-size: .8rem; padding-left: 0; list-style: none; margin: .25rem 0 0; }

.rel-card { transition: transform .1s, box-shadow .1s; text-decoration: none; color: inherit; }
.rel-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.08); color: inherit; }

.empty { text-align: center; padding: 3rem 1rem; color: #64748b; }
.empty i { font-size: 2.5rem; color: #cbd5e1; display: block; margin-bottom: .5rem; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #1e3a5f 0%, #274b78 60%, #f59e0b 180%); padding: 1rem; }
.login-card { width: 100%; max-width: 400px; border-radius: 16px; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1030; }
  .content { margin-left: 0; }
  .topbar, .page { padding-left: 1rem; padding-right: 1rem; }
}
@media print {
  .sidebar, .topbar .btn, .filtros, .no-print { display: none !important; }
  .content { margin: 0; }
}
.admin-bar { background: #fef3c7; border-bottom: 1px solid #fcd34d; color: #78350f; padding: .5rem 1.75rem; font-size: .875rem; display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
