/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/* Label/tag denoting the user that shared a connection */
.jdbc-share-tag {

    background: #0095ff;
    padding: 0.25em;

    -moz-border-radius:    0.25em;
    -webkit-border-radius: 0.25em;
    -khtml-border-radius:  0.25em;
    border-radius:         0.25em;

    color: white;
    font-size: 0.75em;
    font-weight: bold;

}
.totp-enroll p,.totp-details{font-size:.8em}.totp-qr-code{text-align:center}.totp-qr-code img{margin:1em;border:1px solid rgba(0,0,0,0.25);box-shadow:1px 1px 2px rgba(0,0,0,0.25);cursor:pointer}h3.totp-details-header{font-size:.8em}h3.totp-details-header::before{content:'▸ '}.totp-details-visible h3.totp-details-header::before{content:'▾ '}.totp-details,.totp-hide-details{display:none}.totp-details-visible .totp-details{display:table}.totp-details-visible .totp-hide-details{display:inline}.totp-details-visible .totp-show-details{display:none}.totp-hide-details,.totp-show-details{color:blue;text-decoration:underline;cursor:pointer;margin:0 .25em;font-weight:normal}.totp-details{margin:0 auto}.totp-details th{padding-right:.25em;text-align:left}.totp-details td{font-family:monospace}.totp-detail{display:inline-block;margin:0 .25em}/* SCN-Branding fuer die Guacamole-Anmeldung - Stil der RMM-Anmeldeseite
   (Glas-Optik in Blau, Anmeldekarte als Prozessor-Chip mit leuchtenden Leiterbahnen).
   Gilt fuer Anmeldung und Zwei-Faktor-Seiten (beide nutzen .login-ui). */
.login-ui {
    --lg-bg-1: #050b1a;
    --lg-bg-2: #0b1a3a;
    --lg-blue: #3b82f6;
    --lg-blue-2: #60a5fa;
    --lg-text: #e6edf8;
    --lg-muted: #94a3c4;
    --lg-glass: rgba(18, 32, 64, .55);
    --lg-glass-border: rgba(147, 197, 253, .28);
    --lg-input: rgba(8, 16, 36, .55);

    display: flex !important; align-items: center; justify-content: center;
    min-height: 100%; overflow: auto;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    color: var(--lg-text);
    background:
        radial-gradient(900px 600px at 15% 10%, rgba(59, 130, 246, .22), transparent 60%),
        radial-gradient(800px 600px at 90% 90%, rgba(34, 211, 238, .14), transparent 60%),
        linear-gradient(160deg, var(--lg-bg-2), var(--lg-bg-1) 65%) !important;
}
/* Feines Platinenraster */
.login-ui::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5;
    background-image:
        linear-gradient(rgba(96, 165, 250, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, .07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.login-ui .login-dialog-middle {
    display: flex !important; flex-direction: column; align-items: center;
    padding: 40px 16px; width: 100%;
}

/* ---------- Chip: Gehaeuse ---------- */
.login-ui .login-dialog {
    position: relative; width: 420px !important; max-width: 100% !important; margin: 70px 0 !important;
    border-radius: 30px !important; padding: 14px !important;
    background: linear-gradient(150deg, rgba(148, 163, 184, .32), rgba(30, 41, 59, .55)) !important;
    border: 1px solid rgba(191, 219, 254, .25) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(15, 23, 42, .6) inset, 0 0 60px rgba(59, 130, 246, .18) !important;
    text-align: left;
}

/* ---------- Leiterbahnen ---------- */
.scn-pins { position: absolute; inset: 0; pointer-events: none; }
.scn-pin {
    position: absolute; border-radius: 999px; overflow: hidden;
    background: linear-gradient(var(--dir, 180deg), rgba(37, 99, 235, .95), rgba(34, 211, 238, .75));
    box-shadow: 0 0 14px rgba(59, 130, 246, .55), 0 6px 14px rgba(0, 0, 0, .35);
}
.scn-pin::after {
    content: ""; position: absolute; border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(165, 243, 252, 0) 70%);
    animation: scn-flow-down var(--t, 2.8s) linear infinite; animation-delay: var(--d, 0s);
}
.scn-pin.v { width: 12px; }
.scn-pin.h { height: 12px; }
.scn-pin.v::after { left: 0; right: 0; height: 22px; top: -22px; }
.scn-pin.h::after { top: 0; bottom: 0; width: 22px; left: -22px; }
.scn-pin.top    { bottom: 100%; margin-bottom: -6px; --dir: 0deg; }
.scn-pin.bottom { top: 100%;    margin-top: -6px;    --dir: 180deg; }
.scn-pin.left   { right: 100%;  margin-right: -6px;  --dir: 270deg; }
.scn-pin.right  { left: 100%;   margin-left: -6px;   --dir: 90deg; }
.scn-pin.top::after    { animation-name: scn-flow-up; }
.scn-pin.bottom::after { animation-name: scn-flow-down; }
.scn-pin.left::after   { animation-name: scn-flow-left; }
.scn-pin.right::after  { animation-name: scn-flow-right; }
@keyframes scn-flow-down  { from { transform: translateY(0); }     to { transform: translateY(140px); } }
@keyframes scn-flow-up    { from { transform: translateY(140px); } to { transform: translateY(0); } }
@keyframes scn-flow-right { from { transform: translateX(0); }     to { transform: translateX(140px); } }
@keyframes scn-flow-left  { from { transform: translateX(140px); } to { transform: translateX(0); } }

/* ---------- Glaskarte ---------- */
.login-ui .login-form {
    position: relative; border-radius: 20px; padding: 30px 30px 26px;
    background: var(--lg-glass);
    backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--lg-glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -20px 40px rgba(2, 6, 23, .35);
    overflow: hidden;
}
.login-ui .login-form::before {
    content: ""; position: absolute; left: -20%; right: -20%; top: -60%; height: 90%; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(147, 197, 253, .16), transparent 65%);
}
.scn-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: rgba(147, 197, 253, .55); box-shadow: 0 0 8px rgba(96, 165, 250, .8); }
.scn-dot.tl { top: 12px; left: 12px; }    .scn-dot.tr { top: 12px; right: 12px; }
.scn-dot.bl { bottom: 12px; left: 12px; } .scn-dot.br { bottom: 12px; right: 12px; }

