/*
  layout.css
  App-Grundgerüst: Sidebar (Desktop), Bottom Navigation (Mobil), Topbar.
*/

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar (Desktop) --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-md);
  display: none;
  flex-direction: column;
  gap: var(--space-xs);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-sm) var(--space-lg) var(--space-sm);
}
.sidebar-brand .logo-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.sidebar-brand .brand-text strong { display: block; font-size: 1rem; }
.sidebar-brand .brand-text span { font-size: var(--font-size-sm); color: var(--color-text-muted); }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  cursor: pointer;
}
.nav-item:hover { background: var(--color-bg); text-decoration: none; }
.nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

/* --- Topbar --- */
.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-weight: 600; font-size: var(--font-size-md); }

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-md);
}
.user-chip:hover { background: var(--color-bg); }
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* --- Hauptbereich --- */
.main-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-md);
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-lg));
}

/* --- Bottom Navigation (Mobil) --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  z-index: 30;
  box-shadow: 0 -2px 10px rgba(20,30,50,0.06);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
}
.bottom-nav-item.active { color: var(--color-primary); }

@media (min-width: 900px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .main-content { padding: var(--space-xl); padding-bottom: var(--space-xl); }
}

/* --- Login-Seite --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--color-primary-dark) 0%, var(--color-primary) 55%, #1e88e5 100%);
  padding: var(--space-md);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
}
.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 auto var(--space-md) auto;
}

/* --- Grid für Dashboard-Karten --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
}
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-label { color: var(--color-text-muted); font-size: var(--font-size-sm); }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}
