/* Nova - Stil aus dem Agenten-Prototyp vom Juli: warmes Cremeweiss,
   gedecktes Terrakotta als Akzent, ruhige Typografie. */
:root {
  --accent:      #c96442;
  --accent-soft: #f3e6e0;
  --bg:          #faf9f5;
  --card:        #ffffff;
  --sidebar:     #f0eee6;
  --sidebar-hi:  #e8e5d8;
  --line:        #e3e0d4;
  --ink:         #1f1e1d;
  --ink-soft:    #565349;
  --muted:       #8a867a;
  --ok:          #5b9a6b;
  --busy:        #d99a3e;
  --wait:        #c0553c;
  --sidebar-breite: 288px;
  --topbar-hoehe:   0px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  margin: 0;
}

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: #b85838;
  --bs-btn-hover-border-color: #b85838;
  --bs-btn-active-bg: #a54e31;
  --bs-btn-active-border-color: #a54e31;
}
.btn-outline-secondary {
  --bs-btn-color: var(--ink-soft);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--sidebar-hi);
  --bs-btn-hover-border-color: var(--line);
  --bs-btn-hover-color: var(--ink);
}
.form-control { border-color: var(--line); }
.form-control:focus {
  border-color: #d9a78f;
  box-shadow: 0 0 0 .2rem rgba(201, 100, 66, .15);
}
.text-muted { color: var(--muted) !important; }
.modal-content { border: 1px solid var(--line); border-radius: 14px; }

/* --- Login --- */
.login-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.login-box {
  width: 100%; max-width: 380px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 34px 30px;
}
.marke-gross {
  width: 52px; height: 52px; border-radius: 13px;
  background: var(--accent); color: #fff;
  font-size: 24px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* --- Layout --- */
#haupt { display: flex; position: fixed; inset: 0; }

#sidebar {
  width: var(--sidebar-breite); flex: 0 0 var(--sidebar-breite);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.marke {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 16px; font-weight: 600; font-size: 17px;
}
.marke-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* --- Navigation --- */
.nav-liste { padding: 0 10px; }
.nav-punkt {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--ink-soft); text-decoration: none;
  border: none; background: none; width: 100%; text-align: left;
  font-size: 14.5px;
}
.nav-punkt i { width: 17px; text-align: center; color: var(--muted); font-size: 14px; }
.nav-punkt:hover { background: var(--sidebar-hi); color: var(--ink); }
.nav-punkt .zaehler {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: var(--accent); color: #fff;
  border-radius: 9px; padding: 1px 7px;
}
.nav-trenner { height: 1px; background: var(--line); margin: 10px 18px; }

.menu-heading {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 16px 18px 7px; font-weight: 600;
}

/* --- Agentenliste --- */
#agenten-scroll { flex: 1 1 auto; overflow-y: auto; padding-bottom: 8px; }
.agent {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 14px; cursor: pointer; border: none;
  background: none; width: 100%; text-align: left;
  border-radius: 8px; margin: 1px 8px; width: calc(100% - 16px);
}
.agent:hover { background: var(--sidebar-hi); }
.agent.aktiv { background: var(--sidebar-hi); }
.agent .txt { min-width: 0; flex: 1 1 auto; }
.agent .name { font-weight: 600; line-height: 1.25; font-size: 14.5px; }
.agent .rolle { font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.agent .name, .agent .rolle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.punkt { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.punkt-bereit   { background: var(--ok); }
.punkt-arbeitet { background: var(--busy); }
.punkt-wartet   { background: var(--wait); }
.punkt-aus      { background: #c9c5b8; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto; background: var(--sidebar-hi);
}
.avatar-lg { width: 38px; height: 38px; }
.avatar-txt {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 13px;
}
.avatar-lg.avatar-txt { font-size: 15px; }

/* --- Fuss --- */
#sidebar-fuss {
  border-top: 1px solid var(--line);
  padding: 11px 14px 12px 18px;
  font-size: 12px; color: var(--muted);
  line-height: 1.35;
}

/* --- Chat --- */
#chat { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

#chat-kopf {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; border-bottom: 1px solid var(--line);
}
#kopf-status { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

#verlauf {
  flex: 1 1 auto; overflow-y: auto;
  padding: 30px 28px 10px;
  display: flex; flex-direction: column; gap: 22px;
}
.strom { width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

/* Eigene Nachricht: dezent abgesetzt, rechts.
   Agent: frei stehender Text mit Avatar - liest sich wie ein Gespraech. */
.msg { display: flex; gap: 13px; }
.msg-user { justify-content: flex-end; }
.msg-user > div { max-width: 78%; }
.msg-agent > div { max-width: calc(100% - 47px); }
.msg-user .blase {
  background: var(--sidebar-hi); color: var(--ink);
  padding: 9px 15px; border-radius: 14px;
  display: inline-block; max-width: 100%;
  white-space: pre-wrap; word-wrap: break-word;
}
.msg-agent .blase {
  padding: 0; white-space: pre-wrap; word-wrap: break-word;
  color: var(--ink); padding-top: 4px;
}
.msg .zeit { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.msg-user .zeit { text-align: right; }
.leer-hinweis { color: var(--muted); text-align: center; margin: auto; font-size: 14px; }

#eingabe-huelle { padding: 14px 28px 20px; }
#eingabe {
  display: flex; gap: 10px; align-items: flex-end;
  max-width: 760px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 8px 8px 8px 16px;
}
#eingabe:focus-within { border-color: #d9a78f; box-shadow: 0 0 0 3px rgba(201,100,66,.10); }
#feld {
  flex: 1 1 auto; resize: none; max-height: 200px;
  border: none; outline: none; background: none;
  padding: 8px 0; font-size: 15px; font-family: inherit; line-height: 1.6;
  color: var(--ink);
}
#feld::placeholder { color: var(--muted); }
#btn-senden {
  width: 34px; height: 34px; border-radius: 9px; border: none;
  background: var(--accent); color: #fff; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
#btn-senden:hover { background: #b85838; }
#eingabe-hinweis {
  max-width: 760px; margin: 8px auto 0;
  font-size: 12px; color: var(--muted); text-align: center;
}

.tippt { display: flex; gap: 5px; padding: 8px 0; }
.tippt span { width: 7px; height: 7px; border-radius: 50%; background: #c9c5b8; animation: hupf 1.2s infinite; }
.tippt span:nth-child(2) { animation-delay: .2s; }
.tippt span:nth-child(3) { animation-delay: .4s; }
@keyframes hupf { 0%,60%,100% { opacity:.35 } 30% { opacity:1 } }

/* --- Handy --- */
@media (max-width: 767px) {
  :root { --sidebar-breite: 100%; }
  #sidebar { position: absolute; inset: 0; z-index: 20; }
  body.chat-offen #sidebar { display: none; }
  body:not(.chat-offen) #chat { display: none; }
  #verlauf, #eingabe-huelle, #chat-kopf { padding-left: 16px; padding-right: 16px; }
  #btn-zurueck { display: flex !important; }
}
#btn-zurueck { display: none; }
