:root {
  --gruen: #0f766e; --gruen-hell: #ccfbf1; --grund: #f8fafc; --karte: #fff; --linie: #e2e8f0; --text: #0f172a; --leise: #64748b;
  --ein: #fff; --aus: #dcf8c6; --notiz: #fef9c3; --rot: #dc2626;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--text); font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--grund); }
button, .knopf { background: var(--gruen); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
button.zweit { background: #fff; color: var(--text); border: 1px solid var(--linie); }
button:disabled { opacity: .5; cursor: not-allowed; }
.klein-knopf { padding: 3px 10px; font-size: 12px; }
input, select, textarea { font: inherit; border: 1px solid var(--linie); border-radius: 8px; padding: 7px 9px; background: #fff; color: inherit; width: 100%; }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--leise); margin-bottom: 10px; }
a { color: var(--gruen); cursor: pointer; }
.leise { color: var(--leise); } .klein { font-size: 12px; } .fehler { color: var(--rot); min-height: 1em; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 16px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reihe { display: flex; gap: 8px; align-items: flex-end; }
.knoepfe { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; align-items: center; }
.knoepfe.links { justify-content: flex-start; margin: 0 0 12px; }

.testband { background: #fef3c7; color: #92400e; padding: 6px 14px; font-size: 13px; display: flex; gap: 12px; align-items: center; }
.testband button { background: #92400e; }

.app { display: grid; grid-template-columns: 220px 340px 1fr; height: 100vh; }
.testband:not([hidden]) + .app { height: calc(100vh - 36px); }
.seitenleiste { background: #0f172a; color: #cbd5e1; padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.marke { font-weight: 800; font-size: 18px; color: #fff; } .marke span { font-weight: 400; color: #5eead4; font-size: 13px; }
.seitenleiste nav { display: flex; flex-direction: column; }
.seitenleiste nav a { color: #cbd5e1; padding: 6px 8px; border-radius: 6px; display: flex; justify-content: space-between; text-decoration: none; }
.seitenleiste nav a:hover { background: #1e293b; }
.seitenleiste nav a.an { background: var(--gruen); color: #fff; }
.seitenleiste nav b { font-weight: 600; font-size: 12px; } .seitenleiste nav b:empty { display: none; }
.seitenleiste h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin: 8px 0 0; }
.seitenleiste .unten { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.seitenleiste .unten a { color: #cbd5e1; }
.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.voll { width: 100%; }

.liste { border-right: 1px solid var(--linie); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.suche { padding: 10px; border-bottom: 1px solid var(--linie); }
#gespraeche { overflow-y: auto; flex: 1; }
.eintrag { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.eintrag:hover { background: #f8fafc; } .eintrag.an { background: var(--gruen-hell); }
.eintrag .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag.neu .n::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--gruen); border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.eintrag .z { font-size: 11px; color: var(--leise); }
.eintrag .v { grid-column: 1 / -1; color: var(--leise); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag.neu .v { color: var(--text); }
.eintrag .m { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; font-size: 11px; }
.chip { border-radius: 999px; padding: 1px 8px; font-size: 11px; color: #fff; white-space: nowrap; }
.chip.grau { background: #e2e8f0; color: var(--text); }
.chip.warn { background: #fef3c7; color: #92400e; }
.leerliste { padding: 30px; text-align: center; color: var(--leise); }

.chat { display: flex; flex-direction: column; min-height: 0; background: #efeae2; }
.chat .leer { margin: auto; color: var(--leise); }
.chatkopf { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--linie); }
.chatkopf .wer { flex: 1; min-width: 0; }
.name-feld { border-color: transparent; font-weight: 700; font-size: 16px; padding: 2px 4px; }
.name-feld:hover, .name-feld:focus { border-color: var(--linie); }
.chatkopf .aktionen { display: flex; gap: 6px; align-items: center; } .chatkopf select { width: auto; }
.zurueck { display: none; background: none; color: var(--text); font-size: 24px; padding: 0 6px; }
.chatinfo { display: flex; gap: 12px; padding: 8px 14px; background: #fff; border-bottom: 1px solid var(--linie); align-items: flex-end; flex-wrap: wrap; }
.chatinfo label { margin: 0; flex-direction: row; align-items: center; gap: 6px; } .chatinfo input { width: auto; padding: 4px 8px; }
.labels { display: flex; gap: 4px; flex-wrap: wrap; }
.labels .chip { cursor: pointer; opacity: .35; } .labels .chip.an { opacity: 1; }
.verlauf { flex: 1; overflow-y: auto; padding: 16px 8%; display: flex; flex-direction: column; gap: 6px; }
.blase { max-width: 70%; padding: 7px 10px 5px; border-radius: 8px; background: var(--ein); box-shadow: 0 1px 1px rgba(0,0,0,.08); white-space: pre-wrap; overflow-wrap: anywhere; }
.blase.aus { align-self: flex-end; background: var(--aus); }
.blase.notiz { align-self: center; background: var(--notiz); border: 1px dashed #eab308; max-width: 80%; }
.blase.system { align-self: center; background: rgba(255,255,255,.7); color: var(--leise); font-size: 12px; box-shadow: none; padding: 3px 10px; }
.blase .fuss { font-size: 11px; color: var(--leise); text-align: right; margin-top: 2px; }
.blase .vorlagenname { font-size: 11px; color: var(--gruen); font-weight: 600; margin-bottom: 2px; }
.blase .fehlertext { color: var(--rot); font-size: 12px; }
.blase audio { width: 260px; max-width: 100%; display: block; } .blase img, .blase video { max-width: 280px; border-radius: 6px; display: block; }
.haken.gelesen { color: #0ea5e9; } .haken.fehler { color: var(--rot); }
.tag { align-self: center; font-size: 12px; background: #e1f3fb; color: #334155; padding: 3px 10px; border-radius: 6px; margin: 6px 0; }
.eingabe { background: #f0f2f5; padding: 8px 14px 12px; }
.fenster { font-size: 12px; margin-bottom: 6px; } .fenster.zu { color: #b45309; font-weight: 600; }
.tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.tabs button { background: transparent; color: var(--leise); padding: 4px 10px; font-weight: 500; }
.tabs button.an { background: #fff; color: var(--text); }
.tabs .vorlage-knopf { margin-left: auto; color: var(--gruen); font-weight: 600; }
.eingabe.notizmodus textarea { background: var(--notiz); }

.dlg { border: 0; border-radius: 14px; padding: 20px; width: min(560px, 94vw); }
.dlg.breit { width: min(900px, 96vw); }
.dlg::backdrop { background: rgba(15,23,42,.45); }
.dlg h2 { margin-top: 0; }
.vorschau-blase { background: var(--aus); border-radius: 8px; padding: 10px; white-space: pre-wrap; min-height: 40px; }
.vorschau-blase .luecke { background: #fde68a; border-radius: 3px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px; border-bottom: 1px solid var(--linie); vertical-align: top; }
td.text { max-width: 380px; color: var(--leise); white-space: pre-wrap; }
.status-ok { color: #16a34a; font-weight: 600; } .status-nein { color: #b45309; font-weight: 600; }

body.login { display: grid; place-items: center; min-height: 100vh; }
body.login form { width: min(360px, 92vw); }
body.login h1 span { font-weight: 400; color: var(--gruen); font-size: 16px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .seitenleiste { display: none; }
  .app.offen .liste { display: none; } .app:not(.offen) .chat { display: none; }
  .zurueck { display: block; }
  .verlauf { padding: 12px; } .blase { max-width: 88%; }
  .chatkopf .aktionen button.zweit { display: none; }
  .nur-mobil { display: flex; margin-bottom: 8px; align-items: stretch; } .nur-mobil button { white-space: nowrap; }
}
@media (min-width: 901px) { .nur-mobil { display: none; } }
