/* ==========================================================================
   Alltagsplaner – Stylesheet
   Look: "Kühlschrank-Pinnwand" – dicke Konturen, versetzte Schatten,
   Farbcodes pro Bereich. Farben stammen aus dem Maskottchen (Pflaume,
   Mango, Pfirsich).
   ========================================================================== */

:root {
  /* Grundflächen */
  --paper:      #FBF7FF;
  --paper-2:    #F3ECFF;
  --card:       #FFFFFF;
  --ink:        #241C46;
  --ink-soft:   #6E668F;
  --line:       #241C46;

  /* Akzente */
  --grape:      #6B5AE0;
  --mango:      #FF7A45;
  --mint:       #17B08A;
  --sky:        #2E9BF0;
  --pink:       #FF5FA2;
  --lemon:      #FFC53D;
  --peach:      #FFB48A;

  /* Bereichsfarben */
  --c-home:     var(--grape);
  --c-shop:     var(--mint);
  --c-time:     var(--sky);
  --c-fun:      var(--mango);
  --c-clean:    var(--pink);
  --c-admin:    var(--ink);

  --radius:     20px;
  --radius-sm:  12px;
  --shadow:     4px 4px 0 rgba(36, 28, 70, 0.14);
  --shadow-lg:  7px 7px 0 rgba(36, 28, 70, 0.16);
  --border:     2.5px solid var(--line);

  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body:    "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(107, 90, 224, 0.10) 0 12px, transparent 13px),
    radial-gradient(circle at 78% 8%,  rgba(255, 122, 69, 0.12) 0 9px,  transparent 10px),
    radial-gradient(circle at 90% 62%, rgba(23, 176, 138, 0.10) 0 14px, transparent 15px),
    radial-gradient(circle at 30% 88%, rgba(255, 95, 162, 0.10) 0 11px, transparent 12px);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 0.9em; }
a { color: var(--grape); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--mango); }

:focus-visible {
  outline: 3px solid var(--mango);
  outline-offset: 2px;
  border-radius: 6px;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.35em;
}

.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 0.75rem; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------- Grundlayout ---------- */

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 6rem;
}

.sidebar { position: sticky; top: 1.25rem; align-self: start; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  text-decoration: none;
  color: inherit;
}
.brand__mark {
  width: 46px; height: 46px;
  border: var(--border);
  border-radius: 14px;
  background: var(--lemon);
  display: grid; place-items: center;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.brand__name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.brand__sub { font-size: 0.72rem; color: var(--ink-soft); letter-spacing: 0.1em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 0.5rem; }
.nav__item {
  --nav-color: var(--grape);
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.62rem 0.85rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(36, 28, 70, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.nav__item:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 rgba(36, 28, 70, 0.16); color: var(--ink); }
.nav__item[aria-current="page"] {
  background: var(--nav-color);
  color: #fff;
  box-shadow: 4px 4px 0 var(--ink);
}
.nav__icon { font-size: 1.15rem; line-height: 1; }

.nav__item--shop  { --nav-color: var(--c-shop); }
.nav__item--time  { --nav-color: var(--c-time); }
.nav__item--fun   { --nav-color: var(--c-fun); }
.nav__item--clean { --nav-color: var(--c-clean); }
.nav__item--admin { --nav-color: var(--c-admin); }

.sidebar__footer { margin-top: 1.1rem; font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Kopfzeile im Inhalt ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.topbar__title { margin: 0; }

.userbar { display: flex; align-items: center; gap: 0.5rem; }

.pointsbadge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--lemon);
  border: var(--border);
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 3px 3px 0 rgba(36, 28, 70, 0.15);
  white-space: nowrap;
}

/* ---------- Karten ---------- */

.card {
  --card-accent: var(--grape);
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem;
  position: relative;
}
.card + .card { margin-top: 1.1rem; }
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.card__title { margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.card__tape {
  position: absolute;
  top: -12px; left: 22px;
  padding: 0.15rem 0.7rem;
  background: var(--card-accent);
  color: #fff;
  border: var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card--shop  { --card-accent: var(--c-shop); }
.card--time  { --card-accent: var(--c-time); }
.card--fun   { --card-accent: var(--c-fun); }
.card--clean { --card-accent: var(--c-clean); }

.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--grape);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--btn-bg);
  border: var(--border);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); color: #fff; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--ghost { --btn-bg: var(--card); color: var(--ink); box-shadow: 3px 3px 0 rgba(36,28,70,0.18); }
