/* Müller Power – Holz-Müller house style, values from the echt-beraten
 * project page (Frontend/app/globals.css): white surfaces on warm grey,
 * Holz-Müller green #008300, Archivo, small tracked caps for labels,
 * nothing rounded. Light/dark, responsive, no build step. */
@font-face {
  font-family: "Archivo";
  src: url("/static/vendor/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #e6e3dc;
  --card: #ffffff;
  --card-muted: #f5f3ef;
  --ink: #191916;
  --muted: #6f6c64;
  --line: rgba(25, 25, 22, 0.13);
  --line-input: rgba(25, 25, 22, 0.28);
  --accent: #008300;
  --accent-hover: #006c00;
  --accent-deep: #005600;
  --accent-soft: #e8f1e6;
  --accent-ink: #ffffff;
  --ok: #005600;
  --ok-soft: #f2f7f1;
  --warn: #8a5a00;
  --warn-soft: #f7f0e1;
  --danger: #b3261e;
  --danger-soft: #f8e4e1;
  --add-bg: #e8f1e6;
  --add-ink: #005600;
  --del-bg: #f8e4e1;
  --del-ink: #7a1f18;
  --shadow: none;
  --logo-plate: transparent;
  --radius: 0;
  --sidebar-w: 230px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121411;
    --card: #1b1e1a;
    --card-muted: #222621;
    --ink: #ecebe6;
    --muted: #a3a197;
    --line: rgba(236, 235, 230, 0.14);
    --line-input: rgba(236, 235, 230, 0.3);
    --accent: #3fa53f;
    --accent-hover: #52b852;
    --accent-deep: #7fcf7f;
    --accent-soft: #1f2e1e;
    --accent-ink: #0d100c;
    --ok: #7fcf7f;
    --ok-soft: #1f2e1e;
    --warn: #d9a05b;
    --warn-soft: #3b2d1b;
    --danger: #e8877b;
    --danger-soft: #3f2420;
    --add-bg: #1f3a24;
    --add-ink: #b8e6c0;
    --del-bg: #45231e;
    --del-ink: #f2b8ad;
    --shadow: none;
    --logo-plate: #ffffff;
      color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121411;
  --card: #1b1e1a;
  --card-muted: #222621;
  --ink: #ecebe6;
  --muted: #a3a197;
  --line: rgba(236, 235, 230, 0.14);
  --line-input: rgba(236, 235, 230, 0.3);
  --accent: #3fa53f;
  --accent-hover: #52b852;
  --accent-deep: #7fcf7f;
  --accent-soft: #1f2e1e;
  --accent-ink: #0d100c;
  --ok: #7fcf7f;
  --ok-soft: #1f2e1e;
  --warn: #d9a05b;
  --warn-soft: #3b2d1b;
  --danger: #e8877b;
  --danger-soft: #3f2420;
  --add-bg: #1f3a24;
  --add-ink: #b8e6c0;
  --del-bg: #45231e;
  --del-ink: #f2b8ad;
  --shadow: none;
  --logo-plate: #ffffff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 1.9rem; line-height: 1.05; letter-spacing: -0.035em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
code, pre { font-family: var(--mono); font-size: 0.9em; }
pre { background: var(--card-muted); padding: 0.75rem 1rem; border-radius: 0; overflow-x: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
img { max-width: 100%; }

/* Layout */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 1rem; min-height: 56px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
/* The PNG (300x105) has ~100px of empty space right of the mark: crop it. */
.brand-logo { display: block; height: 36px; width: auto; aspect-ratio: 200 / 105; object-fit: cover; object-position: left center; background: var(--logo-plate); padding: 2px 4px; box-sizing: content-box; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; padding-left: 0.75rem; border-left: 1px solid var(--line); }
.brand-text strong { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; color: var(--accent-deep); }
.brand-text small { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
.search { flex: 1; max-width: 480px; margin-left: 0.5rem; }
.search input { width: 100%; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  background: transparent; border: 1px solid transparent; color: var(--ink); font-size: 1.1rem;
  width: 36px; height: 36px; border-radius: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--accent-soft); }
.menu-btn { display: none; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 0; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--accent-soft); }
.user-menu .menu {
  position: absolute; right: 0; top: 110%; min-width: 220px; background: var(--card);
  border: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow); padding: 0.4rem; z-index: 40;
}
.user-menu .menu a, .user-menu .menu button { display: block; width: 100%; text-align: left; padding: 0.45rem 0.6rem; border-radius: 0; color: var(--ink); }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--accent-soft); text-decoration: none; }
.menu-head { padding: 0.4rem 0.6rem 0.6rem; font-size: 0.85rem; border-bottom: 1px solid var(--line); margin-bottom: 0.3rem; }
.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 0;
  background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.04em; flex: none;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar.sm { width: 22px; height: 22px; font-size: 0.6rem; }

