/* ============ TaskForge – Design ============ */
:root {
  --bg: #0f1115;
  --bg-soft: #161922;
  --card: #1c2029;
  --card-hover: #232836;
  --border: #2a3040;
  --text: #eef1f7;
  --text-dim: #8b93a7;
  --accent: #8b5cf6;
  --accent-deep: #6d28d9;
  --accent-light: #c084fc;
  --accent-soft: rgba(139, 92, 246, 0.15);
  --green: #4ade80;
  --blue: #60a5fa;
  --orange: #fb923c;
  --red: #f87171;
  --yellow: #fbbf24;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  line-height: 1.5;
  overscroll-behavior-y: none;
}

.hidden { display: none !important; }

/* ============ Login ============ */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% -20%, rgba(139, 92, 246, 0.18), transparent 60%), var(--bg);
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.login-logo { font-size: 52px; margin-bottom: 8px; }
.login-card h1 { font-size: 28px; letter-spacing: -0.5px; }
.login-sub { color: var(--text-dim); font-size: 14px; margin: 4px 0 28px; }
.login-card input {
  width: 100%;
  margin-bottom: 14px;
}
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; }

/* ============ Inputs ============ */
input[type="text"], input[type="password"], input[type="date"], textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 13px 16px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; }
input[type="date"] { color-scheme: dark; }

/* ============ Buttons ============ */
.btn {
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 20px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, filter 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--bg-soft); color: var(--text-dim); border: 1px solid var(--border); }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.3); }
.btn-block { width: 100%; }