.btn--ghost:hover { color: var(--ink); }
.btn--mango { --btn-bg: var(--mango); }
.btn--mint  { --btn-bg: var(--mint); }
.btn--sky   { --btn-bg: var(--sky); }
.btn--pink  { --btn-bg: var(--pink); }
.btn--sm    { padding: 0.3rem 0.7rem; font-size: 0.82rem; box-shadow: 2px 2px 0 var(--ink); }
.btn--block { width: 100%; }
.btn--danger { --btn-bg: #E0393E; }

.iconbtn {
  border: var(--border);
  background: var(--card);
  border-radius: 10px;
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  cursor: pointer;
  font-size: 0.95rem;
  box-shadow: 2px 2px 0 rgba(36,28,70,0.16);
  color: var(--ink);
  text-decoration: none;
}
.iconbtn:hover { background: var(--paper-2); color: var(--ink); }

/* ---------- Formulare ---------- */

.field { display: block; margin-bottom: 0.85rem; }
.field__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.input, .select, .textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-sm);
}
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--peach); outline-offset: 1px; }
.textarea { min-height: 84px; resize: vertical; }
.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; }
.field--grow { flex: 1 1 180px; }
.field--narrow { flex: 0 0 110px; }

fieldset { border: none; margin: 0; padding: 0; }

.swatches { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatch span {
  display: block; width: 30px; height: 30px;
  border: var(--border); border-radius: 9px;
  cursor: pointer;
}
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--lemon); transform: scale(1.08); }
.swatch input:focus-visible + span { outline: 3px solid var(--mango); outline-offset: 2px; }

