:root {
  --ink: #1d2a33;
  --muted: #5f6b73;
  --line: #dde3e6;
  --bg: #f4f6f5;
  --card: #ffffff;
  --brand: #24443c;
  --brand-2: #e8efec;
  --accent: #b8862f;
  --ok: #2f6b4f;
  --ok-bg: #e6f2eb;
  --err: #a33a2c;
  --err-bg: #fbeae7;
  --info-bg: #eaf0f6;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 1.6rem; margin: 28px 0 18px; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.top { background: var(--brand); color: #fff; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 600; }
.brand small { display: block; font-weight: 400; opacity: .75; font-size: .8rem; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; letter-spacing: .02em; }
.user { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 0; }
.nav a { color: #fff; opacity: .8; text-decoration: none; padding: 10px 12px; white-space: nowrap; border-bottom: 3px solid transparent; font-size: .95rem; }
.nav a:hover { opacity: 1; }
.nav a.active { opacity: 1; border-bottom-color: var(--accent); }

main { padding-bottom: 48px; min-height: 60vh; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.stat { display: block; text-decoration: none; color: inherit; }
.stat strong { display: block; font-size: 2rem; line-height: 1.1; color: var(--brand); }

label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #c5cdd2; border-radius: 8px; font: inherit; background: #fff; color: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[type=file] { font: inherit; max-width: 100%; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.row { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.inline { display: inline; }

.btn { display: inline-block; border: 0; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; }
.btn:hover { filter: brightness(1.1); }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.btn-ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn-light { background: var(--brand-2); color: var(--brand); }
.btn-danger { background: var(--err); }
.top .btn-ghost { color: #fff; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-err { background: var(--err-bg); color: var(--err); }
.alert-info { background: var(--info-bg); }
.alert code, .copy { word-break: break-all; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
td.num { text-align: right; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--brand-2); color: var(--brand); }
.badge-neu { background: #fdf0d9; color: #8a5a0b; }
.badge-in_bearbeitung { background: var(--info-bg); color: #2a4f78; }
.badge-erledigt { background: var(--ok-bg); color: var(--ok); }

.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 80%; padding: 12px 14px; border-radius: 12px; background: var(--brand-2); }
.msg.mine { align-self: flex-end; background: #fff; border: 1px solid var(--line); }
.msg .meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.msg p { margin: 0; white-space: pre-wrap; }
@media (max-width: 600px) { .msg { max-width: 100%; } }

.fotos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.fotos img { width: 140px; height: 105px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.pre { white-space: pre-wrap; }
.empty { padding: 8px 0; }

.login { max-width: 420px; margin: 40px auto; }
.foot { border-top: 1px solid var(--line); background: #fff; font-size: .85rem; color: var(--muted); }
.foot .wrap { display: flex; gap: 18px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

.prose h2 { margin-top: 28px; }
.prose p, .prose li { max-width: 72ch; }
.mt0 { margin-top: 0; margin-bottom: 14px; }
select.w-auto, input.w-auto { width: auto; max-width: 100%; }
textarea.short { min-height: 80px; }
.item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.item:last-child { border-bottom: 0; }
details summary { cursor: pointer; padding: 4px 0; }
details[open] summary { margin-bottom: 8px; }
td form input[type=text] { margin: 6px 0; }
.badge-person { background: #f1e8f7; color: #5b3478; }
.badge-alle { background: var(--brand-2); color: var(--brand); }
.badge-eigentuemer { background: #fdf0d9; color: #8a5a0b; }
.badge-beirat { background: #e3ecf8; color: #2a4f78; }
