:root {
  --bg: #f3f6fb;
  --bg-2: #dde5f2;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(8, 38, 77, 0.12);
  --text: #16263a;
  --text-soft: #4f6179;
  --primary: #0057a8;
  --primary-strong: #014785;
  --danger: #b23827;
  --warning: #a46600;
  --chip: #e6edf7;
  --shadow: 0 10px 30px rgba(14, 44, 79, 0.12);
}

.hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  letter-spacing: 0.02em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 10% 10%, #bfd8f8 0%, transparent 35%),
    radial-gradient(circle at 90% 5%, #ffd39e 0%, transparent 28%),
    linear-gradient(145deg, var(--bg), var(--bg-2));
  z-index: -2;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(0, 87, 168, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 87, 168, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  z-index: -1;
}

.workstation-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
  background: rgba(6, 28, 58, 0.9);
  color: #f0f5ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.brand-logo {
  height: 20px;
  width: auto;
  max-width: 110px;
  filter: brightness(0) invert(1) contrast(1.15) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

.brand-copy {
  display: grid;
  gap: 0.08rem;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  padding-left: 0.62rem;
  line-height: 1.05;
}

.brand-title-line {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-version {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.86);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.workstation-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.78rem;
  background: var(--chip);
  color: #173352;
}

.chip-on {
  background: #d4f2d8;
  color: #1d642a;
}

.chip-off {
  background: #f7d7d3;
  color: #6f2e25;
}

.chip-sip {
  background: #dce8ff;
  color: #153b74;
}

.chip-sip.sip-idle {
  background: #e6edf7;
  color: #28517a;
}

.chip-sip.sip-registered,
.chip-sip.sip-in-call {
  background: #d4f2d8;
  color: #1d642a;
}

.chip-sip.sip-ringing,
.chip-sip.sip-establishing,
.chip-sip.sip-connecting {
  background: #fdecca;
  color: #7a4a02;
}

.chip-sip.sip-error {
  background: #fbe2df;
  color: #7e2720;
}

.btn {
  border: 0;
  border-radius: 0.55rem;
  padding: 0.55rem 0.86rem;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-secondary {
  background: #eef4ff;
  color: #15406b;
  border: 1px solid #bdd4f5;
}

.btn-secondary:hover {
  background: #dbe9ff;
}

.btn-warning {
  background: #cc7f06;
  color: #fff;
}

.btn-queue-active {
  background: #1e8f45;
  color: #fff;
}

.btn-queue-active:hover {
  background: #177039;
}

.btn-queue-inactive {
  background: #d3a01a;
  color: #2f2500;
}

.btn-queue-inactive:hover {
  background: #b8880f;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-with-icon {
  gap: 0.38rem;
}

.btn-icon-only {
  padding: 0.55rem;
  min-width: 2.25rem;
}

.btn-icon {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
  flex: 0 0 auto;
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #f0f5ff;
  border-radius: 0.45rem;
  padding: 0.4rem 0.7rem;
}

.portal-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 72px);
}

.portal-nav {
  padding: 1rem;
  border-right: 1px solid var(--panel-border);
  background: rgba(242, 247, 255, 0.82);
  backdrop-filter: blur(3px);
}

.nav-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 0.7rem;
}

.nav-item {
  display: block;
  padding: 0.68rem 0.8rem;
  margin-bottom: 0.38rem;
  border-radius: 0.5rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-item.active,
.nav-item:hover {
  background: #e6efff;
  border-color: #cadcf9;
}

.portal-content {
  padding: 1.1rem;
}

.public-content {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.public-content-login {
  display: block;
  min-height: 100vh;
  padding: 0;
}

.login-shell-fullscreen {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: clamp(1rem, 4vw, 3.4rem);
  animation: loginFadeIn 0.85s ease both;
}

.login-shell-fullscreen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("/pics/berlin_back.png");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.login-shell-fullscreen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
      110deg,
      rgba(4, 13, 25, 0.72) 0%,
      rgba(5, 16, 30, 0.66) 42%,
      rgba(7, 20, 39, 0.5) 64%,
      rgba(8, 22, 42, 0.72) 100%
    ),
    radial-gradient(circle at 76% 26%, rgba(24, 132, 255, 0.22), transparent 36%);
}

