/* ════════════════════════════════════════════════════════════════════════════
   TaskFlow – Designsystem „Warmes Glas"
   Heller Grau-Gelb-Verlauf · Glaskarten · Graphit für Aktionen · Gelb für
   Fortschritt und Belohnung. Pillenformen statt Ecken.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Schrift (selbst gehostet wegen CSP default-src 'self') ── */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Variablen ── */
:root {
  /* Grund */
  --bg-1:        #E3E4E7;
  --bg-2:        #ECEBE6;
  --bg-3:        #F5EED6;
  --glass:       rgba(255,255,255,.56);
  --glass-solid: rgba(255,255,255,.78);
  --glass-line:  rgba(255,255,255,.85);
  --surface:     #FBFAF6;
  --field:       #FFFFFF;

  /* Tinte */
  --ink:         #1E1E1E;
  --ink-card:    #232323;
  --text-2:      #575757;
  --text-3:      #767676;
  --line:        rgba(30,30,30,.12);
  --line-dot:    rgba(30,30,30,.22);
  --line-strong: rgba(30,30,30,.32);

  /* Akzent */
  --accent:      #F9D65C;
  --accent-h:    #F7CF4A;
  --accent-soft: #FCEFB4;
  --accent-deep: #D9A50A;
  --coin-ring:   #C9971A;

  /* Status */
  --danger:       #B4351F;
  --danger-soft:  #F8DCD5;
  --danger-on-ink:#FFAB98;
  --success:      #3E9B3A;
  --success-text: #2D6A28;
  --success-soft: #DCF2C9;
  --neutral-soft: #E6E6E4;

  /* Aus index.php referenziert */
  --coin:          #F9D65C;
  --heatmap-empty: rgba(255,255,255,.1);

  /* Form */
  --r-pill:   999px;
  --r-sm:     14px;
  --r-md:     22px;
  --r-card:   30px;
  --r-dialog: 34px;

  /* Tiefe */
  --sh-card:   0 1px 2px rgba(30,30,30,.03), 0 10px 30px rgba(30,30,30,.05);
  --sh-hover:  0 2px 4px rgba(30,30,30,.04), 0 24px 48px rgba(30,30,30,.10);
  --sh-dialog: 0 2px 6px rgba(30,30,30,.06), 0 40px 80px rgba(30,30,30,.22);

  /* Bewegung */
  --ease-out:    cubic-bezier(.22,1,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-in:     cubic-bezier(.4,0,1,1);

  --nav-h:       78px;
  --gantt-hdr-h: 64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg-2);
  color: var(--ink);
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
h1 { font-size: 1.6rem; font-weight: 400; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; font-weight: 400; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; font-weight: 500; }

/* ── Eingaben ── */
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--field);
  border: 1.5px solid transparent; border-radius: var(--r-pill);
  padding: 0 20px; height: 52px; width: 100%; outline: none;
  transition: border-color .2s, box-shadow .25s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, textarea:hover, select:hover { box-shadow: 0 6px 18px rgba(30,30,30,.06); }
input:focus, textarea:focus, select:focus {
  border-color: var(--ink); box-shadow: 0 0 0 4px rgba(249,214,92,.55);
}
textarea {
  resize: none; min-height: 96px; height: auto; overflow: hidden;
  border-radius: var(--r-md); padding: 14px 20px; line-height: 1.5;
}
select {
  cursor: pointer; appearance: none; -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E1E1E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 15px;
}
input[type=date] { color-scheme: light; }
input[type=range] {
  -webkit-appearance: none; appearance: none;
  background: var(--line); border: none; padding: 0;
  height: 4px; border-radius: var(--r-pill); cursor: pointer;
}
input[type=range]:hover, input[type=range]:focus { box-shadow: none; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 4px solid var(--accent); cursor: pointer;
  transition: transform .2s var(--ease-spring);
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); border: 4px solid var(--accent); cursor: pointer;
}

/* Runder Haken – Aufgabe erledigen */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 26px !important; height: 26px;
  min-width: 26px; min-height: 26px; max-width: 26px; max-height: 26px;
  padding: 0 !important; flex-shrink: 0; flex-grow: 0;
  border-radius: 50%; border: 1.5px solid var(--line-strong);
  background: var(--field); cursor: pointer; position: relative;
  box-shadow: none;
  transition: background-color .22s, border-color .22s, transform .25s var(--ease-spring);
}
input[type=checkbox]:hover { border-color: var(--ink); transform: scale(1.08); box-shadow: none; }
input[type=checkbox]::after {
  content: ''; position: absolute; left: 8px; top: 4px;
  width: 7px; height: 12px;
  border: 2.6px solid var(--ink); border-top: none; border-left: none;
  border-radius: 1px;
  transform: rotate(45deg) scale(0); transform-origin: 60% 60%;
  opacity: 0;
  transition: transform .3s var(--ease-spring) .05s, opacity .15s;
}
input[type=checkbox]:checked {
  background: var(--accent); border-color: var(--accent);
  animation: checkPop .5s var(--ease-spring);
}
input[type=checkbox]:checked::after { transform: rotate(45deg) scale(1); opacity: 1; }
/* Eckige Variante im Formular */
.login-remember input[type=checkbox],
.checkbox-label input[type=checkbox] {
  width: 24px !important; height: 24px;
  min-width: 24px; min-height: 24px; max-width: 24px; max-height: 24px;
  border-radius: 8px;
}
.login-remember input[type=checkbox]::after,
.checkbox-label input[type=checkbox]::after { left: 7.5px; top: 3.5px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(30,30,30,.18); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(30,30,30,.32); background-clip: content-box; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 52px; padding: 0 24px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: transform .18s var(--ease-out), box-shadow .25s, background-color .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2C2C2C; box-shadow: 0 12px 28px rgba(30,30,30,.24); }
.btn-secondary { background: var(--glass-solid); border: 1px solid var(--glass-line); color: var(--ink); }
.btn-secondary:hover { background: #fff; box-shadow: 0 10px 24px rgba(30,30,30,.08); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9E2F1D; box-shadow: 0 12px 28px rgba(180,53,31,.26); }
.btn-ghost { background: rgba(30,30,30,.06); color: var(--ink); }
.btn-ghost:hover { background: rgba(30,30,30,.1); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; gap: 8px; }

/* Gelber Kreis um das führende Plus */
.btn-primary > svg:first-child {
  width: 32px; height: 32px; margin-left: -14px; padding: 8px;
  border-radius: 50%; background: var(--accent); color: var(--ink);
  flex-shrink: 0; transition: transform .45s var(--ease-spring);
}
.btn-primary:hover > svg:first-child { transform: rotate(90deg); }

.btn-icon {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); flex-shrink: 0;
  transition: background-color .2s, color .2s, transform .18s;
}
.btn-icon:hover { background: rgba(30,30,30,.07); }
.btn-icon:active { transform: scale(.9); }
.btn-icon[style*="--danger"]:hover, .btn-icon.danger:hover { background: var(--danger-soft); }

/* ── Grundgerüst ── */
/* Die ganze Seite scrollt – die Kopfzeile fährt mit, nichts bricht an einer
   Kante ab. Der Verlauf bleibt dabei am Sichtfenster verankert. */
.app {
  display: flex; flex-direction: column; min-height: 100dvh;
  background:
    radial-gradient(1100px 620px at 100% 0%, rgba(249,214,92,.42), rgba(249,214,92,0) 62%),
    radial-gradient(900px 560px at 70% 100%, rgba(249,214,92,.26), rgba(249,214,92,0) 60%),
    linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
  background-attachment: fixed;
}