.shell { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: var(--sidebar-w); flex: none; padding: 1rem 0.75rem; border-right: 1px solid var(--line);
  background: var(--card); position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
}
.sidebar .nav { display: block; padding: 0.45rem 0.7rem; border-radius: 0; color: var(--ink); margin-bottom: 2px; }
.sidebar .nav:hover { background: var(--accent-soft); text-decoration: none; }
.sidebar .nav.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav-section { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.22em; color: var(--muted); margin: 1.2rem 0.7rem 0.4rem; }
.sidebar-backdrop { display: none; }
.content { flex: 1; min-width: 0; padding: 1.5rem 2rem 4rem; max-width: 1400px; }
.content-public { max-width: 460px; margin: 8vh auto; padding: 1rem; }

/* Components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card h2 { display: flex; align-items: center; gap: 0.5rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 0.1rem 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.9rem; border-radius: 0;
  border: 1px solid var(--line-input); background: var(--card); color: var(--ink); cursor: pointer; font: inherit; font-size: 0.92rem;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-soft); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.82rem; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.linklike { background: none; border: 0; color: var(--accent-deep); cursor: pointer; font: inherit; padding: 0; }
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="url"], input[type="number"], select, textarea {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--line-input); border-radius: 0; background: var(--card); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
textarea.editor { min-height: 60vh; font-family: var(--mono); font-size: 0.9rem; tab-size: 2; }
label { display: block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 0.35rem; color: var(--muted); }
.field { margin-bottom: 0.9rem; }
.field-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 160px; }
.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.help { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.flash { padding: 0.65rem 1rem; border-radius: 0; margin-bottom: 1rem; background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
.flash-warn, .alert-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.flash-error, .alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.alert { padding: 0.65rem 1rem; border-radius: 0; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--accent-soft); }
.tag { display: inline-block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.15rem 0.45rem; border-radius: 0; background: var(--accent-soft); color: var(--accent-deep); margin-right: 0.25rem; white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.neutral { background: var(--line); color: var(--muted); }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.25rem; overflow-x: auto; }
.tabs a { padding: 0.55rem 0.9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--accent-deep); border-color: var(--accent); font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 0.55rem 0; border-top: 1px solid var(--line); display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 160px; }
.list .meta { font-size: 0.8rem; color: var(--muted); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); }
.empty { color: var(--muted); font-style: italic; padding: 0.75rem 0; }
.kpi { display: flex; gap: 1rem; flex-wrap: wrap; }
.kpi .card { flex: 1 1 140px; text-align: center; }
.kpi .num { font-size: 2.2rem; font-weight: 600; letter-spacing: -0.045em; line-height: 1; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 0; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }
details.box { border: 1px solid var(--line); border-radius: 0; padding: 0.5rem 0.8rem; margin-bottom: 0.75rem; background: var(--card); }
details.box summary { cursor: pointer; font-weight: 600; }
.due { font-size: 0.78rem; color: var(--muted); }
.due.overdue { color: var(--danger); font-weight: 600; }
.due.soon { color: var(--warn); font-weight: 600; }
.doc-status-archived { opacity: 0.7; }

/* Markdown prose */
.prose { max-width: 80ch; font-size: 1rem; }
.prose h1 { font-size: 1.7rem; margin-top: 0; }
.prose h2 { font-size: 1.3rem; margin-top: 1.6em; padding-bottom: 0.25rem; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1.08rem; margin-top: 1.3em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.92rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.prose th { background: var(--card-muted); }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: 0.2em 1em; color: var(--muted); }
.prose a.wikilink { background: var(--accent-soft); padding: 0 0.3em; border-radius: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.15em; }
.prose hr { margin: 1.5em 0; }
.prose img { border-radius: 0; }

/* Editor */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.preview { border: 1px solid var(--line); border-radius: 0; padding: 1rem 1.25rem; background: var(--card); min-height: 60vh; overflow: auto; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--muted); }

/* Diff */
.diff { font-family: var(--mono); font-size: 0.82rem; border: 1px solid var(--line); border-radius: 0; overflow: auto; background: var(--card); }
.diff .line { display: flex; white-space: pre-wrap; word-break: break-word; }
.diff .line span.no { flex: none; width: 3rem; text-align: right; padding-right: 0.5rem; color: var(--muted); user-select: none; }
.diff .line span.txt { flex: 1; padding: 0.05rem 0.6rem; }
.diff .add { background: var(--add-bg); color: var(--add-ink); }
.diff .del { background: var(--del-bg); color: var(--del-ink); }
.diff .hunk { background: var(--accent-soft); color: var(--muted); }
.diff-stats .add { color: var(--ok); font-weight: 600; }
.diff-stats .del { color: var(--danger); font-weight: 600; }

