:root {
  --bg-main: linear-gradient(180deg, #1d2635 0%, #243040 100%);
  --bg-panel: #121b2a;
  --bg-panel-strong: #182335;
  --text-main: #edf2f8;
  --text-soft: #97a3b6;
  --border: rgba(163, 177, 198, 0.1);
  --accent: #4b89ff;
  --accent-green: #2bb673;
  --ok: #34d17d;
  --ko: #ff6262;
  --shadow: 0 18px 34px rgba(6, 12, 20, 0.22);
  --sidebar-bg: #111a29;
  --sidebar-border: rgba(255, 255, 255, 0.05);
  --topbar-bg: rgba(18, 27, 42, 0.86);
  --footer-bg: rgba(12, 20, 32, 0.9);
  --chip-bg: rgba(255, 255, 255, 0.03);
  --chip-border: rgba(255, 255, 255, 0.06);
  --hero-card-bg: rgba(36, 50, 73, 0.72);
  --eyebrow: #73b5ff;
  --brand-primary: #1480e5;
  --brand-secondary: #2bb673;
  --brand-neutral: #f8fbff;
  --heartbeat: #5eb6ff;
  --heartbeat-shadow: rgba(76, 174, 255, 0.4);
  --timeline-up: rgba(97, 230, 154, 0.9);
  --timeline-down: rgba(255, 85, 111, 0.9);
  --timeline-flap: rgba(93, 171, 255, 0.92);
  --plant-item-bg: rgba(5, 18, 28, 0.72);
  --plant-item-active: linear-gradient(180deg, rgba(75, 137, 255, 0.18), rgba(30, 40, 60, 0.25));
  --positive-bg: linear-gradient(180deg, rgba(17, 41, 59, 0.72), rgba(16, 33, 48, 0.92));
  --positive-text: #c6f6d5;
}

:root.light-mode {
  --bg-main: radial-gradient(circle at top center, #f5f7f8 0%, #e8eef2 52%, #d5dee5 100%);
  --bg-panel: rgba(244, 247, 249, 0.97);
  --bg-panel-strong: #e7edf1;
  --text-main: #0e2233;
  --text-soft: #3e5a6f;
  --border: rgba(31, 85, 121, 0.18);
  --shadow: 0 18px 44px rgba(31, 55, 77, 0.1);
  --sidebar-bg: linear-gradient(180deg, #d7e0e6 0%, #e9eff3 100%);
  --sidebar-border: rgba(31, 85, 121, 0.12);
  --topbar-bg: linear-gradient(180deg, #f3f6f8 0%, #e7edf1 100%);
  --footer-bg: rgba(241, 245, 248, 0.92);
  --chip-bg: rgba(242, 246, 248, 0.92);
  --chip-border: rgba(31, 85, 121, 0.16);
  --hero-card-bg: rgba(242, 246, 248, 0.88);
  --eyebrow: #2f79bf;
  --brand-primary: #1d74bf;
  --brand-secondary: #2a8f64;
  --brand-neutral: #f2f5f7;
  --heartbeat: #4a90d6;
  --heartbeat-shadow: rgba(74, 144, 214, 0.22);
  --timeline-up: rgba(31, 139, 87, 0.88);
  --timeline-down: rgba(217, 93, 115, 0.88);
  --timeline-flap: rgba(55, 133, 211, 0.9);
  --plant-item-bg: rgba(242, 246, 248, 0.92);
  --plant-item-active: linear-gradient(180deg, rgba(20, 128, 229, 0.16), rgba(243, 247, 249, 0.98));
  --positive-bg: linear-gradient(180deg, rgba(229, 241, 234, 0.98), rgba(239, 246, 242, 0.98));
  --positive-text: #0f7a4b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: var(--app-font-family, "IBM Plex Sans", "Segoe UI", sans-serif);
  font-size: var(--font-size-base, 13px);
  background: var(--bg-main);
}

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

a,
button,
input[type="checkbox"],
select,
summary,
[role="button"] {
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  border-radius: 0;
  padding: 1rem 0.85rem;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 1rem;
  min-height: 100vh;
  box-shadow: none;
}

.sidebar-head {
  display: grid;
  gap: 0.8rem;
}

.nav-home-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: flex-start;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--brand-primary) 76%, var(--text-main));
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-block {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 0.9rem;
  padding: 0.45rem 0.3rem 0.2rem;
  border-radius: 14px;
  border: 0;
  background: transparent;
}

.brand-mark {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--brand-primary) 52%, transparent), color-mix(in srgb, var(--brand-primary) 18%, transparent) 48%, color-mix(in srgb, var(--brand-primary) 4%, transparent) 80%);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 34%, transparent);
}

.orbit {
  position: absolute;
  inset: 14px 5px;
  border: 2px solid color-mix(in srgb, var(--accent) 46%, transparent);
  border-radius: 50%;
}

.orbit-a {
  transform: rotate(22deg);
}

.orbit-b {
  transform: rotate(-38deg);
}

.planet {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.planet-a {
  width: 16px;
  height: 16px;
  right: 10px;
  top: 18px;
  background: var(--brand-neutral);
  box-shadow: 0 0 16px color-mix(in srgb, var(--brand-neutral) 82%, transparent);
}

.planet-b {
  width: 18px;
  height: 18px;
  left: 10px;
  top: 36px;
  background: var(--accent-green);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent-green) 65%, transparent);
}

.planet-c {
  width: 14px;
  height: 14px;
  right: 24px;
  bottom: 12px;
  background: color-mix(in srgb, var(--accent) 80%, transparent);
}

.brand-text h1,
.brand-text p {
  margin: 0;
  line-height: 1;
}

.brand-text h1 {
  font-size: 2.15rem;
  letter-spacing: 0.04em;
  color: var(--brand-primary);
}

.brand-text p {
  margin-top: 0.2rem;
  font-size: 1.55rem;
  color: var(--brand-secondary);
  font-weight: 500;
}

.brand-clock {
  display: grid;
  gap: 0.15rem;
  margin: 0.4rem 0.3rem 0.1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-panel-strong) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 92%, transparent);
}

.brand-clock-label {
  color: var(--text-soft);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-clock strong {
  font-size: 0.98rem;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.brand-clock span {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1;
}

.brand-clock small {
  color: var(--text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-heartbeat {
  padding: 0 0.3rem;
}

.brand-heartbeat svg {
  width: 100%;
  height: 26px;
  overflow: visible;
}

.brand-heartbeat path {
  fill: none;
  stroke: var(--heartbeat);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px var(--heartbeat-shadow));
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
  animation: heartbeatLine 3.2s ease-in-out infinite;
}

@keyframes statusPulse {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 38%, transparent);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px color-mix(in srgb, currentColor 0%, transparent);
  }
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent);
  }
}

.sidebar-shortcuts {
  display: grid;
  gap: 0.5rem;
}

.sidebar-shortcut-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: flex-start;
  background: var(--chip-bg);
  color: var(--text-main);
}

.sidebar-section {
  display: grid;
  align-content: start;
  gap: 0.7rem;
  overflow: hidden;
}

.sidebar-group {
  display: grid;
  gap: 0.6rem;
}

.sidebar-nav-list {
  display: grid;
  gap: 0.35rem;
}

.sidebar-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  color: var(--text-main);
  padding: 0.58rem 0.72rem;
}

.sidebar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.nav-mini {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--brand-primary) 76%, var(--text-main));
}

.nav-mini svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-label {
  margin: 0;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-runtime-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.4rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-runtime-status.is-up {
  color: var(--ok);
}

.sidebar-runtime-status.is-down {
  color: var(--ko);
}

.sidebar-runtime-status.is-warn {
  color: var(--warning, #f59e0b);
}

.sidebar-runtime-icon,
.sidebar-runtime-icon svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.sidebar-runtime-copy {
  line-height: 1.1;
}

.sidebar-list {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  overflow: auto;
}

.content-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.content {
  display: grid;
  padding: 1.25rem;
  min-height: 0;
  min-width: 0;
}

.app-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 38px;
  padding: 0.4rem 1.25rem 0.5rem;
  border-top: 1px solid var(--chip-border);
  background: var(--footer-bg);
}

.app-footer-link,
.app-footer-version {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.app-footer-link {
  justify-self: start;
  text-decoration: none;
  transition: color 0.18s ease;
}

.app-footer-link:hover {
  color: var(--text-main);
}

.app-footer-version {
  justify-self: end;
}

.topbar {
  margin: 0;
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  padding: 0.8rem 1.25rem;
  background: var(--topbar-bg);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  box-shadow: none;
}

.topbar-left,
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.topbar-actions {
  gap: 0.62rem;
}

.topbar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.topbar-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.28rem 0.52rem;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
}

.topbar-stat-label {
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  white-space: nowrap;
}

.topbar-stat strong {
  margin-left: auto;
  font-size: 0.88rem;
  color: var(--text-main);
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: color-mix(in srgb, var(--text-main) 88%, #ffffff);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.topbar-title {
  color: color-mix(in srgb, var(--text-main) 88%, #ffffff);
  font-weight: 600;
}

.topbar-search,
.dashboard-search {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0 0.72rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
}

.topbar-search input,
.dashboard-search input {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
}

.topbar-search-icon {
  color: var(--text-soft);
}

.view-section {
  display: grid;
  gap: 1rem;
  min-height: 0;
  align-content: start;
}

.hidden {
  display: none;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.nested-panel {
  background: var(--bg-panel-strong);
  box-shadow: none;
}

.network-side-column > .panel,
.network-side-column > .side-section-accordion {
  border-radius: 18px;
}

.side-section-accordion {
  padding: 0;
  overflow: hidden;
}

.side-section-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1rem 0.92rem;
  cursor: pointer;
}

.side-section-summary::-webkit-details-marker {
  display: none;
}

.side-section-summary-copy {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.side-section-summary-copy h3 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  font-size: 1rem;
  line-height: 1.22;
}

.side-section-title-icon,
.side-section-title-icon i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: color-mix(in srgb, var(--accent) 78%, white);
  flex: 0 0 auto;
}

.side-section-title-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-section-summary-copy .subtle {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.side-section-chevron,
.side-section-chevron i {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--text-soft);
  flex: 0 0 auto;
}

.side-section-accordion[open] .side-section-chevron {
  transform: rotate(180deg);
}

.side-section-body {
  display: grid;
  gap: 0.85rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
}

.side-section-body .network-visibility-block {
  padding-top: 0;
  border-top: none;
}

.hero-panel,
.section-head,
.details-head,
.hero-actions,
.details-actions,
.form-actions,
.table-actions {
  display: flex;
  gap: 0.75rem;
}

.device-row-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.table-action-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.table-action-icon-btn:hover:not(:disabled) {
  box-shadow: 0 10px 20px rgba(6, 12, 20, 0.18);
}

.table-action-icon-btn-danger {
  border-color: rgba(255, 111, 134, 0.28);
  background: rgba(122, 32, 52, 0.16);
  color: #ffc8d1;
}

.table-action-icon-btn-danger:hover:not(:disabled) {
  background: rgba(122, 32, 52, 0.26);
}

.table-action-icon-glyph,
.table-action-icon-glyph i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.table-action-icon-glyph svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-panel,
.section-head,
.details-head {
  justify-content: space-between;
  align-items: flex-start;
}

.hero-panel > *,
.section-head > *,
.details-head > *,
.users-section-head > *,
.topbar-left {
  min-width: 0;
}

.hero-summary {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.dashboard-strip {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 360px);
  align-items: end;
  align-self: start;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
}

.hero-chart-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 16px;
  background: var(--hero-card-bg);
}

.hero-panel h2,
.panel h2,
.panel h3,
.panel h4 {
  margin: 0;
}

.settings-page-title,
.settings-panel-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
}

