/* MARTBot-Webpanel – Leiste + eigene Seiten (Übersicht, Erinnerungen, Verlauf, Login) */
:root {
  --mp-bg: #f4f2f7; --mp-panel: #ffffff; --mp-panel-2: #f8f6fb; --mp-text: #1d1a24; --mp-muted: #6b6578;
  --mp-border: #e2dde9; --mp-accent: #7c3aed; --mp-accent-text: #fff; --mp-accent-soft: #efe7fd;
  --mp-danger: #c0262d; --mp-ok: #15803d; --mp-warn: #b45309; --mp-bar: #1d1a24; --mp-bar-text: #ece9f1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --mp-bg: #141218; --mp-panel: #1d1a23; --mp-panel-2: #24202b; --mp-text: #ece9f1; --mp-muted: #9d96aa;
    --mp-border: #332e3c; --mp-accent: #a78bfa; --mp-accent-text: #160f24; --mp-accent-soft: #2c2440;
    --mp-danger: #f2777c; --mp-ok: #4ade80; --mp-warn: #fbbf24; --mp-bar: #0d0b11; --mp-bar-text: #ece9f1;
  }
}

/* ---------- Leiste ---------- */
#mp-bar {
  display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap;
  padding: 8px 20px; background: var(--mp-bar); color: var(--mp-bar-text);
  font: 14px/1.4 system-ui, "Segoe UI", sans-serif;
}
#mp-bar a { color: inherit; text-decoration: none; }
.mp-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-right: 6px; }
.mp-brand small { font-weight: 500; opacity: .65; }
.mp-logo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #7c3aed; color: #fff; font-weight: 800; }
.mp-links { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.mp-links a { padding: 6px 10px; border-radius: 7px; opacity: .8; white-space: nowrap; }
.mp-links a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.mp-links a.on { opacity: 1; background: rgba(167,139,250,.25); font-weight: 600; }
.mp-links a[hidden] { display: none; }
.mp-user { display: flex; align-items: center; gap: 8px; }
.mp-user img { width: 26px; height: 26px; border-radius: 50%; }
.mp-name { display: flex; flex-direction: column; line-height: 1.1; font-weight: 600; white-space: nowrap; }
.mp-name small { font-weight: 400; opacity: .6; font-size: 11px; }
.mp-out { white-space: nowrap; font-size: 12px; opacity: .7; border: 1px solid rgba(255,255,255,.2); padding: 3px 8px; border-radius: 6px; }
.mp-out:hover { opacity: 1; }
@media (max-width: 760px) { #mp-bar { padding: 8px 12px; } .mp-links { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; } }

select.mp-lang { font: inherit; font-size: 12px; color: inherit; background: transparent; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; padding: 3px 6px; cursor: pointer; }
select.mp-lang option { color: #1d1a24; background: #fff; }
.mp-login select.mp-lang { color: var(--mp-text); border-color: var(--mp-border); font-size: 13px; padding: 5px 8px; }

/* ---------- Avatar-Auswahl im Persönlichkeiten-Editor ---------- */
.avpick { display: flex; flex-wrap: wrap; gap: 8px; }
.avpick .av { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; padding: 6px; font-size: 11px; }
.avpick .av img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.avpick .av span { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avpick .av.sel { border: 2px solid var(--mp-accent); background: var(--mp-accent-soft); }
.avpick .av.add b { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 2px dashed var(--mp-border); font-size: 26px; }

/* ---------- Eigene Seiten ---------- */
body.mp { margin: 0; background: var(--mp-bg); color: var(--mp-text); font: 15px/1.45 system-ui, "Segoe UI", sans-serif; }
.mp-main { max-width: 1100px; margin: 0 auto; padding: 22px 20px 60px; }
@media (max-width: 600px) { .mp-main { padding: 16px; } }
.mp-main h1 { font-size: 22px; margin: 0 0 4px; }
.mp-lead { color: var(--mp-muted); margin: 0 0 18px; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.mp-card { background: var(--mp-panel); border: 1px solid var(--mp-border); border-radius: 12px; padding: 18px; min-width: 0; }
.mp-card h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.mp-card h2 .mp-sp { flex: 1; }
.mp-wide { grid-column: 1 / -1; }
.mp-muted { color: var(--mp-muted); }
.mp-small { font-size: 13px; }
.mp-main a { color: var(--mp-accent); }
.mp-btn {
  font: inherit; border: 1px solid var(--mp-border); background: var(--mp-panel-2); color: var(--mp-text);
  padding: 7px 13px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.mp-btn:hover { border-color: var(--mp-accent); }
.mp-btn.primary { background: var(--mp-accent); color: var(--mp-accent-text); border-color: var(--mp-accent); font-weight: 600; }
.mp-btn.danger { color: var(--mp-danger); }
.mp-btn.small { padding: 4px 9px; font-size: 13px; }
.mp-btn:disabled { opacity: .45; cursor: not-allowed; }
.mp-main :focus-visible, #mp-bar :focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
.mp-input { font: inherit; color: var(--mp-text); background: var(--mp-panel-2); border: 1px solid var(--mp-border); border-radius: 8px; padding: 7px 10px; min-width: 0; }

.mp-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mp-hero img { width: 64px; height: 64px; border-radius: 50%; }
.mp-hero .mp-t { font-size: 20px; font-weight: 700; }
.mp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mp-danger); margin-right: 6px; }
.mp-dot.on { background: var(--mp-ok); }
.mp-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.mp-kv dt { color: var(--mp-muted); }
.mp-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mp-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-left: auto; }
.mp-stats div { display: flex; flex-direction: column; }
.mp-stats b { font-size: 18px; }
.mp-stats span { font-size: 12px; color: var(--mp-muted); }

.mp-personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.mp-persona { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; text-align: center; }
.mp-persona img, .mp-persona .mp-ph { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--mp-accent-soft); }
.mp-persona.cur { border: 2px solid var(--mp-accent); background: var(--mp-accent-soft); font-weight: 600; }

.mp-list { list-style: none; margin: 0; padding: 0; }
.mp-list li { padding: 9px 0; border-top: 1px solid var(--mp-border); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.mp-list li:first-child { border-top: 0; }
.mp-when { color: var(--mp-muted); font-size: 12px; white-space: nowrap; min-width: 105px; }
.mp-who { font-weight: 600; }
.mp-what { flex: 1; min-width: 200px; overflow-wrap: anywhere; }
.mp-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--mp-accent-soft); color: var(--mp-text); white-space: nowrap; }
.mp-tag.warn { background: rgba(180,83,9,.15); }

.mp-table-wrap { overflow-x: auto; }
table.mp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mp-table th { text-align: left; font-size: 12px; color: var(--mp-muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--mp-border); }
.mp-table td { padding: 9px 8px; border-bottom: 1px solid var(--mp-border); vertical-align: top; }
.mp-table td.t { overflow-wrap: anywhere; min-width: 200px; }
.mp-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.mp-tabs { display: inline-flex; gap: 4px; background: var(--mp-panel-2); border: 1px solid var(--mp-border); border-radius: 9px; padding: 3px; }
.mp-tabs button { font: inherit; border: 0; background: transparent; color: var(--mp-text); padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.mp-tabs button.on { background: var(--mp-accent); color: var(--mp-accent-text); font-weight: 600; }
.mp-empty { color: var(--mp-muted); text-align: center; padding: 26px 10px; }

#mp-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .2s;
  background: var(--mp-text); color: var(--mp-bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); }
#mp-toast.show { opacity: 1; transform: translateX(-50%); }

dialog.mp-dialog { border: 1px solid var(--mp-border); border-radius: 12px; background: var(--mp-panel); color: var(--mp-text); padding: 0; width: min(900px, calc(100% - 32px)); max-height: 85vh; }
dialog.mp-dialog::backdrop { background: rgba(0,0,0,.45); }
.mp-dialog header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--mp-border); }
.mp-dialog header b { flex: 1; }
.mp-dialog pre { margin: 0; padding: 14px 16px; overflow: auto; max-height: 70vh; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Login ---------- */
.mp-login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.mp-login .mp-card { max-width: 420px; width: 100%; text-align: center; padding: 30px 24px; }
.mp-login .mp-logo { width: 56px; height: 56px; font-size: 28px; border-radius: 14px; margin: 0 auto 14px; }
.mp-login h1 { font-size: 22px; margin: 0 0 6px; }
.mp-discord { background: #5865F2; color: #fff; border: 0; font-weight: 600; padding: 11px 20px; border-radius: 10px; font-size: 15px; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; margin-top: 18px; }
.mp-discord:hover { background: #4752c4; }
.mp-msg { margin-top: 16px; padding: 10px 12px; border-radius: 9px; background: var(--mp-accent-soft); font-size: 14px; }
.mp-msg.err { background: rgba(192,38,45,.12); color: var(--mp-danger); }