/* ── Kopfzeile (Desktop) – nutzt die Sidebar-Struktur ── */
.sidebar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 16px; padding: 22px clamp(16px, 3vw, 40px) 10px;
  flex-shrink: 0; background: none; border: none; width: auto;
}
.sidebar-logo {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 26px 0 9px;
  border: 1.5px solid rgba(30,30,30,.6); border-radius: var(--r-pill);
  font-size: 25px; font-weight: 400; letter-spacing: -.01em; color: var(--ink);
}
.sidebar-logo svg, .sidebar-logo img { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.sidebar-nav {
  justify-self: center;
  display: flex; flex-direction: row; gap: 2px; padding: 6px; overflow: visible;
  background: rgba(255,255,255,.6); border: 1px solid var(--glass-line);
  border-radius: var(--r-pill); flex: 0 0 auto;
}
.nav-item {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 20px; border-radius: var(--r-pill);
  color: var(--ink); font-weight: 400; font-size: 15px; cursor: pointer;
  white-space: nowrap;
  transition: background-color .25s var(--ease-out), color .25s;
}
.nav-item:hover { background: rgba(30,30,30,.07); }
.nav-item.active { background: var(--ink); color: #fff; animation: navIn .45s var(--ease-spring); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-right { justify-self: end; display: flex; align-items: center; gap: 8px; }
.coin-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 18px 0 14px; border-radius: var(--r-pill);
  background: var(--glass-solid); border: 1px solid var(--glass-line);
  font-size: 15px; font-weight: 500; color: var(--ink); white-space: nowrap;
  transition: background-color .2s, box-shadow .25s, transform .18s var(--ease-out);
}
.coin-pill:hover { background: #fff; box-shadow: 0 10px 24px rgba(30,30,30,.08); }
.coin-pill:active { transform: scale(.97); }

.sidebar-user {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 18px 0 6px; border-radius: var(--r-pill);
  background: var(--glass-solid); border: 1px solid var(--glass-line);
  cursor: pointer;
  transition: background-color .2s, box-shadow .25s, transform .18s var(--ease-out);
}
.sidebar-user:hover { background: #fff; box-shadow: 0 10px 24px rgba(30,30,30,.08); }
.sidebar-user:active { transform: scale(.98); }
.sidebar-user.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sidebar-user.active .user-avatar { background: var(--accent); color: var(--ink); }

.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 17px; flex-shrink: 0;
}
img.user-avatar { object-fit: cover; color: transparent; }
.user-info { min-width: 0; display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 400; font-size: 15px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.user-coins {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px 0 8px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--ink);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.sidebar-user.active .user-coins { background: var(--accent); color: var(--ink); }
.user-coins svg { flex-shrink: 0; }
.coin-bump { animation: coinBump .5s var(--ease-spring); }

/* ── Hauptbereich ── */
.main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.topbar {
  display: none; height: 64px; padding: 10px 16px 0;
  align-items: center; justify-content: space-between;
  border: none; background: none; flex-shrink: 0;
}
.topbar-brand {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px 0 6px;
  border: 1.5px solid rgba(30,30,30,.6); border-radius: var(--r-pill);
  font-size: 19px; font-weight: 400; color: var(--ink);
}
.topbar-brand svg, .topbar-brand img { width: 34px; height: 34px; border-radius: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar .btn-icon { width: 44px; height: 44px; background: var(--glass-solid); }
.topbar .btn-icon:hover { background: #fff; }
.topbar-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink); color: var(--accent);
  font-weight: 500; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0; overflow: hidden;
}
.topbar-avatar:hover { background: #2C2C2C; }
.topbar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.content { flex: 1; padding: 8px clamp(16px, 3vw, 40px) 64px; }
.view { display: none; max-width: 1360px; margin: 0 auto; }
.view.active { display: block; }

/* Eintritts-Animation nur beim Seitenwechsel, nicht bei jedem Neuzeichnen */
.view.is-entering > *,
.view.is-entering > #dashContent > * { animation: rise .6s var(--ease-out) backwards; }
.view.is-entering > *:nth-child(1),
.view.is-entering > #dashContent > *:nth-child(1) { animation-delay: .02s; }
.view.is-entering > *:nth-child(2),
.view.is-entering > #dashContent > *:nth-child(2) { animation-delay: .07s; }
.view.is-entering > *:nth-child(3),
.view.is-entering > #dashContent > *:nth-child(3) { animation-delay: .12s; }
.view.is-entering > *:nth-child(4),
.view.is-entering > #dashContent > *:nth-child(4) { animation-delay: .17s; }
.view.is-entering > *:nth-child(5),
.view.is-entering > #dashContent > *:nth-child(5) { animation-delay: .22s; }
.view.is-entering > *:nth-child(n+6),
.view.is-entering > #dashContent > *:nth-child(n+6) { animation-delay: .27s; }

/* ── Untere Navigation (mobil) ── */
.bottom-nav {
  display: none; height: auto; border: none; background: none;
  padding: 0 14px calc(14px + env(safe-area-inset-bottom)); flex-shrink: 0;
}
.bottom-nav-inner {
  display: flex; height: 70px; align-items: center; gap: 4px; padding: 7px;
  border-radius: var(--r-pill); background: var(--ink);
  box-shadow: 0 18px 40px rgba(30,30,30,.3);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; height: 56px; border-radius: var(--r-pill);
  color: rgba(255,255,255,.75); cursor: pointer; font-size: 11px;
  transition: color .2s, flex-grow .4s var(--ease-out);
}
.bottom-nav-item.active {
  flex-grow: 1.6; flex-direction: row; gap: 8px;
  background: var(--accent); color: var(--ink);
  font-size: 13.5px; font-weight: 500;
  animation: navIn .45s var(--ease-spring);
}
.bottom-nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Seitenkopf ── */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 26px; gap: 20px; flex-wrap: wrap; padding-top: 6px;
}
.page-title {
  font-size: clamp(40px, 5vw, 66px); font-weight: 300;
  letter-spacing: -.035em; line-height: 1;
}
.page-sub { color: var(--text-2); font-size: 15px; margin-top: 12px; }
.sprint-info {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--glass-solid); color: var(--ink); font-size: 14px;
}
.sprint-info::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-deep); flex-shrink: 0;
}

