/* Projektboard – ein Stylesheet, keine Abhängigkeiten. */

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

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1a2231;
  --ink-2: #5b6472;
  --ink-3: #8b93a1;
  --line: #e4e7ec;
  --line-2: #eef0f4;
  --crit: #d64545;
  --crit-bg: #fdeded;
  --warn: #b8801a;
  --warn-bg: #fdf5e6;
  --info: #3b6fb0;
  --info-bg: #eef4fb;
  --ok: #1f8a5f;
  --ok-bg: #e9f7f0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 232px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
small { font-size: 12.5px; color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- App-Rahmen ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--sidebar); color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  padding: 20px 18px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.sidebar__brand img { max-height: 34px; max-width: 150px; display: block; }
.sidebar__brand .name { font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; }
.sidebar nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 8px; color: rgba(255,255,255,.72);
  font-size: 14.5px; font-weight: 500; margin-bottom: 2px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.sidebar nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: rgba(255,255,255,.38); padding: 16px 11px 6px; font-weight: 650; }
.sidebar nav .ico { width: 18px; text-align: center; opacity: .9; font-size: 14px; }
.sidebar nav .pill { margin-left: auto; background: var(--crit); color: #fff; font-size: 11px;
  font-weight: 700; padding: 1px 6px; border-radius: 20px; }
.sidebar__foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.09); font-size: 13px; }
.sidebar__foot a { color: rgba(255,255,255,.72); display: flex; align-items: center; gap: 9px; }
.sidebar__foot a:hover { color: #fff; text-decoration: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 14px 28px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 19px; }
.topbar .sub { color: var(--ink-3); font-size: 13.5px; }
.topbar .spacer { flex: 1; }
.content { padding: 24px 28px 60px; max-width: 1240px; width: 100%; }

.menu-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink); padding: 0 4px; }

/* ---------- Karten & Raster ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px; }
.card__head { padding: 15px 18px; border-bottom: 1px solid var(--line-2); display: flex;
  align-items: center; gap: 12px; }
.card__head h2, .card__head h3 { margin: 0; }
.card__head .spacer { flex: 1; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 12px 18px; border-top: 1px solid var(--line-2); background: #fbfcfd;
  border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--tight { gap: 8px; }
.stack > * + * { margin-top: 14px; }

/* ---------- Kennzahlen ---------- */

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: block; color: inherit; }
.stat:hover { text-decoration: none; border-color: rgba(var(--brand-rgb), .45); }
.stat .n { font-size: 27px; font-weight: 680; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.stat--crit .n { color: var(--crit); }
.stat--warn .n { color: var(--warn); }
.stat--ok .n { color: var(--ok); }

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

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  background: var(--brand); color: #fff; border: 1px solid transparent;
  padding: 9px 15px; border-radius: 8px; font: 600 14px/1.2 var(--font);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(.94); text-decoration: none; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: #f7f8fa; color: var(--ink); filter: none; border-color: #d3d8e0; }
.btn--danger { background: var(--crit); }
.btn--ok { background: var(--ok); }
.btn--sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn--block { width: 100%; }
.btn--link { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 500; }
.btn--link:hover { filter: none; text-decoration: underline; color: var(--brand); }

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

.field { margin-bottom: 15px; }
.field > label, .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number],
input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d5dae2; border-radius: 8px;
  font: 15px/1.4 var(--font); background: #fff; color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15); }
input[type=color] { width: 46px; height: 38px; padding: 3px; border: 1px solid #d5dae2; border-radius: 8px; background: #fff; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; margin-bottom: 9px; cursor: pointer; }
.check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
fieldset legend { font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); padding: 0; margin-bottom: 10px; }

/* ---------- Badges & Marker ---------- */

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px;
  font-weight: 620; white-space: nowrap; border: 1px solid transparent; }
