/* Projektraum Baumgärtner × MakeMyKI — App-Styles auf Basis des MakeMyKI Designsystems */

html { background: var(--bg-canvas); }
body { min-height: 100vh; }
button { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.ic { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }

.container { width: 100%; max-width: var(--container-xl); margin: 0 auto; padding: 0 var(--space-6); }
@media (max-width: 640px) { .container { padding: 0 var(--space-4); } }

.muted { color: var(--text-muted); font-size: var(--fs-body-sm); }
.eyebrow {
  font-size: var(--fs-label); font-weight: var(--fw-semibold); letter-spacing: var(--ls-wider);
  text-transform: uppercase; color: var(--text-accent); margin-bottom: var(--space-2);
}
.eyebrow--muted { color: var(--text-faint); }

.card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}

:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-weight: var(--fw-semibold); font-size: var(--fs-body); line-height: 1;
  padding: 0.6875rem 1.125rem; border-radius: var(--radius-md); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn--sm { font-size: var(--fs-body-sm); padding: 0.5rem 0.875rem; }
.btn--lg { font-size: var(--fs-body-lg); padding: 0.875rem 1.5rem; }
.btn--full { width: 100%; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-active); }
.btn--dark { background: var(--espresso-800); color: var(--cream-50); }
.btn--dark:hover { background: var(--espresso-900); }
.btn--secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--bg-accent-soft); border-color: var(--border-accent); }
.btn--ghost { background: transparent; color: var(--text-accent); }
.btn--ghost:hover { background: var(--bg-accent-soft); }
.btn--danger-ghost { background: transparent; color: var(--text-negative); }
.btn--danger-ghost:hover { background: var(--bg-negative-soft); }

.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: none; background: transparent; color: var(--text-faint); border-radius: var(--radius-sm); cursor: pointer;
  font-size: 17px; transition: background var(--dur-fast), color var(--dur-fast);
}
.icon-btn:hover { background: var(--bg-accent-soft); color: var(--text-accent); }

.link {
  display: inline-flex; align-items: center; gap: 0.35em; padding: 0; border: none; background: none;
  color: var(--text-accent); font-weight: var(--fw-semibold); font-size: var(--fs-body-sm); cursor: pointer;
}
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link--muted { color: var(--text-faint); font-weight: var(--fw-medium); font-size: var(--fs-caption); }

/* ---------- Badges, Avatar, Bar ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 0.4em; white-space: nowrap;
  font-weight: var(--fw-semibold); font-size: var(--fs-caption); line-height: 1;
  padding: 0.3125rem 0.625rem; border-radius: var(--radius-full);
}
.badge--accent { background: var(--bg-accent-soft); color: var(--text-accent); box-shadow: inset 0 0 0 1px var(--border-accent); }
.badge--negative { background: var(--bg-negative-soft); color: var(--text-negative); }

.avatar {
  width: 32px; height: 32px; border-radius: var(--radius-full); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--espresso-700); color: var(--cream-50);
  font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: 0.02em;
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }

.bar { height: 8px; background: var(--sand-100); border-radius: var(--radius-full); overflow: hidden; margin: var(--space-3) 0; }
.bar > span { display: block; height: 100%; background: var(--green-600); border-radius: inherit; transition: width var(--dur-slow) var(--ease-standard); }
.bar--sm { height: 5px; margin: var(--space-2) 0 0; max-width: 160px; }
.bar--lg { height: 12px; }

.count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: var(--radius-full); background: var(--bg-fill); color: var(--text-secondary);
  font-size: var(--fs-caption); font-weight: var(--fw-semibold);
}

/* ---------- Topbar ---------- */

.topbar { background: var(--bg-canvas); border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; z-index: 10; }
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.brand__logo { height: 22px; width: auto; display: block; }
.brand__sep { width: 1px; height: 24px; background: var(--border-strong); }
.brand__proj { font-size: var(--fs-body-sm); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__proj b { color: var(--text-primary); font-weight: var(--fw-semibold); }

.menu { position: relative; }
.menu__btn {
  list-style: none; display: flex; align-items: center; gap: var(--space-2); cursor: pointer;
  padding: 4px 8px 4px 4px; border-radius: var(--radius-full); border: 1px solid transparent;
}
.menu__btn::-webkit-details-marker { display: none; }
.menu__btn:hover, .menu[open] .menu__btn { background: var(--bg-surface); border-color: var(--border-subtle); }
.menu__name { font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); }
.menu__chev { color: var(--text-faint); }
.menu__pop { position: absolute; right: 0; top: calc(100% + 6px); width: 260px; padding: var(--space-2); box-shadow: var(--shadow-lg); }
.menu__who { padding: var(--space-2) var(--space-3) var(--space-3); font-weight: var(--fw-semibold); font-size: var(--fs-body-sm); border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--space-1); }
.menu__who span { color: var(--text-muted); font-weight: var(--fw-regular); font-size: var(--fs-caption); }
.menu__item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left;
  padding: var(--space-2) var(--space-3); border: none; background: none; border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm); cursor: pointer; color: var(--text-secondary);
}
.menu__item:hover { background: var(--bg-accent-soft); color: var(--text-primary); }

