/* ============================================================
   Capture & Scale Chat — Styles
   Design-Tokens: Brand Kit 2026 (Charcoal / Lime / Sky)
============================================================ */
:root {
  --sky:         #38BDF8;
  --lime:        #A3E635;
  --lime-dark:   #65A30D;
  --lime-light:  #D9F99D;
  --lime-pale:   #F7FEE7;
  --charcoal:    #0F172A;
  --slate:       #1E293B;
  --slate-mid:   #1a2538;
  --mid:         #334155;
  --muted:       #94A3B8;
  --soft:        #CBD5E1;
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --white:       #FFFFFF;
  --danger:      #F87171;

  --font-display: 'Epilogue', sans-serif;
  --font-body:    'Plus Jakarta Sans', sans-serif;

  --r-sm: 10px; --r-md: 16px; --r-lg: 22px;
  --sidebar-w: 290px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--charcoal);
  color: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

.brand { font-family: var(--font-display); font-weight: 900; font-size: 17px; letter-spacing: -0.02em; }
.brand span { color: var(--lime); }
.brand small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--muted);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--white); }

/* ════════════ LOGIN ════════════ */
.login-view {
  height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 60% 45% at 50% -5%, rgba(37,99,235,0.22), transparent 70%),
    var(--charcoal);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--slate);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px 36px;
}
.login-card h1 { font-family: var(--font-display); font-weight: 800; font-size: 28px; margin: 26px 0 8px; }
.login-hint { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.login-card input {
  width: 100%; padding: 13px 16px;
  background: var(--slate-mid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--white); font-size: 15px; font-family: inherit;
  outline: none; margin-bottom: 12px;
}
.login-card input:focus { border-color: var(--lime); }
.btn-lime {
  width: 100%; padding: 13px 20px;
  background: var(--lime); color: var(--charcoal);
  border-radius: 999px;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  transition: background .15s, transform .12s;
}
.btn-lime:hover:not(:disabled) { background: var(--lime-light); transform: translateY(-1px); }
.btn-lime:disabled { opacity: .55; cursor: default; }
.login-status { margin-top: 16px; font-size: 14px; color: var(--lime); }
.login-status.error { color: var(--danger); }
.login-dev-hint {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}

/* Login-Tabs */
.login-tabs {
  display: flex; gap: 4px;
  background: var(--slate-mid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 4px;
  margin: 20px 0 18px;
}
.login-tab {
  flex: 1; padding: 9px 12px;
  border-radius: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background .15s, color .15s;
}
.login-tab.active { background: var(--slate); color: var(--white); }
.login-tab:not(.active):hover { color: var(--soft); }

.login-forgot {
  margin-top: 14px; text-align: center;
  font-size: 13px; color: var(--muted);
}

/* User-Row: Einstellungen + Abmelden nebeneinander */
.user-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ════════════ APP-LAYOUT ════════════ */
.app { display: flex; height: 100%; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--slate-mid);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  gap: 14px;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.sidebar-close { display: none; }

.chat-list-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.chat-list-head .btn-new-chat { flex: 1; }

#btn-select-mode {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 8px;
  font-size: 12.5px; color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
#btn-select-mode:hover { color: var(--soft); background: rgba(255,255,255,0.05); }
#btn-select-mode.active { color: var(--lime); border-color: rgba(163,230,53,0.3); }

.fake-chk {
  width: 15px; height: 15px; flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  position: relative;
  transition: background .12s, border-color .12s;
}
#btn-select-mode.active .fake-chk {
  background: var(--lime); border-color: var(--lime);
}
#btn-select-mode.active .fake-chk::after {
  content: '';
  position: absolute; left: 3px; top: 0px;
  width: 5px; height: 9px;
  border: 2px solid var(--charcoal);
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

.btn-new-chat {
  padding: 11px 16px;
  border: 1.5px solid rgba(163,230,53,0.4);
  border-radius: var(--r-sm);
  color: var(--lime); font-weight: 700; font-size: 14px;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.btn-new-chat:hover { background: rgba(163,230,53,0.08); border-color: var(--lime); }

.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.chat-item {
  display: block; width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px; color: var(--soft);
  text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .12s;
}
.chat-item:hover { background: rgba(255,255,255,0.05); }
.chat-item.active { background: var(--slate); color: var(--white); font-weight: 600; }
.chat-list-empty { font-size: 13px; color: var(--muted); padding: 10px 12px; }

/* Selection mode */
.chat-item-select {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13.5px; color: var(--soft);
  background: none; text-align: left;
  transition: background .12s; cursor: pointer;
}
.chat-item-select:hover { background: rgba(255,255,255,0.05); }
.chat-item-select.selected { background: rgba(163,230,53,0.08); color: var(--white); }
.chat-item-select span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Custom checkboxes — abgerundet, lime-farbig */
.chat-item-select input[type="checkbox"],
.select-all-label   input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  background: transparent;
  cursor: pointer; position: relative;
  transition: background .12s, border-color .12s;
}
.chat-item-select input[type="checkbox"]:checked,
.select-all-label   input[type="checkbox"]:checked,
.select-all-label   input[type="checkbox"]:indeterminate {
  background: var(--lime); border-color: var(--lime);
}
.chat-item-select input[type="checkbox"]:checked::after,
.select-all-label   input[type="checkbox"]:checked::after {
  content: '';
  position: absolute; left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: 2px solid var(--charcoal);
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.select-all-label input[type="checkbox"]:indeterminate::after {
  content: '';
  position: absolute; left: 3px; top: 6px;
  width: 9px; height: 2px;
  background: var(--charcoal); border-radius: 1px;
}

.chat-select-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.select-all-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--soft); cursor: pointer;
  flex-shrink: 0;
}
.btn-delete-selected {
  flex: 1;
  padding: 7px 12px; border-radius: 8px;
  background: rgba(248,113,113,0.15); color: var(--danger);
  font-size: 13px; font-weight: 600;
  border: 1px solid rgba(248,113,113,0.25);
  transition: background .15s;
}
.btn-delete-selected:not(:disabled):hover { background: rgba(248,113,113,0.28); }
.btn-delete-selected:disabled { opacity: .4; cursor: default; }

