/* KrakenBot-Server (2.1): Anmeldung, Registrierung, Konto, Admin – gleiche Gestaltung wie das Dashboard. */
:root {
  color-scheme: light;
  --page: #eef1f5; --panel: #ffffff; --panel-2: #f4f6f9; --window: #0f1a26; --window-2: #16263a; --window-ink: #eef3f8;
  --window-ink-2: #9fb0c2; --window-line: #26384d; --ink: #111a24; --ink-2: #4f5d6b; --muted: #7b8794; --line: #e2e7ed;
  --line-strong: #c9d1da; --amber: #e09a12; --amber-glow: rgba(224, 154, 18, .28); --steel: #2453d4; --steel-ink: #fff;
  --steel-soft: rgba(36, 83, 212, .09); --profit: #0e8a44; --loss: #cf352b; --warn: #c98500; --live: #c22a20; --ghost: #5b2bbf;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06); --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --display: "Bahnschrift", "DIN Alternate", "D-DIN", "Barlow", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --r-md: 10px; --r-lg: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0b0f14; --panel: #121821; --panel-2: #18202b; --window: #0a1520; --window-2: #10202f; --window-line: #22364a;
    --ink: #e7edf3; --ink-2: #a5b1bd; --muted: #7d8996; --line: #232d3a; --line-strong: #334152; --steel: #6e9bff;
    --steel-ink: #08111d; --steel-soft: rgba(110, 155, 255, .12); --profit: #3bc275; --loss: #f0675e; --live: #f0675e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
html { background: var(--page); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 17px; }
p { margin: 0 0 .6em; }
a { color: var(--steel); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--ink-2); font-size: 13.5px; }
.up { color: var(--profit); }
.down { color: var(--loss); }

/* Marke */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--window); position: relative; flex: none; box-shadow: inset 0 0 0 1px var(--window-line); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; border-radius: 50%; width: 8px; height: 8px; top: 13px; }
.brand-mark::before { left: 8px; background: var(--amber); box-shadow: 0 0 7px var(--amber-glow); }
.brand-mark::after { right: 8px; background: #3a4b5e; }
.brand-name { font-family: var(--display); font-size: 18px; font-weight: 600; line-height: 1.1; }
.brand-sub { font-size: 12.5px; color: var(--ink-2); }

/* Anmelde-Seiten */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px;
  background: radial-gradient(1200px 520px at 20% -10%, color-mix(in srgb, var(--steel) 14%, transparent), transparent 60%),
              radial-gradient(900px 420px at 110% 110%, color-mix(in srgb, var(--amber) 12%, transparent), transparent 60%), var(--page); }
.auth-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px 26px 22px; box-shadow: var(--shadow-lg); }
.auth-card h1 { margin-bottom: 4px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--ink-2); }
.auth-note { font-size: 13px; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }

/* Formulare */
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
input[type="text"], input[type="password"], input[type="number"], input:not([type]), select {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; min-height: 44px; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px var(--steel-soft); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--steel); flex: none; margin-top: 2px; }
.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--ink); font-weight: 400; cursor: pointer; }
.code-input { font-family: var(--display); font-size: 26px; letter-spacing: .35em; text-align: center; }
.msg { font-size: 14px; min-height: 1.2em; margin: 0; }
.msg.err { color: var(--loss); }
.msg.ok { color: var(--profit); }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px;
  min-height: 42px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--steel); color: var(--steel-ink); }
.btn-quiet { background: var(--panel); border-color: var(--line-strong); color: var(--ink); font-weight: 500; }
.btn-quiet:hover { background: var(--panel-2); }
.btn-danger { background: var(--live); color: #fff; }
.btn-ghost { background: var(--ghost); color: #fff; }
.btn-small { min-height: 34px; padding: 5px 11px; font-size: 13.5px; border-radius: 8px; }
.btn-wide { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Seiten mit Kopf (Konto, Admin) */
.page { max-width: 1240px; margin: 0 auto; padding: 0 20px 48px; }
.page-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 16px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.page-head .brand { margin-right: auto; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.card form { display: flex; flex-direction: column; gap: 12px; }
.wide { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--panel-2); white-space: nowrap; }
.badge.ok { color: var(--profit); border-color: color-mix(in srgb, var(--profit) 40%, var(--line)); background: color-mix(in srgb, var(--profit) 10%, var(--panel)); }
.badge.warn { color: #8a5b00; border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 12%, var(--panel)); }
.badge.bad { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 40%, var(--line)); background: color-mix(in srgb, var(--loss) 9%, var(--panel)); }
.badge.live { color: #fff; background: var(--live); border-color: var(--live); }
.badge.admin { color: var(--steel); border-color: color-mix(in srgb, var(--steel) 45%, var(--line)); background: var(--steel-soft); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list li:first-child { border-top: 0; }
.qr { background: #fff; border-radius: 12px; padding: 6px; width: max-content; box-shadow: 0 0 0 1px var(--line); line-height: 0; }
.qr img { width: 210px; height: 210px; display: block; image-rendering: pixelated; }
.secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; letter-spacing: .06em; word-break: break-all; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.callout { border-left: 4px solid var(--steel); background: var(--steel-soft); border-radius: 0 var(--r-md) var(--r-md) 0; padding: 10px 12px; font-size: 14px; }
.callout.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); }

/* Admin */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: 12.5px; color: var(--ink-2); }
.kpi b { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.meter { height: 6px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--steel); }
.meter i.hi { background: var(--warn); }
.meter i.crit { background: var(--loss); }
.users { display: flex; flex-direction: column; gap: 12px; }
.user { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 10px 18px;
  grid-template-columns: minmax(180px, 1.1fr) minmax(0, 2.4fr) auto; align-items: center; }
.user.locked { opacity: .7; }
.u-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.u-ava { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--window); color: var(--window-ink); font-weight: 700; font-family: var(--display); flex: none; }
.u-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-figs { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); font-size: 13px; }
.u-figs div > span { display: block; color: var(--ink-2); font-size: 12px; }
.u-figs .badge { margin-right: 4px; }
.u-figs div b { font-family: var(--display); font-weight: 600; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.u-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.u-more { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; border-top: 1px dashed var(--line); padding-top: 8px; }
.u-warn { color: var(--loss); font-weight: 600; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 230px; display: flex; flex-direction: column; }
.menu-pop button { border: 0; background: transparent; text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.menu-pop button:hover { background: var(--panel-2); }
.menu-pop button.danger { color: var(--loss); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--ink-2); font-size: 12.5px; font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.mono { white-space: nowrap; }
.grid-2 { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.5fr); }
tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.code-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--panel-2); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.code-box b { font-family: var(--display); font-size: 20px; letter-spacing: .06em; }
.code-box .link { font-size: 12.5px; color: var(--ink-2); word-break: break-all; flex-basis: 100%; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--panel); padding: 11px 18px; border-radius: 10px; max-width: min(640px, calc(100% - 32px)); font-size: 14px; box-shadow: var(--shadow-lg); }
.toast.err { background: var(--loss); color: #fff; }
dialog.dlg { border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 20px 22px; max-width: 480px; width: calc(100% - 24px); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.dlg::backdrop { background: rgba(8, 12, 18, .55); }
dialog.dlg form { display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .user { grid-template-columns: minmax(0, 1fr); }
  .u-act { justify-content: flex-start; }
  .menu-pop { right: auto; left: 0; }
}
@media (max-width: 560px) {
  .page { padding: 0 14px 40px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .auth-card { padding: 22px 18px 18px; border-radius: 16px; }
  .btn { min-height: 44px; }
}
.page > .card + .grid { margin-top: 16px; }
