/* Kaffeeliste – Gestaltung */
:root {
  --bg: #f6f3ef;
  --card: #ffffff;
  --ink: #2a2420;
  --ink-2: #5f564f;
  --muted: #8a8079;
  --line: #e4ddd5;
  --brand: #6b4226;
  --brand-2: #8a5a36;
  --accent: #c8873f;
  --ok: #1d7a45;
  --ok-bg: #e7f4ec;
  --err: #b3261e;
  --err-bg: #fbeaea;
  --info-bg: #eef3f9;
  --warn-bg: #fff6e0;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(40, 25, 10, .06), 0 4px 14px rgba(40, 25, 10, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand-2); }
a:hover { color: var(--brand); }
h1 { font-size: 1.6rem; margin: .2em 0 .5em; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 0 0 .6em; }
h3 { font-size: 1rem; margin: 1em 0 .4em; color: var(--ink-2); }
p { margin: .4em 0 .8em; }
[hidden] { display: none !important; }

/* Kopf */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.2rem; background: var(--brand); color: #fff; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; }
.topbar nav a, .topbar .who a { margin-left: 1rem; opacity: .9; }
.topbar nav a:hover, .topbar .who a:hover { opacity: 1; text-decoration: underline; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; }
.brand img { border-radius: 6px; }
.tag { font-size: .7rem; background: rgba(255,255,255,.2); padding: .1rem .45rem; border-radius: 99px; font-weight: 600; }
.who { display: flex; align-items: center; gap: .3rem; font-size: .9rem; }
.who .link { background: none; border: 0; color: #fff; cursor: pointer; font: inherit; margin-left: 1rem; opacity: .9; padding: 0; }
.who .link:hover { text-decoration: underline; }
.adminnav { display: flex; gap: .2rem; padding: .4rem 1rem; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; }
.adminnav a { padding: .45rem .7rem; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: .92rem; }
.adminnav a:hover { background: var(--bg); color: var(--ink); }
.adminnav a.active { background: var(--brand); color: #fff; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.2rem; }
.container.narrow { max-width: 760px; }
.footer { text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: .85rem; }
.footer a { color: var(--muted); }

/* Karten und Raster */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.card.alert { border-color: #e9b98d; background: #fffaf3; }
.card.tasks ul { margin: 0; padding-left: 1.2rem; }
.card.danger-zone { border-color: #edc6c3; }
.narrow-card { max-width: 520px; }
.hero { text-align: center; padding: 2rem 1rem 1rem; }
.hero h1 { font-size: 2.2rem; color: var(--brand); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.hero .actions { justify-content: center; }
.steps li { margin-bottom: .4rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem 1.6rem; }
.grid-side { display: grid; grid-template-columns: 240px 1fr; gap: 1.1rem; align-items: start; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.pagehead h1, .pagehead h2 { margin: 0; }
.actionrow { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-start; margin: .5rem 0 .8rem; }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow); }
.tile .label { font-size: .8rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.tile .value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: .8rem; color: var(--muted); }
.big { font-size: 1.35rem; font-weight: 700; margin: .2em 0; font-variant-numeric: tabular-nums; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); font-weight: 600; }
.table.compact th, .table.compact td { padding: .32rem .45rem; }
.table tbody tr:hover { background: #fbf9f7; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--err); }
.pos { color: var(--ok); }
tr.struck td { text-decoration: line-through; color: var(--muted); }
td.actions { white-space: nowrap; }
.muted { color: var(--muted); }
.hint { color: var(--ink-2); font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.pill { display: inline-block; font-size: .72rem; padding: .08rem .5rem; border-radius: 99px; background: #efe8e1; color: var(--ink-2); font-weight: 600; vertical-align: middle; }
.pill.gescannt { background: var(--info-bg); }
.pill.abgerechnet { background: var(--ok-bg); color: var(--ok); }
.badge { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 99px; background: var(--accent); color: #fff; font-size: .75rem; text-align: center; font-weight: 700; }
.top5 { list-style: none; padding: 0; margin: 0; }
.top5 li { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.pager { display: flex; gap: 1rem; justify-content: center; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: .7rem; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; color: var(--ink-2); font-weight: 600; }
.form label.check { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 400; color: var(--ink); }
.form label.check input { margin-top: .25rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .7rem 1rem; align-items: end; }
.grid-form > div { display: flex; align-items: end; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
legend { font-weight: 700; padding: 0 .3rem; }
input, select, textarea { font: inherit; color: var(--ink); padding: .5rem .6rem; border: 1px solid #cfc5bb; border-radius: 8px; background: #fff; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
input[type=checkbox] { width: auto; }
input.copy { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; background: #faf8f6; }
select.wide { min-width: 280px; }
.filterbar { display: flex; gap: .7rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filterbar label { display: flex; flex-direction: column; font-size: .8rem; color: var(--ink-2); gap: .2rem; }
.inline { display: inline; }
.inline-form { display: flex; gap: .3rem; }
.inline-form input { min-width: 160px; padding: .3rem .5rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .95rem; border-radius: 8px; border: 1px solid #cfc5bb; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2; }
.btn:hover { background: #f7f2ed; color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #57351e; }
.btn.danger { color: var(--err); border-color: #e6b7b3; }
.btn.danger:hover { background: var(--err-bg); }
.btn.small { padding: .3rem .65rem; font-size: .84rem; }
details.pop { display: inline-block; position: relative; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
details.pop[open] > .form { position: absolute; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem; width: 320px; box-shadow: 0 8px 24px rgba(0,0,0,.12); margin-top: .3rem; }
details > summary { cursor: pointer; }

/* Meldungen */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); border-color: #bfe2cc; color: #145a33; }
.flash-error { background: var(--err-bg); border-color: #efc4c1; color: #8c1d17; }
.flash-info { background: var(--info-bg); border-color: #cbd9ea; color: #23436b; }

/* Diagramme */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.1rem; }
.charts .card { margin: 0; }
figure.chart { margin: 0; }
figure.chart figcaption { font-weight: 700; margin-bottom: .3rem; }
figure.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #ece6df; stroke-width: 1; }
.chart .baseline { stroke: #b9aea3; stroke-width: 1; }
.chart .tick { fill: var(--ink-2); font-size: 11px; font-family: inherit; }
.chart .bar.s1, .chart .dot.s1 { fill: var(--s1); } .chart .line.s1 { stroke: var(--s1); }
.chart .bar.s2, .chart .dot.s2 { fill: var(--s2); } .chart .line.s2 { stroke: var(--s2); }
.chart .bar.s3, .chart .dot.s3 { fill: var(--s3); } .chart .line.s3 { stroke: var(--s3); }
.chart .bar.s4, .chart .dot.s4 { fill: var(--s4); } .chart .line.s4 { stroke: var(--s4); }
.chart .bar.s5, .chart .dot.s5 { fill: var(--s5); } .chart .line.s5 { stroke: var(--s5); }
.chart .bar.s6, .chart .dot.s6 { fill: var(--s6); } .chart .line.s6 { stroke: var(--s6); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.dashed { stroke-dasharray: 6 4; }
.chart .dot { stroke: #fff; stroke-width: 2; }
.chart .bar:hover, .chart .dot:hover { opacity: .8; }
.legend { list-style: none; display: flex; gap: 1rem; flex-wrap: wrap; padding: 0; margin: 0 0 .3rem; font-size: .85rem; color: var(--ink-2); }
.legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.legend .key.s1 { background: var(--s1); } .legend .key.s2 { background: var(--s2); } .legend .key.s3 { background: var(--s3); }
.legend .key.s4 { background: var(--s4); } .legend .key.s5 { background: var(--s5); } .legend .key.s6 { background: var(--s6); }
.legend .key.dashed { height: 3px; border-radius: 0; vertical-align: 3px; }
.chart-table summary { font-size: .8rem; color: var(--muted); margin-top: .3rem; }

/* Scan-Prüfung */
.scan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.1rem; align-items: start; }
.scan-image canvas { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: crosshair; }
.scan-side { position: sticky; top: .8rem; max-height: calc(100vh - 1.6rem); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.scan-side input.count { width: 4.2rem; text-align: right; padding: .25rem .4rem; }
.scan-side select { width: 100%; margin-top: .3rem; }
.unsure { display: block; color: #a06a00; font-size: .75rem; }
canvas.namecrop { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; }
.scanimg { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }

/* Etagen */
.qrbox { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.qrbox .qr svg { display: block; }
.sidelist { display: flex; flex-direction: column; padding: .5rem; }
.sidelist a { padding: .4rem .6rem; border-radius: 6px; text-decoration: none; color: var(--ink-2); }
.sidelist a.active { background: var(--brand); color: #fff; }
.prose h2 { margin-top: 1.2em; }

@media (max-width: 860px) {
  .scan-layout, .grid-side { grid-template-columns: 1fr; }
  .scan-side { position: static; max-height: none; }
  .charts { grid-template-columns: 1fr; }
  .container { padding: .8rem; }
  h1 { font-size: 1.35rem; }
}
@media print {
  .topbar, .adminnav, .footer, .btn, form { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}
.danger-zone input[name=grund] { min-width: min(360px, 100%); }

/* Nachrichten */
.radio-row { display: flex; gap: .4rem 1.4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.ziel-box { border-top: 1px solid var(--line); padding-top: .8rem; display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; }
.personen-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .2rem 1rem; max-height: 420px; overflow: auto; width: 100%; }
.ziel-box .filterbar { width: 100%; margin-bottom: .4rem; }
