﻿:root {
  --bg-a: #9bd4f3;
  --bg-b: #2d89c3;
  --bg-c: #1f6fa7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --text: #102136;
  --muted: #5f7086;
  --line: #dde7f0;
  --brand: #24a658;
  --brand-2: #1e8d4b;
  --danger: #d9534f;
  --shadow: 0 18px 48px rgba(10, 38, 64, 0.2);
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}

.token-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 5px;
}

.token-display-actions,
.token-validity-actions {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.token-display-actions {
  flex-direction: column;
}

.token-validity-actions {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  padding: 3px 5px;
  border: 1px solid #e0e8ee;
  border-radius: 7px;
  background: #fbfdfe;
}

.btn.token-action {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 5px 9px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #47c154, var(--brand));
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 3px 8px rgba(36, 166, 88, 0.22);
  cursor: pointer;
  white-space: nowrap;
}

.btn.token-action:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #52cb60, var(--brand-2));
  box-shadow: 0 5px 10px rgba(36, 166, 88, 0.28);
}

.btn.token-action-warning {
  color: #fff;
  background: linear-gradient(180deg, #e3a43d, #bd7514);
  box-shadow: 0 3px 8px rgba(189, 117, 20, 0.22);
}

.btn.token-action-warning:hover {
  background: linear-gradient(180deg, #edaf48, #a9650f);
  box-shadow: 0 5px 10px rgba(189, 117, 20, 0.28);
}

.btn.token-action-danger {
  color: #fff;
  background: linear-gradient(180deg, #e76a65, #c9423e);
  box-shadow: 0 3px 8px rgba(201, 66, 62, 0.22);
}

.btn.token-action-danger:hover {
  background: linear-gradient(180deg, #ef7771, #b73733);
  box-shadow: 0 5px 10px rgba(201, 66, 62, 0.28);
}

.token-renew-form {
  display: contents;
}

.token-days-input {
  width: 55px !important;
  padding: 3px 5px !important;
  font-size: 11px;
  border-radius: 5px !important;
}

.token-days-label,
.token-never-check {
  font-size: 11px;
  color: #526679;
  white-space: nowrap;
}

.token-never-check {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.token-never-check input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.token-renew-hint {
  grid-column: 1 / -1;
  color: #9a5a00;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.token-renew-hint[hidden] {
  display: none;
}

.token-inline-form {
  display: inline;
  margin: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  padding: 28px;
  font-family: "Nunito Sans", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -20%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(900px 400px at 90% 120%, rgba(19, 99, 145, 0.45), transparent 60%),
    linear-gradient(155deg, var(--bg-a) 0%, var(--bg-b) 52%, var(--bg-c) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shell {
  width: min(1100px, 95vw);
  height: min(760px, 92vh);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: color-mix(in srgb, var(--surface) 94%, #e9f6ff 6%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.42);
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

.workspace-shell {
  width: min(1680px, 98vw);
  height: min(940px, 96vh);
}

.shell > * {
  min-height: 0;
  min-width: 0;
}

.brand {
  position: relative;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(235, 247, 255, 0.86)),
    linear-gradient(180deg, #eef8ff, #d7ecfb);
}

.brand::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 166, 88, 0.14), transparent 68%);
  bottom: -180px;
  left: -90px;
  pointer-events: none;
}

.brand img {
  width: min(260px, 62%);
  height: auto;
  filter: drop-shadow(0 6px 20px rgba(16, 33, 54, 0.12));
}

.top-logo {
  width: min(150px, 34vw);
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(16, 33, 54, 0.1));
}

.form {
  padding: 42px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

h1 {
  margin: 0 0 8px 0;
  font-size: clamp(28px, 2.4vw, 36px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0d2236;
}

h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f2640;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #2b425e;
}

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

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #fcfeff, #f0f6fb);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 11px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus-within {
  border-color: #83b6dc;
  box-shadow: 0 0 0 4px rgba(64, 139, 196, 0.15);
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  background: #ffffff;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 15px;
  color: #0f2740;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input input {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

input::placeholder {
  color: #8798ab;
}

input:focus,
select:focus {
  border-color: #83b6dc;
  box-shadow: 0 0 0 4px rgba(64, 139, 196, 0.15);
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 44px;
}

.password-field input::-ms-reveal,
.password-field input::-ms-clear {
  display: none;
}

.password-field input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #718096;
  appearance: none;
  box-shadow: none;
  outline: none;
  z-index: 2;
  cursor: pointer;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle svg path,
.password-toggle svg circle {
  fill: none !important;
}

.password-toggle:focus-visible {
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(45, 111, 159, 0.18);
}

.password-toggle:hover,
.password-toggle.is-showing {
  color: #2d6f9f;
}

.input.password-field input {
  padding-right: 36px;
}

.btn {
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(180deg, #47c154, var(--brand));
  box-shadow: 0 10px 18px rgba(36, 166, 88, 0.26);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(36, 166, 88, 0.32);
  background: linear-gradient(180deg, #52cb60, var(--brand-2));
}

.btn:disabled {
  background: #9ca3af;
  box-shadow: none;
  transform: none;
}

a {
  color: #1d5f9a;
  text-underline-offset: 2px;
}

a:hover {
  color: #154f82;
}

.links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.msg {
  font-size: 14px;
  color: var(--muted);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 20px;
  margin-top: 10px;
  padding: 0 0 7px;
  border-bottom: 1px solid var(--line);
}

.admin-tabs a {
  padding: 6px 1px 5px;
  color: #1d5f9a;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.admin-tabs a:hover {
  color: #154f82;
  border-bottom-color: #9bc6e6;
}

.admin-tabs a.active {
  color: #0f4e7d;
  font-weight: 800;
  border-bottom-color: #2d89c3;
}

.err {
  font-size: 13px;
  color: #b42318;
  background: #fff1f1;
  border: 1px solid #ffd4d4;
  border-radius: 10px;
  padding: 8px 10px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f2f7fc;
  color: #1d3550;
  font-size: 14px;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
}

th,
td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid #edf2f7;
}

tbody tr:hover {
  background: #f7fbff;
}

tbody tr[data-bulk-id] {
  cursor: default;
  user-select: text;
}

tbody tr.bulk-selected,
tbody tr.bulk-selected:hover {
  background: #dceeff;
  box-shadow: inset 4px 0 0 #2d89c3;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
}

.bulk-toolbar .btn {
  width: auto;
  margin: 0;
  padding: 9px 14px;
  background: var(--danger);
  box-shadow: 0 8px 16px rgba(217, 83, 79, 0.24);
}

.bulk-toolbar .btn:hover:not(:disabled) {
  background: #c9423e;
  box-shadow: 0 10px 18px rgba(217, 83, 79, 0.3);
}

.bulk-toolbar .btn.bulk-download-button {
  background: #2d89c3;
  box-shadow: 0 8px 16px rgba(45, 137, 195, 0.24);
}

.bulk-toolbar .btn.bulk-download-button:hover:not(:disabled) {
  background: #1f6fa7;
  box-shadow: 0 10px 18px rgba(45, 137, 195, 0.3);
}

.bulk-download-dialog h3 {
  margin: 0;
}

.bulk-download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.bulk-download-actions .btn {
  width: 100%;
  margin: 0;
}

.bulk-download-status {
  min-height: 24px;
  margin-top: 14px;
}

@media (max-width: 620px) {
  .bulk-toolbar {
    flex-wrap: wrap;
  }

  .bulk-download-actions {
    grid-template-columns: 1fr;
  }
}

.bulk-check {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  box-shadow: none;
}

.server-refresh-bar,
.server-refresh-actions,
.server-disk-title,
.server-disk-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.server-refresh-bar {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #f7fbff;
}

.server-refresh-actions .btn {
  width: auto;
  margin: 0;
  padding: 10px 14px;
}

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

.server-stat-card,
.server-disk-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff, #f5faff);
}

.server-stat-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.server-stat-card span,
.server-stat-card small {
  color: var(--muted);
}

.server-stat-card strong {
  font-size: 26px;
  color: #123654;
}

.server-progress {
  height: 14px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: #dfebf4;
}

.server-progress span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #62cc70);
}

.serial-create-card,
.serial-product-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.serial-create-card {
  background: linear-gradient(180deg, #ffffff, #f5faff);
}

.serial-form-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.serial-success {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #a9dfb9;
  border-radius: var(--radius-lg);
  background: #edf9f0;
  color: #176936;
}

.serial-search {
  display: flex;
  align-items: end;
  gap: 10px;
}

.serial-search > div {
  flex: 1;
}

.serial-search .btn {
  width: auto;
  margin: 0;
  padding: 10px 16px;
}

.serial-search > a {
  margin-bottom: 10px;
}

.serial-product-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.serial-table-scroll {
  max-height: 310px;
  margin-top: 10px;
}

.serial-edit-button {
  border: 1px solid #b9d3e7;
  border-radius: var(--radius-pill);
  padding: 7px 11px;
  background: #eef7fd;
  color: #185786;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.serial-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.serial-actions form {
  margin: 0;
}

.serial-delete-button {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 7px 11px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.serial-delete-button {
  background: var(--danger);
}

.serial-copy-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #1d5f9a;
  font: inherit;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.serial-number-cell {
  min-width: 190px;
  white-space: nowrap;
}

.serial-hex-cell {
  min-width: 265px;
  white-space: nowrap;
}

.serial-hex-cell code {
  display: inline-block;
  margin-right: 4px;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.serial-edit-button:hover {
  background: #dfeffa;
}

.serial-dialog {
  width: min(620px, 92vw);
  border: 0;
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
}

.serial-dialog::backdrop {
  background: rgba(8, 31, 51, 0.48);
}

.serial-dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.serial-dialog-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef3f7;
  color: #29445c;
  font-size: 24px;
  cursor: pointer;
}

.device-link-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff, #f5faff);
}

.device-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.device-tree-heading,
.serial-product-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.device-client-filter {
  width: min(360px, 100%);
}

.device-client-filter label {
  margin-bottom: 4px;
}

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

.device-tree details {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  overflow: hidden;
}

.device-tree summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.device-tree summary::-webkit-details-marker {
  display: none;
}

.tree-client > summary {
  background: #eef6fc;
}

.tree-product > summary {
  background: #f7fafc;
}

.tree-device > summary {
  min-height: 40px;
}

.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
  background: #dceaf5;
  color: #185786;
  font-weight: 900;
}

.tree-children {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 10px 10px 34px;
  border-top: 1px solid var(--line);
}

.tree-meta {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  margin-left: auto;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
}

.status-active {
  background: #e6f7eb;
  color: #17733a;
}

.status-inactive {
  background: #f2f4f7;
  color: #667085;
}

.tree-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed #cad9e5;
  border-radius: 9px;
}

.device-detail-card {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
}

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

.device-info-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #e5edf4;
  border-radius: 9px;
  background: #fff;
}

.device-info-grid span {
  color: var(--muted);
  font-size: 12px;
}

.device-info-grid code {
  overflow-wrap: anywhere;
}

.device-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.device-edit-form .btn {
  width: auto;
  margin: 0;
  padding: 10px 16px;
}

.device-active-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  margin: 0;
  white-space: nowrap;
}

.device-active-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  box-shadow: none;
}

.device-unlink-form {
  margin-top: 10px;
  text-align: right;
}

.device-unlink-form button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #b42318;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.page-heading,
.telemetry-section-title,
.telemetry-detail-head,
.telemetry-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.header-logout {
  width: 160px;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.telemetry-page {
  gap: 18px;
}

.telemetry-filter-card {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #f8fbfe;
}

.telemetry-filter-card h3,
.telemetry-section-title h2,
.telemetry-detail h2,
.telemetry-device-card h3,
.telemetry-data-block h3 {
  margin: 0;
}

.telemetry-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  min-width: min(560px, 52%);
}

.telemetry-empty {
  padding: 32px 20px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #b9ccdc;
  border-radius: var(--radius-lg);
  background: #f9fcff;
}

.telemetry-empty.compact {
  padding: 18px;
  margin-top: 14px;
}

.telemetry-section-title {
  margin-bottom: 12px;
}

.telemetry-view-toggle {
  display: inline-flex;
  padding: 2px;
  border: 1px solid #cbdbe7;
  border-radius: 8px;
  background: #f2f7fb;
}

.telemetry-view-toggle button {
  width: auto;
  min-width: 62px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  color: #607386;
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.telemetry-view-toggle button.active {
  color: #164f78;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 50, 74, 0.15);
  font-weight: 800;
}

.telemetry-live-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4b6478;
  font-size: 13px;
}

.telemetry-live-label i,
.telemetry-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.telemetry-live-label i {
  color: #24a658;
  box-shadow: 0 0 0 4px rgba(36, 166, 88, 0.12);
}

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

.telemetry-device-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 8px 22px rgba(31, 91, 132, 0.07);
}

