:root {
  --sb-bg: #1f2a37;
  --sb-fg: #c9d3df;
  --sb-active: #2f6fed;
  --page-bg: #f4f6f9;
}
body { background: var(--page-bg); font-size: .94rem; }
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 250px; background-color: var(--sb-bg) !important; color: var(--sb-fg); flex-shrink: 0; }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.sidebar.offcanvas-lg { --bs-offcanvas-bg: var(--sb-bg); --bs-offcanvas-width: 260px; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand > div { min-width: 0; }
.sidebar-brand > i { font-size: 1.6rem; color: #7fb0ff; }
.sidebar .nav { padding: .5rem; }
.sidebar .nav-link { display: flex; align-items: center; gap: .65rem; color: var(--sb-fg); border-radius: .45rem; padding: .5rem .75rem; margin-bottom: 2px; }
.sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--sb-active); color: #fff; }
.sidebar .nav-link.disabled { color: rgba(201,211,223,.45); }
.sidebar .nav-link.disabled .badge { font-size: .62rem; opacity: .7; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(201,211,223,.5); padding: 1rem .75rem .35rem; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; background: #fff; padding: .75rem 1.25rem; border-bottom: 1px solid #e5e8ec; position: sticky; top: 0; z-index: 10; }
.content { padding: 1.25rem; }
@media (max-width: 575px) { .content { padding: .75rem; } }

/* Cards */
.card { border: 1px solid #e5e8ec; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.kpi { padding: 1rem 1.1rem; }
.kpi .kpi-label { font-size: .78rem; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }
.kpi .kpi-value { font-size: clamp(1.15rem, 1.5vw, 1.45rem); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi > .d-flex > div:first-child { min-width: 0; }
.kpi .kpi-icon { flex-shrink: 0; }
.kpi .kpi-icon { width: 42px; height: 42px; border-radius: .6rem; display: grid; place-items: center; font-size: 1.25rem; }

/* Casas */
.casa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .75rem; }
.casa-card { position: relative; text-decoration: none; color: inherit; border-left: 4px solid #cbd5e1; transition: transform .1s, box-shadow .1s; }
.casa-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16,24,40,.08); color: inherit; }
.casa-card.st-PAGA { border-left-color: #198754; }
.casa-card.st-PARCIAL { border-left-color: #ffc107; }
.casa-card.st-ABERTA { border-left-color: #6c757d; }
.casa-card.pendente { border-left-color: #dc3545; }
.casa-card.inativa { opacity: .55; }
.casa-num { font-size: 1.3rem; font-weight: 700; }

.table td, .table th { vertical-align: middle; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #1f2a37, #2f4a6d); padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; }

/* Dashboard */
.chart-box { position: relative; height: 280px; }
.seg-bar { display: flex; gap: 2px; height: 28px; }
.seg { border-radius: 4px; min-width: 4px; display: flex; align-items: center; padding-left: 8px;
       font-size: .78rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; overflow: hidden; white-space: nowrap; }
.seg-1 { background: #2a78d6; } .seg-2 { background: #eb6834; } .seg-3 { background: #1baf7a; color: #0b0b0b; }
.seg-4 { background: #eda100; color: #0b0b0b; } .seg-5 { background: #e87ba4; color: #0b0b0b; } .seg-6 { background: #008300; }
.seg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Prestação de contas */
.hbar { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 4px 10px; align-items: center; font-size: .85rem; }
.hbar .trilho { height: 12px; }
.hbar .barra { height: 12px; border-radius: 0 4px 4px 0; min-width: 2px; }
.pc-header { border-bottom: 2px solid #1f2a37; padding-bottom: .75rem; margin-bottom: 1rem; }
.pc-secao { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #1f2a37; margin: 1.5rem 0 .6rem; }
.pc-letra { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 6px; background: #1f2a37; color: #fff; font-size: .85rem; margin-right: .4rem; }

@media print {
  .sidebar, .topbar, .page-actions, .no-print, .alert-dismissible .btn-close, details > summary { display: none !important; }
  details { display: block; } details > * { display: block; }
  body, .content { background: #fff !important; padding: 0 !important; }
  .card { border: 1px solid #ddd !important; box-shadow: none !important; break-inside: avoid; }
  .main { display: block; }
  a { color: inherit; text-decoration: none; }
  .table { font-size: 10px; }
  .pc-secao { break-after: avoid; }
}
