/* ── TOPBAR ── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: fixed;
  top: 0;
  left: var(--sidebar-w, 260px);
  right: 0;
  min-height: 65px;
  z-index: 140;
}

.main { padding-top: 65px; }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar-title-wrap { min-width: 0; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: opacity .15s;
}

.topbar-title {
  font-family: var(--serif, 'Sora', system-ui, sans-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-soft);
  flex-wrap: nowrap;
  overflow: hidden;
}

.breadcrumb span,
.breadcrumb .bc-sep { color: var(--ink-ghost); }

.bc-sep { font-size: 11px; }

.bc-link {
  color: var(--brand, #1C6EF2);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.bc-link:hover { text-decoration: underline; }

.bc-current {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── RIGHT SIDE ── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── XP CHIP ── */
.xp-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--amber-lt, #FFF6DE);
  border: 1px solid #f5d87a;
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #8a5e00;
  white-space: nowrap;
}

.xp-chip .star { font-size: 13px; }

/* ── AVATAR ── */
.tb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand, #1C6EF2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
  letter-spacing: .02em;
}

/* ── ICON BUTTONS ── */
.tb-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .14s, background .14s;
}

.tb-btn svg {
  width: 17px;
  height: 17px;
  stroke: var(--ink-soft);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tb-btn:hover {
  border-color: var(--brand);
  background: var(--brand-lt, #EBF2FF);
}

.tb-btn:hover svg { stroke: var(--brand); }

.tb-logout { border-color: var(--red-lt, #FEECEC); }
.tb-logout svg { stroke: var(--red, #E0423F); }
.tb-logout:hover { background: var(--red-lt, #FEECEC); border-color: var(--red, #E0423F); }
.tb-logout:hover svg { stroke: var(--red, #E0423F); }

/* ── OVERLAY ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 150;
}

.overlay.show { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 820px) {
  .topbar { left: 0; min-height: 58px; padding: 10px 16px; }
  .main { padding-top: 58px; }
  .hamburger { display: flex; }
}

@media (max-width: 600px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar-title { font-size: 15px; }
  .breadcrumb { font-size: 11px; }
  .xp-chip { font-size: 11px; padding: 3px 9px; }
  .tb-btn { width: 32px; height: 32px; }
  .tb-btn svg { width: 15px; height: 15px; }
  .tb-avatar { width: 28px; height: 28px; font-size: 11px; }
}

@media (max-width: 380px) {
  .breadcrumb { display: none; }
  .xp-chip { padding: 3px 8px; font-size: 10px; }
}
