/*
 * N8 Kit 1.6 – shared by the N8schicht web interfaces (N8 Crosslink, HBlink4-FreeRadioID, adn-frn-server, N8-HotSpot).
 * Same file in every repository. Uses the N8 Theme 2 variables (--accent, --accent-rgb, --glass-*, --text, --text-dim).
 */

/* ---------- lang/* ---------- 1.6: dropdowns in the header (language, user) ---------- */
.n8-dd { position: relative; display: inline-flex; flex: none; }
.n8-dd-car { font-size: 9px; opacity: .7; transition: transform .18s ease; margin-left: 1px; }
.n8-dd.open .n8-dd-car { transform: rotate(180deg); }
.n8-dd-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 400; min-width: 220px; max-height: min(70vh, 560px); overflow: auto;
  display: flex; flex-direction: column; gap: 1px; padding: 6px; border-radius: 16px; box-sizing: border-box;
  background: rgba(18, 24, 44, .96); border: 1px solid var(--glass-border, rgba(255, 255, 255, .14));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right; transition: opacity .15s ease, transform .15s ease, visibility 0s .15s; }
.n8-dd-pop.left { right: auto; left: 0; transform-origin: top left; }
.n8-dd.open > .n8-dd-pop { opacity: 1; visibility: visible; transform: none; transition: opacity .15s ease, transform .15s ease; }
.n8-dd-pop > button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text, #f5f7fb); cursor: pointer; white-space: nowrap; }
.n8-dd-pop > button:hover, .n8-dd-pop > button:focus-visible { background: rgba(var(--accent-rgb, 90, 200, 250), .16); outline: none; }
.n8-dd-pop > button:disabled { opacity: .45; cursor: default; }
.n8-dd-pop > button.on { background: rgba(var(--accent-rgb, 90, 200, 250), .22); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb, 90, 200, 250), .45); }
.n8-dd-pop > button.on::after { content: "✓"; margin-left: auto; color: var(--accent, #5ac8fa); font-weight: 800; }
.n8-dd-pop hr { border: 0; border-top: 1px solid var(--glass-border, rgba(255, 255, 255, .12)); margin: 5px 4px; width: auto; }
html[data-theme-mode=light] .n8-dd-pop { background: rgba(255, 255, 255, .97); box-shadow: 0 18px 50px rgba(20, 30, 60, .22); }

/* language: 🌐 DE ▾ */
.n8-lang-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; height: 31px; padding: 0 10px 0 9px;
  border-radius: 999px; font-family: inherit; font-size: 12px; font-weight: 750; letter-spacing: .04em; color: var(--text, #f5f7fb);
  background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-border, rgba(255, 255, 255, .14)); transition: background .15s, border-color .15s; }
.n8-lang-btn:hover, .n8-lang.open .n8-lang-btn { background: rgba(var(--accent-rgb, 90, 200, 250), .16); border-color: rgba(var(--accent-rgb, 90, 200, 250), .45); }
.n8-lang-btn:focus-visible { outline: 2px solid var(--accent, #5ac8fa); outline-offset: 2px; }
.n8-lang-ic { font-size: 13px; line-height: 1; }
.n8-lang-pop { min-width: 210px; }
.n8-lang-code { display: inline-grid; place-items: center; width: 28px; height: 20px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .05em;
  background: rgba(255, 255, 255, .08); color: var(--text-dim, rgba(235, 240, 250, .75)); flex: none; }
.n8-lang-pop > button.on .n8-lang-code { background: linear-gradient(135deg, var(--accent, #5ac8fa), var(--accent2, var(--accent, #0a84ff))); color: #fff; }
html[data-theme-mode=light] .n8-lang-btn { background: rgba(0, 0, 0, .05); }
html[data-theme-mode=light] .n8-lang-code { background: rgba(0, 0, 0, .06); }

/* user: avatar + name ▾ */
.n8-user-btn { display: inline-flex !important; align-items: center !important; gap: 7px !important; padding-left: 4px !important; }
.n8-user-btn .n8-av { width: 23px; height: 23px; font-size: 10px; background: linear-gradient(135deg, var(--accent, #5ac8fa), var(--accent2, var(--accent, #0a84ff))); color: #fff; }
.n8-user-btn img { width: 23px; height: 23px; border-radius: 50%; object-fit: cover; }
.n8-user-pop { min-width: 250px; }
.n8-user-card { display: flex; align-items: center; gap: 11px; padding: 8px 8px 10px; }
.n8-user-card > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.n8-user-card b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.n8-user-card small { color: var(--text-dim, #aab); font-size: 11.5px; }
.n8-av.big, .n8-user-card img { width: 40px !important; height: 40px !important; font-size: 15px !important; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #5ac8fa), var(--accent2, var(--accent, #0a84ff))); color: #fff; }
.n8-mi-ic { width: 20px; text-align: center; flex: none; }
.n8-dd-pop > button.n8-mi-out { color: #ff9f97; }
.n8-dd-pop > button.n8-mi-out:hover, .n8-dd-pop > button.n8-mi-out:focus-visible { background: rgba(255, 69, 58, .16); }

/* ---------- 1.6: login window – the same in every N8 system ---------- */
.n8-login-ov { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; box-sizing: border-box; overflow: auto;
  background: rgba(5, 8, 18, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: n8-fade .18s ease; }
.n8-login { position: relative; width: min(400px, 100%); box-sizing: border-box; padding: 30px 28px 18px; border-radius: 26px; display: flex; flex-direction: column; gap: 12px;
  color: var(--text, #f5f7fb); background: linear-gradient(160deg, rgba(34, 44, 78, .92), rgba(16, 20, 38, .94));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, .14)); box-shadow: 0 30px 90px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
  animation: n8-pop .22s cubic-bezier(.2, .9, .3, 1.2); }
.n8-login::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 26px 26px 0 0;
  background: linear-gradient(90deg, var(--accent, #5ac8fa), var(--accent2, #bf5af2)); opacity: .85; }
.n8-login-x { all: unset; position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  font-size: 13px; color: var(--text-dim, #aab); }
.n8-login-x:hover { background: rgba(255, 255, 255, .08); color: var(--text, #fff); }
.n8-login-logo { width: 72px; height: 72px; object-fit: contain; align-self: center; border-radius: 18px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .4)); }
.n8-login h2 { margin: 2px 0 0; text-align: center; font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.n8-login-sub { margin: -6px 0 6px; text-align: center; font-size: 13px; color: var(--text-dim, rgba(235, 240, 250, .7)); line-height: 1.45; }
.n8-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-dim, rgba(235, 240, 250, .75)); }
.n8-inp { position: relative; display: flex; align-items: center; }
.n8-inp-ic { position: absolute; left: 12px; font-size: 14px; opacity: .75; pointer-events: none; }
.n8-inp input { width: 100%; box-sizing: border-box; height: 44px; padding: 0 44px 0 38px; border-radius: 13px; font: inherit; font-size: 15px; font-weight: 500;
  color: var(--text, #f5f7fb); background: rgba(0, 0, 0, .28); border: 1px solid var(--glass-border, rgba(255, 255, 255, .14)); outline: none; transition: border-color .15s, box-shadow .15s; }
.n8-inp input:focus { border-color: var(--accent, #5ac8fa); box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 90, 200, 250), .22); }
.n8-eye { all: unset; position: absolute; right: 6px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; font-size: 15px; opacity: .55; }
.n8-eye:hover, .n8-eye.on { opacity: 1; background: rgba(255, 255, 255, .07); }
.n8-caps { font-size: 12px; font-weight: 650; color: #ffd60a; margin-top: -4px; }
.n8-login-rem { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim, rgba(235, 240, 250, .8)); cursor: pointer; user-select: none; }
.n8-login-rem input { position: absolute; opacity: 0; pointer-events: none; }
.n8-sw-ui { width: 36px; height: 21px; border-radius: 999px; flex: none; position: relative; background: rgba(255, 255, 255, .14); transition: background .18s; }
.n8-sw-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .18s; }
.n8-login-rem input:checked + .n8-sw-ui { background: var(--accent, #5ac8fa); }
.n8-login-rem input:checked + .n8-sw-ui::after { transform: translateX(15px); }
.n8-login-rem input:focus-visible + .n8-sw-ui { outline: 2px solid var(--accent, #5ac8fa); outline-offset: 2px; }
.n8-login-err { padding: 9px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; line-height: 1.4; color: #ffb4ad; background: rgba(255, 69, 58, .14); border: 1px solid rgba(255, 69, 58, .35); }
.n8-login-go { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 14px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 750; color: #fff; margin-top: 4px;
  background: linear-gradient(135deg, var(--accent, #5ac8fa), var(--accent2, var(--accent, #0a84ff))); box-shadow: 0 8px 24px rgba(var(--accent-rgb, 90, 200, 250), .35);
  transition: transform .1s, filter .15s; }
.n8-login-go:hover { filter: brightness(1.08); }
.n8-login-go:active { transform: scale(.985); }
.n8-login-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.n8-login-go:disabled { cursor: progress; filter: saturate(.6); }
.n8-spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: n8-rot .7s linear infinite; }
.n8-login.busy .n8-spin { display: inline-block; }
.n8-login-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--glass-border, rgba(255, 255, 255, .1)); }
.n8-login-lock { font-size: 11.5px; color: var(--text-dim, #aab); }
.n8-login-foot .n8-dd-pop { top: auto; bottom: calc(100% + 8px); transform-origin: bottom right; }
.n8-login.shake { animation: n8-shake .38s ease; }
html[data-theme-mode=light] .n8-login { background: linear-gradient(160deg, rgba(255, 255, 255, .98), rgba(238, 243, 252, .98)); box-shadow: 0 30px 90px rgba(20, 30, 60, .3); }
html[data-theme-mode=light] .n8-inp input { background: #fff; }
html[data-theme-mode=light] .n8-sw-ui { background: rgba(0, 0, 0, .15); }
@keyframes n8-fade { from { opacity: 0; } }
@keyframes n8-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes n8-rot { to { transform: rotate(360deg); } }
@keyframes n8-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@media (prefers-reduced-motion: reduce) { .n8-login, .n8-login-ov, .n8-login.shake, .n8-dd-pop { animation: none !important; transition: none !important; } }
@media (max-width: 600px) {
  .n8-lang-btn { height: 28px; padding: 0 8px; font-size: 11px; gap: 3px; }
  .n8-lang-ic { display: none; }
  .n8-login { padding: 24px 18px 14px; border-radius: 22px; }
}
tons, badges, key/value list used by the kit ---------- */
.n8-btn { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-family: inherit; font-weight: 650; font-size: 13px; line-height: 1.2;
          color: var(--text, #f5f7fb); background: rgba(255, 255, 255, .08); border: 1px solid var(--glass-border, rgba(255, 255, 255, .16)); }
.n8-btn:hover:not(:disabled) { background: rgba(var(--accent-rgb, 90, 200, 250), .18); border-color: rgba(var(--accent-rgb, 90, 200, 250), .5); }
.n8-btn.primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent, #5ac8fa), var(--accent2, var(--accent, #0a84ff))); }
.n8-btn.ghost { background: none; }
.n8-btn:disabled { opacity: .45; cursor: default; }
html[data-theme-mode=light] .n8-btn:not(.primary) { background: rgba(0, 0, 0, .05); }
.n8-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(142, 142, 147, .22); color: var(--text-dim, #aab); }
.n8-badge.ok { background: rgba(48, 209, 88, .18); color: #30d158; }
.n8-badge.bad { background: rgba(255, 69, 58, .18); color: #ff6b61; }
.n8-badge.warn { background: rgba(255, 214, 10, .18); color: #ffd60a; }
.n8-kv { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 7px 18px; font-size: 13.5px; align-items: baseline; }
.n8-kv .k { color: var(--text-dim, rgba(235, 240, 250, .62)); }
.n8-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.n8-help { margin-top: 10px; font-size: 12.5px; color: var(--text-dim, rgba(235, 240, 250, .62)); line-height: 1.5; }
.n8-sub { margin: 16px 0 6px; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim, rgba(235, 240, 250, .62)); }
.n8-log { margin: 0; max-height: 320px; overflow: auto; padding: 10px 12px; border-radius: 12px; font: 11.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
          white-space: pre-wrap; color: var(--text-dim, rgba(235, 240, 250, .7)); background: rgba(0, 0, 0, .25); border: 1px solid var(--glass-border, rgba(255, 255, 255, .1)); }
html[data-theme-mode=light] .n8-log { background: rgba(0, 0, 0, .04); }

/* ---------- update banner (directly under the status strip, same in every app) ---------- */
.n8-upd { margin: 0 0 14px; padding: 9px 14px; border-radius: 14px; font-size: 13.5px;
          background: rgba(var(--accent-rgb, 90, 200, 250), .12); border: 1px solid rgba(var(--accent-rgb, 90, 200, 250), .38); }
.n8-upd[hidden] { display: none !important; }
.n8-upd-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.n8-upd-ico { font-size: 18px; }
.n8-upd-txt { flex: 1 1 240px; }
.n8-upd-txt b { color: var(--accent, #5ac8fa); }
.n8-upd-act { display: flex; gap: 6px; flex-wrap: wrap; }
.n8-upd-act .n8-btn { padding: 4px 12px; font-size: 12.5px; }
.n8-upd-notes { display: none; margin-top: 8px; font-size: 12.5px; }
.n8-upd.open .n8-upd-notes { display: block; }
.n8-upd ul, .n8-upd-panel ul { margin: 4px 0 4px 18px; padding: 0; } .n8-upd li, .n8-upd-panel li { margin: 2px 0; }

/* ---------- update progress ---------- */
.n8-upd-ov { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px;
             background: rgba(5, 8, 18, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.n8-upd-box { width: min(460px, 100%); padding: 20px 22px; border-radius: 20px; color: var(--text, #f5f7fb);
              background: var(--card-solid, rgba(18, 24, 44, .96)); border: 1px solid var(--glass-border, rgba(255, 255, 255, .14)); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
html[data-theme-mode=light] .n8-upd-box { background: rgba(255, 255, 255, .97); }
.n8-upd-box h3 { margin: 0 0 12px; font-size: 17px; }
.n8-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.n8-steps li { display: flex; align-items: center; gap: 10px; color: var(--text-dim, rgba(235, 240, 250, .6)); }
.n8-steps li::before { content: ''; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(142, 142, 147, .6); box-sizing: border-box; }
.n8-steps li.run { color: var(--text, #f5f7fb); }
.n8-steps li.run::before { border-color: var(--accent, #5ac8fa); border-top-color: transparent; animation: n8-spin .9s linear infinite; }
.n8-steps li.done { color: var(--text, #f5f7fb); }
.n8-steps li.done::before { content: '✓'; border: 0; background: #30d158; color: #fff; font-family: inherit; font-weight: 800; font-size: 10px; line-height: 16px; text-align: center; }
.n8-steps li.bad::before { content: '✕'; border: 0; background: #ff453a; color: #fff; font-family: inherit; font-weight: 800; font-size: 10px; line-height: 16px; text-align: center; }
.n8-upd-msg { margin-top: 14px; font-size: 13.5px; }
.n8-upd-msg.ok { color: #30d158; } .n8-upd-msg.bad { color: #ff6b61; }
@keyframes n8-spin { to { transform: rotate(360deg); } }
.n8-upd-text { max-height: 260px; overflow: auto; margin-bottom: 6px; font-size: 13px; }
.n8-pw { width: 100%; box-sizing: border-box; margin-top: 12px; padding: 9px 12px; border-radius: 12px; font: inherit; color: var(--text, #f5f7fb);
         background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-border, rgba(255, 255, 255, .16)); }
html[data-theme-mode=light] .n8-pw { background: #fff; color: #111; }
.n8-steps[hidden], .n8-upd-ask[hidden] { display: none; }

/* ---------- 1.1: admin menu as a tree (same in every N8 system) ---------- */
.n8-admin { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.n8-admin > .n8-admin-main { min-width: 0; }
.n8-tree { position: sticky; top: 96px; padding: 10px 8px; border-radius: 18px; background: var(--glass-bg, rgba(255, 255, 255, .055));
           border: 1px solid var(--glass-border, rgba(255, 255, 255, .12)); box-shadow: inset 0 1px 0 var(--glass-highlight, rgba(255, 255, 255, .18));
           -webkit-backdrop-filter: var(--glass-blur, blur(20px)); backdrop-filter: var(--glass-blur, blur(20px)); max-height: calc(100vh - 120px); overflow: auto; }
.n8-tree-toggle { display: none; }
.n8-tree-g + .n8-tree-g { margin-top: 4px; }
.n8-tree-gh { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 10px 5px;
              font-family: inherit; font-weight: 800; font-size: 10.5px; line-height: 1.2; letter-spacing: .08em; white-space: nowrap; text-transform: uppercase; color: var(--text-dim, rgba(235, 240, 250, .62)); }
.n8-tree-gh:hover { color: var(--text, #f5f7fb); }
.n8-tree-car { display: inline-block; width: 10px; transition: transform .15s; font-size: 10px; }
.n8-tree-g.open .n8-tree-car { transform: rotate(90deg); }
.n8-tree-items { display: none; flex-direction: column; gap: 1px; padding: 2px 0 4px 8px; margin-left: 9px; border-left: 1px solid var(--glass-border, rgba(255, 255, 255, .12)); }
.n8-tree-g.open .n8-tree-items { display: flex; }
.n8-tree-i { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%;
             padding: 7px 10px; border-radius: 10px; font-family: inherit; font-weight: 600; font-size: 13.5px; line-height: 1.25; color: var(--text, #f5f7fb); }
.n8-tree-i:hover { background: rgba(255, 255, 255, .06); }
.n8-tree-i.on { background: rgba(var(--accent-rgb, 90, 200, 250), .16); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb, 90, 200, 250), .45); }
.n8-tree-i:focus-visible, .n8-tree-gh:focus-visible { outline: 2px solid var(--accent, #5ac8fa); outline-offset: -2px; }
html[data-theme-mode=light] .n8-tree-i:hover { background: rgba(0, 0, 0, .05); }
@media (max-width: 860px) {
    .n8-admin { grid-template-columns: 1fr; }
    .n8-tree { position: relative; top: 0; max-height: none; padding: 6px; }
    .n8-tree-toggle { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1.2; color: var(--text, #f5f7fb); }
    .n8-tree .n8-tree-body { display: none; padding-top: 4px; }
    .n8-tree.open .n8-tree-body { display: block; }
}

/* ---------- 1.1: System views (update, services, permissions & sudo, keep-alive) ---------- */
.n8-sys { display: flex; flex-direction: column; gap: 14px; }
.n8-sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: stretch; }
.n8-card { padding: 14px 16px; border-radius: 18px; background: var(--glass-bg, rgba(255, 255, 255, .055)); border: 1px solid var(--glass-border, rgba(255, 255, 255, .12));
           box-shadow: inset 0 1px 0 var(--glass-highlight, rgba(255, 255, 255, .18)); -webkit-backdrop-filter: var(--glass-blur, blur(20px)); backdrop-filter: var(--glass-blur, blur(20px)); }
.n8-card { display: flex; flex-direction: column; min-width: 0; }
.n8-card > .n8-actions:last-child, .n8-card > :last-child > .n8-actions:last-child { margin-top: auto; padding-top: 12px; }
.n8-card > .n8-upd-panel, .n8-card > .n8-sys-log { flex: 1; display: flex; flex-direction: column; }
.n8-sys-log .n8-log { flex: 1; }
.n8-card > h3 { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.n8-card > h3 .n8-badge { letter-spacing: .04em; }
.n8-dim { color: var(--text-dim, rgba(235, 240, 250, .62)); font-size: 12.5px; }
.n8-btn.sm { padding: 4px 10px; font-size: 12.5px; }
.n8-btn.danger { color: #ff8a80; border-color: rgba(255, 69, 58, .45); }
.n8-btn.danger:hover:not(:disabled) { background: rgba(255, 69, 58, .18); border-color: rgba(255, 69, 58, .7); }
.n8-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; }
.n8-log { margin: 10px 0 0; max-height: 260px; overflow: auto; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); font: 11.5px/1.45 var(--mono, ui-monospace, Menlo, monospace);
          white-space: pre-wrap; color: var(--text-dim, rgba(235, 240, 250, .75)); }
html[data-theme-mode=light] .n8-log { background: rgba(0, 0, 0, .05); }
.n8-svc-list { display: flex; flex-direction: column; }
.n8-svc { display: grid; grid-template-columns: minmax(0, 1fr) auto 150px 96px; gap: 10px; align-items: center; padding: 9px 2px; border-top: 1px solid var(--glass-border, rgba(255, 255, 255, .1)); }
.n8-svc:first-child { border-top: 0; }
.n8-svc-n { display: flex; flex-direction: column; min-width: 0; }
.n8-svc-n code { font-size: 11.5px; color: var(--text-dim, #aab); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n8-svc-b { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 600px) { .n8-svc { grid-template-columns: minmax(0, 1fr) auto; } }
.n8-sw { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.n8-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.n8-sw i { position: relative; width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .18); transition: .2s; flex: none; }
.n8-sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.n8-sw input:checked + i { background: #30d158; }
.n8-sw input:checked + i::after { left: 19px; }
.n8-sw input:focus-visible + i { outline: 2px solid var(--accent, #5ac8fa); outline-offset: 2px; }
.n8-perm { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.n8-perm-r { display: grid; grid-template-columns: 24px minmax(150px, 230px) minmax(0, 1fr); gap: 8px; align-items: baseline; }
.n8-perm-r span { color: var(--text-dim, rgba(235, 240, 250, .7)); }
@media (max-width: 600px) { .n8-perm-r { grid-template-columns: 24px minmax(0, 1fr); } .n8-perm-r span { grid-column: 2; } }
.n8-perm-ok { margin-top: 10px; }
.n8-perm-ok summary { cursor: pointer; font-size: 13px; color: var(--text-dim, #aab); padding: 4px 0; }
.n8-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin-top: 16px; align-items: start; }
@media (max-width: 700px) { .n8-form { grid-template-columns: 1fr; } }
.n8-form > label:not(.n8-sw) { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-dim, #aab); }
.n8-form input:not([type=checkbox]) { box-sizing: border-box; width: 100%; padding: 8px 10px; border-radius: 10px; font: inherit; font-size: 13.5px; color: var(--text, #f5f7fb);
          background: rgba(0, 0, 0, .25); border: 1px solid var(--glass-border, rgba(255, 255, 255, .14)); }
.n8-form .n8-actions { grid-column: 1 / -1; }

/* ---------- 1.1: symmetric admin: tiles in a row get the same height, buttons sit at the bottom ---------- */
.n8-admin-main .grid, .n8-admin-main .tiles, .n8-admin-main .station-grid, .hb-admin .station-grid { align-items: stretch !important; }
.n8-admin-main .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .n8-admin-main .tiles { grid-template-columns: 1fr; } }
.n8-admin-main .tiles > .tile:last-child:nth-child(odd), .n8-admin-main .g2 > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.n8-admin-main .grid > .tile, .n8-admin-main .tiles > .tile, .hb-admin .station-grid > .tile { display: flex; flex-direction: column; min-width: 0; }
.n8-admin-main .grid > .tile > .actions:last-child, .hb-admin .station-grid > .tile > .set-actions:last-child { margin-top: auto; padding-top: 12px; }
.n8-sys-extra > .grid { grid-template-columns: 1fr !important; }
.n8-card > p.n8-help { margin: 0 0 10px; }
/* 1.1: children of a menu item (the former in-page menus) */
.n8-tree-i.has-kids::after { content: "▸"; font-size: 10px; color: var(--text-dim, #aab); transition: transform .15s; }
.n8-tree-i.has-kids.kids-open::after { transform: rotate(90deg); }
.n8-tree-kids { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 4px 12px; padding-left: 8px; border-left: 1px solid var(--glass-border, rgba(255, 255, 255, .12)); }
.n8-tree-i.kid { padding: 5px 9px; font-size: 12.5px; font-weight: 600; color: var(--text-dim, rgba(235, 240, 250, .7)); }
.n8-tree-i.kid:hover, .n8-tree-i.kid.on { color: var(--text, #f5f7fb); }
.n8-admin-main [hidden], .hb-admin [hidden] { display: none !important; }
.n8-admin-main .tiles.one, .n8-admin-main .grid.one { grid-template-columns: 1fr !important; }
.n8-tree-i .n8-badge.dot { background: none; padding: 0 2px; font-size: 10px; margin-left: auto; }

/* ---------- 1.2: N8 Frame – the whole browser width and the same menu bar in every N8 system (model: ADN FRN Server) ---------- */
body > :is(.container, .wrap) { max-width: none !important; padding-left: clamp(10px, 1.3vw, 24px) !important; padding-right: clamp(10px, 1.3vw, 24px) !important; box-sizing: border-box; }
body .site-footer { max-width: none !important; }
/* 1.3: derselbe Seitenrand wie N8 Crosslink in allen N8-Systemen (12 px links und rechts, dann 10–24 px im Inhalt) */
@media (min-width: 901px) { body { padding-left: 12px !important; padding-right: 12px !important; } }
.modal-content.admin { width: calc(100vw - 32px) !important; max-width: none !important; }
@media (min-width: 901px) {
    :is(.n8-topbar, .topbar) > header { display: flex !important; align-items: center !important; gap: 14px !important; padding: 8px 14px !important;
        height: 64px !important; min-height: 64px !important; box-sizing: border-box; border-radius: 20px !important;
        background: var(--glass-bg, rgba(20, 26, 45, .55)) !important; border: 1px solid var(--glass-border, rgba(255, 255, 255, .12)) !important;
        box-shadow: inset 0 1px 0 var(--glass-highlight, rgba(255, 255, 255, .18)), 0 10px 40px rgba(0, 0, 0, .35) !important; }
    :is(.n8-topbar, .topbar) > header > :first-child { display: flex !important; align-items: center !important; gap: 10px !important; min-width: 0; flex: 0 1 auto !important; text-decoration: none; color: inherit; }
    :is(.n8-topbar, .topbar) > header > :first-child img { width: 46px !important; height: 46px !important; border-radius: 12px !important; object-fit: contain; flex: none; }
    :is(.n8-topbar, .topbar) > header h1 { margin: 0 !important; font-size: 19px !important; font-weight: 700 !important; letter-spacing: -.02em !important; line-height: 1.2 !important; white-space: nowrap; }
    :is(.n8-topbar, .topbar) > header > :first-child h1 + * { margin: 1px 0 0 !important; font-size: 12px !important; font-weight: 400 !important; line-height: 1.25 !important;
        color: var(--text-dim, rgba(245, 247, 251, .62)) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 36vw; }
    :is(.n8-topbar, .topbar) > header > nav { margin: 0 auto !important; display: flex !important; gap: 3px !important; padding: 3px !important; border-radius: 999px !important;
        background: rgba(255, 255, 255, .04) !important; border: 1px solid var(--glass-border, rgba(255, 255, 255, .12)) !important; flex: 0 1 auto !important; min-width: 0; overflow-x: auto; scrollbar-width: none; }
    :is(.n8-topbar, .topbar) > header > nav > :is(button, a) { display: flex; align-items: center !important; gap: 6px !important; padding: 6px 12px !important; margin: 0 !important;
        font-size: 12.5px !important; font-weight: 650 !important; line-height: 1.2 !important; border-radius: 999px !important; border: 0 !important; white-space: nowrap;
        background: transparent !important; box-shadow: none !important; color: var(--text-dim, rgba(245, 247, 251, .7)) !important; text-decoration: none !important; min-height: 0 !important; height: auto !important; }
    :is(.n8-topbar, .topbar) > header > nav > :is(.hidden, [hidden]) { display: none !important; }
    :is(.n8-topbar, .topbar) > header > nav > :is(button, a):hover { color: var(--text, #f5f7fb) !important; background: rgba(255, 255, 255, .06) !important; }
    :is(.n8-topbar, .topbar) > header > nav > :is(.active, .on, [aria-current=page], [aria-selected=true]) { color: var(--text, #f5f7fb) !important;
        background: rgba(var(--accent-rgb, 90, 200, 250), .18) !important; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb, 90, 200, 250), .38) !important; }
    :is(.n8-topbar, .topbar) > header > :last-child { display: flex !important; align-items: center !important; gap: 6px !important; flex: none !important; margin-left: 0 !important; }
    :is(.n8-topbar, .topbar) > header > :last-child :is(.links-trigger, .links-btn, .hbtn, .hdr-btn, .btn, #userArea button, #userDd > button):not(:is(.links-pop, .dd-menu, .listen-pop, .n8-dd-pop, .links-pop *, .dd-menu *, .listen-pop *, .n8-dd-pop *)) {
        height: 31px !important; min-height: 31px !important; padding: 5px 11px !important; font-size: 12px !important; font-weight: 650 !important; line-height: 1 !important;
        border-radius: 999px !important; box-sizing: border-box; display: inline-flex; align-items: center !important; gap: 6px; white-space: nowrap; }
    :is(.n8-topbar, .topbar) > :is(.n8-strip, .status-strip, .strip) { height: 22px !important; line-height: 22px !important; font-size: 11.5px !important; margin: -1px 24px 0 !important; padding: 0 14px !important; border-radius: 0 0 14px 14px !important; }
}
html[data-theme-mode=light] :is(.n8-topbar, .topbar) > header > nav { background: rgba(0, 0, 0, .04) !important; }
/* 1.6: phones and tablets – the same two-row header everywhere: logo + title | language · links · user; below the menu as a pill row */
@media (max-width: 900px) {
    :is(.n8-topbar, .topbar) > header { display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important; grid-template-areas: "b a" "n n" !important;
        align-items: center !important; gap: 8px !important; padding: 8px 10px 9px !important; height: auto !important; min-height: 0 !important; border-radius: 18px !important; }
    :is(.n8-topbar, .topbar) > header > :first-child { grid-area: b !important; display: flex !important; align-items: center !important; gap: 9px !important; min-width: 0 !important; margin: 0 !important; }
    :is(.n8-topbar, .topbar) > header > :first-child img { width: 36px !important; height: 36px !important; border-radius: 10px !important; flex: none; }
    :is(.n8-topbar, .topbar) > header > :first-child > div { min-width: 0; }
    :is(.n8-topbar, .topbar) > header h1 { margin: 0 !important; font-size: 16px !important; line-height: 1.2 !important; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
    :is(.n8-topbar, .topbar) > header > :first-child h1 + * { font-size: 11px !important; margin: 0 !important; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; opacity: .8; }
    :is(.n8-topbar, .topbar) > header > nav { grid-area: n !important; display: flex !important; justify-content: flex-start !important; gap: 2px !important; margin: 0 !important; padding: 3px !important;
        border-radius: 999px !important; width: auto !important; max-width: 100% !important; overflow-x: auto !important; scrollbar-width: none; flex-wrap: nowrap !important;
        background: rgba(255, 255, 255, .04) !important; border: 1px solid var(--glass-border, rgba(255, 255, 255, .12)) !important; }
    :is(.n8-topbar, .topbar) > header > nav::-webkit-scrollbar { display: none; }
    :is(.n8-topbar, .topbar) > header > nav > :is(button, a) { flex: 1 0 auto !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 5px !important;
        padding: 6px 10px !important; margin: 0 !important; font-size: 12px !important; font-weight: 650 !important; border-radius: 999px !important; border: 0 !important; white-space: nowrap !important;
        background: transparent !important; box-shadow: none !important; color: var(--text-dim, rgba(245, 247, 251, .7)) !important; min-height: 0 !important; height: auto !important; text-decoration: none !important; }
    :is(.n8-topbar, .topbar) > header > nav > :is(.hidden, [hidden]) { display: none !important; }
    :is(.n8-topbar, .topbar) > header > nav > :is(.active, .on, [aria-current=page], [aria-selected=true]) { color: var(--text, #f5f7fb) !important;
        background: rgba(var(--accent-rgb, 90, 200, 250), .18) !important; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb, 90, 200, 250), .38) !important; }
    :is(.n8-topbar, .topbar) > header > :last-child { grid-area: a !important; display: flex !important; align-items: center !important; justify-content: flex-end !important; gap: 5px !important;
        flex-wrap: nowrap !important; margin: 0 !important; width: auto !important; }
    :is(.n8-topbar, .topbar) > header > :last-child :is(.links-trigger, .links-btn, .hbtn, .hdr-btn, .btn, #userArea button, .network-info-btn):not(:is(.links-pop, .dd-menu, .listen-pop, .n8-dd-pop, .links-pop *, .dd-menu *, .listen-pop *, .n8-dd-pop *)) {
        height: 30px !important; min-height: 30px !important; padding: 0 9px !important; font-size: 12px !important; border-radius: 999px !important; box-sizing: border-box; display: inline-flex !important;
        align-items: center !important; gap: 4px !important; white-space: nowrap; }
    :is(.n8-topbar, .topbar) > header :is(.u-name, .t-long) { display: none !important; }
    :is(.n8-topbar, .topbar) > header > :last-child .links-label:not(:first-child) { display: none !important; }
    .n8-user-btn { padding: 0 6px 0 3px !important; }
}
@media (max-width: 420px) { :is(.n8-topbar, .topbar) > header > :first-child h1 + * { display: none !important; } }

/* ---- 1.3: Abstürze (System → 💥 Abstürze, Hinweisfenster nach der Anmeldung) ---- */
.n8-crash-list { display: grid; gap: 6px; margin: 8px 0; }
.n8-crash { border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
html[data-theme-mode=light] .n8-crash { background: rgba(0, 0, 0, .03); border-color: rgba(0, 0, 0, .06); }
.n8-crash.new { border-color: rgba(255, 69, 58, .45); box-shadow: inset 3px 0 0 #ff453a; }
.n8-crash > summary { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; }
.n8-crash > summary::-webkit-details-marker { display: none; }
.n8-crash-ic { font-size: 16px; }
.n8-crash-t { font-variant-numeric: tabular-nums; color: var(--text-dim, #aab); font-size: 12.5px; white-space: nowrap; }
.n8-crash-s { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n8-crash .n8-badge { white-space: nowrap; }
.n8-crash-r { grid-column: 2 / -1; grid-row: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-dim, #c5cad6); }
.n8-crash[open] .n8-crash-r { white-space: normal; }
.n8-crash-m { grid-column: 5; grid-row: 1; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.n8-crash-sys { display: grid; gap: 16px; }
.n8-crash-m code { font-size: 11px; color: var(--text-dim, #aab); }
.n8-crash > .n8-log { margin: 0 10px 10px; max-height: 420px; white-space: pre-wrap; word-break: break-word; }
.n8-crash-week { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 4px; }
.n8-chip { border: 1px solid rgba(var(--accent-rgb, 10, 132, 255), .35); background: rgba(var(--accent-rgb, 10, 132, 255), .10); color: inherit;
  border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.n8-chip.on { background: rgba(var(--accent-rgb, 10, 132, 255), .35); }
.n8-crash-box { width: min(860px, 100%) !important; max-height: calc(100vh - 40px); overflow: auto; }
@media (max-width: 720px) {
  .n8-crash > summary { grid-template-columns: auto auto minmax(0, 1fr); }
  .n8-crash-t, .n8-crash-m code { display: none; }
  .n8-crash-m { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; }
  .n8-crash-r { grid-column: 1 / -1; }
}

/* ---- 1.4: Benutzer & Zugang (Vorbild HBlink4) · Netz, Ports & Domains (Vorbild N8 Crosslink) ---- */
.n8-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.n8-tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim, #aab); padding: 6px 8px; font-weight: 700; }
.n8-tbl td { padding: 7px 8px; border-top: 1px solid rgba(255, 255, 255, .06); vertical-align: middle; }
html[data-theme-mode=light] .n8-tbl td { border-top-color: rgba(0, 0, 0, .07); }
.n8-tbl td.n8-act { text-align: right; white-space: nowrap; }
.n8-tbl td.n8-act > * + * { margin-left: 4px; }
.n8-tbl td.n8-num { text-align: right; white-space: nowrap; }
.n8-tbl .n8-nowrap { white-space: nowrap; }
.n8-tbl tr.off td { opacity: .55; }
.n8-tbl tr.n8-edit td { background: rgba(255, 255, 255, .03); border-top: none; }
.n8-tbl code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.n8-tbl .n8-dim, .n8-net .n8-dim { color: var(--text-dim, #aab); font-size: 12px; margin-top: 2px; }
.n8-btn.sm { padding: 5px 11px; font-size: 12px; }
.n8-btn.danger { color: #ff9f97; border-color: rgba(255, 69, 58, .45); }
.n8-btn.danger:hover:not(:disabled) { background: rgba(255, 69, 58, .18); border-color: rgba(255, 69, 58, .6); }
a.n8-btn { text-decoration: none; color: inherit; }
.n8-role { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 2px 7px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, .14)); color: var(--text-dim, #aab); white-space: nowrap; }
.n8-role-superadmin { color: #ffcf6e; border-color: rgba(255, 159, 10, .55); background: rgba(255, 159, 10, .14); }
.n8-role-admin { color: #9bd8ff; border-color: rgba(10, 132, 255, .55); background: rgba(10, 132, 255, .16); }
.n8-role-editor { color: #c7a6ff; border-color: rgba(175, 82, 222, .55); background: rgba(175, 82, 222, .14); }
.n8-role-off { color: #ff9f97; border-color: rgba(255, 69, 58, .45); }
.n8-user-c { display: inline-flex; align-items: center; gap: 10px; }
.n8-user-c small { color: var(--text-dim, #aab); }
.n8-av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; flex: none;
  background: rgba(var(--accent-rgb, 90, 200, 250), .22); color: var(--text, #f5f7fb); }
.n8-iform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.n8-iform.create { padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--glass-border, rgba(255, 255, 255, .12)); margin-bottom: 10px; }
.n8-iform > input, .n8-iform > select, .n8-in { flex: 1 1 140px; min-width: 0; padding: 7px 10px; border-radius: 10px; font: inherit; font-size: 13px;
  color: var(--text, #f5f7fb); background: rgba(0, 0, 0, .25); border: 1px solid var(--glass-border, rgba(255, 255, 255, .14)); outline: none; box-sizing: border-box; }
html[data-theme-mode=light] :is(.n8-iform > input, .n8-iform > select, .n8-in) { background: rgba(255, 255, 255, .85); }
:is(.n8-iform > input, .n8-iform > select, .n8-in):focus { border-color: var(--accent, #5ac8fa); }
.n8-iform select option { background: #1c2238; }
.n8-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim, #aab); }
.n8-tbl td.n8-num .n8-in { width: 110px; text-align: right; flex: none; }
.n8-tbl td.n8-num .n8-in[type=text] { width: 170px; text-align: left; }
.n8-net-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.n8-net-grid > .n8-card { margin: 0; }
.n8-net > .n8-card + .n8-card { margin-top: 16px; }
.n8-net-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 10px 16px; align-items: end; margin: 6px 0 10px; }
.n8-net-form label:not(.n8-sw) { display: grid; gap: 5px; font-size: 12px; color: var(--text-dim, #aab); font-weight: 600; }
.n8-net-opts { display: grid; gap: 4px; margin: 6px 0 12px; }
@media (max-width: 720px) {
  .n8-access .n8-tbl th:nth-child(n+3):not(:last-child), .n8-access .n8-tbl td:nth-child(n+3):not(:last-child):not([colspan]) { display: none; }
  .n8-tbl td.n8-num .n8-in { width: 90px; }
}
.n8-tbl select.n8-target { min-width: 180px; width: auto; }
