/* =============================================================================
   Layout-Grid (Spec §5.3) — TopBar + Sidebar 260px + Main
   ============================================================================= */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* iOS Safari: dynamische Viewport-Höhe (Adressleiste-ausblendend) */
  width: 100vw;
  overflow: hidden;
}

/* ---------- Top-Bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--topbar-h);
  padding: 0 1rem;
  border-bottom: 1px solid var(--glass-border-subtle);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  flex-shrink: 0;
}

.topbar__spacer-mac {
  width: 64px;
  flex-shrink: 0;
}

.topbar__search {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
  max-width: 480px;
  padding: 0.375rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 13px;
  cursor: text;
  transition: border-color 120ms ease, background 120ms ease;
}
.topbar__search:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}
.topbar__search-text {
  flex: 1;
}
.topbar__shortcut {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  color: var(--text-dim);
}

.topbar__flex {
  flex: 1;
}

.topbar__stopwatch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid rgba(5, 150, 105, 0.30);
  border-radius: var(--radius-md);
  background: rgba(5, 150, 105, 0.10);
}
.topbar__stopwatch-icon {
  color: var(--mod-finance);
  font-size: 10px;
}
.topbar__stopwatch-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--mod-finance);
  font-variant-numeric: tabular-nums;
}
.topbar__stopwatch-context {
  font-size: 11px;
  color: var(--text-dim);
}
.topbar__stopwatch {
  transition: background 120ms ease, border-color 120ms ease;
}
.topbar__stopwatch:hover {
  background: rgba(5, 150, 105, 0.15);
}
.topbar__stopwatch[data-state="running"] {
  background: rgba(5, 150, 105, 0.18);
  border-color: rgba(5, 150, 105, 0.50);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ---------- Body ---------- */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--glass-sidebar);
  backdrop-filter: blur(var(--glass-blur-strong));
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  border-right: 1px solid var(--glass-border-subtle);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 1.25rem 1.25rem 1rem;
  flex-shrink: 0;
}
.sidebar__brand-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 1rem;
  will-change: transform;
}

.sidebar__group {
  margin-top: 0.75rem;
}
.sidebar__group:first-child {
  margin-top: 0;
}
.sidebar__group-label {
  padding: 0 1.25rem 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem 0.625rem 1.125rem;
  margin: 0.125rem 0.625rem;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.95);
}
.nav-item[data-active="true"] {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.nav-item[data-active="true"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--nav-accent, #2563EB);
  box-shadow: 0 0 12px var(--nav-accent, #2563EB);
}
.nav-item__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar__footer {
  margin: 0 0.75rem 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}
.sidebar__footer-title {
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  overflow-y: auto;
  will-change: transform;
}
.main__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}
