:root {
  --usp-primary: #1d4ed8;
  --usp-primary-dark: #1e3a8a;
  --usp-surface: #ffffff;
  --usp-bg: #f4f7fb;
  --usp-border: #dbe3ef;
  --usp-text: #0f172a;
  --usp-muted: #64748b;
  --usp-sidebar: #0b1220;
  --usp-sidebar-text: #cbd5e1;
}

html, body { height: 100%; }
body.portal-body {
  margin: 0;
  background: var(--usp-bg);
  color: var(--usp-text);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.portal-shell { display: flex; min-height: 100vh; }
.portal-sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--usp-sidebar), #111827);
  color: var(--usp-sidebar-text);
  padding: 1.25rem 1rem;
  flex-shrink: 0;
}
.portal-brand { display: flex; gap: .75rem; align-items: center; margin-bottom: 1.5rem; }
.portal-brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--usp-primary); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.portal-brand-title { color: #fff; font-weight: 700; }
.portal-brand-subtitle { font-size: .8rem; color: #94a3b8; }
.portal-nav-group {
  margin: 1rem 0 .35rem;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #64748b;
}
.portal-nav-link {
  display: block; color: var(--usp-sidebar-text); text-decoration: none;
  padding: .55rem .75rem; border-radius: .65rem; margin-bottom: .2rem;
}
.portal-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.portal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.portal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; background: var(--usp-surface); border-bottom: 1px solid var(--usp-border);
}
.portal-page-title { font-size: 1.25rem; font-weight: 700; }
.portal-page-subtitle { color: var(--usp-muted); font-size: .9rem; }
.portal-header-actions { display: flex; gap: .75rem; align-items: center; }
.portal-user { color: var(--usp-muted); font-size: .9rem; }
.portal-content { padding: 1.25rem 1.5rem 2rem; overflow: auto; }
.portal-toast { border-radius: .75rem; }

.kpi-card, .section-card {
  background: var(--usp-surface); border: 1px solid var(--usp-border);
  border-radius: 1rem; box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.kpi-card { padding: 1rem 1.1rem; height: 100%; }
.kpi-label { color: var(--usp-muted); font-size: .85rem; }
.kpi-value { font-size: 1.8rem; font-weight: 700; margin-top: .2rem; }
.badge-status { border-radius: 999px; padding: .25rem .6rem; font-size: .75rem; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-suspended { background: #fef3c7; color: #92400e; }
.badge-expired, .badge-revoked { background: #fee2e2; color: #991b1b; }
.table-portal { background: var(--usp-surface); border-radius: 1rem; overflow: hidden; }
.table-portal th { color: var(--usp-muted); font-weight: 600; font-size: .82rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--usp-muted); }

@media (max-width: 992px) {
  .portal-shell { flex-direction: column; }
  .portal-sidebar { width: 100%; }
  .portal-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
  .portal-nav-group { width: 100%; margin-top: .75rem; }
}