.login-overlay-logo {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  left: clamp(1rem, 3vw, 2rem);
  width: clamp(88px, 11vw, 132px);
  height: auto;
  z-index: 3;
  filter: brightness(0) invert(1) contrast(1.12) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.36));
  opacity: 0.98;
}

.login-panel {
  width: min(520px, 42vw);
  margin: 0;
  margin-left: max(0px, calc(66.666vw - (min(520px, 42vw) / 2) - clamp(1rem, 4vw, 3.4rem)));
  z-index: 2;
  animation: loginCardSlideIn 0.75s cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.login-card-glass {
  border-radius: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: linear-gradient(145deg, rgba(14, 31, 55, 0.52), rgba(11, 22, 41, 0.42));
  box-shadow: 0 25px 60px rgba(6, 18, 35, 0.46);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #eef5ff;
  padding: clamp(1.1rem, 3.2vw, 1.8rem);
}

.login-card-glass h1 {
  margin-top: 0.18rem;
  font-size: clamp(2rem, 2.8vw, 2.65rem);
  line-height: 1.02;
  color: #ffffff;
  text-wrap: balance;
}

.login-eyebrow-light {
  color: rgba(220, 233, 255, 0.94);
  letter-spacing: 0.16em;
}

.login-subline {
  margin-top: 0.72rem;
  margin-bottom: 0.24rem;
  color: rgba(223, 236, 255, 0.92);
  line-height: 1.45;
}

.form-error-glass {
  border: 1px solid rgba(255, 155, 142, 0.46);
  background: rgba(118, 27, 19, 0.45);
  color: #ffd7d1;
}

.login-form label {
  color: rgba(235, 244, 255, 0.97);
}

.login-form input {
  border-color: rgba(202, 224, 255, 0.38);
  background: rgba(12, 29, 54, 0.55);
  color: #f5f9ff;
}

.login-form input::placeholder {
  color: rgba(211, 228, 255, 0.64);
}

.login-form input:focus {
  outline: none;
  border-color: rgba(96, 175, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(18, 122, 241, 0.25);
}

.login-submit-btn {
  margin-top: 0.2rem;
  padding: 0.68rem 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(160deg, #1f89ff, #0a66d8);
  box-shadow: 0 8px 20px rgba(14, 92, 188, 0.42);
}

.login-submit-btn:hover {
  background: linear-gradient(160deg, #228fff, #095bbe);
}

.login-benefits {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.login-benefit-badge {
  border-radius: 999px;
  border: 1px solid rgba(186, 215, 255, 0.38);
  background: rgba(18, 42, 75, 0.52);
  color: rgba(236, 246, 255, 0.97);
  padding: 0.28rem 0.64rem;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes loginCardSlideIn {
  from {
    opacity: 0;
    transform: translateX(32px) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

.login-shell {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.login-card,
.login-visual,
.panel,
.kpi-card {
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  padding: 1.4rem;
}

.login-card h1 {
  margin-top: 0.2rem;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
}

.login-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.muted {
  color: var(--text-soft);
}

.form-error {
  background: #fce4e0;
  color: #82291d;
  padding: 0.65rem;
  border-radius: 0.6rem;
}

.form-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.form-grid label {
  display: grid;
  gap: 0.28rem;
  font-weight: 600;
  color: #203854;
}

.map-geocode-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.inline-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.inline-action-row .muted {
  margin: 0;
}

.map-geocode-error {
  color: #972f27;
}

.map-picker-block {
  grid-column: 1 / -1;
}

.map-picker {
  margin-top: 0.4rem;
  width: 100%;
  min-height: 320px;
  border-radius: 0.7rem;
  border: 1px solid #c7d4e6;
  overflow: hidden;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.check-row input {
  width: auto;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 0.55rem;
  border: 1px solid #c7d4e6;
  padding: 0.58rem 0.62rem;
  background: #fff;
  color: #1a2a40;
  font: inherit;
}

textarea {
  resize: vertical;
}

.login-hint {
  margin-top: 1rem;
  font-size: 0.86rem;
  color: #445876;
}

.login-visual {
  min-height: 420px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(130deg, #073d73, #0a5a95 50%, #ce7e09);
}

.login-visual-city {
  background-image: linear-gradient(130deg, rgba(6, 27, 56, 0.68), rgba(8, 63, 112, 0.62), rgba(160, 98, 10, 0.58)),
    url("/pics/mywerk_city.jpg");
  background-size: cover;
  background-position: center;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.18), transparent 55%);
}

.visual-card {
  width: min(420px, 90%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.22);
  padding: 1rem;
  color: #f8fbff;
}

.visual-title {
  margin-top: 0.6rem;
  font-weight: 700;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.05em;
  font-size: 1.08rem;
}

.visual-text {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.38;
}

.visual-badge {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  padding: 0.24rem 0.66rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f8fbff;
  background: rgba(255, 255, 255, 0.09);
}

.value-row {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.value-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.26rem 0.64rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #174c82;
  background: #dfebfd;
  border: 1px solid #c3d8f7;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 0.9rem;
}

.admin-menu-panel {
  margin-bottom: 0.9rem;
}

.admin-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
}

.admin-menu-card {
  display: grid;
  gap: 0.2rem;
  border-radius: 0.7rem;
  padding: 0.72rem 0.78rem;
  border: 1px solid #c9daf3;
  text-decoration: none;
  background: #f4f8ff;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.admin-menu-card:hover {
  background: #e6efff;
  border-color: #98b9ec;
  transform: translateY(-1px);
}

.admin-menu-card.active {
  background: #dce9ff;
  border-color: #7ea7e0;
  box-shadow: inset 0 0 0 1px rgba(0, 87, 168, 0.12);
}

.admin-menu-card.active .admin-menu-sub {
  color: #234a78;
}

.admin-menu-icon {
  display: inline-flex;
  width: 1.2rem;
  height: 1.2rem;
  color: #0c4d92;
}

.admin-menu-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.admin-menu-title {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #11375f;
}

.admin-menu-sub {
  font-size: 0.78rem;
  color: #476689;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.signalling-block {
  margin-top: 0.85rem;
  background: rgba(255, 255, 255, 0.68);
}

.signalling-timing-grid,
.signalling-command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.55rem;
}

.signalling-timing-item,
.signalling-command-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.58rem 0.62rem;
  border: 1px solid #c9daf3;
  border-radius: 0.55rem;
  background: #f6f9ff;
}

.signalling-timing-title,
.signalling-command-title {
  font-weight: 700;
  font-size: 0.84rem;
  color: #133d67;
  letter-spacing: 0.02em;
}

.signalling-timing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.signalling-timing-number {
  max-width: 120px;
}

.signalling-flow-list {
  display: grid;
  gap: 0.55rem;
}

.signalling-flow-step {
  border: 1px solid #c9daf3;
  border-radius: 0.55rem;
  background: #f7faff;
  padding: 0.62rem;
  display: grid;
  gap: 0.45rem;
}

.signalling-flow-step.dragging {
  opacity: 0.65;
}

.signalling-flow-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.signalling-drag-handle {
  cursor: grab;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.15rem;
  line-height: 1;
  color: #27598a;
  user-select: none;
}

.flow-enabled {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: #31567d;
}

.flow-remove-btn {
  padding: 0.28rem 0.52rem;
}

.signalling-flow-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
}

.signalling-flow-fields label {
  font-size: 0.78rem;
  color: #1f486f;
  display: grid;
  gap: 0.22rem;
}

.admin-group-head {
  margin: 0.45rem 0 0.65rem;
}

.eyebrow {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-soft);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.95rem;
}

.kpi-card {
  padding: 0.95rem;
}

.kpi-label {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.kpi-value {
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  font-weight: 700;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.8rem;
}

.panel {
  padding: 1rem;
}

.panel.compact {
  padding-bottom: 1.15rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  text-align: left;
  padding: 0.62rem 0.45rem;
  border-bottom: 1px solid #dce4f2;
}

.endpoint-qr-row td {
  background: rgba(0, 87, 168, 0.04);
}

.endpoint-qr-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.endpoint-qr-meta {
  min-width: 260px;
  flex: 1 1 320px;
  display: grid;
  gap: 0.35rem;
}

.endpoint-qr-payload {
  display: block;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.36rem 0.44rem;
  border-radius: 0.38rem;
  border: 1px solid #c6d7f0;
  background: #f2f7ff;
  font-size: 0.76rem;
}

.endpoint-qr-code {
  width: 112px;
  height: 112px;
  border: 1px solid #c6d7f0;
  border-radius: 0.4rem;
  background: #fff;
  padding: 0.28rem;
}

.endpoint-cli-dump {
  margin: 0.55rem 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #c6d7f0;
  border-radius: 0.48rem;
  background: #f4f8ff;
  color: #1f3555;
  white-space: pre-wrap;
  font-size: 0.78rem;
  line-height: 1.35;
  max-height: 250px;
  overflow: auto;
}

.iot-device-table-wrap table {
  min-width: 680px;
}

.iot-open-btn {
  min-width: 90px;
}

.iot-admin-editor {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid #dce4f2;
}

.iot-admin-editor h3 {
  margin-bottom: 0.65rem;
}

.iot-admin-form {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.iot-json-block {
  margin-top: 0.55rem;
  padding: 0.6rem 0.68rem;
  border: 1px solid #c6d7f0;
  border-radius: 0.52rem;
  background: #f4f8ff;
  color: #1f3555;
  white-space: pre-wrap;
  font-size: 0.78rem;
  line-height: 1.34;
  max-height: 420px;
  overflow: auto;
}

.iot-raw-details {
  margin-top: 0.7rem;
}

.iot-raw-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #153f6d;
}

.iot-submenu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.iot-submenu-btn {
  border: 1px solid #bdd2ef;
  background: #edf4ff;
  color: #15406b;
  border-radius: 0.5rem;
  padding: 0.46rem 0.74rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.iot-submenu-btn:hover {
  background: #dceaff;
}

.iot-submenu-btn.active {
  background: #0f4f90;
  color: #fff;
  border-color: #0f4f90;
}

.iot-tab-panel {
  display: grid;
  gap: 0.6rem;
}

.iot-heartbeat-live {
  display: grid;
  gap: 0.72rem;
}

.iot-hb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.72rem;
}

.iot-hb-card {
  border: 1px solid #c7d9f3;
  border-radius: 0.72rem;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.92));
  padding: 0.68rem 0.72rem;
  box-shadow: 0 4px 12px rgba(17, 57, 99, 0.08);
  display: grid;
  gap: 0.58rem;
}

.iot-hb-card-head {
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.iot-hb-card-head h4 {
  margin: 0;
  font-size: 1rem;
  color: #133d67;
}

.iot-hb-icon {
  width: 1.42rem;
  height: 1.42rem;
  border-radius: 0.4rem;
  background: #d7e9ff;
  color: #0f4f90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b8d2f3;
}

.iot-hb-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.iot-hb-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.52rem;
}

.iot-hb-metric {
  border: 1px solid #d5e3f7;
  border-radius: 0.54rem;
  background: #f8fbff;
  padding: 0.42rem 0.48rem;
  display: grid;
  gap: 0.18rem;
}

.iot-hb-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4a6482;
}

.iot-hb-value {
  color: #0f3155;
  font-size: 0.93rem;
  font-weight: 700;
}

.iot-hb-list {
  display: grid;
  gap: 0.4rem;
}

.iot-hb-list-row {
  display: grid;
  grid-template-columns: minmax(70px, auto) 1fr auto;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #d5e3f7;
  border-radius: 0.5rem;
  background: #f8fbff;
  padding: 0.36rem 0.46rem;
  font-size: 0.84rem;
}

.iot-hb-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.iot-hb-chip.up,
.iot-hb-chip.on {
  background: #d6f1db;
  color: #1f6530;
}

.iot-hb-chip.down,
.iot-hb-chip.off {
  background: #f5dbd6;
  color: #7c2a23;
}

.iot-io-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.iot-io-chip {
  border-radius: 0.5rem;
  border: 1px solid #c9dbf5;
  background: #eef5ff;
  padding: 0.2rem 0.4rem;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.iot-io-chip.on {
  border-color: #9ccdae;
  background: #e2f5e7;
  color: #184f27;
}

.iot-io-chip.off {
  border-color: #e2c0bc;
  background: #f9ecea;
  color: #6a231e;
}

.iot-hb-battery-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  border: 1px solid #b8d2f3;
  background: #e4eefc;
  overflow: hidden;
}

.iot-hb-battery-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f7f38, #5dbd39, #f3b631);
}

.iot-hb-fallback-note {
  border: 1px dashed #bfd4f0;
  border-radius: 0.58rem;
  padding: 0.55rem 0.6rem;
  background: #f3f8ff;
  color: #244a75;
}

.iot-file-controls {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.55rem;
  align-items: center;
}

.iot-file-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 0.72rem;
  align-items: start;
}

