/* Top bar + navigation (responsive). */
.topbar {
  background: var(--c-primary);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1000px; margin: 0 auto; padding: 0 var(--gap);
  display: flex; align-items: center; gap: 1rem; min-height: 56px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  color: #fff; font-weight: 700; letter-spacing: .01em; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: .3rem; margin-left: auto; flex-wrap: wrap; }
.nav > a, .nav-group > summary {
  color: #cfe0f0; padding: .5em .7em; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 500; cursor: pointer; list-style: none;
}
.nav > a:hover, .nav-group > summary:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav > a.active { background: rgba(255,255,255,.16); color: #fff; }
.nav-logout { color: #f0c9c2 !important; }

.nav-group { position: relative; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: " ▾"; font-size: .7em; }
.nav-drop {
  position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); min-width: 200px; padding: 6px; display: flex; flex-direction: column; z-index: 60;
}
.nav-drop a { color: var(--c-text); padding: .5em .7em; border-radius: 6px; font-size: .95rem; }
.nav-drop a:hover { background: var(--c-surface-2); text-decoration: none; }
.nav-drop a.active { background: var(--c-info-bg); }

@media (max-width: 640px) {
  .topbar-inner { min-height: 52px; }
  .nav { width: 100%; margin-left: 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .nav > a, .nav-group > summary { white-space: nowrap; }
  .nav-drop { position: static; }
}

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.stat { text-align: center; padding: 1rem; }
.stat span { display: block; color: var(--c-muted); font-size: .85rem; }
.stat strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .cards-3 { grid-template-columns: 1fr; } }

.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-card { max-width: 380px; width: 100%; }
.login-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.login-brand h1 { margin: 0; }
