/* ===== TOPBAR v2 ===== */
.topbar {
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 8px;
}
.topbar .brand { display:flex;align-items:center; }
.topbar .brand a { display:flex;align-items:center; }
.topbar .brand img { height: 30px; }

.tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Buttons */
.tb-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.tb-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--border-strong); }

.tb-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 7px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.tb-icon-btn:hover { background: var(--panel-2); color: var(--text); }
.tb-icon-btn svg { width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }

/* Badge on bell */
.tb-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-sizing: border-box;
  border: 1.5px solid var(--panel);
}
.tb-badge.visible { display:flex; }

/* Vertical divider */
.tb-vdiv { width:1px; height:20px; background:var(--border); margin:0 4px; flex-shrink:0; }

/* Dropdown wrapper */
.tb-drop-wrap { position: relative; }

/* Dropdown panel */
.tb-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  min-width: 200px;
  z-index: 200;
  display: none;
  overflow: hidden;
  animation: tbDropIn 0.12s ease;
}
@keyframes tbDropIn { from { opacity:0;transform:translateY(-6px); } to { opacity:1;transform:translateY(0); } }
.tb-drop.open { display:block; }

.tb-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  /* <a> and <button> resolve line-height differently, which made the anchor items
     (Terms of use, Privacy policy) sit taller than the buttons above them. */
  line-height: 1.25;
  box-sizing: border-box;
  margin: 0;
}
.tb-drop-item:hover { background: var(--panel-2); color: var(--text); text-decoration:none; }
.tb-drop-item.danger { color: var(--accent); }
.tb-drop-item.danger:hover { background: rgba(170,56,216,0.08); color: var(--accent); }
.tb-drop-item.unread { font-weight: 600; color: var(--text); }
.tb-drop-item.notif { font-size:13px;padding:8px 14px;flex-direction:column;align-items:flex-start;gap:2px; }
.tb-drop-item.notif .notif-time { font-size:10px;color:var(--text-faint);font-weight:400; }
.tb-drop-item.notif.unread { font-weight:600; }

.tb-drop-divider { height:1px; background:var(--border); margin:4px 0; }