@media (max-width: 640px) {
  .menu__name, .brand__sep, .menu__chev { display: none; }
  .brand__proj { display: none; }
}

/* ---------- Page ---------- */

.page { padding-top: var(--space-10); padding-bottom: var(--space-16); }
.hero { margin-bottom: var(--space-8); }
.hero__title { font-size: clamp(1.75rem, 4vw, var(--fs-display-lg)); font-weight: var(--fw-black); letter-spacing: var(--ls-tighter); line-height: var(--lh-snug); }
.hero__lead { margin-top: var(--space-3); font-size: var(--fs-body-lg); color: var(--text-secondary); max-width: 40em; }

.list-h { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-heading-md); font-weight: var(--fw-bold); margin: var(--space-8) 0 var(--space-3); }

.empty { color: var(--text-muted); font-size: var(--fs-body-sm); padding: var(--space-2) 0; }

/* ---------- Roadmap ---------- */

.months { display: flex; flex-direction: column; gap: var(--space-6); }
.month { display: grid; grid-template-columns: 200px 1fr; gap: var(--space-6); align-items: start; }
@media (max-width: 760px) { .month { grid-template-columns: 1fr; gap: var(--space-3); } }
.month__rail { display: flex; gap: var(--space-3); padding-top: var(--space-5); }
.month__idx {
  font-family: var(--font-mono); font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); color: var(--text-faint);
  padding-top: 1px;
}
.month--current .month__idx { color: var(--accent); }
.month__rail .eyebrow { margin-bottom: var(--space-1); }
.month__name { white-space: nowrap; font-size: clamp(var(--fs-heading-md), 1.9vw, var(--fs-heading-lg)); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); }
.month__count { font-size: var(--fs-body-sm); color: var(--text-muted); margin-top: 2px; }
.month--current .month__body { border-color: var(--border-accent); box-shadow: var(--shadow-md); }
.month__body { padding: var(--space-3) var(--space-5) var(--space-4); }
.month--past .month__body { background: var(--bg-canvas-alt); box-shadow: none; }
.block { padding: var(--space-2) 0; }
.block + .block { border-top: 1px solid var(--border-subtle); margin-top: var(--space-2); }
.block__h {
  font-size: var(--fs-label); font-weight: var(--fw-semibold); letter-spacing: var(--ls-wider); text-transform: uppercase;
  color: var(--text-faint); padding: var(--space-2) 0 var(--space-1);
}
.month__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); border-top: 1px solid var(--border-subtle); padding-top: var(--space-3); margin: var(--space-2) calc(-1 * var(--space-2)) 0; }

.later { margin-top: var(--space-4); }

.past { margin-top: var(--space-12); border-top: 1px solid var(--border-subtle); padding-top: var(--space-6); }
.past__sum {
  list-style: none; display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer;
  font-size: var(--fs-heading-md); font-weight: var(--fw-bold); padding: var(--space-1) var(--space-2); margin-left: calc(-1 * var(--space-2));
  border-radius: var(--radius-sm);
}
.past__sum::-webkit-details-marker { display: none; }
.past__sum:hover { background: var(--bg-accent-soft); }
.past__chev { transform: rotate(-90deg); transition: transform var(--dur-normal) var(--ease-standard); color: var(--text-faint); }
.past[open] .past__chev { transform: none; }
.past[open] > .months { margin-top: var(--space-6); }
.past__empty { margin-top: var(--space-3); max-width: 44em; }

/* ---------- Einträge (Ziele, Meilensteine, Checkliste) ---------- */

