:root {
  --bg: #0f1117; --side: #0b0d13; --card: #151923; --line: #1f2430; --line2: #262c3a; --field: #10131b;
  --text: #e6e8ef; --muted: #8b91a5; --faint: #5a6075; --acc1: #aa5cc3; --acc2: #00a4dc;
  --ok: #34d399; --err: #ff5c7a; --warn: #f5b94a; --info: #4cc3f0;
  --accent: linear-gradient(135deg, var(--acc1), var(--acc2));
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --script: "Segoe Script", "Lucida Handwriting", "Brush Script MT", "Apple Chancery", cursive;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 13.5px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
::selection { background: #00a4dc66; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2b3142; border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

.ic { display: inline-flex; width: 16px; height: 16px; flex: none; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.side { background: var(--side); display: flex; flex-direction: column; border-right: 1px solid #14171f; min-height: 0; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { padding: 22px 32px 6px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.top h1 { margin: 0; font-size: 22px; font-weight: 600; }
.top .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.content { flex: 1; overflow: auto; padding: 14px 32px 16px; min-height: 0; display: flex; flex-direction: column; }
.statusbar { height: 32px; padding: 0 32px; display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3a4052; flex: none; }
.dot.ok { background: var(--ok); } .dot.err { background: var(--err); } .dot.warn { background: var(--warn); } .dot.info { background: var(--info); }

/* Marke */
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 16px 26px 22px; }
.brand img { width: 44px; height: 44px; }
.brand .b1 { font-size: 18px; font-weight: 600; color: #f2f3f8; line-height: 1.1; }
.brand .b2 { font-family: var(--script); font-size: 21px; line-height: 1; margin: -2px 0 0 2px; background: linear-gradient(90deg, #c98af2, #4cc3f0); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
.over { font-size: 10.5px; font-weight: 600; color: #4e5468; letter-spacing: .04em; padding: 0 26px; margin: 0 0 8px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; padding: 0 12px; margin-bottom: 14px; }
.nav button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; border-radius: 8px; color: var(--muted); cursor: pointer; position: relative; margin: 1px 0; }
.nav button:hover { background: #141823; color: #d5d8e2; }
.nav button.on { background: #181c28; color: #fff; }
.nav button.on::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 2px; background: var(--accent); }
.nav button:focus-visible { outline: 2px solid var(--acc2); outline-offset: -2px; }
.sidefoot { margin-top: auto; padding: 14px 20px 16px 24px; border-top: 1px solid #171a23; font-size: 12px; color: #7a8096; }
.sidefoot .row { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidefoot .who { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: #a9aebf; }
.sidefoot .ver { color: #3a4052; font-size: 11px; margin-top: 10px; }

/* Karten & Text */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.card.tight { padding: 4px; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
.hint { color: var(--faint); font-size: 12px; line-height: 1.5; margin: 6px 0 0; }
.lbl { color: #9ca2b5; font-size: 12px; font-weight: 600; margin: 14px 0 6px; display: block; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 18px 20px; }
.stat .t { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.stat .n { font-size: 30px; font-weight: 600; margin-top: 10px; line-height: 1.1; }
.stat .s { color: var(--faint); font-size: 12px; margin-top: 2px; }
.split { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; margin-top: 12px; flex: 1; min-height: 320px; }
.split .card { display: flex; flex-direction: column; min-height: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line2); background: #1b202c; font-weight: 600; cursor: pointer; white-space: nowrap; position: relative; }
.btn:hover { filter: brightness(1.18); }
.btn:active { filter: brightness(1.35); }
.btn:disabled { opacity: .35; cursor: default; filter: none; }
.btn:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.danger { background: #2a161d; border-color: #43202b; color: #ff7a93; }
.btn.ghost { background: transparent; border-color: transparent; color: #9ca2b5; font-weight: 400; }
.btn.icon { width: 38px; height: 38px; padding: 0; }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn.big { padding: 11px 14px; }

/* Eingaben */
.inp { width: 100%; background: var(--field); border: 1px solid #232836; border-radius: 8px; padding: 9px 11px; outline: none; color: var(--text); }
.inp:hover { border-color: #2e3546; }
.inp:focus { border-color: var(--acc2); }
.inp::placeholder { color: #4e5468; }
.inp.mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; }
.search { position: relative; width: 250px; }
.search .ic { position: absolute; left: 12px; top: 11px; color: var(--faint); width: 14px; height: 14px; }
.search .inp { padding-left: 34px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; background: #12151e; border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { all: unset; cursor: pointer; padding: 6px 12px; border-radius: 6px; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.on { background: #262c3b; color: #fff; }
.seg button:focus-visible { outline: 2px solid var(--acc2); }
.switch { display: flex; align-items: center; gap: 12px; margin: 7px 0; cursor: pointer; color: #d5d8e2; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 36px; height: 20px; border-radius: 10px; background: #262c3b; position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #9ca2b5; transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--acc2); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .4; }

/* Werkzeugleiste, Tabellen */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bar .l, .bar .r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.count { color: var(--faint); }
.tablecard { margin: 12px 0; flex: 1; min-height: 160px; overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; color: var(--faint); font-size: 11.5px; font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.grid td { padding: 0 16px; height: 56px; border-bottom: 1px solid #191d28; }
.grid tr.row { cursor: pointer; }
.grid tr.row:hover td { background: #181c27; }
.grid tr.row.sel td { background: #14283a; }
.grid th.chk, .grid td.chk { width: 44px; padding-right: 0; }
.chkbox { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #3a4052; display: inline-grid; place-items: center; vertical-align: middle; }
.sel .chkbox { background: var(--accent); border-color: transparent; }
.sel .chkbox::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.user { display: flex; align-items: center; gap: 12px; }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 600; color: #fff; flex: none; }
.user .n { font-weight: 600; }
.user .s { color: #6e7489; font-size: 11.5px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: #1b202c; color: var(--muted); }
.pill.blue { background: #0e2733; color: var(--info); } .pill.purple { background: #251b31; color: #c98af2; } .pill.amber { background: #2e2512; color: var(--warn); }
.st { display: inline-flex; align-items: center; gap: 8px; }
.st i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.st.off i { background: var(--err); }
.empty { padding: 48px 16px; text-align: center; color: var(--faint); }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 18px; margin-bottom: 4px; }
.actions .l { color: var(--muted); } .actions .r { display: flex; gap: 8px; flex-wrap: wrap; }

/* Aktivität */
.log { overflow: auto; flex: 1; margin-top: 12px; }
.log .e { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; font-size: 12.5px; color: #a9aebf; }
.log .e .dot { margin-top: 6px; }
.log .e .tx { flex: 1; word-break: break-word; }
.log .e time { color: #4e5468; font-size: 11.5px; }

/* Formular "Neuer Benutzer" */
.newgrid { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; flex: 1; min-height: 0; }
.prev { text-align: center; }
.prev .avbig { width: 72px; height: 72px; font-size: 28px; margin: 26px auto 0; }
.fill { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.formcard { padding: 26px; overflow: auto; }
.prev h3 { margin: 14px 0 0; font-size: 18px; font-weight: 600; word-break: break-all; }
.prev .plogin { color: var(--muted); margin-top: 3px; min-height: 20px; word-break: break-all; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; text-align: right; }
.kv span:first-child { color: var(--muted); text-align: left; }
.sep { border-top: 1px solid var(--line); margin: 22px 0 4px; }

/* Einstellungen */
.setgrid { display: grid; grid-template-columns: 250px 1fr; gap: 28px; }
.kvl { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; margin-top: 12px; }
.kvl dt { color: var(--muted); } .kvl dd { margin: 0; word-break: break-all; }
.mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 12.5px; }

/* Dialog */
.overlay { position: fixed; inset: 0; background: #070910d0; display: grid; place-items: center; z-index: 50; padding: 16px; }
.dlg { width: 500px; max-width: 100%; max-height: 90vh; overflow: auto; background: #171b26; border: 1px solid var(--line2); border-radius: 14px; padding: 26px; box-shadow: 0 24px 60px #000a; }
.dlg .hd { display: flex; align-items: center; gap: 12px; }
.dlg .ib { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.dlg h3 { margin: 0; font-size: 17px; font-weight: 600; }
.dlg .msg { color: #a9aebf; margin: 14px 0 0; line-height: 1.55; white-space: pre-wrap; }
.dlg pre { background: var(--field); border: 1px solid #232836; border-radius: 8px; padding: 10px 12px; margin: 14px 0 0; max-height: 230px; overflow: auto; font: 12.5px/1.5 "Cascadia Mono", Consolas, ui-monospace, monospace; white-space: pre; }
.dlg .ft { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.dlg .inp, .dlg .switch { margin-top: 16px; }

.busy { position: fixed; inset: 0; background: #070910a0; display: grid; place-items: center; z-index: 60; }
.busy .box { background: #171b26; border: 1px solid var(--line2); border-radius: 12px; padding: 18px 24px; display: flex; align-items: center; gap: 14px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #2b3142; border-top-color: var(--acc2); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 20px; bottom: 20px; background: #171b26; border: 1px solid var(--line2); border-radius: 10px; padding: 12px 16px; z-index: 70; max-width: 420px; box-shadow: 0 10px 30px #0008; }

/* Dateibrowser */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.crumb { all: unset; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; cursor: pointer; color: #c9cdd8; font-weight: 600; }
.crumb:hover { background: #181c27; }
.crumb:focus-visible { outline: 2px solid var(--acc2); }
.sepc { color: var(--faint); }
.fname { all: unset; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; max-width: 100%; }
.fname span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname .ic { color: var(--muted); }
.fname:hover { color: #fff; }
.fname:focus-visible { outline: 2px solid var(--acc2); border-radius: 4px; }
.grid td.count { color: var(--muted); white-space: nowrap; }
.tablecard.drop { outline: 2px dashed var(--acc2); outline-offset: -6px; }
.uploads { padding: 8px 18px; margin: 12px 0 0; }
.up { padding: 8px 0; }
.upname { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.upname span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar2 { height: 5px; background: #1f2430; border-radius: 3px; margin: 8px 0 4px; overflow: hidden; }
.fill2 { height: 100%; background: var(--accent); transition: width .15s; }
.fill2.err { background: var(--err); }
.upstate { font-size: 11.5px; color: var(--faint); }
.upstate.err { color: var(--err); }
.btn.ghost.sm { padding: 5px 8px; }

/* Anmeldung */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 50% -10%, #1a1630 0%, var(--bg) 70%); }
.login .box { width: 400px; max-width: 100%; }
.login .brand { justify-content: center; padding: 0 0 26px; }
.login .brand img { width: 56px; height: 56px; }
.login .brand .b1 { font-size: 24px; } .login .brand .b2 { font-size: 27px; }
.login .card { padding: 28px; }
.login .err { color: var(--err); background: #2a161d; border: 1px solid #43202b; border-radius: 8px; padding: 9px 12px; margin-top: 14px; }

@media (max-width: 1100px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .split, .newgrid, .setgrid { grid-template-columns: 1fr; }
  .fill { flex: none; min-height: auto; }
  .newgrid { flex: none; }
  .formcard { overflow: visible; }
  .tablecard { min-height: 320px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid #14171f; }
  .brand { padding: 12px 14px; } .brand img { width: 32px; height: 32px; }
  .nav { flex-direction: row; flex-wrap: wrap; padding: 0 8px; margin: 0; } .over, .sidefoot .row { display: none; }
  .sidefoot { margin: 0 0 0 auto; border: 0; padding: 8px 14px; }
  .top, .content, .statusbar { padding-left: 16px; padding-right: 16px; }
  .search { width: 100%; }
}

select.inp { appearance: auto; color-scheme: dark; cursor: pointer; }
select.inp option { background: #181c27; color: #e8eaf1; }
