:root {
  --brand: #0f5c4d;
  --brand-dark: #0a3f34;
  --brand-light: #e8f5f1;
  --accent: #d99a2b;
  --bg: #f4f6f8;
  --sidebar-w: 250px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #1f2937;
}

.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--brand-dark), var(--brand));
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  padding-bottom: 2rem;
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; gap: .5rem;
}

.sidebar-section {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.55);
  padding: 1rem 1.25rem .35rem;
}

.sidebar-version {
  margin-top: 1.5rem;
  padding: .75rem 1.25rem 1rem;
  font-size: .72rem;
  color: rgba(255,255,255,.4);
  border-top: 1px solid rgba(255,255,255,.1);
  font-family: "Consolas", "Courier New", monospace;
}

.sidebar a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1.25rem;
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: .92rem;
  border-left: 3px solid transparent;
}

.sidebar a:hover { background: rgba(255,255,255,.08); }
.sidebar a.active {
  background: rgba(255,255,255,.14);
  border-left-color: var(--accent);
  font-weight: 600;
}

.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: #fff;
  padding: .85rem 1.75rem;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0; z-index: 10;
}

.topbar-title { font-size: 1.15rem; font-weight: 700; color: var(--brand-dark); }
.topbar-user { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.badge-role {
  background: var(--brand-light); color: var(--brand-dark);
  padding: .2rem .6rem; border-radius: 999px; font-size: .72rem;
  text-transform: uppercase; font-weight: 700;
}

.content-area { padding: 1.75rem; }

.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-radius: .6rem; }

.stat-card {
  background: #fff; border-radius: .7rem; padding: 1.1rem 1.3rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border-left: 4px solid var(--brand);
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--brand-dark); }
.stat-card .stat-label { font-size: .8rem; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.stat-card.warning { border-left-color: #d97706; }
.stat-card.danger { border-left-color: #dc2626; }
.stat-card.success { border-left-color: #16a34a; }

.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.text-brand { color: var(--brand); }

.report-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  transition: box-shadow .15s, transform .15s;
}
.report-card:hover {
  box-shadow: 0 4px 16px rgba(15, 92, 77, .12);
  transform: translateY(-2px);
  border-color: var(--brand);
}
.report-card h5 { color: var(--brand-dark); }

.kpi-card {
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: 3px solid var(--brand);
}
.kpi-card .kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--brand-dark); }
.kpi-card .kpi-label { font-size: .78rem; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card .kpi-sub { font-size: .78rem; color: #9ca3af; }

table.table thead { background: var(--brand-light); }
table.table thead th { color: var(--brand-dark); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: none; }

.status-badge { padding: .28rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.status-pendente { background:#fef3c7; color:#92400e; }
.status-remetido { background:#dbeafe; color:#1e40af; }
.status-registrado { background:#e0e7ff; color:#3730a3; }
.status-pago, .status-baixado_manual { background:#dcfce7; color:#166534; }
.status-vencido { background:#fee2e2; color:#991b1b; }
.status-cancelado { background:#f3f4f6; color:#6b7280; }
.status-ativo { background:#dcfce7; color:#166534; }
.status-inativo, .status-removido { background:#f3f4f6; color:#6b7280; }
.status-suspenso, .status-manutencao { background:#fef3c7; color:#92400e; }
.status-inadimplente, .status-cancelado_c { background:#fee2e2; color:#991b1b; }

.login-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}
.login-card {
  background: #fff; border-radius: .9rem; padding: 2.5rem; width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

.mono { font-family: "Consolas", "Courier New", monospace; font-size: .78rem; }