.badge--slate  { background: #eef0f4; color: #4b5563; }
.badge--grey   { background: #f1f2f5; color: #6b7280; }
.badge--blue   { background: #e8f0fe; color: #1a56b8; }
.badge--violet { background: #f0ebfd; color: #6b3fc4; }
.badge--green  { background: #e6f6ee; color: #17794f; }
.badge--teal   { background: #e2f5f4; color: #10736f; }
.badge--amber  { background: #fdf3e2; color: #a06810; }
.badge--orange { background: #fdeee2; color: #a85511; }
.badge--red    { background: #fdeaea; color: #b83232; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: hsl(var(--h) 45% 92%); color: hsl(var(--h) 45% 32%);
  font-size: 11px; font-weight: 700; flex: 0 0 auto; }

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

.note { padding: 12px 15px; border-radius: var(--radius); border: 1px solid; font-size: 14px; margin-bottom: 14px; }
.note--crit { background: var(--crit-bg); border-color: #f2c9c9; color: #8f2626; }
.note--warn { background: var(--warn-bg); border-color: #f0dcb2; color: #7d5710; }
.note--info { background: var(--info-bg); border-color: #cfe0f3; color: #2b5484; }
.note--ok   { background: var(--ok-bg); border-color: #bfe6d3; color: #14663f; }

.conflict { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.conflict:last-child { border-bottom: 0; }
.conflict__icon { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center;
  justify-content: center; font-size: 13px; flex: 0 0 auto; font-weight: 700; }
.conflict--crit .conflict__icon { background: var(--crit-bg); color: var(--crit); }
.conflict--warn .conflict__icon { background: var(--warn-bg); color: var(--warn); }
.conflict--info .conflict__icon { background: var(--info-bg); color: var(--info); }
.conflict__body { min-width: 0; }
.conflict__title { font-weight: 620; font-size: 14px; }
.conflict__detail { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.conflict__links { margin-top: 5px; font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Tabellen & Listen ---------- */

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fbfcfd; }
table.list td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.item:last-child { border-bottom: 0; }
.item__main { flex: 1; min-width: 0; }
.item__title { font-weight: 600; font-size: 14.5px; }
.item__meta { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 30px; opacity: .35; margin-bottom: 8px; }

.progress { height: 6px; background: var(--line-2); border-radius: 20px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 20px; }

.date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.date--over { color: var(--crit); font-weight: 620; }
.date--soon { color: var(--warn); font-weight: 620; }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 15px; font-size: 14px; font-weight: 570; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { color: var(--ink-3); font-weight: 500; }

/* ---------- Timeline (Gantt) ---------- */

.gantt { overflow-x: auto; }
.gantt__inner { min-width: 780px; }
.gantt__head { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.gantt__label { width: 210px; flex: 0 0 210px; padding: 10px 14px; font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 650; }
.gantt__months { flex: 1; display: flex; }
.gantt__month { flex: 1; text-align: center; font-size: 12px; font-weight: 620; color: var(--ink-2);
  padding: 10px 4px; border-left: 1px solid var(--line-2); }
.gantt__row { display: flex; border-bottom: 1px solid var(--line-2); min-height: 44px; align-items: center; }
.gantt__row:last-child { border-bottom: 0; }
.gantt__row:hover { background: #fbfcfd; }
.gantt__name { width: 210px; flex: 0 0 210px; padding: 8px 14px; min-width: 0; }
.gantt__name .t { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt__track { flex: 1; position: relative; height: 44px; }
.gantt__grid { position: absolute; inset: 0; display: flex; pointer-events: none; }
.gantt__grid > div { flex: 1; border-left: 1px solid var(--line-2); }
.gantt__bar { position: absolute; top: 13px; height: 18px; border-radius: 5px;
  background: var(--brand); opacity: .9; display: flex; align-items: center; padding: 0 7px;
  color: #fff; font-size: 11px; font-weight: 620; overflow: hidden; white-space: nowrap; min-width: 4px; }
.gantt__bar--tentative { background: repeating-linear-gradient(45deg, rgba(var(--brand-rgb),.45),
  rgba(var(--brand-rgb),.45) 5px, rgba(var(--brand-rgb),.22) 5px, rgba(var(--brand-rgb),.22) 10px);
  border: 1px dashed rgba(var(--brand-rgb), .7); color: var(--ink); }
.gantt__bar--done { background: #9aa3b1; }
.gantt__bar--hold { background: #c98a20; }
.gantt__ms { position: absolute; top: 12px; width: 11px; height: 11px; background: #fff;
  border: 2px solid var(--ink); transform: rotate(45deg) translateX(-4px); margin-top: 4px; z-index: 3; border-radius: 2px; }
.gantt__ms--done { background: var(--ok); border-color: var(--ok); }
.gantt__ms--over { background: var(--crit); border-color: var(--crit); }
.gantt__today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--crit); opacity: .6; z-index: 1; }
.gantt__blocker { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg,
  rgba(150,150,160,.13), rgba(150,150,160,.13) 6px, transparent 6px, transparent 12px); z-index: 0; }
.gantt__legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); padding: 12px 18px; }
.gantt__legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Kalender ---------- */

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line);
  border-left: 1px solid var(--line); }
.cal__dow { padding: 9px 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 650; color: var(--ink-3); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: #fbfcfd; }
.cal__day { min-height: 104px; padding: 7px 8px; border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line); position: relative; }
.cal__day--out { background: #fafbfc; }
.cal__day--today { background: rgba(var(--brand-rgb), .05); }
.cal__day--today .cal__n { background: var(--brand); color: #fff; }
.cal__day--blocked { background-image: repeating-linear-gradient(45deg, rgba(150,150,160,.10),
  rgba(150,150,160,.10) 6px, transparent 6px, transparent 12px); }
.cal__n { font-size: 12.5px; font-weight: 620; color: var(--ink-2); display: inline-flex;
  align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 50%; }
.cal__ev { display: block; font-size: 11.5px; padding: 3px 6px; border-radius: 5px; margin-top: 4px;
  background: var(--info-bg); color: #2b5484; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-left: 3px solid var(--info); }
.cal__ev:hover { text-decoration: none; filter: brightness(.97); }
.cal__ev--over { background: var(--crit-bg); color: #8f2626; border-left-color: var(--crit); }
.cal__ev--soon { background: var(--warn-bg); color: #7d5710; border-left-color: var(--warn); }
.cal__ev--done { background: var(--ok-bg); color: #14663f; border-left-color: var(--ok); text-decoration: line-through; }

/* ---------- Stream ---------- */

.stream { position: relative; }
.stream__item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.stream__item:last-child { border-bottom: 0; }
.stream__body { flex: 1; min-width: 0; }
.stream__meta { font-size: 12.5px; color: var(--ink-3); margin-bottom: 3px; }
.stream__text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.stream__item--activity .stream__text { color: var(--ink-2); font-size: 13.5px; }
.stream__marker { width: 28px; height: 28px; border-radius: 50%; background: var(--line-2);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-3); flex: 0 0 auto; }

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

.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(160deg, var(--sidebar) 0%, color-mix(in srgb, var(--sidebar) 78%, var(--brand)) 100%); }
.guest__box { width: 100%; max-width: 400px; background: var(--card); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 32px; }
.guest__logo { text-align: center; margin-bottom: 22px; }
.guest__logo img { max-height: 52px; max-width: 190px; }
.guest__logo .name { font-size: 20px; font-weight: 680; letter-spacing: -.02em; }
.guest h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.guest .sub { text-align: center; color: var(--ink-3); font-size: 14px; margin-bottom: 22px; }
.guest__foot { text-align: center; margin-top: 18px; font-size: 13.5px; }

/* ---------- Sonstiges ---------- */

.flash-wrap { position: fixed; top: 14px; right: 14px; z-index: 100; width: min(380px, calc(100vw - 28px)); }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; font-size: 14px;
  box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--line); animation: slide-in .2s ease-out; }
.flash--ok { border-left: 4px solid var(--ok); }
.flash--err { border-left: 4px solid var(--crit); }
.flash--warn { border-left: 4px solid var(--warn); }
.flash button { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 17px; line-height: 1; padding: 0; }
@keyframes slide-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

details.disclose { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; background: var(--card); }
details.disclose > summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--ink-3); transition: transform .15s; }
details.disclose[open] > summary::before { transform: rotate(90deg); }
details.disclose > div { padding: 0 16px 16px; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  background: #f2f4f7; padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.copybox { display: flex; gap: 8px; align-items: center; }
.copybox input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }

.muted { color: var(--ink-3); }
.strike { text-decoration: line-through; color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mb0 { margin-bottom: 0; }
.mt16 { margin-top: 16px; }
.hide { display: none; }

/* ---------- Responsiv ---------- */

@media (max-width: 1000px) {
  .grid--main, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10,15,25,.45); z-index: 40; }
  .menu-toggle { display: block; }
  .content { padding: 16px 14px 48px; }
  .topbar { padding: 12px 14px; }
  .grid--2, .grid--3, .grid--4, .grid--main { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cal__day { min-height: 76px; padding: 5px; }
  .cal__ev { font-size: 10.5px; }
}

@media print {
  .sidebar, .topbar, .flash-wrap, .btn, .tabs { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; }
}
