/* ===========================
   Theme-Variablen & Dark Mode
   =========================== */
:root {
  --primary-bg: #f8fafc;
  --card-bg: #fff;
  --accent: #10b981;
  --accent-light: #6ee7b7;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --nav-bg: #fff;
  --nav-active: #10b981;
  --nav-inactive: #6b7280;
  --danger: #ef4444;
  --info: #007bff;
  --shadow: 0 4px 24px 0 rgba(16,185,129,0.07), 0 1.5px 4px 0 rgba(0,0,0,0.04);
}

body.dark {
  --primary-bg: #181c24;
  --card-bg: #232a36;
  --accent: #10b981;
  --accent-light: #34d399;
  --text: #f3f6fa;
  --text-muted: #b0b8c9;
  --border: #232a36;
  --nav-bg: #232a36cc;
  --nav-active: #10b981;
  --nav-inactive: #b0b8c9;
  --danger: #ef4444;
  --info: #60a5fa;
  --shadow: 0 4px 24px 0 rgba(16,185,129,0.10), 0 1.5px 4px 0 rgba(0,0,0,0.10);
}

/* ===========================
   Grundlayout & Typografie
   =========================== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--primary-bg);
  color: var(--text);
  margin: 0;
  padding-bottom: 90px;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

.container {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 8px 0 8px;
}

/* ===========================
   Header (modern, ohne Avatar)
   =========================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px 18px 18px 18px;
  margin-bottom: 28px;
  gap: 18px;
  position: relative;
}

.header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.greeting {
  font-size: 0.98rem;
  color: var(--text-muted);
  font-weight: 500;
}

.username {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.points-badge {
  background: var(--accent-light);
  color: var(--accent);
  padding: 7px 14px;
  border-radius: 22px;
  font-weight: 700;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 4px 0 rgba(16,185,129,0.08);
}

/* Logout-Button */
.logout-btn {
  background: none;
  border: none;
  margin-left: 8px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.logout-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.logout-btn svg {
  display: block;
}

/* ===========================
   Cards & Statistiken
   =========================== */
.card {
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 18px 18px 18px;
  margin-bottom: 24px;
  transition: background 0.2s;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 10px;
}

.stat-card {
  background: var(--primary-bg);
  border-radius: 14px;
  padding: 18px 0 14px 0;
  text-align: center;
  box-shadow: 0 1px 4px 0 rgba(16,185,129,0.04);
  transition: background 0.2s;
}

.stat-number {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.93rem;
  color: var(--text-muted);
  font-weight: 500;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 28px 0 12px 0;
  color: var(--text);
  letter-spacing: 0.01em;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 38px 0 18px 0;
}

.empty-state-icon {
  font-size: 2.3rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* ===========================
   Aufgaben/Tasks
   =========================== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.task-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 1px 4px 0 rgba(16,185,129,0.04);
  padding: 16px 14px 14px 14px;
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.task-card .task-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
}

.task-card .task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.task-card .due-chip {
  background: var(--info);
  color: #fff;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.92rem;
  font-weight: 500;
}

.task-card .status-badge {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.92rem;
  font-weight: 500;
}

.task-card.overdue {
  border-left: 4px solid var(--danger);
}

.task-card.completed {
  opacity: 0.7;
  background: var(--primary-bg);
}

/* ===========================
   Floating Bottom Navigation
   =========================== */
.floating-nav {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0;
  padding: 0;
  z-index: 100;
  border-radius: 0;
  box-shadow: 0 -2px 12px #0002;
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s;
}
.floating-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 6px 0;
  border-radius: 0;
  transition: color 0.2s;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
}
.floating-nav .nav-icon svg {
  width: 26px;
  height: 26px;
  display: block;
  color: var(--nav-inactive);
  transition: color 0.2s, filter 0.2s;
}
.floating-nav .nav-item.active .nav-icon svg {
  color: var(--nav-active);
  filter: drop-shadow(0 0 4px var(--accent-light));
}
.floating-nav .nav-label {
  font-size: 0.75rem;
  margin-top: 2px;
  font-weight: 500;
  color: var(--nav-inactive);
  transition: color 0.2s;
}
.floating-nav .nav-item.active .nav-label {
  font-weight: 700;
  color: var(--text);
}
@media (min-width: 768px) {
  .floating-nav { display: none; }
}

/* ===========================
   Login Overlay & Form
   =========================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.08);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-form {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 260px;
  transition: background 0.2s;
}
.login-form input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
  background: var(--primary-bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}
.login-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}
.login-form button:hover {
  background: var(--accent-light);
}

/* ===========================
   Toast-Benachrichtigungen
   =========================== */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--card-bg);
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  padding: 12px 22px;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-info { border-left: 4px solid var(--accent); }
.toast-success { border-left: 4px solid #22c55e; }
.toast-error { border-left: 4px solid var(--danger); }
	
	.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.add-task-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16,185,129,0.10);
  transition: background 0.2s;
}
.add-task-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.18);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.modal {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
  padding: 32px 24px;
  min-width: 280px;
  max-width: 95vw;
}
.modal h2 { margin-top: 0; }
.modal form { display: flex; flex-direction: column; gap: 14px; }
.modal input, .modal textarea, .modal select {
  padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 1rem; background: var(--primary-bg); color: var(--text);
}
.modal button[type="submit"] {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 10px; font-weight: 600; cursor: pointer; font-size: 1rem;
  transition: background 0.2s;
}
.modal button[type="submit"]:hover {
  background: var(--accent-light); color: var(--accent);
}
.modal button#closeModalBtn {
  background: none; color: var(--text-muted); border: none; cursor: pointer;
  margin-top: 4px;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 480px) {
  .container {
    padding: 10px 2px 0 2px;
  }
  .main-header, .card {
    padding: 16px 8px 12px 8px;
  }
  .stats-grid {
    gap: 10px;
  }
  .toast-container {
    bottom: 70px;
  }
}