/* WhatsApp-Schreibseite — VBZ. Ruhiges, klares Layout: dunkle Navigationsleiste, helle Karten. */
:root {
  --navy: #17294a;
  --navy-soft: #24406e;
  --gold: #b8860b;
  --bg: #eef1f6;
  --card: rgba(255, 255, 255, .92);
  --line: rgba(23, 41, 74, .12);
  --text: #16202f;
  --muted: #64748b;
  --ok: #16794a;
  --warn: #b45309;
  --bad: #b3261e;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(23, 41, 74, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 "Inter", "Manrope", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding: 0 0 40px;
}

/* Licht-Auren hinter dem Inhalt */
.aura { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .5; z-index: 0; pointer-events: none; }
.aura-1 { width: 420px; height: 420px; background: radial-gradient(circle, #9db8e8, transparent 70%); top: -140px; right: -80px; }
.aura-2 { width: 380px; height: 380px; background: radial-gradient(circle, #f0d9a8, transparent 70%); bottom: -160px; left: -100px; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 22px;
  background: rgba(23, 41, 74, .94);
  backdrop-filter: blur(14px);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand b { display: block; font-size: 16px; letter-spacing: .2px; }
.brand span { display: block; font-size: 12px; opacity: .72; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill-ok { background: rgba(22, 121, 74, .22); color: #b6f0cd; }
.pill-wait { background: rgba(255, 255, 255, .14); color: #e7ecf5; }
.pill-bad { background: rgba(179, 38, 30, .26); color: #ffd2ce; }
.pill-muted { background: rgba(255, 255, 255, .10); color: #d7dfec; font-weight: 500; }

/* Navigationsleiste */
.rail {
  position: sticky; top: 58px; z-index: 4;
  display: flex; gap: 8px; padding: 10px 22px;
  background: rgba(255, 255, 255, .78); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.rail-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--navy);
  font: inherit; font-weight: 600;
}
.rail-btn:hover { background: rgba(23, 41, 74, .07); }
.rail-btn.is-active { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.rail-btn .ico { font-size: 15px; }

/* Inhalt */
.stage { position: relative; z-index: 1; max-width: 1050px; margin: 18px auto 0; padding: 0 18px; display: grid; gap: 16px; }
.view { display: grid; gap: 16px; }
.is-hidden { display: none !important; }

.card {
  background: var(--card); border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 16.5px; letter-spacing: .2px; color: var(--navy); }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-actions { margin-top: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input[type="text"], input[type="search"], input[type="password"], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(36, 64, 110, .12); }
textarea { resize: vertical; line-height: 1.55; }

/* Buttons */
.btn { padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 650; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover:not(:disabled) { background: var(--navy-soft); }
.btn-send { background: var(--gold); color: #2b1d00; box-shadow: var(--shadow); }
.btn-send:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost { background: rgba(23, 41, 74, .07); color: var(--navy); }
.btn-ghost:hover:not(:disabled) { background: rgba(23, 41, 74, .13); }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.badge { padding: 4px 11px; border-radius: 999px; background: rgba(23, 41, 74, .09); color: var(--navy); font-size: 12.5px; font-weight: 600; }
.badge-muted { background: rgba(100, 116, 139, .13); color: var(--muted); }
.muted { color: var(--muted); font-size: 13.5px; }

/* Chat-Liste */
.chat-list { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.chat {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer;
}
.chat:hover { border-color: var(--navy-soft); transform: translateY(-1px); }
.chat.is-sel { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 134, 11, .15); }
.chat-ava { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; }
.chat-name { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.chat-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62ch; }
.lang-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(184, 134, 11, .18); color: #6b4b00; font-weight: 700; }
.chat-meta { text-align: right; font-size: 12px; color: var(--muted); }

.result { margin-top: 10px; font-size: 13.5px; border-radius: 12px; }
.result.ok { background: rgba(22, 121, 74, .10); color: #0f5d38; padding: 10px 12px; }
.result.warn { background: rgba(180, 83, 9, .12); color: #8a4108; padding: 10px 12px; }
.result.bad { background: rgba(179, 38, 30, .10); color: #8c1d18; padding: 10px 12px; }
.result:empty { display: none; }
.notes { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy); }
.details.danger summary { color: var(--bad); }
.details > *:not(summary) { margin-top: 10px; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding: 6px 0; font-size: 13.5px; }
.kv b { font-weight: 650; }
.rules { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.7; }

.log-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; font-size: 13.5px; }
.log-item .head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.log-item .txt { white-space: pre-wrap; }
.log-ok { border-left: 4px solid var(--ok); }
.log-bad { border-left: 4px solid var(--bad); }
