/* The app's frame: the sidebar with the server card, navigation and account,
   the top bar, the preview banner, the page heading and the footer. */

.dashboard-body {
  background: var(--bg-primary);
  min-height: 100vh;
}

.dashboard-sidebar {
  background: var(--bg-secondary);
  color: var(--text-primary);
  width: 232px;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 24px 14px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.dashboard-sidebar > .brand {
  padding-left: 4px;
}

.dashboard-sidebar .brand-logo {
  height: 42px;
}

.server-card {
  margin: 26px 0 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  background: var(--bg-warm);
}

.server-card > span:last-child {
  margin-left: auto;
  color: var(--text-warm);
  font-size: 11px;
}

.server-avatar {
  background: var(--bg-warm);
  color: var(--accent);
  width: 33px;
  height: 33px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--accent-border);
}

.server-card strong {
  font-size: 12px;
  display: block;
  font-weight: 600;
}

.server-card div > span {
  font-size: 10px;
  color: var(--text-secondary);
}

.sidebar-label {
  font-size: 10px;
  letter-spacing: 0.13em;
  padding-left: 12px;
  color: var(--text-muted);
}

.workspace-nav {
  margin-top: 10px;
}

.workspace-nav a {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px 12px;
  margin-block: 3px;
  font-size: 12px;
  color: var(--text-secondary);
  border-radius: 7px;
  border: 1px solid transparent;
  min-height: 42px;
}

.workspace-nav a > span:first-child {
  font-size: 18px;
  line-height: 1;
  width: 19px;
  text-align: center;
}

.workspace-nav a[aria-current] {
  background: var(--nav-selected);
  color: var(--accent);
  border-color: var(--border-warm);
}

.workspace-nav a:hover {
  background: var(--nav-hover);
  color: var(--text-primary);
}

.sidebar-count {
  margin-left: auto;
  font-size: 9px;
  background: var(--nav-selected);
  padding: 0 6px;
  border-radius: 4px;
}

.sidebar-count:empty {
  display: none;
}

.sidebar-new {
  margin-left: auto;
  font-size: 9px;
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 32px;
}

.preview-sidebar-note {
  padding: 14px 12px;
  background: var(--bg-warm);
  border-radius: 9px;
  border: 1px solid var(--border-warm);
}

.preview-sidebar-note .status-dot {
  background: var(--success);
  margin-right: 5px;
}

.preview-sidebar-note strong {
  font-size: 11px;
}

.preview-sidebar-note p {
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-top: 9px;
}

/* Links out of the app, under the nav: quieter rows of the same shape. */
.sidebar-links {
  display: grid;
  gap: 2px;
}

.preview-sidebar-note + .sidebar-links {
  margin-top: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
}

.sidebar-link .ui-icon {
  flex: none;
  color: var(--text-muted);
}

.sidebar-link:hover {
  background: var(--nav-hover);
  color: var(--text-primary);
}

.sidebar-link:hover .ui-icon {
  color: var(--accent);
}

.sidebar-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -1px;
}

.sidebar-link[aria-current] {
  background: var(--nav-selected);
  color: var(--accent);
}

.sidebar-link[aria-current] .ui-icon {
  color: var(--accent);
}

/* What's new's unread count: copper, so it reads as news rather than a tally. */
.sidebar-link .sidebar-count {
  color: var(--accent);
  font-weight: 600;
}

/* Who is signed in, and Sign out (sidebar-account.js): pinned to the sidebar's
   bottom, so it stays in view while a short window scrolls the rest under it. */
.sidebar-account-slot {
  position: sticky;
  bottom: -20px;
  z-index: 1;
  margin: 20px -14px -20px;
  padding: 0 14px 20px;
  background: var(--bg-secondary);
}

.sidebar-account-slot:empty {
  display: none;
}

.sidebar-account {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-account-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 4px;
}

.sidebar-account-avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.sidebar-account-name {
  display: grid;
  min-width: 0;
}

.sidebar-account-name strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-account-name small {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-sign-out {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-sign-out:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

button.sidebar-sign-out:hover:not(:disabled) {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

.sidebar-sign-out:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.sidebar-sign-out:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* The page footer's What's new and Sign out show only where the sidebar's foot is hidden. */
.footer-sign-out,
.footer-whats-new {
  display: none;
}

.footer-whats-new {
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  color: var(--text-secondary);
}

.footer-count:not(:empty) {
  padding: 0 6px;
  border-radius: 4px;
  background: var(--nav-selected);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
}

.dashboard-workspace {
  margin-left: 232px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-topbar {
  height: 76px;
  padding: 0 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
}

.dashboard-topbar > span > span {
  margin: 0 12px;
  color: var(--text-muted);
}

.dashboard-topbar strong {
  font-weight: 500;
  color: var(--text-primary);
}

.preview-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 30px;
  border-bottom: 1px solid var(--border-warm);
  background: var(--bg-warm);
  font-size: 12px;
  color: var(--text-warm);
}

.preview-banner > a {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent);
}

.dashboard-main {
  padding: 26px 30px 48px;
  max-width: 1600px;
  width: 100%;
  margin-inline: auto;
  flex: 1;
}

.page-heading {
  display: flex;
  gap: 25px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-heading .eyebrow {
  font-size: 10px;
  color: var(--accent);
}

.page-heading h1 {
  font-size: clamp(25px, 2.6vw, 32px);
  letter-spacing: -0.8px;
  margin-top: 10px;
  font-weight: 620;
}

.page-heading p:not(.eyebrow) {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.page-heading > .button {
  flex-shrink: 0;
  font-size: 12px;
  padding: 10px 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