.settings-title-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: color-mix(in srgb, var(--accent) 72%, white);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 12%, transparent);
}

.settings-title-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-panel h2 {
  font-size: 1.1rem;
}

.hero-actions-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.hero-action-card {
  display: grid;
  justify-items: start;
  gap: 0.18rem;
  min-height: 78px;
  padding: 0.72rem;
  background: var(--hero-card-bg);
}

.hero-action-card strong,
.hero-action-card small {
  display: block;
}

.hero-action-card small {
  color: var(--text-soft);
  text-align: left;
}

.eyebrow {
  margin: 0 0 0.18rem;
  color: var(--eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 700;
}

.subtle {
  color: var(--text-soft);
  margin: 0.12rem 0 0;
}

.plant-item-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--plant-item-bg);
  overflow: hidden;
}

.plant-item {
  text-align: left;
  width: 100%;
  border-radius: 0;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.plant-item:hover {
  transform: translateY(-2px);
}

.plant-item {
  background: transparent;
  padding: 0.68rem 0.78rem 0.4rem;
  display: block;
}

.plant-item-shell.active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: var(--plant-item-active);
}

.plant-map-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.plant-item-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0 0.78rem 0.66rem;
}

.plant-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.plant-map-btn:hover {
  color: var(--text-main);
  background: transparent;
}

.plant-item-copy {
  display: grid;
  gap: 0;
  min-width: 0;
}

.plant-item-subnet {
  margin: 0;
  min-width: 0;
}

.inline-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  max-width: 100%;
}

.inline-icon-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--text-soft);
}

.inline-icon-shell i {
  width: 15px;
  height: 15px;
}

.inline-icon-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plant-copy-line {
  max-width: 100%;
}

.plant-copy-line .inline-icon-shell {
  color: var(--brand-primary);
}

.plant-copy-subnet .inline-icon-shell {
  color: var(--text-soft);
}

.plant-item-copy strong,
.plant-item-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plant-item-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  min-width: 0;
  padding-right: 0;
  margin-left: auto;
}

.wg-state-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--ko);
  background: currentColor;
}

.wg-state-dot.is-up {
  color: var(--ok);
  animation: statusPulse 1.6s ease-in-out infinite;
}

.wg-state-dot.is-seen {
  color: var(--ok);
  opacity: 0.82;
}

.wg-state-dot.is-down {
  color: var(--ko);
}

.plant-device-counter {
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.plant-device-counter.has-offline .offline-count {
  color: var(--ko);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 156px));
  gap: 0.45rem;
}

.stats-grid-hero {
  justify-content: start;
  align-self: start;
}

.stat-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.42rem 0.55rem;
  min-height: 58px;
}

.stat-card strong {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1;
}

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.stat-dot {
  width: 12px;
  height: 12px;
  display: inline-flex;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.stat-dot-plants {
  background: #f4c542;
}

.stat-dot-devices {
  background: #2a84ff;
}

.stat-dot-offline {
  background: #ff5b6e;
}

.dashboard-donut {
  --donut-chart: conic-gradient(#f4c542 0 33%, #2a84ff 33% 66%, #ff5b6e 66% 100%);
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--donut-chart);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.donut-hole {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-panel);
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--border);
}

.donut-hole strong,
.donut-hole span {
  display: block;
}

.donut-hole strong {
  font-size: 1.35rem;
  line-height: 1;
}

.donut-hole span {
  color: var(--text-soft);
  font-size: 0.74rem;
}

.offline-list {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.offline-legend {
  display: grid;
  gap: 0.38rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.offline-legend-row {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
}

.offline-legend .subtle {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.offline-panel {
  display: grid;
  align-content: start;
  min-height: 0;
}

.maintenance-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.maintenance-dashboard-stat {
  padding: 0.58rem 0.82rem;
  min-height: 46px;
}

.maintenance-dashboard-list {
  display: grid;
  gap: 0.8rem;
}

.maintenance-dashboard-list-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.maintenance-dashboard-list-items {
  display: grid;
  gap: 0.65rem;
}

.maintenance-dashboard-item {
  display: grid;
  gap: 0.38rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--chip-bg) 88%, transparent);
}

.maintenance-dashboard-item-head,
.maintenance-dashboard-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.maintenance-dashboard-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.device-type-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.device-type-filter-btn {
  width: auto;
  min-width: 0;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: none;
}

.device-type-filter-btn .inline-icon-label {
  min-width: 0;
}

.device-type-filter-btn span {
  color: inherit;
  opacity: 0.78;
}

.device-type-filter-btn.active {
  color: #edf5ff;
  border-color: rgba(108, 154, 212, 0.3);
  background: linear-gradient(120deg, rgba(66, 109, 178, 0.86), rgba(107, 149, 214, 0.86));
}

.network-device-filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.network-device-filters .device-type-filter-bar {
  margin-bottom: 0;
  flex: 1 1 360px;
}

.network-device-type-select-wrap {
  display: grid;
  gap: 0.35rem;
  width: min(100%, 320px);
}

.network-device-type-select-wrap.is-inline {
  flex: 0 0 260px;
}

.network-device-type-select-wrap .subtle {
  margin: 0;
}

.network-device-type-select-wrap select {
  width: 100%;
}

.offline-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(255, 111, 134, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(58, 21, 31, 0.4), rgba(24, 33, 45, 0.96));
  box-shadow: inset 0 0 0 1px rgba(255, 111, 134, 0.06);
}

