/* LIEB-&-KÜHN-CRM – Farbwelt der Website: Weiß, Grau, Gold; serifenlos. */
:root { --paper:#f7f6f3; --sand:#efece6; --card:#fff; --ink:#3a3a3a; --muted:#7a7a7a; --line:#e4e0d8;
  --gold:#d19200; --gold-text:#9a6e00; --gold-soft:#f6e9c8; --ok:#2f7d52; --err:#a32d2d; --warn:#a35d00; --r:10px; }
* { box-sizing: border-box; }
body.adm { margin: 0; font: 400 15.5px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--paper); color: var(--ink); display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
a { color: var(--gold-text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.side { background: #2e2e2e; color: #eee; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side__brand { color: #fff; text-decoration: none; padding: 0 8px 16px; display: block; }
.side__brand img { width: 150px; display: block; filter: brightness(0) invert(1); }
.side__brand small { display: block; font: 600 .66rem/1 system-ui; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-top: 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #e6e6e6; text-decoration: none; padding: 8px 10px; border-radius: 8px; display: flex; justify-content: space-between; }
.side nav a:hover { background: rgba(255,255,255,.08); }
.side nav a[aria-current="page"] { background: var(--gold); color: #fff; font-weight: 600; }
.side__h { margin: 16px 10px 4px; font: 600 .68rem/1 system-ui; letter-spacing: .14em; text-transform: uppercase; color: #9a9a9a; }
.side__foot { margin-top: auto; padding: 16px 8px 0; font-size: .85rem; display: grid; gap: 10px; }
.side__foot a { color: var(--gold); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--gold); text-decoration: underline; cursor: pointer; text-align: left; }
.main .linkbtn { color: var(--gold-text); }
.linkbtn.danger, .danger { color: var(--err) !important; }
.main { padding: 30px clamp(18px, 4vw, 44px) 80px; max-width: 1120px; width: 100%; }
h1 { font: 300 2rem/1.15 system-ui, sans-serif; letter-spacing: .02em; margin: 0 0 20px; }
h2 { font: 600 1.05rem/1.3 system-ui; margin: 0 0 12px; }
h3 { font: 600 .95rem system-ui; margin: 18px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.mt { margin-top: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; text-decoration: none; color: var(--ink); display: block; }
.stat b { display: block; font: 300 2rem/1.1 system-ui; }
.stat span { color: var(--muted); font-size: .88rem; }
.stat.alert b { color: var(--err); }
.muted { color: var(--muted); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.flash { background: var(--gold-soft); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-weight: 500; }
.flash.err { background: #f3d6d6; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-size: .88rem; font-weight: 600; }
.form label.check, label.inline { display: flex; gap: 8px; align-items: center; font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
textarea { resize: vertical; }
.btn { display: inline-block; font: 600 .92rem system-ui; background: var(--gold); color: #fff; border: 1px solid var(--gold); border-radius: 999px; padding: 11px 22px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #b17b00; border-color: #b17b00; }
.btn.alt { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.alt:hover { background: var(--ink); color: #fff; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff !important; }
.btn.small { padding: 7px 15px; font-size: .86rem; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 8px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--sand); color: var(--ink); white-space: nowrap; }
.tag.warn { background: #f7e3c4; color: var(--warn); }
.tag.ok { background: #d9efe2; color: var(--ok); }
.tag.err { background: #f3d6d6; color: var(--err); }
.tag.gold { background: var(--gold-soft); color: var(--gold-text); }
.tabsnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tabsnav a { text-decoration: none; padding: 7px 14px; border-radius: 999px; background: var(--sand); color: var(--ink); font-size: .9rem; }
.tabsnav a[aria-current="page"] { background: var(--ink); color: #fff; }
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: .92rem; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--sand); font-size: .8rem; color: var(--muted); font-weight: 600; }
.tbl td.r, .tbl th.r { text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; border-radius: var(--r); margin-bottom: 18px; max-width: 100%; }
.tbl-wrap .tbl { margin: 0; min-width: 560px; }
.kv { display: grid; gap: 6px; margin: 0; }
.kv div { display: flex; gap: 12px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.kv dt { width: 110px; color: var(--muted); flex: none; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.msg { white-space: pre-wrap; background: var(--paper); padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
code { background: var(--sand); padding: 2px 7px; border-radius: 6px; font-size: .92rem; overflow-wrap: anywhere; }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 10px; }
.auth { grid-column: 1 / -1; max-width: 420px; margin: 12vh auto; width: 100%; padding: 0 16px; }
body.adm:not(:has(.side)) { display: block; }
.badge { background: var(--gold-soft); color: var(--ink); border-radius: 999px; padding: 0 8px; font-size: .75rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar, .scrim { display: none; }
.main, .form > *, .cols > *, .grid2 > *, .card, .actions > * { min-width: 0; }

/* Rechnungsformular: Positionen */
.lines { display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 1fr 90px 120px 110px; gap: 8px; align-items: start; background: var(--paper); padding: 10px; border-radius: 8px; }
.line textarea { min-height: 62px; }
.line .amt { text-align: right; padding-top: 10px; font-weight: 600; white-space: nowrap; }
.blocks { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.chip { font: 500 .85rem system-ui; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gold); background: #fff; color: var(--gold-text); cursor: pointer; }
.chip:hover { background: var(--gold-soft); }
.sums { text-align: right; display: grid; gap: 2px; margin-top: 10px; }
.sums b { font-size: 1.15rem; }

/* Zahlungsseite */
.paybox { max-width: 520px; margin: 8vh auto; padding: 0 16px; }
.paybox .card { padding: 28px; }
.paybox img.logo { width: 170px; display: block; margin: 0 auto 22px; }

@media (max-width: 1023px) {
  body.adm { display: block; }
  .topbar { display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 60; background: #2e2e2e; color: #fff; padding: 8px 14px; min-height: 56px; }
  .topbar__brand { color: #fff; text-decoration: none; font-weight: 600; letter-spacing: .12em; }
  .topbar__brand small { color: var(--gold); margin-left: 8px; font-size: .62rem; text-transform: uppercase; letter-spacing: .2em; }
  .burger { width: 44px; height: 44px; border: 1.5px solid rgba(255,255,255,.35); border-radius: 10px; background: transparent; cursor: pointer; display: grid; place-content: center; gap: 5px; padding: 0; }
  .burger i { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  body.nav-open .burger i:nth-of-type(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .burger i:nth-of-type(2) { opacity: 0; }
  body.nav-open .burger i:nth-of-type(3) { transform: translateY(-7px) rotate(-45deg); }
  .side { position: fixed; inset: 56px auto 0 0; width: min(86vw, 320px); height: calc(100dvh - 56px); z-index: 50; transform: translateX(-104%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; padding-top: 12px; }
  body.nav-open .side { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; box-shadow: 0 0 60px rgba(0,0,0,.45); }
  .scrim { display: block; position: fixed; inset: 56px 0 0 0; z-index: 40; background: rgba(20,20,20,.55); }
  .scrim[hidden] { display: none; }
  body.nav-open { overflow: hidden; }
  .side__brand { display: none; }
  .side nav a { padding: 12px; font-size: 1.02rem; }
  .main { padding: 20px 16px 96px; }
  h1 { font-size: 1.7rem; }
}
@media (max-width: 860px) {
  .cols, .cols3 { grid-template-columns: 1fr; }
  .line { grid-template-columns: 1fr 1fr; }
  .line textarea { grid-column: 1 / -1; }
  .btn { padding: 13px 22px; }
  input, select, textarea { padding: 12px 13px; font-size: 16px; }
  .card { padding: 16px; }
  .tbl-wrap .tbl { min-width: 640px; }
}
@media (prefers-reduced-motion: reduce) { .side, .burger i { transition: none !important; } }
.line[hidden] { display: none; }