.sidebar-foot { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--border); padding-top: 14px; }
.credits-box { background: var(--slate); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; }
.credits-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.plan-badge {
  font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--charcoal); background: var(--lime);
  border-radius: 20px; padding: 3px 10px;
}
.credits-label { font-size: 12.5px; color: var(--muted); }
.credits-label strong { color: var(--white); font-size: 14px; }
.credits-bar { height: 6px; background: var(--mid); border-radius: 3px; overflow: hidden; }
.credits-bar-fill { height: 100%; width: 0%; background: var(--lime); border-radius: 3px; transition: width .4s ease, background .3s; }
.credits-bar-fill.low { background: var(--danger); }
.credits-warn { margin-top: 8px; font-size: 11.5px; color: var(--danger); }

.user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.user-email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Main ── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-open { display: none; }
.main-title { flex: 1; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-badge {
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sky); border: 1px solid rgba(56,189,248,0.35);
  border-radius: 20px; padding: 3px 10px;
}

/* ── Nachrichten ── */
.messages { flex: 1; overflow-y: auto; padding: 28px 20px; }
.messages-inner, .messages > * { max-width: 760px; margin-left: auto; margin-right: auto; }

.welcome { text-align: center; padding: 8vh 16px 24px; }
.welcome h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 3vw, 30px); line-height: 1.2; margin-bottom: 12px; }
.welcome h2 span { color: var(--lime); font-style: italic; }
.welcome p { font-size: 14px; color: var(--muted); }

.msg { display: flex; margin-bottom: 18px; }
.msg-user { justify-content: flex-end; }
.msg-bot { flex-direction: column; align-items: flex-start; }
.bubble {
  max-width: 85%;
  padding: 13px 17px;
  border-radius: var(--r-md);
  font-size: 14.5px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg-user .bubble {
  background: var(--mid);
  border-bottom-right-radius: 4px;
}
.msg-bot .bubble {
  background: var(--slate);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.bubble-actions { margin-top: 10px; }

/* ── Convert-Kundenanalyse-Karte (strukturierte Auswertung statt Freitext) ── */
.analyse-card {
  margin-top: 10px; max-width: 85%;
  background: var(--slate-mid); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px 18px;
}
.analyse-card-head {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.analyse-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.analyse-row:last-of-type { border-bottom: none; }
.analyse-label { color: var(--muted); flex-shrink: 0; }
.analyse-value { font-weight: 700; text-align: right; }
.analyse-value.sky    { color: var(--sky); }
.analyse-value.lime   { color: var(--lime); }
.analyse-value.danger { color: var(--danger); }
.analyse-strategie {
  margin-top: 10px; padding: 12px 14px;
  background: var(--charcoal); border-radius: var(--r-sm);
}
.analyse-strategie-label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--lime); margin-bottom: 6px;
}
.analyse-strategie p { font-size: 13.5px; color: var(--soft); line-height: 1.5; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--charcoal); color: var(--lime);
  border-radius: 6px; font-size: 11.5px; font-weight: 700;
  transition: background .15s;
}
.copy-btn:hover { background: var(--slate-mid); }

