/* Sunny Konto – Oberfläche. Farben kommen aus theme.css (gleich wie sunnyChat). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: Manrope, "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
code { font-family: Consolas, ui-monospace, monospace; font-size: 13px; background: var(--panel-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.icon { display: inline-flex; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.logo { display: block; flex: none; border-radius: 22%; }
.wordmark { font-size: 22px; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.wm-a { font-weight: 600; }
.wm-b { font-weight: 800; color: var(--accent-text); }
.brand-row { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--panel-2); color: var(--text); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.accent { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.big { min-height: 52px; font-size: 16px; width: 100%; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.danger-text { color: var(--danger-text) !important; }
.icon-btn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); }

/* ---------- Anmelde-Seiten ---------- */
.auth { min-height: 100vh; display: flex; }
.auth-brand { flex: 0 1 46%; min-width: 0; padding: 48px 56px; background: var(--panel); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.brand-copy { display: flex; flex-direction: column; gap: 18px; }
.brand-copy h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.brand-copy p { color: var(--muted); font-size: 17px; max-width: 440px; }
.app-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.app-list li { display: flex; align-items: center; gap: 8px; }
.app-list .icon { color: var(--accent-text); }
.auth-main { flex: 1 1 54%; min-width: 0; padding: 24px; display: flex; flex-direction: column; }
.auth-top { display: flex; justify-content: flex-end; }
.auth-card { width: 100%; max-width: 440px; margin: auto; display: flex; flex-direction: column; gap: 18px; padding: 16px 0 32px; }
.auth-title { font-size: 28px; font-weight: 800; }
.alt-links { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
@media (max-width: 820px) {
  .auth { flex-direction: column; }
  .auth-brand { flex: none; padding: 20px; gap: 12px; }
  .brand-copy h1 { font-size: 24px; }
  .brand-copy p, .app-list, .auth-brand > p { display: none; }
  .auth-main { padding: 8px 20px 24px; }
}
.test-flag { padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-text); font-size: 13px; font-weight: 700; }
.test-flag a { color: inherit; }
.test-flag.slim { border-radius: 0; text-align: center; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.tabs a { flex: 1; min-height: 46px; display: flex; align-items: center; justify-content: center; text-align: center; border-bottom: 3px solid transparent; color: var(--muted); font-size: 15px; font-weight: 700; text-decoration: none; }
.tabs a.active { border-bottom-color: var(--accent); color: var(--text); }
.form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; min-width: 0; }
.field small { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="number"], input:not([type]), select {
  min-height: 46px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--input); color: var(--text); font-size: 15px; width: 100%; min-width: 0;
}
input:disabled { opacity: 0.7; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-status { color: var(--danger-text); font-size: 14px; min-height: 1em; }
.test-box { padding: 16px; border-radius: 14px; border: 1px dashed var(--line-strong); display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; max-width: 100%; }
.chip small { color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.notice > div, .notice > p, .notice > ul { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.notice .icon { color: var(--accent-text); }
.notice.warn { background: var(--warn-soft); color: var(--warn-text); border-color: transparent; }
.notice.warn .icon { color: var(--warn-text); }
.notice.ok { border-color: var(--accent-text); }

/* ---------- Angemeldete Seiten ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topnav { display: flex; gap: 4px; }
.topnav a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-weight: 700; text-decoration: none; }
.topnav a.active, .topnav a:hover { background: var(--panel-2); color: var(--text); }
.me-mini { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
@media (max-width: 700px) {
  .topbar { padding: 8px 12px; gap: 6px; }
  .topbar .wordmark { display: none; }
  .topnav a span:not(.icon) { display: none; }
  .me-name { display: none; }
}
.page-main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 20px 48px; display: flex; flex-direction: column; gap: 20px; }
.page-main.wide { max-width: 1440px; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { font-size: 30px; font-weight: 800; }
.page-head.row, .page-head:has(> button) { flex-direction: row; justify-content: space-between; align-items: center; }
.card { padding: 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { font-size: 18px; font-weight: 800; }
.card h3 { font-size: 14px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; align-items: start; }
.stack-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.profile-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar-actions { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plain.list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain.list li:last-child { border-bottom: none; }
.apps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.apps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--accent-soft); color: var(--accent-soft-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.bad { background: var(--danger); color: #fff; }
.pill.tiny { font-size: 10px; padding: 1px 6px; margin-left: 6px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table.compact td { padding: 6px 8px; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.who small { color: var(--muted); overflow-wrap: anywhere; }
.invite-form input { flex: 2 1 200px; }
.invite-form select { flex: 1 1 130px; width: auto; }
.dns-hint { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 13px; color: var(--muted); }
fieldset { margin: 0; padding: 0; border: none; display: flex; flex-direction: column; gap: 10px; }
legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.radio { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.radio input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; }
.radio span { display: flex; flex-direction: column; }
.radio small { color: var(--muted); }
.mail { gap: 8px; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 14px; margin: 0; padding: 12px; border-radius: 10px; background: var(--bg); }

/* ---------- Profilbilder ---------- */
.avatar { position: relative; width: 38px; height: 38px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 800; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }
.c0 { background: #4D6EA6; } .c1 { background: #6E5DAE; } .c2 { background: #3C7F84; } .c3 { background: #9A6A48; }
.c4 { background: #7A5A9A; } .c5 { background: #4F7F4A; } .c6 { background: #A2566B; } .c7 { background: #3F6E9E; }

/* ---------- Dialoge & Hinweise ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(4, 9, 18, 0.62); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.dialog { width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px 28px 28px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.dialog.wide { max-width: 1100px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 22px; font-weight: 800; }
@media (max-width: 520px) { .dialog { padding: 18px 16px; } }
.toasts { position: fixed; z-index: 70; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(92vw, 520px); }
.toast { padding: 12px 18px; border-radius: 14px; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; text-align: center; transition: opacity 0.35s, transform 0.35s; }
.toast.error { border-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Betreiber ---------- */
.op-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.op-tabs button { flex: none; min-height: 44px; padding: 0 14px; background: none; border: none; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.op-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.op-body, .op-grid { display: flex; flex-direction: column; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpis.small .kpi { background: var(--bg); }
.kpi span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.kpi b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi small { color: var(--muted); font-size: 12px; }
.op-search { max-width: 340px; }
.op-table th button { background: none; border: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 0; white-space: nowrap; }
.op-table th.sorted { color: var(--text); }
.op-table tbody tr { cursor: pointer; }
.op-table tbody tr:hover { background: var(--panel-2); }
tr.flagged td { background: color-mix(in srgb, var(--warn-soft) 70%, transparent); }
tr.is-blocked td { opacity: 0.6; text-decoration: line-through; text-decoration-color: var(--muted); }
.flag { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding: 1px 6px; border-radius: 999px; background: var(--warn-text); color: var(--panel); font-size: 11px; font-weight: 800; }
.flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.flag-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); border-left-width: 5px; }
.flag-item.high { border-left-color: var(--danger); }
.flag-item.mid { border-left-color: var(--warn-text); }
.flag-item .icon { color: var(--warn-text); }
.chart-box { display: flex; flex-direction: column; gap: 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .axis.end { text-anchor: end; }
.chart .line { fill: none; stroke-width: 2; }
.bar.s1, .sw.s1 { fill: #4D6EA6; background: #4D6EA6; } .line.s1 { stroke: #4D6EA6; }
.bar.s2, .sw.s2 { fill: #8DB82A; background: #8DB82A; } .line.s2 { stroke: #8DB82A; }
.bar.s3, .sw.s3 { fill: #C93A40; background: #C93A40; } .line.s3 { stroke: #C93A40; }
.bar.s4, .sw.s4 { fill: #F2A93B; background: #F2A93B; } .line.s4 { stroke: #F2A93B; }
:root[data-theme="dark"] .bar.s1, :root[data-theme="dark"] .sw.s1 { fill: #7F9FD8; background: #7F9FD8; }
:root[data-theme="dark"] .line.s1 { stroke: #7F9FD8; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--input); border: 1px solid var(--line); margin-bottom: 12px; }
.seg button { min-height: 36px; padding: 0 14px; border: none; border-radius: 9px; background: none; color: var(--muted); font-weight: 800; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(80px, 200px) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-val { font-variant-numeric: tabular-nums; color: var(--muted); }
.hbar { width: 100%; height: 12px; display: block; }
.chart-box { max-width: 900px; }
