:root {
  --bg: #000;
  --panel: #0a0a0a;
  --border: #262626;
  --border-soft: #1c1c1c;
  --text: #fff;
  --muted: #a3a3a3;
  --faint: #737373;
  --hover: #141414;
  --active: #1f1f1f;
  --accent: #f6821f;
  --ok: #3ecf8e;
  --topbar: 57px;
  --side: 260px;
}
:root.collapsed { --side: 57px; }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.icon { flex: none; }
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-bottom: 1px solid var(--border); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; width: var(--side); padding: 0 10px 0 18px; height: 100%; border-right: 1px solid var(--border); white-space: nowrap; transition: width 0.25s ease, padding 0.25s ease; }
.top-actions { display: flex; align-items: center; gap: 22px; padding-right: 24px; }
.top-link { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.sidebar {
  position: fixed; top: var(--topbar); bottom: 0; left: 0; width: var(--side);
  display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--bg);
  overflow: hidden; transition: width 0.25s ease;
}
.search {
  display: flex; align-items: center; gap: 10px; margin: 12px 15px;
  height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--muted); overflow: hidden; white-space: nowrap;
  transition: margin 0.25s ease;
}
.search span { flex: 1; color: #d4d4d4; font-size: 13.5px; }
kbd { font: inherit; font-size: 11px; color: var(--faint); }
nav { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 4px 15px 16px; transition: padding 0.25s ease; scrollbar-width: none; }
.nav-label { height: 18px; margin: 18px 11px 8px; overflow: hidden; white-space: nowrap; color: var(--muted); font-size: 13px; background: transparent; transition: height 0.25s ease, margin 0.25s ease, color 0.25s ease, background-color 0.25s ease; }
.nav-item {
  display: flex; align-items: center; gap: 14px; height: 34px; padding: 0 11px;
  border-radius: 8px; color: #e5e5e5; font-size: 13.5px; margin-bottom: 1px; white-space: nowrap; overflow: hidden;
}
.nav-item .icon { color: var(--faint); }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--active); color: var(--text); }
.nav-item.active .icon { color: var(--text); }
.sidebar-foot { height: 46px; display: flex; align-items: center; padding-left: 17px; border-top: 1px solid var(--border); transition: padding 0.25s ease; }
.sidebar-toggle { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.sidebar-toggle:hover { background: var(--hover); color: var(--text); }
.content { transition: margin-left 0.25s ease; margin: var(--topbar) 0 0 var(--side); min-height: calc(100vh - var(--topbar)); display: flex; justify-content: center; padding: 120px 32px 64px; }
.stage { width: 100%; max-width: 1110px; }
h1 { font-size: 28px; font-weight: 600; text-align: center; letter-spacing: -0.01em; }
.lead { color: var(--muted); text-align: center; max-width: 360px; margin: 10px auto 26px; font-size: 14px; }
.pill {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 514px; margin: 0 auto;
  height: 60px; padding: 0 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); font-size: 14px;
}
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ok); }
.dot.idle { border-color: var(--faint); }
.tag { margin-left: auto; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--bg); }
h2 { font-size: 16px; font-weight: 600; margin: 72px 0 12px; max-width: 1110px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card {
  display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); min-height: 84px;
}
.card:hover { border-color: #3a3a3a; background: var(--hover); }
.card-icon { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.card-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.card-text { color: var(--muted); font-size: 12.5px; }
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .sidebar { display: none; }
  .brand { border-right: 0; }
  .content { margin-left: 0; padding-top: 80px; }
  .cards { grid-template-columns: 1fr; }
}
button.nav-item { width: 100%; border: 0; background: none; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.nav-toggle span { flex: 1; }
.nav-toggle .icon:last-child { color: var(--faint); transition: transform 0.15s; }
.nav-group.open .nav-toggle .icon:last-child { transform: rotate(90deg); }
.sub-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
.nav-group.open .sub-wrap { grid-template-rows: 1fr; }
.sub-list { min-height: 0; overflow: hidden; margin-left: 20px; padding-left: 8px; border-left: 1px solid #222; }
@media (prefers-reduced-motion: reduce) { .sub-wrap, .nav-toggle .icon:last-child { transition: none; } }
.sub-item { display: flex; align-items: center; height: 34px; padding: 0 12px; margin-bottom: 1px; border-radius: 8px; color: #e5e5e5; font-size: 13.5px; }
.sub-item:hover { background: var(--hover); }
.sub-item.active { background: var(--active); color: var(--text); }
.collapsed .brand { padding: 0 0 0 12px; }
.collapsed .crumb { opacity: 0; pointer-events: none; }
.collapsed .nav-toggle .icon:last-child { opacity: 0; }
.collapsed .search { margin: 12px 8px; }
.collapsed nav { padding: 4px 8px 16px; }
.collapsed .nav-label { height: 1px; margin: 13px 7px 12px; color: transparent; background-color: var(--border); }
.collapsed .sub-wrap { grid-template-rows: 0fr; }
.collapsed .sidebar-foot { padding-left: 12px; }
.nav-toggle .icon:last-child { transition: opacity 0.2s ease, transform 0.15s; }
@media (prefers-reduced-motion: reduce) { .brand, .sidebar, .content, nav, .search, .nav-label, .sidebar-foot, .switcher-menu, .switcher-btn .icon:last-child { transition: none; } }

.logo-link { flex: none; display: block; width: 32px; height: 32px; }
.logo-link img { display: block; width: 32px; height: 32px; border-radius: 8px; background: #0d0d10; border: 1px solid #2c2c33; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03); }
.crumb { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; font-size: 13.5px; transition: opacity 0.2s ease; }
.crumb-user { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.crumb-sep { color: var(--faint); }
.switcher { position: relative; min-width: 0; }
.switcher-btn strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.switcher-btn .icon { flex: none; }
.switcher-btn { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px; min-width: 0; max-width: 100%; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.switcher-btn:hover, .switcher-btn[aria-expanded="true"] { background: var(--hover); }
.switcher-btn .icon:first-child { color: var(--muted); }
.switcher-btn .icon:last-child { color: var(--muted); }
.switcher-menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6); z-index: 10; }
.switcher-menu { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px) scale(0.98); transform-origin: top left; transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s; }
.switcher-menu.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s; }
.switcher-btn .icon:last-child { transition: transform 0.18s ease; }
.switcher-btn[aria-expanded="true"] .icon:last-child { transform: rotate(90deg); }
.switcher-title { padding: 8px 10px 6px; color: var(--muted); font-size: 12px; }
.switcher-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: #e5e5e5; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.switcher-item .icon { color: var(--faint); }
.switcher-item:hover { background: var(--hover); }
.switcher-item.current { background: var(--active); color: var(--text); font-weight: 600; }
.srv-icon { flex: none; display: block; border-radius: 6px; object-fit: cover; }
.srv-fallback { display: grid; place-items: center; background: var(--active); color: var(--muted); font-size: 11px; font-weight: 700; }
.switcher-item { text-decoration: none; }
.switcher-item .tag { margin-left: auto; }
.tag-small { padding: 2px 8px; font-size: 11px; }
.switcher-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.menu-divider { height: 1px; margin: 6px 4px; background: var(--border); }
.menu-right { left: auto; right: 0; transform-origin: top right; }
.menu-wrap { position: relative; }
.menu-wrap form { margin: 0; }
.avatar-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.avatar-btn:hover .avatar-img { border-color: #4a4a4a; }
.avatar-img { display: block; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; }
.profile-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.profile-head div { display: flex; flex-direction: column; min-width: 0; }
.profile-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-head span { color: var(--muted); font-size: 12px; }
.server-list { display: flex; flex-direction: column; gap: 8px; max-width: 514px; margin: 0 auto; }
.server-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.server-row:hover { border-color: #3a3a3a; background: var(--hover); }
.pill-btn { display: block; margin: 0 auto; height: 36px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.pill-btn:hover { background: var(--hover); }
.refresh-line { margin-top: 18px; text-align: center; }
.link-btn { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-btn:hover { color: var(--text); }
button:focus-visible, a:focus-visible { outline: 2px solid #7aa7ff; outline-offset: 2px; }
