/* ============================================================
   LLMBench · App-Shell (Sidebar, Topbar, Layout-Grid)
   Foundation §4 / §5 — übernommen 1:1 aus _plans/002-design.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--t-md);
  line-height: 1.45;
  color: var(--ink-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
table { border-collapse: collapse; width: 100%; }

.mono { font-family: var(--mono); font-size: 0.94em; }
.muted { color: var(--ink-3); }
.row { display: inline-flex; align-items: center; }
.row.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mb-12 { margin-bottom: 12px; }
.icon { width: 14px; height: 14px; flex: 0 0 14px; }

/* App layout */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.app.collapsed { grid-template-columns: 64px 1fr; }

/* Sidebar */
.sidebar {
  background: var(--side-bg);
  color: var(--side-ink-1);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--side-line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar-head {
  background: var(--side-bg-2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 64px;
  border-bottom: 1px solid var(--side-line);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.logo-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  background: url("/img/logo.svg") center/contain no-repeat;
  font-size: 0;
  color: transparent;
}
.logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collapse-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--side-ink-2);
  border-radius: var(--r-sm);
  flex: 0 0 28px;
}
.collapse-btn:hover { background: rgba(255,255,255,0.06); color: var(--side-ink-1); }

.nav-section { padding: 16px 12px; flex: 1; overflow-y: auto; }
.nav-section + .nav-section { padding-top: 0; }
.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--side-ink-3);
  padding: 0 12px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  color: var(--side-ink-2);
  cursor: pointer;
  font-size: var(--t-md);
  font-weight: 500;
  position: relative;
  margin-bottom: 2px;
}
.nav-item .icon { width: 16px; height: 16px; flex: 0 0 16px; color: var(--side-ink-3); }
.nav-item .label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count {
  font-size: var(--t-xs);
  color: var(--side-ink-3);
  font-variant-numeric: tabular-nums;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--side-ink-1); }
.nav-item.active {
  background: rgba(232, 90, 44, 0.10);
  color: var(--accent);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item.active .icon { color: var(--accent); }
.nav-item.active .count { color: var(--accent); }
.nav-item svg.icon { display: block; }

.sidebar-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--side-line);
  font-size: var(--t-sm);
  color: var(--side-ink-2);
}
.live-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.live-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(232, 90, 44, 0.18);
  animation: pulse 1.6s ease-in-out infinite;
}
.live-dot.idle { background: var(--side-ink-3); box-shadow: none; animation: none; }
.live-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 122, 31, 0.18); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(232, 90, 44, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(232, 90, 44, 0.06); }
}

/* Collapsed sidebar */
.app.collapsed .logo-text,
.app.collapsed .nav-label,
.app.collapsed .nav-item .label,
.app.collapsed .nav-item .count,
.app.collapsed .sidebar-foot { display: none; }
.app.collapsed .nav-item { justify-content: center; padding: 10px; }
.app.collapsed .sidebar-head { justify-content: center; padding: 14px 8px; }

/* Main / topbar */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  min-height: 64px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--t-md);
  color: var(--ink-3);
}
.crumb { cursor: pointer; }
.crumb:hover { color: var(--ink-1); }
.crumb.current { color: var(--ink-1); font-weight: 500; cursor: default; }
.breadcrumb .sep { color: var(--ink-4); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.content {
  padding: 8px 32px 48px;
  max-width: 1600px;
}