/* ============ App-Layout ============ */
.app-view {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px calc(110px + var(--safe-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(to bottom, var(--bg) 80%, transparent);
  padding: 14px 0 10px;
}
.header-top { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; letter-spacing: -0.3px; }
.brand-icon { font-size: 22px; }
.header-stats { display: flex; align-items: center; gap: 10px; }
.streak {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: var(--yellow);
  font-weight: 700;
  font-size: 14px;
  padding: 5px 12px;
  border-radius: 99px;
}
.icon-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
#logout-btn:hover { color: var(--red); border-color: var(--red); }

/* ============ Begrüßung ============ */
.greeting { margin-top: 14px; }
.greeting-text { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.greeting-sub { font-size: 13.5px; color: var(--text-dim); margin-top: 2px; }

.level-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.level-label {
  font-size: 12px; font-weight: 700;
  background: var(--accent-soft);
  color: #b79cff;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.xp-track {
  flex: 1;
  height: 8px;
  background: var(--bg-soft);
  border-radius: 99px;
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.xp-label { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

/* ============ Bereichs-Tabs ============ */
.area-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 14px;
  scrollbar-width: none;
}
.area-tabs::-webkit-scrollbar { display: none; }
.area-tab {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 9px 16px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.area-tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.area-tab[data-area="privat"].active   { background: var(--green);  border-color: var(--green);  color: #052e16; }
.area-tab[data-area="business"].active { background: var(--blue);   border-color: var(--blue);   color: #0c1e3a; }
.area-tab[data-area="valuezon"].active { background: var(--orange); border-color: var(--orange); color: #3b1604; }

/* ============ Tages-Quests ============ */
.quest-panel {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), var(--card));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius);
  padding: 4px 14px;
  margin-bottom: 14px;
}
.quest-header {
  background: none; border: none; cursor: pointer;
  font-family: inherit; width: 100%; text-align: left;
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 700; color: var(--text);
  padding: 10px 0;
}
.quest-header .chevron { margin-left: auto; transition: transform 0.25s; }
.quest-header.collapsed .chevron { transform: rotate(-90deg); }
.quest-header.collapsed + .quest-list { display: none; }
.quest-list { padding-bottom: 12px; display: flex; flex-direction: column; gap: 9px; }
.quest-item { display: flex; align-items: center; gap: 10px; }
.quest-icon { font-size: 19px; flex-shrink: 0; width: 26px; text-align: center; }
.quest-info { flex: 1; min-width: 0; }
.quest-name { font-size: 13px; font-weight: 600; }
.quest-name .quest-desc { font-weight: 400; color: var(--text-dim); }
.quest-track { height: 5px; background: var(--bg-soft); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.quest-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: 99px; transition: width 0.4s; }
.quest-item.done .quest-fill { background: var(--green); }
.quest-xp {
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  color: #c084fc; background: rgba(139, 92, 246, 0.12);
  padding: 3px 9px; border-radius: 99px;
}
.quest-item.done .quest-xp { color: var(--green); background: rgba(74, 222, 128, 0.12); }

/* ============ Begleiter (Forgie) ============ */
.pet-card {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.08), var(--card));
  border: 1px solid rgba(74, 222, 128, 0.22);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pet-emoji {
  font-size: 40px;
  flex-shrink: 0;
  animation: pet-idle 3s ease-in-out infinite;
  cursor: pointer;
}
@keyframes pet-idle {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(3deg); }
}
.pet-info { flex: 1; min-width: 0; }
.pet-name-row { display: flex; align-items: baseline; gap: 8px; }
.pet-name { font-size: 14.5px; font-weight: 800; cursor: pointer; }
.pet-name:hover { color: var(--accent-light); }
.pet-stage { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.pet-speech {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  padding: 7px 11px;
  margin-top: 6px;
  line-height: 1.4;
}

/* Boss-Schadenszahlen */
.boss-card { position: relative; }
.boss-dmg-float {
  position: absolute;
  right: 18px; top: 8px;
  font-size: 20px;
  font-weight: 900;
  color: var(--red);
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  pointer-events: none;
  animation: dmg-float 1.4s ease-out forwards;
}
@keyframes dmg-float {
  0% { opacity: 0; transform: translateY(8px) scale(0.7); }
  20% { opacity: 1; transform: translateY(0) scale(1.15); }
  100% { opacity: 0; transform: translateY(-34px) scale(1); }
}

/* Akzentfarben-Auswahl */
.theme-dots { display: flex; gap: 10px; }
.theme-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.theme-dot:hover { transform: scale(1.15); }
.theme-dot.active { border-color: #fff; transform: scale(1.12); }

/* ============ Wochen-Boss ============ */
.boss-card {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(139, 92, 246, 0.08), var(--card));
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.boss-emoji { font-size: 42px; flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(248, 113, 113, 0.4)); }
.boss-card.boss-hit .boss-emoji { animation: boss-shake 0.5s; }
.boss-info { flex: 1; min-width: 0; }
.boss-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: #fca5a5; }
.boss-name { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.boss-hp-track {
  height: 10px;
  background: var(--bg-soft);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 7px;
}
.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #f87171, #dc2626);
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.boss-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; }
.boss-card.defeated {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), var(--card));
}
.boss-card.defeated .boss-title { color: var(--yellow); }
.boss-card.defeated .boss-hp-fill { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.boss-card.defeated .boss-emoji { filter: grayscale(0.7) drop-shadow(0 0 8px rgba(251, 191, 36, 0.5)); }
@keyframes boss-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-4px) rotate(-8deg); }
  40% { transform: translateX(4px) rotate(6deg); }
  60% { transform: translateX(-3px) rotate(-4deg); }
  80% { transform: translateX(2px) rotate(2deg); }
}
.boss-victory-title {
  background: linear-gradient(90deg, #fbbf24, #f87171, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.levelup-title-rank { font-size: 16px; font-weight: 700; color: var(--yellow); margin: -18px 0 26px; }

/* ============ Golden Hour ============ */
.golden-line {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 10px;
  padding: 8px 12px;
}
.golden-line.active {
  animation: golden-pulse 1.6s ease-in-out infinite;
  border-color: rgba(251, 191, 36, 0.6);
}
@keyframes golden-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.25); }
  50% { box-shadow: 0 0 16px 2px rgba(251, 191, 36, 0.35); }
}