.typing { display: inline-flex; gap: 5px; padding: 16px 18px; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ── Composer ── */
.composer { padding: 10px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; max-width: 760px; margin: 0 auto 10px; }
.chip {
  padding: 7px 14px;
  background: var(--slate); border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--soft);
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--lime); color: var(--lime); }

.input-row {
  display: flex; gap: 10px; align-items: flex-end;
  max-width: 760px; margin: 0 auto;
  background: var(--slate);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 10px 10px 16px;
  transition: border-color .15s;
}
.input-row:focus-within { border-color: var(--lime); }
#chat-input {
  flex: 1; resize: none; max-height: 160px;
  background: none; border: none; outline: none;
  color: var(--white); font-size: 14.5px; font-family: inherit; line-height: 1.5;
}
#chat-input::placeholder { color: var(--muted); }
.send-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--lime); color: var(--charcoal);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, opacity .15s;
  flex-shrink: 0;
}
.send-btn:hover:not(:disabled) { background: var(--lime-light); }
.send-btn:disabled { opacity: .4; cursor: default; }
.composer-foot {
  display: flex; justify-content: space-between;
  max-width: 760px; margin: 8px auto 0;
  font-size: 11px; color: var(--muted);
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--slate); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--danger);
  border-radius: var(--r-sm);
  padding: 13px 20px;
  font-size: 13.5px; color: var(--soft);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 200; max-width: 90vw;
}
.toast.success { border-left-color: var(--lime); }

/* ════════════ EINSTELLUNGEN ════════════ */
.settings-view {
  height: 100%; overflow-y: auto;
  display: flex; justify-content: center;
  padding: 32px 24px;
  background:
    radial-gradient(ellipse 60% 45% at 50% -5%, rgba(37,99,235,0.18), transparent 70%),
    var(--charcoal);
}
.settings-card {
  width: 100%; max-width: 520px;
  height: fit-content;
}
.settings-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.settings-card h1 {
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  margin-bottom: 28px;
}
.settings-section {
  background: var(--slate);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px 24px;
  margin-bottom: 16px;
}
.settings-section h2 {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.settings-hint {
  font-size: 13.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.5;
}
.settings-info { display: flex; flex-direction: column; gap: 10px; }
.settings-usage { margin-top: 16px; }
.settings-usage-caption { margin-top: 8px; font-size: 12px; color: var(--muted); }
.settings-info-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.settings-label { font-size: 13.5px; color: var(--muted); flex-shrink: 0; }
.settings-value { font-size: 13.5px; color: var(--white); font-weight: 600; text-align: right; }
.settings-value.muted { color: var(--muted); font-weight: 400; }
.settings-section input {
  width: 100%; padding: 12px 16px;
  background: var(--slate-mid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--white); font-size: 14.5px; font-family: inherit;
  outline: none; margin-bottom: 10px;
}
.settings-section input:focus { border-color: var(--lime); }
.settings-section select {
  width: 100%; padding: 12px 16px;
  background: var(--slate-mid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--white); font-size: 14.5px; font-family: inherit;
  outline: none; margin-bottom: 10px;
}
.settings-section select:focus { border-color: var(--lime); }
.settings-field-label {
  display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px;
}
.settings-status {
  margin-top: 12px; font-size: 13.5px; color: var(--lime);
}
.settings-status.error { color: var(--danger); }

/* ── Tonfall: Aktiv-Schalter & Feinsteuerung (ab Connect) ── */
.tone-active-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; font-size: 13.5px; color: var(--soft); cursor: pointer;
}
.tone-active-row input { width: auto; margin: 0; }
.tone-finetune-heading {
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: var(--soft); margin: 22px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.tone-finetune-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--charcoal); background: var(--lime);
  border-radius: 999px; padding: 2px 8px;
}
.tone-lock-hint {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  background: var(--slate-mid); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px;
}
.tone-lock-hint a { color: var(--lime); }
.tone-finetune { border: none; margin: 0; padding: 0; }
.tone-finetune[disabled] { opacity: .45; pointer-events: none; }
.tone-finetune input[type="range"] {
  width: 100%; margin-bottom: 10px; accent-color: var(--lime);
  padding: 0; background: none; border: none;
}

/* ── Tonfall-Audit (ab Convert, Phase E) ── */
.audit-textarea {
  width: 100%; resize: vertical; font-family: inherit;
  padding: 12px 16px; background: var(--slate-mid);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  color: var(--white); font-size: 14px; outline: none; margin-bottom: 10px;
}
.audit-textarea:focus { border-color: var(--lime); }
#audit-analyse-btn { margin-top: 4px; }
.tone-audit-preview {
  margin-top: 16px; padding: 16px; background: var(--slate-mid);
  border: 1px solid var(--border); border-radius: var(--r-sm);
}
.tone-audit-preview h3 {
  font-size: 13px; font-weight: 700; color: var(--soft); margin-bottom: 8px;
}
.tone-audit-example {
  font-size: 13.5px; color: var(--soft); line-height: 1.5; font-style: italic;
  background: var(--charcoal); border-radius: var(--r-sm); padding: 10px 12px;
  margin-bottom: 14px;
}
.tone-audit-actions { display: flex; gap: 10px; }

