/* vmpanel — Layout: App-Shell, Sidebar, Topbar, Seitenkopf, Login. */

.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px 14px;
  z-index: 80;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 10px 18px; color: var(--text);
}
.sidebar .brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  background: linear-gradient(140deg, var(--accent), #9a6bff);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 18px -4px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-mark .ic { width: 20px; height: 20px; stroke-width: 2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.brand-node { font: 11px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  margin: 14px 12px 6px; font: 700 10.5px var(--font);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.nav-label:first-child { margin-top: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 600; font-size: 13.5px;
  transition: background 0.12s, color 0.12s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-2); }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  background: var(--accent-2); border-radius: 0 3px 3px 0;
}
.nav a .ic { width: 18px; height: 18px; }
.nav a .cnt {
  margin-left: auto; font: 700 11px var(--mono);
  background: var(--surface-3); color: var(--text-2);
  border-radius: 99px; padding: 1px 8px; min-width: 22px; text-align: center;
}
.nav a.active .cnt { background: var(--accent-soft); color: var(--accent-2); }
.nav a .cnt.alert-cnt { background: var(--warn-soft); color: var(--warn); }

.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }

.node-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 12px;
}
.node-card .nc-head { display: flex; align-items: center; gap: 8px; font: 600 12px var(--font); color: var(--text-2); margin-bottom: 9px; }
.node-card .nc-head .name { font-family: var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-row { display: grid; grid-template-columns: 34px 1fr 38px; align-items: center; gap: 8px; font: 11px var(--mono); color: var(--muted); }
.node-row + .node-row { margin-top: 7px; }
.node-row b { color: var(--text); text-align: right; font-weight: 600; }

.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), #9a6bff); color: #fff;
  display: grid; place-items: center; font: 800 12px var(--font);
}
.side-user .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.side-user .u-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .u-role { font-size: 11px; color: var(--muted); }
.side-user form { margin-left: auto; }

/* ---------- Hauptspalte ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.burger { display: none; }
.tb-search {
  display: flex; align-items: center; gap: 9px; flex: 0 1 380px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); padding: 0 8px 0 12px; height: 36px; color: var(--muted);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.tb-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.tb-search input {
  flex: 1; min-width: 0; background: none; border: 0; color: var(--text);
  font: 13.5px var(--font); outline: none; height: 100%;
}
.tb-search input::placeholder { color: var(--muted); }
.tb-search kbd {
  font: 11px var(--mono); color: var(--muted);
  border: 1px solid var(--border-2); border-radius: 5px; padding: 0 6px; line-height: 18px;
  background: var(--inset);
}
.tb-spacer { flex: 1; }
.tb-actions { display: flex; align-items: center; gap: 4px; }

.live-state {
  display: inline-flex; align-items: center; gap: 7px; font: 11.5px var(--font); color: var(--muted);
  padding: 0 8px;
}
.live-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live-state[data-state="connected"] { color: var(--ok); }
.live-state[data-state="connecting"], .live-state[data-state="reconnecting"] { color: var(--warn); }

.content {
  flex: 1; width: min(var(--content-max), 100%);
  margin: 0 auto; padding: 28px 28px 80px;
}
.app-foot {
  width: min(var(--content-max), 100%); margin: 0 auto;
  padding: 0 28px 24px; color: var(--muted);
  font: 12px var(--font); display: flex; gap: 10px; flex-wrap: wrap;
}
.app-foot a { color: var(--muted); }
.app-foot a:hover { color: var(--text); }

/* ---------- Seitenkopf ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .sep { opacity: 0.5; }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .ph-main { flex: 1 1 280px; min-width: 0; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.page-head .ph-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page-head .ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Job-Banner (auf jeder Seite, wenn ein Auftrag laeuft) ---------- */
.job-banner {
  display: flex; align-items: center; gap: 12px; margin: 0 0 22px;
  background: var(--accent-soft); border: 1px solid var(--accent-ring);
  color: var(--text); border-radius: var(--r-sm); padding: 11px 16px; font-size: 13.5px;
}
.job-banner:hover { text-decoration: none; border-color: var(--accent-2); }
.job-banner .jb-go { margin-left: auto; color: var(--accent-2); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art {
  position: relative; overflow: hidden; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(700px 460px at 12% 8%, rgba(154, 107, 255, 0.45), transparent 65%),
    radial-gradient(640px 520px at 92% 96%, rgba(56, 189, 248, 0.28), transparent 65%),
    linear-gradient(160deg, #15122e, #0a0b14);
  color: #eceef3;
}
.login-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 75%);
}
.login-art > * { position: relative; z-index: 1; }
.login-art .brand-line { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.login-art h2 { font-size: 36px; line-height: 1.12; letter-spacing: -0.035em; font-weight: 800; max-width: 440px; }
.login-art .art-lede { margin-top: 14px; color: #b9bfd3; max-width: 420px; font-size: 15px; }
.login-feats { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 13px; }
.login-feats li { display: flex; gap: 12px; align-items: center; color: #d5d9e6; font-size: 14px; }
.login-feats .ic { color: #a89eff; background: rgba(168, 158, 255, 0.14); border-radius: 9px; padding: 7px; width: 32px; height: 32px; }
.login-art .art-foot { font: 12px var(--mono); color: #8d93a8; }

.login-pane { display: grid; place-items: center; padding: 32px 24px; position: relative; }
.login-card { width: min(390px, 100%); }
.login-card .mobile-brand { display: none; align-items: center; gap: 11px; font-weight: 800; font-size: 17px; margin-bottom: 26px; }
.login-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.login-card .lede { color: var(--muted); font-size: 14px; margin: 6px 0 24px; }
.login-form { display: grid; gap: 16px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap .pw-toggle { position: absolute; right: 4px; bottom: 3px; }
.login-submit { margin-top: 6px; }
.login-foot { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; margin-top: 22px; }
.login-foot .dot { animation: ping 2.4s infinite; }
.login-theme { position: absolute; top: 16px; right: 16px; }

/* ---------- Responsiv ---------- */
@media (max-width: 1000px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card .mobile-brand { display: flex; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto;
    width: min(290px, 86vw);
    transform: translateX(-105%); transition: transform 0.2s ease; visibility: hidden;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: none; visibility: visible; }
  .burger { display: inline-grid; }
  .scrim {
    position: fixed; inset: 0; z-index: 70;
    background: rgba(4, 6, 10, 0.6); backdrop-filter: blur(2px);
  }
  .topbar { padding: 0 16px; }
  .content { padding: 22px 16px 70px; }
  .app-foot { padding: 0 16px 20px; }
  .tb-search kbd { display: none; }
  .page-head h1 { font-size: 23px; }
}
@media (max-width: 560px) {
  .tb-search { flex: 1 1 auto; }
  .tb-spacer, .live-state { display: none; }
  .hide-sm { display: none !important; }
}