/* ── Karten ── */
.stat-card, .task-card, .no-dates-note, .empty-state, .gantt-container, .tasks-list {
  background: var(--glass); border: 1px solid var(--glass-line);
  border-radius: var(--r-card); box-shadow: var(--sh-card);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

/* ── Kennzahlen ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.stat-card { padding: 20px 24px; }
/* Kartenüberschrift – gleiche Größe wie die Abschnittstitel */
.stat-label {
  font-size: 24px; font-weight: 400; color: var(--ink);
  letter-spacing: -.01em; line-height: 1.2; margin-bottom: 10px;
  display: flex; align-items: center; gap: 9px;
}
.stat-value { font-size: 3.2rem; font-weight: 300; line-height: 1; letter-spacing: -.04em; color: var(--ink); }
.stat-value.c-primary, .stat-value.c-success, .stat-value.c-warning, .stat-value.c-coin { color: var(--ink); }
.stat-value.c-danger { color: var(--danger); }
.coin-breakdown {
  font-size: 13px; color: var(--text-2); margin-top: 10px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.coin-breakdown span { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }

.coin-card { display: flex; flex-direction: column; }
.coin-note { font-size: 13.5px; color: var(--text-2); margin: 10px 0 0; }
.coin-bars { display: flex; gap: 4px; margin-top: auto; padding-top: 20px; }
.coin-bar {
  flex: 1 1 0; min-width: 72px; display: flex; flex-direction: column; gap: 10px;
  transition: flex-grow .8s var(--ease-out);
}
.coin-bar-head {
  display: flex; flex-direction: column; gap: 2px; padding: 0 0 6px 10px;
  border-left: 1.5px solid var(--line-strong);
}
.coin-bar-value { font-size: 20px; line-height: 1.2; }
.coin-bar-label { font-size: 12.5px; color: var(--text-2); }
.coin-bar-fill { height: 46px; border-radius: var(--r-pill); }
.coin-bar-fill.c1 { background: var(--accent); }
.coin-bar-fill.c2 { background: var(--ink); }
.coin-bar-fill.c3 { background: #8E8E8E; }

/* ── Übersicht: Kennzahlen als freistehende Zahlen ── */
.dash-head { align-items: flex-end; gap: 32px; }
.kpi-row { display: flex; gap: clamp(20px, 3.2vw, 48px); flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi-top { display: flex; align-items: flex-start; gap: 8px; }
.kpi-icon {
  width: 30px; height: 30px; margin-top: 12px; border-radius: 50%;
  background: rgba(255,255,255,.75); color: var(--ink); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.kpi-value { font-size: clamp(44px, 4.6vw, 70px); font-weight: 300; letter-spacing: -.04em; line-height: 1; }
.kpi-label { font-size: 14px; color: var(--text-2); padding-left: 38px; }
.kpi-danger .kpi-icon { background: var(--danger-soft); color: var(--danger); }
.kpi-danger .kpi-value { color: var(--danger); }

/* ── Übersicht: Fortschrittsband + Hauptaktion ── */
.dash-bar { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.seg-bar { flex: 1 1 520px; display: flex; gap: 6px; min-width: 0; }
.seg-col {
  flex-basis: 0; min-width: 96px; display: flex; flex-direction: column; gap: 10px;
  transition: flex-grow .8s var(--ease-out);
}
.seg-label { font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg {
  height: 52px; border-radius: var(--r-pill); display: flex; align-items: center;
  padding: 0 18px; font-size: 14px; font-weight: 500;
}
.seg-done  { background: var(--ink); color: #fff; }
.seg-track { background: var(--accent); color: var(--ink); }
.seg-late  {
  background:
    repeating-linear-gradient(-45deg, rgba(30,30,30,0) 0 7px, rgba(30,30,30,.16) 7px 9px),
    rgba(255,255,255,.55);
  box-shadow: inset 0 0 0 1px rgba(30,30,30,.14); color: var(--ink);
}
.seg-empty {
  background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(30,30,30,.14);
  color: var(--text-2); font-weight: 400;
}

/* ── Übersicht: Aufgabenspalten ── */
.dash-lists { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.up-card {
  flex: 2 1 580px; min-width: 0; padding: 24px 28px 14px;
  background: var(--glass); border: 1px solid var(--glass-line);
  border-radius: var(--r-card); box-shadow: var(--sh-card);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.up-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.up-title { display: flex; align-items: center; gap: 12px; }
.up-title h2 { font-size: 24px; font-weight: 400; letter-spacing: -.01em; }
.count-chip {
  height: 28px; min-width: 28px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pill-link {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 8px 0 18px; border-radius: var(--r-pill);
  background: var(--glass-solid); border: 1px solid var(--glass-line);
  font-size: 15px; font-weight: 500; color: var(--ink);
  transition: background-color .2s, box-shadow .25s, transform .18s var(--ease-out);
}
.pill-link:hover { background: #fff; box-shadow: 0 10px 24px rgba(30,30,30,.08); }
.pill-link:active { transform: scale(.97); }
.pill-arrow {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.pill-arrow svg { transition: transform .45s var(--ease-spring); }
.pill-link:hover .pill-arrow svg { transform: rotate(45deg); }
/* Die Liste sitzt schon in der Karte – kein zweiter Kartenhintergrund */
.up-card .tasks-list {
  background: none; border: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0;
}
.up-card .tasks-grid { padding: 4px 0 10px; }
.up-card .empty-state { background: none; border: none; box-shadow: none; backdrop-filter: none; padding: 32px 16px; }

.od-wrap { flex: 1 1 320px; min-width: 0; position: relative; padding-top: 12px; }
.od-wrap::before {                       /* angedeutete Karte darunter */
  content: ''; position: absolute; left: 22px; right: 22px; top: 0; height: 60px;
  border-radius: 26px; background: #8B8B8B; opacity: .5;
}
.od-card {
  position: relative; padding: 24px 26px 10px;
  background: var(--ink-card); border: 1px solid #2F2F2F; color: #fff;
  border-radius: var(--r-card); box-shadow: var(--sh-card);
}
.od-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.od-head h2 { font-size: 24px; font-weight: 400; letter-spacing: -.01em; }
.od-count { font-size: 46px; font-weight: 300; line-height: 1; letter-spacing: -.03em; }
.od-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px dotted rgba(255,255,255,.2);
}
.od-row:last-child { border-bottom: none; }
.od-icon {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: #fff; color: var(--danger);
  display: inline-flex; align-items: center; justify-content: center;
}
.od-icon-ok { background: var(--accent); color: var(--ink); }
.od-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.od-title {
  font-size: 15.5px; word-break: break-word;
  text-decoration: line-through; text-decoration-color: transparent;
  transition: text-decoration-color .45s var(--ease-out), color .3s;
}
.od-meta { font-size: 13px; color: var(--danger-on-ink); }
.od-check { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.42); }
.od-check:hover { border-color: #fff; }
.od-check:checked { background: var(--accent); border-color: var(--accent); }
.od-empty { display: flex; align-items: center; gap: 14px; padding: 16px 0 14px; font-size: 15px; color: rgba(255,255,255,.82); }

/* ── Münz-Block, Heatmap, Achievements ── */
.coin-stats-wrapper { display: flex; gap: 20px; margin-bottom: 28px; align-items: stretch; flex-wrap: wrap; }
.coin-stats-wrapper > .stat-card:first-child { flex: 1 1 260px; min-width: 240px; }
.heatmap-card {
  flex: 1 1 420px; display: flex; flex-direction: column; justify-content: center;
  background: var(--ink-card); border-color: #2F2F2F; color: #fff;
}
.heatmap-card { justify-content: flex-start; }
.heatmap-card .stat-label { color: #fff; margin: 0; }
.heatmap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.heatmap-note { font-size: 13px; color: rgba(255,255,255,.66); white-space: nowrap; }
.heatmap-spacer { flex: 1; min-height: 12px; }
.heatmap-months {
  display: grid; grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 6px; margin-top: 6px; font-size: 11px; color: rgba(255,255,255,.66);
}
.heatmap-months span { white-space: nowrap; }
.heatmap-grid {
  display: grid; grid-template-columns: repeat(13, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto); grid-auto-flow: column; gap: 6px; margin-top: 6px;
}
.heatmap-cell {
  width: auto; height: auto; aspect-ratio: 1 / 1; border-radius: 50%;
  transition: transform .2s var(--ease-spring);
}
.heatmap-cell:hover { transform: scale(1.35); opacity: 1; }
.heatmap-legend {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  margin-top: 12px; font-size: 12px; color: rgba(255,255,255,.66);
}
.heatmap-legend .heatmap-cell { width: 12px; height: 12px; aspect-ratio: auto; }

.achievements-card { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; }
.achievement-system { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.achievement-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; align-content: center; flex: 1;
}
.achievement {
  width: auto; height: auto; border-radius: 20px; overflow: visible; background: none;
  display: flex; align-items: center; justify-content: center; padding: 4px;
  transition: transform .45s var(--ease-spring);
}
.achievement img { width: 100%; height: auto; object-fit: contain; display: block; }
.achievement:hover { transform: translateY(-4px) rotate(-4deg) scale(1.07); }
.achievement.locked { background: rgba(30,30,30,.05); }
.achievement.locked img { filter: grayscale(1) brightness(.95); opacity: .45; }
.achievement.locked:hover { transform: none; }

.achievement-progress { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.achievement-progress-head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--text-2);
}
.achievement-bar { height: 8px; border-radius: var(--r-pill); background: rgba(30,30,30,.08); overflow: hidden; }
.achievement-bar > span {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: var(--ink); transition: width .9s var(--ease-out);
}

/* ── Abschnitte ── */
.section-title {
  font-size: 26px; font-weight: 400; color: var(--ink); letter-spacing: -.01em;
  margin: 28px 0 16px; display: flex; align-items: center; gap: 12px;
}
.section-subtitle {
  font-size: 14px; font-weight: 400; color: var(--text-2);
  text-transform: none; letter-spacing: 0; margin: 22px 0 12px;
  display: flex; align-items: center; gap: 12px;
}
.section-subtitle::after { content: ''; flex: 1; border-top: 1px dotted var(--line-dot); }
.divider { height: 0; border-top: 1px dotted var(--line-dot); margin: 28px 0; }

/* ── „Mehr laden“ (Paginierung) ── */
.load-more { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 24px 0 0; }
.load-more-hint { font-size: 14px; color: var(--text-2); margin: 0; }

/* ── Aufgabenkarten ── */
.tasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.task-card {
  border-radius: 26px; padding: 20px 20px 18px 22px;
  display: flex; flex-direction: column; gap: 12px; position: relative;
  transition: transform .4s var(--ease-out), box-shadow .4s, opacity .45s;
}
.task-card:hover { transform: translateY(-4px); box-shadow: var(--sh-hover); }
.task-card.completed { opacity: .62; }
.task-card.completed:hover { opacity: 1; }
.task-card-header { display: flex; align-items: center; gap: 14px; margin: 0; }
.task-card-check { margin: 0; }
.task-card-title {
  flex: 1; font-weight: 500; font-size: 16px; line-height: 1.35; word-break: break-word;
  text-decoration: line-through; text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color .45s var(--ease-out), color .3s;
}
.task-card.completed .task-card-title { text-decoration-color: currentColor; color: var(--text-3); }
.task-card-actions { display: flex; gap: 2px; flex-shrink: 0; margin: -4px -8px 0 0; opacity: 0; transform: translateX(8px); transition: opacity .2s, transform .3s var(--ease-out); }
.task-card:hover .task-card-actions, .task-card:focus-within .task-card-actions { opacity: 1; transform: none; }
.task-card-desc {
  font-size: 14px; color: var(--text-2); margin: 0; line-height: 1.45; padding-left: 40px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task-card-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: auto; padding-top: 12px; border-top: 1px dotted var(--line-dot);
}
.task-card-footer .task-tags { margin-left: auto; }
.task-date {
  font-size: 13px; color: var(--ink); display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 11px; border-radius: var(--r-pill); background: rgba(30,30,30,.05);
}
.task-date.overdue { background: var(--danger-soft); color: var(--danger); }
.workdays-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px;
  font-size: 12.5px; font-weight: 500; color: inherit; white-space: nowrap;
}
.workdays-badge.overdue { color: var(--danger); }
.task-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; padding: 3px 10px 3px 8px;
  border-radius: var(--r-pill); color: var(--ink); white-space: nowrap;
  box-shadow: inset 0 0 0 100px rgba(255,255,255,.78);
}
.tag-pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--dot, currentColor);
}

/* ── Aufgabenliste ── */
.tasks-list { display: flex; flex-direction: column; padding: 6px 26px; gap: 0; }
.task-row {
  background: none; border: none; border-bottom: 1px dotted var(--line-dot);
  border-radius: var(--r-md); padding: 14px 16px; margin: 0 -16px;
  display: flex; align-items: center; gap: 18px;
  transition: background-color .25s, opacity .45s;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: rgba(255,255,255,.82); }
.task-row.completed { opacity: .62; }
.task-row.completed:hover { opacity: 1; }
.task-row-title {
  flex: 1; font-weight: 400; font-size: 16px; min-width: 0;
  text-decoration: line-through; text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color .45s var(--ease-out), color .3s;
}
.task-row.completed .task-row-title { text-decoration-color: currentColor; color: var(--text-3); }
.task-row-date {
  font-size: 13px; color: var(--ink); white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 11px; border-radius: var(--r-pill); background: rgba(30,30,30,.05);
}
.task-row-date.overdue { background: var(--danger-soft); color: var(--danger); }
.task-row-tags { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
/* Aktionen: in Aufgabenlisten erst beim Überfahren, in der Benutzerliste immer */
.task-row-actions { display: flex; gap: 4px; flex-shrink: 0; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
#view-tasks .task-row-actions,
#view-dashboard .task-row-actions {
  opacity: 0; transform: translateX(8px);
  transition: opacity .2s, transform .3s var(--ease-out);
}
#view-tasks .task-row:hover .task-row-actions,
#view-tasks .task-row:focus-within .task-row-actions,
#view-dashboard .task-row:hover .task-row-actions,
#view-dashboard .task-row:focus-within .task-row-actions { opacity: 1; transform: none; }
#view-users .task-row { gap: 14px; }
#view-users .task-row-title { flex: 1 1 200px; }
#view-users .task-row-actions .btn-sm { background: #fff; border: none; }
#view-users .task-row-actions .btn-sm:hover { box-shadow: 0 6px 16px rgba(30,30,30,.1); }

/* Münz-Flug beim Abhaken */
.coin-fly {
  position: fixed; z-index: 2000; transform: translate(-50%, 0);
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--accent);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none;
  animation: coinFly 1.05s var(--ease-out) forwards;
}

/* ── Werkzeugleiste ── */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 24px; padding: 12px;
  background: var(--glass); border: 1px solid var(--glass-line);
  border-radius: var(--r-pill); box-shadow: var(--sh-card);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.toolbar-search { position: relative; flex: 1 1 240px; min-width: 200px; }
.toolbar-search input { padding-left: 48px; height: 48px; }
.toolbar-search-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--ink); pointer-events: none; display: flex;
}
.view-toggle {
  display: flex; gap: 2px; background: var(--field);
  border: none; border-radius: var(--r-pill); overflow: hidden; padding: 4px;
}
.view-toggle button {
  width: 48px; height: 40px; border-radius: var(--r-pill); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .3s var(--ease-out), color .3s;
}
.view-toggle button:hover { background: rgba(30,30,30,.06); }
.view-toggle button.active { background: var(--ink); color: #fff; }
.sort-select {
  background-color: var(--field); border: 1.5px solid transparent;
  border-radius: var(--r-pill); height: 48px; padding: 0 44px 0 18px;
  color: var(--ink); cursor: pointer; width: auto; flex-shrink: 0;
}
#sortDirBtn { flex-shrink: 0; background: var(--field); border: none; height: 48px; }
#sortDirBtn:hover { background: #fff; box-shadow: 0 6px 18px rgba(30,30,30,.07); }

/* ── Dialoge ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(30,30,30,.30);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; animation: fadeIn .25s ease; }
.modal-overlay.closing { animation: fadeOut .2s ease forwards; }
.modal {
  background: var(--surface); border: none;
  border-radius: var(--r-dialog); width: 100%; max-width: 580px;
  max-height: 90dvh; display: flex; flex-direction: column;
  box-shadow: var(--sh-dialog);
  animation: modalIn .45s var(--ease-out);
}
.modal-overlay.closing .modal { animation: modalOut .2s var(--ease-in) forwards; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 24px 6px 32px; flex-shrink: 0; gap: 12px;
}
.modal-header h2 { font-size: 30px; font-weight: 300; letter-spacing: -.02em; }
.modal-header .btn-icon { width: 44px; height: 44px; background: rgba(30,30,30,.06); }
.modal-header .btn-icon:hover { background: rgba(30,30,30,.12); transform: rotate(90deg); }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 32px 8px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 28px 28px; border: none; flex-shrink: 0;
}
.form-group { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.form-group label { display: block; font-size: 14px; font-weight: 400; color: var(--text-2); margin: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Bestätigungsdialog (ersetzt confirm) ── */
.confirm-modal { max-width: 470px; }
.confirm-body { display: flex; gap: 18px; padding: 30px 32px 6px; align-items: flex-start; }
.confirm-icon {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--accent);
}
.confirm-modal.danger .confirm-icon { background: var(--danger-soft); color: var(--danger); }
.confirm-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.confirm-title { font-size: 26px; font-weight: 300; letter-spacing: -.02em; line-height: 1.15; }
.confirm-msg { font-size: 15px; color: var(--text-2); white-space: pre-line; }

/* ── Toasts (ersetzen alert) ── */
.toast-wrap {
  position: fixed; right: 28px; bottom: 28px; z-index: 3000;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 360px; max-width: calc(100vw - 32px);
  padding: 15px 14px 15px 16px; border-radius: var(--r-md);
  background: var(--ink); color: #fff;
  box-shadow: 0 24px 48px rgba(30,30,30,.28);
  overflow: hidden; pointer-events: auto;
  animation: toastIn .55s var(--ease-out);
}
.toast.closing { animation: toastOut .3s var(--ease-in) forwards; }
.toast-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--ink);
}
.toast.error { background: #fff; color: var(--ink); border: 1.5px solid #F2C3B8; }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast-msg { flex: 1; font-size: 15px; min-width: 0; }
.toast-close {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.7); transition: background-color .2s, color .2s;
}
.toast-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.toast.error .toast-close { color: var(--text-3); }
.toast.error .toast-close:hover { background: rgba(30,30,30,.08); color: var(--ink); }
.toast-bar {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--accent); transform-origin: left;
  animation: toastDrain 3.6s linear forwards;
}
.toast.error .toast-bar { background: var(--danger); }

/* ── Datumsbereich ── */
.date-range-wrap { position: relative; }
.date-range-field {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; height: 52px; padding: 0 20px; border-radius: var(--r-pill);
  background: var(--field); border: 1.5px solid transparent;
  color: var(--ink); font-size: 15.5px; text-align: left;
  transition: border-color .2s, box-shadow .25s;
}
.date-range-field:hover { box-shadow: 0 6px 18px rgba(30,30,30,.06); }
.date-range-field:focus, .date-range-field.open {
  border-color: var(--ink); box-shadow: 0 0 0 4px rgba(249,214,92,.55); outline: none;
}
.date-range-field svg { flex-shrink: 0; transition: transform .3s var(--ease-spring); }
.date-range-field.open svg { transform: scale(1.15); }
.datepicker-overlay { z-index: 1100; background: rgba(30,30,30,.2); backdrop-filter: blur(3px); }
.datepicker-card {
  background: var(--field); border: none;
  border-radius: var(--r-card); padding: 20px; box-shadow: var(--sh-dialog);
  user-select: none; animation: modalIn .4s var(--ease-out);
}
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month-label { font-weight: 500; font-size: 17px; }
.cal-nav {
  font-size: 18px; line-height: 1; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(30,30,30,.05); color: var(--ink);
}
.cal-nav:hover { background: rgba(30,30,30,.1); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 46px); margin-bottom: 4px; }
.cal-wd { width: 46px; text-align: center; font-size: 12.5px; color: var(--text-2); font-weight: 400; padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 46px); row-gap: 2px; }
.cal-day {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; margin: 2px; border-radius: 50%; font-size: 14.5px;
  color: var(--ink);
  transition: background-color .2s, color .2s, transform .2s var(--ease-spring);
}
.cal-day:hover { background: rgba(30,30,30,.08); }
.cal-day:active { transform: scale(.88); }
.cal-day.muted { color: #9A9A9A; opacity: 1; }
.cal-day.today { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-day.in-range {
  background: var(--accent-soft); border-radius: 0; color: var(--ink);
  width: 46px; height: 46px; margin: 0;
}
.cal-day.range-start, .cal-day.range-end {
  background: var(--ink); color: #fff; border-radius: 50%; transform: scale(1.04);
  box-shadow: none;
}
.cal-day.range-start:hover, .cal-day.range-end:hover { background: #2C2C2C; }
.cal-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; border-top: 1px dotted var(--line-dot); padding-top: 12px;
}

/* ── Tag-Auswahl ── */
.tag-selector-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.tag-option {
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 4px 0 0; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; border: none;
  color: var(--ink); opacity: 1;
  box-shadow: inset 0 0 0 100px rgba(255,255,255,.78);
  transition: color .25s, box-shadow .25s;
}
.tag-option:hover { box-shadow: inset 0 0 0 100px rgba(255,255,255,.66); }
.tag-option.selected {
  color: #fff; box-shadow: inset 0 0 0 100px var(--ink);
  animation: tagPop .35s var(--ease-spring);
}
.tag-option-sel {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 6px 0 13px; border-radius: var(--r-pill);
  color: inherit; font: inherit; font-weight: 500;
}
.tag-option-sel::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--dot, currentColor);
}
.tag-option.selected .tag-option-sel::after {
  content: ''; width: 6px; height: 11px; margin-left: 2px; flex-shrink: 0;
  border: 2.4px solid var(--accent); border-top: none; border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.tag-option-del {
  width: 32px; height: 32px; border-radius: 50%; opacity: .5; color: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity .2s, background-color .2s;
}
.tag-option-del:hover { opacity: 1; background: rgba(30,30,30,.1); }
.tag-option.selected .tag-option-del:hover { background: rgba(255,255,255,.22); }
.tag-create-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
  grid-template-areas: "input button" "swatches swatches";
  align-items: center; margin-top: 12px;
  padding: 8px; border-radius: var(--r-md); background: rgba(30,30,30,.04);
}
.tag-create-row input { grid-area: input; max-width: none; height: 44px; }
.tag-create-row .btn {
  grid-area: button; width: 44px; height: 44px; padding: 0;
  background: var(--accent); color: var(--ink); border: none; flex-shrink: 0;
}
.tag-create-row .btn:hover { background: var(--accent-h); transform: rotate(90deg); }
.color-swatches {
  grid-area: swatches; display: flex; gap: 5px; flex-wrap: wrap;
  margin: 0; padding: 2px 6px 2px 10px; justify-content: space-between;
}
.color-swatch {
  width: 30px; height: 30px; padding: 0; border-radius: 50%; cursor: pointer;
  border: none; flex-shrink: 0;
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.selected {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink);
}

/* ── Leerzustand ── */
.empty-state {
  text-align: center; padding: 60px 24px; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: emptyIn .6s var(--ease-spring);
}
.empty-state svg {
  width: 88px; height: 88px; padding: 25px; margin: 0; opacity: 1;
  border-radius: 50%; background: var(--accent); color: var(--ink); stroke-width: 1.5;
}
.empty-state h3 { color: var(--ink); margin: 0; font-size: 26px; font-weight: 400; }
.empty-state p { font-size: 15px; max-width: 380px; }
.no-dates-note {
  border-radius: var(--r-md); padding: 14px 20px; font-size: 14px;
  color: var(--text-2); margin-top: 14px;
}

/* ── Anmeldung ── */
.login-wrap {
  position: relative; overflow: hidden;
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px; padding: 40px 16px;
  background:
    radial-gradient(1000px 640px at 100% 0%, rgba(249,214,92,.5), rgba(249,214,92,0) 62%),
    radial-gradient(800px 560px at 0% 100%, rgba(249,214,92,.28), rgba(249,214,92,0) 60%),
    linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
}
.login-deco { position: absolute; border-radius: var(--r-pill); pointer-events: none; animation: floaty 6s ease-in-out infinite alternate; }
.login-card {
  position: relative; background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9);
  border-radius: 36px; padding: 38px 36px 34px; width: 100%; max-width: 460px;
  box-shadow: 0 2px 4px rgba(30,30,30,.03), 0 30px 60px rgba(30,30,30,.10);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: rise .8s var(--ease-out) .08s backwards;
}
.login-card.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97); }
.login-logo {
  display: inline-flex; align-items: center; gap: 12px; margin: 0;
  height: 60px; padding: 0 28px 0 10px;
  border: 1.5px solid rgba(30,30,30,.6); border-radius: var(--r-pill);
  background: rgba(255,255,255,.35); position: relative;
  animation: rise .8s var(--ease-out) backwards;
}
.login-logo svg, .login-logo img { width: 42px; height: 42px; border-radius: 11px; }
.login-logo span { font-size: 27px; font-weight: 400; letter-spacing: -.01em; color: var(--ink); }
.login-title { font-size: 40px; font-weight: 300; letter-spacing: -.03em; line-height: 1.05; margin-bottom: 22px; }
.login-error {
  display: flex; align-items: center; gap: 10px;
  background: var(--danger-soft); border: none; color: #8A2615;
  padding: 12px 16px; border-radius: 18px; margin-bottom: 18px; font-size: 14.5px;
  animation: errIn .35s var(--ease-out);
}
.login-2fa-hint { font-size: 15px; color: var(--text-2); margin-bottom: 22px; text-align: left; }
.login-remember {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px;
  font-size: 15px; color: var(--ink); cursor: pointer; min-height: 44px;
}
.login-remember input { width: auto; cursor: pointer; }
.login-btn { width: 100%; height: 56px; font-size: 16px; }
.login-card .form-group input { height: 54px; font-size: 16px; }
#twoFaCode { text-align: center; font-size: 22px; letter-spacing: .25em; height: 64px; }
#twoFaCode::placeholder { font-size: 15px; letter-spacing: 0; }