.offline-main {
  display: grid;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.history-block {
  display: grid;
  gap: 0.2rem;
  width: fit-content;
  max-width: 100%;
}

.history-bar {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  margin-top: 0.2rem;
}

.history-scale {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.2rem;
  width: 100%;
}

.history-scale small {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.timeline-legend-line {
  display: inline-flex;
  width: 18px;
  height: 4px;
  border-radius: 999px;
  margin-inline: 0.1rem;
  background: var(--timeline-flap);
}

.timeline-legend-flap {
  box-shadow: 0 0 0 1px rgba(93, 171, 255, 0.15);
}

.history-segment {
  width: 8px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.history-up {
  background: #61e69a;
}

.history-down {
  background: #ff556f;
}

.device-uptime-timeline {
  display: grid;
  gap: 0.24rem;
  width: min(100%, 640px);
  margin-top: 0.35rem;
}

.device-uptime-timeline.is-compact {
  width: min(100%, 440px);
  margin-top: 0.45rem;
}

.device-uptime-timeline.is-row {
  width: 100%;
  max-width: none;
  margin-top: 0;
}

.device-uptime-track {
  position: relative;
  padding-top: 1.1rem;
}

.device-uptime-timeline.is-plain .device-uptime-track {
  padding-top: 0;
}

.device-uptime-line {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--timeline-up) 0%, var(--timeline-up) 100%);
  opacity: 0.9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.device-uptime-event {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.12rem;
  pointer-events: none;
}

.device-uptime-event-label {
  color: var(--text-soft);
  font-size: 0.68rem;
  line-height: 1;
  white-space: nowrap;
}

.device-uptime-event-label.is-hidden {
  display: none;
}

.device-uptime-event-tick {
  width: 2px;
  height: 12px;
  border-radius: 999px;
  background: var(--timeline-event-color, var(--timeline-up));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.device-uptime-scale {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.device-uptime-scale small {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.offline-item p,
.offline-meta small,
.device-subtle {
  margin: 0.22rem 0 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.device-timeline-row td {
  padding-top: 0;
}

.device-timeline-spacer {
  width: 1%;
}

.device-timeline-cell {
  padding-top: 0;
  padding-bottom: 1rem;
}

.device-main-row td {
  padding-bottom: 0.32rem;
}

.device-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  width: fit-content;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 600;
}

.device-type-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.device-type-badge[data-device-type="router"] {
  border-color: rgba(103, 138, 255, 0.32);
  background: rgba(103, 138, 255, 0.1);
  color: #dce5ff;
}

.device-type-badge[data-device-type="controller"] {
  border-color: rgba(178, 143, 255, 0.3);
  background: rgba(178, 143, 255, 0.1);
  color: #efe2ff;
}

.device-type-badge[data-device-type="nas"] {
  border-color: rgba(126, 204, 255, 0.28);
  background: rgba(126, 204, 255, 0.1);
  color: #e2f5ff;
}

.device-type-badge[data-device-type="server"] {
  border-color: rgba(124, 224, 184, 0.28);
  background: rgba(124, 224, 184, 0.1);
  color: #ddfff0;
}

.device-type-badge[data-device-type="switch"] {
  border-color: rgba(107, 214, 189, 0.3);
  background: rgba(107, 214, 189, 0.1);
  color: #d7fff8;
}

.device-type-badge[data-device-type="ip_camera"] {
  border-color: rgba(255, 136, 154, 0.28);
  background: rgba(255, 136, 154, 0.1);
  color: #ffe1e7;
}

.device-type-badge[data-device-type="nvr"] {
  border-color: rgba(252, 192, 108, 0.28);
  background: rgba(252, 192, 108, 0.1);
  color: #ffe9c0;
}

.device-type-badge[data-device-type="cpe"] {
  border-color: rgba(134, 188, 255, 0.28);
  background: rgba(134, 188, 255, 0.1);
  color: #e0f0ff;
}

.device-type-badge[data-device-type="altro"] {
  border-color: rgba(168, 181, 199, 0.24);
  background: rgba(168, 181, 199, 0.08);
  color: #e7edf6;
}

.offline-meta {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
  text-align: right;
}

.offline-variations {
  display: grid;
  gap: 0.16rem;
  margin-top: 0.35rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 1rem;
}

.settings-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.settings-stack {
  display: grid;
  gap: 1rem;
}

.settings-panel-wide,
.settings-panel-compact {
  display: grid;
  gap: 0.85rem;
}

#fixed-settings-form {
  gap: 0.9rem;
}

.fixed-settings-grid {
  align-items: start;
}

.cards-grid-2 {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.network-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.39fr) minmax(280px, 0.61fr);
  gap: 1rem;
}

.network-layout.network-layout-single {
  grid-template-columns: 1fr;
}

.network-live-summary {
  display: inline-flex;
  align-items: stretch;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.network-summary-chip {
  display: grid;
  gap: 0.2rem;
  min-width: 136px;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.network-summary-chip.is-up {
  border-color: color-mix(in srgb, var(--ok) 24%, var(--border));
}

.network-summary-chip.is-down {
  border-color: color-mix(in srgb, var(--ko) 24%, var(--border));
}

.network-summary-label {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.network-summary-value {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-main);
  font-weight: 600;
}

.devices-column,
.network-side-column {
  display: grid;
  gap: 0.9rem;
  align-content: start;
  min-width: 0;
}

.form-panel {
  max-width: 680px;
}

.add-network-stage {
  align-content: start;
  justify-items: center;
  padding-top: clamp(0.5rem, 5vh, 2.4rem);
}

.add-network-stage .section-head,
.add-network-stage .form-panel {
  width: min(760px, 100%);
}

.add-network-stage .section-head {
  justify-content: flex-start;
}

.add-network-stage .form-panel {
  margin: 0 auto;
}

.panel-details {
  display: grid;
  gap: 1rem;
}

.network-sticky-head {
  position: sticky;
  top: -0.05rem;
  z-index: 5;
  padding-bottom: 0.9rem;
  margin-bottom: -0.1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-panel) 96%, transparent) 0%, color-mix(in srgb, var(--bg-panel) 94%, transparent) 82%, transparent 100%);
  backdrop-filter: blur(8px);
}

.devices-table-shell {
  overflow: visible;
  max-height: none;
}

form {
  display: grid;
  gap: 0.75rem;
}

.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.75rem;
}

.compact-form-grid-compact {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 0.6rem;
}

.field-span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  min-width: 0;
}

.toggle-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
  padding: 0.62rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(16, 23, 33, 0.78);
}

.toggle-card input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.settings-section {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-panel-strong) 84%, transparent);
}

.dynamic-settings-split {
  align-items: start;
}

.dynamic-settings-split .settings-section {
  height: 100%;
}

.appearance-designer {
  display: grid;
  gap: 0.9rem;
}

.appearance-designer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.appearance-designer-copy {
  margin: 0.28rem 0 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.55;
  max-width: 54ch;
}

.appearance-designer-actions {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.appearance-preview-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 18%, transparent), transparent 44%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg-panel-strong) 88%, transparent), color-mix(in srgb, var(--bg-panel) 96%, transparent));
  box-shadow: 0 18px 36px rgba(5, 12, 22, 0.16);
}

.appearance-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.appearance-preview-head strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-main);
  font-size: 1rem;
}

.appearance-preview-head p {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.appearance-preview-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.appearance-preview-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 32px;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 700;
}

.appearance-preview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.appearance-preview-stat {
  display: grid;
  gap: 0.22rem;
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  background: color-mix(in srgb, var(--bg-panel) 88%, transparent);
}

.appearance-preview-stat strong {
  color: var(--text-main);
  font-size: 1rem;
}

.appearance-preview-stat span {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.appearance-preview-stat.is-alert strong {
  color: var(--ko);
}

.appearance-preview-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.appearance-preview-primary,
.appearance-preview-secondary {
  min-height: 38px;
  padding: 0.62rem 0.95rem;
  border-radius: 12px;
  font: inherit;
  cursor: default;
}

.appearance-preview-primary {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  color: #ffffff;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 82%, #1f4d9f), color-mix(in srgb, var(--accent) 100%, #87bcff));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 26%, transparent);
}

.appearance-preview-secondary {
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  color: var(--text-main);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.appearance-preview-footer {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.appearance-preview-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.35rem 0.68rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  background: color-mix(in srgb, var(--bg-panel) 90%, transparent);
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

.appearance-preview-pill[data-tone="text"] {
  color: var(--text-main);
}

.appearance-preview-pill[data-tone="accent"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.appearance-control-grid {
  align-items: start;
}

.appearance-font-size-field {
  gap: 0.5rem;
}

.appearance-font-size-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
}

.appearance-font-size-shell input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.appearance-font-size-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 40px;
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text-main);
  font-weight: 700;
}

.appearance-color-field {
  display: grid;
  gap: 0.45rem;
}

.appearance-color-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.appearance-color-input {
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.appearance-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.appearance-color-input::-webkit-color-swatch {
  border: 2px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 16px;
}

.appearance-color-input::-moz-color-swatch {
  border: 2px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 16px;
}

.appearance-color-code {
  width: 100%;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.appearance-quick-preset-box {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.network-visibility-block {
  display: grid;
  gap: 0.8rem;
  padding-top: 0.9rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
}

.network-visibility-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.network-visibility-head .subtle {
  margin: 0.22rem 0 0;
}

.network-visibility-list {
  display: grid;
  gap: 0.6rem;
}

.network-visibility-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
}

.visibility-add-btn,
.visibility-remove-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}

.visibility-add-btn .action-icon,
.visibility-remove-btn .action-icon {
  width: 16px;
  height: 16px;
  background: transparent;
}

.visibility-add-btn .action-icon svg,
.visibility-remove-btn .action-icon svg {
  width: 14px;
  height: 14px;
}

.visibility-user-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.72rem 0.8rem;
}

.visibility-user-card.is-inactive {
  opacity: 0.74;
}

.visibility-user-copy {
  display: grid;
  min-width: 0;
}

.visibility-user-copy strong {
  color: var(--text-main);
  font-size: 0.9rem;
}

.visibility-user-copy small {
  color: var(--text-soft);
  white-space: normal;
  overflow-wrap: anywhere;
}

.visibility-user-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.network-visibility-empty {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-soft);
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.02);
}

.station-editor-section {
  gap: 0.95rem;
}

.station-editor-head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0.85rem;
}

.station-editor-head > div:first-child {
  min-width: 0;
}

.station-editor-head .subtle {
  margin: 0.24rem 0 0;
  max-width: 72ch;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.station-editor-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: stretch;
  gap: 0.6rem;
  width: 100%;
}

.station-editor-actions-bottom {
  margin-top: 0.2rem;
}

.station-editor-actions .compact-btn {
  font-size: 0.82rem;
  padding: 0.52rem 0.74rem;
  min-height: 38px;
  width: 100%;
  justify-content: center;
}

.station-editor-actions .compact-btn span:last-child {
  white-space: nowrap;
}

.station-editor-body {
  gap: 0.8rem;
}

.station-editor-body .settings-section-title {
  margin: 0;
}

.network-side-column #device-form,
.network-side-column .network-visibility-block {
  display: grid;
  gap: 0.85rem;
}

.network-side-column #device-form > button,
.network-side-column #save-network-visibility-btn {
  width: 100%;
  justify-content: center;
}

.station-editor-list {
  display: grid;
  gap: 0.85rem;
}

.station-card {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  background: color-mix(in srgb, var(--bg-panel-strong) 92%, transparent);
}

.station-accordion {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.station-accordion-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 1rem;
  margin: 0;
}

.station-accordion-summary::-webkit-details-marker {
  display: none;
}

.station-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.station-card-summary-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.station-accordion-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.station-card-head strong {
  color: var(--text-main);
  font-size: 0.96rem;
}

.station-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.38rem;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.station-accordion-chevron,
.station-accordion-chevron i {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--text-soft);
  flex: 0 0 auto;
}

.station-summary-maintenance-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  background: color-mix(in srgb, var(--chip-bg) 88%, transparent);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, background 160ms ease;
}

.station-summary-maintenance-btn:hover,
.station-summary-maintenance-btn:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  color: var(--text-main);
  background: color-mix(in srgb, var(--accent) 12%, var(--chip-bg));
  transform: translateY(-1px);
}

.maintenance-tools-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.02rem;
  color: currentColor;
}