.items { display: flex; flex-direction: column; }
.item { scroll-margin: 100px; }
.item + .item { border-top: 1px solid var(--border-subtle); }
.item__row { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; }
.item__main { flex: 1; min-width: 0; }
.item__title { font-weight: var(--fw-semibold); line-height: 1.4; padding-top: 3px; overflow-wrap: anywhere; }
.item__flag { color: var(--accent); margin-right: var(--space-2); }
.item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.item__meta:empty { display: none; }
.item__edit { margin-top: -3px; opacity: 0.55; }
.item:hover .item__edit, .item__edit:focus-visible { opacity: 1; }
.item__carry { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.item.is-done .item__title { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--taupe-300); }
.meta-done { display: inline-flex; align-items: center; gap: 0.35em; font-size: var(--fs-caption); color: var(--text-positive); }

.check {
  width: 28px; height: 28px; flex: none; border-radius: var(--radius-full); cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--bg-surface); color: transparent;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-emphasis);
}
.check .ic { stroke-width: 3; }
.check:hover { border-color: var(--green-600); color: var(--green-600); background: var(--green-100); }
.check[aria-pressed="true"] { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.check[aria-pressed="true"]:hover { background: var(--green-700); }
.check:active { transform: scale(0.92); }

.note-toggle {
  display: inline-flex; align-items: center; gap: 0.4em; border: none; background: none; cursor: pointer;
  padding: 0.3125rem 0.5rem; margin-left: -0.25rem; border-radius: var(--radius-full);
  font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--text-faint);
}
.note-toggle:hover, .note-toggle.is-open { background: var(--bg-accent-soft); color: var(--text-accent); }
.note-toggle.has-notes { color: var(--text-secondary); }

/* Notizen */
.notes { margin: 0 0 var(--space-4) calc(28px + var(--space-3)); padding: var(--space-4); background: var(--bg-canvas-alt); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
@media (max-width: 640px) { .notes { margin-left: 0; } }
.notes__list { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-4); }
.notes__empty { font-size: var(--fs-body-sm); color: var(--text-muted); margin-bottom: var(--space-3); }
.note__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-body-sm); }
.note--kunde .avatar { background: var(--terracotta-500); }
.note__date { color: var(--text-faint); font-size: var(--fs-caption); }
.note__del { margin-left: auto; }
.note__text { margin: var(--space-1) 0 0 calc(24px + var(--space-2)); white-space: pre-wrap; overflow-wrap: anywhere; line-height: var(--lh-normal); }
.note-form { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.note-form__text { min-height: 64px; resize: vertical; }

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

.field { display: flex; flex-direction: column; gap: var(--space-2); border: none; padding: 0; margin: 0 0 var(--space-5); min-width: 0; }
.field__label { font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); padding: 0; }
.field__hint { color: var(--text-faint); font-weight: var(--fw-regular); }
.input {
  width: 100%; font: inherit; font-size: var(--fs-body); color: var(--text-primary);
  padding: 0.6875rem 0.875rem; background: var(--bg-surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
textarea.input { resize: vertical; line-height: var(--lh-normal); }
.input:hover { border-color: var(--espresso-500); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.input::placeholder { color: var(--text-faint); }

.form-error, .dlg__error {
  color: var(--text-negative); background: var(--bg-negative-soft); border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3); font-size: var(--fs-body-sm); margin-bottom: var(--space-4);
}
[hidden] { display: none !important; }

/* ---------- Dialog ---------- */

.dlg {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: none; border-radius: var(--radius-lg);
  background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xl);
}
.dlg::backdrop { background: rgba(34, 28, 23, 0.45); }
.dlg[open] { animation: rise var(--dur-normal) var(--ease-standard); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.dlg__head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-6) 0; }
.dlg__title { font-size: var(--fs-heading-md); font-weight: var(--fw-bold); }
.dlg__body { padding: var(--space-5) var(--space-6) 0; }
.dlg__error { margin: 0 var(--space-6) var(--space-4); }
.dlg__foot { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-subtle); background: var(--bg-canvas-alt); }
.dlg__spacer { flex: 1; }
@media (max-width: 480px) {
  .dlg__foot { flex-wrap: wrap; }
  .dlg__foot .btn--primary, .dlg__foot .btn--secondary { flex: 1; }
}

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

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-6) var(--space-4); }
.login__card { width: 100%; max-width: 420px; padding: var(--space-10) var(--space-8); box-shadow: var(--shadow-lg); }
@media (max-width: 480px) { .login__card { padding: var(--space-8) var(--space-5); } }
.login__logo { height: 26px; width: auto; display: block; margin-bottom: var(--space-8); }
.login__title { font-size: var(--fs-heading-lg); font-weight: var(--fw-black); letter-spacing: var(--ls-tight); line-height: var(--lh-snug); }
.login__lead { color: var(--text-secondary); margin: var(--space-2) 0 var(--space-6); }
.login__help { margin-top: var(--space-5); font-size: var(--fs-caption); color: var(--text-muted); text-align: center; }

