* { box-sizing: border-box; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; }
body { margin: 0; background: #f3f5f7; color: #111; }

html, body { height: 100%; }
body { overflow: hidden; }

.center { min-height: 100vh; display: grid; place-items: center; }
.card { width: 320px; background: #fff; padding: 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.08); display: grid; gap: 10px; }
.card input, .card button { padding: 10px 12px; border-radius: 10px; border: 1px solid #ddd; }
.card button { background: #111; color: #fff; border: 0; cursor: pointer; }
.err { color: #b00020; min-height: 1.2em; margin: 0; }

.app { display: grid; grid-template-columns: 320px 1fr; height: 100vh; }
.sidebar { background:#fff; border-right:1px solid #e7e7e7; display:flex; flex-direction:column; height: 100vh; overflow: hidden; }

.sidebar {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


.online { overflow: auto; min-height: 0; max-height: 30vh; }


.main { display:flex; flex-direction:column; height: 100vh; overflow: hidden; }



.bar { padding: 12px 14px; border-bottom:1px solid #eee; display:flex; align-items:center; justify-content:space-between; gap: 10px; }
.section { padding: 10px 12px; border-bottom:1px solid #eee; display:grid; gap: 8px; }
.section button { padding: 10px; border-radius: 10px; border:1px solid #ddd; background:#fafafa; cursor:pointer; }

.list {
  flex: 1;                 /* bekommt verfügbaren Platz */
  overflow-y: auto;        /* nur scrollen */
  min-height: 0;           /* Flexbox-Fix */
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chatItem { text-align:left; padding:10px; border-radius: 10px; border:1px solid #eee; background:#fff; cursor:pointer;  flex: 0 0 auto;}
.chatItem:hover { background:#f7f7f7; }

.messages { flex:1; overflow:auto; padding: 12px; display:grid; gap: 10px; min-height: 0; }
.msg { background:#fff; border:1px solid #eee; border-radius: 14px; padding: 10px 12px; }
.msg .meta { font-size: 12px; opacity: .7; margin-bottom: 6px; }
.composer { display:flex; gap: 10px; padding: 12px; border-top:1px solid #eee; background:#fff; }
.composer input { flex:1; padding: 10px 12px; border-radius: 12px; border:1px solid #ddd; }
.composer button { padding: 10px 14px; border-radius: 12px; border:0; background:#111; color:#fff; cursor:pointer; }
.online { padding: 10px 12px; display:grid; gap: 6px; overflow:auto; }
.onlineRow { font-size: 14px; }


/* Admin UI */
.adminTop {
  display:flex; justify-content:space-between; align-items:center;
  padding: 12px 14px; background:#fff; border-bottom:1px solid #e7e7e7;
}
.adminTopLeft { display:flex; gap:10px; align-items:baseline; }
.adminTopRight { display:flex; gap:10px; align-items:center; }
.adminWrap { max-width: 1100px; margin: 0 auto; padding: 14px; display:grid; gap: 14px; }
.panel { background:#fff; border:1px solid #eee; border-radius: 14px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.04); }
.panelHeader { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.panelActions { display:flex; gap:10px; align-items:center; }
.panelActions input { padding:10px 12px; border-radius: 10px; border:1px solid #ddd; }
.grid2 { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.grid2 label span { display:block; font-size: 13px; opacity:.8; margin-bottom: 6px; }
.grid2 input, .grid2 select { width:100%; padding:10px 12px; border-radius: 10px; border:1px solid #ddd; }
.hint { display:block; opacity:.65; margin-top: 6px; font-size: 12px; }
.rowEnd { display:flex; align-items:flex-end; justify-content:flex-end; }
.tableWrap { overflow:auto; margin-top: 10px; }
.tbl { width:100%; border-collapse: collapse; min-width: 780px; }
.tbl th, .tbl td { padding: 10px 10px; border-bottom: 1px solid #eee; text-align:left; white-space: nowrap; }
.tbl th { font-size: 13px; opacity: .75; }
.actions { display:flex; gap:8px; }
.btn, .btnPrimary, .btnDanger {
  padding: 10px 12px; border-radius: 10px; border:1px solid #ddd; background:#fafafa; cursor:pointer;
}
.btnPrimary { background:#111; color:#fff; border:0; }
.btnDanger { background:#b00020; color:#fff; border:0; }
.btnLink { text-decoration:none; padding:10px 12px; border-radius:10px; border:1px solid #ddd; background:#fafafa; color:#111; }
.muted { opacity:.7; }
.result { margin: 10px 0 0; min-height: 1.2em; }
.result.ok { color: #0a7a2f; }
.result.bad { color: #b00020; }
.tag.ok { color:#0a7a2f; }
.tag.bad { color:#b00020; }
.bullets { margin: 8px 0 0; padding-left: 18px; }
@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
}


/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display:grid; place-items:center; padding: 14px; }
.modal.hidden { display: none; }
.modalCard { width: min(420px, 100%); background:#fff; border-radius: 14px; padding: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.18); display:grid; gap: 12px; }
.modalHeader { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.modalLabel span { display:block; font-size: 13px; opacity:.8; margin-bottom: 6px; }
.modalLabel select { width:100%; padding:10px 12px; border-radius: 10px; border:1px solid #ddd; }
.modalActions { display:flex; justify-content:flex-end; }



.composer textarea {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}


.list:empty::after {
  content: 'Noch keine Chats';
  opacity: 0.6;
  font-size: 14px;
}


.chatItem { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.badge { font-size: 18px; line-height: 1; }
.chatItem.hasUnread { font-weight: 600; }


.panelRow { display:flex; gap:10px; align-items:center; }
.panelRow input { flex:1; padding:10px 12px; border-radius:10px; border:1px solid #ddd; }

.checkList {
  border:1px solid #eee;
  border-radius: 12px;
  padding: 8px;
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.checkItem {
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 10px;
  border-radius: 10px;
  border:1px solid #f0f0f0;
  background:#fff;
}

.checkItem:hover { background:#f8f8f8; }
.checkItem input { width: 18px; height: 18px; }


.memberRow { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.memberRow .name { display:flex; gap:10px; align-items:center; }
.memberTag { font-size:12px; opacity:.65; }