.maintenance-tools-icon i {
  display: inline-flex;
  width: 13px;
  height: 13px;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.maintenance-tools-icon i:first-child {
  transform: translate(1px, -1px) rotate(-8deg);
}

.maintenance-tools-icon i:last-child {
  transform: translate(-1px, 1px) rotate(8deg);
}

.maintenance-tools-icon svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.station-accordion[open] .station-accordion-chevron {
  transform: rotate(180deg);
}

.station-accordion-body {
  display: grid;
  gap: 0.8rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
}

.station-accordion-body .compact-form-grid {
  grid-template-columns: minmax(0, 1fr);
}

.station-accordion-body input,
.station-accordion-body select,
.station-accordion-body textarea {
  width: 100%;
  min-width: 0;
}

.station-textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

.station-textarea-sm {
  min-height: 70px;
}

.station-device-breakdown {
  display: grid;
  gap: 0.34rem;
  margin-top: 0.55rem;
}

.station-device-line {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.42rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.station-device-line strong {
  color: var(--text-main);
}

.station-device-line-icon,
.station-device-line-icon i {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 0.08rem;
}

.station-device-line.is-online .station-device-line-icon {
  color: var(--ok);
}

.station-device-line.is-offline .station-device-line-icon {
  color: var(--ko);
}

.station-card-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.station-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  min-height: 34px;
  padding: 0.34rem 0.64rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
}

.station-status-badge .station-status-icon,
.station-status-icon i {
  display: inline-flex;
  width: 14px;
  height: 14px;
}

.station-status-badge.is-up {
  border-color: color-mix(in srgb, var(--ok) 24%, var(--border));
  color: var(--ok);
}

.station-status-badge.is-partial {
  border-color: rgba(245, 166, 35, 0.26);
  color: #f5b24e;
}

.station-status-badge.is-down {
  border-color: color-mix(in srgb, var(--ko) 24%, var(--border));
  color: var(--ko);
}

.station-status-badge.is-empty {
  color: var(--text-soft);
}

.station-maintenance-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 600;
}

.station-maintenance-chip.is-open {
  border-color: rgba(245, 166, 35, 0.28);
  color: #f5b24e;
}

.station-maintenance-section {
  display: grid;
  gap: 0.8rem;
  padding-top: 0.2rem;
}

.station-maintenance-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.station-maintenance-head h4 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.24;
}

.station-maintenance-head .subtle {
  margin: 0.32rem 0 0;
  line-height: 1.45;
}

.station-maintenance-summary,
.station-maintenance-toolbar {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

.station-maintenance-toolbar .subtle {
  margin: 0;
}

.station-maintenance-composer {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--bg-panel-strong) 72%, transparent);
}

.station-maintenance-list {
  display: grid;
  gap: 0.7rem;
}

.station-maintenance-item {
  display: grid;
  gap: 0.38rem;
  padding: 0.82rem 0.9rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  background: color-mix(in srgb, var(--chip-bg) 82%, transparent);
}

.station-maintenance-item-head,
.station-maintenance-item-meta,
.station-maintenance-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.station-maintenance-item-copy {
  display: grid;
  gap: 0.1rem;
}

.station-maintenance-item-copy span,
.station-maintenance-item-meta span,
.station-maintenance-item p {
  color: var(--text-soft);
  font-size: 0.82rem;
  margin: 0;
}

.station-maintenance-item p.is-outcome {
  color: var(--text-main);
}

.maintenance-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.22rem 0.58rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 700;
}

.maintenance-status-badge.is-planned {
  border-color: rgba(245, 166, 35, 0.28);
  color: #f5b24e;
}

.maintenance-status-badge.is-in_progress {
  border-color: rgba(91, 171, 255, 0.28);
  color: #5babff;
}

.maintenance-status-badge.is-done {
  border-color: color-mix(in srgb, var(--ok) 28%, var(--border));
  color: var(--ok);
}

.maintenance-status-badge.is-cancelled {
  color: var(--text-soft);
}

.station-maintenance-empty {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-soft);
  font-size: 0.82rem;
}

.device-dialog.station-maintenance-dialog {
  width: min(calc(100vw - 0.5rem), 1910px);
  max-width: calc(100vw - 0.5rem);
  height: min(calc(100vh - 0.5rem), 980px);
  max-height: calc(100vh - 0.5rem);
}

.device-dialog.device-status-history-dialog {
  width: min(calc(100vw - 1rem), 1180px);
  max-width: calc(100vw - 1rem);
  height: min(calc(100vh - 1rem), 880px);
  max-height: calc(100vh - 1rem);
}

.station-maintenance-dialog {
  padding: 1rem;
  overflow: hidden;
  margin: auto;
}

.station-maintenance-dialog .dialog-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0.2rem 0.28rem 0.12rem;
  align-items: start;
}

.station-maintenance-dialog .dialog-head .eyebrow,
.station-maintenance-dialog .dialog-head h3,
.station-maintenance-dialog .dialog-head .subtle {
  overflow-wrap: anywhere;
}

.station-maintenance-dialog .dialog-head .eyebrow {
  margin: 0 0 0.38rem;
  line-height: 1.2;
  padding-left: 0.04rem;
}

.station-maintenance-dialog .dialog-head h3 {
  margin: 0;
  line-height: 1.22;
  padding-left: 0.04rem;
}

.station-maintenance-dialog .dialog-head .subtle {
  margin: 0.58rem 0 0;
  line-height: 1.45;
  padding-left: 0.04rem;
}

.station-maintenance-dialog-body {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  min-height: 0;
  height: calc(100% - 6rem);
  overflow: auto;
  padding: 0 0.18rem 0.12rem;
}

.station-maintenance-dialog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.station-maintenance-dialog-panel {
  display: grid;
  gap: 0.95rem;
  padding: 1.15rem 1.2rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  background: color-mix(in srgb, var(--bg-panel-strong) 72%, transparent);
}

.station-maintenance-dialog-panel.is-history {
  min-width: 0;
}

.station-maintenance-dialog-panel.is-history .station-maintenance-table-wrap {
  max-height: min(66vh, 720px);
}

.station-maintenance-dialog-panel.is-form {
  justify-items: start;
}

.station-maintenance-dialog-panel.is-form .station-maintenance-composer,
.station-maintenance-dialog-panel.is-form .station-maintenance-toolbar {
  width: min(100%, 680px);
}

.station-maintenance-dialog-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.station-maintenance-dialog-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

.station-maintenance-dialog-meta .subtle {
  margin: 0;
  line-height: 1.45;
}

.station-maintenance-table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  background: rgba(255, 255, 255, 0.02);
}

.station-maintenance-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.station-maintenance-table th,
.station-maintenance-table td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 8%, var(--border));
  vertical-align: top;
  text-align: left;
}

.station-maintenance-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent);
  color: var(--text-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.station-maintenance-table tbody tr:last-child td {
  border-bottom: 0;
}

.station-maintenance-table-copy {
  display: grid;
  gap: 0.22rem;
}

.station-maintenance-table-copy strong {
  font-size: 0.88rem;
}

.station-maintenance-table-copy span,
.station-maintenance-table td small {
  color: var(--text-soft);
}

.station-maintenance-table-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.device-status-history-dialog {
  padding: 1rem;
  overflow: hidden;
  margin: auto;
}

.device-status-history-dialog .dialog-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0.2rem 0.28rem 0.12rem;
  align-items: start;
}

.device-status-history-dialog .dialog-head .eyebrow,
.device-status-history-dialog .dialog-head h3,
.device-status-history-dialog .dialog-head .subtle {
  overflow-wrap: anywhere;
}

.device-status-history-dialog .dialog-head .eyebrow {
  margin: 0 0 0.38rem;
  line-height: 1.2;
  padding-left: 0.04rem;
}

.device-status-history-dialog .dialog-head h3 {
  margin: 0;
  line-height: 1.22;
  padding-left: 0.04rem;
}

.device-status-history-dialog .dialog-head .subtle {
  margin: 0.58rem 0 0;
  line-height: 1.45;
  padding-left: 0.04rem;
}

.device-status-history-dialog-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.device-status-history-dialog-body {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  min-height: 0;
  height: calc(100% - 6rem);
  overflow: auto;
  padding: 0 0.18rem 0.12rem;
}

.device-status-history-layout {
  display: grid;
  gap: 0.95rem;
  align-items: start;
}

.device-status-history-panel {
  display: grid;
  gap: 0.95rem;
  padding: 1.15rem 1.2rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  background: color-mix(in srgb, var(--bg-panel-strong) 72%, transparent);
}

.device-status-history-summary-head,
.device-status-history-list-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.device-status-history-summary-head h4,
.device-status-history-list-head h4 {
  margin: 0;
}

.device-status-history-summary-head .subtle,
.device-status-history-list-head .subtle {
  margin: 0.2rem 0 0;
}

.device-status-history-summary-hero {
  display: grid;
  gap: 0.9rem;
}

.device-status-history-device-name .inline-icon-text {
  font-size: 1.02rem;
  font-weight: 600;
}

.device-status-history-summary-badges,
.device-status-history-summary-chips {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.device-status-history-chip,
.device-status-history-flag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.79rem;
  font-weight: 600;
}

.device-status-history-flag {
  border-color: color-mix(in srgb, var(--timeline-flap) 32%, var(--border));
  color: var(--timeline-flap);
  background: color-mix(in srgb, var(--timeline-flap) 16%, transparent);
}

.device-status-history-list {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.device-status-history-item,
.device-status-history-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.95rem;
  align-items: start;
  padding: 0.9rem 0.95rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  background: rgba(255, 255, 255, 0.025);
}

.device-status-history-empty {
  grid-template-columns: minmax(0, 1fr);
  color: var(--text-soft);
}

.device-status-history-item.is-flapping {
  border-color: color-mix(in srgb, var(--timeline-flap) 34%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--timeline-flap) 14%, transparent);
}

.device-status-history-item-copy {
  display: grid;
  min-width: 0;
}

.device-status-history-item-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

.device-status-history-item-datetime {
  margin: 0;
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: right;
}

.device-status-history-item-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.device-status-history-item-time {
  color: var(--text-main);
  font-size: 1.08rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
  align-self: center;
}

.network-map-dialog {
  --network-map-sidebar-width: 360px;
  --network-map-canvas-width: min(100%, 1600px);
  --network-map-canvas-height: 100%;
  width: min(calc(100vw - 0.5rem), 1910px);
  max-width: calc(100vw - 0.5rem);
  height: min(calc(100vh - 0.5rem), 980px);
  max-height: calc(100vh - 0.5rem);
  padding: 0.85rem;
  overflow: hidden;
  margin: auto;
}

.network-map-layout {
  display: grid;
  grid-template-columns: var(--network-map-sidebar-width) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: stretch;
  min-height: 0;
  height: calc(100% - 4.9rem);
  margin-top: 0.55rem;
}

