/* Streife NFC – Büro-Oberfläche */
:root {
  --bg: #f4f5f2; --surface: #fff; --soft: #fafaf8; --line: #e2e5e8; --line2: #eef0f2; --input: #cfd5da;
  --text: #141a22; --text2: #3d4752; --muted: #5b6673;
  --side: #0f141b; --side2: #1a222d;
  --amber: #f5b021; --amber-t: #7a4f00; --amber-bg: #fff3d6; --warn-bg: #fff8e6; --warn-line: #f0d58a; /* nur für Warnungen */
  --accent: #c8102e; --accent-h: #a30d25; --accent-t: #a30d25; --accent-l: #ff5c66; --accent-bg: #fde8ea; /* Firmenfarbe Rot */
  --ok: #146c43; --ok-bg: #e3f5ec; --rot: #b42318; --rot-bg: #fde4e1;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; }
a { color: var(--accent-t); }
a:hover { color: #7a0a1c; }
h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.01em; }
h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
p { line-height: 1.5; }
code { background: var(--line2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.grow1 { flex-grow: 1; min-width: 0; }
.c-ok { color: var(--ok); } .c-warn { color: var(--amber-t); } .c-rot { color: var(--rot); }

/* Grundlayout */
.shell { display: flex; min-height: 100vh; }
.side { width: 240px; flex-shrink: 0; background: var(--side); color: #eef2f6; display: flex; flex-direction: column; gap: 28px; padding: 28px 16px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 0 8px; }
.brand-k { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--accent-l); }
.brand-k.dark { color: var(--accent-t); margin-bottom: 6px; }
.brand-n { font-family: var(--display); font-weight: 800; font-size: 24px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; color: #c9d2dc; text-decoration: none; font-weight: 600; }
.side-nav a:hover { background: var(--side2); color: #fff; }
.side-nav a.on { background: #3a1216; color: var(--accent-l); }
.side-foot { margin-top: auto; padding: 14px; border-radius: 12px; background: var(--side2); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.side-foot a { color: #c9d2dc; }
.main { flex-grow: 1; min-width: 0; padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.two-col { display: flex; gap: 16px; align-items: flex-start; }
.aside { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.card.narrow { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.card h1 { font-size: 26px; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.panel.pad { padding: 18px 20px; }
.panel-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; }
.panel.inactive { opacity: 0.7; }
.empty { padding: 20px; color: var(--muted); }
.flash { padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-err { background: var(--rot-bg); color: var(--rot); }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi-l { font-size: 14px; color: var(--muted); }
.kpi-v { font-family: var(--display); font-weight: 800; font-size: 34px; }
.kpi-s { font-size: 13px; color: var(--muted); }
.small-kpis .kpi-v { font-size: 22px; }
.live-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1f9d63; margin-right: 6px; }

/* Tabellen */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--soft); padding: 10px 14px; }
.tbl td { padding: 11px 14px; border-top: 1px solid var(--line2); vertical-align: middle; }
.tbl tr.inactive td { color: var(--muted); }
.tbl tr.row-flag td { background: var(--warn-bg); }
.tbl tr.row-new td { background: var(--accent-bg); }
.tbl tr[data-href] { cursor: pointer; }
.tbl tr[data-href]:hover td { background: var(--soft); }
.w-num { width: 36px; }
.actions { display: flex; gap: 6px; align-items: center; }

/* Chips & Punkte */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: #fdeecb; color: var(--amber-t); }
.chip-rot { background: var(--rot-bg); color: var(--rot); }
.chip-grau { background: var(--line2); color: var(--text2); }
.chip-amber { background: var(--accent-bg); color: var(--accent-t); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-ok { background: #1f9d63; } .dot-warn { background: var(--amber); } .dot-rot { background: var(--rot); } .dot-grau { background: #9aa7b5; }
.mini { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line2); }
.mini:first-of-type { border-top: 0; }
.alert-line { padding: 8px 0; border-top: 1px solid var(--warn-line); line-height: 1.45; }
.alert-line:first-of-type { border-top: 0; }

/* Buttons & Formulare */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--input); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--soft); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); color: #fff; }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; }
.btn-dark:hover { background: #2b3440; color: #fff; }
.btn-danger { color: var(--rot); border-color: #f1b8b0; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.link-btn { border: 0; background: none; color: var(--accent-t); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; padding: 0 4px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .door-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text2); }
input, select, textarea { font: inherit; font-size: 15px; font-weight: 400; color: var(--text); background: #fff; border: 1px solid var(--input); border-radius: 10px; padding: 0 12px; min-height: 42px; }
textarea { padding: 10px 12px; resize: vertical; }
input[type=checkbox] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.inline, .inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form input { min-height: 34px; width: 150px; }
.inline-label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.steps { margin: 16px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--text2); }

/* Kunden-Gruppen */
.group-head { display: flex; gap: 12px; align-items: center; padding: 14px 20px; background: var(--soft); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.group-title { font-size: 17px; font-weight: 700; }
.url { word-break: break-all; color: var(--text2); }
.copy { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; vertical-align: middle; }
.copy:hover { background: var(--line2); color: var(--text); }
.copy.done { color: var(--ok); }
.door-edit { border-top: 1px solid var(--line2); padding: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.door-edit:first-of-type { border-top: 0; }
.door-edit.inactive { opacity: 0.65; }
.door-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.w-sort input { width: 70px; }
.door-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Soll-Plan */
.plan-tbl td { padding: 8px 10px; }
.in-num { width: 70px; }
.in-time { width: 110px; }
.in-mail { width: 100%; min-width: 180px; }
.days { display: flex; gap: 2px; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; }
.days span { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--input); font-size: 12px; font-weight: 600; color: var(--muted); }
.days input:checked + span { background: var(--text); border-color: var(--text); color: #fff; }
.days input:focus-visible + span { outline: 2px solid var(--accent); }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.info-grid p { margin: 6px 0 0; }

/* Scan-Details */
.facts { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; margin: 0 0 16px; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; }
.gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery img { width: 220px; height: 165px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* Bericht */
.report { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 40px 44px; max-width: 900px; display: flex; flex-direction: column; gap: 18px; }
.report-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 3px solid var(--accent); }
.report-head h1 { font-size: 26px; margin: 4px 0; }
.report-head .right { text-align: right; }
.kicker-dark { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.issue { padding: 10px 14px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 8px; font-size: 14px; }
.report h2 { margin: 8px 0 0; }
.report-foot { border-top: 1px solid var(--line); padding-top: 12px; }

@media (max-width: 1100px) {
  .two-col { flex-direction: column; }
  .aside { width: 100%; }
  .kpis, .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin-top: 0; }
  .main { padding: 20px 16px 40px; }
  .panel { overflow-x: auto; }
  .kpis, .info-grid { grid-template-columns: 1fr 1fr; }
}
@media print {
  .side, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
  .report { border: 0; padding: 0; max-width: none; }
}

/* Marke & Hinweise */
.brand-s { margin-top: 4px; font-size: 11px; color: #8894a2; letter-spacing: 0.02em; }
.support { font-size: 12px; color: var(--muted); margin-top: -6px; }
.credit { margin-top: auto; padding-top: 24px; font-size: 12px; color: #8894a2; }
.center-credit { text-align: center; margin-top: 4px; padding-top: 8px; }
