/* Halama Remote – Webportal */

:root {
  --accent: #004466;
  --accent-hover: #00334d;
  --accent-soft: #e6eff4;
  --accent-line: #4591c0;
  --header: #0f2b3d;
  --header-2: #14232d;
  --header-muted: #a9c2d3;
  --header-line: #3e6074;
  --text: #14232d;
  --text-2: #33434e;
  --muted: #4e5f6b;
  --faint: #8fa3b0;
  --border: #c2cdd5;
  --border-light: #e6ebef;
  --card-line: #dce3e9;
  --row-line: #eef1f4;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --hover: #eaf0f4;
  --link: #245c80;
  --link-hover: #163f59;
  --ok-bg: #e2f5ea;
  --ok-fg: #16633f;
  --ok-dot: #23a26a;
  --warn-bg: #fff1d6;
  --warn-fg: #6b4200;
  --warn-dot: #d98a00;
  --crit-bg: #fbe4e2;
  --crit-fg: #8e2219;
  --off-bg: #eef1f3;
  --off-fg: #4e5f6b;
  --info-bg: #e3eef5;
  --info-fg: #1c4a68;
  --danger: #c0362c;
  --danger-hover: #a82e25;
  --radius: 8px;
  --radius-lg: 12px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;
  --shadow-pop: 0 12px 32px rgba(15, 43, 61, 0.18);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.is-auth {
  background: var(--surface);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.25;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

svg.ic {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.strong {
  font-weight: 600;
}

.mono {
  font-family: var(--mono);
  font-size: 0.95em;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link {
  color: var(--link);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.linklike {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.linklike:hover {
  color: var(--link);
  text-decoration: underline;
}

.noscript {
  padding: 24px;
}

/* ---------------------------------------------------------------- Schaltflächen */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.btn:hover {
  background: var(--hover);
  color: var(--text);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:disabled:hover {
  background: var(--surface);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: #fff;
}

.btn-primary:disabled,
.btn-primary:disabled:hover {
  border-color: var(--faint);
  background: var(--faint);
  opacity: 0.75;
}

.btn-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  font-weight: 600;
}

.btn-danger:hover {
  border-color: var(--danger-hover);
  background: var(--danger-hover);
  color: #fff;
}

.btn-danger-ghost {
  border-color: #e7b9b4;
  color: var(--danger-hover);
}

.btn-danger-ghost:hover {
  background: var(--crit-bg);
  color: var(--crit-fg);
}

.btn-danger-text {
  color: var(--danger-hover);
}

.btn-danger-text:hover {
  background: var(--crit-bg);
  color: var(--crit-fg);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--link);
}

.btn-ghost:hover {
  background: var(--hover);
  color: var(--link-hover);
}

.btn-link {
  height: 36px;
  border: none;
  background: none;
  color: var(--link);
}

.btn-link:hover {
  background: var(--hover);
  color: var(--link-hover);
}

.btn-dark {
  border-color: #4a6576;
  background: transparent;
  color: #fff;
}

.btn-dark:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-sm {
  height: 32px;
  padding: 0 10px;
  gap: 6px;
  border-radius: 6px;
  font-size: 13px;
}

.btn-lg {
  height: 46px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn-square {
  width: 40px;
  padding: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.12s;
}

.btn-icon:hover {
  background: var(--hover);
  color: var(--text);
}

.btn-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon:disabled:hover {
  background: transparent;
}

.btn-icon-bordered {
  border: 1px solid var(--border);
  background: var(--surface);
}

.btn-icon-bordered:disabled:hover {
  background: var(--surface);
}

.btn-icon-danger {
  color: var(--danger-hover);
}

.btn-icon-danger:hover {
  background: var(--crit-bg);
  color: var(--crit-fg);
}

/* ---------------------------------------------------------------- Formulare */

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
}

.field-hint {
  color: var(--muted);
  font-size: 12.5px;
}

.field-hint.is-ok {
  color: var(--ok-fg);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.input::placeholder {
  color: #8796a1;
}

.input:focus {
  border-color: var(--accent-line);
  outline: none;
  box-shadow: 0 0 0 3px rgba(69, 145, 192, 0.22);
}

.input:disabled {
  background: var(--surface-2);
  color: var(--muted);
}

.textarea {
  height: auto;
  min-height: 72px;
  padding: 9px 12px;
  line-height: 1.45;
  resize: vertical;
}

.select {
  padding-right: 34px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234E5F6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px;
  cursor: pointer;
}

.input-mono {
  font-family: var(--mono);
  letter-spacing: 0.3px;
}

.input-code {
  height: 56px;
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 10px;
  text-align: center;
}

.input-id {
  height: 48px;
  font-family: var(--mono);
  font-size: 21px;
  letter-spacing: 2px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .input {
  flex: 1;
  min-width: 0;
}

.form-error,
.form-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
}

.form-error {
  background: var(--crit-bg);
  color: var(--crit-fg);
}

.form-info {
  background: var(--info-bg);
  color: var(--info-fg);
}

.form-error svg,
.form-info svg {
  margin-top: 1px;
}

/* ---------------------------------------------------------------- Bausteine */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.pill-ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.pill-warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.pill-crit {
  background: var(--crit-bg);
  color: var(--crit-fg);
}

.pill-off {
  background: var(--off-bg);
  color: var(--off-fg);
}

.pill-info {
  background: var(--info-bg);
  color: var(--info-fg);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 2px;
  padding: 0 7px;
  border-radius: 11px;
  background: #eef2f5;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 320px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #c9d3db;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(69, 145, 192, 0.22);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius);
  background: #e9eef2;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.seg-btn:hover {
  background: rgba(255, 255, 255, 0.6);
}

.seg-btn[aria-pressed="true"] {
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 43, 61, 0.15);
}

.seg-count {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: rgba(15, 43, 61, 0.07);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  color: var(--muted);
}

.spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  color: var(--muted);
  text-align: center;
}

.empty svg {
  color: var(--faint);
}

.footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #2f6f99;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  background: #1c3b4e;
  font-size: 12px;
}

.avatar-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--header);
  border-radius: 50%;
  background: var(--ok-dot);
}

/* ---------------------------------------------------------------- Rahmen */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 10px 24px;
  background: var(--header);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #fff;
}