/* ── Settings Tabs ── */
.settings-tabs {
  display: flex; gap: 4px;
  background: var(--slate-mid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 4px;
  margin-bottom: 20px;
}
.settings-tab {
  flex: 1; padding: 9px 12px;
  border-radius: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background .15s, color .15s;
}
.settings-tab.active { background: var(--slate); color: var(--white); }
.settings-tab:not(.active):hover { color: var(--soft); }

/* ── Admin-Panel-Kopf (innerhalb des Admin-Tabs) ── */
.admin-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.admin-panel-title {
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  color: var(--white);
}

/* Sekundärer Button (outline) */
.btn-outline {
  width: 100%; padding: 12px 20px;
  background: transparent;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  color: var(--soft);
  transition: border-color .15s, color .15s;
}
.btn-outline:hover:not(:disabled) { border-color: var(--lime); color: var(--lime); }
.btn-outline:disabled { opacity: .45; cursor: default; }
.btn-outline-muted { color: var(--muted) !important; border-color: rgba(255,255,255,.12) !important; }
.btn-outline-muted:hover:not(:disabled) { border-color: rgba(255,255,255,.28) !important; color: var(--soft) !important; }
.btn-outline-danger { color: var(--danger) !important; border-color: rgba(248,113,113,.3) !important; background: rgba(248,113,113,.07) !important; }
.btn-outline-danger:hover:not(:disabled) { border-color: var(--danger) !important; background: rgba(248,113,113,.15) !important; }

/* ── 2FA ── */
.settings-value.mfa-on { color: var(--lime); }
.qr-container {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  display: inline-block;
}
.qr-container svg { display: block; width: 240px; height: 240px; }

/* ── 2FA Enroll Modal ── */
.mfa-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.68);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
  overflow-y: auto;
}
.mfa-modal-card {
  background: var(--slate);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 400px;
  flex-shrink: 0;
}
.mfa-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.mfa-modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
}
.mfa-modal-hint {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}
.qr-wrapper {
  display: flex;
  justify-content: center;
  margin: 16px 0 20px;
}
.mfa-modal-card input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--slate-mid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--white);
  font-size: 15px;
  font-family: inherit;
  letter-spacing: .18em;
  outline: none;
  margin-bottom: 10px;
  margin-top: 14px;
}
.mfa-modal-card input[type="text"]:focus { border-color: var(--lime); }
.mfa-modal-card a.btn-lime {
  display: block;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  margin-top: 14px;
}
.mfa-secret-box {
  background: var(--slate-mid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 6px 0 16px;
  word-break: break-all;
}
.mfa-secret-box code {
  color: var(--sky);
  font-size: 12.5px;
  background: none;
  padding: 0;
  letter-spacing: .1em;
}

/* ════════════ ADMIN DASHBOARD ════════════ */
/* Admin-Tab braucht mehr Breite für Tabellen/KPI-Grid */
.settings-card.admin-wide { max-width: 860px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--slate);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
}
.kpi-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  color: var(--lime);
  line-height: 1.1;
  margin-bottom: 4px;
}
.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 360px;
}
.admin-table th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--border-strong);
}
.admin-table th.num-th { text-align: right; }
.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--soft);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .plan-pill {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(163,230,53,0.15);
  color: var(--lime);
  white-space: nowrap;
}
.admin-table .num-cell { text-align: right; font-variant-numeric: tabular-nums; color: var(--white); }
.admin-table .muted-cell { color: var(--muted); }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
}
.bar-fill {
  width: 100%;
  background: var(--lime);
  border-radius: 3px 3px 0 0;
  opacity: 0.75;
  min-height: 4px;
}
.bar-num  { font-size: 10px; color: var(--soft);  line-height: 1; }
.bar-date { font-size: 10px; color: var(--muted); line-height: 1; }

.admin-sub-num {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  margin-left: 6px;
}
.admin-meta {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 8px;
  padding-bottom: 8px;
}

/* ════════════ MOBILE ════════════ */
@media (max-width: 800px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 100;
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: min(var(--sidebar-w), 85vw);
  }
  .sidebar.open { transform: none; }
  .sidebar-close, .sidebar-open { display: inline-flex; }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(0,0,0,0.55);
  }
  .messages { padding: 20px 14px; }
  .composer { padding-left: 12px; padding-right: 12px; }
  .bubble { max-width: 92%; }
}
