:root {
  --bg: #E7EBEA;
  --panel: #FAFBFB;
  --ink: #16212A;
  --ink-2: #4B5A66;
  --line: #CBD3D3;
  --petrol: #0E5F6E;
  --petrol-2: #0A4854;
  --lamp-on: #2F9E61;
  --lamp-busy: #F2B33D;
  --lamp-off: #B9C2C4;
  --fault: #C2412D;
  --radius-s: 4px;
  --radius-m: 8px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-num: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--ink-2); }
a { color: var(--petrol); }
.btn { text-decoration: none; display: inline-block; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---------- Gerüst ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) 228px, var(--bg) 228px); }
.side {
  background: var(--ink);
  color: #DCE4E6;
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; }
.nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; scrollbar-color: #33434D transparent; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--petrol); display: grid; place-items: center; }
.brand-mark i { width: 11px; height: 11px; border-radius: 50%; background: var(--lamp-busy); box-shadow: 0 0 8px var(--lamp-busy); }
.brand b { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: #fff; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; border-radius: var(--radius-s);
  color: #B9C6CA; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: var(--petrol); color: #fff; }
.nav-sep { font-size: 11.5px; color: #7F9197; padding: 14px 12px 3px; text-transform: uppercase; letter-spacing: .06em; }
.nav-sep:empty { padding: 8px 0 0; }
.nav a small { font-variant-numeric: tabular-nums; opacity: .7; }
.side-foot { margin-top: auto; padding: 12px 8px 0; font-size: 13px; color: #8A9AA0; border-top: 1px solid #26343E; flex: none; }
.side-foot button { background: none; border: 0; color: #B9C6CA; padding: 0; cursor: pointer; text-decoration: underline; }

.main { padding: 32px 40px 64px; max-width: 1240px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head p { margin-top: 6px; max-width: 70ch; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel + .panel { margin-top: 20px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 12px; }
.panel-b { padding: 18px; }

/* ---------- Vermittlungsplatz: Lampenfeld der Nebenstellen ---------- */
.board {
  background: var(--ink);
  border-radius: var(--radius-m);
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.jack {
  border: 1px solid #2C3A45; border-radius: var(--radius-s);
  padding: 12px 12px 10px; color: #DCE4E6; position: relative; min-height: 78px;
}
.jack .n { font-family: var(--font-num); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.jack .who { font-size: 12.5px; color: #9AABB1; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jack .lamp { position: absolute; top: 12px; right: 12px; width: 12px; height: 12px; border-radius: 50%; background: #3A4853; }
.jack.reg .lamp { background: var(--lamp-on); box-shadow: 0 0 10px var(--lamp-on); }
.jack.busy .lamp { background: var(--lamp-busy); box-shadow: 0 0 12px var(--lamp-busy); animation: blink 1.1s steps(2, start) infinite; }
.jack.off { opacity: .45; }
@keyframes blink { to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .jack.busy .lamp { animation: none; } }
.board-empty { grid-column: 1 / -1; color: #9AABB1; padding: 8px 2px; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); margin: -8px 0 20px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols .panel + .panel { margin-top: 0; }

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; font-weight: 600; color: var(--ink-2); background: #F1F4F4; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #EEF4F4; }
td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 28px 18px; color: var(--ink-2); }
.empty button { margin-top: 12px; }

.state { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.state i { width: 9px; height: 9px; border-radius: 50%; background: var(--lamp-off); }
.state.ok i { background: var(--lamp-on); }
.state.warn i { background: var(--lamp-busy); }
.state.bad i { background: var(--fault); }
.state.bad { color: var(--fault); }

/* ---------- Knöpfe ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel);
  padding: 8px 14px; border-radius: var(--radius-s); cursor: pointer; font-weight: 550;
}
.btn:hover { border-color: #9FB0B3; }
.btn.primary { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.btn.primary:hover { background: var(--petrol-2); }
.btn.danger { color: var(--fault); }
.btn.small { padding: 4px 10px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulare ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form .full { grid-column: 1 / -1; }
.f label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.f input, .f select, .f textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff;
}
.f textarea { min-height: 84px; resize: vertical; font-family: var(--font-num); }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--petrol); outline: none; box-shadow: 0 0 0 3px rgba(14,95,110,.15); }
.f .hint { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.f.check label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.f.check input { width: auto; }
.pw { display: flex; gap: 6px; }
.pw .btn { white-space: nowrap; }
.pw input { font-family: var(--font-num); }
.section-title { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 6px; }
.section-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.note { background: #FFF6E0; border: 1px solid #EBD39A; border-radius: var(--radius-s); padding: 10px 12px; font-size: 13.5px; }
.note.info { background: #E6F1F2; border-color: #B5D3D7; }
.sipcard { background: #F1F4F4; border-radius: var(--radius-s); padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 14px; }
.sipcard dt { color: var(--ink-2); }
.sipcard dd { margin: 0; font-family: var(--font-num); word-break: break-all; }
pre.log { background: var(--ink); color: #DCE4E6; padding: 14px; border-radius: var(--radius-s); font-size: 13px; overflow: auto; max-height: 360px; white-space: pre-wrap; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--radius-m); padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 60px rgba(22,33,42,.35); }
dialog::backdrop { background: rgba(22,33,42,.45); }
dialog .dh { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
dialog .db { padding: 20px 22px; overflow: auto; max-height: calc(100vh - 200px); }
dialog .df { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; background: #F1F4F4; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 4px 8px; }
.err { color: var(--fault); font-size: 14px; min-height: 1em; }

/* ---------- Anmeldung ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.gate-box { width: min(400px, 100%); background: var(--panel); border-radius: var(--radius-m); padding: 30px; }
.gate-box .brand { padding: 0 0 20px; }
.gate-box .brand b { color: var(--ink); }
.gate-box form { display: grid; gap: 14px; margin-top: 18px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--radius-s);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--fault); }

/* ---------- Phase 2 ---------- */
.small { font-size: 12.5px; }
.dest-row { display: flex; gap: 8px; }
.dest-row > select { flex: 0 0 44%; }
.dest-val { flex: 1; min-width: 0; }
.dest-val select, .dest-val input { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.sched { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; align-items: center; }
.sched label { font-size: 14px; }
.sched .hint { font-size: 12.5px; color: var(--ink-2); }
.sched input { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); font-family: var(--font-num); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--petrol); text-decoration: underline; cursor: pointer; font-size: inherit; }
.optrow { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.optrow .f label:empty { display: none; }
.optkey { padding: 8px 6px; border: 1px solid var(--line); border-radius: var(--radius-s); font-family: var(--font-num); font-size: 16px; text-align: center; }
.upload { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
audio { height: 34px; max-width: 260px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 5px 10px; font-size: 13.5px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- Phase 3 ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.kpi .num { font-size: 26px; font-weight: 600; line-height: 1.1; }
.kpi span:last-child { font-size: 13px; color: var(--ink-2); }
.kpi.alert .num { color: var(--fault); }
.kpi:hover { border-color: #9FB0B3; }
.filters .panel-b { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; }
.filters .f input, .filters .f select { padding: 7px 9px; }
.sumrow { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 2px; color: var(--ink-2); font-size: 14px; }
.sumrow b { color: var(--ink); }
table.cdr td { vertical-align: top; }
table.cdr td:first-child { white-space: nowrap; }
tr.fresh td { background: #FFFBEF; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lamp-busy); }
.head > .f { min-width: 220px; }

/* ---------- VPN ---------- */
.ep { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; }
.ep .btn { margin-top: 26px; }
.vpnpanel { margin-top: 20px; }
.vpnmeta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }
.sipline { border-bottom: 1px solid var(--line); font-size: 14.5px; }
td.dl { white-space: normal; text-align: left; }
td.dl .btn { margin: 2px 0; }
.vpnhelp dl { margin: 10px 0 0; }
.vpnhelp dt { font-weight: 650; margin-top: 12px; }
.vpnhelp dd { margin: 4px 0 0; color: var(--ink-2); max-width: 85ch; }
.sitef { grid-column: 1 / -1; }
.sitef[hidden], [hidden] { display: none !important; }
#vpn-ovpn + .panel { margin-top: 20px; }
.vpnhelp p.small { margin-top: 14px; }

@media (max-width: 900px) {
  .ep { grid-template-columns: 1fr; }
  .ep .btn { margin-top: 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .filters .panel-b { grid-template-columns: 1fr 1fr; }
  .upload { grid-template-columns: 1fr; }
  .nav-sep { display: none; }
  .sched { grid-template-columns: 90px 1fr; }
  .dest-row { flex-direction: column; }
  .seg button { padding: 5px 7px; }
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .brand { padding: 0 8px 0 0; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; overflow: visible; margin: 0; padding: 0; }
  .side-foot { border-top: 0; }
  .side-foot { margin: 6px 0 0; width: 100%; padding: 0; }
  .side-foot div { display: none; }
  .main { padding: 22px 16px 48px; }
  .cols, .form { grid-template-columns: 1fr; }
  th, td { padding: 9px 10px; }
  .hide-m { display: none; }
}

/* Systemansagen */
.sysgroup { border-top: 1px solid var(--line); padding: 8px 0; }
.sysgroup:first-of-type { border-top: 0; }
.sysgroup summary { cursor: pointer; padding: 6px 0; }
.sysgroup table { margin-top: 6px; }
.sysgroup audio { height: 32px; max-width: 220px; }

/* Sprachnachricht als Text */
.vmtext { margin-top: 6px; max-width: 520px; font-size: 13px; line-height: 1.45; white-space: normal; }
.vmtext.err { color: var(--bad, #b42318); }

/* ---------------- Benutzerportal ---------------- */
.portal .kpis { grid-template-columns: repeat(2, minmax(0, 260px)); }
.me-box { margin: 0 4px 18px; padding: 10px 12px; border-radius: var(--radius-s); background: rgba(255,255,255,.06); display: flex; flex-direction: column; }
.me-box b { color: #fff; font-size: 14.5px; }
.me-box span { color: #9AABB1; font-size: 12.5px; }
.nav a { position: relative; }
.badge { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--fault); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.badge.warn { background: var(--lamp-busy); color: var(--ink); }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 6px 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 40px; height: 22px; border-radius: 11px; background: var(--lamp-off); position: relative; transition: background .15s; margin-top: 1px; }
.switch .track i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--petrol); }
.switch input:checked + .track i { left: 21px; }
.switch input:focus-visible + .track { outline: 2px solid var(--petrol); outline-offset: 2px; }
.sw-l { display: flex; flex-direction: column; }
.dial { display: flex; gap: 8px; }
.dial input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 17px; font-family: var(--font-num); }
.rule { border-top: 1px solid var(--line); padding: 10px 0; }
.rule:first-child { border-top: 0; padding-top: 0; }
.rule .f input, .panel-b > .f input { width: 100%; max-width: 360px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-s); margin-left: 52px; }
.panel-b > .f input { margin-left: 52px; }
.fsched { margin: -2px 0 10px 52px; font-size: 14px; }
.fsched .schk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.days { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0; }
.days label { display: inline-flex; gap: 4px; align-items: center; }
.times input { padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.greet { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.greet:first-child { border-top: 0; padding-top: 0; }
.greet audio { height: 32px; max-width: 320px; }
.greet p { margin: 0; }
.qr { margin: 14px 0 6px; }
.qr svg { display: block; border: 1px solid var(--line); border-radius: var(--radius-s); }
table.calls td { vertical-align: middle; }
.cdir { display: inline-block; width: 24px; height: 24px; border-radius: 50%; text-align: center; line-height: 24px; font-weight: 700; font-size: 14px; }
.cdir.out { background: #E3EEF0; color: var(--petrol); }
.cdir.in { background: #E2F2E8; color: var(--lamp-on); }
.cdir.miss { background: #F8E3DF; color: var(--fault); }
.bad { color: var(--fault); }
table.codes td { padding: 6px 10px 6px 0; border: 0; }
table.codes td:first-child { white-space: nowrap; width: 1%; }
.search { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); min-width: 220px; }
.panel-h .search { flex: 1; max-width: 360px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.jack[data-call] { cursor: pointer; background: none; text-align: left; font: inherit; }
button.jack { background: none; text-align: left; font: inherit; }
.jack.dnd .lamp { background: #c47f00; box-shadow: 0 0 10px #c47f00; }
.pin { width: 120px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); }
@media (max-width: 760px) {
  .portal .kpis { grid-template-columns: 1fr 1fr; }
  .rule .f input, .panel-b > .f input, .fsched { margin-left: 0; }
  .nav a .badge { position: static; transform: none; margin-left: 6px; display: inline-block; }
  .nav a .badge[hidden] { display: none; }
  .dial input { font-size: 16px; }
}
.cols + .panel, .panel + .cols, .cols + .cols, .kpis + .cols { margin-top: 20px; }
.portal .panel + .btn-row { margin-top: 16px; }
@media (max-width: 900px) {
  .shell > .main { min-width: 0; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .panel { overflow-x: auto; }
  table.calls .actions .btn:not(.primary) { display: none; }
  table.phones td.actions { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  table.phones td.actions .btn { margin: 0; }
}

/* ---------------- Softphone ---------------- */
.sp { position: fixed; right: 18px; bottom: 18px; width: 300px; z-index: 50; background: var(--ink); color: #DCE4E6;
  border-radius: var(--radius-m); box-shadow: 0 10px 30px rgba(0,0,0,.28); overflow: hidden; }
.sp-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: none; border: 0; color: inherit; cursor: pointer; text-align: left; }
.sp-head b { font-size: 14px; }
.sp-head .sp-st { margin-left: auto; font-size: 12.5px; color: #9AABB1; }
.sp-head .state { margin: 0; }
.sp-body { display: none; padding: 0 14px 14px; }
.sp.open .sp-body { display: block; }
.sp.ringing { animation: sp-pulse 1s ease-in-out infinite alternate; }
@keyframes sp-pulse { to { box-shadow: 0 0 0 6px rgba(47,158,97,.45), 0 10px 30px rgba(0,0,0,.28); } }
@media (prefers-reduced-motion: reduce) { .sp.ringing { animation: none; outline: 3px solid var(--lamp-on); } }
.sp .btn { background: #22313B; border-color: #34444F; color: #E6EDEF; }
.sp .btn.primary, .sp .btn.sp-ok { background: var(--lamp-on); border-color: var(--lamp-on); color: #fff; }
.sp .btn.danger { background: var(--fault); border-color: var(--fault); color: #fff; }
.sp .btn.on { background: var(--lamp-busy); border-color: var(--lamp-busy); color: var(--ink); }
.sp .btn:disabled { opacity: .45; }
.sp-dial { display: flex; gap: 6px; margin-bottom: 8px; }
.sp-dial input { flex: 1; min-width: 0; padding: 7px 9px; border-radius: var(--radius-s); border: 1px solid #34444F; background: #0F1A21; color: #fff; font-size: 17px; font-family: var(--font-num); }
.sp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 8px; }
.sp-pad .btn { padding: 7px 0; font-size: 16px; font-family: var(--font-num); }
.sp-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-row .btn { flex: 1; justify-content: center; }
.sp-ctl { margin-bottom: 8px; }
.sp-peer { display: flex; flex-direction: column; margin: 4px 0 12px; }
.sp-peer b { font-size: 18px; color: #fff; word-break: break-all; }
.sp-peer span { font-size: 13px; color: #9AABB1; font-variant-numeric: tabular-nums; }
.sp-wide { width: 100%; justify-content: center; }
.sp p { margin: 0 0 8px; }
@media (max-width: 760px) { .sp { right: 8px; left: 8px; width: auto; bottom: 8px; } }

.tlsopts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.tlsopt { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; background: #fff; }
.tlsopt.on { border-color: var(--petrol); box-shadow: inset 0 0 0 1px var(--petrol); }
.tlsopt h3 { font-size: 15px; margin-bottom: 6px; }
.tlsopt .form { grid-template-columns: 1fr; gap: 8px; margin: 8px 0; }
#tlspanel .panel { margin: 20px 0; }
@media (max-width: 1000px) { .tlsopts { grid-template-columns: 1fr; } }

/* Update */
.updgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.updgrid h3 { margin: 0 0 6px; font-size: 15px; }
.updgrid input[type=file] { max-width: 100%; min-width: 0; }
.updstaged { border: 1px solid var(--petrol); border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 16px; background: rgba(15,107,115,.06); }
.updstaged .btn-row { margin-top: 10px; }
.updnotes, .updlog { white-space: pre-wrap; font-size: 12.5px; background: rgba(0,0,0,.04); border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; max-height: 260px; overflow: auto; }
.updavail { background: rgba(46,160,90,.1); border-radius: 8px; padding: 8px 12px; margin: 0 0 14px; }
.updov { position: fixed; inset: 0; background: rgba(15,23,30,.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.updbox { background: var(--panel); color: inherit; border-radius: 14px; padding: 26px 28px; width: min(440px, 100%); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.updbox h2 { margin: 0 0 14px; font-size: 18px; }
.updspin { width: 34px; height: 34px; margin: 6px auto 12px; border: 3px solid rgba(15,107,115,.2); border-top-color: var(--petrol); border-radius: 50%; animation: updspin 1s linear infinite; }
@keyframes updspin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .updgrid { grid-template-columns: 1fr; } }
.good { color: var(--lamp-on); }
.updgrid .form { grid-template-columns: 1fr; }
.sp-hint { margin: 8px 0 0; color: var(--lamp-busy); }
.fslog { white-space: pre; font-size: 11.5px; max-height: 60vh; max-width: min(1100px, 86vw); overflow: auto; background: rgba(0,0,0,.05); padding: 10px; border-radius: var(--radius-m); }

/* Fax */
.faxtabs a { display: inline-block; padding: 6px 14px; font-size: 14px; color: inherit; text-decoration: none; background: var(--panel); border-right: 1px solid var(--line); }
.faxtabs a:last-child { border-right: 0; }
.faxtabs a.on { background: var(--ink); color: #fff; }
.faxtabs .pill { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--fault); color: #fff; font-size: 11.5px; text-align: center; }
.faxdrop { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 14px 0 8px; padding: 22px 12px; border: 2px dashed var(--line); border-radius: var(--radius-m); cursor: pointer; text-align: center; }
.faxdrop:hover, .faxdrop.over { border-color: var(--petrol); background: rgba(14,95,110,.05); }
.faxdoc { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.faxdoc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.faxprev { display: flex; flex-wrap: wrap; gap: 12px; max-height: 70vh; overflow: auto; }
.faxpg { position: relative; border: 1px solid var(--line); background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); line-height: 0; }
.faxpg canvas { width: 108px; height: auto; display: block; }
.faxpg span { position: absolute; right: 4px; bottom: 4px; line-height: 1.4; font-size: 11px; background: rgba(22,33,42,.75); color: #fff; padding: 0 5px; border-radius: 3px; }
.faxnew textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); resize: vertical; }
.faxtable td.actions { white-space: normal; }
@media (max-width: 760px) { .faxpg canvas { width: 88px; } }

/* Telefone */
.provurls { width: 100%; }
.provurls td { padding: 8px 4px; vertical-align: top; border-top: 1px solid var(--line); }
.provurls code.sel { user-select: all; word-break: break-all; font-size: 12.5px; }
.blfed { width: 100%; }
.blfed td, .blfed th { padding: 4px; }
.blfed input, .blfed select { width: 100%; min-width: 0; }

/* ---------------- Postfächer / Aufgaben ---------------- */
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #DCE8EA; color: var(--petrol-2); white-space: nowrap; }
.tboxes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tbox { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 14px; min-width: 150px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel); cursor: pointer; font: inherit; text-align: left; color: var(--ink); }
.tbox span { font-size: 13px; color: var(--ink-2); }
.tbox em { font-style: normal; font-weight: 600; color: var(--fault); }
.tbox.on { border-color: var(--petrol); box-shadow: inset 0 0 0 1px var(--petrol); background: #fff; }
.tseg { margin-bottom: 14px; }
.tasks { display: grid; gap: 10px; }
.task { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--lamp-busy); border-radius: var(--radius-m); padding: 12px 16px; display: grid; gap: 8px; }
.task.st-progress { border-left-color: var(--lamp-on); }
.task.st-done { border-left-color: var(--lamp-off); opacity: .85; }
.task header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.task header .who b { font-size: 16px; }
.task header .who span { color: var(--ink-2); }
.task header .state { margin-left: auto; }
.task blockquote { margin: 0; padding: 6px 12px; border-left: 3px solid #DCE8EA; background: #fff; border-radius: var(--radius-s); font-size: 14.5px; }
.task-row { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 10px; align-items: start; }
.task-row audio { width: 100%; height: 36px; }
.tnote { width: 100%; resize: none; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); font: inherit; font-size: 14px; background: #fff; overflow: hidden; }
.tnote:focus { border-color: var(--petrol); outline: none; box-shadow: 0 0 0 3px rgba(14,95,110,.15); }
.task footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.task footer .grow { flex: 1; }
.btn.good-btn { border-color: var(--lamp-on); color: #1F6E43; }
.btn.good-btn:hover { background: #E6F4EC; }
.tlog summary { cursor: pointer; }
.tlog pre { margin: 6px 0 0; font: 12.5px/1.5 var(--font); white-space: pre-wrap; color: var(--ink-2); }
.autogrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.autogrid code.sel { display: inline-block; margin: 6px 0; word-break: break-all; }
@media (max-width: 900px) {
  .task-row, .autogrid { grid-template-columns: 1fr; }
  .task header .state { margin-left: 0; }
  .tbox { min-width: 0; flex: 1 1 140px; }
}
.task.overdue { border-left-color: var(--fault); }
.task.waiting { opacity: .8; }
.tbadges { display: flex; flex-wrap: wrap; gap: 6px; }
.tb { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #EEF1F1; color: var(--ink-2); white-space: nowrap; }
.tb.bad { background: #FBE6E2; color: var(--fault); font-weight: 600; }
.tb.good { background: #E6F4EC; color: #1F6E43; }
.aichips { display: flex; flex-wrap: wrap; gap: 6px; }
.aichip { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13.5px; padding: 3px 10px; border-radius: var(--radius-s); background: #fff; border: 1px solid #DCE8EA; }
.aichip i { font-style: normal; font-size: 11.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.aichip.med { border-color: #B8D7DD; background: #F1F8F9; }
.aichip.urgent { background: var(--fault); border-color: var(--fault); color: #fff; font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
.tfields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; padding: 8px 12px; background: #fff; border-radius: var(--radius-s); border-left: 3px solid #DCE8EA; }
.tfields dt { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tfields dd { margin: 0; }
.seek { border: 1px solid var(--line); background: var(--panel); border-radius: 50%; width: 20px; height: 20px; font-size: 9px; line-height: 1; cursor: pointer; padding: 0; color: var(--petrol); }
.textra { border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 6px; }
.textra audio { height: 32px; max-width: 320px; }
.steped { display: grid; gap: 6px; }
.steprow { display: grid; grid-template-columns: 22px 1fr 1.4fr 70px auto auto; gap: 6px; align-items: center; }
.steprow input, .steprow select { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); font: inherit; font-size: 14px; background: #fff; min-width: 0; }
.autosec { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.autosec h3 { margin: 0 0 8px; font-size: 15px; }
.autosec .btn-row input { padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); font: inherit; font-size: 14px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; min-width: 0; }
.bar i { display: block; width: 100%; background: var(--petrol); border-radius: 2px 2px 0 0; min-height: 1px; }
.bar span { font-size: 10px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; }
@media (max-width: 900px) {
  .steprow { grid-template-columns: 22px 1fr 60px auto auto; }
  .steprow select { grid-column: 2 / -1; grid-row: 2; }
  .tfields { grid-template-columns: 1fr; }
}

/* ---------------- Sicherheit ---------------- */
.secstats { grid-template-columns: repeat(4, 1fr); }
.secstats .kpi .small-num { font-size: 22px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form input, .inline-form select { padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); font: inherit; font-size: 14px; background: #fff; }
table.compact td { padding: 6px 8px; }
@media (max-width: 900px) { .secstats { grid-template-columns: repeat(2, 1fr); } }
.show-m { display: none; }
@media (max-width: 900px) { .show-m { display: block; } }

/* ---------------- Leitungsprotokoll ---------------- */
.tlog-panel .panel-h { flex-wrap: wrap; }
.tlog-panel .panel-h select { padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); font: inherit; font-size: 14px; background: #fff; }
.tl-sum { margin-bottom: 16px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 6px; }
.tl-kpi { font-size: 13.5px; color: var(--ink-2); }
.tl-kpi > span:first-child { font-weight: 600; color: var(--ink); }
.tl-kpi .bad, .tl-head .bad { color: var(--fault); }
.warn-t { color: #A86B00; }
.tl-bar { display: flex; height: 22px; gap: 1px; background: var(--panel); }
.tl-bar i { flex: 1; min-width: 1px; border-radius: 1px; }
.tl-bar i.y { background: var(--lamp-on); }
.tl-bar i.x { background: var(--fault); }
.tl-bar i.n { background: #DDE3E3; }
.tl-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.tl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--lamp-on); vertical-align: 1px; }
.tl-err .tl-dot { background: var(--fault); }
.tl-warn .tl-dot { background: var(--lamp-busy); }
.tl-err td:last-child { color: var(--fault); }
.tl-detail { margin-top: 4px; word-break: break-all; }
#trunklog { margin-top: 20px; }

/* Ausgehende VPN-Verbindungen */
.vcpanel .panel-h > .btn { white-space: nowrap; flex-shrink: 0; }
.vcpanel .vcerr { max-width: 340px; white-space: pre-line; margin-top: 4px; }
.vcpanel td.actions { white-space: nowrap; }
@media (max-width: 700px) {
  .vcpanel .panel-h { flex-wrap: wrap; gap: 10px; }
  .vcpanel .panel-h > .btn { width: 100%; }
  .vcpanel td.actions { white-space: normal; }
  .vcpanel td.actions .btn { margin: 2px 0; }
}