.network-map-sidebar {
  display: grid;
  align-content: start;
  gap: 0.42rem;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 0.08rem;
}

.network-map-toolbar {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  padding: 0 0.06rem 0.12rem;
}

.network-map-toolbar .compact-btn {
  min-height: 32px;
  padding: 0.4rem 0.62rem;
  font-size: 0.76rem;
}

.network-map-add-station-form {
  display: grid;
  gap: 0.42rem;
  padding: 0.7rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  background: rgba(255, 255, 255, 0.03);
}

.network-map-add-station-field {
  display: grid;
  gap: 0.32rem;
}

.network-map-add-station-field input {
  min-width: 0;
}

.network-map-add-station-actions {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.network-map-add-station-actions .compact-btn {
  min-height: 34px;
}

.network-map-stations {
  display: grid;
  gap: 0.38rem;
  align-content: start;
}

.network-map-station-devices-panel {
  display: grid;
  gap: 0.72rem;
  padding: 0.82rem;
  border-radius: 14px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  background: color-mix(in srgb, var(--bg-panel-strong) 58%, transparent);
}

.network-map-station-devices-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.network-map-station-devices-head strong {
  color: var(--text-main);
  font-size: 0.92rem;
}

.network-map-station-devices-head .subtle {
  margin: 0.18rem 0 0;
  font-size: 0.79rem;
}

.network-map-device-list {
  display: grid;
  gap: 0.55rem;
}

.network-map-device-item {
  display: grid;
  gap: 0.42rem;
  padding: 0.72rem 0.76rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  background: rgba(255, 255, 255, 0.02);
}

.network-map-device-head,
.network-map-device-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.network-map-device-copy {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
}

.network-map-device-copy strong {
  color: var(--text-main);
  font-size: 0.86rem;
}

.network-map-device-copy span,
.network-map-device-meta span,
.network-map-station-devices-empty {
  color: var(--text-soft);
  font-size: 0.77rem;
}

.network-map-station-devices-empty {
  padding: 0.78rem 0.82rem;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.network-map-station-card {
  position: relative;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  background: color-mix(in srgb, var(--bg-panel-strong) 74%, transparent);
  overflow: hidden;
}

.network-map-station-body {
  padding: 0 0.58rem 0.58rem;
}

.network-map-station-actions {
  position: absolute;
  top: 0.52rem;
  right: 0.54rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.34rem;
}

.network-map-station-lock {
  position: static;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(31, 85, 121, 0.16);
  background: color-mix(in srgb, var(--chip-bg) 88%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.network-map-station-lock:hover:not(:disabled) {
  transform: translateY(-1px);
}

.network-map-station-lock.is-locked {
  color: #ffe09b;
}

.network-map-station-lock.is-unlocked {
  color: #d6f7eb;
}

.network-map-station-lock:disabled {
  cursor: default;
  opacity: 0.92;
}

.network-map-station-lock-icon,
.network-map-station-lock-icon i {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

.network-map-station-lock-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.network-map-station-maintenance-alert {
  position: static;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(31, 85, 121, 0.16);
  background: color-mix(in srgb, var(--chip-bg) 88%, transparent);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.network-map-station-maintenance-alert:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  color: var(--text-main);
  background: color-mix(in srgb, var(--accent) 12%, var(--chip-bg));
  box-shadow: 0 10px 18px rgba(31, 55, 77, 0.12);
}

.network-map-station-maintenance-alert.has-open-items {
  border-color: rgba(245, 184, 88, 0.28);
  background: linear-gradient(180deg, rgba(103, 74, 24, 0.3), rgba(76, 54, 14, 0.26));
  color: #ffd993;
}

.network-map-station-maintenance-alert.has-open-items:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(122, 88, 28, 0.38), rgba(88, 63, 17, 0.34));
  box-shadow: 0 10px 18px rgba(63, 42, 8, 0.18);
}

.network-map-station-maintenance-alert .maintenance-tools-icon i {
  width: 12px;
  height: 12px;
}

.network-map-station-maintenance-alert .maintenance-tools-icon svg {
  width: 12px;
  height: 12px;
}

.network-map-station-item {
  width: 100%;
  padding: 0.58rem 4.1rem 0.58rem 0.72rem;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  display: grid;
  gap: 0.18rem;
  box-shadow: none;
  min-width: 0;
  align-content: start;
  position: relative;
}

.network-map-station-card.has-maintenance-alert .network-map-station-item {
  padding-right: 6.8rem;
}

.network-map-station-headline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
}

.network-map-station-item.active {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-panel-strong));
}

.network-map-station-item strong,
.network-map-station-item .station-count-line,
.network-map-station-item .station-count-line span {
  display: block;
  overflow-wrap: anywhere;
}

.network-map-station-item strong {
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.18;
}

.network-map-station-item span {
  color: var(--text-soft);
  font-size: 0.74rem;
  line-height: 1.2;
}

.station-count-line {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  width: fit-content;
  min-height: 22px;
  padding: 0;
  border: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
}

.station-count-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.station-count-line.is-online {
  color: var(--ok);
}

.station-count-line.is-partial {
  color: #f5b24e;
}

.station-count-line.is-offline {
  color: var(--ko);
}

.station-count-line.is-empty {
  color: var(--text-soft);
}

.station-count-line.is-online span {
  color: var(--ok);
}

.station-count-line.is-partial span {
  color: #f5b24e;
}

.station-count-line.is-offline span {
  color: var(--ko);
}

.station-count-line.is-empty span {
  color: var(--text-soft);
}

.network-map-stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.network-map-canvas {
  position: relative;
  width: min(100%, var(--network-map-canvas-width));
  height: var(--network-map-canvas-height);
  min-height: 0;
  max-width: 100%;
  max-height: none;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: #dbe5ed;
  box-shadow: 0 18px 44px rgba(7, 11, 19, 0.24);
}

.network-map-canvas .leaflet-container {
  width: 100%;
  height: 100%;
  background: #dbe5ed;
  font: inherit;
}

.network-map-canvas .leaflet-tile-pane,
.network-map-canvas .leaflet-marker-pane,
.network-map-canvas .leaflet-shadow-pane,
.network-map-canvas .leaflet-overlay-pane {
  will-change: auto;
}

.network-map-canvas .leaflet-container img,
.network-map-canvas .leaflet-tile,
.network-map-canvas .leaflet-marker-icon,
.network-map-canvas .leaflet-marker-shadow {
  max-width: none !important;
  max-height: none !important;
}

.network-map-canvas .leaflet-tile {
  visibility: visible !important;
}

.network-map-canvas.is-unavailable {
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background:
    radial-gradient(circle at top, rgba(91, 173, 255, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(20, 27, 40, 0.96), rgba(13, 18, 29, 0.98));
}

.network-map-unavailable {
  display: grid;
  gap: 0.45rem;
  max-width: 32rem;
  text-align: center;
  color: var(--text);
}

.network-map-unavailable strong {
  font-size: 1rem;
}

.network-map-unavailable span {
  color: var(--text-soft);
  line-height: 1.5;
}

.network-map-tile-warning {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 420;
  padding: 0.72rem 0.9rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 42%, var(--border));
  background: rgba(16, 24, 38, 0.88);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(4, 8, 15, 0.28);
  backdrop-filter: blur(10px);
  font-size: 0.84rem;
  line-height: 1.4;
  pointer-events: none;
}

.network-map-dialog .dialog-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  padding: 0.08rem 0.2rem 0 0.2rem;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-panel);
}

.network-map-dialog .dialog-head .eyebrow,
.network-map-dialog .dialog-head h3,
.network-map-dialog .dialog-head .subtle {
  overflow-wrap: anywhere;
}

.network-map-dialog .dialog-head .eyebrow {
  margin-bottom: 0.32rem;
  padding-left: 0.06rem;
}

.network-map-dialog .dialog-head h3 {
  margin: 0;
  line-height: 1.22;
  padding-left: 0.06rem;
}

.network-map-dialog .dialog-head .subtle {
  margin: 0.55rem 0 0;
  max-width: 74ch;
  line-height: 1.45;
  padding-left: 0.06rem;
  white-space: nowrap;
}

.network-map-head-actions {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.network-map-head-actions .compact-btn {
  min-height: 36px;
  padding: 0.46rem 0.66rem;
  font-size: 0.8rem;
}

.station-marker-wrapper {
  background: transparent;
  border: none;
}

.station-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(7, 11, 19, 0.26);
  font-size: 0.76rem;
  font-weight: 700;
  color: #f6fbff;
  background: #57738f;
  white-space: nowrap;
}

.station-marker.is-up {
  background: #178b57;
}

.station-marker.is-partial {
  background: #d48a1a;
}

.station-marker.is-down {
  background: #c84646;
}

.station-marker.is-empty {
  background: #57738f;
}

.station-marker.is-selected {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 14px 26px rgba(7, 11, 19, 0.34);
}

.station-marker-pin,
.station-marker-pin i {
  display: inline-flex;
  width: 14px;
  height: 14px;
}

.station-marker-pin svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.station-marker-label {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-station-line .inline-icon-shell {
  color: var(--accent);
}

.scroll-top-btn {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent);
  color: var(--text-main);
  box-shadow: 0 18px 38px rgba(6, 10, 16, 0.28);
  z-index: 40;
}

.scroll-top-btn:hover {
  transform: translateY(-2px);
}

.settings-section-title {
  margin: 0;
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ec7ff;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.settings-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 1rem;
}

.settings-actions-inline {
  display: flex;
  justify-content: flex-end;
}

.settings-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 1rem;
  align-items: stretch;
}

.settings-ops-section {
  gap: 0.9rem;
  height: 100%;
}

.settings-ops-stack {
  display: grid;
  gap: 0.95rem;
  height: 100%;
}

.settings-ops-item {
  display: grid;
  gap: 0.75rem;
}

.settings-ops-copy {
  display: grid;
  gap: 0.35rem;
}

.settings-ops-copy strong {
  color: var(--text-main);
  font-size: 0.96rem;
}

.settings-ops-copy p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.55;
}

.settings-ops-divider {
  height: 1px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--border));
}