/* ── Gantt ── */
.gantt-wrap { display: flex; flex-direction: column; height: calc(100dvh - 240px); min-height: 320px; }
.gantt-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px; margin-bottom: 18px; flex-shrink: 0;
  background: var(--glass); border: 1px solid var(--glass-line);
  border-radius: var(--r-pill); box-shadow: var(--sh-card);
}
.gantt-toolbar .btn-secondary {
  height: 44px; min-width: 44px; padding: 0 16px; background: var(--field); border: none;
}
.gantt-toolbar .btn-secondary:hover { background: #fff; box-shadow: 0 6px 18px rgba(30,30,30,.08); }
.gantt-toolbar input[type=range] { margin: 0 4px; }
.gantt-toolbar .text-small { color: var(--text-2); padding: 0 6px; }
.gantt-switch {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  height: 44px; padding: 0 16px 0 8px; border-radius: var(--r-pill);
  background: var(--field); font-size: 14.5px; color: var(--ink); user-select: none;
}
.gantt-switch-input { display: none; }
.gantt-switch-track {
  position: relative; width: 46px; height: 28px; border-radius: var(--r-pill);
  background: rgba(30,30,30,.16); border: none; flex-shrink: 0;
  transition: background-color .3s;
}
.gantt-switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(30,30,30,.25);
  transition: transform .4s var(--ease-spring), background-color .3s;
}
.gantt-switch-input:checked + .gantt-switch-track { background: var(--ink); }
.gantt-switch-input:checked + .gantt-switch-track::after { transform: translateX(18px); background: var(--accent); }