.brand-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.brand-sub {
  color: var(--header-muted);
  font-size: 12px;
  white-space: nowrap;
}

.mainnav {
  display: flex;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: #dce8f0;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.top-link,
.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s;
}

.top-btn {
  border-color: var(--header-line);
}

.top-link:hover,
.top-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  padding: 4px 8px 4px 4px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.user-btn:hover,
.user-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  white-space: nowrap;
}

.user-role {
  color: var(--header-muted);
  font-size: 12px;
  white-space: nowrap;
}

.user-chev {
  color: var(--header-muted);
}

.page {
  flex: 1;
  outline: none;
}

.page-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.page-titles h1 {
  margin: 0;
  font-size: 24px;
}

.page-sub {
  margin-top: 4px;
  color: var(--muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar-spacer {
  flex: 1;
}

.statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  padding: 7px 24px;
  border-top: 1px solid var(--card-line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-right {
  margin-left: auto;
}

.live-ind {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}

.live-ind[data-state="on"] {
  background: var(--ok-dot);
}

.live-ind[data-state="connecting"] {
  background: var(--warn-dot);
}

.boot,
.fatal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.fatal h1 {
  margin: 12px 0 0;
  font-size: 22px;
}

/* ---------------------------------------------------------------- Karten */

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.card-flush {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
}

.card-head h2 > svg {
  color: #2f6f99;
}

.card-head-pad {
  padding: 16px 18px 12px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

a.kpi:hover {
  border-color: #9db3c2;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(15, 43, 61, 0.07);
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.kpi-label svg {
  color: #2f6f99;
}

.kpi-value {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

.kpi-value.is-warn {
  color: #9a5b00;
}

.kpi-of {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.kpi-hint {
  color: var(--muted);
  font-size: 12px;
}

.overview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 18px;
}

.quick-card {
  flex: 1 1 340px;
}

.newdev-card {
  flex: 2 1 520px;
  gap: 4px;
}

.quick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick .btn-lg {
  margin-top: 4px;
}

.quick-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  background: #f3f6f8;
  font-size: 13px;
}

.quick-hint .pill {
  margin-left: auto;
}

.newdev-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--row-line);
}

.newdev-row:first-child {
  border-top: none;
}

.newdev-main {
  flex: 1;
  min-width: 0;
}

.newdev-main .dev-title {
  font-weight: 600;
}

.newdev-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.newdev-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 0;
  color: var(--ok-fg);
  font-weight: 500;
}

.newdev-more {
  padding-top: 8px;
  font-size: 13px;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok-dot);
  box-shadow: 0 0 0 3px rgba(35, 162, 106, 0.18);
}

/* ---------------------------------------------------------------- Tabellen */

.dtable-wrap {
  overflow-x: auto;
  container: dtable / inline-size;
}

.dtable {
  min-width: 900px;
}

.dtable-dev {
  min-width: 0;
}

.dtable-dev .dt-row {
  grid-template-columns: var(--cols);
}

.cell-flex {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.cell-ic {
  display: none;
  color: var(--faint);
}

.dt-row {
  display: grid;
  align-items: center;
  border-top: 1px solid var(--row-line);
}

.dt-row:first-child {
  border-top: none;
}

.dt-head {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dt-head + .dt-row {
  border-top: none;
}

.dt-cell {
  min-width: 0;
  padding: 9px 12px;
}

.dt-head .dt-cell {
  padding-top: 10px;
  padding-bottom: 10px;
  white-space: nowrap;
}

.dt-row:not(.dt-head):hover {
  background: #f8fafb;
}

.dt-group {
  padding: 10px 14px 7px;
  border-top: 1px solid var(--border-light);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dt-head + .dt-group {
  border-top: none;
}

.dt-group > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dt-group svg {
  color: #2f6f99;
}

.dt-group-count {
  color: var(--muted);
  font-weight: 500;
}

.dt-row .c-actions {
  padding-top: 7px;
  padding-bottom: 7px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.dev-name {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 100%;
  padding: 2px 0;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.dev-name:hover .dev-title {
  color: var(--link);
  text-decoration: underline;
}

.dev-name-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dev-title {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-ic {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  color: var(--text-2);
}

.dev-dot {
  position: absolute;
  right: -3px;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--faint);
}

.dev-ic.is-online .dev-dot {
  background: var(--ok-dot);
}

.is-offline .dev-ic {
  color: var(--faint);
}

.audit .dt-row {
  grid-template-columns: 150px 170px minmax(200px, 1.1fr) minmax(130px, 0.9fr) minmax(200px, 1.5fr);
}

.audit .c-detail {
  overflow-wrap: anywhere;
}

.users {
  min-width: 860px;
}

.users .dt-row {
  grid-template-columns: minmax(220px, 1.4fr) 140px 130px 160px 410px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.you {
  color: var(--muted);
  font-weight: 400;
}

/* ---------------------------------------------------------------- Kunden */

.page-split {
  max-width: 1500px;
}

.split {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.split-list {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 120px);
  padding: 14px 10px;
  overflow-y: auto;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.split-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 2px;
}

.split-list-head h1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 18px;
}

.split-list .search {
  min-width: 0;
  margin: 0 2px 4px;
}

.clist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clist-empty {
  padding: 12px 8px;
}

.citem {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.citem:hover {
  background: var(--hover);
  color: var(--text);
}

.citem[aria-current="page"] {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.citem[aria-current="page"] .citem-name {
  font-weight: 600;
}

.citem-ic {
  color: #2f6f99;
}

.citem-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.citem-name {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.citem-num {
  color: var(--muted);
  font-size: 12px;
}

.citem-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.citem-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok-dot);
}

.split-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.split-empty {
  align-items: center;
  padding: 36px;
}

.detail-head {
  gap: 6px;
  padding: 18px 20px 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.detail-head + .tab-panel {
  margin-top: 16px;
}

.detail-head.card {
  border-radius: var(--radius-lg);
}

.back-link {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  text-decoration: none;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-titles {
  min-width: 0;
}

.detail-title {
  margin: 0;
  font-size: 21px;
}

.detail-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 4px;
  color: var(--muted);
}

.detail-sub .is-online {
  color: var(--ok-fg);
  font-weight: 500;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
}

.tab:hover {
  background: #f3f6f8;
  color: var(--text);
}

.tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.cform {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.cform-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.cform-card {
  gap: 12px;
}

.cform-card h3,
.subcard h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
}

.cform-card h3 svg,
.subcard h3 svg {
  color: #2f6f99;
}

.cform-notes {
  border-color: #ebddb3;
  background: #fffbef;
}

.cform-notes h3 svg {
  color: #9a6b00;
}

.cform-extra {
  grid-column: 1 / -1;
}

.extra-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.extra-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 32px;
  align-items: center;
  gap: 8px;
}

.cform-extra > .btn {
  align-self: flex-start;
}

.cform-bar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 20px rgba(15, 43, 61, 0.08);
}

.dirty-note {
  color: var(--warn-fg);
  font-size: 13px;
  font-weight: 500;
}

/* ---------------------------------------------------------------- Dialoge */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 43, 61, 0.45);
  animation: fade-in 0.12s ease-out;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: pop-in 0.14s ease-out;
}

.modal-sm {
  max-width: 440px;
}

.modal-md {
  max-width: 580px;
}

.modal-lg {
  max-width: 880px;
}

.modal.is-busy {
  cursor: progress;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 12px 24px;
}

.modal-titles {
  flex: 1;
  min-width: 0;
}

.modal-title {
  margin: 0;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.modal-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.modal-pill {
  margin-top: 3px;
}

.modal-body {
  flex: 1;
  min-height: 0;
  padding: 4px 24px 20px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--row-line);
}

.modal-foot .btn-danger-ghost {
  margin-right: auto;
}

.confirm-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.confirm-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.confirm-ic.is-danger {
  background: var(--crit-bg);
  color: var(--crit-fg);
}

.confirm-text {
  padding-top: 2px;
  line-height: 1.5;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
}

/* Gerätedetails */

.details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.facts {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.id-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 10px 12px 14px;
  border-radius: 10px;
  background: #f3f6f8;
}

.id-label {
  color: var(--muted);
  font-size: 12px;
}

.id-value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  white-space: nowrap;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px 18px;
  font-size: 13px;
}

.fact-k {
  color: var(--muted);
}

.fact-v {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.subcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.subcard h3 {
  font-size: 14px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid #f0f3f5;
  font-size: 13px;
}

.kv-k {
  color: var(--muted);
  white-space: nowrap;
}

.kv-v {
  min-width: 0;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.kv-v.mono {
  white-space: normal;
}

.hw-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.hw-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.disk {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.disk-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 13px;
}

.disk-name {
  font-weight: 600;
}

.disk-val {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.disk-val.is-warn {
  color: var(--warn-fg);
  font-weight: 600;
}

.disk-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--border-light);
}

.disk-fill {
  height: 100%;
  border-radius: 4px;
  background: #2f6f99;
}

.disk-fill.is-warn {
  background: var(--warn-dot);
}

.net-list {
  display: flex;
  flex-direction: column;
}

.net-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid #f0f3f5;
  font-size: 13px;
}

.net-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.details-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.notes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notes-text {
  font-size: 13.5px;
  white-space: pre-line;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.history-list li {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
}

.history-time {
  color: var(--muted);
  white-space: nowrap;
}

.history .loading {
  justify-content: flex-start;
  padding: 4px 0;
}

/* Rollenwahl */

.role-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.role-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.role-opt:hover {
  background: var(--surface-2);
}

.role-opt svg {
  color: #2f6f99;
}

.role-opt[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.role-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

/* ---------------------------------------------------------------- Meldungen */

.toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 600px;
  padding: 9px 8px 9px 14px;
  border-left: 4px solid var(--accent-line);
  border-radius: 10px;
  background: var(--header-2);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
  transition: opacity 0.18s, transform 0.18s;
}

.toast-ok {
  border-left-color: var(--ok-dot);
}

.toast-ok .toast-ic {
  color: #7fe0b1;
}

.toast-error {
  border-left-color: #e0574b;
}

.toast-error .toast-ic {
  color: #ff9c92;
}

.toast-info .toast-ic {
  color: #8ccbf0;
}

.toast-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast-action {
  height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.toast-action:hover {
  background: rgba(255, 255, 255, 0.2);
}

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--header-muted);
  cursor: pointer;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.in-session .toasts {
  right: 16px;
  bottom: 44px;
  left: auto;
  align-items: flex-end;
  transform: none;
}

body.in-session:has(.s-panel:not([hidden])) .toasts {
  right: 356px;
}

.toast-out {
  opacity: 0;
  transform: translateY(6px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------------------------------------------------------------- Menüs */

.menu {
  position: fixed;
  z-index: 110;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  animation: fade-in 0.1s ease-out;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--hover);
  outline: none;
}

.menu-item svg {
  color: #2f6f99;
}

.menu-item.is-danger,
.menu-item.is-danger svg {
  color: var(--danger-hover);
}

.menu-label {
  flex: 1;
}

.menu-hint {
  color: var(--muted);
  font-size: 12px;
}

.menu-check {
  display: inline-flex;
  width: 16px;
}

.menu-check svg {
  color: var(--accent);
}

.menu-sep {
  height: 1px;
  margin: 4px 0;
  background: var(--row-line);
}

.menu-head {
  padding: 6px 10px 4px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------------------------------------------------------------- Anmeldung */

.auth {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
}

.auth-side {
  display: flex;
  flex: 1 1 420px;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 48px 56px;
  background: var(--header);
  color: #fff;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.auth-mark {
  width: 44px;
  height: 44px;
  padding: 5px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}

.auth-pitch {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 460px;
}

.auth-claim {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
}

.auth-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #c8d8e3;
  font-size: 15px;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-points svg {
  color: #5cc1ff;
}

.auth-foot {
  color: #8fb0c4;
  font-size: 13px;
}

.auth-main {
  display: flex;
  flex: 1 1 420px;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--surface);
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  width: 220px;
  height: auto;
}

.auth-step {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-head h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form.is-busy {
  opacity: 0.75;
  pointer-events: none;
}

.auth-form .btn-link {
  align-self: center;
}

.auth-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.auth-note svg {
  color: #1e7a50;
}

.auth-version {
  margin-left: auto;
  color: var(--faint);
}

.enroll-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}

.enroll-qr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.qr {
  width: 168px;
  height: 168px;
  padding: 8px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: #fff;
}

.secret {
  display: flex;
  flex: 1 1 180px;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.secret-label {
  color: var(--muted);
  font-size: 12.5px;
}

.secret-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.secret-code {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: #f3f6f8;
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
}

.secret-link {
  font-size: 12.5px;
}

/* ---------------------------------------------------------------- Sitzung */

body.in-session {
  overflow: hidden;
  background: #0b1822;
}

body.in-session .topbar,
body.in-session .statusbar {
  display: none;
}

.page-session {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.session {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  background: #0b1822;
  color: #fff;
}

.s-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 7px 12px;
  border-bottom: 1px solid #22394a;
  background: var(--header-2);
}

.s-ident {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 250px;
}

.s-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 7px;
  background: #fff;
}

.s-ident-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.s-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s-sub {
  overflow: hidden;
  color: var(--header-muted);
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s-sas {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(127, 224, 177, 0.28);
  border-radius: var(--radius);
  background: rgba(127, 224, 177, 0.1);
  color: #7fe0b1;
  font-size: 12.5px;
  white-space: nowrap;
}

.s-sas-code {
  color: #fff;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 1px;
}

.s-tools {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.tbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 9px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s;
}

.tbtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tbtn[aria-pressed="true"] {
  background: rgba(69, 145, 192, 0.3);
}

.tbtn:disabled {
  opacity: 0.38;
  cursor: default;
}

.tbtn:disabled:hover {
  background: transparent;
}

.tbtn-chev {
  opacity: 0.7;
}

.tbtn-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e0574b;
  font-size: 10.5px;
  font-weight: 700;
}

.s-monitors {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 6px;
  padding: 3px;
  border-radius: var(--radius);
  background: #0b1822;
}

.s-mon-ic {
  margin: 0 4px 0 6px;
  color: var(--header-muted);
}

.s-mon {
  min-width: 34px;
  height: 30px;
  padding: 0 9px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #c8d8e3;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.s-mon:hover {
  background: rgba(255, 255, 255, 0.08);
}

.s-mon[aria-pressed="true"] {
  background: var(--accent-line);
  color: #fff;
}

.s-disconnect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin-left: auto;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.s-disconnect:hover {
  background: var(--danger-hover);
}

.s-body {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}

.s-viewer {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: #0b1822;
}

.s-stage {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 12px;
}

.session.is-fullscreen .s-stage {
  padding: 0;
}

.s-screen {
  position: relative;
  flex-shrink: 0;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.s-canvas,
.s-cursor {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.s-canvas {
  outline: none;
  cursor: default;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.s-canvas:focus-visible {
  outline: 2px solid rgba(92, 193, 255, 0.45);
  outline-offset: 0;
}

.s-cursor {
  pointer-events: none;
}

.s-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 24, 34, 0.9);
}

.s-ov-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  text-align: center;
}

.s-ov-title {
  font-size: 20px;
  font-weight: 600;
}

.s-ov-text {
  color: #c8d8e3;
  line-height: 1.5;
}

.s-ov-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.s-ov-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(224, 87, 75, 0.16);
  color: #ff9c92;
}

.s-ov-ic.is-info {
  background: rgba(69, 145, 192, 0.2);
  color: #8ccbf0;
}

.s-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.s-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5cc1ff;
  animation: pulse 1.2s ease-in-out infinite;
}

.s-dots span:nth-child(2) {
  background: var(--accent-line);
  animation-delay: 0.2s;
}

.s-dots span:nth-child(3) {
  background: #2f6f99;
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.s-drop {
  position: absolute;
  inset: 12px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #5cc1ff;
  border-radius: 10px;
  background: rgba(11, 24, 34, 0.78);
  pointer-events: none;
}

.s-drop-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}

.s-panel {
  display: flex;
  flex: 0 0 340px;
  flex-direction: column;
  width: 340px;
  min-height: 0;
  border-left: 1px solid #22394a;
  background: var(--surface);
  color: var(--text);
}

.s-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--border-light);
}

.s-panel-head h2 {
  margin: 0;
  font-size: 15px;
}

.s-panel-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 14px 16px;
  overflow-y: auto;
}

