/* PQuadrat – Basis-Styles: Sidebar-Layout ohne Kopf- und Fußzeile */

:root {
  --sidebar-bg: #111827;
  --sidebar-bg-hover: #1f2937;
  --sidebar-text: #9ca3af;
  --sidebar-text-active: #f9fafb;
  --sidebar-accent: #6366f1;
  --content-bg: #f3f4f6;
  --card-bg: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--content-bg);
}

/* ---------- Layout: links Navigation, rechts Inhalt ---------- */

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

.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--sidebar-accent), #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.brand-name {
  color: var(--sidebar-text-active);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6b7280;
  padding: 16px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14.5px;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-accent);
  color: #fff;
}

/* ---------- Benutzerbereich unten in der Sidebar ---------- */

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-name {
  color: var(--sidebar-text-active);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user form { display: flex; }

.logout-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  transition: background 0.15s, color 0.15s;
}

.logout-btn svg { width: 18px; height: 18px; }

.logout-btn:hover {
  background: var(--sidebar-bg-hover);
  color: #f87171;
}

/* ---------- Inhaltsbereich ---------- */

.content {
  flex: 1;
  min-width: 0;
  padding: 36px 40px;
}

.page-head { margin-bottom: 28px; }

.page-head h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- Login-Seite ---------- */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--sidebar-bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border-radius: 14px;
  padding: 36px 34px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  margin: 20px;
}

.login-brand {
  text-align: center;
  margin-bottom: 26px;
}

.login-brand .brand-mark {
  width: 46px;
  height: 46px;
  font-size: 19px;
  border-radius: 12px;
}

.login-brand h1 {
  margin: 14px 0 4px;
  font-size: 21px;
}

.login-brand p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  border-color: var(--sidebar-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 11px;
  margin-top: 6px;
  background: var(--sidebar-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: #4f46e5; }

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* ---------- Mobil ---------- */

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .content { padding: 24px 20px; }
}
