/* Shared chrome — topbar, bottom nav, sidebar, common components */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
  z-index: 50;
  display: flex;
  align-items: center;
}
.topbar .container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--c-primary);
  letter-spacing: -0.01em;
}
.topbar .brand img { width: 28px; height: 28px; object-fit: contain; }
.topbar .spacer { flex: 1; }
.topbar .icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: var(--c-text-mute);
  background: var(--c-card-alt);
  border: 1px solid var(--c-border);
}
.topbar .icon-btn:hover { color: var(--c-primary); }
.topbar .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-soft));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}
.topbar .badge-dot {
  position: relative;
}
.topbar .badge-dot::after {
  content: "";
  position: absolute;
  top: 8px; right: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-danger);
  border: 2px solid var(--c-card);
}

/* Mobile bottom nav */
.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--c-card);
  border-top: 1px solid var(--c-border);
  display: flex;
  z-index: 50;
}
.bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--c-text-soft);
  padding-top: 8px;
}
.bottomnav a.active { color: var(--c-primary); }
.bottomnav a svg { width: 22px; height: 22px; }

/* Laptop sidebar */
.sidenav {
  display: none;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: 240px;
  height: calc(100vh - var(--topbar-h));
  background: var(--c-card);
  border-right: 1px solid var(--c-border);
  padding: 20px 14px;
  z-index: 40;
}
.sidenav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--c-text-mute);
  font-weight: 500;
  margin-bottom: 2px;
}
.sidenav a:hover { background: var(--c-card-alt); color: var(--c-text); }
.sidenav a.active { background: var(--c-accent-soft); color: var(--c-primary); }
.sidenav a svg { width: 20px; height: 20px; }

@media (min-width: 1024px) {
  .bottomnav { display: none; }
  .sidenav { display: block; }
}

/* Card primitives */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--sh-1);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title { font-size: 0.95rem; font-weight: 600; }
.card-link { font-size: 0.8rem; color: var(--c-info); font-weight: 500; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-soft); }
.btn-accent { background: var(--c-accent); color: #fff; }
.btn-ghost { background: var(--c-card-alt); color: var(--c-text); border-color: var(--c-border); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 0.82rem; border-radius: 10px; }

/* Pill / chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--c-card-alt);
  color: var(--c-text-mute);
  border: 1px solid var(--c-border);
}
.chip-accent { background: var(--c-accent-soft); color: var(--c-accent-deep, #1B5FCB); border-color: #B6CFFE; }
.chip-warn { background: var(--c-warn-soft); color: #92400E; border-color: #FDE68A; }
.chip-info { background: var(--c-info-soft); color: #1D4ED8; border-color: #BFDBFE; }

/* Section spacing */
.stack > * + * { margin-top: 14px; }
.section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-soft);
  margin: 22px 4px 10px;
  font-weight: 600;
}