/* ============ Tages-Glücksrad ============ */
.spin-line {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  color: #c084fc;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.spin-line:hover { border-color: var(--accent); background: var(--accent-soft); }
.spin-line.claimed { color: var(--text-dim); cursor: default; background: var(--bg-soft); border-color: var(--border); }

.spin-card {
  text-align: center;
  padding: 30px;
  animation: levelup-pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.spin-title { font-size: 22px; font-weight: 800; margin-bottom: 22px; }
.wheel-wrap { position: relative; width: 260px; height: 260px; margin: 0 auto 22px; }
.wheel-pointer {
  position: absolute;
  top: -16px; left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 6px solid var(--border);
  position: relative;
  box-shadow: 0 8px 40px rgba(139, 92, 246, 0.25), inset 0 0 30px rgba(0,0,0,0.3);
  background: conic-gradient(
    #6d28d9 0deg 45deg, #1d4ed8 45deg 90deg,
    #15803d 90deg 135deg, #b45309 135deg 180deg,
    #7c3aed 180deg 225deg, #2563eb 225deg 270deg,
    #16a34a 270deg 315deg, #dc2626 315deg 360deg
  );
  transition: transform 4s cubic-bezier(0.12, 0.8, 0.2, 1);
}
.wheel-label {
  position: absolute;
  left: 50%; top: 50%;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.spin-result {
  font-size: 20px;
  font-weight: 800;
  color: var(--yellow);
  margin-bottom: 18px;
  animation: levelup-pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ============ Aufgaben-Roulette ============ */
.roulette-heading { font-size: 14px; color: var(--text-dim); margin-bottom: 14px; }
.roulette-task {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  max-width: 300px;
  margin: 0 auto 22px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.roulette-task.final {
  border-color: var(--accent);
  background: var(--accent-soft);
  animation: levelup-pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Krit-Toast */
.toast-crit {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
  font-size: 15.5px;
  animation: toast-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), crit-flash 0.6s ease, fade-out 0.4s ease 2.4s forwards;
}
@keyframes crit-flash {
  0% { transform: scale(1.3); box-shadow: 0 0 30px rgba(251, 191, 36, 0.6); }
  100% { transform: scale(1); }
}

/* ============ Toolbar: Quick-Add + Suche + Ansichten ============ */
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.quickadd-form { flex: 1; }
#quickadd-input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 16px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#quickadd-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar .icon-btn { width: 40px; height: 40px; flex-shrink: 0; }
.toolbar .icon-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.view-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.view-switcher::-webkit-scrollbar { display: none; }
.view-btn {
  flex: 1 0 auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 12px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.view-btn.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

/* Inbox-Badge im Tab */
.tab-badge {
  display: inline-block;
  margin-left: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  padding: 0 7px;
}

/* Heute-Ansicht */
.overdue-title { color: var(--red); }
.review-btn {
  width: 100%;
  margin-top: 18px;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 13px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.review-btn:hover { color: var(--text); border-color: var(--accent); }

/* Wochen-Ansicht */
.week-day-bucket {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.week-day-bucket.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.week-day-bucket.is-today { border-color: rgba(139, 92, 246, 0.5); }
.week-day-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.week-day-bucket.is-today .week-day-head { color: #c084fc; }
.week-day-bucket .task-list { gap: 8px; }
.week-day-empty { font-size: 12.5px; color: var(--text-dim); opacity: 0.6; padding: 2px 0 4px; }
.week-hint { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; }

/* Review */
.review-summary {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), var(--bg-soft));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 14px;
}
.review-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.review-item-title { font-size: 14.5px; font-weight: 600; }
.review-item-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.review-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.review-actions .btn { padding: 7px 12px; font-size: 12.5px; flex: 1 0 auto; }
.review-done {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-dim);
  font-size: 14px;
}

/* Geplant-Zeile im Sheet */
.planned-row { display: flex; gap: 8px; align-items: center; }
.planned-row input { flex: 1; }
.btn-mini { padding: 10px 12px; font-size: 12.5px; white-space: nowrap; }

.chip-planned { color: #c4b5fd; background: rgba(139, 92, 246, 0.14); }
.chip-link { color: #7dd3fc; background: rgba(125, 211, 252, 0.1); cursor: pointer; }
.chip-inbox { color: #fda4af; background: rgba(253, 164, 175, 0.1); }

/* ============ Suche ============ */
.search-row { margin-bottom: 14px; }
#search-input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text);
  font-size: 14.5px;
  padding: 10px 18px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#search-input::-webkit-search-cancel-button { filter: invert(0.6); }

/* ============ Sektionen & Karten ============ */
.task-section { margin-bottom: 22px; }
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.collapsible {
  background: none; border: none; cursor: pointer;
  font-family: inherit; width: 100%; text-align: left;
}
.chevron { margin-left: auto; transition: transform 0.25s; }
.collapsed .chevron { transform: rotate(-90deg); }
.collapsed + .task-list { display: none; }
.count-badge {
  background: var(--bg-soft);
  border-radius: 99px;
  padding: 1px 9px;
  font-size: 11px;
}

.task-list { display: flex; flex-direction: column; gap: 10px; }

.task-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, transform 0.15s, opacity 0.3s;
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.task-card:hover { background: var(--card-hover); }
.task-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.task-card.area-privat::before   { background: var(--green); }
.task-card.area-business::before { background: var(--blue); }
.task-card.area-valuezon::before { background: var(--orange); }

.task-card.completing {
  animation: complete-pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.task-card.done-card { opacity: 0.55; }
.task-card.done-card .task-title { text-decoration: line-through; }

/* Checkbox */
.check {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border: 2px solid var(--text-dim);
  border-radius: 50%;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.check:hover { border-color: var(--green); transform: scale(1.12); }
.check.checked {
  background: var(--green);
  border-color: var(--green);
  color: #052e16;
  animation: check-pop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15.5px; font-weight: 600; word-break: break-word; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--bg-soft);
  color: var(--text-dim);
}
.chip-privat   { color: var(--green);  background: rgba(74, 222, 128, 0.1); }
.chip-business { color: var(--blue);   background: rgba(96, 165, 250, 0.1); }
.chip-valuezon { color: var(--orange); background: rgba(251, 146, 60, 0.1); }
.chip-due-ok      { color: var(--text-dim); }
.chip-due-soon    { color: var(--yellow); background: rgba(251, 191, 36, 0.1); }
.chip-due-overdue { color: var(--red);    background: rgba(248, 113, 113, 0.12); }
.chip-prio-2 { color: var(--red);    background: rgba(248, 113, 113, 0.12); }
.chip-prio-0 { color: var(--text-dim); }
.chip-xp { color: #c084fc; background: rgba(139, 92, 246, 0.12); }
.chip-diff { color: var(--text-dim); }
.chip-tag { color: #67e8f9; background: rgba(103, 232, 249, 0.1); cursor: pointer; }
.chip-recur { color: #a5b4fc; background: rgba(165, 180, 252, 0.1); }

/* Checklisten-Fortschritt auf der Karte */
.subtask-progress { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.subtask-progress-track { flex: 1; height: 5px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.subtask-progress-fill { height: 100%; background: var(--green); border-radius: 99px; transition: width 0.3s; }
.subtask-progress-label { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

/* Swipe-Gesten */
.task-card.swiping { transition: none; }
.task-card.swipe-reset { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.swipe-hint {
  position: absolute;
  top: 0; bottom: 0;
  display: flex; align-items: center;
  font-size: 22px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.swipe-hint.right { left: 14px; }
.swipe-hint.left { right: 14px; }
.swipe-hint.visible { opacity: 1; }
.task-notes-preview {
  font-size: 13px; color: var(--text-dim);
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============ Archiv ============ */
.archive-btn {
  width: 100%;
  margin-top: 10px;
  background: none;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.archive-btn:hover { color: var(--text); border-color: var(--text-dim); }

/* ============ Board-Ansicht ============ */
.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}
.board-col {
  flex: 1;
  min-width: 240px;
  scroll-snap-align: start;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.board-col-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.board-list { display: flex; flex-direction: column; gap: 9px; min-height: 60px; }
.board-list .task-card { background: var(--card); }
.board-col.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.task-card.dragging { opacity: 0.4; }

/* ============ Kalender-Ansicht ============ */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-nav h2 { font-size: 17px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 16px;
}
.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 4px 0;
}
.cal-cell {
  aspect-ratio: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: all 0.15s;
  padding: 2px;
}
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.other-month { opacity: 0.3; }
.cal-cell.today { border-color: var(--accent); background: var(--accent-soft); }
.cal-cell.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-cell.empty { background: none; border: none; cursor: default; }
.cal-dots { display: flex; gap: 2px; height: 5px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal-dot.overdue { background: var(--red); }
.cal-dot.more { background: var(--text-dim); }
.cal-daylist-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.cal-daylist .task-list { margin-bottom: 20px; }

/* ============ Subtasks im Sheet ============ */
.subtask-list { display: flex; flex-direction: column; gap: 6px; }
.subtask-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}
.subtask-check {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 2px solid var(--text-dim);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.subtask-check.checked { background: var(--green); border-color: var(--green); color: #052e16; }
.subtask-title { flex: 1; font-size: 14px; word-break: break-word; }
.subtask-item.done .subtask-title { text-decoration: line-through; color: var(--text-dim); }
.subtask-remove {
  background: none; border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}
.subtask-remove:hover { color: var(--red); }
.subtask-add { display: flex; gap: 8px; margin-top: 8px; }
.subtask-add input { flex: 1; }
.subtask-add .btn { padding: 8px 18px; font-size: 18px; }

/* ============ Pomodoro ============ */
.btn-pomodoro {
  width: 100%;
  margin-top: 18px;
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.btn-pomodoro:hover { background: rgba(248, 113, 113, 0.18); }
.pomodoro-card {
  text-align: center;
  padding: 40px;
  animation: levelup-pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pomodoro-task {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 280px;
  margin: 0 auto 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pomodoro-time {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 18px;
}
.pomodoro-ring { position: relative; width: 140px; height: 140px; margin: 0 auto 26px; }
.pomodoro-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-soft); stroke-width: 8; }
.ring-fill {
  fill: none;
  stroke: var(--red);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
.pomodoro-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}
.pomodoro-actions { display: flex; gap: 10px; justify-content: center; }

/* ============ Einstellungen im Statistik-Sheet ============ */
.settings-list { display: flex; flex-direction: column; gap: 10px; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.settings-label { font-size: 14px; font-weight: 600; }
.settings-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }
.settings-row .btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.toggle {
  position: relative;
  width: 46px; height: 26px;
  border-radius: 99px;
  background: var(--border);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.2s;
}
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 23px; background: #fff; }

/* ============ Empty State ============ */
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.empty-icon { font-size: 56px; margin-bottom: 14px; }
.empty-sub { font-size: 13.5px; margin-top: 6px; }

/* ============ FAB ============ */
.fab {
  position: fixed;
  right: max(20px, calc(50vw - 320px));
  bottom: calc(24px + var(--safe-bottom));
  width: 60px; height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: 30px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 30;
}
.fab:hover { transform: scale(1.08) rotate(90deg); }
.fab:active { transform: scale(0.92); }

/* ============ Bottom Sheet ============ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.2s;
}
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 12px 22px calc(26px + var(--safe-bottom));
  animation: slide-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin: 0 auto 16px;
}
.sheet h2 { font-size: 19px; margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px;
}
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; }

.segmented { display: flex; gap: 8px; }
.seg-btn {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 10px 6px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.seg-btn.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.seg-btn.area-privat.active   { color: var(--green);  border-color: var(--green);  background: rgba(74, 222, 128, 0.12); }
.seg-btn.area-business.active { color: var(--blue);   border-color: var(--blue);   background: rgba(96, 165, 250, 0.12); }
.seg-btn.area-valuezon.active { color: var(--orange); border-color: var(--orange); background: rgba(251, 146, 60, 0.12); }
.seg-btn.prio-high.active { color: var(--red);    border-color: var(--red);    background: rgba(248, 113, 113, 0.12); }
.seg-btn.prio-low.active  { color: var(--text-dim); border-color: var(--text-dim); background: var(--bg-soft); }
.seg-btn.diff-easy.active { color: var(--green);  border-color: var(--green);  background: rgba(74, 222, 128, 0.12); }
.seg-btn.diff-hard.active { color: var(--orange); border-color: var(--orange); background: rgba(251, 146, 60, 0.12); }

.xp-preview {
  margin-top: 14px;
  font-size: 13.5px;
  color: #c084fc;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 11px;
  padding: 9px 14px;
  text-align: center;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.sheet-actions .btn-primary { flex: 1; }

/* ============ Toast ============ */
#toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 10px 22px;
  font-size: 14.5px;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: toast-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), fade-out 0.4s ease 1.8s forwards;
}
.toast-xp { color: #c084fc; border-color: rgba(139, 92, 246, 0.4); }
.toast-error { color: var(--red); border-color: rgba(248, 113, 113, 0.4); }

/* ============ Konfetti ============ */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

/* ============ Animationen ============ */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-up {
  from { transform: translateY(60px); opacity: 0.5; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes check-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
@keyframes complete-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.025); box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25); }
  100% { transform: scale(1); }
}

/* ============ Statistik-Dashboard ============ */
.stats-sheet { max-height: 92vh; }
.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.stats-header h2 { margin-bottom: 0; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.stat-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.stat-name { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.stat-card.stat-warn { border-color: rgba(248, 113, 113, 0.35); }
.stat-card.stat-warn .stat-value { color: var(--red); }

.penalty-warning {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 12px;
  padding: 11px 14px;
}

/* Aktivitäts-Heatmap */
.heatmap-wrap {
  overflow-x: auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  scrollbar-width: thin;
}
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 11px);
  grid-auto-flow: column;
  grid-auto-columns: 11px;
  gap: 3px;
  width: max-content;
}
.heat-cell { border-radius: 3px; background: var(--card); }
.heat-0 { background: #232836; }
.heat-1 { background: #3b2d63; }
.heat-2 { background: #5b3fa3; }
.heat-3 { background: #7c52e0; }
.heat-4 { background: #a78bfa; }

.stats-section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 22px 0 12px;
}

/* Wochen-Chart */
.week-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 10px;
}
.week-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.week-bar-value { font-size: 11px; font-weight: 700; color: var(--text-dim); }
.week-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  min-height: 3px;
  transition: height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.week-day.today .week-bar { background: linear-gradient(180deg, var(--accent-light), var(--accent)); box-shadow: 0 0 12px var(--accent-soft); }
.week-bar.empty { background: var(--border); }
.week-bar-label { font-size: 11px; color: var(--text-dim); }
.week-day.today .week-bar-label { color: #c084fc; font-weight: 700; }

/* Bereichs-Verteilung */
.area-dist { display: flex; flex-direction: column; gap: 10px; }
.area-row { display: flex; align-items: center; gap: 10px; }
.area-row-label { width: 110px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.area-row-track { flex: 1; height: 10px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.area-row-fill { height: 100%; border-radius: 99px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.area-row-fill.privat   { background: var(--green); }
.area-row-fill.business { background: var(--blue); }
.area-row-fill.valuezon { background: var(--orange); }
.area-row-count { font-size: 12px; color: var(--text-dim); width: 70px; text-align: right; white-space: nowrap; }

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.achievement {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.achievement.unlocked {
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), var(--bg-soft));
}
.achievement.locked { opacity: 0.45; filter: grayscale(0.8); }
.achievement-icon { font-size: 26px; flex-shrink: 0; }
.achievement-title { font-size: 13px; font-weight: 700; line-height: 1.25; }
.achievement-desc { font-size: 11px; color: var(--text-dim); line-height: 1.3; margin-top: 1px; }

/* ============ Level-Up-Overlay ============ */
.levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(6px);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.3s;
}
.levelup-card {
  text-align: center;
  padding: 40px;
  animation: levelup-pop 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.levelup-emoji { font-size: 80px; animation: levelup-bounce 1s ease infinite alternate; }
.levelup-title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #c084fc, #8b5cf6, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 8px 0 4px;
}
.levelup-level { font-size: 18px; color: var(--text-dim); margin-bottom: 28px; }
@keyframes levelup-pop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes levelup-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-12px); }
}

/* Desktop-Feinschliff */
@media (min-width: 700px) {
  .app-view { padding-top: 10px; }
  .task-title { font-size: 16px; }
}