.telemetry-device-card.selected {
  border-color: #80b9df;
  box-shadow: 0 0 0 3px rgba(45, 137, 195, 0.1);
}

.telemetry-list-view {
  display: none;
}

#telemetryRefreshZone.view-list .telemetry-card-view {
  display: none;
}

#telemetryRefreshZone.view-list .telemetry-list-view {
  display: block;
}

#telemetryRefreshZone.view-list .telemetry-standalone-detail {
  display: none;
}

.telemetry-list-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.telemetry-list-table {
  min-width: 1530px;
  margin: 0;
  border: 0;
  border-radius: 0;
  font-size: 12px;
}

.telemetry-list-table th,
.telemetry-list-table td {
  padding: 11px 10px;
  vertical-align: middle;
  line-height: 1.35;
}

.telemetry-list-table th {
  font-size: 12px;
  white-space: nowrap;
}

.telemetry-list-table tr.selected {
  background: #edf7fd;
  box-shadow: inset 3px 0 0 #2d89c3;
}

.telemetry-list-table tr[data-device-row].detail-open,
.telemetry-list-table tr[data-device-row].detail-open:hover {
  background: #edf7fd;
  box-shadow: inset 3px 0 0 #2d89c3;
}

.telemetry-list-detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  padding: 4px 7px;
  color: #1d5f9a;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.telemetry-list-detail-toggle:hover,
