/* ============================================
   TOPBAR NAVIGATION
   ============================================ */

.topbar {
  background: var(--color-topbar);
  color: #f4f6fb;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar-inner {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 64px;
  padding: 0.75rem 0;
}

.topbar-primary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  transition: background 160ms ease;
}

.brand-mark:hover {
  background: rgba(255, 255, 255, 0.08);
}

.brand-logo {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  color: #f4f6fb;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: rgba(244, 246, 251, 0.6);
  line-height: 1.2;
}

.brand-badge {
  padding: 0.25rem 0.5rem;
  background: rgba(2, 129, 82, 0.16);
  color: #34d399;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar-panel {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #f4f6fb;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot-live {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.topbar-meta-slot {
  font-size: 13px;
  color: rgba(244, 246, 251, 0.7);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #f4f6fb;
}

.user-role {
  font-size: 11px;
  color: rgba(244, 246, 251, 0.6);
  line-height: 1.2;
}

.topbar-btn {
  font-size: 13px;
  padding: 0.5rem 1rem;
  white-space: nowrap;
}

.logout-form {
  margin: 0;
}

/* Responsive Design */
@media (max-width: 960px) {
  .topbar-inner {
    gap: var(--space-2);
  }

  .brand-copy {
    display: none;
  }

  .user-meta {
    display: none;
  }

  .user-chip {
    padding: 0.375rem;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 1rem;
  }

  .topbar-badges {
    gap: 0.5rem;
  }

  .tenant-chip {
    padding: 0.25rem 0.5rem;
    font-size: 12px;
  }

  .topbar-btn {
    padding: 0.5rem 0.75rem;
    font-size: 12px;
  }
}