.emojipick { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.emojipick label { position: relative; }
.emojipick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.emojipick span {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 1.1rem;
}
.emojipick input:checked + span { background: var(--lemon); }

/* ---------- Listen ---------- */

.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  border: 2px solid rgba(36, 28, 70, 0.14);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 0.5rem;
}
.list__item.is-done { background: var(--paper-2); border-style: dashed; }
.list__item.is-done .list__title { text-decoration: line-through; color: var(--ink-soft); }
.list__item.is-overdue { border-color: var(--pink); background: #FFF3F8; }
.list__item.is-today { border-color: var(--lemon); background: #FFFBEB; }
.list__title { font-weight: 500; }
.list__meta { font-size: 0.8rem; color: var(--ink-soft); }
.list__actions { margin-left: auto; display: flex; gap: 0.35rem; align-items: center; }

.checkbtn {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border: var(--border);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: grid; place-items: center;
  color: var(--mint);
}
.checkbtn:hover { background: #EAFBF5; }
.checkbtn.is-checked { background: var(--mint); color: #fff; }

.tag {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-2);
  white-space: nowrap;
}
.tag--mint { background: #D7F5EC; }
.tag--sky  { background: #DCEEFF; }
.tag--mango{ background: #FFE6D9; }
.tag--pink { background: #FFE1EE; }
.tag--lemon{ background: #FFF3CE; }

.chip {
  --chip: var(--grape);
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.6rem 0.2rem 0.3rem;
  background: color-mix(in srgb, var(--chip) 16%, #fff);
  border: 2px solid var(--chip);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip__emoji {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
}
.chip--sm { font-size: 0.74rem; }

/* Fortschritt */
.bar {
  height: 14px;
  border: var(--border);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.bar__fill { height: 100%; background: var(--mint); transition: width 0.35s ease; }

/* Kennzahlen */
.stat {
  border: var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow);
}
.stat__value { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; }
.stat__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }

/* ---------- Tabellen (Adminbereich) ---------- */

.table { width: 100%; border-collapse: separate; border-spacing: 0 0.4rem; font-size: 0.92rem; }
.table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0 0.6rem;
}
.table td { background: #fff; padding: 0.55rem 0.6rem; border-top: 2px solid rgba(36,28,70,0.14); border-bottom: 2px solid rgba(36,28,70,0.14); }
.table td:first-child { border-left: 2px solid rgba(36,28,70,0.14); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.table td:last-child { border-right: 2px solid rgba(36,28,70,0.14); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.table-scroll { overflow-x: auto; }

/* ---------- Hinweise ---------- */

.notice {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.7rem 0.9rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 0.75rem;
  box-shadow: 3px 3px 0 rgba(36,28,70,0.12);
}
.notice--ok    { background: #E4F9F1; }
.notice--error { background: #FFE7EC; }
.notice--info  { background: #E8F1FF; }
.notice--warn  { background: #FFF6DC; }

.empty {
  text-align: center;
  padding: 1.5rem 1rem;
  border: 2.5px dashed rgba(36,28,70,0.28);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: rgba(255,255,255,0.6);
}

/* ---------- Maskottchen ---------- */

.mascot {
  position: fixed;
  right: 1.1rem; bottom: 1.1rem;
  z-index: 60;
  display: flex; align-items: flex-end; gap: 0.5rem;
  max-width: min(420px, calc(100vw - 2rem));
}
.mascot__bubble {
  position: relative;
  background: #fff;
  border: var(--border);
  border-radius: 18px;
  padding: 0.7rem 0.9rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  max-width: 260px;
}
.mascot__bubble::after {
  content: "";
  position: absolute;
  right: -11px; bottom: 16px;
  width: 0; height: 0;
  border-left: 12px solid var(--ink);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.mascot__bubble::before {
  content: "";
  position: absolute;
  right: -7px; bottom: 18px;
  width: 0; height: 0;
  border-left: 9px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  z-index: 1;
}
.mascot__name { font-family: var(--font-display); font-size: 0.78rem; color: var(--grape); display: block; }
.mascot__figure {
  border: none; background: transparent; padding: 0; cursor: pointer;
  width: 92px; flex: 0 0 auto;
  filter: drop-shadow(3px 4px 0 rgba(36,28,70,0.18));
  animation: bob 4.5s ease-in-out infinite;
}
.mascot__figure img { width: 100%; display: block; }
.mascot__close {
  position: absolute; top: -10px; right: -10px;
  width: 24px; height: 24px;
  border: var(--border); border-radius: 50%;
  background: var(--mango); color: #fff;
  font-size: 0.7rem; line-height: 1; cursor: pointer;
}
.mascot.is-collapsed .mascot__bubble { display: none; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-7px) rotate(1.5deg); }
}

/* Lob-Einblendung */
.praise {
  position: fixed;
  left: 50%; top: 1.2rem;
  transform: translateX(-50%);
  z-index: 80;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1.1rem;
  background: var(--lemon);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}
.praise img { width: 34px; }
@keyframes pop {
  from { transform: translateX(-50%) scale(0.7); opacity: 0; }
  to   { transform: translateX(-50%) scale(1); opacity: 1; }
}

.confetti {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 70;
  overflow: hidden;
}
.confetti i {
  position: absolute;
  width: 10px; height: 14px;
  border-radius: 2px;
  animation: fall 1.5s linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(540deg); opacity: 0.2; }
}

/* ---------- Anmeldung ---------- */

.gate {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 1.5rem;
}
.gate__box {
  width: min(430px, 100%);
  background: var(--card);
  border: var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  padding: 1.6rem 1.5rem;
}
.gate__mascot { width: 128px; margin: -3.6rem auto 0.4rem; display: block; filter: drop-shadow(3px 4px 0 rgba(36,28,70,0.18)); }
.gate__bubble {
  background: var(--paper-2);
  border: 2px dashed var(--grape);
  border-radius: 14px;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
  text-align: center;
}

/* ---------- Mobile Navigation ---------- */

.tabbar { display: none; }

@media (max-width: 880px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-bottom: 7.5rem; gap: 1rem; }
  .sidebar { position: static; }
  .nav { display: none; }
  .sidebar__footer { display: none; }
  .brand { margin-bottom: 0.6rem; }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 0.5rem; right: 0.5rem; bottom: 0.5rem;
    z-index: 65;
    gap: 0.25rem;
    padding: 0.4rem;
    background: #fff;
    border: var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .tabbar__item {
    display: grid; place-items: center; gap: 2px;
    padding: 0.3rem 0.1rem;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
    text-align: center;
  }
  .tabbar__item span { font-size: 1.15rem; }
  .tabbar__item[aria-current="page"] { background: var(--paper-2); }

  .mascot { bottom: 5.2rem; right: 0.6rem; }
  .mascot__figure { width: 68px; }
  .mascot__bubble { max-width: 200px; font-size: 0.86rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot__figure { animation: none; }
  .confetti { display: none; }
  * { transition: none !important; }
}

@media print {
  .sidebar, .tabbar, .mascot, .praise { display: none; }
  body { background: #fff; }
}