.telemetry-list-detail-toggle.active {
  color: #154f82;
  background: #e4f1fa;
  border-color: #c5deef;
}

.telemetry-list-detail-toggle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  color: #fff;
  background: #2d89c3;
  border-radius: 50%;
  font-weight: 900;
  line-height: 1;
}

.telemetry-list-detail-row,
.telemetry-list-detail-row:hover {
  background: #f6fbfe;
}

.telemetry-list-detail-row > td {
  padding: 0;
  border-bottom: 1px solid #cddfeb;
}

.telemetry-list-detail-panel {
  padding: 18px 20px 20px;
  box-shadow: inset 3px 0 0 #2d89c3;
}

.telemetry-list-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.telemetry-list-detail-head h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.telemetry-list-table .telemetry-status {
  padding: 4px 8px;
  font-size: 11px;
}

.telemetry-list-nowrap {
  white-space: nowrap;
}

.telemetry-list-file {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telemetry-map-placeholder {
  color: #7d8d9c;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: not-allowed;
}

.telemetry-identity {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.telemetry-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
}

.telemetry-status.online {
  color: #17733a;
  background: #e5f7eb;
}

.telemetry-status.offline,
.telemetry-status.blocked {
  color: #a1332f;
  background: #fff0ef;
}

.telemetry-status.unknown {
  color: #687a8e;
  background: #edf2f6;
}

.telemetry-status.attempting {
  color: #a65300;
  background: #fff1dc;
  gap: 4px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.telemetry-status.attempting i {
  width: 5px;
  height: 5px;
}

.telemetry-status.online,
.telemetry-status.offline {
  gap: 4px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.telemetry-status.online i,
.telemetry-status.offline i {
  width: 5px;
  height: 5px;
}

.telemetry-state-text {
  display: inline-block;
  max-width: 180px;
  color: #526679;
  font-size: 12px;
  line-height: 1.25;
}

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

.telemetry-summary-grid {
  margin-top: 14px;
}

.telemetry-summary-grid > div,
.telemetry-data-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e6eef5;
  border-radius: 9px;
  background: #fbfdff;
}

.telemetry-summary-grid span,
.telemetry-data-grid span {
  color: var(--muted);
  font-size: 12px;
}

.telemetry-summary-grid strong,
.telemetry-data-grid strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.telemetry-file {
  grid-column: 1 / -1;
}

.telemetry-alarm.alarm {
  color: #b42318;
}

.telemetry-alarm.normal {
  color: #17733a;
}

.telemetry-alarm-disclosure {
  min-width: 140px;
}

.telemetry-alarm-disclosure summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.telemetry-alarm-disclosure summary:hover,
.telemetry-alarm-disclosure summary:focus-visible {
  text-decoration-style: solid;
}

.telemetry-alarm-info {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #f1d3cd;
  border-radius: 7px;
  background: #fff8f6;
  color: #51362f;
  font-size: 12px;
  line-height: 1.4;
}

.telemetry-alarm-info small {
  color: #826a62;
}

.telemetry-alarm-info ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.telemetry-occurrence {
  grid-column: 1 / -1;
}

.telemetry-occurrence small,
.telemetry-list-occurrence small,
.telemetry-list-occurrence span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.telemetry-occurrence em {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #526679;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telemetry-list-occurrence {
  min-width: 170px;
}

.telemetry-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 13px;
  font-size: 13px;
}

.telemetry-card-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #8a98a8;
}