.iot-file-sidebar {
  border: 1px solid #c7d9f3;
  border-radius: 0.72rem;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 255, 0.92));
  padding: 0.62rem;
  display: grid;
  gap: 0.55rem;
}

.iot-file-sidebar h4 {
  margin: 0;
  color: #123d66;
  font-size: 0.98rem;
}

.iot-dir-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.iot-dir-crumb {
  border: 1px solid #c3d7f4;
  background: #eef5ff;
  color: #17406b;
  border-radius: 0.45rem;
  padding: 0.2rem 0.42rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.iot-dir-crumb:hover {
  background: #ddeafe;
}

.iot-dir-list {
  display: grid;
  gap: 0.35rem;
  max-height: 460px;
  overflow: auto;
}

.iot-dir-item {
  border: 1px solid #d0dff4;
  background: #f9fcff;
  color: #173a61;
  border-radius: 0.5rem;
  padding: 0.38rem 0.48rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

.iot-dir-item:hover {
  background: #eaf3ff;
  border-color: #b4cdf0;
}

.iot-dir-item.active {
  background: #dcecff;
  border-color: #91b7e7;
  color: #0f3a66;
}

.iot-file-main {
  display: grid;
  gap: 0.62rem;
}

.iot-file-detail-card {
  border: 1px solid #c7d9f3;
  border-radius: 0.62rem;
  background: #f6faff;
  padding: 0.5rem 0.62rem;
  color: #22486f;
  font-size: 0.84rem;
}

.iot-file-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.iot-file-type-icon {
  min-width: 2rem;
  width: 2rem;
  height: 1.45rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #bfd2ef;
  background: #e9f2ff;
  color: #164778;
  border-radius: 0.38rem;
  padding: 0.08rem 0.28rem;
}

.iot-file-type-icon svg {
  width: 0.98rem;
  height: 0.98rem;
  display: block;
}

.iot-file-type-icon.dir {
  background: #fff2d8;
  border-color: #e7c98a;
  color: #704801;
}

.iot-file-type-icon.image {
  background: #dff6eb;
  border-color: #b6dec8;
  color: #1d5b3a;
}

.iot-file-type-icon.text {
  background: #e3efff;
  border-color: #b9d1f0;
  color: #1a4675;
}

.iot-file-type-icon.archive {
  background: #f4e8ff;
  border-color: #d4b8ef;
  color: #5f2f87;
}

.iot-file-type-icon.code {
  background: #e3fbff;
  border-color: #b4dde7;
  color: #1c5c67;
}

.iot-file-type-icon.binary {
  background: #eceef3;
  border-color: #cbd2df;
  color: #3e495a;
}

.iot-file-row-selected td {
  background: rgba(8, 77, 144, 0.08);
}

.iot-upload-form {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.iot-upload-form input[type="file"] {
  max-width: 420px;
}

.iot-file-name-link {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.iot-file-type-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
}

.iot-file-name-link:disabled {
  color: #4f6179;
  cursor: default;
  text-decoration: none;
}

.iot-inline-btn {
  min-width: 94px;
}

.iot-shell-terminal-wrap {
  margin-top: 0.6rem;
  border: 1px solid #c6d7f0;
  border-radius: 0.68rem;
  background: linear-gradient(145deg, rgba(3, 28, 54, 0.92), rgba(8, 38, 70, 0.78));
  min-height: 380px;
  height: 380px;
  resize: both;
  overflow: hidden;
}

.iot-shell-terminal {
  width: 100%;
  height: 100%;
  padding: 0.35rem;
}

.iot-shell-terminal .xterm,
.iot-shell-terminal .xterm-viewport {
  background: transparent !important;
}

.iot-shell-fallback {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.55rem;
}

.iot-shell-fallback-output {
  margin: 0;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #c6d7f0;
  border-radius: 0.6rem;
  background: #112a44;
  color: #f1f6ff;
  padding: 0.62rem 0.68rem;
  font-size: 0.8rem;
  line-height: 1.34;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.iot-shell-fallback-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

th {
  color: var(--text-soft);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.state {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.79rem;
  background: #e6edf7;
  color: #20466f;
}

.state-incoming {
  background: #ffe4c2;
  color: #824a00;
}

.state-active {
  background: #d4e8ff;
  color: #0f4f90;
}

.state-field {
  background: #d8f0dd;
  color: #246b30;
}

.state-resolved {
  background: #e2e4e8;
  color: #4e5660;
}

.state-transfer {
  background: #eddcf9;
  color: #643b8a;
}

.capability-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.5rem;
}

.state-row {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.action-row {
  margin-top: 0.9rem;
}

.pbx-check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
}

.pbx-window-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: end;
}

.pbx-window-form label {
  display: grid;
  gap: 0.22rem;
}

.chip.status-ok {
  background: #d9f1e0;
  color: #1d5a2e;
}

.chip.status-warn {
  background: #fff2cf;
  color: #7a5300;
}

.chip.status-fail {
  background: #ffdfe0;
  color: #8f2328;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-pill {
  padding: 0.34rem 0.56rem;
  border-radius: 999px;
  text-decoration: none;
  background: #e8eef8;
  color: #2a4563;
}

.filter-pill.active {
  background: #cfe1ff;
  color: #15447c;
}

.text-link {
  color: #074e90;
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
}

.sip-log-detail {
  max-width: 460px;
  white-space: pre-wrap;
  word-break: break-word;
}

.flash {
  margin-bottom: 0.85rem;
  border-radius: 0.6rem;
  padding: 0.62rem 0.75rem;
  border: 1px solid transparent;
}

.flash-success {
  background: #e0f3e3;
  border-color: #b9dfbf;
  color: #1b5f2a;
}

.flash-warning {
  background: #fdecca;
  border-color: #f0cf8f;
  color: #7a4a02;
}

.flash-error {
  background: #fbe2df;
  border-color: #edc0ba;
  color: #7e2720;
}

.flash-info {
  background: #e3eefc;
  border-color: #bfd4f7;
  color: #174d87;
}

.sip-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 2rem));
  max-height: min(86vh, 760px);
  overflow: auto;
  border-radius: 0.9rem;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  padding: 0.9rem;
  z-index: 95;
}

