:root {
  --bg: #f3f4f6; --card: #ffffff; --line: #dde1e6; --line2: #eceef1;
  --text: #16191d; --muted: #4b5563; --accent: #b86e00; --link: #1d4ed8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); }
h1 { font-size: 26px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.mono, code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 600; }
.muted { color: var(--muted); }
.grow { flex: 1 1 auto; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 10px 24px; background: #16191d; color: #fff; }
.topbar a { color: #e5e7eb; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.brand { font-weight: 700; font-size: 18px; color: #fff !important; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; flex: 1 1 auto; }
.me { display: flex; align-items: center; gap: 12px; }
.me form { margin: 0; }

.wrap { max-width: 1360px; margin: 0 auto; padding: 24px 16px 48px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.head h1, .head h2 { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .grow { flex: 999 1 560px; min-width: 0; }
.cols > .side { flex: 1 1 340px; min-width: 0; }
.scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
tr.overdue td { background: #fff7e6; }
tr.inactive td { color: #8b939e; }

.btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid #c7ccd3; background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #f0f1f3; }
.btn.primary { background: #16191d; color: #fff; border-color: #16191d; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.topbar .btn.small { background: transparent; color: #e5e7eb; border-color: #4b5563; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 20px; }
.form .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input, select { font: inherit; padding: 9px 10px; border: 1px solid #c7ccd3; border-radius: 8px; background: #fff; min-height: 40px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters input[name=q] { flex: 1 1 260px; }

.flash { padding: 12px 16px; border-radius: 8px; background: #dff3ec; color: #0f5e4b; margin-bottom: 16px; font-weight: 600; }
.error { padding: 12px 16px; border-radius: 8px; background: #fde4e1; color: #8a1f15; font-weight: 600; }
.error-inline { color: #b42318; font-weight: 600; }
.alert { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 14px 18px; border-radius: 10px; margin-bottom: 16px; }
.alert.warn { background: #fff4dc; border: 1px solid #f0c66e; color: #3d2b00; }
.alert.info { background: #e8f0ff; border: 1px solid #a9c1f5; color: #1d3f8a; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; border-bottom-width: 4px; }
.kpi span { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi strong { font-size: 30px; line-height: 1.1; }
.kpi-lager { border-bottom-color: #2e9c80; } .kpi-ausgegeben { border-bottom-color: #3b6fe0; }
.kpi-defekt { border-bottom-color: #d1453b; } .kpi-pruefung { border-bottom-color: #d49b12; }
.kpi-ladeplatz { border-bottom-color: #8a63e0; }

.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.tag-lager { background: #dff3ec; color: #0f5e4b; }
.tag-ausgegeben { background: #e1ebff; color: #1d3f8a; }
.tag-defekt { background: #fde4e1; color: #8a1f15; }
.tag-pruefung { background: #fff1cc; color: #6b4a00; }
.tag-ladeplatz { background: #ece4ff; color: #4b2a99; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.dot { width: 10px; height: 10px; border-radius: 5px; background: #c7ccd3; flex-shrink: 0; }
.dot.on { background: #2e9c80; }
.nowrap { white-space: nowrap; }