.settings-guide-panel {
  display: grid;
  gap: 0.9rem;
}

.settings-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 1rem;
}

.settings-guide-column {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.15rem 0;
}

.settings-guide-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.48rem;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.settings-guide-list li {
  overflow-wrap: anywhere;
}

.settings-guide-list strong,
.settings-guide-list code {
  color: var(--text-main);
}

.settings-guide-list a {
  color: var(--accent);
  text-decoration: none;
}

.settings-guide-list a:hover {
  text-decoration: underline;
}

.settings-guide-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 0.8rem;
  padding-top: 0.2rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
}

.settings-guide-footnote {
  display: grid;
  gap: 0.32rem;
  padding: 0.72rem 0.85rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  min-width: 0;
}

.settings-guide-footnote strong {
  color: var(--text-main);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-guide-footnote span {
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.settings-guide-footnote code {
  color: var(--text-main);
}

.field-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.field-help {
  margin-top: -0.04rem;
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.field-help code {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.08rem 0.32rem;
  border-radius: 6px;
}

.settings-inline-note {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

.settings-inline-note strong {
  color: var(--text-main);
}

.settings-time-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.settings-time-box-copy {
  display: grid;
  gap: 0.24rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 16%, transparent),
    color-mix(in srgb, var(--bg-panel-strong) 72%, transparent)
  );
}

.settings-time-box-copy strong {
  color: var(--text-main);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-time-box-copy span {
  color: var(--brand-primary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.backup-restore-note {
  margin-top: 0.05rem;
}

.field-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #8ec7ff;
  font-size: 0.78rem;
}

.field-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input,
select,
textarea,
button {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(57, 70, 92, 0.88);
  color: var(--text-main);
  padding: 0.62rem 0.72rem;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 220px;
}

button {
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--accent) 80%, #315dbf),
    color-mix(in srgb, var(--accent) 100%, #79a7ff)
  );
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(39, 92, 173, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease,
    background 0.18s ease, color 0.18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(39, 92, 173, 0.22);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.plant-actions-row {
  flex-wrap: wrap;
  gap: 0.58rem;
}

.plant-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  min-width: 0;
  padding: 0.52rem 0.76rem;
  border-radius: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: none;
}

.plant-action-primary {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 86%, #5d90ff),
    color-mix(in srgb, var(--accent) 92%, #315dbf)
  );
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  color: #f7fbff;
}

.plant-action-secondary {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(163, 177, 198, 0.16);
  color: rgba(237, 242, 248, 0.94);
}

.plant-action-danger {
  background: linear-gradient(180deg, rgba(127, 40, 62, 0.72), rgba(108, 33, 52, 0.72));
  border-color: rgba(255, 111, 134, 0.26);
  color: #ffd3da;
}

.plant-action-btn:hover:not(:disabled) {
  box-shadow: 0 12px 24px rgba(6, 12, 20, 0.18);
}

.plant-action-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

.plant-action-danger:hover:not(:disabled) {
  box-shadow: 0 12px 24px rgba(111, 28, 47, 0.2);
}

.danger-btn {
  background: linear-gradient(120deg, rgba(122, 32, 52, 0.72), rgba(164, 49, 72, 0.72));
  border-color: rgba(255, 111, 134, 0.4);
  color: #ffc8d1;
  box-shadow: 0 10px 22px rgba(111, 28, 47, 0.22);
}

.danger-btn:hover:not(:disabled) {
  box-shadow: 0 14px 28px rgba(111, 28, 47, 0.28);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.devices-box {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 0.58rem 0.38rem;
  font-size: 0.84rem;
  vertical-align: top;
}

th {
  text-align: center;
  vertical-align: middle;
  color: var(--text-soft);
  font-weight: 600;
}

.table-head-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
}

.table-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: color-mix(in srgb, var(--brand-primary) 72%, var(--text-main));
}

.table-head-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notify-group-head,
.notify-col-head,
.notify-col-cell {
  text-align: center;
}

.notify-group-head {
  letter-spacing: 0.04em;
}

.notify-col-head,
.notify-col-cell {
  width: 58px;
  padding-left: 0.18rem;
  padding-right: 0.18rem;
}

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

.device-ip-stack {
  display: grid;
  gap: 0.16rem;
}

.device-ip-value {
  font-weight: 600;
}

.device-name-with-icon .inline-icon-shell {
  color: var(--brand-primary);
}

.device-name-highlight {
  font-size: 0.98rem;
}

.device-type-shell {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.device-type-shell-ip_camera {
  color: #ff9aac;
  background: rgba(255, 136, 154, 0.12);
  border-color: rgba(255, 136, 154, 0.24);
}

.device-type-shell-cpe {
  color: #9bd3ff;
  background: rgba(134, 188, 255, 0.12);
  border-color: rgba(134, 188, 255, 0.22);
}

.device-type-shell-switch {
  color: #78e4d1;
  background: rgba(107, 214, 189, 0.12);
  border-color: rgba(107, 214, 189, 0.22);
}

.device-type-shell-nvr {
  color: #ffd27d;
  background: rgba(252, 192, 108, 0.12);
  border-color: rgba(252, 192, 108, 0.22);
}

.device-type-shell-router {
  color: #9fb4ff;
  background: rgba(103, 138, 255, 0.12);
  border-color: rgba(103, 138, 255, 0.22);
}

.device-type-shell-controller {
  color: #cfb1ff;
  background: rgba(178, 143, 255, 0.12);
  border-color: rgba(178, 143, 255, 0.22);
}

.device-type-shell-nas {
  color: #9fddff;
  background: rgba(126, 204, 255, 0.12);
  border-color: rgba(126, 204, 255, 0.22);
}

.device-type-shell-server {
  color: #9fe8c8;
  background: rgba(124, 224, 184, 0.12);
  border-color: rgba(124, 224, 184, 0.22);
}

.device-type-shell-altro {
  color: #c7d3e3;
  background: rgba(168, 181, 199, 0.1);
  border-color: rgba(168, 181, 199, 0.2);
}

.section-heading-line {
  max-width: 100%;
}

.section-heading-line .inline-icon-shell {
  color: var(--brand-primary);
}

.section-heading-subnet .inline-icon-shell {
  color: var(--text-soft);
}

.section-heading-divider {
  color: var(--text-soft);
  margin: 0 0.32rem;
}

#network-map-btn .action-icon,
#reload-btn .action-icon {
  width: 22px;
  height: 22px;
}

#network-map-btn .action-icon svg {
  width: 16px;
  height: 16px;
}

.device-status-stack {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
}

.device-correlation-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.28rem;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 600;
}

.device-correlation-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-correlation-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.device-correlation-pill.is-root {
  color: #ffd9de;
  background: rgba(211, 76, 104, 0.16);
  border-color: rgba(211, 76, 104, 0.28);
}

.device-correlation-pill.is-impacted {
  color: #dfe9ff;
  background: rgba(103, 138, 255, 0.14);
  border-color: rgba(103, 138, 255, 0.26);
}

.device-correlation-pill.is-cluster {
  color: #def7ff;
  background: rgba(88, 171, 209, 0.14);
  border-color: rgba(88, 171, 209, 0.26);
}

.table-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.table-toggle input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.36rem;
  min-width: 72px;
  padding: 0.25rem 0.62rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-icon i {
  width: 14px;
  height: 14px;
}

.badge-up {
  color: var(--ok);
  border-color: rgba(48, 208, 178, 0.32);
  background: rgba(48, 208, 178, 0.09);
}

.badge-down {
  color: var(--ko);
  border-color: rgba(255, 111, 134, 0.32);
  background: rgba(255, 111, 134, 0.09);
}

.channel-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
}

.web-link-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    background 0.18s ease;
}

.web-link-btn.is-ready {
  color: #edf5ff;
  border-color: rgba(108, 154, 212, 0.3);
  background: linear-gradient(120deg, rgba(49, 105, 172, 0.86), rgba(91, 146, 210, 0.86));
}