.sip-popup.hidden {
  display: none;
}

.sip-popup.sip-popup-unit {
  width: min(700px, calc(100vw - 2rem));
  max-height: min(86vh, 760px);
  overflow: auto;
}

.sip-popup-title {
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.sip-popup-meta {
  margin-top: 0.3rem;
  color: var(--text-soft);
}

.sip-unit-context {
  margin-top: 0.75rem;
  border: 1px solid #d8e4f5;
  border-radius: 0.7rem;
  padding: 0.65rem;
  background: #f7fbff;
}

.sip-unit-context.hidden {
  display: none;
}

.sip-unit-line {
  margin: 0.15rem 0;
}

.sip-unit-map {
  margin-top: 0.55rem;
  width: 100%;
  height: 240px;
  border-radius: 0.65rem;
  border: 1px solid #c7d4e6;
  overflow: hidden;
}

.sip-unit-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.sip-popup-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.team-invite-popup {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(420px, calc(100vw - 2rem));
  border-radius: 0.9rem;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  padding: 0.9rem;
  z-index: 91;
}

.team-invite-popup.hidden {
  display: none;
}

.team-invite-title {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.team-invite-body {
  margin-top: 0.4rem;
  color: var(--text-soft);
}

.team-invite-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sip-dtmf-debug-screen {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 2rem));
  max-height: min(74vh, 720px);
  border-radius: 0.9rem;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  padding: 0.85rem;
  z-index: 5000;
}

