/* ── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 52px;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  position: sticky;
  top: 0;
  z-index: 200;
}
.topbar-brand {
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: #58a6ff;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-divider {
  width: 1px;
  height: 20px;
  background: #21262d;
  margin: 0 6px;
  flex-shrink: 0;
}
.topbar-spacer { flex: 1; }

/* ── Abas funcionais ────────────────────────────────────────────────────────── */
.topbar-tabs {
  display: flex;
  gap: 2px;
}
.topbar-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 13px;
  color: #8b949e;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.topbar-tab:hover {
  background: #21262d;
  color: #c9d1d9;
}
.topbar-tab.active {
  background: #21262d;
  border-color: #30363d;
  color: #e6edf3;
  font-weight: 500;
}
.tab-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.tab-icon--blue  { background: #1c3258; color: #58a6ff; }
.tab-icon--green { background: #0d2a1e; color: #3fb950; }
.tab-icon--gold  { background: #2a2013; color: #d4a94a; }

/* ── Dropdown de perfil ─────────────────────────────────────────────────────── */
.profile-menu { position: relative; }
.profile-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #30363d;
  background: #161b22;
  cursor: pointer;
  font-size: 12px;
  color: #c9d1d9;
  white-space: nowrap;
}
.profile-btn:hover { background: #21262d; }
.profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1c3258;
  color: #58a6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  width: 215px;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  padding: 4px 0;
}
.profile-dropdown.open { display: block; }
.dropdown-section-label {
  font-size: 10px;
  font-weight: 600;
  color: #484f58;
  padding: 6px 12px 2px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.dropdown-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  font-size: 13px;
  color: #c9d1d9;
  text-decoration: none;
}
.dropdown-link:hover { background: #21262d; color: #e6edf3; }
.dropdown-link--danger { color: #f85149; }
.dropdown-link--danger:hover { background: #2d1117; }
.dropdown-sep { height: 1px; background: #21262d; margin: 3px 0; }

/* ── Tab panels (home) ──────────────────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #21262d;
  margin-bottom: 16px;
}
.sub-tab {
  padding: 8px 14px;
  font-size: 13px;
  color: #8b949e;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
}
.sub-tab:hover { color: #c9d1d9; }
.sub-tab.active { color: #e6edf3; font-weight: 500; border-bottom-color: #58a6ff; }
.sub-panel { display: none; }
.sub-panel.active { display: block; }

/* ── Stats grid ─────────────────────────────────────────────────────────────── */
.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.home-stat { background: #0d1117; border: 1px solid #21262d; border-radius: 8px; padding: 12px 14px; }
.home-stat--success { border-left: 3px solid #3fb950; }
.home-stat--warning { border-left: 3px solid #d29922; }
.home-stat--danger  { border-left: 3px solid #f85149; }
.home-stat-label { font-size: 11px; color: #8b949e; display: block; margin-bottom: 4px; }
.home-stat-value { font-size: 26px; font-weight: 600; line-height: 1; display: block; }

/* ── Quick links ────────────────────────────────────────────────────────────── */
.quick-links { display: flex; flex-direction: column; gap: 2px; }
.quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #0d1117;
  border: 1px solid #21262d;
  color: #c9d1d9;
  text-decoration: none;
  font-size: 13px;
  transition: background .12s;
}
.quick-link:hover { background: #21262d; color: #e6edf3; }
.quick-link i.ql-icon { font-size: 16px; color: #58a6ff; flex-shrink: 0; }
.quick-link-text { flex: 1; }
.quick-link-text strong { display: block; }
.quick-link-text small { color: #8b949e; font-size: 11px; }
.quick-link-arrow { color: #484f58; }

/* ── Main content (sem sidebar) ─────────────────────────────────────────────── */
.main-content-full {
  margin-top: 52px;
  padding: 1.5rem;
  min-height: calc(100vh - 52px);
}

@media (max-width: 768px) {
  .topbar-tabs .topbar-tab span:not(.tab-icon) { display: none; }
  .profile-btn .profile-name { display: none; }
}

/* Selo de sessão master */
.master-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #b91c1c;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .2rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
  cursor: default;
}
.profile-avatar--master { box-shadow: 0 0 0 2px #b91c1c; }