/* ---------- Footer & Toast ---------- */

.footer { border-top: 1px solid var(--border-subtle); }
.footer__in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); padding-top: var(--space-6); padding-bottom: var(--space-10); font-size: var(--fs-caption); color: var(--text-muted); }
.footer__in img { height: 14px; width: auto; opacity: 0.7; }

.toast {
  position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 32px); padding: var(--space-3) var(--space-5); border-radius: var(--radius-md);
  background: var(--espresso-800); color: var(--cream-50); font-size: var(--fs-body-sm); font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-lg); animation: rise var(--dur-normal) var(--ease-standard);
}
.toast--error { background: var(--red-700); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Layout: Roadmap + ToDos ---------- */

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-8); align-items: start; }
.layout__side { position: sticky; top: 88px; }
@media (max-width: 1060px) {
  .layout { grid-template-columns: 1fr; gap: var(--space-8); }
  .layout__side { position: static; order: -1; }
}

/* ---------- ToDos ---------- */

.todos {
  background: var(--bg-canvas-alt); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: var(--space-5); max-height: calc(100vh - 112px); overflow: auto;
}
@media (max-width: 1060px) { .todos { max-height: none; } }
.todos__title {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-body-lg); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); margin-bottom: var(--space-3);
}

.todo-form { margin-bottom: var(--space-2); }
.todo-form__input {
  width: 100%; font: inherit; font-size: var(--fs-body-sm); color: var(--text-primary);
  padding: 0.5625rem 0.75rem; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.todo-form__input::placeholder { color: var(--text-faint); }
.todo-form__input:hover { border-color: var(--border-strong); }
.todo-form__input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.todo-form__row { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.todo-form:not(:focus-within):not(.has-text) .todo-form__row { display: none; }
.todo-form__who {
  flex: 1; min-width: 0; font: inherit; font-size: var(--fs-caption); color: var(--text-secondary);
  padding: 0.375rem 0.5rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-surface);
}

.todo-list { display: flex; flex-direction: column; }
.todo { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; }
.todo + .todo { border-top: 1px solid var(--border-subtle); }
.todo__main { flex: 1; min-width: 0; }
.todo__text { font-size: var(--fs-body-sm); font-weight: var(--fw-medium); line-height: 1.4; overflow-wrap: anywhere; }
.todo.is-done .todo__text { color: var(--text-faint); font-weight: var(--fw-regular); text-decoration: line-through; text-decoration-color: var(--taupe-300); }

.todo__who { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; max-width: 100%; cursor: pointer; }
.todo__who select {
  appearance: none; -webkit-appearance: none; min-width: 0; max-width: 100%; cursor: pointer;
  font: inherit; font-size: var(--fs-caption); color: var(--text-muted);
  padding: 0; border: none; background: none;
}
.todo__who:hover select { color: var(--text-accent); text-decoration: underline; text-underline-offset: 2px; }
.todo__who.is-empty select { color: var(--text-faint); }
.todo.is-mine .todo__who select { color: var(--text-accent); font-weight: var(--fw-semibold); }
.avatar--xs { width: 18px; height: 18px; font-size: 8px; letter-spacing: 0; }
.todo.is-mine .avatar--xs { background: var(--terracotta-500); }
.todo.is-done .avatar--xs { opacity: 0.5; }

.todo__del {
  flex: none; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: var(--radius-xs); cursor: pointer;
  color: var(--text-faint); font-size: 14px; opacity: 0; transition: opacity var(--dur-fast);
}
.todo:hover .todo__del, .todo__del:focus-visible { opacity: 1; }
.todo__del:hover { color: var(--text-negative); background: var(--bg-negative-soft); }
@media (hover: none) { .todo__del { opacity: 0.6; } }

.check--sm { width: 22px; height: 22px; font-size: 13px; }

.todos__empty { font-size: var(--fs-caption); color: var(--text-faint); padding-top: var(--space-2); }
.todos__done { margin-top: var(--space-2); border-top: 1px solid var(--border-subtle); padding-top: var(--space-2); }
.todos__done summary {
  list-style: none; display: inline-flex; align-items: center; gap: var(--space-1); cursor: pointer;
  font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--text-muted); padding: var(--space-1) 0;
}
.todos__done summary:hover { color: var(--text-primary); }
.todos__done summary::-webkit-details-marker { display: none; }
.todos__chev { transform: rotate(-90deg); transition: transform var(--dur-normal) var(--ease-standard); }
.todos__done[open] .todos__chev { transform: none; }