.sip-dtmf-debug-screen.hidden {
  display: none;
}

.sip-dtmf-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sip-dtmf-debug-title {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.sip-dtmf-debug-body {
  margin-top: 0.6rem;
  border: 1px solid #d8e4f5;
  border-radius: 0.65rem;
  background: #f7fbff;
  min-height: 120px;
  max-height: min(56vh, 540px);
  overflow: auto;
  padding: 0.55rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.sip-dtmf-keyboard {
  margin-top: 0.75rem;
  border: 1px solid #d8e4f5;
  border-radius: 0.65rem;
  background: #f7fbff;
  padding: 0.6rem;
}

.sip-dtmf-keyboard.hidden {
  display: none;
}

.sip-dtmf-keyboard-title {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
}

.sip-dtmf-keypad {
  margin-top: 0.45rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.sip-dtmf-keypad .btn {
  min-height: 2.25rem;
  padding: 0.4rem 0.3rem;
}

.direct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.direct-video-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.direct-video-card {
  border: 1px solid var(--panel-border);
  border-radius: 0.7rem;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.75);
}

.direct-video-card video {
  margin-top: 0.35rem;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.55rem;
  background: #12263f;
  border: 1px solid #355779;
  object-fit: cover;
}

.direct-chat-log {
  border: 1px solid var(--panel-border);
  border-radius: 0.7rem;
  min-height: 320px;
  max-height: 520px;
  overflow-y: auto;
  padding: 0.65rem;
  background: rgba(248, 251, 255, 0.92);
}

.direct-chat-item {
  max-width: 82%;
  border-radius: 0.65rem;
  padding: 0.48rem 0.6rem;
  margin-bottom: 0.45rem;
  border: 1px solid transparent;
}

.direct-chat-item.mine {
  margin-left: auto;
  background: #d9e9ff;
  border-color: #b2cefb;
}

.direct-chat-item.theirs {
  margin-right: auto;
  background: #edf2f9;
  border-color: #d3dfef;
}

.direct-chat-meta {
  margin: 0;
  font-size: 0.78rem;
  color: #506684;
}

.direct-chat-text {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.two-cols {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 1080px) {
  .workstation-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .header-actions {
    justify-content: flex-start;
  }
  .login-shell-fullscreen {
    justify-content: center;
    padding: clamp(1rem, 4vw, 2rem);
  }
  .login-panel {
    width: min(640px, 96vw);
    margin: 0;
  }
}

@media (max-width: 920px) {
  .menu-toggle {
    display: inline-flex;
  }

  .portal-layout {
    grid-template-columns: 1fr;
  }

  .portal-nav {
    position: fixed;
    z-index: 40;
    top: 72px;
    left: 0;
    width: min(280px, 80%);
    height: calc(100vh - 72px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    border-right: 1px solid var(--panel-border);
  }

  .portal-nav.open {
    transform: translateX(0);
  }

  .kpi-grid,
  .split-grid,
  .two-cols,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-shell-fullscreen {
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }

  .login-card-glass {
    border-radius: 1.05rem;
    padding: 1.05rem;
  }

  .direct-video-grid {
    grid-template-columns: 1fr;
  }

  .portal-content {
    padding: 0.8rem;
  }

  table {
    min-width: 420px;
  }

  .iot-file-controls {
    grid-template-columns: 1fr;
  }

  .iot-file-layout {
    grid-template-columns: 1fr;
  }

  .iot-dir-list {
    max-height: 180px;
  }

  .iot-hb-metrics {
    grid-template-columns: 1fr;
  }

  .iot-hb-list-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .iot-upload-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .iot-shell-terminal-wrap {
    min-height: 320px;
    height: 320px;
    resize: vertical;
  }
}

@media (max-width: 560px) {
  .brand-logo {
    height: 16px;
    max-width: 90px;
  }
  .brand-copy {
    padding-left: 0.45rem;
  }
  .brand-title-line {
    font-size: 0.78rem;
    letter-spacing: 0.03em;
  }
  .brand-version {
    font-size: 0.64rem;
  }
  .workstation-meta {
    gap: 0.3rem;
  }

  .login-overlay-logo {
    width: 88px;
    top: 0.85rem;
    left: 0.85rem;
  }

  .login-card-glass h1 {
    font-size: clamp(1.58rem, 8.5vw, 2.08rem);
  }

  .login-subline {
    font-size: 0.95rem;
  }

  .login-benefits {
    gap: 0.38rem;
  }

  .login-benefit-badge {
    font-size: 0.72rem;
  }

  .sip-popup.sip-popup-unit {
    width: min(96vw, 640px);
    max-height: 78vh;
  }

  .sip-unit-map {
    height: 180px;
  }

  .chip {
    font-size: 0.74rem;
  }

  .btn {
    width: 100%;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