.gantt-container { flex: 1; display: flex; overflow: hidden; border-radius: var(--r-card); }
.gantt-sidebar-wrap {
  width: 200px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: rgba(255,255,255,.35); overflow: hidden;
}
.gantt-sidebar-hdr {
  height: var(--gantt-hdr-h); background: none; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-end; padding: 0 18px 12px;
  font-size: 13px; font-weight: 400; color: var(--text-2); flex-shrink: 0;
}
.gantt-sidebar-rows { flex: 1; overflow-y: auto; overflow-x: hidden; }
.gantt-sidebar-row {
  height: 56px; display: flex; align-items: center; gap: 10px;
  padding: 0 12px 0 10px; border-bottom: 1px dotted rgba(30,30,30,.14);
  cursor: grab; transition: background-color .2s, opacity .2s, box-shadow .2s;
}
.gantt-sidebar-row:hover { background: rgba(255,255,255,.75); }
.gantt-sidebar-row:active { cursor: grabbing; }
.gantt-sidebar-row.drag-over { background: rgba(249,214,92,.18); box-shadow: inset 0 3px 0 var(--accent); }
.gantt-drag-icon { color: rgba(30,30,30,.4); font-size: 14px; flex-shrink: 0; cursor: grab; transition: color .2s; }
.gantt-sidebar-row:hover .gantt-drag-icon { color: var(--ink); }
.gantt-sidebar-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gantt-sidebar-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-sidebar-row.done .gantt-sidebar-title { text-decoration: line-through; color: var(--text-3); }
.gantt-sidebar-tags { display: flex; flex-wrap: nowrap; gap: 4px; overflow: hidden; }
.gantt-sidebar-tags .tag-pill { font-size: 11px; padding: 1px 7px; }