.web-link-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: rgba(151, 163, 182, 0.8);
  border-color: rgba(151, 163, 182, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

.web-link-btn.is-ready:hover {
  transform: translateY(-1px);
  color: #edf5ff;
  border-color: rgba(108, 154, 212, 0.3);
  background: linear-gradient(120deg, rgba(49, 105, 172, 0.9), rgba(91, 146, 210, 0.9));
}

.channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.channel-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-bulk-group {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.26rem 0.45rem 0.26rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.notification-bulk-label {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.notification-bulk-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.channel-btn.active {
  color: #edf5ff;
  border-color: rgba(108, 154, 212, 0.3);
  box-shadow: 0 0 0 1px rgba(108, 154, 212, 0.16) inset;
}

.channel-btn.channel-mail.active,
.channel-btn[data-action="toggle-mail"].active {
  background: linear-gradient(120deg, rgba(66, 109, 178, 0.86), rgba(107, 149, 214, 0.86));
}

.channel-btn.channel-telegram.active,
.channel-btn[data-action="toggle-telegram"].active {
  background: linear-gradient(120deg, rgba(52, 133, 166, 0.86), rgba(93, 171, 201, 0.86));
}

.discovery-head,
.script-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.script-copy-btn {
  align-self: center;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
  gap: 0.46rem;
}

.script-copy-btn .action-icon {
  width: 15px;
  height: 15px;
}

.script-copy-btn .action-icon svg {
  width: 10px;
  height: 10px;
}

.compact-btn {
  width: auto;
  min-width: 0;
  padding: 0.62rem 0.8rem;
}

.nav-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.78rem;
  padding: 0.42rem 0.58rem;
  white-space: nowrap;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.action-icon {
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: currentColor;
  flex: 0 0 auto;
  font-size: 0.72rem;
  line-height: 1;
}

.action-icon svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-icon-user svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-nav-btn {
  min-width: 0;
}

.icon-only-btn {
  width: 42px;
  min-width: 42px;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.profile-summary-card {
  gap: 0.9rem;
}

.password-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.password-fields {
  display: grid;
  gap: 0.75rem;
}

.password-actions {
  display: grid;
  gap: 0.65rem;
  align-content: center;
  min-width: 180px;
}

.password-actions .compact-btn,
.password-actions button {
  width: 100%;
}

.users-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1rem;
}

.users-section-list,
.users-section-editor {
  align-content: start;
}

.users-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.2rem;
}

.users-email-hint {
  margin-top: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(74, 130, 198, 0.18);
  background: rgba(74, 130, 198, 0.08);
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

.users-email-hint strong {
  color: var(--text-main);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.75rem;
}

.profile-item {
  display: grid;
  gap: 0.12rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.profile-label {
  color: var(--text-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.users-table th,
.users-table td {
  text-align: left;
  vertical-align: middle;
}

.users-table td:last-child,
.users-table th:last-child {
  text-align: right;
}

.user-row-actions {
  display: inline-flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
}

.pill-role {
  color: #cfe4ff;
  background: rgba(74, 130, 198, 0.16);
  border-color: rgba(74, 130, 198, 0.26);
}

.pill-status-on {
  color: #b9f0d7;
  background: rgba(43, 182, 115, 0.14);
  border-color: rgba(43, 182, 115, 0.24);
}

.pill-status-off {
  color: #ffc6cf;
  background: rgba(211, 76, 104, 0.14);
  border-color: rgba(211, 76, 104, 0.24);
}

.pill-alarm-open {
  color: #ffd8de;
  background: rgba(211, 76, 104, 0.18);
  border-color: rgba(211, 76, 104, 0.3);
}

.pill-alarm-ack {
  color: #ffe7bb;
  background: rgba(191, 133, 34, 0.18);
  border-color: rgba(191, 133, 34, 0.3);
}

.alarm-note {
  max-width: 320px;
  padding: 0.52rem 0.62rem;
  border-radius: 10px;
  border: 1px solid rgba(191, 133, 34, 0.24);
  background: rgba(191, 133, 34, 0.1);
  color: var(--text-main);
  font-size: 0.8rem;
  line-height: 1.45;
}

.alarm-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.form-error {
  margin: 0;
  padding: 0.72rem 0.82rem;
  border-radius: 12px;
  color: #ffd5dc;
  border: 1px solid rgba(211, 76, 104, 0.32);
  background: rgba(211, 76, 104, 0.14);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(7, 12, 20, 0.58);
  backdrop-filter: blur(10px);
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  width: min(560px, calc(100vw - 2rem));
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  box-shadow: 0 26px 60px rgba(6, 12, 20, 0.3);
}

.auth-brand {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
  text-align: center;
}

.auth-brand-logo {
  display: block;
  width: min(100%, 420px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(6, 12, 20, 0.22));
}

.auth-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  text-align: center;
}

.hero-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: start;
}

.discovery-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 14, 24, 0.54);
  backdrop-filter: blur(6px);
}

.discovery-overlay.hidden {
  display: none;
}

.discovery-loader {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 1.05rem 1.2rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: rgba(10, 22, 34, 0.86);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

.signal {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-primary) 82%, #ffffff);
  opacity: 0.25;
  animation: networkPulse 1.2s infinite ease-in-out;
}

.signal-b {
  animation-delay: 0.16s;
}

.signal-c {
  animation-delay: 0.32s;
}

body.is-discovering #discover-btn {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent) inset, 0 0 28px color-mix(in srgb, var(--accent) 28%, transparent);
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--text-soft);
}

.empty-state-positive {
  display: grid;
  gap: 0.3rem;
  min-height: 220px;
  place-items: center;
  text-align: center;
  border-style: solid;
  background: var(--positive-bg);
}

.empty-state-positive strong {
  font-size: 1.35rem;
  color: var(--positive-text);
}

.empty-state-positive p {
  margin: 0;
}

.device-dialog {
  width: min(680px, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0;
  color: var(--text-main);
  background: var(--bg-panel);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.34);
}

.device-dialog.network-map-dialog {
  width: min(calc(100vw - 0.5rem), 1910px);
  max-width: calc(100vw - 0.5rem);
  height: min(calc(100vh - 0.5rem), 980px);
  max-height: calc(100vh - 0.5rem);
}

.device-dialog::backdrop {
  background: rgba(5, 14, 24, 0.7);
  backdrop-filter: blur(6px);
}

.device-dialog form {
  padding: 1rem;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

:root.light-mode .topbar-badge {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--brand-primary);
}

:root.light-mode .topbar-title,
:root.light-mode .brand-text h1 {
  color: var(--brand-primary);
}

:root.light-mode .brand-text p {
  color: var(--brand-secondary);
}

:root.light-mode .sidebar-shortcut-btn,
:root.light-mode .nav-home-btn,
:root.light-mode .plant-item,
:root.light-mode .notification-bulk-group,
:root.light-mode .toggle-card,
:root.light-mode .settings-section,
:root.light-mode .topbar-stat,
:root.light-mode .dashboard-search,
:root.light-mode .topbar-search,
:root.light-mode .secondary-btn {
  background: var(--chip-bg);
  border-color: var(--chip-border);
}

:root.light-mode .hero-action-card {
  background: var(--hero-card-bg);
  border-color: var(--chip-border);
}

:root.light-mode .nav-home-btn {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

:root.light-mode button:not(.secondary-btn):not(.danger-btn):not(.channel-btn):not(.web-link-btn):not(.device-type-filter-btn) {
  color: #ffffff;
  border-color: rgba(74, 127, 179, 0.24);
  background: linear-gradient(120deg, #4f7db0, #78a7d6);
  box-shadow: 0 12px 26px rgba(67, 118, 166, 0.18);
}

:root.light-mode button:not(.secondary-btn):not(.danger-btn):not(.channel-btn):not(.web-link-btn):not(.device-type-filter-btn):hover:not(:disabled) {
  box-shadow: 0 16px 30px rgba(67, 118, 166, 0.22);
  background: linear-gradient(120deg, #4877aa, #709fce);
}

:root.light-mode .settings-section {
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.98), rgba(237, 244, 248, 0.98));
  border-color: rgba(31, 85, 121, 0.14);
  box-shadow: 0 10px 28px rgba(31, 55, 77, 0.05);
}

:root.light-mode .settings-inline-note {
  background: rgba(74, 130, 198, 0.08);
  border-color: rgba(31, 85, 121, 0.14);
}

:root.light-mode .field-help code {
  background: rgba(31, 85, 121, 0.08);
}

:root.light-mode .network-visibility-block {
  border-top-color: rgba(31, 85, 121, 0.12);
}

:root.light-mode .network-visibility-empty {
  background: rgba(242, 246, 248, 0.88);
  border-color: rgba(31, 85, 121, 0.16);
}

:root.light-mode .settings-section-title {
  color: #0f5fb0;
}

:root.light-mode .settings-section label {
  color: #35556c;
}

:root.light-mode .settings-section .toggle-card span,
:root.light-mode .settings-section .field-title {
  color: var(--text-soft);
}

:root.light-mode .profile-item {
  background: linear-gradient(180deg, rgba(244, 247, 249, 0.98), rgba(236, 242, 246, 0.98));
  border-color: rgba(31, 85, 121, 0.12);
}

:root.light-mode .users-email-hint {
  background: rgba(74, 130, 198, 0.08);
  border-color: rgba(74, 130, 198, 0.14);
}

:root.light-mode .pill-role {
  color: #355f86;
  background: rgba(74, 130, 198, 0.12);
  border-color: rgba(74, 130, 198, 0.18);
}

:root.light-mode .pill-status-on {
  color: #117148;
  background: rgba(43, 182, 115, 0.12);
  border-color: rgba(43, 182, 115, 0.2);
}

:root.light-mode .pill-status-off {
  color: #9e2940;
  background: rgba(211, 76, 104, 0.12);
  border-color: rgba(211, 76, 104, 0.2);
}

:root.light-mode .form-error {
  color: #9f3047;
  background: rgba(255, 239, 242, 0.96);
  border-color: rgba(211, 76, 104, 0.2);
}

:root.light-mode .auth-overlay {
  background: rgba(217, 231, 239, 0.54);
}

:root.light-mode .table-head-icon {
  color: #4576a6;
}

:root.light-mode .web-link-btn {
  background: rgba(242, 246, 248, 0.92);
  border-color: rgba(31, 85, 121, 0.16);
  color: #2a5f8c;
}

:root.light-mode .channel-btn {
  background: rgba(242, 246, 248, 0.92);
  border-color: rgba(31, 85, 121, 0.16);
  color: #2a5f8c;
}

:root.light-mode .secondary-btn {
  color: #244761;
  background: linear-gradient(180deg, rgba(244, 247, 249, 0.98), rgba(236, 242, 246, 0.96));
  border-color: rgba(31, 85, 121, 0.18);
  box-shadow: none;
}

:root.light-mode .plant-action-primary {
  background: linear-gradient(180deg, #4f88da, #3b72c3);
  border-color: rgba(48, 102, 177, 0.22);
  color: #ffffff;
}

:root.light-mode .plant-action-secondary {
  background: linear-gradient(180deg, rgba(244, 247, 249, 0.98), rgba(236, 242, 246, 0.96));
  border-color: rgba(31, 85, 121, 0.16);
  color: #294d69;
}

:root.light-mode .plant-action-danger {
  background: linear-gradient(180deg, rgba(196, 67, 93, 0.92), rgba(175, 57, 82, 0.92));
  border-color: rgba(184, 57, 81, 0.26);
  color: #fff7f8;
}

:root.light-mode .plant-action-secondary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(246, 249, 250, 0.99), rgba(233, 240, 244, 0.98));
}

:root.light-mode .secondary-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(245, 248, 250, 0.98), rgba(231, 239, 244, 0.98));
  box-shadow: 0 10px 22px rgba(31, 55, 77, 0.08);
}