/* ---------- Kopf: Logo + Titel ---------- */
.login-ui .login-dialog .logo {
    position: relative;
    background: url('app/ext/scn-branding/images/logo.png') center / contain no-repeat !important;
    width: 100% !important; height: 96px !important; margin: 0 auto 6px !important;
    filter: drop-shadow(0 4px 18px rgba(59, 130, 246, .35));
}
.login-ui .login-dialog .version {
    position: relative; text-align: center !important; margin: 10px 0 22px !important; padding: 0 !important;
    color: var(--lg-text) !important;
}
.login-ui .login-dialog .version .app-name {
    font-size: 22px !important; font-weight: 700 !important; letter-spacing: .02em; color: var(--lg-text) !important;
    text-transform: none !important;
}
.login-ui .login-dialog .version .app-name::after {
    content: "Anmeldung mit Ihrem Windows-Konto"; display: block; margin-top: 2px;
    font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--lg-muted);
}
.login-ui .login-dialog .version .version-number { display: none !important; }

/* ---------- Formular ---------- */
.login-ui .login-fields { position: relative; }
.login-ui .login-fields .labeled-field {
    position: relative; margin: 0 0 12px !important; padding: 0 !important;
    background: transparent !important; border: 0 !important;
}
.login-ui .login-fields input[type=text],
.login-ui .login-fields input[type=password],
.login-ui .login-fields input[type=number],
.login-ui .login-fields input:not([type]) {
    width: 100% !important; height: 48px !important; padding: 0 14px !important; margin: 0 !important;
    border-radius: 12px !important; box-sizing: border-box;
    background: var(--lg-input) !important; color: var(--lg-text) !important; font-size: 15px !important;
    border: 1px solid rgba(147, 197, 253, .22) !important; outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-ui .login-fields input:focus {
    border-color: var(--lg-blue-2) !important; box-shadow: 0 0 0 4px rgba(59, 130, 246, .25) !important;
    background: rgba(8, 16, 36, .75) !important;
}
.login-ui .login-fields .field-header {
    color: #7f8fb0 !important; font-size: 15px !important; font-weight: 400 !important;
    padding-left: 14px !important; text-transform: none !important;
}
.login-ui .login-fields .labeled-field:not(.empty) .field-header { color: var(--lg-muted) !important; font-size: 11px !important; }

/* ---------- Schaltflaeche ---------- */
.login-ui .buttons { position: relative; margin-top: 6px; }
.login-ui .buttons input[type=submit] {
    width: 100% !important; height: 50px !important; margin: 0 !important; border: 0 !important; border-radius: 12px !important;
    cursor: pointer; font-size: 15px !important; font-weight: 600 !important; letter-spacing: .01em;
    text-transform: none !important; color: #fff !important;
    background: linear-gradient(135deg, #2563eb, #3b82f6 45%, #06b6d4) !important;
    box-shadow: 0 10px 26px rgba(37, 99, 235, .45), inset 0 1px 0 rgba(255, 255, 255, .25) !important;
    transition: transform .12s, box-shadow .15s, filter .15s;
}
.login-ui .buttons input[type=submit]:hover { filter: brightness(1.08); }
.login-ui .buttons input[type=submit]:active { transform: translateY(1px); }

/* ---------- Fehler / Hinweise ---------- */
.login-ui p.login-error {
    background: rgba(239, 68, 68, .14) !important; color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, .45) !important; border-radius: 10px;
    backdrop-filter: blur(8px); font-size: 13px;
}
.login-ui .login-fields p, .login-ui .login-fields .totp-details, .login-ui .login-fields label {
    color: var(--lg-muted) !important; font-size: 13px; line-height: 1.5;
}
.login-ui .login-fields a { color: var(--lg-blue-2) !important; }

/* Zwei-Faktor: QR-Code auf weisser Kachel, damit Apps ihn sicher lesen */
.login-ui .login-fields img {
    display: block; margin: 8px auto 14px; background: #fff; padding: 10px; border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

/* ---------- Fuss ---------- */
.scn-foot { position: relative; font-size: 12px; color: #6b7ba0; display: flex; gap: 8px; align-items: center; justify-content: center; }
.scn-foot svg { width: 14px; height: 14px; color: #60a5fa; }

/* Schmale Bildschirme */
@media (max-width: 560px) {
    .login-ui .login-dialog { margin: 46px 0 64px !important; padding: 10px !important; border-radius: 24px !important; }
    .login-ui .login-dialog .logo { height: 72px !important; }
    .scn-pin.left, .scn-pin.right { display: none; }
    .login-ui .login-form { padding: 24px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) { .scn-pin::after { animation: none; display: none; } }

/* Ausgefuelltes Feld: Beschriftung oben klein, Eingabe darunter (keine Ueberlappung) */
.login-ui .login-fields .labeled-field:not(.empty) .field-header { top: 7px !important; line-height: 1 !important; }
.login-ui .login-fields .labeled-field:not(.empty) input { padding-top: 16px !important; }

/* Hinweis "Konto gesperrt" - ersetzt die normale Fehlermeldung oben */
.login-ui p.scn-lock-msg {
    position: fixed; top: 0; left: 0; right: 0; z-index: 20; margin: 0;
    display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 20px;
    font: 14px "Segoe UI", system-ui, sans-serif; color: #ffe1e2; text-align: left;
    background: rgba(127, 29, 29, .55); border-bottom: 1px solid rgba(248, 113, 113, .6);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
.login-ui p.scn-lock-msg.ng-hide { display: none !important; }
.login-ui p.scn-lock-msg svg { width: 20px; height: 20px; flex: none; color: #fca5a5; }
.login-ui p.scn-lock-msg b { color: #fff; font-weight: 700; }
.login-ui p.scn-lock-msg:not(.ng-hide) + p.login-error { visibility: hidden !important; }

/* Fehlermeldung oben immer vor der Anmeldekarte */
.login-ui p.login-error { z-index: 25 !important; }
/* SCN-Branding fuer die Oberflaeche NACH der Anmeldung (Startseite, Menues, Einstellungen, Sitzungsmenue).
   Design "Glas" wie im RMM: tiefes Blau, feines Leiterbahn-Raster, Glasflaechen, blaue Akzente. Nur Darstellung. */

:root {
    --sc-canvas: #07101d;
    --sc-surface: rgba(16, 26, 44, .62);
    --sc-surface-2: rgba(255, 255, 255, .045);
    --sc-surface-3: rgba(255, 255, 255, .08);
    --sc-border: rgba(170, 200, 255, .13);
    --sc-border-strong: rgba(170, 200, 255, .24);
    --sc-text: #eef3fb;
    --sc-text-2: #a9b6ca;
    --sc-muted: #7586a0;
    --sc-accent: #4f8ff7;
    --sc-accent-2: #7cb0ff;
    --sc-glow: rgba(59, 130, 246, .16);
    --sc-grid: rgba(120, 160, 230, .035);
    --sc-blur: blur(18px) saturate(1.3);
    --sc-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
    --sc-hover: rgba(124, 176, 255, .07);
    --sc-input: rgba(255, 255, 255, .05);
    --sc-font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* ---------- Grundflaeche (alle Seiten ausser der laufenden Sitzung) ---------- */
body:not(.client) {
    font-family: var(--sc-font) !important; color: var(--sc-text);
    background-color: var(--sc-canvas) !important;
    background-image:
        radial-gradient(900px 520px at 78% -8%, var(--sc-glow), transparent 62%),
        linear-gradient(var(--sc-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--sc-grid) 1px, transparent 1px) !important;
    background-size: auto, 32px 32px, 32px 32px !important;
    background-attachment: fixed !important;
    color-scheme: dark;
}
body.client { font-family: var(--sc-font) !important; }
body:not(.client) a { color: var(--sc-accent-2); }
::selection { background: rgba(79, 143, 247, .35); }

/* Inhalt mittig wie im RMM */
.home-view .connection-list-ui,
body:not(.client) #content > .view:not(.home-view) { max-width: 1120px; margin: 0 auto; padding: 22px 24px 40px; box-sizing: border-box; }

/* Kopfzeile mit Logo ueber der Startseite */
.home-view .connection-list-ui::before {
    content: "Browserzugang"; display: flex; align-items: center; height: 52px; margin: 6px 0 18px; padding-left: 176px;
    background: url('app/ext/scn-branding/images/logo.png') left center / auto 44px no-repeat;
    font-size: 21px; font-weight: 700; letter-spacing: -.01em; color: var(--sc-text);
}

/* ---------- Abschnittskoepfe ---------- */
body:not(.client) .header {
    display: flex !important; align-items: center; gap: 10px;
    background: var(--sc-surface) !important; border: 1px solid var(--sc-border) !important; border-radius: 14px;
    box-shadow: var(--sc-shadow) !important; backdrop-filter: var(--sc-blur); -webkit-backdrop-filter: var(--sc-blur);
    margin: 0 0 14px !important; padding: 0 6px 0 18px; min-height: 52px; box-sizing: border-box;
}
body:not(.client) .header ~ .header, body:not(.client) .header ~ * .header { margin-top: 26px !important; }
body:not(.client) h2.header { display: block !important; padding: 15px 18px !important; font-size: 15px !important; font-weight: 650 !important; text-transform: none !important; color: var(--sc-text) !important; margin: 26px 0 12px !important; }
body:not(.client) .header h2 {
    font-size: 15px !important; font-weight: 650 !important; text-transform: none !important; letter-spacing: 0;
    color: var(--sc-text) !important; padding: 0 !important; margin: 0 !important; flex: 1 1 auto;
}

/* Suche */
body:not(.client) .filter input.search-string {
    height: 36px; border-radius: 10px !important; border: 1px solid var(--sc-border) !important;
    background-color: var(--sc-input) !important; color: var(--sc-text) !important; font-size: 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237586a0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") !important;
    background-size: 16px !important; background-position: 12px center !important; padding-left: 36px !important;
}
body:not(.client) .header .filter { padding: 8px 0; }
body:not(.client) .filter input.search-string:focus { border-color: var(--sc-accent-2) !important; box-shadow: 0 0 0 3px rgba(79, 143, 247, .25); outline: none; }

/* ---------- Benutzermenue (oben rechts) ---------- */
body:not(.client) .menu-dropdown {
    border: 1px solid var(--sc-border) !important; border-radius: 10px; background: var(--sc-surface-2) !important;
    color: var(--sc-text) !important; min-height: 38px; margin: 7px 0;
}
body:not(.client) .menu-dropdown:hover { background: var(--sc-surface-3) !important; }
body:not(.client) .menu-dropdown.open { background: rgba(79, 143, 247, .18) !important; border-color: rgba(124, 176, 255, .35) !important; }
.menu-dropdown .menu-title { color: inherit !important; font-weight: 600 !important; }
.user-menu .menu-dropdown .menu-title {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237cb0ff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E") !important;
}
.menu-dropdown .menu-indicator {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b6ca' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-size: 14px !important;
}
.menu-dropdown .menu-contents {
    background: rgba(11, 20, 36, .97) !important; border: 1px solid var(--sc-border-strong) !important; border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .5) !important; margin-top: 6px; padding: 6px;
}
.menu-dropdown .menu-contents li a { color: var(--sc-text) !important; border-radius: 8px; padding: 10px 12px 10px 38px !important; font-size: 14px; }
.menu-dropdown .menu-contents li a:hover { background-color: var(--sc-hover) !important; }
.menu-dropdown .menu-contents li a.current, .menu-dropdown .menu-contents li a.current:hover { opacity: .45; }
.menu-dropdown .menu-contents .profile { color: var(--sc-text-2); border-bottom: 1px solid var(--sc-border) !important; margin: 8px 10px !important; }
.menu-dropdown .menu-contents .profile a { color: var(--sc-text) !important; font-weight: 600; padding: 0 !important; }
.menu-dropdown .menu-contents li a.danger, .menu-dropdown .menu-contents li a.logout:hover { background-color: rgba(255, 97, 102, .14) !important; color: #ffb3b5 !important; }
.menu-dropdown .menu-contents .filter input { background: var(--sc-input) !important; color: var(--sc-text) !important; border: 1px solid var(--sc-border) !important; border-radius: 8px; }

/* Symbole im Benutzermenue (hell, passend zum dunklen Grund) */
.user-menu .menu-dropdown .menu-contents li a { background-size: 16px !important; background-position: 12px center !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b6ca' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E") !important; }
.user-menu .menu-dropdown .menu-contents li a[href="#/"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b6ca' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11 12 4l9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E") !important; }
.user-menu .menu-dropdown .menu-contents li a[href^="#/settings"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b6ca' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Ccircle cx='10' cy='12' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3C/svg%3E") !important; }
.user-menu .menu-dropdown .menu-contents li a.logout, .client .user-menu .menu-dropdown .menu-contents li a.disconnect {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff8a8e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='m16 17 5-5-5-5M21 12H9'/%3E%3C/svg%3E") !important; }

/* ---------- Letzte Verbindungen (Vorschaubilder) ---------- */
body:not(.client) .recent-connections { display: flex; flex-wrap: wrap; gap: 14px; padding: 2px 0 4px !important; margin: 0 !important; text-align: left !important; }
.home-view .all-connections, .home-view .all-connections .group-list, .home-view .all-connections .group-list-page { padding: 0 !important; margin: 0 !important; }
body:not(.client) .recent-connections .placeholder {
    flex: 1; margin: 0; padding: 22px; text-align: center; font-size: 14px !important; font-weight: 400 !important;
    color: var(--sc-muted) !important; opacity: 1 !important;
    border: 1px dashed var(--sc-border-strong); border-radius: 14px; background: var(--sc-surface-2);
}
body:not(.client) .recent-connections .connection {
    margin: 0 !important; padding: 12px !important; border-radius: 14px !important; max-width: 280px !important;
    background: var(--sc-surface) !important; border: 1px solid var(--sc-border); box-shadow: var(--sc-shadow);
    backdrop-filter: var(--sc-blur); -webkit-backdrop-filter: var(--sc-blur); transition: border-color .15s, transform .15s;
}
body:not(.client) .recent-connections .connection:hover { border-color: rgba(124, 176, 255, .45); transform: translateY(-2px); }
body:not(.client) .recent-connections .connection .thumbnail > * { border: 1px solid var(--sc-border) !important; border-radius: 8px; box-shadow: none !important; max-width: 100% !important; }
body:not(.client) .recent-connections .connection .caption { color: var(--sc-text); font-weight: 600; font-size: 14px; padding-top: 8px; }

/* ---------- Alle Verbindungen als Kacheln ---------- */
.home-view .all-connections .group-list-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.home-view .all-connections .list-item { margin: 0; }
.home-view .all-connections .list-item .caption { padding: 0 !important; background: none !important; }
.home-view .all-connections a.home-connection {
    display: flex !important; align-items: center; gap: 14px; padding: 16px 18px; min-height: 76px; box-sizing: border-box;
    border-radius: 14px; background: var(--sc-surface); border: 1px solid var(--sc-border); box-shadow: var(--sc-shadow);
    backdrop-filter: var(--sc-blur); -webkit-backdrop-filter: var(--sc-blur);
    color: var(--sc-text) !important; text-decoration: none !important; transition: border-color .15s, transform .15s, background .15s;
}
.home-view .all-connections a.home-connection::after {
    content: ""; width: 18px; height: 18px; margin-left: auto; flex: none; opacity: .45; transition: opacity .15s, transform .15s;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237cb0ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.home-view .all-connections a.home-connection:hover { border-color: rgba(124, 176, 255, .45); background: rgba(22, 36, 62, .72); transform: translateY(-2px); }
.home-view .all-connections a.home-connection:hover::after { opacity: 1; transform: translateX(2px); }
.home-view .all-connections a.home-connection .name { color: var(--sc-text) !important; font-size: 15px; font-weight: 600; margin: 0 !important; }
.home-view .all-connections a.home-connection .activeUserCount { color: var(--sc-muted); font-size: 12px; }
.home-view .all-connections .connection .icon {
    width: 42px !important; height: 42px !important; flex: none; border-radius: 11px; opacity: 1 !important; margin: 0 !important;
    background-color: rgba(79, 143, 247, .16) !important; border: 1px solid rgba(124, 176, 255, .22); box-sizing: border-box;
    background-size: 22px 22px !important; background-position: center !important; background-repeat: no-repeat !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237cb0ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E") !important;
}
/* Eigene Symbole je Programm (Verbindungs-Nr. 1-3 aus der Installation) */
.home-view a.home-connection[href^="#/client/MQBj"] .icon { /* AFS-Manager */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237cb0ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E") !important; }
.home-view a.home-connection[href^="#/client/MgBj"] .icon { /* AFS-Banking */
    background-color: rgba(76, 195, 138, .14) !important; border-color: rgba(76, 195, 138, .28) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366d9a3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10 12 4l9 6'/%3E%3Cpath d='M5 10v8M9.5 10v8M14.5 10v8M19 10v8M3 20h18'/%3E%3C/svg%3E") !important; }
.home-view a.home-connection[href^="#/client/MwBj"] .icon { /* AFS-Ticketsystem */
    background-color: rgba(240, 176, 74, .14) !important; border-color: rgba(240, 176, 74, .28) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5c26b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8a2 2 0 0 0 2-2h14a2 2 0 0 0 2 2v2a2 2 0 0 0 0 4v2a2 2 0 0 0-2 2H5a2 2 0 0 0-2-2v-2a2 2 0 0 0 0-4z'/%3E%3Cpath d='M13 6v2M13 11v2M13 16v2'/%3E%3C/svg%3E") !important; }
.home-view a.home-connection[href^="#/client/NABj"] .icon { /* Terminalserver-Desktop */
    background-color: rgba(148, 163, 196, .12) !important; border-color: rgba(148, 163, 196, .25) !important; }

/* Ordner (falls Verbindungsgruppen angelegt werden) */
.home-view .connection-group > .caption { color: var(--sc-text-2); font-weight: 600; }

/* Seitenumschalter: nur zeigen, wenn es mehrere Seiten gibt */
body:not(.client) .pager { color: var(--sc-text-2); margin-top: 14px; }
body:not(.client) .pager:has(.first-page.disabled):has(.last-page.disabled) { display: none; }
body:not(.client) .pager .icon { filter: invert(.8); }
body:not(.client) .pager .set-page.current { background: rgba(79, 143, 247, .2) !important; border-color: rgba(124, 176, 255, .35) !important; color: #fff; }

/* ---------- Schaltflaechen und Eingabefelder (ueberall) ---------- */
a.button, button, input[type=submit] {
    font-family: var(--sc-font) !important; text-shadow: none !important; border-radius: 10px !important; font-weight: 600 !important;
    background: linear-gradient(180deg, #3b82f6, #2563eb) !important; border: 1px solid #2563eb !important; color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .28) !important; transition: filter .15s;
}
a.button:hover, button:hover, input[type=submit]:hover { filter: brightness(1.1); }
a.button:active, button:active, input[type=submit]:active { filter: brightness(.95); }
button:disabled, input[type=submit]:disabled { opacity: .45; filter: none; }
a.button.danger, button.danger { background: linear-gradient(180deg, #ef4444, #dc2626) !important; border-color: #dc2626 !important; box-shadow: 0 4px 12px rgba(220, 38, 38, .28) !important; }
button.cancel, a.button.cancel { background: var(--sc-surface-3) !important; border-color: var(--sc-border-strong) !important; box-shadow: none !important; }
.login-ui .buttons input[type=submit] { border: 0 !important; }

body:not(.client) .view input[type=text], body:not(.client) .view input[type=password], body:not(.client) .view input[type=email],
body:not(.client) .view input[type=number], body:not(.client) .view input[type=date], body:not(.client) .view input[type=time],
body:not(.client) .view select, body:not(.client) .view textarea, body:not(.client) div.location,
.menu input[type=text], .menu input[type=number], .menu select, .menu textarea {
    background-color: var(--sc-input); color: var(--sc-text); border: 1px solid var(--sc-border-strong) !important;
    border-radius: 9px !important; padding: 8px 10px; font-family: var(--sc-font); box-sizing: border-box;
}
body:not(.client) select option, .menu select option { background: #0d1726; color: var(--sc-text); }
body:not(.client) .view input:focus, body:not(.client) .view select:focus, body:not(.client) .view textarea:focus,
.menu input:focus, .menu select:focus, .menu textarea:focus { border-color: var(--sc-accent-2) !important; box-shadow: 0 0 0 3px rgba(79, 143, 247, .25); outline: none; }

/* ---------- Einstellungen / Verwaltung ---------- */
.page-tabs .page-list ul, .section-tabs ul {
    background: var(--sc-surface) !important; border: 1px solid var(--sc-border) !important; border-radius: 12px;
    padding: 5px !important; display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px !important;
}
.page-tabs .page-list li a[href], .section-tabs li a { color: var(--sc-text-2) !important; border-radius: 8px; padding: 8px 14px !important; font-size: 14px; }
.page-tabs .page-list li a[href]:hover, .section-tabs li a:hover { background: var(--sc-hover) !important; color: var(--sc-text) !important; }
.page-tabs .page-list li a[href].current, .section-tabs li a.current { background: rgba(79, 143, 247, .2) !important; color: #fff !important; }
body:not(.client) .settings.section, body:not(.client) .view .section {
    background: var(--sc-surface); border: 1px solid var(--sc-border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--sc-shadow);
    backdrop-filter: var(--sc-blur); -webkit-backdrop-filter: var(--sc-blur); color: var(--sc-text-2); margin: 0 0 16px !important;
}
body:not(.client) .view .form .fields { border-left: 3px solid rgba(124, 176, 255, .25) !important; }
body:not(.client) .form-field .field-header, body:not(.client) th { color: var(--sc-text-2); }
body:not(.client) table.sorted { border-collapse: separate !important; border-spacing: 0; width: 100%; }
body:not(.client) table.sorted th { background: var(--sc-surface-2) !important; color: var(--sc-text-2) !important; font-weight: 600 !important; }
body:not(.client) table.sorted td, body:not(.client) table.sorted th { border: 0 !important; border-bottom: 1px solid var(--sc-border) !important; padding: 10px 14px !important; }
body:not(.client) table.sorted tr:hover td { background: var(--sc-hover); }
body:not(.client) .list-item.selected { background: rgba(79, 143, 247, .18) !important; }
body:not(.client) .list-item:not(.selected) .caption:hover { background: var(--sc-hover) !important; }
body:not(.client) .list-item .name { color: var(--sc-text) !important; }

/* ---------- Meldungen / Dialoge (Startseite UND Sitzung) ---------- */
.notification:not(.login-dialog) {
    background: rgba(13, 23, 40, .96) !important; color: var(--sc-text) !important; font-family: var(--sc-font);
    border: 1px solid var(--sc-border-strong) !important; border-radius: 16px !important; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55) !important;
}
.notification.error:not(.login-dialog) { border-color: rgba(255, 97, 102, .45) !important; }
.notification:not(.login-dialog) .title-bar { background: rgba(255, 255, 255, .04) !important; border-bottom: 1px solid var(--sc-border) !important; box-shadow: none !important;
    text-transform: none !important; font-size: 16px !important; font-weight: 650 !important; padding: 12px 18px !important; }
.notification.error .title-bar { color: #ffb3b5; }
.notification .progress { background: rgba(255, 255, 255, .08) !important; border: 0 !important; border-radius: 99px; overflow: hidden; }
.notification .progress .bar { background: linear-gradient(90deg, #3b82f6, #06b6d4) !important; box-shadow: none !important; }

/* ---------- Waehrend der Sitzung: Seitenmenue (Strg+Alt+Umschalt) ---------- */
.client .menu {
    background: rgba(9, 17, 31, .96) !important; color: var(--sc-text) !important; font-family: var(--sc-font);
    border-right: 1px solid var(--sc-border-strong); box-shadow: 8px 0 40px rgba(0, 0, 0, .55) !important;
}
.client .menu .header {
    background: rgba(255, 255, 255, .035) !important; border: 0 !important; border-bottom: 1px solid var(--sc-border) !important; box-shadow: none !important;
}
.client .menu .header h2 { color: var(--sc-text) !important; text-transform: none !important; font-weight: 650 !important; }
.client .menu .menu-section h3 { color: var(--sc-accent-2) !important; text-transform: none !important; font-size: 13px !important; font-weight: 650 !important; border-bottom: 1px solid var(--sc-border) !important; background: none !important; }
.client .menu .menu-section .content, .client .menu .content p, .client .menu label, .client .menu .choice { color: var(--sc-text-2) !important; }
.client .menu .menu-dropdown { background: rgba(255, 255, 255, .05) !important; border: 1px solid var(--sc-border) !important; border-radius: 10px; color: var(--sc-text) !important; }
.client .menu .menu-dropdown .menu-contents li a { color: var(--sc-text) !important; }
.client .menu textarea { background: rgba(0, 0, 0, .35) !important; color: var(--sc-text) !important; border-radius: 10px !important; border: 1px solid var(--sc-border-strong) !important; }
.client #guac-menu #devices .device, .client #guac-menu #share-links {
    background-color: rgba(255, 255, 255, .04) !important; border: 1px solid var(--sc-border) !important; border-radius: 10px; color: var(--sc-text) !important;
}
.client #guac-menu #devices .device:hover { border-color: rgba(124, 176, 255, .45) !important; }
.client .menu .header .icon, .client .menu .zoom-ctrl .icon, .client .menu .back { filter: invert(.85); }
.client .menu .zoom-ctrl { color: var(--sc-text) !important; background: rgba(255, 255, 255, .05) !important; border: 1px solid var(--sc-border) !important; border-radius: 9px; }
.client .menu .zoom-ctrl input { color: var(--sc-text) !important; background: transparent !important; }
.client .menu input[type=range] { accent-color: var(--sc-accent); }

/* Dateibrowser (Laufwerk im Sitzungsmenue) */
.file-browser .list-item .caption { color: var(--sc-text); border-radius: 6px; }
.file-browser .list-item.focused .caption { background: rgba(79, 143, 247, .22) !important; border-color: transparent !important; }
.file-browser .icon { filter: invert(.85); }
#filesystem-menu .header.breadcrumbs { background: rgba(255, 255, 255, .03) !important; }
#filesystem-menu .header.breadcrumbs .breadcrumb:hover { background-color: var(--sc-hover) !important; }
#file-transfer-dialog .transfer-manager { background: rgba(13, 23, 40, .96) !important; color: var(--sc-text); border: 1px solid var(--sc-border-strong) !important; border-radius: 14px; overflow: hidden; }
#file-transfer-dialog .transfer-manager .header { background: rgba(255, 255, 255, .04) !important; border: 0 !important; box-shadow: none !important; }

/* Leiste mit weiteren offenen Verbindungen (rechts) */
.client-panel { background: rgba(9, 17, 31, .92) !important; border: 1px solid var(--sc-border-strong) !important; border-right: 0 !important; border-radius: 12px 0 0 12px; }
.client-panel .client-panel-connection .name { color: var(--sc-text) !important; }

/* Verbindungs-Hinweis unten rechts (instabile Verbindung) */
#connection-warning { background: rgba(13, 23, 40, .96) !important; color: var(--sc-text); border-left-color: #f0b04a !important; border-radius: 0 10px 10px 0; }

/* Schmale Bildschirme */
@media (max-width: 640px) {
    .home-view .connection-list-ui, body:not(.client) #content > .view:not(.home-view) { padding: 14px 12px 30px; }
    .home-view .connection-list-ui::before { padding-left: 128px; background-size: auto 32px; font-size: 18px; height: 42px; }
    .home-view .all-connections .group-list-page { grid-template-columns: 1fr; }
}

/* Einstellungen: Auswahl-Bilder (Maus/Eingabe) auf heller Kachel, Texte lesbar */
body:not(.client) .settings .choice .figure img { background: #e9eff8; border-radius: 10px; padding: 6px; }
body:not(.client) .settings .choice label, body:not(.client) .settings .choice .caption { color: var(--sc-text-2) !important; }
body:not(.client) .settings input[type=radio], body:not(.client) .settings input[type=checkbox] { accent-color: var(--sc-accent); }
body:not(.client) .settings .action-buttons { text-align: right; margin-top: 10px; }
body:not(.client) .settings table.fields th { font-weight: 400; color: var(--sc-text-2); padding-right: 14px; }

/* ---------- Startseite-Knopf ---------- */
.user-menu { display: flex; align-items: center; gap: 8px; }
a.scn-home {
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; box-sizing: border-box; white-space: nowrap;
    border-radius: 10px; border: 1px solid rgba(124, 176, 255, .35); background: rgba(79, 143, 247, .16);
    color: var(--sc-text) !important; text-decoration: none !important; font: 600 14px var(--sc-font); transition: background .15s, border-color .15s;
}
a.scn-home:hover { background: rgba(79, 143, 247, .3); border-color: rgba(124, 176, 255, .6); }
a.scn-home svg { width: 17px; height: 17px; color: var(--sc-accent-2); flex: none; }
body.home a.scn-home { display: none; } /* auf der Startseite selbst nicht noetig */
.client .menu .user-menu a.scn-home { height: 36px; }

/* Schwebende Leiste waehrend der Remote-Sitzung: oben mittig, klappt bei Mauskontakt aus */
.scn-float {
    position: fixed; top: 0; left: 50%; z-index: 30; transform: translate(-50%, calc(-100% + 8px));
    display: flex; gap: 6px; padding: 8px 8px 8px; box-sizing: border-box;
    border-radius: 0 0 14px 14px; border: 1px solid rgba(124, 176, 255, .35); border-top: 0;
    background: rgba(9, 17, 31, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45); opacity: .85; transition: transform .18s ease, opacity .18s ease;
}
.scn-float::after { /* Griff, der im eingeklappten Zustand sichtbar bleibt */
    content: ""; position: absolute; left: 50%; bottom: 3px; width: 34px; height: 3px; margin-left: -17px;
    border-radius: 3px; background: rgba(124, 176, 255, .55);
}
.scn-float:hover, .scn-float:focus-within { transform: translate(-50%, 0); opacity: 1; }
.scn-float:hover::after, .scn-float:focus-within::after { opacity: 0; }
a.scn-float-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 9px;
    color: #eef3fb !important; text-decoration: none !important; font: 600 13px "Segoe UI", system-ui, sans-serif;
    background: rgba(79, 143, 247, .16); border: 1px solid rgba(124, 176, 255, .3); cursor: pointer; white-space: nowrap;
}
a.scn-float-btn:hover { background: rgba(79, 143, 247, .32); }
a.scn-float-btn svg { width: 16px; height: 16px; color: #7cb0ff; flex: none; }
a.scn-float-btn.scn-float-logout { background: rgba(255, 97, 102, .14); border-color: rgba(255, 97, 102, .4); }
a.scn-float-btn.scn-float-logout:hover { background: rgba(255, 97, 102, .3); }
a.scn-float-btn.scn-float-logout svg { color: #ff8a8e; }
a.scn-float-btn.busy { opacity: .5; pointer-events: none; }
@media (hover: none) { .scn-float { transform: translate(-50%, calc(-100% + 16px)); } }

/* Direktes Abmelden in der Weboberflaeche */
a.scn-signout {
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; box-sizing: border-box; white-space: nowrap;
    border-radius: 10px; border: 1px solid rgba(255, 97, 102, .35); background: rgba(255, 97, 102, .1); cursor: pointer;
    color: #ffd0d2 !important; text-decoration: none !important; font: 600 14px var(--sc-font); transition: background .15s;
}
a.scn-signout:hover { background: rgba(255, 97, 102, .24); }
a.scn-signout svg { width: 17px; height: 17px; color: #ff8a8e; flex: none; }
.client .menu .user-menu a.scn-signout { height: 36px; }

/* Hilfsverbindung "Logout" nirgends anzeigen */
.scn-hidden { display: none !important; }

/* Statusmeldung in der Sitzung (Verbindungsaufbau, Fehler) mittig und kompakt */
.client .client-status-modal .notification { width: min(560px, 92vw) !important; max-width: none !important; margin: 0 auto !important; left: auto !important; }

/* Kachel-Aufbau: Symbol | Name (+ Status darunter) | Pfeil - laeuft auch bei aktiver Verbindung nicht ueber */
.home-view .all-connections a.home-connection {
    display: grid !important; grid-template-columns: 42px minmax(0, 1fr) 18px; grid-template-rows: auto auto;
    column-gap: 14px; row-gap: 4px; align-items: center; align-content: center;
}
.home-view .all-connections a.home-connection .icon { grid-column: 1; grid-row: 1 / span 2; }
.home-view .all-connections a.home-connection .name { grid-column: 2; grid-row: 1 / span 2; line-height: 1.25; overflow-wrap: anywhere; }
.home-view .all-connections a.home-connection::after { grid-column: 3; grid-row: 1 / span 2; margin-left: 0; }
.home-view .all-connections a.home-connection.active .name { grid-row: 1; align-self: end; }
.home-view .all-connections a.home-connection .activeUserCount {
    grid-column: 2; grid-row: 2; justify-self: start; align-self: start;
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px;
    font-size: 11.5px !important; font-style: normal !important; font-weight: 600; float: none !important; white-space: nowrap;
    color: #8ee3b8 !important; background: rgba(76, 195, 138, .14); border: 1px solid rgba(76, 195, 138, .3);
}
.home-view .all-connections a.home-connection .activeUserCount::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: #4cc38a; box-shadow: 0 0 6px #4cc38a;
}
.home-view .all-connections a.home-connection.active { border-color: rgba(76, 195, 138, .35); }
.home-view .all-connections a.home-connection .jdbc-share-tag { display: none; }

/* Letzte Verbindungen: Vorschaubilder einheitlich gross */
body:not(.client) .recent-connections .connection { width: 260px; }
body:not(.client) .recent-connections .connection .thumbnail { display: block; }
body:not(.client) .recent-connections .connection .thumbnail > * { width: 100%; }
