/* Formulare */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem 1.1rem; align-items: end; }
.form-actions { grid-column: 1 / -1; display: flex; gap: .8rem; align-items: center; }
.contents { display: contents; border: 0; padding: 0; margin: 0; }
.field select { font: inherit; }
.opt, .req { font-style: normal; font-weight: 500; font-size: .75rem; color: var(--muted); margin-left: .25rem; }
.req { color: var(--warning); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 600; font-size: .9rem; padding: .55rem 0; }
.check input { margin-top: .2rem; accent-color: var(--primary); width: 1.05rem; height: 1.05rem; }
.hint { font-weight: 400; font-size: .82rem; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.field-emp.needs select { border-color: var(--warning); background: var(--warning-soft); }
.save-state { font-size: .82rem; color: var(--muted); }
.text-ok { color: var(--success); font-weight: 600; }
.text-warn { color: var(--warning); font-weight: 600; }
.pill-warn { background: var(--warning-soft); color: var(--warning); }
.crumb { font-size: .82rem; margin-bottom: .2rem; }
.crumb a { text-decoration: none; }
kbd { font-family: inherit; font-size: .75rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; background: var(--surface); }
.keys { margin: -.4rem 0 .9rem; }

/* Bogen */
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.sheet-side { position: sticky; top: 1rem; display: grid; gap: 1.25rem; }
.sheet-side .card { margin-bottom: 0; }
.player { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.player p { margin: 0; }
.crit-block { padding-bottom: .4rem; }
.crit-block-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: .6rem; margin-bottom: .2rem; }
.crit { border-bottom: 1px solid var(--border); padding: .9rem .6rem; margin: 0 -.6rem; border-left: 3px solid transparent; border-radius: 4px; outline: none; display: grid; gap: .55rem; }
.crit:last-child { border-bottom: 0; }
.crit.r-full { border-left-color: var(--success); }
.crit.r-fail { border-left-color: var(--danger); }
.crit.r-partial { border-left-color: var(--warning); }
.crit.r-na { border-left-color: var(--border); }
.crit.is-current { border-left-color: var(--primary); background: var(--primary-soft); }
.crit-head { display: grid; grid-template-columns: 3rem 1fr auto; gap: .6rem; align-items: start; }
.crit-code { color: var(--muted); padding-top: .1rem; }
.crit-title { display: grid; }
.crit-points { font-weight: 700; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.rating { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: 3.6rem; }
.rate { position: relative; }
.rate input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rate span { display: inline-block; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--surface); color: var(--text); cursor: pointer; }
.rate input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.rate-full input:checked + span { background: var(--success); border-color: var(--success); color: #fff; }
.rate-partial input:checked + span { background: var(--warning); border-color: var(--warning); color: #fff; }
.rate-fail input:checked + span { background: var(--danger); border-color: var(--danger); color: #fff; }
.rate-na input:checked + span { background: var(--muted); border-color: var(--muted); color: #fff; }
.rate.is-off span { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.rate input:disabled { cursor: not-allowed; }
.crit-notes { display: grid; grid-template-columns: 5.5rem 1fr; gap: .6rem; margin-left: 3.6rem; }
.crit-notes .field { font-size: .78rem; font-weight: 600; color: var(--muted); gap: .15rem; }
.crit-notes input, .crit-notes textarea { padding: .35rem .5rem; font-size: .9rem; resize: vertical; }
.req-cond { display: none; }
.needs-note .req-cond { display: inline; }
.is-missing { border-color: var(--warning) !important; background: var(--warning-soft) !important; }
.help { margin-left: 3.6rem; font-size: .85rem; }
.help summary { cursor: pointer; color: var(--primary); font-weight: 600; width: max-content; }
.help dl { display: grid; grid-template-columns: 8rem 1fr; gap: .25rem .8rem; margin: .5rem 0 0; padding: .6rem .8rem; background: var(--bg); border-radius: var(--radius); }
.help dt { font-weight: 700; }
.help dd { margin: 0; }
.crit-state { margin-left: 3.6rem; color: var(--muted); min-height: 1em; }
.crit-state.is-bad { color: var(--danger); font-weight: 600; }
.ko-item { border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: .6rem; display: grid; gap: .4rem; }
.ko-item.is-hit { border-color: var(--danger); background: var(--danger-soft); }
.ko-item .crit-notes, .ko-item .crit-state { margin-left: 1.6rem; }
.grid-2.tight { margin-bottom: 0; gap: 1rem; }
.grid-2.tight textarea { resize: vertical; }

.score-card { display: grid; gap: .35rem; }
.score-value { font-size: 2.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.score-value small { font-size: 1.1rem; font-weight: 600; color: var(--muted); }
.score-verdict { min-height: 1.6rem; }
.meter { position: relative; height: 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); margin: .3rem 0 .4rem; }
.meter-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: var(--primary); transition: width .25s; }
.meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); }
.score-facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0; font-size: .88rem; }
.score-facts dt { color: var(--muted); }
.score-facts dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.todo { margin: 0 0 1rem; padding-left: 1.1rem; font-size: .88rem; display: grid; gap: .3rem; }
.todo-done { display: none; }
.todo:empty { display: none; }
.todo:empty + .todo-done { display: block; }

@media (max-width: 1100px) {
  .sheet { grid-template-columns: 1fr; }
  .sheet-side { position: static; order: -1; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .rating, .crit-notes, .help, .crit-state { margin-left: 0; }
  .crit-notes { grid-template-columns: 1fr; }
}
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
.player .pill { white-space: nowrap; }

/* Admin */
.subnav { display: flex; flex-wrap: wrap; gap: .3rem; margin: -.4rem 0 1.25rem; border-bottom: 1px solid var(--border); }
.subnav a { padding: .5rem .8rem; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--text); }
.subnav a.is-active { color: var(--primary); border-bottom-color: var(--primary); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain:disabled input, fieldset.plain:disabled select, fieldset.plain:disabled textarea { background: var(--bg); color: var(--muted); }
.with-unit { display: inline-flex; align-items: center; gap: .4rem; }
.with-unit input { width: 6rem; text-align: right; }
.field-inline { margin-bottom: .8rem; }
.ko-edit { display: grid; gap: .6rem; }
.ko-row { display: grid; grid-template-columns: 2.4rem 2fr 1fr 9rem; gap: .4rem .8rem; align-items: end; border: 1px dashed var(--border); border-radius: var(--radius); padding: .6rem .8rem; }
.ko-row.ko-aktiv { border: 1px solid var(--danger); background: var(--danger-soft); }
.ko-row.ko-vorschlag { border-style: solid; }
.ko-row .ko-num { align-self: center; }
.ko-row .ko-desc { grid-column: 2 / -1; }
.block-title { margin: 1.2rem 0 .3rem; font-size: 1rem; }
.points-table input.pts { width: 4.2rem; text-align: right; padding: .3rem .45rem; font: inherit; border: 1px solid var(--border); border-radius: var(--radius); }
.points-table input[type=checkbox] { width: 1.05rem; height: 1.05rem; accent-color: var(--primary); }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 1rem; align-items: center; padding: .8rem 1.2rem; margin: 0 0 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); }
.row-actions { display: flex; gap: .8rem; margin-top: 1rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.inline-form .field { flex: 1 1 10rem; }
.row-form { display: grid; grid-template-columns: 2fr 1.3fr 2.5rem 1.6rem auto; gap: .5rem; align-items: center; }
.row-form-3 { grid-template-columns: 1fr 2.5rem 1.6rem auto; }
.row-form input:not([type=checkbox]), .row-form select { font: inherit; font-size: .9rem; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.row-form-user { grid-template-columns: 1.6fr 1.1fr 1.3fr 1.6rem auto; }
.table td[colspan] { padding: .35rem .6rem; }
tr.is-inactive { opacity: .55; }
.users-table .actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.grid-2.top { align-items: start; }
.secret { font-family: ui-monospace, Consolas, monospace; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: .1rem .4rem; user-select: all; }
.secret-box p { margin: 0 0 .3rem; }
.qr { display: block; margin: .5rem 0; background: #fff; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); }
.steps { padding-left: 1.2rem; display: grid; gap: .45rem; }
.nowrap { white-space: nowrap; }
.who-link { font-size: .8rem; color: var(--side-muted); margin-top: .2rem; }
.who-link:hover, .who-link.is-active { color: var(--side-text); }
@media (max-width: 900px) {
  .ko-row, .row-form, .row-form-3, .row-form-user { grid-template-columns: 1fr; }
  .ko-row .ko-desc { grid-column: auto; }
}
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }

/* Kalibrierung */
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
fieldset.people { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .9rem .7rem; display: flex; flex-wrap: wrap; gap: 0 1.4rem; }
fieldset.people legend { padding: 0 .3rem; }
.calib-scroll { overflow-x: auto; }
.table.calib td, .table.calib th { vertical-align: top; }
.table.calib tr.diff > td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.vote-h { min-width: 8rem; }
.vote { min-width: 8rem; }
.vote-note { display: block; font-size: .78rem; color: var(--muted); margin-top: .2rem; max-width: 16rem; }
.chip { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #fff; white-space: nowrap; }
.chip-full { background: var(--success); }
.chip-partial { background: var(--warning); }
.chip-fail { background: var(--danger); }
.chip-na { background: var(--muted); }
.cons { min-width: 15rem; }
.cons select, .cons textarea { width: 100%; font: inherit; font-size: .88rem; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .3rem; background: var(--surface); }
.score-facts.big dd { font-size: 1.2rem; }
@media (max-width: 900px) { .span-2 { grid-column: auto; } }
.pill { white-space: nowrap; }

/* Auditieren und Meine Ergebnisse */
.head-score { display: grid; justify-items: end; gap: .3rem; }
.head-score .score-value { font-size: 2.2rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.row-between p { margin: 0; }
.veto { border-color: var(--danger); background: var(--danger-soft); }
.veto blockquote { margin: .4rem 0 .6rem; padding: .6rem .9rem; background: var(--surface); border-left: 3px solid var(--danger); border-radius: 4px; white-space: pre-wrap; }
.facts { display: grid; grid-template-columns: 9rem 1fr; gap: .3rem 1rem; margin: 0; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem 1rem; align-items: end; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.filter-actions { display: flex; gap: .8rem; align-items: center; }
.table.audit td { vertical-align: top; }
.table.audit td:first-child { width: 45%; }
.table.audit .help { margin-left: 0; margin-top: .2rem; }
.audit-edit.is-changed { background: var(--warning-soft); border-radius: var(--radius); }
.audit-edit .reason { width: 100%; font: inherit; font-size: .85rem; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: var(--radius); }
.audit-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; }
.audit-actions .grow { flex: 1 1 20rem; }
.fb-good { border-top: 3px solid var(--success); }
.fb-improve { border-top: 3px solid var(--warning); }
@media (max-width: 900px) { .filter-grid { grid-template-columns: 1fr 1fr; } .facts { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .head-score { justify-items: start; }
  .table.audit, .table.audit tbody, .table.audit tr, .table.audit td { display: block; width: 100%; }
  .table.audit thead { display: none; }
  .table.audit tr { border-bottom: 1px solid var(--border); padding: .4rem 0; }
  .table.audit td { border: 0; padding: .2rem 0; }
  .table.audit td:first-child { width: 100%; }
}

/* Dashboard */
.kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-value.warn { color: var(--warning); }
.text-bad { color: var(--danger); }
.card.filter-grid { padding-bottom: 1rem; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .axis.small { font-size: 9px; }
.chart .thr { fill: var(--danger); }
.chart .threshold { stroke: var(--danger); stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart .line-main { fill: none; stroke: var(--primary); stroke-width: 2.5; }
.chart .line-main-dot { fill: var(--primary); }
.chart .line-cmp { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart .line-cmp-dot { fill: var(--muted); }
.chart .val { fill: var(--text); font-size: 11px; font-weight: 700; font-family: var(--font); }
.chart .bar { fill: var(--warning); }
.chart .bar-alt { fill: var(--primary); }
.chart .lbl { fill: var(--text); font-size: 11.5px; }
.legend { display: inline-block; width: 18px; height: 3px; vertical-align: middle; background: var(--primary); }
.legend-cmp { background: var(--muted); }
.table.compact td, .table.compact th { padding: .35rem .5rem; }
/* Feedbackbogen */
.sheet-doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.6rem 1.9rem; box-shadow: var(--shadow); max-width: 900px; }
.doc-head { display: flex; justify-content: space-between; gap: 1.5rem; border-bottom: 2px solid var(--primary); padding-bottom: .9rem; margin-bottom: 1rem; }
.doc-kicker { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--muted); font-weight: 700; margin: 0; }
.doc-title { font-size: 1.5rem; margin: .1rem 0; }
.doc-facts { display: grid; grid-template-columns: auto auto; gap: .15rem 1rem; margin: 0; font-size: .9rem; }
.doc-facts dt { color: var(--muted); }
.doc-facts dd { margin: 0; text-align: right; font-weight: 700; }
.doc-sec { padding: .8rem 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.doc-sec:last-child { border-bottom: 0; }
.doc-sec h3 { font-size: 1rem; margin-bottom: .5rem; color: var(--primary); }
.doc-list { margin: .3rem 0; padding-left: 1.1rem; }
.doc-list li { margin-bottom: .25rem; }
.doc-field { margin-bottom: .7rem; }
.doc-steps { margin: 0; padding-left: 1.2rem; font-size: .92rem; }
.goal-row { display: grid; grid-template-columns: 3fr 2fr; gap: .8rem; }
.sign { border-top: 1px solid var(--text); padding-top: .4rem; margin-top: 1.2rem; }
@media (max-width: 1100px) { .kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpis-6 { grid-template-columns: 1fr 1fr; } .doc-head { flex-direction: column; } .goal-row { grid-template-columns: 1fr; } .sheet-doc { padding: 1rem; } }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .sidebar, .demo-band, .no-print, .sticky-actions { display: none !important; }
  .shell { display: block; background: none; }
  .content { padding: 0; max-width: none; }
  .sheet-doc { border: 0; box-shadow: none; padding: 0; max-width: none; }
  fieldset.plain:disabled input, fieldset.plain:disabled textarea, .field input, .field textarea, .field select { border: 0; border-bottom: 1px solid #999; background: none; padding: .1rem 0; }
  a { color: inherit; text-decoration: none; }
}