/* Board */
.board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; scroll-snap-type: x proximity; }
.column { flex: 0 0 290px; background: var(--card-muted); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; scroll-snap-align: start; max-height: calc(100vh - 200px); display: flex; flex-direction: column; }
.column-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.column-head .count { font-size: 0.75rem; background: var(--card); padding: 0.05rem 0.5rem; border-radius: 0; color: var(--muted); }
.task-list { display: flex; flex-direction: column; gap: 0.5rem; min-height: 40px; overflow-y: auto; flex: 1; padding: 2px; }
.task-card { background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: 0.6rem 0.75rem; box-shadow: var(--shadow); cursor: grab; }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.6; }
.task-card .title { display: block; color: var(--ink); font-weight: 500; }
.task-card .title:hover { text-decoration: none; color: var(--accent); }
.task-card .foot { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.task-card.done .title { text-decoration: line-through; color: var(--muted); }
.task-card .prio-high { border-left: 3px solid var(--danger); }
.task-card.prio-high { border-left: 3px solid var(--danger); }
.task-card.prio-low { opacity: 0.85; }
.sortable-ghost { opacity: 0.35; background: var(--accent-soft); }
.add-task { margin-top: 0.5rem; }
.add-task input { background: var(--card); }
.add-task details summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; list-style: none; }
.add-task details summary::-webkit-details-marker { display: none; }
.add-task .row { display: flex; gap: 0.4rem; margin-top: 0.4rem; }

/* Timeline */
.timeline { overflow-x: auto; }
.tl-grid { min-width: 720px; position: relative; }
.tl-months { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 0.5rem; }
.tl-months > div { font-size: 0.75rem; color: var(--muted); padding: 0.25rem 0.3rem; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.tl-row { position: relative; height: 40px; margin-bottom: 4px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 12 - 1px), var(--line) calc(100% / 12 - 1px), var(--line) calc(100% / 12)); border-radius: 0; }
.tl-bar { position: absolute; top: 6px; height: 28px; border-radius: 0; color: #fff; font-size: 0.78rem; line-height: 28px; padding: 0 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--shadow); }
.tl-bar:hover { text-decoration: none; filter: brightness(1.1); }
.tl-bar.erledigt { opacity: 0.55; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 2; }
.tl-today::after { content: "heute"; position: absolute; top: -1.1rem; left: 4px; font-size: 0.7rem; color: var(--danger); }
.tl-rows { position: relative; }

/* Team cards */
.profile-card { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-card .head { display: flex; gap: 0.75rem; align-items: center; }
.profile-card .head h3 { margin: 0; }
.profile-card .headline { color: var(--muted); font-size: 0.9rem; }
.profile-card .foot { display: flex; gap: 0.5rem; align-items: center; margin-top: auto; font-size: 0.85rem; }
.profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.profile-head h1 { margin: 0; }

/* Feed */
.feed li { align-items: center; }
.feed .avatar { flex: none; }

/* AI */
.ai-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.doc-picker { max-height: 260px; overflow: auto; border: 1px solid var(--line-input); border-radius: 0; padding: 0.5rem 0.75rem; background: var(--card); }
.doc-picker label { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; color: var(--ink); margin: 0.15rem 0; font-size: 0.9rem; }
.doc-picker input { width: auto; }
.doc-picker .space-name { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); margin: 0.5rem 0 0.2rem; }
.ai-result { margin-top: 1.5rem; }
.token-badge { font-size: 0.78rem; color: var(--muted); }

/* Login */
.login-card { text-align: left; }
.login-brand { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.login-brand .brand-logo { height: 52px; }
.login-card .btn-primary { width: 100%; justify-content: center; min-height: 48px; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; }

/* Responsive */
@media (max-width: 960px) {
  .editor-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-block; }
  .brand-text { display: none; }
  .brand-logo { height: 30px; }
  .user-name { display: none; }
  .search { max-width: none; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; transform: translateX(-100%); transition: transform 0.2s; z-index: 50; padding-top: 1rem; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 45; }
  .column { flex-basis: 82vw; max-height: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* Print: documents only */
@media print {
  .topbar, .sidebar, .sidebar-backdrop, .tabs, .actions, .flash, .no-print, .editor-toolbar { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; font-size: 11pt; }
  .prose a { color: #000; text-decoration: underline; }
  .prose table { display: table; }
}