.s-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.s-sec-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: #fafbfc;
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--accent-line);
  background: #f0f6fa;
}

.dropzone svg {
  color: #2f6f99;
}

.xfers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.xfers:empty {
  display: none;
}

.xfer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.xfer-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.xfer-top svg {
  color: #2f6f99;
}

.xfer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xfer-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xfer-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--border-light);
}

.xfer-fill {
  width: 0;
  height: 100%;
  background: #2f6f99;
  transition: width 0.2s;
}

.xfer.is-done .xfer-fill {
  background: var(--ok-dot);
}

.xfer.is-failed .xfer-fill {
  background: var(--danger);
}

.xfer.is-failed .xfer-meta {
  color: var(--crit-fg);
}

.s-sec-fill {
  flex: 1;
  min-height: 160px;
}

.fb-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fb-path {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  overflow: hidden;
  border-radius: 6px;
  background: #f3f6f8;
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-list {
  display: flex;
  flex-direction: column;
}

.fb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 6px;
  border: none;
  border-bottom: 1px solid #f0f3f5;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.fb-item:hover {
  background: #f3f6f8;
}

.fb-ic-dir {
  color: #b57d00;
}

.fb-ic-file {
  color: var(--muted);
}

.fb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-size {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.fb-go {
  color: var(--faint);
}

.chat-body {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.chat-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px 16px;
  overflow-y: auto;
}

.chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13.5px;
}

