:root { --bg:#0f1720; --panel:#17212c; --line:#253242; --text:#e6edf3; --muted:#8b9bb0; --accent:#2f81f7; --err:#f85149; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--text); font-family: "Segoe UI", system-ui, sans-serif; }
a { color: inherit; }
.bbt-shell { min-height:100%; display:flex; flex-direction:column; }
.bbt-header { height:44px; display:flex; align-items:center; justify-content:space-between; padding:0 16px; background:var(--panel); border-bottom:1px solid var(--line); }
.bbt-brand { font-weight:700; text-decoration:none; font-size:18px; }
.bbt-brand span { color:var(--accent); }
.bbt-brandbox { display:flex; align-items:baseline; gap:8px; min-width:0; }
.bbt-copyright { font-size:11px; color:var(--muted); opacity:.8; white-space:nowrap; }
@media (max-width: 420px) { .bbt-copyright { display:none; } }
.bbt-user { display:flex; gap:12px; align-items:center; color:var(--muted); }
.bbt-user form { margin:0; }
@media (max-width: 700px) { .bbt-user { flex-wrap:wrap; justify-content:flex-end; } }
/* Letzter Login / Anmeldungen in 24 h (LastLoginBanner): groß über der Rechnerliste und beim Direktstart */
.bbt-lastlogin-banner { background:var(--panel); border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:8px; padding:12px 16px; margin:0 0 18px; }
.bbt-lastlogin-main { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 14px; font-size:20px; line-height:1.3; }
.bbt-lastlogin-main b { color:#fff; }
.bbt-lastlogin-ip { color:var(--muted); font-size:16px; }
.bbt-lastlogin-count { margin-left:auto; white-space:nowrap; }
.bbt-lastlogin-count b { color:var(--accent); font-size:24px; }
.bbt-lastlogin-hint { color:var(--muted); font-size:13px; margin-top:4px; }
.bbt-login .bbt-lastlogin-banner { margin:0; padding:10px 12px; }
.bbt-login .bbt-lastlogin-main { font-size:17px; }
.bbt-login .bbt-lastlogin-count { margin-left:0; }
.bbt-main { flex:1; padding:24px; }
h1 { font-size:22px; margin:0 0 12px; }
.bbt-muted { color:var(--muted); font-size:14px; }
.bbt-login { max-width:380px; margin:48px auto; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:28px; display:flex; flex-direction:column; gap:12px; }
.bbt-login form { display:flex; flex-direction:column; gap:12px; }
.bbt-login label { display:flex; flex-direction:column; gap:4px; font-size:14px; color:var(--muted); }
/* „Kennwort nicht übertragen“: Haken links, ganze Zeile klickbar (Touch) */
.bbt-login label.bbt-srp-option { flex-direction:row; align-items:flex-start; gap:10px; min-height:44px; color:var(--text); cursor:pointer; }
.bbt-srp-option input { width:20px; height:20px; margin:2px 0 0; flex:none; accent-color:var(--accent); }
.bbt-srp-option .bbt-muted { display:block; font-size:12px; }
.bbt-srp-busy { color:var(--muted); font-size:13px; }
input { background:#0b121a; border:1px solid var(--line); color:var(--text); border-radius:6px; padding:9px 10px; font-size:15px; }
input:focus { outline:2px solid var(--accent); border-color:transparent; }
.bbt-btn { background:var(--accent); color:#fff; border:0; border-radius:6px; padding:9px 16px; font-size:15px; cursor:pointer; }
.bbt-btn:disabled { opacity:.6; cursor:wait; }
.bbt-btn-ghost { background:transparent; border:1px solid var(--line); color:var(--text); padding:5px 12px; font-size:13px; }
.bbt-alert, .validation-message, .bbt-error { color:var(--err); font-size:14px; }
.bbt-status { min-height:20px; font-size:14px; color:var(--muted); }
.bbt-search { width:100%; max-width:360px; margin-bottom:16px; }
.bbt-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:14px; }
.bbt-card { display:flex; flex-direction:column; gap:6px; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:16px; text-decoration:none; transition:border-color .15s; }
.bbt-card:hover { border-color:var(--accent); }
.bbt-card-title { font-weight:600; font-size:16px; }
.bbt-card-host { font-family:Consolas, monospace; font-size:13px; color:var(--muted); }
.bbt-card-action { margin-top:auto; color:var(--accent); font-size:14px; }
/* session page: canvas uses the full window */
.bbt-session { position:fixed; inset:44px 0 0 0; background:#000; }
.bbt-session .bbt-connect { position:relative; top:24px; }
.bbt-toolbar { position:fixed; top:0; right:220px; height:44px; display:flex; align-items:center; gap:8px; z-index:5; }
.bbt-toolbar #bbt-title { color:var(--muted); margin-right:8px; }
.bbt-screen { position:absolute; inset:0; display:flex; align-items:flex-start; justify-content:flex-start; overflow:auto; background:#000; }
/* 1 remote pixel = 1 device pixel (CSS size = backing size / devicePixelRatio, set by bbterminal.js); never smoothed */
#bbt-canvas { display:block; flex:none; outline:none; cursor:default; image-rendering:crisp-edges; image-rendering:pixelated; }
[hidden] { display:none !important; }
#blazor-error-ui { background:#5c1b1b; bottom:0; display:none; left:0; padding:.6rem 1.25rem .7rem 1.25rem; position:fixed; width:100%; z-index:1000; }
#blazor-error-ui .dismiss { cursor:pointer; position:absolute; right:.75rem; top:.5rem; }
/* ---- stage 2: navigation, recovery banner, tiles, admin ---- */
.bbt-recovery { background:#7a1f1f; color:#fff; padding:10px 16px; font-weight:600; border-bottom:2px solid var(--err); }
.bbt-nav { display:flex; gap:4px; margin-left:24px; flex:1; }
.bbt-nav a { text-decoration:none; color:var(--muted); padding:6px 12px; border-radius:6px; font-size:14px; }
.bbt-nav a.active, .bbt-nav a:hover { color:var(--text); background:#0b121a; }
.bbt-tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:16px; }
.bbt-tile { display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:20px 14px; text-decoration:none; transition:border-color .15s, transform .15s; }
.bbt-tile:hover { border-color:var(--accent); transform:translateY(-2px); }
.bbt-tile-logo { width:96px; height:96px; display:flex; align-items:center; justify-content:center; font-size:56px; }
.bbt-tile-logo img { max-width:100%; max-height:100%; object-fit:contain; }
.bbt-tile-logo.small { width:64px; height:64px; font-size:36px; }
.bbt-tile-logo.tiny { width:32px; height:32px; font-size:20px; }
.bbt-tile-title { font-weight:600; font-size:16px; }
.bbt-tile-desc { color:var(--muted); font-size:13px; }
.bbt-tile-tags { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; }
.bbt-tile-wrap { display:flex; flex-direction:column; gap:6px; min-width:0; }
.bbt-tile-wrap > .bbt-tile { flex:1; }
.bbt-notes { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.bbt-notes-text { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font-family:Consolas, ui-monospace, monospace; font-size:13px; color:var(--text); user-select:text; }
.bbt-notes-actions { display:flex; gap:6px; justify-content:flex-end; }
.bbt-notes .bbt-btn { font-size:12px; padding:4px 8px; }
.bbt-tag { font-size:11px; padding:2px 8px; border-radius:10px; background:#0b121a; border:1px solid var(--line); color:var(--muted); }
.bbt-tag-ok { color:#3fb950; border-color:#2a5a35; }
.bbt-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.bbt-tabs button { background:transparent; color:var(--muted); border:0; border-bottom:2px solid transparent; padding:8px 14px; font-size:14px; cursor:pointer; }
.bbt-tabs button.active { color:var(--text); border-bottom-color:var(--accent); }
.bbt-info { color:#3fb950; font-size:14px; margin-bottom:10px; }
.bbt-editor { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:20px; max-width:900px; }
.bbt-editor h2 { font-size:18px; margin:0 0 14px; }
.bbt-editor h3 { font-size:15px; margin:22px 0 8px; }
.bbt-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px 18px; }
.bbt-form-grid label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); }
.bbt-form-grid .bbt-check { flex-direction:row; align-items:center; gap:8px; }
.bbt-span2 { grid-column:span 2; }
.bbt-logo-row { display:flex; align-items:center; gap:14px; }
.bbt-actions { display:flex; gap:8px; margin:14px 0; }
.bbt-table { width:100%; border-collapse:collapse; font-size:14px; }
.bbt-table th { text-align:left; color:var(--muted); font-weight:500; border-bottom:1px solid var(--line); padding:8px; }
.bbt-table td { border-bottom:1px solid var(--line); padding:8px; vertical-align:middle; }
.bbt-table tr.bbt-disabled td { opacity:.5; }
.bbt-row-actions { white-space:nowrap; text-align:right; }
.bbt-danger { color:var(--err) !important; }
select, textarea { background:#0b121a; border:1px solid var(--line); color:var(--text); border-radius:6px; padding:8px 10px; font-size:14px; font-family:inherit; }
input[type=checkbox] { width:16px; height:16px; }
.bbt-clip { position:fixed; top:52px; right:16px; width:380px; z-index:6; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:8px; box-shadow:0 8px 24px rgba(0,0,0,.5); }
.bbt-clip textarea { width:100%; height:140px; resize:vertical; }
.bbt-clip-actions { display:flex; gap:8px; justify-content:flex-end; }
/* ---- sharing / watching ---- */
.bbt-watch-indicator { border-color:var(--err) !important; color:#fff !important; background:#7a1f1f !important; animation:bbt-pulse 1.6s ease-in-out infinite; }
@keyframes bbt-pulse { 50% { box-shadow:0 0 0 4px rgba(248,81,73,.35); } }
.bbt-is-watched .bbt-screen { box-shadow:inset 0 0 0 3px var(--err); }
.bbt-share { width:440px; }
.bbt-share input { width:100%; font-family:Consolas, monospace; font-size:12px; }
.bbt-viewer-list { display:flex; flex-direction:column; gap:6px; }
.bbt-viewer { display:flex; gap:8px; align-items:center; justify-content:space-between; font-size:13px; }
.bbt-viewer span { flex:1; }
.bbt-watching #bbt-canvas { max-width:100%; height:auto !important; }
/* VNC desktop larger than the window (fixed Mac resolution): fit into the window, smooth scaling */
.bbt-fit #bbt-canvas { width:auto !important; height:auto !important; max-width:100%; max-height:100%; image-rendering:auto; } /* watchers: only scaled down if their window is smaller */
.bbt-watching .bbt-toolbar { left:auto; }
.bbt-audit td { font-size:12px; font-family:Consolas, monospace; }
.bbt-audit th.bbt-sortable { cursor:pointer; user-select:none; white-space:nowrap; }
.bbt-audit th.bbt-sortable:hover { color:var(--text); }
.bbt-audit-filter { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:10px 0; }
.bbt-audit-filter input { min-width:180px; }
.bbt-audit-filter select { width:auto; min-height:40px; } /* Benutzer-Reiter: Status- und Sortierauswahl nur so breit wie nötig */
.bbt-audit-link { background:none; border:0; padding:0; color:inherit; font:inherit; cursor:pointer; text-decoration:underline dotted; }
body:has(#bbt-session) .bbt-nav { display:none; }
.bbt-warn { display:block; color:#f0b429; font-size:12px; margin-top:4px; }
/* built-in icons */
.bbt-icon { width:100%; height:100%; color:var(--text); }
.bbt-tile-logo .bbt-icon { width:80%; height:80%; }
.bbt-icon-picker { display:grid; grid-template-columns:repeat(auto-fill, minmax(92px, 1fr)); gap:8px; margin-top:6px; }
.bbt-icon-choice { display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 4px; background:transparent; border:1px solid rgba(255,255,255,.12); border-radius:8px; color:inherit; cursor:pointer; }
.bbt-icon-choice svg, .bbt-icon-choice span { width:40px; height:40px; font-size:30px; line-height:40px; }
.bbt-icon-choice small { font-size:11px; text-align:center; line-height:1.2; opacity:.85; }
.bbt-icon-choice:hover { border-color:rgba(255,255,255,.35); }
.bbt-icon-choice.selected { border-color:#3b82f6; background:rgba(59,130,246,.15); }
.bbt-check-inline { display:inline-flex; align-items:center; gap:4px; cursor:pointer; }
.bbt-check-inline input { margin:0; }
.bbt-keys-wrap { position:relative; display:inline-block; }
.bbt-keys { position:absolute; top:calc(100% + 4px); right:0; z-index:50; display:flex; flex-direction:column; gap:2px; min-width:250px;
  background:var(--panel, #1c2430); border:1px solid var(--border, #33404f); border-radius:8px; padding:6px; box-shadow:0 8px 24px rgba(0,0,0,.4); }
.bbt-keys .bbt-btn { text-align:left; justify-content:flex-start; }
.bbt-keys-hint { font-size:11px; padding:4px 6px 0; max-width:240px; }
#bbt-session[data-protocol=vnc] .bbt-keys [data-proto=rdp], #bbt-session:not([data-protocol=vnc]) .bbt-keys [data-proto=vnc] { display:none; }

/* ---- Login: Hintergrundbild (nur Anmeldeseite) ---- */
/* eigenes fixiertes Element statt background-attachment:fixed (funktioniert auch auf iOS/Android) */
.bbt-login-bg { position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(ellipse at center, rgba(6,12,22,.15) 0%, rgba(6,12,22,.55) 70%, rgba(6,12,22,.75) 100%),
    url("img/login-bg.jpg") center center / cover no-repeat, var(--bg); }
.bbt-login-page { position:relative; min-height:calc(100vh - 44px); min-height:calc(100dvh - 44px); display:flex; align-items:center; justify-content:center; padding:24px 16px; box-sizing:border-box; }
.bbt-login-page .bbt-login { position:relative; z-index:1; width:100%; margin:0 auto; box-sizing:border-box;
  background:rgba(15,23,32,.72); border:1px solid rgba(255,255,255,.12); box-shadow:0 12px 40px rgba(0,0,0,.55);
  -webkit-backdrop-filter:blur(12px) saturate(120%); backdrop-filter:blur(12px) saturate(120%); }
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) { .bbt-login-page .bbt-login { background:rgba(15,23,32,.92); } }
.bbt-login-page .bbt-login input { background:rgba(10,16,24,.75); }
body:has(.bbt-login-page) .bbt-header { position:relative; z-index:2; background:rgba(15,23,32,.7); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
body:has(.bbt-login-page) .bbt-recovery { position:relative; z-index:2; }
body:has(.bbt-login-page) .bbt-main { padding:0; }
@media (max-width:480px) { .bbt-login-page { align-items:flex-start; padding:20px 12px; } .bbt-login-page .bbt-login { padding:20px; } }
/* Gruppen- / Mitglieder-Auswahl und 2FA-Schlüssel (Administration, Mein Konto) */
.bbt-checklist { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:6px 18px; margin:8px 0 14px; }
.bbt-checklist .bbt-check { display:flex; flex-direction:row; align-items:center; gap:8px; min-height:36px; font-size:14px; cursor:pointer; }
.bbt-checklist .bbt-check input { width:18px; height:18px; flex:none; }
.bbt-secret { display:inline-block; font-size:18px; letter-spacing:1px; padding:8px 12px; border:1px solid #253242; border-radius:6px; user-select:all; }
.bbt-main > .bbt-recovery { margin-bottom:14px; border-radius:6px; }
.bbt-recovery a { color:#fff; text-decoration:underline; }
/* Sitzungsseite mit sofortigem Verbinden (hinterlegte Zugangsdaten / Agent): nur Name und Status, bis es scheitert oder endet */
.bbt-connect.bbt-autoconnect > p, .bbt-connect.bbt-autoconnect > label, .bbt-connect.bbt-autoconnect > button { display:none; }
/* Ersteinrichtung (noch kein Admin-Passwort): Hinweis im Anmeldekasten */
.bbt-login .bbt-recovery { border-radius:6px; border-bottom:0; margin:0 0 14px; font-weight:500; line-height:1.4; }
/* lange Auswahltexte (Anmeldesicherheit, VNC-Verfahren, Zwischenablage) dürfen das Formularraster nicht aufweiten */
.bbt-form-grid { grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); }
.bbt-form-grid > * { min-width:0; }
.bbt-form-grid select, .bbt-table select { width:100%; max-width:100%; text-overflow:ellipsis; }

/* Administration -> Lizenz */
.bbt-license th { text-align: left; white-space: nowrap; width: 1%; padding-right: 1.5em; }
.bbt-license code { user-select: all; }
.bbt-license-text { width: 100%; box-sizing: border-box; font-family: Consolas, monospace; font-size: .85em; word-break: break-all; }
.bbt-ok { color: #1f8a4c; font-weight: 600; }
.bbt-license-hint { margin: .5em 0; }

.bbt-hwkey { display: flex; gap: .5em; }
.bbt-hwkey input { flex: 1; font-family: Consolas, monospace; letter-spacing: .05em; }
.bbt-license-page { max-width: 560px; }
/* Rechnerlisten in Gruppen nach Registrierungscode (ComputerGroups.razor) */
.bbt-group { margin-bottom:14px; }
.bbt-group-head { display:flex; align-items:center; gap:8px; width:100%; text-align:left; background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:8px 12px; font-size:15px; font-weight:600; cursor:pointer; }
.bbt-group-head:hover { border-color:var(--accent); }
.bbt-group-caret { width:1em; color:var(--muted); }
.bbt-group-count { color:var(--muted); font-weight:400; }
.bbt-group-body { margin-top:10px; }
.bbt-code-groups .bbt-check { display:inline-flex; margin-right:14px; }
.bbt-code-groups table { margin-top:6px; }
