/* Riccardo Berichtssystem – zentrales Stylesheet (CI: dunkles Anthrazit + Abteilungs-Akzent) */
:root {
  --brand:  #1a1a18;
  --accent: #c8973e;
  --red:    #c0392b;
  --green:  #27ae60;
  --yellow: #f39c12;
  --bg:     #f0ede8;
  --card:   #ffffff;
  --border: #e0dbd2;
  --text:   #1a1a18;
  --muted:  #888070;
  --soft:   #faf9f7;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 15px; color: var(--text);
  min-height: 100vh; padding-bottom: 80px;
}
a { color: inherit; }

/* ── Banner & Navigation ── */
.banner { background: var(--brand); position: relative; overflow: hidden; }
.banner::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: var(--accent); opacity: 0.12;
}
.banner-inner { max-width: 980px; margin: 0 auto; padding: 26px 24px 22px; }
.banner-tag {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 2px; margin-bottom: 12px;
}
.banner h1 { font-family: 'DM Serif Display', serif; font-size: 26px; color: #fff; line-height: 1.2; margin-bottom: 5px; }
.banner p { color: #a8a29a; font-size: 13px; font-weight: 300; }

.nav {
  background: var(--brand); border-top: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 200;
}
.nav-inner {
  max-width: 980px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.nav a {
  color: rgba(255,255,255,0.75); text-decoration: none; font-size: 13px;
  padding: 11px 13px; display: inline-block; border-bottom: 2px solid transparent;
}
.nav a:hover { color: #fff; }
.nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav .spacer { flex: 1; }
.nav .who { color: rgba(255,255,255,0.55); font-size: 12px; padding-right: 8px; }
.badge-count {
  background: var(--red); color: #fff; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; margin-left: 5px;
}

/* ── Fortschritt ── */
.progress-wrap { position: sticky; top: 42px; z-index: 100; background: var(--brand); padding: 10px 0; }
.progress-inner { max-width: 700px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 14px; }
.progress-bar-bg { flex: 1; height: 6px; background: rgba(255,255,255,0.15); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s ease; width: 0%; }
.progress-label { font-size: 12px; color: rgba(255,255,255,0.7); white-space: nowrap; font-weight: 300; }
.progress-pct { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; min-width: 38px; text-align: right; }

.container { max-width: 700px; margin: 0 auto; padding: 0 16px; }
.container-wide { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* ── Karten ── */
.identity-card {
  background: var(--card); border-top: 6px solid var(--accent);
  border-radius: 0 0 8px 8px; padding: 26px 26px 22px; margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.identity-card h2 {
  font-size: 14px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 18px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:540px) { .field-grid { grid-template-columns: 1fr; } }
.field.wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 5px; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 6px;
  padding: 9px 12px; font-family: inherit; font-size: 14px;
  color: var(--text); background: var(--soft); transition: border-color 0.18s; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: #fff; }
.field input[readonly] { background: #efece6; color: var(--muted); }
.field textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

.section-card {
  background: var(--card); border-radius: 10px; margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden;
  animation: fadeUp 0.4s ease both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.section-header { display: flex; align-items: center; gap: 14px; padding: 18px 24px 16px; border-bottom: 1px solid var(--border); }
.section-icon { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.section-header-text h3 { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.section-header-text p { font-size: 12px; color: var(--muted); font-weight: 300; }
.phase-badge {
  margin-left: auto; font-size: 9.5px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
.section-body { padding: 20px 24px; }

/* ── Checkliste ── */
.check-group { margin-bottom: 18px; }
.check-group:last-child { margin-bottom: 4px; }
.check-group-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--border);
}
.check-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px;
  border-radius: 7px; margin-bottom: 6px; cursor: pointer;
  transition: background 0.15s; border: 1.5px solid transparent;
}
.check-item:hover { background: #faf8f4; }
.check-item.checked { background: #f0faf2; border-color: #b8e8c4; }
.check-item input[type="checkbox"] { display: none; }
.check-box {
  width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 5px;
  flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; background: #fff;
}
.check-item.checked .check-box { background: var(--green); border-color: var(--green); }
.check-box-inner { display: none; color: #fff; font-size: 13px; font-weight: 700; line-height: 1; }
.check-item.checked .check-box-inner { display: block; }
.check-text { flex: 1; }
.check-label { font-size: 14px; color: var(--text); line-height: 1.45; }
.check-item.checked .check-label { color: var(--muted); text-decoration: line-through; text-decoration-color: #b0c8b4; }
.check-hint { font-size: 11.5px; color: #a09890; margin-top: 2px; font-weight: 300; }

.warn-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px; margin-left: 8px; vertical-align: middle; white-space: nowrap;
}
.warn-badge.red { background: #fde8e8; color: var(--red); }
.warn-badge.yellow { background: #fef6e4; color: #b06010; }

/* ── Doppelhaken Früh/Spät ── */
.dual-block { border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.dual-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: #faf8f4; }
.dual-row + .dual-row { border-top: 1px solid var(--border); }
.dual-box {
  width: 26px; height: 26px; border: 2px solid var(--border); border-radius: 6px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: #fff; transition: all .15s; color: #fff; font-size: 14px; font-weight: 700;
}
.dual-box.on { background: var(--accent); border-color: var(--accent); }
.dual-box span { display: none; }
.dual-box.on span { display: block; }
.dual-main { flex: 1; }
.dual-main .t { font-size: 13px; font-weight: 600; }
.dual-main .s { font-size: 11px; color: var(--muted); }
.dual-badge { display: none; font-size: 11px; font-weight: 600; color: #186030; background: #ddf5e4; padding: 3px 9px; border-radius: 20px; }
.dual-badge.on { display: block; }
.dual-complete { display: none; padding: 8px 14px; background: #ddf5e4; border-top: 1px solid #b0e0c0; font-size: 12px; font-weight: 600; color: #186030; text-align: center; }
.dual-complete.on { display: block; }

/* ── Infoboxen ── */
.info-hint { background: #fff8ee; border: 1px solid #ead890; border-radius: 7px; padding: 10px 14px; margin-bottom: 12px; font-size: 12px; color: #806030; line-height: 1.55; }
.info-warn { background: #fff8e8; border: 1.5px solid #f0c060; border-radius: 7px; padding: 10px 14px; margin-bottom: 12px; font-size: 12px; color: #5a3a00; line-height: 1.65; }
.info-rule { background: #eef4fa; border: 1.5px solid #b8d4ec; border-radius: 7px; padding: 10px 14px; margin-bottom: 12px; font-size: 12px; color: #1a4a70; line-height: 1.65; }
.info-alert { background: #fff0f0; border: 1.5px solid #f5c6c6; border-radius: 7px; padding: 10px 14px; margin-bottom: 12px; font-size: 12px; color: #8a2020; line-height: 1.65; }

/* ── KPI ── */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
@media(max-width:480px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-field label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
.kpi-input-wrap { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 6px; background: var(--soft); overflow: hidden; transition: border-color 0.15s; }
.kpi-input-wrap:focus-within { border-color: var(--accent); background: #fff; }
.kpi-prefix { padding: 9px 10px; background: var(--bg); font-size: 13px; color: var(--muted); border-right: 1px solid var(--border); white-space: nowrap; }
.kpi-input-wrap input { flex: 1; border: none; background: transparent; padding: 9px 12px; font-size: 15px; font-family: inherit; color: var(--text); font-weight: 500; outline: none; width: 100%; }
.kpi-hint { margin-top: 5px; font-size: 11.5px; color: var(--muted); }

/* Zähler */
.counter-wrap { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; background: #faf8f4; max-width: 280px; }
.counter-btn { width: 48px; height: 48px; border: none; background: #ede8df; font-size: 22px; font-weight: 600; cursor: pointer; color: var(--accent); flex-shrink: 0; line-height: 1; }
.counter-mid { flex: 1; text-align: center; }
.counter-val { font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1.1; padding: 6px 0 2px; }
.counter-unit { font-size: 10px; color: var(--muted); padding-bottom: 5px; }

/* ── Radios / Pillen ── */
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 6px; }
.radio-item {
  display: flex; align-items: center; gap: 7px; padding: 8px 14px;
  border: 1.5px solid var(--border); border-radius: 20px; cursor: pointer;
  font-size: 13px; transition: all 0.15s; user-select: none; background: #fff;
}
.radio-item:hover { border-color: var(--accent); }
.radio-item.sel-ja { border-color: var(--red); background: #fff0f0; color: var(--red); font-weight: 500; }
.radio-item.sel-nein { border-color: var(--green); background: #f0faf2; color: var(--green); font-weight: 500; }
.radio-item.sel-offen { border-color: var(--yellow); background: #fef8ee; color: #b06010; font-weight: 500; }
.radio-item.sel-muted { border-color: var(--muted); background: #f4f2ee; color: var(--text); font-weight: 500; }
.radio-item.sel-green { border-color: var(--green); background: #f0faf2; color: var(--green); font-weight: 500; }
.radio-item.sel-yellow { border-color: var(--yellow); background: #fef8ee; color: #b06010; font-weight: 500; }

.incident-box { margin-bottom: 16px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--soft); }
.incident-box h4 { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.incident-box .sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* Status-Select */
.status-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.status-label { flex: 1; font-size: 14px; }
.status-select { width: 230px; border: 1.5px solid var(--border); border-radius: 6px; padding: 7px 10px; font-size: 13px; font-family: inherit; background: var(--soft); cursor: pointer; outline: none; color: var(--text); }
.status-select.ok { border-color: var(--green); background: #f0faf2; }
.status-select.warn { border-color: var(--yellow); background: #fef8ee; }
.status-select.nok { border-color: var(--red); background: #fff0f0; }

/* Chips */
.chips-title { font-size: 12px; font-weight: 500; color: var(--muted); margin: 12px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 13px; border: 1.5px solid var(--border); border-radius: 20px; cursor: pointer; font-size: 12.5px; user-select: none; background: #fff; transition: all .15s; }
.chip:hover { border-color: var(--accent); }
.chip.on { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 500; }
.chip input { display: none; }

/* Ampel */
.ampel-label { font-size: 12px; font-weight: 500; color: var(--muted); margin: 10px 0 6px; }
.ampel { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ampel .pill { padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 20px; cursor: pointer; font-size: 13px; user-select: none; background: #fff; transition: all .15s; }
.ampel .pill.on-gruen { border-color: var(--green); background: #f0faf2; color: var(--green); font-weight: 600; }
.ampel .pill.on-gelb { border-color: var(--yellow); background: #fef8ee; color: #b06010; font-weight: 600; }
.ampel .pill.on-rot { border-color: var(--red); background: #fff0f0; color: var(--red); font-weight: 600; }

/* Subblock */
.subblock { border: 1.5px solid var(--border); border-radius: 9px; padding: 14px 16px; margin-bottom: 14px; background: var(--soft); }
.subblock > .subblock-title { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }

/* Besuchskarten (GL) */
.visit-card { border: 1.5px solid var(--border); border-radius: 10px; margin-bottom: 14px; background: var(--soft); overflow: hidden; }
.visit-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #f1ede6; border-bottom: 1px solid var(--border); }
.visit-head .num { font-weight: 700; color: var(--accent); font-size: 13px; }
.visit-head .rm { margin-left: auto; background: none; border: none; color: var(--red); cursor: pointer; font-size: 12px; }
.visit-body { padding: 14px 16px; }
.btn-add { background: #fff; border: 1.5px dashed var(--accent); color: var(--accent); border-radius: 8px; padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer; width: 100%; margin-bottom: 8px; font-family: inherit; }
.btn-add:hover { background: #fdf8f0; }

/* Wiederholbare Zeilen */
.rep-row { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 10px; margin-bottom: 8px; align-items: end; }
.rep-row .rm { background: none; border: none; color: var(--red); font-size: 16px; cursor: pointer; padding-bottom: 9px; }

/* ── Buttons & Submit ── */
.submit-card { background: var(--card); border-radius: 10px; padding: 26px 26px 22px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 16px; }
.submit-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.submit-card p { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.55; }
.submit-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { background: var(--brand); color: #fff; border: none; padding: 12px 32px; border-radius: 7px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.18s, transform 0.1s; text-decoration: none; display: inline-block; }
.btn:hover { background: #2e2e2a; transform: translateY(-1px); }
.btn.small { padding: 7px 14px; font-size: 12.5px; }
.btn.ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn.ghost:hover { border-color: var(--muted); color: var(--text); }
.btn.accent { background: var(--accent); }
.btn.danger { background: var(--red); }

/* ── Overlay ── */
.success-overlay { display: none; position: fixed; inset: 0; background: rgba(26,26,24,0.85); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.success-overlay.show { display: flex; }
.success-box { background: #fff; border-radius: 14px; padding: 44px 38px; max-width: 460px; width: 100%; text-align: center; }
.success-icon { width: 64px; height: 64px; background: #e8f8ee; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto 20px; }
.success-box h2 { font-family: 'DM Serif Display', serif; font-size: 24px; margin-bottom: 10px; }
.success-box p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.success-summary { background: #f8f6f2; border-radius: 8px; padding: 14px 18px; text-align: left; font-size: 13px; margin-bottom: 22px; }
.success-summary div { margin-bottom: 6px; color: var(--muted); }
.success-summary span { color: var(--text); font-weight: 500; }

/* ── Dashboard ── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.dash-tile { background: var(--card); border-radius: 9px; padding: 12px 14px; border: 1.5px solid var(--border); font-size: 12.5px; text-decoration: none; display: block; }
.dash-tile .t { font-weight: 600; margin-bottom: 3px; line-height: 1.3; }
.dash-tile .s { color: var(--muted); font-size: 11px; }
.dash-tile.ok { border-color: #b8e8c4; background: #f4fbf6; }
.dash-tile.miss { border-color: #eddcdc; background: #fdf7f7; }
.dash-tile.warn-tile { border-color: #f0c060; background: #fffaf0; }
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi-card { background: var(--card); border-radius: 10px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.kpi-card .v { font-size: 24px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.kpi-card .l { font-size: 11.5px; color: var(--muted); margin-top: 3px; letter-spacing: 0.03em; }
.kpi-card.neg .v { color: var(--red); }
h2.section-title { font-family: 'DM Serif Display', serif; font-size: 20px; margin: 26px 0 12px; }
h2.section-title:first-child { margin-top: 18px; }

/* Eskalationen */
.esk { background: var(--card); border-radius: 10px; border-left: 5px solid var(--muted); box-shadow: 0 2px 8px rgba(0,0,0,0.05); padding: 14px 18px; margin-bottom: 10px; }
.esk.hoch { border-left-color: var(--red); }
.esk.mittel { border-left-color: var(--yellow); }
.esk.info { border-left-color: #6a9fd8; }
.esk .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.esk .title { font-weight: 600; font-size: 14px; flex: 1; min-width: 200px; }
.esk .meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.esk .desc { font-size: 13px; margin-top: 8px; line-height: 1.55; background: var(--soft); border-radius: 6px; padding: 8px 12px; }
.esk .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.sev { font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; }
.sev.hoch { background: #fde8e8; color: var(--red); }
.sev.mittel { background: #fef6e4; color: #b06010; }
.sev.info { background: #e8f0fa; color: #2a5a90; }
.st { font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; }
.st.offen { background: #fde8e8; color: var(--red); }
.st.in_bearbeitung { background: #fef6e4; color: #b06010; }
.st.geloest { background: #e8f8ee; color: #186030; }

/* Tabellen */
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.05); font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 12px 14px; border-bottom: 1.5px solid var(--border); background: var(--soft); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid #f0ece5; }
.tbl tr:last-child td { border-bottom: none; }
.tbl a { color: var(--accent); font-weight: 600; text-decoration: none; }
.tbl-wrap { overflow-x: auto; }

/* Bericht-Detail */
.det-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f2eee8; font-size: 13.5px; }
.det-row:last-child { border-bottom: none; }
.det-ok { color: var(--green); font-weight: 700; }
.det-miss { color: #c8c0b0; font-weight: 700; }
.det-label { flex: 1; }
.det-value { font-weight: 600; text-align: right; max-width: 55%; white-space: pre-wrap; }
.det-sub { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); padding: 12px 0 4px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--brand); }
.login-box { background: #fff; border-radius: 14px; padding: 44px 40px; max-width: 400px; width: 100%; }
.login-box .banner-tag { margin-bottom: 16px; }
.login-box h1 { font-family: 'DM Serif Display', serif; font-size: 26px; margin-bottom: 6px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-box .field { margin-bottom: 14px; }
.error-box { background: #fff0f0; border: 1.5px solid #f5c6c6; color: #8a2020; border-radius: 7px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.ok-box { background: #e8f8ee; border: 1.5px solid #b0e0c0; color: #186030; border-radius: 7px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }

.pill-filter { display: inline-flex; gap: 6px; margin: 0 0 14px; }
.pill-filter a { text-decoration: none; font-size: 12.5px; padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border); background: #fff; color: var(--muted); }
.pill-filter a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