.gantt-resizer {
  width: 12px; flex-shrink: 0; cursor: col-resize; background: none;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2; touch-action: none;
}
.gantt-resizer::after {
  content: ''; width: 4px; height: 44px; border-radius: var(--r-pill);
  background: rgba(30,30,30,.16);
  transition: background-color .2s, height .3s var(--ease-spring);
}
.gantt-resizer:hover::after, .gantt-resizer.dragging::after { background: var(--ink); height: 72px; }

.gantt-chart-area { flex: 1; overflow: auto; position: relative; }
.gantt-header { position: sticky; top: 0; z-index: 10; background: rgba(252,251,247,.92); backdrop-filter: blur(8px); }
.gantt-months { display: flex; border: none; }
.gantt-month-cell {
  flex-shrink: 0; height: 30px; border-right: none; border-left: 1px solid var(--line);
  padding: 6px 10px; font-size: 13px; font-weight: 500; color: var(--ink);
  background: none; overflow: hidden; white-space: nowrap;
}
.gantt-days { display: flex; border-bottom: 1px solid var(--line); }
.gantt-day-cell {
  flex-shrink: 0; height: 34px; border-right: none;
  font-size: 12px; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.gantt-day-cell > span {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.gantt-day-cell.weekend { background: rgba(30,30,30,.035); color: #8A8A8A; }
.gantt-day-cell.today-hdr { color: var(--ink); font-weight: 500; }
.gantt-day-cell.today-hdr > span { background: var(--ink); color: #fff; }

.gantt-rows-wrap { position: relative; }
.gantt-row { height: 56px; border-bottom: 1px dotted rgba(30,30,30,.14); position: relative; }
.gantt-row.alt { background: rgba(30,30,30,.015); }
.gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); z-index: 5; pointer-events: none; opacity: 1; }
.gantt-bar {
  position: absolute; top: 11px; height: 34px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--ink); cursor: grab;
  display: flex; align-items: center; user-select: none; min-width: 16px; z-index: 4;
  box-shadow: 0 4px 12px rgba(30,30,30,.1);
  transition: box-shadow .25s, transform .25s;
}
.gantt-bar:hover { box-shadow: 0 8px 20px rgba(30,30,30,.16); }
/* Überfällig = dunkel (kein JS-Eingriff nötig) */
.gantt-bar:has(.gantt-bar-days.overdue) { background: var(--ink); color: #fff; }
.gantt-bar.done {
  background:
    repeating-linear-gradient(-45deg, rgba(30,30,30,0) 0 6px, rgba(30,30,30,.12) 6px 8px),
    rgba(255,255,255,.7);
  box-shadow: inset 0 0 0 1px rgba(30,30,30,.16); color: var(--text-2); opacity: 1;
}
.gantt-bar.dragging {
  cursor: grabbing; opacity: 1; transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 32px rgba(30,30,30,.22); z-index: 20;
}
.gantt-handle {
  width: 14px; height: 100%; cursor: ew-resize; flex-shrink: 0;
  background: none; border-radius: inherit;
  display: flex; align-items: center; justify-content: center; touch-action: none;
}
.gantt-handle::after {
  content: ''; width: 4px; height: 16px; border-radius: var(--r-pill);
  background: rgba(30,30,30,.45); opacity: 0; transition: opacity .2s;
}
.gantt-bar:has(.gantt-bar-days.overdue) .gantt-handle::after { background: rgba(255,255,255,.7); }
.gantt-bar:hover .gantt-handle::after, .gantt-bar.dragging .gantt-handle::after { opacity: 1; }
.gantt-bar-label {
  flex: 1; padding: 0 4px; font-size: 13.5px; font-weight: 500; color: inherit;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.gantt-bar-days {
  flex-shrink: 0; height: 24px; min-width: 28px; padding: 0 9px; margin-right: 2px;
  border-radius: var(--r-pill); background: rgba(255,255,255,.7); color: var(--ink);
  font-size: 12px; font-weight: 500; opacity: 1; white-space: nowrap; pointer-events: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.gantt-bar-days.overdue { background: var(--danger-soft); color: var(--danger); opacity: 1; }
/* Schmale Balken: Beschriftung weg, damit nichts überläuft */
.gantt-bar.narrow { justify-content: center; }
.gantt-bar.narrow .gantt-bar-label { display: none; }
.gantt-bar.narrow .gantt-bar-days { margin: 0; min-width: 0; padding: 0 7px; }
.gantt-bar.narrow .gantt-handle { width: 7px; }
.gantt-bar.tiny .gantt-bar-days { display: none; }
.gantt-bar-tooltip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  background: var(--ink); border: none; color: #fff;
  font-size: 12.5px; height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  white-space: nowrap; pointer-events: none; display: none; z-index: 30;
  align-items: center;
}
.gantt-bar.dragging .gantt-bar-tooltip { display: inline-flex; }

/* ── Abzeichen ── */
.badge-overdue {
  background: var(--danger-soft); color: var(--danger); border: none;
  padding: 4px 13px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500;
}
.badge-ok { background: var(--success-soft); color: var(--success-text); border: none; padding: 4px 13px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500; }
.user-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 500; margin-left: 6px; vertical-align: middle;
}
.badge-admin  { background: var(--ink); color: #fff; }
.badge-user   { background: none; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.badge-locked { background: var(--neutral-soft); color: #4A4A4A; }
.badge-2fa    { background: #fff; color: var(--ink); }
.sidebar-user.active .badge-admin { background: var(--accent); color: var(--ink); }

/* ── Profil ── */
.profile-page { max-width: 560px; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.profile-head {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 36px 28px;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.profile-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.profile-avatar { width: 128px; height: 128px; font-size: 52px; font-weight: 300; }
.profile-avatar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.profile-name { font-size: 32px; font-weight: 300; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.profile-coins { font-size: 16px; height: 40px; padding: 0 16px 0 12px; }
.profile-actions { display: flex; flex-direction: column; gap: 0; padding: 10px 28px;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-card);
  box-shadow: var(--sh-card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.profile-btn {
  display: flex; align-items: center; gap: 16px; justify-content: flex-start;
  width: 100%; height: auto; padding: 16px 14px; margin: 0 -14px; font-size: 17px;
  background: none; border: none; border-bottom: 1px dotted var(--line-dot);
  border-radius: var(--r-md); color: var(--ink); width: calc(100% + 28px);
}
.profile-btn:last-child { border-bottom: none; }
.profile-btn:hover { background: rgba(255,255,255,.85); box-shadow: none; transform: none; }
.profile-btn > svg {
  width: 46px; height: 46px; padding: 13px; border-radius: 50%;
  background: #fff; flex-shrink: 0; stroke-width: 1.8;
}
.profile-btn.btn-danger { background: none; color: var(--danger); }
.profile-btn.btn-danger:hover { background: rgba(255,255,255,.85); box-shadow: none; }
.profile-btn.btn-danger > svg { background: var(--danger-soft); }
.profile-section {
  border-top: none; padding: 26px 28px 24px;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-card);
  box-shadow: var(--sh-card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.profile-section-title {
  font-size: 24px; font-weight: 400; text-transform: none; letter-spacing: -.01em;
  color: var(--ink); margin-bottom: 18px;
}
.profile-section-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
#spHint { font-size: 14.5px; color: var(--text-2); margin-bottom: 18px; }

/* ── 2FA ── */
.modal-wide { max-width: 520px; width: 96vw; }
.twofa-status {
  display: flex; align-items: center; gap: 12px; font-size: 15px;
  padding: 14px 16px; border-radius: var(--r-md); background: #fff;
}
.twofa-badge {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
}
.twofa-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.twofa-badge.active   { background: var(--success-soft); color: var(--success-text); }
.twofa-badge.inactive { background: var(--neutral-soft); color: #4A4A4A; }
.twofa-qr {
  display: flex; justify-content: center; margin: 16px auto; background: #fff;
  border-radius: 24px; padding: 16px; width: fit-content;
  box-shadow: 0 0 0 6px var(--accent);
}
.twofa-qr svg { max-width: 196px; max-height: 196px; display: block; }
.twofa-secret-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 18px; border-radius: var(--r-pill); background: #fff;
}
.twofa-secret {
  background: none; border: none; border-radius: 0; padding: 0;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 14px; letter-spacing: .06em; flex: 1; overflow-wrap: anywhere; color: var(--ink);
}
.twofa-backup-codes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0;
  padding: 14px; border-radius: 24px; background: var(--ink-card);
}
.twofa-backup-codes code {
  background: rgba(255,255,255,.07); border: none; border-radius: var(--r-sm);
  height: 44px; padding: 0 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 15px; letter-spacing: .08em; color: var(--accent);
}
#twoFaEnableCode {
  text-align: center; font-size: 20px; letter-spacing: .3em;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

/* ── Avatar-Zuschnitt ── */
.modal-cropper { max-width: 480px; width: 100%; }
.cropper-body { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px 30px 6px; }
.cropper-stage-wrap {
  position: relative; width: 320px; height: 320px; max-width: 100%;
  border-radius: 26px; overflow: hidden; background: #2A2A2A;
  box-shadow: none; cursor: grab; touch-action: none;
}
.cropper-stage-wrap:active { cursor: grabbing; }
#cropperCanvas { display: block; width: 320px; height: 320px; border-radius: 0; }
.cropper-circle-mask {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(20,20,20,.58);
  border: 2px solid rgba(255,255,255,.9);
  pointer-events: none;
  animation: maskIn .6s var(--ease-out) .25s backwards;
}
.cropper-controls { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 320px; }
.cropper-controls > svg {
  width: 44px; height: 44px; padding: 13px; border-radius: 50%;
  background: rgba(30,30,30,.06); flex-shrink: 0;
}
.cropper-controls input[type=range] { cursor: pointer; }

/* ── Kleinkram ── */
.text-muted { color: var(--text-2); }
.text-small { font-size: 13px; }
.mt-2 { margin-top: 8px; }
.gap-row { display: flex; gap: 10px; align-items: center; }

/* ── Keyframes ── */
@keyframes rise      { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut   { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalIn   { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes modalOut  { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes navIn     { from { transform: scale(.86); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes checkPop  { 0% { transform: scale(.6); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes coinBump  { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.16); } }
@keyframes coinFly {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(.6); }
  20%  { opacity: 1; transform: translate(-50%, -14px) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(.95); }
}
@keyframes tagPop    { 0% { transform: scale(1); } 45% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes toastIn {
  0%   { opacity: 0; transform: translateY(24px) scale(.96); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.01); }
  100% { opacity: 1; transform: none; }
}
@keyframes toastOut   { to { opacity: 0; transform: translateX(40px); } }
@keyframes toastDrain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-10px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }  80% { transform: translateX(3px); }
}
@keyframes errIn   { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes emptyIn {
  0%   { opacity: 0; transform: translateY(10px) scale(.96); }
  60%  { opacity: 1; transform: translateY(-3px) scale(1.01); }
  100% { transform: none; }
}
@keyframes maskIn { from { transform: scale(1.15); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes floaty { from { transform: translateY(0) rotate(var(--r, 0deg)); } to { transform: translateY(-18px) rotate(var(--r, 0deg)); } }

/* ── Eigene Fensterleiste (PWA am Desktop) ───────────────────────────
   Im Modus „window-controls-overlay“ zeichnet Windows keine Fenster-Kopfleiste
   mehr – nur die Systemknöpfe liegen rechts oben über dem Inhalt. Die
   App-Kopfzeile rückt unter diese Knöpfe und dient selbst als Ziehfläche.
   env(titlebar-area-height) ist deren Höhe; der Ersatzwert greift nur, falls
   das Fenster sie nicht meldet. */
@media all and (display-mode: window-controls-overlay) {
  /* Kopfzeile Desktop */
  .sidebar {
    padding-top: calc(env(titlebar-area-height, 33px) + 12px);
    -webkit-app-region: drag; app-region: drag;
  }
  /* Kopfzeile im schmalen Fenster */
  .topbar {
    height: auto;
    padding-top: calc(env(titlebar-area-height, 33px) + 8px);
    -webkit-app-region: drag; app-region: drag;
  }
  /* Bedienelemente bleiben klickbar statt das Fenster zu ziehen */
  .sidebar-logo, .sidebar-nav, .sidebar-right,
  .topbar-brand, .topbar-actions {
    -webkit-app-region: no-drag; app-region: no-drag;
  }

  /* Die Kopfzeile scrollt mit – damit das Fenster immer verschiebbar bleibt,
     zieht zusätzlich der obere Rand des Fensters, genau auf der Fläche, die
     das Fenster selbst für seine Leiste reserviert (ohne die Systemknöpfe).
     Liegt unter Dialogen, damit deren Hintergrund anklickbar bleibt. */
  .app::before {
    content: ""; position: fixed; z-index: 900;
    top: 0; left: env(titlebar-area-x, 0px);
    width: env(titlebar-area-width, 100%);
    height: env(titlebar-area-height, 33px);
    -webkit-app-region: drag; app-region: drag;
  }

  /* Anmeldeseite: eigener Ziehstreifen am oberen Rand */
  .login-wrap { padding-top: calc(40px + env(titlebar-area-height, 33px)); }
  .login-wrap::before {
    content: ""; position: absolute; z-index: 1;
    top: 0; left: 0; right: 0; height: env(titlebar-area-height, 33px);
    -webkit-app-region: drag; app-region: drag;
  }
}

/* ── Mobil ── */
@media (max-width: 900px) {
  .coin-stats-wrapper > .stat-card:first-child,
  .heatmap-card, .achievements-card { flex: 1 1 100%; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .topbar { display: flex; }

  /* Die untere Leiste schwebt über dem Inhalt; die Seite scrollt als Ganzes
     (siehe .app), die Kopfzeile fährt dabei mit. */
  .content { padding: 14px 16px calc(104px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: block; position: fixed; z-index: 30;
    left: 14px; right: 14px; bottom: 0;
    padding: 0 0 calc(14px + env(safe-area-inset-bottom));
  }
  .page-title { font-size: 42px; }
  .page-header { margin-bottom: 20px; }

  /* Kennzahlen als Viererraster, ohne Symbole – wie im Mobil-Entwurf */
  .dash-head { gap: 18px; }
  .kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .kpi { gap: 2px; }
  .kpi-icon { display: none; }
  .kpi-value { font-size: 40px; }
  .kpi-label { font-size: 12.5px; padding-left: 0; }

  .dash-bar { gap: 14px; margin-bottom: 20px; }
  .seg-bar { flex: 1 1 100%; gap: 4px; }
  .seg-col { min-width: 58px; }
  .seg { height: 44px; padding: 0 14px; font-size: 13px; }
  .dash-bar > .btn { flex: 1 1 100%; }

  .up-card { padding: 20px 18px 10px; }
  .od-wrap { padding-top: 10px; }
  .od-card { padding: 20px 18px 8px; }
  .toolbar { border-radius: var(--r-card); }
  .toolbar-search { flex: 1 1 100%; }
  .tasks-list { padding: 4px 18px; }
  .task-row { gap: 12px; flex-wrap: wrap; }
  .task-row-tags, .task-row-date { flex-shrink: 1; }
  #view-tasks .task-row-actions,
  #view-dashboard .task-row-actions { opacity: 1; transform: none; }
  .task-card-actions { opacity: 1; transform: none; }
  .gantt-wrap { height: calc(100dvh - 300px); }
  .gantt-sidebar-wrap { width: 150px; }
  .toast-wrap { right: 16px; left: 16px; bottom: 96px; align-items: stretch; }
  .toast { width: auto; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: none; max-height: 92dvh;
    border-radius: var(--r-dialog) var(--r-dialog) 0 0;
    animation: sheetUp .5s var(--ease-out);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-overlay.closing .modal { animation: sheetDown .25s var(--ease-in) forwards; }
  .datepicker-overlay { align-items: center; padding: 16px; }
  .datepicker-card { animation: modalIn .4s var(--ease-out); }
  .modal-header { padding: 22px 16px 4px 24px; }
  .modal-body { padding: 14px 24px 8px; }
  .modal-footer { padding: 14px 20px 24px; }
  .modal-footer .btn { flex: 1; }
  .profile-avatar { width: 104px; height: 104px; font-size: 44px; }
}

@media (max-width: 560px) {
  .seg-label { display: none; }
  .seg { padding: 0 12px; }
  .cal-weekdays, .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-wd { width: auto; }
  .cal-day { width: 100%; height: 42px; margin: 2px 0; }
  .cal-day.in-range { width: 100%; height: 46px; margin: 0; }
  .tag-create-row { border-radius: var(--r-card); }
}

@media (max-width: 460px) {
  #view-dashboard .task-card-desc { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 16px 18px; }
  .stat-value { font-size: 2.6rem; }
  .achievement-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
}

@keyframes sheetUp   { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { from { transform: none; } to { transform: translateY(100%); } }

/* ── Weniger Bewegung ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
