:root {
  --bf-primary: #1f7a5c;
  --bf-primary-dark: #145c44;
  --bf-bg: #f4f6f5;
  --bf-sidebar: #12312a;
  --bf-sidebar-active: #1f7a5c;
}

body { background: var(--bf-bg); font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.btn-primary { background-color: var(--bf-primary); border-color: var(--bf-primary); }
.btn-primary:hover { background-color: var(--bf-primary-dark); border-color: var(--bf-primary-dark); }
.btn-outline-primary { color: var(--bf-primary); border-color: var(--bf-primary); }
.btn-outline-primary:hover { background-color: var(--bf-primary); border-color: var(--bf-primary); }
a { color: var(--bf-primary); }

/* ---------- Logo ---------- */
.brand-logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bf-sidebar);
  border-radius: 10px;
  padding: 6px 10px;
  line-height: 0;
}
.brand-logo-chip img { height: 28px; width: auto; display: block; }
.brand-logo-chip-lg { padding: 10px 16px; border-radius: 14px; }
.brand-logo-chip-lg img { height: 44px; }

.brand-badge { height: 64px; width: auto; display: block; border-radius: 50%; margin: 0 auto; }

.public-logo { height: 40px; width: auto; display: block; }
.brand-badge-lg { height: 52px; margin: 0 auto; }
.brand-badge-portal-login { height: 85px; margin: 0 auto; }

/* ---------- Público ---------- */
.public-header { background: var(--bf-sidebar); border-bottom: 1px solid rgba(255,255,255,.08); }
.public-header .container { flex-wrap: wrap; row-gap: .75rem; }
.public-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.3rem; color: #fff; text-decoration: none; }
.public-brand span { display: block; font-size: 1.05rem; font-weight: 600; color: #fff; }
.public-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.public-nav a { margin-left: 0; text-decoration: none; color: #dfe9e4; font-size: 0.95rem; }
.public-nav a.btn-outline-primary { color: #fff; border-color: #fff; }
.public-nav a.btn-outline-primary:hover { background: #fff; color: var(--bf-sidebar); }
.public-nav a.btn-outline-secondary { color: #dfe9e4; border-color: #dfe9e4; }
.public-nav a.btn-outline-secondary:hover { background: #dfe9e4; color: var(--bf-sidebar); }
.public-footer { background: var(--bf-sidebar); color: #cfe3da; margin-top: 3rem; }
.public-main { min-height: 60vh; }

@media (max-width: 576px) {
  .public-header .container { justify-content: center; text-align: center; }
  .public-brand { font-size: 1.1rem; }
  .public-nav { justify-content: center; width: 100%; }
}

/* ---------- Login ---------- */
.login-body { min-height: 100vh; background: linear-gradient(135deg, var(--bf-sidebar) 0%, var(--bf-primary) 100%); }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bf-primary); color: #fff; font-weight: 700; }
.brand-mark-lg { width: 64px; height: 64px; font-size: 1.4rem; }

/* ---------- Admin shell ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--bf-sidebar);
  color: #dfe9e4;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: .5rem .75rem 1rem; margin-bottom: 1rem; }
.brand-text { font-weight: 700; line-height: 1.1; font-size: 1.05rem; letter-spacing: .5px; }
.sidebar-nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.sidebar-nav a { color: #cfe3da; text-decoration: none; padding: .6rem .75rem; border-radius: 8px; font-size: .95rem; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); }
.sidebar-nav a.active { background: var(--bf-sidebar-active); color: #fff; font-weight: 600; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1rem; margin-top: 1rem; }
.sidebar-user { display: flex; flex-direction: column; font-size: .85rem; }
.sidebar-user span { color: #a9c4ba; font-size: .75rem; }

.admin-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { background: #fff; border-bottom: 1px solid #e5e5e5; padding: 1rem 1.75rem; }
.admin-topbar h1 { font-size: 1.35rem; margin: 0; }
.admin-main { padding: 1.5rem 1.75rem; flex: 1; }

.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
}
.kpi-value { font-size: 1.9rem; font-weight: 700; color: var(--bf-primary-dark); }
.kpi-label { color: #777; font-size: .85rem; }

.card { border-radius: 12px; }
.table thead th { font-size: .78rem; text-transform: uppercase; color: #888; border-bottom-width: 1px; }

@media (max-width: 768px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .admin-topbar { padding: .85rem 1rem; }
  .admin-main { padding: 1rem; }
}

@media (max-width: 576px) {
  .admin-topbar h1 { font-size: 1.15rem; }
  .kpi-card { padding: .9rem 1rem; }
  .kpi-value { font-size: 1.5rem; }
}