:root.light-mode .web-link-btn.is-ready {
  color: #ffffff;
  border-color: rgba(67, 118, 166, 0.24);
  background: linear-gradient(120deg, #4a7fb3, #77a8d9);
}

:root.light-mode .web-link-btn:disabled {
  color: rgba(88, 112, 130, 0.7);
  border-color: rgba(88, 112, 130, 0.16);
  background: rgba(238, 244, 248, 0.92);
}

:root.light-mode .channel-btn.active {
  color: #ffffff;
  border-color: rgba(67, 118, 166, 0.24);
  box-shadow: 0 0 0 1px rgba(67, 118, 166, 0.12) inset;
}

:root.light-mode .channel-btn.channel-mail.active,
:root.light-mode .channel-btn[data-action="toggle-mail"].active {
  background: linear-gradient(120deg, #537fb2, #81a8d6);
}

:root.light-mode .channel-btn.channel-telegram.active,
:root.light-mode .channel-btn[data-action="toggle-telegram"].active {
  background: linear-gradient(120deg, #4b8ca8, #78b6ca);
}

:root.light-mode .danger-btn {
  color: #ffffff;
  border-color: rgba(184, 57, 81, 0.34);
  background: linear-gradient(120deg, #c4435d, #e56b82);
  box-shadow: 0 12px 26px rgba(164, 49, 72, 0.18);
}

:root.light-mode .danger-btn:hover:not(:disabled) {
  background: linear-gradient(120deg, #bc3954, #de6079);
  box-shadow: 0 16px 30px rgba(164, 49, 72, 0.22);
}

:root.light-mode .plant-item.active {
  background: linear-gradient(180deg, rgba(20, 128, 229, 0.16), rgba(243, 247, 249, 0.98));
  border-color: rgba(20, 128, 229, 0.24);
}

:root.light-mode input,
:root.light-mode select,
:root.light-mode textarea {
  background: #f3f6f8;
  color: var(--text-main);
  border-color: rgba(31, 85, 121, 0.18);
}

:root.light-mode .action-icon,
:root.light-mode .field-icon {
  background: rgba(20, 128, 229, 0.1);
  color: #0f5fb0;
}

:root.light-mode .empty-state-positive {
  background: var(--positive-bg);
}

:root.light-mode .empty-state-positive strong {
  color: var(--positive-text);
}

:root.light-mode .offline-item {
  background: linear-gradient(180deg, rgba(250, 236, 240, 0.95), rgba(244, 247, 249, 0.98));
  border-color: rgba(201, 76, 108, 0.18);
}

:root.light-mode .offline-legend {
  background: rgba(241, 245, 248, 0.92);
  border-color: rgba(31, 85, 121, 0.14);
}

:root.light-mode .device-type-filter-btn,
:root.light-mode .network-summary-chip,
:root.light-mode .device-type-badge {
  background: rgba(242, 246, 248, 0.92);
  border-color: rgba(31, 85, 121, 0.14);
  color: var(--text-main);
}

:root.light-mode .device-type-filter-btn {
  color: #34566f;
}

:root.light-mode .device-type-filter-btn.active {
  color: #ffffff;
  border-color: rgba(67, 118, 166, 0.24);
  background: linear-gradient(120deg, #4f7db0, #78a7d6);
}

:root.light-mode .table-action-icon-btn {
  background: rgba(242, 246, 248, 0.92);
  border-color: rgba(31, 85, 121, 0.14);
  color: var(--text-main);
}

:root.light-mode .table-action-icon-btn-danger {
  background: rgba(183, 57, 87, 0.1);
  border-color: rgba(183, 57, 87, 0.22);
  color: #a33a52;
}

:root.light-mode .network-map-station-maintenance-alert.has-open-items {
  background: linear-gradient(180deg, rgba(255, 242, 216, 0.96), rgba(255, 235, 196, 0.94));
  border-color: rgba(201, 145, 33, 0.24);
  color: #966313;
}

@keyframes networkPulse {
  0%,
  100% {
    opacity: 0.22;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes heartbeatLine {
  0%,
  18% {
    stroke-dashoffset: 280;
    opacity: 0.25;
  }
  28%,
  58% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -280;
    opacity: 0.2;
  }
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .topbar,
  .topbar-stats,
  .stats-grid,
  .cards-grid,
  .cards-grid-2,
  .settings-layout,
  .settings-guide-grid,
  .settings-guide-footer,
  .settings-ops-grid,
  .settings-split,
  .compact-form-grid,
  .network-layout {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .content {
    padding: 0.85rem;
  }

  .appearance-preview-stats,
  .appearance-color-shell,
  .appearance-font-size-shell {
    grid-template-columns: 1fr;
  }

  .appearance-preview-head {
    flex-direction: column;
    align-items: stretch;
  }

  .appearance-color-input {
    width: 100%;
  }

  .sidebar {
    padding: 0.8rem 0.75rem;
  }

  .hero-panel,
  .section-head,
  .details-head,
  .topbar,
  .discovery-head,
  .script-panel-head,
  .hero-actions,
  .details-actions,
  .form-actions,
  .table-actions,
  .offline-item {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-block {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .plant-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .plant-item-shell {
    grid-template-columns: 1fr;
  }

  .plant-item {
    padding-bottom: 0.38rem;
  }

  .plant-map-btn {
    width: 22px;
    min-width: 22px;
    height: 22px;
  }

  .plant-item-meta-row {
    padding: 0 0.78rem 0.66rem;
  }

  .plant-item-status {
    justify-content: flex-start;
  }

  .topbar-stat-label {
    white-space: normal;
  }

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

  .maintenance-dashboard-stats {
    grid-template-columns: 1fr;
  }

  .hero-chart-card {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions-cards {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .hero-panel {
    align-items: stretch;
  }

  .plant-actions-row .plant-action-btn,
  .topbar-actions .nav-action-btn {
    width: 100%;
    justify-content: center;
  }

  .details-actions,
  .topbar-actions {
    width: 100%;
  }

  .network-live-summary,
  .network-summary-chip {
    width: 100%;
  }

  .network-device-type-select-wrap {
    width: 100%;
  }

  .network-device-type-select-wrap.is-inline {
    flex-basis: 100%;
  }

  .network-sticky-head {
    position: static;
    padding-bottom: 0;
    margin-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .devices-table-shell {
    max-height: none;
    overflow: visible;
  }

  .devices-column,
  .users-section-list {
    overflow-x: visible;
  }

  .station-editor-head,
  .station-card-head,
  .network-map-layout,
  .network-map-station-devices-head,
  .network-map-device-head,
  .network-map-device-meta,
  .station-maintenance-head,
  .station-maintenance-item-head,
  .station-maintenance-item-meta,
  .station-maintenance-actions,
  .station-accordion-head-actions,
  .station-maintenance-dialog-layout,
  .station-maintenance-dialog-meta,
  .station-maintenance-dialog-actions,
  .device-status-history-dialog-actions,
  .maintenance-dashboard-list-head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .station-editor-actions {
    width: 100%;
  }

  .station-editor-actions .compact-btn {
    width: 100%;
    justify-content: center;
  }

  .network-map-dialog {
    --network-map-sidebar-width: 100%;
    --network-map-canvas-width: 100%;
    --network-map-canvas-height: 100%;
    width: min(100vw - 1rem, 1080px);
    height: min(calc(100vh - 1rem), 920px);
    padding: 0.9rem;
  }

  .device-dialog.network-map-dialog {
    width: min(100vw - 1rem, 1080px);
    max-width: calc(100vw - 1rem);
    height: min(calc(100vh - 1rem), 920px);
    max-height: calc(100vh - 1rem);
  }

  .device-dialog.station-maintenance-dialog {
    width: min(100vw - 1rem, 1080px);
    max-width: calc(100vw - 1rem);
    height: min(calc(100vh - 1rem), 920px);
    max-height: calc(100vh - 1rem);
  }

  .device-dialog.device-status-history-dialog {
    width: min(100vw - 1rem, 1080px);
    max-width: calc(100vw - 1rem);
    height: min(calc(100vh - 1rem), 920px);
    max-height: calc(100vh - 1rem);
  }

  .station-maintenance-dialog {
    padding: 0.9rem;
  }

  .device-status-history-dialog {
    padding: 0.9rem;
  }

  .station-maintenance-dialog .dialog-head {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding: 0.12rem 0.12rem 0.04rem;
  }

  .device-status-history-dialog .dialog-head {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding: 0.12rem 0.12rem 0.04rem;
  }

  .station-maintenance-dialog-body {
    margin-top: 0.85rem;
    height: calc(100% - 5.6rem);
    padding: 0;
  }

  .device-status-history-dialog-body {
    margin-top: 0.85rem;
    height: calc(100% - 5.6rem);
    padding: 0;
  }

  .station-maintenance-table {
    min-width: 680px;
  }

  .network-map-stage {
    order: -1;
  }

  .network-map-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .network-map-canvas {
    min-height: 0;
  }

  .scroll-top-btn {
    right: 1rem;
    bottom: 1rem;
    width: 48px;
    height: 48px;
  }

  .devices-column table,
  .users-table {
    min-width: 0;
    width: 100%;
  }

  .devices-column thead,
  .users-table thead {
    display: none;
  }

  .devices-column table,
  .devices-column tbody,
  .users-table,
  .users-table tbody {
    display: block;
  }

  .devices-column tr,
  .users-table tr {
    display: grid;
    gap: 0.6rem;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--chip-bg);
  }

  .devices-column td,
  .users-table td {
    display: grid;
    gap: 0.28rem;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .devices-column td::before,
  .users-table td::before {
    content: attr(data-label);
    color: var(--text-soft);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .devices-column .notify-col-cell,
  .devices-column td[data-label="Web"] {
    justify-items: start;
  }

  .devices-column tr.device-main-row {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .devices-column tr.device-timeline-row {
    margin-top: -0.2rem;
    padding-top: 0.25rem;
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  .devices-column .device-timeline-spacer {
    display: none;
  }

  .devices-column .device-timeline-cell::before {
    display: none;
  }

  .devices-column .table-actions,
  .users-table .user-row-actions {
    justify-content: flex-start;
  }

  .device-status-history-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem;
  }

  .device-status-history-item-time {
    padding-top: 0;
    font-size: 1rem;
  }

  .history-block {
    width: 100%;
  }

  .offline-meta {
    text-align: left;
    justify-items: start;
  }

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

  .settings-time-box {
    grid-template-columns: 1fr;
  }

  .users-admin-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

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

  .password-actions {
    min-width: 0;
  }

}