.telemetry-detail {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.telemetry-eyebrow {
  color: #2d7cac;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.telemetry-detail-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.telemetry-data-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e1eaf2;
  border-radius: 12px;
  background: #f9fcff;
}

.telemetry-data-block h3 {
  margin-bottom: 10px;
  color: #1b4e73;
}

.telemetry-json {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.telemetry-json summary {
  color: #1d5f9a;
  cursor: pointer;
  font-size: 14px;
}

.telemetry-json pre {
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  color: #dcecff;
  background: #10273a;
  border-radius: 10px;
  font: 12px/1.55 Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.telemetry-page-updated {
  position: fixed;
  left: 5px;
  bottom: 2px;
  z-index: 20;
  padding: 1px 4px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(10, 58, 91, 0.14);
  border-radius: 4px;
  font-size: 9px;
  line-height: 1.1;
  pointer-events: none;
}

.telemetry-page-updated strong {
  color: #fff;
  font-weight: 700;
}

body.telemetry-map-body {
  display: block;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  background: #dbe9f3;
}

.telemetry-map-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.telemetry-map-sidebar {
  position: relative;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
  border-right: 1px solid #d4e0e9;
  box-shadow: 5px 0 18px rgba(13, 49, 73, 0.14);
}

.telemetry-map-sidebar-head {
  padding: 18px 18px 12px;
  border-bottom: 1px solid #e3ebf2;
}

.telemetry-map-logo {
  display: block;
  width: 112px;
  height: auto;
  margin-bottom: 10px;
}

.telemetry-map-back {
  display: inline-block;
  margin-bottom: 13px;
  font-size: 13px;
}

.telemetry-map-sidebar h1 {
  margin: 0 0 4px;
  font-size: 20px;
}

.telemetry-map-search-wrap {
  padding: 12px 14px 8px;
}

.telemetry-map-search-wrap input {
  padding: 9px 10px;
  font-size: 13px;
}

.telemetry-map-count {
  padding: 2px 15px 9px;
  color: var(--muted);
  font-size: 12px;
}

.telemetry-map-device-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 9px 10px;
}

.telemetry-map-device {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 9px;
  width: 100%;
  margin: 0 0 5px;
  padding: 10px;
  text-align: left;
  color: var(--text);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
}

.telemetry-map-device:hover:not(:disabled) {
  background: #f2f8fc;
  border-color: #d5e6f2;
}

.telemetry-map-device.selected {
  background: #e8f4fb;
  border-color: #91c3e2;
  box-shadow: inset 3px 0 0 #2d89c3;
}

.telemetry-map-device:disabled {
  color: #7b8997;
  background: #fafcfd;
  cursor: default;
  opacity: 0.78;
}

.telemetry-map-device-status {
  padding-top: 4px;
}

.telemetry-map-device-status i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.telemetry-map-device-status.online {
  color: #1fa653;
}

.telemetry-map-device-status.offline,
.telemetry-map-device-status.blocked {
  color: #d9534f;
}

.telemetry-map-device-status.unknown {
  color: #91a0ae;
}

.telemetry-map-device-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.telemetry-map-device-copy strong,
.telemetry-map-device-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telemetry-map-device-copy strong {
  font-size: 13px;
}

.telemetry-map-device-copy small {
  color: var(--muted);
  font-size: 11px;
}

.telemetry-map-list-empty {
  padding: 18px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.telemetry-map-sidebar-foot {
  padding: 8px 14px;
  color: #6c7e8e;
  background: #f6f9fb;
  border-top: 1px solid #e2ebf2;
  font-size: 10px;
}

.telemetry-map-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.telemetry-map-canvas {
  width: 100%;
  height: 100%;
  background: #dbe7ef;
}

.telemetry-map-client-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 280px;
  padding: 8px 12px;
  color: #1d3b52;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(164, 190, 207, 0.75);
  border-radius: 9px;
  box-shadow: 0 5px 16px rgba(25, 67, 96, 0.16);
  backdrop-filter: blur(5px);
}

.telemetry-map-layer-switch {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 800;
  display: inline-flex;
  padding: 3px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(146, 173, 191, 0.8);
  border-radius: 9px;
  box-shadow: 0 5px 16px rgba(25, 67, 96, 0.18);
  backdrop-filter: blur(5px);
  transform: translateX(-50%);
}

.telemetry-map-layer-switch button {
  width: auto;
  min-width: 72px;
  padding: 6px 11px;
  color: #5e7181;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.telemetry-map-layer-switch button.active {
  color: #fff;
  background: #247db4;
  box-shadow: 0 2px 6px rgba(24, 93, 136, 0.26);
  font-weight: 800;
}

.telemetry-map-client-chip span {
  color: #6a7b8a;
  font-size: 10px;
  text-transform: uppercase;
}

.telemetry-map-client-chip strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telemetry-map-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 700;
  width: min(420px, 80%);
  padding: 16px;
  color: #52687a;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #c9d9e5;
  border-radius: 11px;
  box-shadow: 0 8px 24px rgba(20, 58, 85, 0.16);
  transform: translate(-50%, -50%);
}

.telemetry-map-marker-shell {
  background: transparent;
  border: 0;
}

.telemetry-map-marker {
  position: relative;
  display: block;
  width: 10px;
  height: 10px;
  margin: 1px;
  color: #7b8b99;
  background: currentColor;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
}

.telemetry-map-marker.online {
  color: #00e85b;
  box-shadow: 0 0 4px rgba(0, 232, 91, 0.8);
}

.telemetry-map-marker.offline,
.telemetry-map-marker.blocked {
  color: #d9534f;
}

.telemetry-map-marker.unknown {
  color: #788997;
}

.telemetry-map-marker.attempting {
  color: #f59e0b;
}

.telemetry-map-marker.online.moving::after {
  position: absolute;
  inset: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  animation: telemetry-marker-signal 2.8s ease-out infinite;
}

@keyframes telemetry-marker-signal {
  0% {
    opacity: 0.75;
    transform: scale(0.9);
  }
  80%, 100% {
    opacity: 0;
    transform: scale(3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .telemetry-map-marker.online.moving::after {
    animation: none;
    content: none;
  }
}

.telemetry-map-popup {
  min-width: 280px;
  color: var(--text);
}

.telemetry-map-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.telemetry-map-popup-head > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.telemetry-map-popup-head > div > strong {
  font-size: 15px;
}

.telemetry-map-popup-head > div > span {
  color: var(--muted);
  font-size: 11px;
}

.telemetry-map-popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.telemetry-map-popup-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  background: #f4f8fb;
  border-radius: 6px;
}

.telemetry-map-popup-grid > div.wide {
  grid-column: 1 / -1;
}

.telemetry-map-popup-grid span {
  color: var(--muted);
  font-size: 10px;
}

.telemetry-map-popup-grid strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
}

.leaflet-popup-content {
  margin: 13px;
}

.leaflet-tooltip {
  font-family: "Nunito Sans", "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
  border-radius: 7px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-scroll {
  max-height: 50vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.alerts-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
}

.alerts-section-heading h3 {
  margin: 0 0 8px;
}

.alerts-client-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: min(430px, 100%);
}

.alerts-client-filter label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.alerts-client-filter select {
  min-width: 220px;
  padding: 9px 11px;
}

.alerts-client-filter .btn {
  width: auto;
  padding: 9px 13px;
}

.alerts-delay-setting {
  display: grid;
  grid-template-columns: minmax(220px, 300px) auto minmax(280px, 1fr);
  align-items: end;
  gap: 12px;
  margin: 12px 0 4px;
  padding: 14px;
  border: 1px solid #cfe0ed;
  border-radius: 11px;
  background: #f6fbfe;
}

.alerts-delay-setting label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.alerts-delay-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alerts-delay-input input {
  min-width: 0;
}

.alerts-delay-input span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.alerts-delay-setting .btn {
  width: auto;
  white-space: nowrap;
}

.alerts-delay-setting .msg,
.alerts-delay-help {
  margin: 0;
  text-align: left;
}

.alerts-delay-help {
  padding: 10px 0 2px;
}

.contact-device-summary {
  display: inline-block;
  min-width: 118px;
  margin: 0 7px 0 5px;
  color: var(--muted);
  font-size: 11px;
  vertical-align: middle;
}

.alerts-device-dialog {
  width: min(760px, 94vw);
  max-height: 90vh;
  padding: 22px;
  color: var(--text);
  background: #fff;
  border: 1px solid #bcd0df;
  border-radius: 16px;
  box-shadow: 0 18px 55px rgba(16, 54, 80, 0.25);
}

.alerts-device-dialog::backdrop {
  background: rgba(15, 35, 55, 0.48);
}

.alerts-device-dialog-head,
.alerts-device-dialog-actions,
.alerts-device-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.alerts-device-dialog-head {
  align-items: flex-start;
  margin-bottom: 15px;
}

.alerts-device-dialog-head h3,
.alerts-device-dialog-head p {
  margin: 0;
  text-align: left;
}

.alerts-dialog-close {
  width: 36px;
  height: 36px;
  padding: 0;
  color: #52687a;
  background: #f1f6fa;
  border: 1px solid #d6e2eb;
  border-radius: 50%;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.alerts-all-devices,
.alerts-device-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
}

.alerts-all-devices {
  padding: 13px;
  background: #edf7fd;
  border: 1px solid #c9e0ef;
  border-radius: 11px;
}

.alerts-all-devices input,
.alerts-device-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.alerts-all-devices span,
.alerts-device-option span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.alerts-all-devices small,
.alerts-device-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.alerts-device-search {
  display: block;
  margin-top: 14px;
}

.alerts-device-search span {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 800;
}

.alerts-device-selection-head {
  margin: 12px 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.alerts-device-selection-head button {
  padding: 4px 7px;
  color: #1d5f9a;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.alerts-device-selection-head button:disabled {
  color: #9aa8b3;
  cursor: default;
}

.alerts-device-list {
  min-height: 130px;
  max-height: 42vh;
  overflow: auto;
  border: 1px solid #d9e4ec;
  border-radius: 11px;
}

.alerts-device-option {
  padding: 11px 13px;
  border-bottom: 1px solid #e7eef4;
}

.alerts-device-option:last-child {
  border-bottom: 0;
}

.alerts-device-option:hover {
  background: #f7fbfe;
}

.alerts-device-option input:disabled + span {
  opacity: 0.68;
}

.alerts-device-empty {
  padding: 28px 14px;
}

.alerts-device-message {
  min-height: 20px;
  margin: 8px 0 0;
  text-align: left;
}

.alerts-device-error {
  color: #b42318;
}

.alerts-device-dialog-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

.alerts-device-dialog-actions .btn {
  width: auto;
}

.alerts-secondary-button {
  color: #29475d;
  background: #e6eef4;
  box-shadow: none;
}

.alerts-table-scroll {
  margin-top: 8px;
}

.alerts-contacts-scroll {
  min-height: 320px;
  max-height: 62vh;
}

.alerts-invites-scroll {
  min-height: 230px;
  max-height: 48vh;
}

.alerts-deliveries-scroll {
  min-height: 280px;
  max-height: 55vh;
}

.admin-col {
  height: 100%;
  overflow: auto;
  padding: 28px;
}

.admin-col .admin-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  padding-bottom: 12px;
}

code {
  background: #eff6fc;
  border: 1px solid #d8e7f4;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 12px;
}

@media (max-width: 980px) {
  body {
    padding: 14px;
  }

  .shell {
    width: min(100%, 100vw);
    height: auto;
    grid-template-columns: 1fr;
  }

  .workspace-shell {
    width: 100%;
    min-height: 94vh;
  }

  .brand {
    padding: 26px;
  }

  .form {
    padding: 22px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .server-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .serial-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .device-link-grid,
  .device-info-grid,
  .device-edit-form,
  .telemetry-card-grid,
  .telemetry-detail-sections {
    grid-template-columns: 1fr 1fr;
  }

  .telemetry-filter-card {
    align-items: stretch;
    flex-direction: column;
  }

  .telemetry-filters {
    min-width: 0;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .table-scroll {
    max-height: 42vh;
  }

  .admin-col {
    height: auto;
    padding: 20px;
  }

  .telemetry-page-updated {
    left: 3px;
    bottom: 2px;
  }
}

@media (max-width: 620px) {
  .server-stat-grid {
    grid-template-columns: 1fr;
  }

  .serial-form-grid {
    grid-template-columns: 1fr;
  }

  .serial-search {
    align-items: stretch;
    flex-direction: column;
  }

  .device-link-grid,
  .device-info-grid,
  .device-edit-form,
  .telemetry-card-grid,
  .telemetry-detail-sections,
  .telemetry-filters {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .telemetry-section-title,
  .telemetry-detail-head,
  .telemetry-card-head {
    align-items: flex-start;
  }

  .header-logout {
    width: auto;
  }

  .telemetry-summary-grid,
  .telemetry-data-grid {
    grid-template-columns: 1fr;
  }

  .telemetry-file {
    grid-column: auto;
  }

  .tree-children {
    padding-left: 16px;
  }

  .alerts-section-heading,
  .alerts-client-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .alerts-client-filter {
    gap: 5px;
    min-width: 0;
    width: 100%;
  }

  .alerts-client-filter select {
    min-width: 0;
    width: 100%;
  }

  .alerts-delay-setting {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .alerts-delay-setting .btn {
    width: 100%;
  }

  .alerts-device-dialog {
    padding: 15px;
  }

  .alerts-device-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .alerts-device-dialog-actions .btn {
    width: 100%;
  }
}

@media (max-width: 760px) {
  body.telemetry-map-body {
    overflow: auto;
  }

  .telemetry-map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(250px, 36vh) minmax(480px, 64vh);
    height: auto;
    min-height: 100vh;
  }

  .telemetry-map-sidebar {
    border-right: 0;
    border-bottom: 1px solid #d4e0e9;
  }

  .telemetry-map-sidebar-head {
    padding: 10px 14px 8px;
  }

  .telemetry-map-logo {
    width: 84px;
    margin-bottom: 4px;
  }

  .telemetry-map-back {
    margin-bottom: 5px;
  }

  .telemetry-map-sidebar h1 {
    font-size: 17px;
  }

  .telemetry-map-search-wrap {
    padding: 7px 10px 4px;
  }

  .telemetry-map-device-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 8px 7px;
  }

  .telemetry-map-device {
    flex: 0 0 250px;
    margin: 0;
  }

  .telemetry-map-count {
    padding-bottom: 5px;
  }

  .telemetry-map-layer-switch {
    top: 8px;
    left: 10px;
    transform: none;
  }

  .telemetry-map-client-chip {
    top: 8px;
    right: 8px;
    max-width: 170px;
  }
}