.chat-me {
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  background: var(--accent);
  color: #fff;
}

.chat-them {
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  background: #eef2f5;
}

.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-time {
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.72;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
}

.s-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  padding: 5px 14px;
  border-top: 1px solid #1b3242;
  background: #102330;
  color: var(--header-muted);
  font-size: 12.5px;
}

.s-st-state,
.s-st-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.s-st-item:empty {
  display: none;
}

.s-st-state {
  color: #fff;
}

.s-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn-dot);
}

.s-st-state[data-tone="busy"] .s-dot {
  animation: pulse 1.2s ease-in-out infinite;
}

.s-st-state[data-tone="ok"] .s-dot {
  background: var(--ok-dot);
}

.s-st-state[data-tone="off"] .s-dot {
  background: #e0574b;
}

.s-st-e2e {
  color: #7fe0b1;
}

.s-st-kbd {
  color: #8ccbf0;
}

.s-st-warn {
  color: #ffc864;
}

.s-st-right {
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- Gerätetabellen je nach verfügbarer Breite */

/* kompakt: ohne Benutzer und „Zuletzt online“ */
@container dtable (max-width: 1059px) {
  .dtable-dev .dt-row {
    grid-template-columns: var(--cols-compact);
  }

  .dtable-dev .c-user,
  .dtable-dev .c-seen {
    display: none;
  }
}

/* Karten */
@container dtable (max-width: 879px) {
  .dtable-dev .dt-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    padding: 12px 14px;
  }

  .dtable-dev .dt-row.dt-head {
    display: none;
  }

  .dtable-dev .dt-cell {
    padding: 0;
  }

  .dtable-dev .c-name {
    order: 1;
    flex: 1 1 calc(100% - 110px);
  }

  .dtable-dev .dt-row:not(:has(.c-status)) .c-name {
    flex-basis: 100%;
  }

  .dtable-dev .c-status {
    order: 2;
    margin-left: auto;
  }

  .dtable-dev .c-id,
  .dtable-dev .c-customer,
  .dtable-dev .c-os,
  .dtable-dev .c-user,
  .dtable-dev .c-seen {
    order: 3;
    max-width: 100%;
    color: var(--muted);
    font-size: 12.5px;
  }

  .dtable-dev .c-user,
  .dtable-dev .dt-row.is-offline .c-seen {
    display: block;
  }

  .dtable-dev .cell-ic {
    display: inline-flex;
  }

  .dtable-dev .c-actions {
    order: 4;
    flex: 1 1 100%;
    padding-top: 6px;
  }

  .dtable-dev .row-actions {
    justify-content: flex-start;
  }

  .dtable-dev .c-actions .btn-primary {
    flex: 0 1 260px;
  }
}

/* ---------------------------------------------------------------- Anpassung an Breiten */

@media (max-width: 1599px) {
  .tbtn.tb-sec .tbtn-label {
    display: none;
  }

  .tbtn.tb-sec {
    width: 36px;
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 1439px) {
  .s-sas-label {
    display: none;
  }

  .s-ident {
    max-width: 210px;
  }
}

@media (max-width: 1360px) {
  .user-meta {
    display: none;
  }
}

@media (max-width: 1180px) {
  .cform-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-link span {
    display: none;
  }
}

@media (max-width: 1100px) {
  .tbtn .tbtn-label {
    display: none;
  }

  .tbtn {
    padding: 0 8px;
  }

  .topbar {
    gap: 8px 14px;
  }

  .top-btn span {
    display: none;
  }
}

@media (max-width: 960px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mainnav {
    order: 3;
    width: 100%;
    margin: 0 -6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mainnav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .split-list {
    position: static;
    max-height: none;
  }

  .split.has-selection .split-list {
    display: none;
  }

  .back-link {
    display: inline-flex;
  }

  .auth-side {
    flex-basis: 100%;
    gap: 14px;
    padding: 20px 24px;
  }

  .auth-claim {
    font-size: 20px;
  }

  .auth-points,
  .auth-foot {
    display: none;
  }

  .auth-main {
    align-items: flex-start;
    padding: 28px 20px 40px;
  }

  .s-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    width: min(360px, 100%);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.35);
  }

  .s-ident {
    max-width: 200px;
  }

  .s-tools {
    order: 3;
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .s-tools::-webkit-scrollbar {
    display: none;
  }

  .s-tools > * {
    flex-shrink: 0;
  }
}

@media (max-width: 760px) {
  .page-inner {
    gap: 14px;
    padding: 16px;
  }

  .topbar {
    padding: 8px 16px;
  }

  .statusbar {
    padding: 7px 16px;
  }

  .brand-sub {
    display: none;
  }

  .search {
    min-width: 0;
    flex: 1 1 100%;
  }

  .field-row,
  .details-cols,
  .facts,
  .kv-grid,
  .role-choice {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .overview-row > .card {
    flex-basis: 100%;
  }

  .newdev-row {
    flex-wrap: wrap;
  }

  .newdev-main {
    flex-basis: calc(100% - 40px);
  }

  .newdev-row > .btn {
    margin-left: 32px;
  }

  .dtable-dev .c-actions .btn-primary {
    flex: 1 1 auto;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 8px;
  }

  .modal-head {
    padding: 16px 14px 10px 18px;
  }

  .modal-body {
    padding: 4px 18px 16px;
  }

  .modal-foot {
    padding: 12px 18px;
  }

  .cform-bar {
    bottom: 8px;
  }

  .extra-row {
    grid-template-columns: minmax(0, 1fr) 32px;
  }

  .extra-row > .input:nth-child(2) {
    grid-column: 1;
  }

  .extra-row > .btn-icon {
    grid-row: 1;
    grid-column: 2;
  }

  .s-disconnect span {
    display: none;
  }

  .s-disconnect {
    padding: 0 11px;
  }

  .s-ident {
    max-width: 150px;
  }

  .s-st-right {
    display: none;
  }

  .toasts {
    bottom: 12px;
  }
}

@media (max-width: 420px) {
  .kpi {
    padding: 12px 14px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .nav-link {
    padding: 0 10px;
  }

  .auth-logo {
    width: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Automatische Einrichtung (Rollout) */
.form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.form-row > .field { flex: 1 1 180px; margin: 0; }
.form-actions { margin: 14px 0 20px; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .input { flex: 1 1 auto; }
.section-title { margin: 22px 0 10px; font-size: 1rem; }
.card-highlight { border: 1px solid var(--accent-line); background: var(--accent-soft); margin: 4px 0 8px; }
.card-highlight h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-muted { background: var(--off-bg); color: var(--off-fg); }
table.table { width: 100%; border-collapse: collapse; }
table.table th { text-align: left; font-size: 0.8rem; color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--border); }
table.table td { padding: 9px 10px; border-bottom: 1px solid var(--row-line); vertical-align: top; }
table.table td.right, table.table th.right { text-align: right; }

/* Link zum weiteren Portal (t2sign) auf der Login-Seite */
.auth-portal { margin: 18px auto 0; display: inline-flex; align-items: center; gap: 7px; }
